[PATCH] ARM: Shutdown barebox (MMU) before setting ATAGS to avoid page #0 fault.

Sascha Hauer s.hauer at pengutronix.de
Fri May 11 15:00:59 EDT 2012


Hi Krzysztof,

On Sat, May 05, 2012 at 11:38:15PM +0200, Krzysztof Halasa wrote:
> This doesn't fix the "md" issue.
> 
> Signed-off-by: Krzysztof Hałasa <khc at pm.waw.pl>
> 
> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
> index a167036..847fefa 100644
> --- a/arch/arm/lib/armlinux.c
> +++ b/arch/arm/lib/armlinux.c
> @@ -260,12 +260,15 @@ void start_linux(void *adr, int swap, unsigned long initrd_address,
>  	if (oftree) {
>  		printf("booting Linux kernel with devicetree\n");
>  		params = oftree;
> -	} else {
> +	}
> +
> +	shutdown_barebox();
> +
> +	if (!oftree) {
>  		setup_tags(initrd_address, initrd_size, swap);
>  		params = armlinux_bootparams;
>  	}

I don't like this very much because I think that shutdown_barebox should
be the last thing before jumping to the kernel. Also it makes starting
of the kernel potentially slower as we execute code with caches
disabled.

BTW I don't understand why the zero page is faulting in your case
anyway. You have SDFAM at 0x0, right? So we have

vectors_init() -> sets zero page to faulting
for_each_memory_bank()
	create_sections(); -> should set the zero page accessible again
                              if we have a SDRAM bank at 0x0

Am I getting something wrong here?

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