imx6 kernel crash when access usb register

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx6 kernel crash when access usb register

跳至解决方案
1,567 次查看
mostion
Contributor II

Hi all,

   there is a strange issue about my imx6 platform. the kernel version is 3.10.7. we use one usb otg port and one usb host port, and the OTG VBUS is external 5V. I just want to know, which conditions will cause the kernel can't access the USB register, I mean, if we want to access these register by some system functions like ioremap/mmap, and when we read/write the pointer of these functions returns, the kernel will crash, and no more message print. it just like the CPU strike suddenly.

Thanks.

1 解答
1,195 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Mostion

please check that usb clocks are enabled in CCM_CCGRx registers,

for example in i.MX6Q (address may be different on other i.MX6 processors)

this is CCM_CCGR6, described in sect.18.6.29 CCM Clock Gating Register

6 (CCM_CCGR6) i.MX6DQ Reference Manual

http://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf

In linux usb is configured with settings described in sect.39.3.3 Menu Configuration Options

attached Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

3 回复数
1,196 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Mostion

please check that usb clocks are enabled in CCM_CCGRx registers,

for example in i.MX6Q (address may be different on other i.MX6 processors)

this is CCM_CCGR6, described in sect.18.6.29 CCM Clock Gating Register

6 (CCM_CCGR6) i.MX6DQ Reference Manual

http://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf

In linux usb is configured with settings described in sect.39.3.3 Menu Configuration Options

attached Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,195 次查看
mostion
Contributor II

Hi igor

   I found it. It is disabled when USB controller suspend and enable again when resume, and all the USB controller use same clock. So, it all USB controller is suspend, the USB clock will disable thorough. It is a protection operation in kernel, but in our platform, we need to access USB register in application level all the time, so i annotate the code of USB clock operations in suspend and resume function, it seemed everything is ok.

   Thank you again.

Best regards,

Mostion

0 项奖励
1,195 次查看
mostion
Contributor II

Hi igor,

   Thanks for your suggestion. As you said, the cause is clock of usb disabled. BTW, can you tell me why it happened even though the driver is initialized. in my impression, the clock will open when system initializes, and close if system releases this driver. It would be a issue for your Linux BSP if this happened, because I used original kernel test it before, it same as our new kernel. Thanks very much and looking forward to your reply.

Best Regards,

Mostion

0 项奖励