Patrick Georgi | 7051707 | 2020-05-10 18:47:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-3-Clause */ |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 2 | |
Julius Werner | 25a282d | 2014-01-13 13:24:30 -0800 | [diff] [blame] | 3 | #include <arch/asm.h> |
| 4 | |
Julius Werner | 25a282d | 2014-01-13 13:24:30 -0800 | [diff] [blame] | 5 | .arm |
| 6 | ENTRY(maincpu_setup) |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 7 | /* |
Elyes HAOUAS | 038e724 | 2016-07-29 18:31:16 +0200 | [diff] [blame] | 8 | * Set the CPU to System mode with IRQ and FIQ disabled. Prefetch/Data |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 9 | * aborts may happen early and crash before the abort handlers are |
| 10 | * installed, but at least the problem will show up near the code that |
| 11 | * causes it. |
| 12 | */ |
| 13 | msr cpsr_cxf, #0xdf |
| 14 | |
Julius Werner | edf6b57 | 2013-10-25 17:49:26 -0700 | [diff] [blame] | 15 | ldr sp, maincpu_stack_pointer |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 16 | eor lr, lr |
Julius Werner | edf6b57 | 2013-10-25 17:49:26 -0700 | [diff] [blame] | 17 | ldr r0, maincpu_entry_point |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 18 | bx r0 |
Julius Werner | 25a282d | 2014-01-13 13:24:30 -0800 | [diff] [blame] | 19 | ENDPROC(maincpu_setup) |
Julius Werner | 7c6e489 | 2014-01-24 16:23:08 -0800 | [diff] [blame] | 20 | |
| 21 | .align 2 |
| 22 | |
| 23 | .global maincpu_stack_pointer |
| 24 | maincpu_stack_pointer: |
| 25 | .word 0 |
| 26 | |
| 27 | .global maincpu_entry_point |
| 28 | maincpu_entry_point: |
| 29 | .word 0 |