summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorDaniel Ankers <dan@weirdo.org.uk>2006-10-11 17:47:32 +0000
committerDaniel Ankers <dan@weirdo.org.uk>2006-10-11 17:47:32 +0000
commit6a4ec1414da6e393314abc389290cc2b57b387e6 (patch)
treeeb59e5923cab215d119abef4c38037242ed01797 /firmware
parent406069467d3b7bcbc3a0f923f19ad7aa3551a419 (diff)
downloadrockbox-6a4ec1414da6e393314abc389290cc2b57b387e6.tar.gz
rockbox-6a4ec1414da6e393314abc389290cc2b57b387e6.zip
Oops: Sansa and H10 need crt0 included in the bootloader
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11190 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES4
-rw-r--r--firmware/boot.lds13
-rw-r--r--firmware/target/arm/crt0-pp5024.S92
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
169thread.c 169thread.c
170timer.c 170timer.c
171#ifdef CPU_PP 171#ifdef CPU_PP
172#if (CONFIG_CPU == PP5024)
173target/arm/crt0-pp5024.S
174#else
172target/arm/crt0-pp.S 175target/arm/crt0-pp.S
176#endif
173#elif defined(CPU_ARM) 177#elif defined(CPU_ARM)
174target/arm/crt0.S 178target/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)
8OUTPUT_FORMAT(elf32-littlearm) 8OUTPUT_FORMAT(elf32-littlearm)
9OUTPUT_ARCH(arm) 9OUTPUT_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)
15INPUT(target/arm/crt0-pp5024.o)
16#else
17INPUT(target/arm/crt0-pp.o)
18#endif
19#else
12INPUT(target/arm/crt0.o) 20INPUT(target/arm/crt0.o)
13#endif 21#endif
22#endif
14#else 23#else
15OUTPUT_FORMAT(elf32-sh) 24OUTPUT_FORMAT(elf32-sh)
16INPUT(target/sh/crt0.o) 25INPUT(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
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