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.zip
rockbox-9daf658ef18f1467ca949b7a4d4b6d428c8f4ce4.tar.gz
rockbox-9daf658ef18f1467ca949b7a4d4b6d428c8f4ce4.tar.bz2
rockbox-9daf658ef18f1467ca949b7a4d4b6d428c8f4ce4.tar.xz
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 8caa1b9..5c069f6 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 {
};
struct {
- long update_timeout;
+ long update_timeout;
enum lcd_status state;
bool blocked;
#if NUM_CORES > 1
@@ -107,6 +107,7 @@ static void bcm_setup_rect(unsigned x, unsigned y,
BCM_DATA32 = y + height - 1;
}
+#ifndef BOOTLOADER
static void lcd_tick(void)
{
/* No set_irq_level - already in interrupt context */
@@ -186,6 +187,29 @@ static void lcd_unblock_and_update(void)
set_irq_level(oldlevel);
}
+#else /* BOOTLOADER */
+
+#define lcd_block_tick()
+
+static void lcd_unblock_and_update(void)
+{
+ unsigned data;
+
+ if (lcd_state.state != LCD_INITIAL)
+ {
+ data = bcm_read32(0x1F8);
+ while (data == 0xFFFA0005 || data == 0xFFFF)
+ {
+ yield();
+ data = bcm_read32(0x1F8);
+ }
+ }
+ bcm_write32(0x1F8, 0xFFFA0005); /* Kick off update */
+ BCM_CONTROL = 0x31;
+ lcd_state.state = LCD_IDLE;
+}
+#endif /* BOOTLOADER */
+
/*** hardware configuration ***/
void lcd_set_contrast(int val)
@@ -210,11 +234,15 @@ void lcd_set_flip(bool yesno)
/* LCD init */
void lcd_init_device(void)
{
+ bcm_setup_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
lcd_state.blocked = false;
lcd_state.state = LCD_INITIAL;
+#ifndef BOOTLOADER
+#if NUM_CORES > 1
corelock_init(&lcd_state.cl);
- bcm_setup_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
+#endif
tick_add_task(&lcd_tick);
+#endif /* !BOOTLOADER */
}
/*** update functions ***/