summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2009-07-16 00:57:02 +0000
committerDave Chapman <dave@dchapman.com>2009-07-16 00:57:02 +0000
commit0270e4c59133c910902c6825a224476965a02134 (patch)
tree640a4d45e8ba8f150a4962bbba71cecc87c394b3
parentc30d509f34c80fa59cd3120cda4f4383cbcde485 (diff)
downloadrockbox-0270e4c59133c910902c6825a224476965a02134.tar.gz
rockbox-0270e4c59133c910902c6825a224476965a02134.tar.bz2
rockbox-0270e4c59133c910902c6825a224476965a02134.zip
Get the Nano2G bootloader running - it now runs and displays a logo on one type of Nano2G LCD.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21900 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/SOURCES1
-rw-r--r--bootloader/ipodnano2g.c9
-rw-r--r--firmware/target/arm/s5l8700/crt0.S14
3 files changed, 20 insertions, 4 deletions
diff --git a/bootloader/SOURCES b/bootloader/SOURCES
index 459a1a27bf..d36479c4ee 100644
--- a/bootloader/SOURCES
+++ b/bootloader/SOURCES
@@ -54,4 +54,5 @@ lyre_proto1.c
show_logo.c
#elif defined(IPOD_NANO2G)
ipodnano2g.c
+show_logo.c
#endif
diff --git a/bootloader/ipodnano2g.c b/bootloader/ipodnano2g.c
index 637d405f01..e8e8e2e1a4 100644
--- a/bootloader/ipodnano2g.c
+++ b/bootloader/ipodnano2g.c
@@ -7,7 +7,7 @@
* \/ \/ \/ \/ \/
* $Id$
*
- * Copyright (C) 2009 by ???? [to be completed by first author]
+ * Copyright (C) 2009 by Dave Chapman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -46,8 +46,15 @@
char version[] = APPSVERSION;
+/* Show the Rockbox logo - in show_logo.c */
+extern int show_logo(void);
+
void main(void)
{
+ lcd_init();
+
+ show_logo();
+
/* Do nothing... */
while(1);
}
diff --git a/firmware/target/arm/s5l8700/crt0.S b/firmware/target/arm/s5l8700/crt0.S
index 0dcc203844..c79897606c 100644
--- a/firmware/target/arm/s5l8700/crt0.S
+++ b/firmware/target/arm/s5l8700/crt0.S
@@ -45,10 +45,12 @@ _newstart:
newstart2:
msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ/FIQ */
+#ifdef ROCKBOX_BIG_ENDIAN
mov r1, #0x80
mrc 15, 0, r0, c1, c0, 0
orr r0, r0, r1
mcr 15, 0, r0, c1, c0, 0 // set bigendian
+#endif
ldr r1, =0x3c800000 // disable watchdog
mov r0, #0xa5
@@ -66,7 +68,7 @@ newstart2:
str r0, [r1] // clear pending interrupts
ldr r1, =0x39c0001c
str r0, [r1] // clear pending external interrupts
-
+
// ldr r1, =0x3cf00000
// ldr r0, [r1]
// mvn r2, #0x30
@@ -80,6 +82,7 @@ newstart2:
// orr r0, r0, r2
// str r0, [r1] // switch backlight on
+#if CONFIG_CPU==S5L8700
ldr r1, =0x3c500000 // CLKCON
ldr r0, =0x00800080
str r0, [r1]
@@ -232,6 +235,7 @@ newstart2:
ldrhi r1, [r4], #4
strhi r1, [r2], #4
bhi 1b
+#endif
/* Initialise bss section to zero */
ldr r2, =_edata
@@ -241,7 +245,8 @@ newstart2:
cmp r3, r2
strhi r4, [r2], #4
bhi 1b
-
+
+#if CONFIG_CPU==S5L8700
/* Copy icode and data to ram */
ldr r2, =_datastart
ldr r3, =_dataend
@@ -251,6 +256,7 @@ newstart2:
ldrhi r1, [r4], #4
strhi r1, [r2], #4
bhi 1b
+#endif
/* Set up some stack and munge it with 0xdeadbeef */
ldr sp, =_stackend
@@ -260,7 +266,7 @@ newstart2:
cmp sp, r2
strhi r3, [r2], #4
bhi 1b
-
+
/* Set up stack for IRQ mode */
msr cpsr_c, #0xd2
ldr sp, =_irqstackend
@@ -281,6 +287,7 @@ newstart2:
// if we did not switch remap on, device
// would crash when MENU is pressed,
// as that button is connected to BOOT_MODE pin
+#if CONFIG_CPU==S5L8700
ldr r1, =0x38200000
ldr r0, [r1]
mvn r2, #0x10000
@@ -288,6 +295,7 @@ newstart2:
mov r2, #0x1
orr r0, r0, r2
str r0, [r1] // remap iram to address 0x0
+#endif
bl main