NOR memory driver fail with MMU enabled

Sascha Hauer s.hauer at pengutronix.de
Wed Feb 6 07:11:34 EST 2013


On Wed, Feb 06, 2013 at 03:01:38PM +0400, Alexander Shiyan wrote:
> Hello.
> 
> I have a problem with NOR flash when enabling MMU.
> Probably this happen due NOR start address is 0x0.
> Should we a remap memory addresses same as we do it for kernel? 
> Or can someone tell what could be the problem?

This is because the zero page is set to faulting so that you can
catch NULL pointer exceptions. You could disable this (see
vectors_init), but then you can't catch NULL pointer exceptions
anymore. So the best you can do is use map_io_sections and map
your flash to some free region, maybe like this:

map_io_sections(0x0, (void *)SZ_1M, SZ_32M);

Then register your flash flash with address 1M instead of 0x0.

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