Mapping physical address to virtual page address Issue.


I am using beagle bone black and writing i2c driver just for learning.
I used am335x TRM and i2c1 at address 0x4802a000 as mentioned in TRM.

I did the following :

void * addr = ioremap(phy_addr, length);
unsigned x = readl(addr);

Where phy_addr is the physical address (0x4802a000) mentioned in TRM.
And length is the end address - start address (0x4802afff - 0x4802a000)

Now on ‘read’ it crashes and gives me the following error when checked in dmesg :
Unhandled fault: external abort on non-linefetch.

Need help on this.


Check out ""

The OS can place memory blocks anywhere and keeps track of the mapping.
You need to use mmap to translate an address from the TRM to /dev/mem.

Hope this helps.