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
This commit is contained in:
Jens Arnold 2007-11-02 01:18:14 +00:00
parent c888a9bebe
commit 9daf658ef1

View file

@ -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 ***/