summaryrefslogtreecommitdiff
path: root/firmware/target
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/target
parentd58e3584772189715f54b4035cd13eac4270058e (diff)
downloadrockbox-386503502b2794021f5de431a32bad41dfe5c2d9.tar.gz
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/target')
-rw-r--r--firmware/target/arm/s5l8700/crt0.S6
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c9
2 files changed, 14 insertions, 1 deletions
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:
82// orr r0, r0, r2 82// orr r0, r0, r2
83// str r0, [r1] // switch backlight on 83// str r0, [r1] // switch backlight on
84 84
85#if CONFIG_CPU==S5L8700
86 ldr r1, =0x3c500000 // CLKCON 85 ldr r1, =0x3c500000 // CLKCON
87 ldr r0, =0x00800080 86 ldr r0, =0x00800080
88 str r0, [r1] 87 str r0, [r1]
@@ -90,7 +89,11 @@ newstart2:
90 mov r0, #0 89 mov r0, #0
91 str r0, [r1] 90 str r0, [r1]
92 ldr r1, =0x3c500004 // PLL0PMS 91 ldr r1, =0x3c500004 // PLL0PMS
92#ifdef IPOD_NANO2G
93 ldr r0, =0x21200
94#else
93 ldr r0, =0x1ad200 95 ldr r0, =0x1ad200
96#endif
94 str r0, [r1] 97 str r0, [r1]
95 ldr r1, =0x3c500014 // PLL0LCNT 98 ldr r1, =0x3c500014 // PLL0LCNT
96 ldr r0, =8100 99 ldr r0, =8100
@@ -226,6 +229,7 @@ newstart2:
226 mcr 15, 0, r0, c1, c0, 0 // enable protection unit 229 mcr 15, 0, r0, c1, c0, 0 // enable protection unit
227 230
228 231
232#if CONFIG_CPU==S5L8700
229 /* Copy interrupt vectors to iram */ 233 /* Copy interrupt vectors to iram */
230 ldr r2, =_intvectstart 234 ldr r2, =_intvectstart
231 ldr r3, =_intvectend 235 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 */
60 60
61static inline void s5l_lcd_write_cmd_data(int cmd, int data) 61static inline void s5l_lcd_write_cmd_data(int cmd, int data)
62{ 62{
63 while (LCD_STATUS & 0x10);
63 LCD_WCMD = cmd >> 8; 64 LCD_WCMD = cmd >> 8;
65 while (LCD_STATUS & 0x10);
64 LCD_WCMD = cmd & 0xff; 66 LCD_WCMD = cmd & 0xff;
65 67
68 while (LCD_STATUS & 0x10);
66 LCD_WDATA = data >> 8; 69 LCD_WDATA = data >> 8;
70 while (LCD_STATUS & 0x10);
67 LCD_WDATA = data & 0xff; 71 LCD_WDATA = data & 0xff;
68} 72}
69 73
70static inline void s5l_lcd_write_cmd(unsigned short cmd) 74static inline void s5l_lcd_write_cmd(unsigned short cmd)
71{ 75{
76 while (LCD_STATUS & 0x10);
72 LCD_WCMD = cmd; 77 LCD_WCMD = cmd;
73} 78}
74 79
75static inline void s5l_lcd_write_data(int data) 80static inline void s5l_lcd_write_data(int data)
76{ 81{
82 while (LCD_STATUS & 0x10);
77 LCD_WDATA = data >> 8; 83 LCD_WDATA = data >> 8;
84 while (LCD_STATUS & 0x10);
78 LCD_WDATA = data & 0xff; 85 LCD_WDATA = data & 0xff;
79} 86}
80 87
@@ -185,7 +192,9 @@ void lcd_update(void)
185 for (x = 0; x < LCD_WIDTH; x++) { 192 for (x = 0; x < LCD_WIDTH; x++) {
186 pixel = *(p++); 193 pixel = *(p++);
187 194
195 while (LCD_STATUS & 0x10);
188 LCD_WDATA = (pixel & 0xff00) >> 8; 196 LCD_WDATA = (pixel & 0xff00) >> 8;
197 while (LCD_STATUS & 0x10);
189 LCD_WDATA = pixel & 0xff; 198 LCD_WDATA = pixel & 0xff;
190 } 199 }
191 } 200 }