xtensa: nommu: fix Image.elf reset code and ld script
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 2 Oct 2014 18:03:27 +0000 (22:03 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 21 Oct 2014 09:28:52 +0000 (13:28 +0400)
Don't hardcode kernel entry address as 0x3000 or 0xd0003000, use
LOAD_MEMORY_ADDRESS macro. Don't compile MMU remapping code and don't try
to link it when building noMMU configuration.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/boot/boot-elf/boot.lds.S
arch/xtensa/boot/boot-elf/bootstrap.S

index 932b58ef33d4de8a9051fee13c748d7eecc38bee..958b33af96b7e97b5075916c7d69280161450928 100644 (file)
@@ -41,6 +41,7 @@ SECTIONS
                __bss_end = .;
        }
 
+#ifdef CONFIG_MMU
        /*
         * This is a remapped copy of the Reset Vector Code.
         * It keeps gdb in sync with the PC after switching
@@ -51,4 +52,5 @@ SECTIONS
        {
                *(.ResetVector.remapped_text)
        }
+#endif
 }
index 1388a499753b477d4a162e08d51b36dc78880bb3..9341a57506945ec2602ff4c7d397b3e34a7a6268 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/page.h>
 #include <asm/cacheasm.h>
 #include <asm/initialize_mmu.h>
+#include <asm/vectors.h>
 #include <linux/linkage.h>
 
        .section        .ResetVector.text, "ax"
@@ -34,12 +35,7 @@ _ResetVector:
 
        .align 4
 RomInitAddr:
-#if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \
-       XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
-       .word 0x00003000
-#else
-       .word 0xd0003000
-#endif
+       .word   LOAD_MEMORY_ADDRESS
 RomBootParam:
        .word _bootparam
 _bootparam:
@@ -79,6 +75,7 @@ reset:
        movi    a4, 0
        jx      a0
 
+#ifdef CONFIG_MMU
        .align 4
 
        .section        .ResetVector.remapped_text, "x"
@@ -102,3 +99,4 @@ _RemappedSetupMMU:
 #endif
 
        .end    no-absolute-literals
+#endif