Skip to contentSkip to conversation

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

PATCH In review Krzysztof Halasa 2 participants 2 messages May 5, 2012 – May 11, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

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

This doesn't fix the "md" issue.

arch/arm/lib/armlinux.c +5 -2
index a167036..847fefa 100644
@@ -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;
 	}
 
-	shutdown_barebox();
 	if (swap) {
 		u32 reg;
 		__asm__ __volatile__("mrc p15, 0, %0, c1, c0" : "=r" (reg));

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

Hi Krzysztof,

Quoted 11 lines · Krzysztof Halasa

This doesn't fix the "md" issue.

arch/arm/lib/armlinux.c +0 -0
index a167036..847fefa 100644
@@ -260,12 +260,15 @@ void start_linux(void *adr, int swap, unsigned long initrd_address,
 	if (oftree) {
 		printf("booting Linux kernel with devicetree\n");

arch/arm/lib/armlinux.c void start_linux(void *adr, int swap, unsigned long initrd_address, · line 270

Quoted 10 lines
arch/arm/lib/armlinux.c +5 -1
 		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

Signature · 9 lines
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 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox