summaryrefslogtreecommitdiff
path: root/firmware/target/arm/crt0-pp5024.S
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/crt0-pp5024.S')
-rw-r--r--firmware/target/arm/crt0-pp5024.S92
1 files changed, 92 insertions, 0 deletions
diff --git a/firmware/target/arm/crt0-pp5024.S b/firmware/target/arm/crt0-pp5024.S
new file mode 100644
index 0000000000..72edf37052
--- /dev/null
+++ b/firmware/target/arm/crt0-pp5024.S
@@ -0,0 +1,92 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "config.h"
20#include "cpu.h"
21
22#define THUMB_MODE(_r_, _l_) \
23 ldr _r_,=_l_ ## f+1 ;\
24 bx _r_ ;\
25 .pool ;\
26 .code 16 ;\
27 .thumb_func ;\
28 _l_:
29
30// Switch to ARM mode
31#define ARM_MODE(_r_, _l_) \
32 ldr _r_,=_l_ ## f ;\
33 bx _r_ ;\
34 .pool ;\
35 .code 32 ;\
36 _l_:
37
38
39.equ MODE_MASK, 0x1f
40.equ T_BIT, 0x20
41.equ F_BIT, 0x40
42.equ I_BIT, 0x80
43.equ MODE_IRQ, 0x12
44.equ MODE_SVC, 0x13
45.equ MODE_SYS, 0x1f
46
47
48
49 .section .init.text,"ax",%progbits
50
51 .global start
52start:
53
54 .equ PROC_ID, 0x60000000
55 .equ COP_CTRL, 0x60007004
56 .equ COP_STATUS, 0x60007004
57 .equ IIS_CONFIG, 0x70002800
58 .equ SLEEP, 0x80000000
59 .equ WAKE, 0x0
60 .equ SLEEPING, 0x80000000
61
62
63 /* Find out which processor we are */
64 mov r0, #PROC_ID
65 ldr r0, [r0]
66 and r0, r0, #0xff
67 cmp r0, #0x55
68 beq 1f
69
70 /* put us (co-processor) to sleep */
71 ldr r4, =COP_CTRL
72 mov r3, #SLEEP
73 str r3, [r4]
74 ldr pc, =cop_wake_start
75
76cop_wake_start:
77 /* jump the COP to startup */
78 ldr r0, =startup_loc
79 ldr pc, [r0]
80
811:
82 msr cpsr_c, #0xd3
83
84 ldr sp, =0x40017f00 /* set stack */
85
86
87 /* execute the loader - this will load an image to 0x10000000 */
88 bl main
89
90startup_loc:
91 .word 0x0
92