ARM, MMU and IO space mapping

Sascha Hauer s.hauer at pengutronix.de
Thu Dec 1 09:26:36 EST 2011


On Wed, Nov 30, 2011 at 11:06:13PM +0100, Robert Jarzmik wrote:
> Sascha Hauer <s.hauer at pengutronix.de> writes:
> 
> > We use high vectors at 0xfff00000, so there won't be vectors at 0x0. the
> > 0x0 mapping is only used to catch NULL pointer derefs.
> 
> > That said, being able to catch NULL pointers is a very good thing,
> > especially when there is flash at 0x0 which might be accidently
> > overwritten by some code acting on NULL pointers.
> I don't know if it can be that easily overwritten, but catching NPE is always
> good, it's true.
> 
> > With MMU we could just remap the flash in board code and pass the
> > remapped address as resource to the cfi driver. While I think the
> > cleanest solution would be to use ioremap in all drivers (and make
> > this a no-op on most boards) I don't think it's worth it at the moment.
> OK, remap in board, and input virtual mapping address into io ressource, simple
> enough. OK, I'll try that.
> That would require a function in arch/arm/cpu/mmu.c, to remap a physical address
> range into a virtual one, wouldn't it ? Would you have a suggestion for the API
> ? As in map_io_section(u32 phys_addr, void *virt) ?

How about adding a size parameter ;)

Yes, this looks good enough for now.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list