一直以来,公司的产品HI3516CV300+323模组每次贴片几十K总是有1%的模组无法启动,其中无法启动的模组大部分都卡死在了kernel启动过程,连接了debug串口之后,发现最后的打印为
ohci-platform 10110000.ohci: new USB bus registered, assigned bus number 2
打算从这里入手
查看了上面类似的打印:
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-platform: EHCI generic platform driver
ehci-platform 10120000.ehci: EHCI Host Controller
ehci-platform 10120000.ehci: new USB bus registered, assigned bus number 1
ehci-platform 10120000.ehci: irq 31, io mem 0x10120000
ehci-platform 10120000.ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-platform: OHCI generic platform driver
ohci-platform 10110000.ohci: Generic Platform OHCI controller
ohci-platform 10110000.ohci: new USB bus registered, assigned bus number 2
发现疑似USB枚举USB1.1的设备时导致卡死,当然也有可能是申请中断号出了问题,但是任务紧急,先尝试关闭USB1.1支持
make ARCH=arm CROSS_COMPILE=arm-hisiv500-linux- menuconfig
在 Device Drivers → USB support下找到OHCI HCD (USB 1.1) support,将其关闭
重新编译kernel
make ARCH=arm CROSS_COMPILE=arm-hisiv500-linux- uImage -j 20
烧写后发现,还是不行,打印为
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-platform: EHCI generic platform driver
ehci-platform 10120000.ehci: EHCI Host Controller
ehci-platform 10120000.ehci: new USB bus registered, assigned bus number 1
ehci-platform 10120000.ehci: irq 31, io mem 0x10120000
ehci-platform 10120000.ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-platform: OHCI generic platform driver
ohci-platform 10110000.ohci: Generic Platform OHCI controller
ohci-platform 10110000.ohci: new USB bus registered, assigned bus number 2
嗯,还是会卡死在这个打印里面。。。。
将上述的修改撤回。继续改其他的,
vi drivers/usb/core/Kconfig
将
config USB_OTG_BLACKLIST_HUB
bool "Disable external hubs"
depends on USB_OTG || EXPERT
help
If you say Y here, then Linux will refuse to enumerate
external hubs. OTG hosts are allowed to reduce hardware
and software costs by not supporting external hubs. So
are "Embedded Hosts" that don't offer OTG support.
增加一个default y,改为
config USB_OTG_BLACKLIST_HUB
bool "Disable external hubs"
depends on USB_OTG || EXPERT
default y
help
If you say Y here, then Linux will refuse to enumerate
external hubs. OTG hosts are allowed to reduce hardware
and software costs by not supporting external hubs. So
are "Embedded Hosts" that don't offer OTG support.
这个是为了关闭对USB HUB设备的枚举,反正模组的用途不考虑增加USB HUB,将其关闭试试看。
再次编译和烧写。
启动正常
打印只剩下这些
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-platform: EHCI generic platform driver
ehci-platform 10120000.ehci: EHCI Host Controller
ehci-platform 10120000.ehci: new USB bus registered, assigned bus number 1
ehci-platform 10120000.ehci: irq 31, io mem 0x10120000
ehci-platform 10120000.ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
就这样先吧,让工厂烧写后出货,后面USB接口就不能使用USB HUB连接设备了。但是也拯救了这1%的模组,效益还是可以的。
为啥会出现这些问题,我后面有空再细查其原因。