blob: fa2bde1a6b5aa5365861a1b9cfc4346f9d144728 [file] [log] [blame]
Patrick Georgi70517072020-05-10 18:47:05 +02001/* SPDX-License-Identifier: BSD-3-Clause */
Gabe Blackd40be112013-10-09 23:45:07 -07002
Julius Werner25a282d2014-01-13 13:24:30 -08003#include <arch/asm.h>
4
Julius Werner25a282d2014-01-13 13:24:30 -08005.arm
6ENTRY(maincpu_setup)
Gabe Blackd40be112013-10-09 23:45:07 -07007 /*
Elyes HAOUAS038e7242016-07-29 18:31:16 +02008 * Set the CPU to System mode with IRQ and FIQ disabled. Prefetch/Data
Gabe Blackd40be112013-10-09 23:45:07 -07009 * 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 Werneredf6b572013-10-25 17:49:26 -070015 ldr sp, maincpu_stack_pointer
Gabe Blackd40be112013-10-09 23:45:07 -070016 eor lr, lr
Julius Werneredf6b572013-10-25 17:49:26 -070017 ldr r0, maincpu_entry_point
Gabe Blackd40be112013-10-09 23:45:07 -070018 bx r0
Julius Werner25a282d2014-01-13 13:24:30 -080019ENDPROC(maincpu_setup)
Julius Werner7c6e4892014-01-24 16:23:08 -080020
21 .align 2
22
23 .global maincpu_stack_pointer
24maincpu_stack_pointer:
25 .word 0
26
27 .global maincpu_entry_point
28maincpu_entry_point:
29 .word 0