summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/mrobe-500/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tms320dm320/mrobe-500/crt0.S')
-rwxr-xr-xfirmware/target/arm/tms320dm320/mrobe-500/crt0.S206
1 files changed, 0 insertions, 206 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/crt0.S b/firmware/target/arm/tms320dm320/mrobe-500/crt0.S
deleted file mode 100755
index 193470fd4a..0000000000
--- a/firmware/target/arm/tms320dm320/mrobe-500/crt0.S
+++ /dev/null
@@ -1,206 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * Arm bootloader and startup code based on startup.s from the iPodLinux loader
13 *
14 * Copyright (c) 2003, Daniel Palffy (dpalffy (at) rainstorm.org)
15 * Copyright (c) 2005, Bernard Leach <leachbj@bouncycastle.org>
16 *
17 * All files in this archive are subject to the GNU General Public License.
18 * See the file COPYING in the source tree root for full license agreement.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24#include "config.h"
25#include "cpu.h"
26
27 .section .init.text,"ax",%progbits
28
29 .global start
30start:
31 msr cpsr, #0xd3 /* enter supervisor mode, disable IRQ */
32
33#if !defined(DEBUG)
34 /* Copy exception handler code to address 0 */
35 ldr r2, =_vectorsstart
36 ldr r3, =_vectorsend
37 ldr r4, =_vectorscopy
381:
39 cmp r3, r2
40 ldrhi r5, [r4], #4
41 strhi r5, [r2], #4
42 bhi 1b
43#else
44 ldr r1, =vectors
45 ldr r0, =irq_handler
46 str r0, [r1, #24]
47 ldr r0, =fiq_handler
48 str r0, [r1, #28]
49#endif
50
51 /* Disable high vectors (at 0xffff0000 instead of 0x00000000) */
52 mrc p15, 0, r0, c1, c0
53 and r0, r0, #~(1<<13)
54 mcr p15, 0, r0, c1, c0
55
56#if !defined(BOOTLOADER)
57
58#if !defined(STUB)
59 /* Zero out IBSS */
60 ldr r2, =_iedata
61 ldr r3, =_iend
62 mov r4, #0
631:
64 cmp r3, r2
65 strhi r4, [r2], #4
66 bhi 1b
67
68 /* Copy the IRAM */
69 ldr r2, =_iramcopy
70 ldr r3, =_iramstart
71 ldr r4, =_iramend
721:
73 cmp r4, r3
74 ldrhi r5, [r2], #4
75 strhi r5, [r3], #4
76 bhi 1b
77#endif /* !STUB */
78#endif /* !BOOTLOADER */
79
80 /* Initialise bss section to zero */
81 ldr r2, =_edata
82 ldr r3, =_end
83 mov r4, #0
841:
85 cmp r3, r2
86 strhi r4, [r2], #4
87 bhi 1b
88
89 /* Set up some stack and munge it with 0xdeadbeef */
90 ldr r3, =stackend
91 ldr r2, =stackbegin
92 ldr r4, =0xdeadbeef
931:
94 cmp r3, r2
95 strhi r4, [r2], #4
96 bhi 1b
97
98 /* Set up stack for IRQ mode */
99 msr cpsr_c, #0xd2
100 ldr sp, =irq_stack
101 /* Set up stack for FIQ mode */
102 msr cpsr_c, #0xd1
103 ldr sp, =fiq_stack
104
105 /* Let abort and undefined modes use IRQ stack */
106 msr cpsr_c, #0xd7
107 ldr sp, =irq_stack
108 msr cpsr_c, #0xdb
109 ldr sp, =irq_stack
110 /* Switch to supervisor mode (no IRQ) */
111 msr cpsr_c, #0xd3
112 ldr sp, =stackend
113
114#ifdef BOOTLOADER
115 /* get the high part of our execute address */
116 ldr r2, =0xffffff00
117 and r4, pc, r2
118
119 /* Copy bootloader to safe area - 0x01900000 */
120 mov r5, #0x00900000
121 add r5, r5, #0x01000000
122 ldr r6, = _dataend
123 sub r0, r6, r5 /* length of loader */
124 add r0, r4, r0 /* r0 points to start of loader */
1251:
126 cmp r5, r6
127 ldrcc r2, [r4], #4
128 strcc r2, [r5], #4
129 bcc 1b
130
131 ldr pc, =start_loc /* jump to the relocated start_loc: */
132
133#endif
134
135start_loc:
136 bl main
137 /* main() should never return */
138
139/* Exception handlers. Will be copied to address 0 after memory remapping */
140 .section .vectors,"aw"
141 ldr pc, [pc, #24]
142 ldr pc, [pc, #24]
143 ldr pc, [pc, #24]
144 ldr pc, [pc, #24]
145 ldr pc, [pc, #24]
146 ldr pc, [pc, #24]
147 ldr pc, [pc, #24]
148 ldr pc, [pc, #24]
149
150 /* Exception vectors */
151 .global vectors
152vectors:
153 .word start
154 .word undef_instr_handler
155 .word software_int_handler
156 .word prefetch_abort_handler
157 .word data_abort_handler
158 .word reserved_handler
159 .word irq_handler
160 .word fiq_handler
161
162 .text
163
164#if !defined(STUB)
165 .global irq
166 .global fiq
167 .global UIE
168#endif
169
170/* All illegal exceptions call into UIE with exception address as first
171 parameter. This is calculated differently depending on which exception
172 we're in. Second parameter is exception number, used for a string lookup
173 in UIE.
174 */
175undef_instr_handler:
176 mov r0, lr
177 mov r1, #0
178 b UIE
179
180/* We run supervisor mode most of the time, and should never see a software
181 exception being thrown. Perhaps make it illegal and call UIE?
182 */
183software_int_handler:
184reserved_handler:
185 movs pc, lr
186
187prefetch_abort_handler:
188 sub r0, lr, #4
189 mov r1, #1
190 b UIE
191
192data_abort_handler:
193 sub r0, lr, #8
194 mov r1, #2
195 b UIE
196
197UIE:
198 b UIE
199
200/* 256 words of IRQ stack */
201 .space 256*4
202irq_stack:
203
204/* 256 words of FIQ stack */
205 .space 256*4
206fiq_stack: