xtensa: move vecbase SR initialization to _startup
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 4 Oct 2014 01:12:27 +0000 (05:12 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 21 Oct 2014 09:28:55 +0000 (13:28 +0400)
Instead of initializing vecbase in initialize_mmu macro, which may be
expanded either in Image.elf reset vector hadler or in the kernel
head.S, both times only when CONFIG_MMU is enabled, do this
initialization once in _startup function.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/initialize_mmu.h
arch/xtensa/kernel/head.S

index 600781edc8a3a79e532b4410ebcc135386a2025f..cdac5584ec0cad9ff7685be647fd30c49aa7463a 100644 (file)
        jx      a4
 
 1:
-       movi    a2, VECBASE_RESET_VADDR
-       wsr     a2, vecbase
-
        /* Step 5: remove temporary mapping. */
        idtlb   a7
        iitlb   a7
index aeeb3cc8a4109e59bc6ce5f23fd88c21c0450f3f..15a461e2a0edda4444bcfbad3046c270d5a599b1 100644 (file)
@@ -112,6 +112,11 @@ ENTRY(_startup)
 
        movi    a0, 0
 
+#if XCHAL_HAVE_VECBASE
+       movi    a2, VECBASE_RESET_VADDR
+       wsr     a2, vecbase
+#endif
+
        /* Clear debugging registers. */
 
 #if XCHAL_HAVE_DEBUG