summaryrefslogtreecommitdiff
path: root/bootloader/iriver_h1x0.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/iriver_h1x0.c')
-rw-r--r--bootloader/iriver_h1x0.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/bootloader/iriver_h1x0.c b/bootloader/iriver_h1x0.c
index e744b642b0..168bd29b67 100644
--- a/bootloader/iriver_h1x0.c
+++ b/bootloader/iriver_h1x0.c
@@ -57,6 +57,10 @@
57 57
58#define DRAM_START 0x31000000 58#define DRAM_START 0x31000000
59 59
60/* From common.c */
61extern int line;
62extern int remote_line;
63
60#ifdef HAVE_EEPROM_SETTINGS 64#ifdef HAVE_EEPROM_SETTINGS
61static bool recovery_mode = false; 65static bool recovery_mode = false;
62#endif 66#endif
@@ -89,7 +93,6 @@ void start_firmware(void)
89 asm(" jmp (%a0)"); 93 asm(" jmp (%a0)");
90} 94}
91 95
92#ifdef IRIVER_H100_SERIES
93void start_flashed_romimage(void) 96void start_flashed_romimage(void)
94{ 97{
95 uint8_t *src = (uint8_t *)FLASH_ROMIMAGE_ENTRY; 98 uint8_t *src = (uint8_t *)FLASH_ROMIMAGE_ENTRY;
@@ -134,7 +137,6 @@ void start_flashed_ramimage(void)
134 /* Failure */ 137 /* Failure */
135 power_off(); 138 power_off();
136} 139}
137#endif /* IRIVER_H100_SERIES */
138 140
139void shutdown(void) 141void shutdown(void)
140{ 142{
@@ -159,9 +161,7 @@ void shutdown(void)
159 161
160 /* Backlight OFF */ 162 /* Backlight OFF */
161 backlight_hw_off(); 163 backlight_hw_off();
162#ifdef HAVE_REMOTE_LCD
163 remote_backlight_hw_off(); 164 remote_backlight_hw_off();
164#endif
165 165
166 __reset_cookie(); 166 __reset_cookie();
167 power_off(); 167 power_off();
@@ -252,7 +252,6 @@ void failsafe_menu(void)
252 int defopt = -1; 252 int defopt = -1;
253 char buf[32]; 253 char buf[32];
254 int i; 254 int i;
255 extern int line;
256 255
257 reset_screen(); 256 reset_screen();
258 printf("Bootloader %s", rbversion); 257 printf("Bootloader %s", rbversion);
@@ -362,18 +361,14 @@ void failsafe_menu(void)
362 -> RESET signal */ 361 -> RESET signal */
363inline static void __uda1380_reset_hi(void) 362inline static void __uda1380_reset_hi(void)
364{ 363{
365#ifdef HAVE_UDA1380
366 or_l(1<<29, &GPIO_OUT); 364 or_l(1<<29, &GPIO_OUT);
367 or_l(1<<29, &GPIO_ENABLE); 365 or_l(1<<29, &GPIO_ENABLE);
368 or_l(1<<29, &GPIO_FUNCTION); 366 or_l(1<<29, &GPIO_FUNCTION);
369#endif
370} 367}
371 368
372inline static void __uda1380_reset_lo(void) 369inline static void __uda1380_reset_lo(void)
373{ 370{
374#ifdef HAVE_UDA1380
375 and_l(~(1<<29), &GPIO_OUT); 371 and_l(~(1<<29), &GPIO_OUT);
376#endif
377} 372}
378 373
379void main(void) 374void main(void)
@@ -385,8 +380,6 @@ void main(void)
385 bool rec_button = false; 380 bool rec_button = false;
386 bool hold_status = false; 381 bool hold_status = false;
387 int data; 382 int data;
388 extern int line; /* From common.c */
389 extern int remote_line; /* From common.c */
390 383
391 /* We want to read the buttons as early as possible, before the user 384 /* We want to read the buttons as early as possible, before the user
392 releases the ON button */ 385 releases the ON button */
@@ -422,22 +415,16 @@ void main(void)
422 backlight_hw_off(); 415 backlight_hw_off();
423 416
424 /* Remote backlight ON */ 417 /* Remote backlight ON */
425#ifdef HAVE_REMOTE_LCD
426 remote_backlight_hw_on(); 418 remote_backlight_hw_on();
427#endif
428 419
429 system_init(); 420 system_init();
430 kernel_init(); 421 kernel_init();
431 422
432 __uda1380_reset_lo(); 423 __uda1380_reset_lo();
433 424
434#ifdef HAVE_ADJUSTABLE_CPU_FREQ
435 /* Set up waitstates for the peripherals */ 425 /* Set up waitstates for the peripherals */
436 set_cpu_frequency(0); /* PLL off */ 426 set_cpu_frequency(0); /* PLL off */
437#ifdef CPU_COLDFIRE
438 coldfire_set_pllcr_audio_bits(DEFAULT_PLLCR_AUDIO_BITS); 427 coldfire_set_pllcr_audio_bits(DEFAULT_PLLCR_AUDIO_BITS);
439#endif
440#endif
441 enable_irq(); 428 enable_irq();
442 429
443#ifdef HAVE_EEPROM_SETTINGS 430#ifdef HAVE_EEPROM_SETTINGS
@@ -547,10 +534,8 @@ void main(void)
547 lcd_putsxy((LCD_WIDTH-w)/2, (LCD_HEIGHT-h)/2, msg); 534 lcd_putsxy((LCD_WIDTH-w)/2, (LCD_HEIGHT-h)/2, msg);
548 lcd_update(); 535 lcd_update();
549 536
550#ifdef HAVE_REMOTE_LCD
551 lcd_remote_puts(0, 3, msg); 537 lcd_remote_puts(0, 3, msg);
552 lcd_remote_update(); 538 lcd_remote_update();
553#endif
554 539
555#ifdef HAVE_EEPROM_SETTINGS 540#ifdef HAVE_EEPROM_SETTINGS
556 if (firmware_settings.initialized) 541 if (firmware_settings.initialized)
@@ -608,7 +593,7 @@ void main(void)
608 593
609 printf("Loading firmware"); 594 printf("Loading firmware");
610 i = load_firmware((unsigned char *)DRAM_START, BOOTFILE, MAX_LOADSIZE); 595 i = load_firmware((unsigned char *)DRAM_START, BOOTFILE, MAX_LOADSIZE);
611 if(i < 0) 596 if(i <= EFILE_EMPTY)
612 printf("Error: %s", loader_strerror(i)); 597 printf("Error: %s", loader_strerror(i));
613 598
614 if (i > 0) 599 if (i > 0)