Linux移植中USB出现的问题

Linux版本:V4.19.78
硬件平台:Tiny6410

问题一:startup error -75

错误日志

ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-s3c2410: OHCI S3C2410 driver
s3c2410-ohci s3c2410-ohci: OHCI Host Controller
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
s3c2410-ohci s3c2410-ohci: init err (00000000 0000)
s3c2410-ohci s3c2410-ohci: can't start
s3c2410-ohci s3c2410-ohci: startup error -75
s3c2410-ohci s3c2410-ohci: USB bus 1 deregistered
s3c2410-ohci: probe of s3c2410-ohci failed with error -75

以上问题,是由于usb host时钟不工作,默认情况USB时钟源是采用48MHz时钟源(该时钟需要外部晶振,以及配置USB OTG模块),这个解决办法是将usb host的时钟源配置为EPLL时钟

问题二:usb 1-1: device descriptor read/64, error -62

错误日志

以下为linux启动过程的报错
usb 1-1: device descriptor read/64, error -62                                     
usb 1-1: device descriptor read/64, error -62                                     
usb 1-1: new full-speed USB device number 3 using s3c2410-ohci                    
usb 1-1: device descriptor read/64, error -62                                     
usb 1-1: device descriptor read/64, error -62 

以下为插入u盘时的报错
usb 1-1: new full-speed USB device ni
usb 1-1: device not accepting address 4, error -62                                
usb 1-1: new full-speed USB device number 5 using s3c2410-ohci                    
usb 1-1: device not accepting address 5, error -62                                
usb usb1-port1: unable to enumerate USB device

以上问题,是因为usb host时钟频率达不到48MHz的要求,从linux启动日志看,EPLL时钟才24M,可以修改EPLL的配置寄存器,将EPLL时钟设置为48M

解决办法

针对以上两种问题,同时不对linux内核进行修改,我在uboot中进行相应的修改
在uboot中的lowlevel_init.S中,修改以下内容

	/* FOUT of EPLL is 48MHz */
	ldr	r1, =0x80200103            /* 配置EPLL输出48M */
	str	r1, [r0, #EPLL_CON0_OFFSET]
	ldr	r1, =0x0
	str	r1, [r0, #EPLL_CON1_OFFSET]

	/* APLL, MPLL, EPLL select to Fout */
	ldr	r1, [r0, #CLK_SRC_OFFSET]
	orr	r1, r1, #0x7
	orr	r1, r1, #0x20              /* 配置USB Host时钟源选择为EPLL输出时钟 */
	str	r1, [r0, #CLK_SRC_OFFSET]

参考资料

https://blog.csdn.net/willand1981/article/details/5360278

你可能感兴趣的:(Linux)