]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: 6648/1: map ATAGs when not in first 1MB of RAM
authorRob Herring <rob.herring@calxeda.com>
Wed, 2 Feb 2011 15:33:17 +0000 (16:33 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 17 Feb 2011 23:27:33 +0000 (23:27 +0000)
If ATAGs or DTB pointer is not within first 1MB of RAM, then the boot params
will not be mapped early enough, so map the 1MB region that r2 points to. Only
map the first 1MB when r2 is 0.

Some assembly improvements from Nicolas Pitre.

Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/head.S

index a94dd99d54c35bde28689877dbcd09a63c6c3fa8..591a2ead8cef190541539f2b4d37f5c44bb12905 100644 (file)
@@ -206,11 +206,17 @@ __create_page_tables:
 #endif
 
        /*
-        * Then map first 1MB of ram in case it contains our boot params.
+        * Then map boot params address in r2 or
+        * the first 1MB of ram if boot params address is not specified.
         */
-       add     r0, r4, #PAGE_OFFSET >> 18
-       orr     r6, r7, r8
-       str     r6, [r0]
+       mov     r0, r2, lsr #20
+       movs    r0, r0, lsl #20
+       moveq   r0, r8
+       sub     r3, r0, r8
+       add     r3, r3, #PAGE_OFFSET
+       add     r3, r4, r3, lsr #18
+       orr     r6, r7, r0
+       str     r6, [r3]
 
 #ifdef CONFIG_DEBUG_LL
 #ifndef CONFIG_DEBUG_ICEDCC