183d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2cdaa633fSAndre Przywara /* 3cdaa633fSAndre Przywara * Configuration settings for the Allwinner A64 (sun50i) CPU 4cdaa633fSAndre Przywara */ 5cdaa633fSAndre Przywara 683843c9bSAndre Przywara #if defined(CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER) && !defined(CONFIG_SPL_BUILD) 7cdaa633fSAndre Przywara /* reserve space for BOOT0 header information */ 8ce62e57fSAndre Przywara b reset 9cdaa633fSAndre Przywara .space 1532 1083843c9bSAndre Przywara #elif defined(CONFIG_ARM_BOOT_HOOK_RMR) 1183843c9bSAndre Przywara /* 1283843c9bSAndre Przywara * Switch into AArch64 if needed. 1383843c9bSAndre Przywara * Refer to arch/arm/mach-sunxi/rmr_switch.S for the original source. 1483843c9bSAndre Przywara */ 1583843c9bSAndre Przywara tst x0, x0 // this is "b #0x84" in ARM 1683843c9bSAndre Przywara b reset 1783843c9bSAndre Przywara .space 0x7c 1883843c9bSAndre Przywara .word 0xe59f1024 // ldr r1, [pc, #36] ; 0x170000a0 1983843c9bSAndre Przywara .word 0xe59f0024 // ldr r0, [pc, #36] ; CONFIG_*_TEXT_BASE 2083843c9bSAndre Przywara .word 0xe5810000 // str r0, [r1] 2183843c9bSAndre Przywara .word 0xf57ff04f // dsb sy 2283843c9bSAndre Przywara .word 0xf57ff06f // isb sy 2383843c9bSAndre Przywara .word 0xee1c0f50 // mrc 15, 0, r0, cr12, cr0, {2} ; RMR 2483843c9bSAndre Przywara .word 0xe3800003 // orr r0, r0, #3 2583843c9bSAndre Przywara .word 0xee0c0f50 // mcr 15, 0, r0, cr12, cr0, {2} ; RMR 2683843c9bSAndre Przywara .word 0xf57ff06f // isb sy 2783843c9bSAndre Przywara .word 0xe320f003 // wfi 2883843c9bSAndre Przywara .word 0xeafffffd // b @wfi 29*80197801SIcenowy Zheng #ifndef CONFIG_MACH_SUN50I_H6 3083843c9bSAndre Przywara .word 0x017000a0 // writeable RVBAR mapping address 31*80197801SIcenowy Zheng #else 32*80197801SIcenowy Zheng .word 0x09010040 // writeable RVBAR mapping address 33*80197801SIcenowy Zheng #endif 3483843c9bSAndre Przywara #ifdef CONFIG_SPL_BUILD 3583843c9bSAndre Przywara .word CONFIG_SPL_TEXT_BASE 3683843c9bSAndre Przywara #else 3783843c9bSAndre Przywara .word CONFIG_SYS_TEXT_BASE 3883843c9bSAndre Przywara #endif 3983843c9bSAndre Przywara #else 4083843c9bSAndre Przywara /* normal execution */ 4183843c9bSAndre Przywara b reset 4283843c9bSAndre Przywara #endif 43