IMX6UL kernel hang when trying to read GPIO5 register

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

IMX6UL kernel hang when trying to read GPIO5 register

1,156 次查看
zc_tee
Contributor III

Hi all,

I am trying to read the GPIO5 register during the startup of the mxsfb_probe.

I had define the GPIO5 base address to 0x020AC000, as in the datasheet, as below:

#define MX6Q_GPIO5_BASE_ADDR     0x020AC000

And my coding on accessing the register as below:

u32 glp05;

void __iomem *gpio5_base = (void __iomem *)IMX_IO_P2V(MX6Q_GPIO5_BASE_ADDR);

glp05 = readl_relaxed(gpio5_base);

printk(KERN_INFO "gpio value is 0x%x\n", gpl05);

When the kernel runs until this line of code, it hangs. I tried to check for similiar readl_relaxed coding, and found out that in cpuidle_imx6ul.c, there are some readl_relaxed on MX6Q_ANATOP_BASE_ADDR, and the kernel had no problem running it.

May i know is there something that i missed out, or there is something that i need to add so that i can access the GPIO5 register directly?

Thank you.

Regards,

Tee

标签 (2)
0 项奖励
回复
3 回复数

933 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Tee

seems one can look at __raw_writel usage in ../fbdev/mxc/mxc_epdc_fb.c

linux-2.6-imx.git - Freescale i.MX Linux Tree

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

933 次查看
zc_tee
Contributor III

Hi Igor,

Thanks for replying.

The usage of __raw_writel and __raw_readl in the ../fbdev/mxc/mxc_epdc_fb.c is accessing the register within the device. I see that it gets the address throught devm_request_and_ioremap(&pdev->dev,res), where pdev is the fb device itself.

Let's say i need to access to a GPIO raw register in this driver, what variable shall i pass in the devm_request_and_ioremap function call? There is not a pdev that points to the GPIO.

Thank you.

Regards,

Tee

0 项奖励
回复

933 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Tee

as this is specific kernel question one can post it

on kernel.org mail list.

Best regards

igor

0 项奖励
回复