'read only zero from ioremap register on STM32MP157
I want to access an register , it's phy address is 0x50002000, in the driver init function, I can read out the value:
gpioa = ioremap(0x50002000, 4);
printk("ioremap(0x50002000) = 0x%x\n", gpioa);
for (i = 0; i < 10; i++)
printk("gpioa_mode = 0x%x\n", *gpioa);
But in the read function of file_operations, the value is always zero:
static ssize_t led_drv_read (struct file *file, char __user *buf, size_t size, loff_t *offset)
{
printk("gpioa_mode(0x%x) = 0x%x\n", gpioa, ioread32(gpioa));
return 0;
}
With devmem, it is zero too:
# devmem 0x50002000 32
0x00000000
Why ? Thank you.
I want to use ioremap to debug my driver, but it can not work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
