IMX6UL kernel hang when trying to read GPIO5 register

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

IMX6UL kernel hang when trying to read GPIO5 register

808 Views
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

Labels (2)
0 Kudos
3 Replies

585 Views
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 Kudos

585 Views
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 Kudos

585 Views
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 Kudos