linux kernel get stuck, only if connect the usb device it will work well

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

linux kernel get stuck, only if connect the usb device it will work well

1,853 Views
chengsi
Contributor I

Hi,I am very new to imx7d, we designed a custom board referring to the imx7sabre board, the USB part, both the otg the host , is the same as sabre.
So in our dts file, the configuration of usb otg and usb host is the same as the sabre, and the kernel we use is freescale/linux 4.1-2.0.x-imx. After we burn the u-boot and the kernel into the emmc, we can start the u-boot and the kernel, but then we get very strange result:
1. After the u-boot successfully load the kernel, the kernel can run for a while then it will get stuck with no errors showing.
2. If we connect either a otg device(like a pc) to otg port or a usb storage to host port, the system will work well.

It seems kernel get into a deep sleep mode if there is no usb interuput request, I was thinking it may have some relationship with the low power mode?

Please give me some advice,thinks.

Here is part of our schematic and dts.

dts:

&usbotg1 {
vbus-supply = <&reg_usb_otg1_vbus>;
srp-disable;
hnp-disable;
adp-disable;
disable-over-current;
status = "okay";

};

&usbotg2 {
vbus-supply = <&reg_usb_otg2_vbus>;
disable-over-current;
dr_mode = "host";
status = "okay";
};

reg_usb_otg1_vbus: regulator@0 {
compatible = "regulator-fixed";
reg = <0>;
regulator-name = "usb_otg1_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio1 5 0>;
enable-active-high;
};

reg_usb_otg2_vbus: regulator@1 {
compatible = "regulator-fixed";
reg = <1>;
regulator-name = "usb_otg2_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio1 7 0>;
enable-active-high;
};

Labels (3)
0 Kudos
3 Replies

1,157 Views
chengsi
Contributor I

CarlosCasillas‌ thanks for your answer. I recheck the DTB and the DCD, I think they are right. Let me describe more.

If we connect the usb device to the otg or host port, the linux can work well and i can get the output from the serial port. Then if i disconnect the usb device, after maybe 5 or 6 seconds, the system will get stuck and there is nothing output from the serial port, it is like the kernel suddenly die.

One more, if we do not connect the usb device, the uboot can work very well. 

0 Kudos

1,157 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Cheng,

Have you properly configured a DTB file according with all your hardware? Did you properly calibrated the DDR? Are you considering low power modes? It seems that USB communication is remaining awake the processor, avoiding the stuck.

You could take a look at the following link:

https://community.nxp.com/thread/329129

Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,157 Views
chengsi
Contributor I

we just find a temporary solution. If we turn off CONFIG_CPU_IDLE in your kernel config, the linux can work  withouht usb device connected but it will become not very stable. Do you know why? 

thanks. :smileyhappy:

0 Kudos