summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-11-02 01:18:14 +0000
committerJens Arnold <amiconn@rockbox.org>2007-11-02 01:18:14 +0000
commit9daf658ef18f1467ca949b7a4d4b6d428c8f4ce4 (patch)
treeed7a0b8fc5fd08586e49c2f34bb4a5a7d22771f7
parentc888a9bebef0c631db744ee12fda34eea07b7b1c (diff)
downloadrockbox-9daf658ef18f1467ca949b7a4d4b6d428c8f4ce4.tar.gz
rockbox-9daf658ef18f1467ca949b7a4d4b6d428c8f4ce4.zip
iPod Video LCD driver: Reintroduce the simple method of waiting for update completion for use in the bootloader, because bootloaders don't enable interrupts and hence the tick task won't work. Slower than the full driver, but still faster than the old one, because it first transfers the data, and then polls the BCM.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15399 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/ipod/video/lcd-video.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/firmware/target/arm/ipod/video/lcd-video.c b/firmware/target/arm/ipod/video/lcd-video.c
index 8caa1b9c50..5c069f638b 100644
--- a/firmware/target/arm/ipod/video/lcd-video.c
+++ b/firmware/target/arm/ipod/video/lcd-video.c
@@ -62,7 +62,7 @@ enum lcd_status {
62}; 62};
63 63
64struct { 64struct {
65 long update_timeout; 65 long update_timeout;
66 enum lcd_status state; 66 enum lcd_status state;
67 bool blocked; 67 bool blocked;
68#if NUM_CORES > 1 68#if NUM_CORES > 1
@@ -107,6 +107,7 @@ static void bcm_setup_rect(unsigned x, unsigned y,
107 BCM_DATA32 = y + height - 1; 107 BCM_DATA32 = y + height - 1;
108} 108}
109 109
110#ifndef BOOTLOADER
110static void lcd_tick(void) 111static void lcd_tick(void)
111{ 112{
112 /* No set_irq_level - already in interrupt context */ 113 /* No set_irq_level - already in interrupt context */
@@ -186,6 +187,29 @@ static void lcd_unblock_and_update(void)
186 set_irq_level(oldlevel); 187 set_irq_level(oldlevel);
187} 188}
188 189
190#else /* BOOTLOADER */
191
192#define lcd_block_tick()
193
194static void lcd_unblock_and_update(void)
195{
196 unsigned data;
197
198 if (lcd_state.state != LCD_INITIAL)
199 {
200 data = bcm_read32(0x1F8);
201 while (data == 0xFFFA0005 || data == 0xFFFF)
202 {
203 yield();
204 data = bcm_read32(0x1F8);
205 }
206 }
207 bcm_write32(0x1F8, 0xFFFA0005); /* Kick off update */
208 BCM_CONTROL = 0x31;
209 lcd_state.state = LCD_IDLE;
210}
211#endif /* BOOTLOADER */
212
189/*** hardware configuration ***/ 213/*** hardware configuration ***/
190 214
191void lcd_set_contrast(int val) 215void lcd_set_contrast(int val)
@@ -210,11 +234,15 @@ void lcd_set_flip(bool yesno)
210/* LCD init */ 234/* LCD init */
211void lcd_init_device(void) 235void lcd_init_device(void)
212{ 236{
237 bcm_setup_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
213 lcd_state.blocked = false; 238 lcd_state.blocked = false;
214 lcd_state.state = LCD_INITIAL; 239 lcd_state.state = LCD_INITIAL;
240#ifndef BOOTLOADER
241#if NUM_CORES > 1
215 corelock_init(&lcd_state.cl); 242 corelock_init(&lcd_state.cl);
216 bcm_setup_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); 243#endif
217 tick_add_task(&lcd_tick); 244 tick_add_task(&lcd_tick);
245#endif /* !BOOTLOADER */
218} 246}
219 247
220/*** update functions ***/ 248/*** update functions ***/