diff options
-rw-r--r-- | firmware/SOURCES | 4 | ||||
-rw-r--r-- | firmware/boot.lds | 13 | ||||
-rw-r--r-- | firmware/target/arm/crt0-pp5024.S | 92 |
3 files changed, 107 insertions, 2 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index f58ec6d130..c95b37d660 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -169,7 +169,11 @@ rolo.c | |||
169 | thread.c | 169 | thread.c |
170 | timer.c | 170 | timer.c |
171 | #ifdef CPU_PP | 171 | #ifdef CPU_PP |
172 | #if (CONFIG_CPU == PP5024) | ||
173 | target/arm/crt0-pp5024.S | ||
174 | #else | ||
172 | target/arm/crt0-pp.S | 175 | target/arm/crt0-pp.S |
176 | #endif | ||
173 | #elif defined(CPU_ARM) | 177 | #elif defined(CPU_ARM) |
174 | target/arm/crt0.S | 178 | target/arm/crt0.S |
175 | #elif defined(CPU_COLDFIRE) | 179 | #elif defined(CPU_COLDFIRE) |
diff --git a/firmware/boot.lds b/firmware/boot.lds index 97a9f784c0..0337b816f2 100644 --- a/firmware/boot.lds +++ b/firmware/boot.lds | |||
@@ -7,10 +7,19 @@ INPUT(target/coldfire/crt0.o) | |||
7 | #elif defined (CPU_ARM) | 7 | #elif defined (CPU_ARM) |
8 | OUTPUT_FORMAT(elf32-littlearm) | 8 | OUTPUT_FORMAT(elf32-littlearm) |
9 | OUTPUT_ARCH(arm) | 9 | OUTPUT_ARCH(arm) |
10 | #ifndef CPU_PP | 10 | #ifndef IPOD_ARCH |
11 | /* PortalPlayer-based machines won't work if crt0 is included */ | 11 | /* the ipods can't have the crt0.o mentioned here, but the others can't do |
12 | without it! */ | ||
13 | #ifdef CPU_PP | ||
14 | #if (CONFIG_CPU == PP5024) | ||
15 | INPUT(target/arm/crt0-pp5024.o) | ||
16 | #else | ||
17 | INPUT(target/arm/crt0-pp.o) | ||
18 | #endif | ||
19 | #else | ||
12 | INPUT(target/arm/crt0.o) | 20 | INPUT(target/arm/crt0.o) |
13 | #endif | 21 | #endif |
22 | #endif | ||
14 | #else | 23 | #else |
15 | OUTPUT_FORMAT(elf32-sh) | 24 | OUTPUT_FORMAT(elf32-sh) |
16 | INPUT(target/sh/crt0.o) | 25 | INPUT(target/sh/crt0.o) |
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 | ||
52 | start: | ||
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 | |||
76 | cop_wake_start: | ||
77 | /* jump the COP to startup */ | ||
78 | ldr r0, =startup_loc | ||
79 | ldr pc, [r0] | ||
80 | |||
81 | 1: | ||
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 | |||
90 | startup_loc: | ||
91 | .word 0x0 | ||
92 | |||