diff options
-rw-r--r-- | bootloader/x1000/boot.c | 22 | ||||
-rw-r--r-- | bootloader/x1000/x1000bootloader.h | 13 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c | 22 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_x1000/lcd-x1000.h | 8 |
4 files changed, 65 insertions, 0 deletions
diff --git a/bootloader/x1000/boot.c b/bootloader/x1000/boot.c index 60fb864d19..9e22192516 100644 --- a/bootloader/x1000/boot.c +++ b/bootloader/x1000/boot.c | |||
@@ -29,6 +29,10 @@ | |||
29 | #include "boot-x1000.h" | 29 | #include "boot-x1000.h" |
30 | #include <ctype.h> | 30 | #include <ctype.h> |
31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
32 | #if defined(EROS_QN) | ||
33 | # include "lcd-x1000.c" | ||
34 | # include "backlight-target.h" | ||
35 | #endif | ||
32 | 36 | ||
33 | void boot_rockbox(void) | 37 | void boot_rockbox(void) |
34 | { | 38 | { |
@@ -201,6 +205,24 @@ void boot_of_helper(uint32_t addr, uint32_t flash_size, const char* args) | |||
201 | 205 | ||
202 | gui_shutdown(); | 206 | gui_shutdown(); |
203 | 207 | ||
208 | /* The Eros Q needs the LCD initialized in the bootloader */ | ||
209 | #if defined(EROS_QN) | ||
210 | /* enable LCD if it's not yet on, but keep the backlight off to avoid a white flash */ | ||
211 | init_lcd(); | ||
212 | backlight_hw_off(); | ||
213 | |||
214 | /* TODO: this doesn't work for some reason */ | ||
215 | //lcd_clear_display(); | ||
216 | //lcd_update(); | ||
217 | //lcd_wait_frame(); | ||
218 | |||
219 | /* disable irq and dma */ | ||
220 | lcd_enable(false); | ||
221 | |||
222 | /* set up LCD in a config compatible with OF */ | ||
223 | lcd_tgt_enable_of(1); | ||
224 | #endif | ||
225 | |||
204 | x1000_dualboot_load_pdma_fw(); | 226 | x1000_dualboot_load_pdma_fw(); |
205 | x1000_dualboot_cleanup(); | 227 | x1000_dualboot_cleanup(); |
206 | x1000_dualboot_init_clocktree(); | 228 | x1000_dualboot_init_clocktree(); |
diff --git a/bootloader/x1000/x1000bootloader.h b/bootloader/x1000/x1000bootloader.h index 1fba9a29a1..81c7f2aaa4 100644 --- a/bootloader/x1000/x1000bootloader.h +++ b/bootloader/x1000/x1000bootloader.h | |||
@@ -99,6 +99,19 @@ struct uimage_header; | |||
99 | # define BL_QUIT_NAME "POWER" | 99 | # define BL_QUIT_NAME "POWER" |
100 | # define BL_SCREENSHOT_NAME "MENU" | 100 | # define BL_SCREENSHOT_NAME "MENU" |
101 | # define BOOTBACKUP_FILE "/erosqnative-boot.bin" | 101 | # define BOOTBACKUP_FILE "/erosqnative-boot.bin" |
102 | # define OF_PLAYER_NAME "Aigo Player" | ||
103 | # define OF_PLAYER_ADDR 0x300000 | ||
104 | # define OF_PLAYER_LENGTH (6 * 1024 * 1024) | ||
105 | # define OF_PLAYER_ARGS OF_RECOVERY_ARGS \ | ||
106 | " init=/linuxrc ubi.mtd=4 root=ubi0:rootfs ubi.mtd=5 rootfstype=ubifs \ | ||
107 | sn_no=00000000000000000000000000000000 bt_mac=xxxxxxxxxxxx wifi_mac=xxxxxxxxxxxx rw" | ||
108 | # define OF_PLAYER_BTN BUTTON_PLAY | ||
109 | /* Note: OF Recovery boots, but is otherwise untested. */ | ||
110 | //# define OF_RECOVERY_NAME "Aigo Recovery" | ||
111 | //# define OF_RECOVERY_ADDR 0x900000 | ||
112 | //# define OF_RECOVERY_LENGTH (7 * 1024 * 1024) | ||
113 | # define OF_RECOVERY_ARGS \ | ||
114 | "console=ttyS2,115200n8 mem=32M@0x0 no_console_suspend lpj=5009408 ip=off" | ||
102 | #else | 115 | #else |
103 | # error "Missing keymap!" | 116 | # error "Missing keymap!" |
104 | #endif | 117 | #endif |
diff --git a/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c b/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c index 19da722898..0d43a3f010 100644 --- a/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c +++ b/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c | |||
@@ -102,6 +102,19 @@ static const uint32_t erosqnative_lcd_cmd_enable[] = { | |||
102 | LCD_INSTR_END, | 102 | LCD_INSTR_END, |
103 | }; | 103 | }; |
104 | 104 | ||
105 | static const uint32_t erosqnative_lcd_of_compat_cmd[] = { | ||
106 | /* Pixel Format Set */ | ||
107 | LCD_INSTR_CMD, 0x3a, | ||
108 | LCD_INSTR_DAT, 0x66, /* 18 bpp */ | ||
109 | /* Exit Sleep */ | ||
110 | LCD_INSTR_CMD, 0x11, | ||
111 | LCD_INSTR_UDELAY, 120000, | ||
112 | /* Display On */ | ||
113 | LCD_INSTR_CMD, 0x29, | ||
114 | LCD_INSTR_UDELAY, 20000, | ||
115 | LCD_INSTR_END, | ||
116 | }; | ||
117 | |||
105 | /* sleep and wake copied directly from m3k */ | 118 | /* sleep and wake copied directly from m3k */ |
106 | static const uint32_t erosqnative_lcd_cmd_sleep[] = { | 119 | static const uint32_t erosqnative_lcd_cmd_sleep[] = { |
107 | /* Display OFF */ | 120 | /* Display OFF */ |
@@ -180,6 +193,15 @@ void lcd_tgt_enable(bool enable) | |||
180 | } | 193 | } |
181 | } | 194 | } |
182 | 195 | ||
196 | void lcd_tgt_enable_of(bool enable) | ||
197 | { | ||
198 | /* silence the unused parameter warning */ | ||
199 | if (enable) | ||
200 | {} | ||
201 | |||
202 | lcd_exec_commands(&erosqnative_lcd_of_compat_cmd[0]); | ||
203 | } | ||
204 | |||
183 | void lcd_tgt_sleep(bool sleep) | 205 | void lcd_tgt_sleep(bool sleep) |
184 | { | 206 | { |
185 | if(sleep) | 207 | if(sleep) |
diff --git a/firmware/target/mips/ingenic_x1000/lcd-x1000.h b/firmware/target/mips/ingenic_x1000/lcd-x1000.h index 749fac8240..e88a8733ed 100644 --- a/firmware/target/mips/ingenic_x1000/lcd-x1000.h +++ b/firmware/target/mips/ingenic_x1000/lcd-x1000.h | |||
@@ -105,6 +105,14 @@ extern void lcd_exec_commands(const uint32_t* cmdseq); | |||
105 | */ | 105 | */ |
106 | extern void lcd_tgt_enable(bool on); | 106 | extern void lcd_tgt_enable(bool on); |
107 | 107 | ||
108 | /* Enable/disable the LCD controller, but intended for booting the OF. | ||
109 | * | ||
110 | * This is only used for the Eros Q Native port, as the OF seems to be | ||
111 | * unable to initialize the LCD in the kernel boot rather than having | ||
112 | * the bootloader do it. | ||
113 | */ | ||
114 | extern void lcd_tgt_enable_of(bool on); | ||
115 | |||
108 | /* Enter or exit sleep mode to save power, normally by sending the necessary | 116 | /* Enter or exit sleep mode to save power, normally by sending the necessary |
109 | * commands with lcd_exec_commands(). | 117 | * commands with lcd_exec_commands(). |
110 | */ | 118 | */ |