summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2009-07-18 11:31:19 +0000
committerDave Chapman <dave@dchapman.com>2009-07-18 11:31:19 +0000
commit386503502b2794021f5de431a32bad41dfe5c2d9 (patch)
tree19e3b216233cfc7c529633458f2aa80a157e81a9 /firmware
parentd58e3584772189715f54b4035cd13eac4270058e (diff)
downloadrockbox-386503502b2794021f5de431a32bad41dfe5c2d9.tar.gz
rockbox-386503502b2794021f5de431a32bad41dfe5c2d9.tar.bz2
rockbox-386503502b2794021f5de431a32bad41dfe5c2d9.zip
Various Nano2g changes - enable the rest of crt0.S (including clock setup) and make the nano2g bootloader do something useful (displaying gpio ports). Also add checks for the fifo-full condition in the LCD driver - required after enabling all the crt0.S inits
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21948 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES1
-rw-r--r--firmware/export/s5l8700.h2
-rw-r--r--firmware/target/arm/s5l8700/crt0.S6
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c9
4 files changed, 17 insertions, 1 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index a3359cf8e7..51693b9b65 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -1303,6 +1303,7 @@ target/arm/s5l8700/udacodec-meizu.c
#ifdef IPOD_NANO2G
target/arm/s5l8700/kernel-s5l8700.c
target/arm/s5l8700/ipodnano2g/backlight-nano2g.c
+target/arm/s5l8700/ipodnano2g/button-nano2g.c
target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
#endif
diff --git a/firmware/export/s5l8700.h b/firmware/export/s5l8700.h
index 353690398a..4360f14a2d 100644
--- a/firmware/export/s5l8700.h
+++ b/firmware/export/s5l8700.h
@@ -19,6 +19,8 @@
*
****************************************************************************/
+#include <inttypes.h>
+
#define REG8_PTR_T volatile uint8_t *
#define REG16_PTR_T volatile uint16_t *
#define REG32_PTR_T volatile uint32_t *
diff --git a/firmware/target/arm/s5l8700/crt0.S b/firmware/target/arm/s5l8700/crt0.S
index c79897606c..c6e201e73f 100644
--- a/firmware/target/arm/s5l8700/crt0.S
+++ b/firmware/target/arm/s5l8700/crt0.S
@@ -82,7 +82,6 @@ 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]
@@ -90,7 +89,11 @@ newstart2:
mov r0, #0
str r0, [r1]
ldr r1, =0x3c500004 // PLL0PMS
+#ifdef IPOD_NANO2G
+ ldr r0, =0x21200
+#else
ldr r0, =0x1ad200
+#endif
str r0, [r1]
ldr r1, =0x3c500014 // PLL0LCNT
ldr r0, =8100
@@ -226,6 +229,7 @@ newstart2:
mcr 15, 0, r0, c1, c0, 0 // enable protection unit
+#if CONFIG_CPU==S5L8700
/* Copy interrupt vectors to iram */
ldr r2, =_intvectstart
ldr r3, =_intvectend
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
index 481e548440..3cbff75ffd 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
@@ -60,21 +60,28 @@ static int xoffset; /* needed for flip */
static inline void s5l_lcd_write_cmd_data(int cmd, int data)
{
+ while (LCD_STATUS & 0x10);
LCD_WCMD = cmd >> 8;
+ while (LCD_STATUS & 0x10);
LCD_WCMD = cmd & 0xff;
+ while (LCD_STATUS & 0x10);
LCD_WDATA = data >> 8;
+ while (LCD_STATUS & 0x10);
LCD_WDATA = data & 0xff;
}
static inline void s5l_lcd_write_cmd(unsigned short cmd)
{
+ while (LCD_STATUS & 0x10);
LCD_WCMD = cmd;
}
static inline void s5l_lcd_write_data(int data)
{
+ while (LCD_STATUS & 0x10);
LCD_WDATA = data >> 8;
+ while (LCD_STATUS & 0x10);
LCD_WDATA = data & 0xff;
}
@@ -185,7 +192,9 @@ void lcd_update(void)
for (x = 0; x < LCD_WIDTH; x++) {
pixel = *(p++);
+ while (LCD_STATUS & 0x10);
LCD_WDATA = (pixel & 0xff00) >> 8;
+ while (LCD_STATUS & 0x10);
LCD_WDATA = pixel & 0xff;
}
}