diff options
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c index 12c1f3eb09..56c8504649 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c | |||
@@ -38,7 +38,16 @@ do { \ | |||
38 | 38 | ||
39 | #define SLEEP(x) { register int __i; for(__i=0; __i<x; __i++) asm volatile("nop\n nop\n"); } | 39 | #define SLEEP(x) { register int __i; for(__i=0; __i<x; __i++) asm volatile("nop\n nop\n"); } |
40 | #define DELAY SLEEP(700000); | 40 | #define DELAY SLEEP(700000); |
41 | #ifdef USB_BOOT | 41 | |
42 | #if (defined(ONDA_VX777) && !defined(BOOTLOADER)) || defined(USB_BOOT) | ||
43 | /* | ||
44 | * Onda VX777 needs this in order to boot correctly, it looks like the SPL | ||
45 | * does not correctly initialize the LCD for Rockbox to switch it on. | ||
46 | */ | ||
47 | #define RESET_LCD | ||
48 | #endif | ||
49 | |||
50 | #ifdef RESET_LCD | ||
42 | static void _display_pin_init(void) | 51 | static void _display_pin_init(void) |
43 | { | 52 | { |
44 | my__gpio_as_lcd_16bit(); | 53 | my__gpio_as_lcd_16bit(); |
@@ -61,7 +70,7 @@ static void _display_pin_init(void) | |||
61 | #define SLCD_SEND_COMMAND(cmd,val) SLCD_SET_COMMAND(cmd); SLCD_SET_DATA(val); | 70 | #define SLCD_SEND_COMMAND(cmd,val) SLCD_SET_COMMAND(cmd); SLCD_SET_DATA(val); |
62 | static void _display_init(void) | 71 | static void _display_init(void) |
63 | { | 72 | { |
64 | #ifdef USB_BOOT | 73 | #ifdef RESET_LCD |
65 | SLCD_SEND_COMMAND(REG_SOFT_RESET, SOFT_RESET(1)); | 74 | SLCD_SEND_COMMAND(REG_SOFT_RESET, SOFT_RESET(1)); |
66 | SLEEP(700000); | 75 | SLEEP(700000); |
67 | SLCD_SEND_COMMAND(REG_SOFT_RESET, SOFT_RESET(0)); | 76 | SLCD_SEND_COMMAND(REG_SOFT_RESET, SOFT_RESET(0)); |
@@ -78,7 +87,7 @@ static void _display_init(void) | |||
78 | SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_VID | ENTRY_MODE_AM)); | 87 | SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_VID | ENTRY_MODE_AM)); |
79 | #endif | 88 | #endif |
80 | 89 | ||
81 | #ifdef USB_BOOT | 90 | #ifdef RESET_LCD |
82 | SLCD_SEND_COMMAND(REG_DISP_CTRL2, 0x503); | 91 | SLCD_SEND_COMMAND(REG_DISP_CTRL2, 0x503); |
83 | SLCD_SEND_COMMAND(REG_DISP_CTRL3, 1); | 92 | SLCD_SEND_COMMAND(REG_DISP_CTRL3, 1); |
84 | SLCD_SEND_COMMAND(REG_LPCTRL, 0x10); | 93 | SLCD_SEND_COMMAND(REG_LPCTRL, 0x10); |
@@ -144,7 +153,7 @@ static void _display_init(void) | |||
144 | SLCD_SEND_COMMAND(REG_DISP_CTRL1, (DISP_CTRL1_BASEE | DISP_CTRL1_VON | | 153 | SLCD_SEND_COMMAND(REG_DISP_CTRL1, (DISP_CTRL1_BASEE | DISP_CTRL1_VON | |
145 | DISP_CTRL1_GON | DISP_CTRL1_DTE | DISP_CTRL1_D(3))); | 154 | DISP_CTRL1_GON | DISP_CTRL1_DTE | DISP_CTRL1_D(3))); |
146 | SLEEP(3500000); | 155 | SLEEP(3500000); |
147 | #endif /* USB_BOOT */ | 156 | #endif /* RESET_LCD */ |
148 | } | 157 | } |
149 | 158 | ||
150 | static void _display_on(void) | 159 | static void _display_on(void) |
@@ -199,7 +208,7 @@ void lcd_init_controller(void) | |||
199 | { | 208 | { |
200 | lcd_clock_enable(); | 209 | lcd_clock_enable(); |
201 | 210 | ||
202 | #ifdef USB_BOOT | 211 | #ifdef RESET_LCD |
203 | _display_pin_init(); | 212 | _display_pin_init(); |
204 | #endif | 213 | #endif |
205 | _set_lcd_bus(); | 214 | _set_lcd_bus(); |