summaryrefslogtreecommitdiff
path: root/bootloader
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/common.c3
-rwxr-xr-xbootloader/ondavx747.c44
2 files changed, 19 insertions, 28 deletions
diff --git a/bootloader/common.c b/bootloader/common.c
index c9309a67db..4ac421d872 100644
--- a/bootloader/common.c
+++ b/bootloader/common.c
@@ -40,8 +40,7 @@
40#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \ 40#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \
41 || defined(SANSA_E200) || defined(SANSA_C200) || defined(GIGABEAT_F) \ 41 || defined(SANSA_E200) || defined(SANSA_C200) || defined(GIGABEAT_F) \
42 || defined(PHILIPS_SA9200) || (CONFIG_CPU == AS3525) || defined(COWON_D2) \ 42 || defined(PHILIPS_SA9200) || (CONFIG_CPU == AS3525) || defined(COWON_D2) \
43 || defined(MROBE_100) || defined(PHILIPS_HDD1630) || defined(ONDA_VX747) \ 43 || defined(MROBE_100) || defined(PHILIPS_HDD1630) || defined(MROBE_500)
44 || defined(MROBE_500)
45bool verbose = false; 44bool verbose = false;
46#else 45#else
47bool verbose = true; 46bool verbose = true;
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c
index 0b97a2e81c..6a04c1ba85 100755
--- a/bootloader/ondavx747.c
+++ b/bootloader/ondavx747.c
@@ -22,6 +22,7 @@
22#include "config.h" 22#include "config.h"
23#include "jz4740.h" 23#include "jz4740.h"
24#include "backlight.h" 24#include "backlight.h"
25#include "backlight-target.h"
25#include "font.h" 26#include "font.h"
26#include "lcd.h" 27#include "lcd.h"
27#include "usb.h" 28#include "usb.h"
@@ -46,10 +47,7 @@ static void show_splash(int timeout, const char *msg)
46static void usb_mode(void) 47static void usb_mode(void)
47{ 48{
48 int button; 49 int button;
49 50
50 /* Init backlight */
51 backlight_init();
52
53 /* Init USB */ 51 /* Init USB */
54 usb_init(); 52 usb_init();
55 usb_start_monitoring(); 53 usb_start_monitoring();
@@ -88,8 +86,7 @@ static void usb_mode(void)
88 86
89static void boot_of(void) 87static void boot_of(void)
90{ 88{
91 /* Init backlight */ 89 /* Do nothing atm */
92 backlight_init();
93} 90}
94 91
95int main(void) 92int main(void)
@@ -99,45 +96,38 @@ int main(void)
99 int dummy; 96 int dummy;
100#endif 97#endif
101 void (*kernel_entry)(void); 98 void (*kernel_entry)(void);
102 99
103 kernel_init(); 100 kernel_init();
104 lcd_init(); 101 lcd_init();
105 font_init(); 102 font_init();
106 lcd_setfont(FONT_SYSFIXED); 103 lcd_setfont(FONT_SYSFIXED);
107 button_init(); 104 button_init();
108 adc_init(); 105 adc_init();
106 backlight_init();
109 107
110 reset_screen(); 108 reset_screen();
111 109 printf(MODEL_NAME" Rockbox Bootloader");
110 printf("Version "APPSVERSION);
111
112 rc = storage_init();
113 if(rc)
114 error(EATA, rc);
115
112#ifdef HAVE_TOUCHSCREEN 116#ifdef HAVE_TOUCHSCREEN
113 rc = button_read_device(&dummy); 117 rc = button_read_device(&dummy);
114#else 118#else
115 rc = button_read_device(); 119 rc = button_read_device();
116#endif 120#endif
117 121
118 if(rc & BUTTON_VOL_UP) 122 if(rc & BUTTON_VOL_UP)
119 usb_mode(); 123 usb_mode();
120 else if(button_hold()) 124 else if(button_hold())
121 boot_of(); 125 boot_of();
122 else if(rc)
123 verbose = true;
124
125 /* Only enable backlight when button is pressed */
126 if(verbose)
127 {
128 backlight_init();
129 printf(MODEL_NAME" Rockbox Bootloader");
130 printf("Version "APPSVERSION);
131 }
132
133 rc = storage_init();
134 if(rc)
135 error(EATA, rc);
136 126
137 rc = disk_mount_all(); 127 rc = disk_mount_all();
138 if (rc <= 0) 128 if (rc <= 0)
139 error(EDISK,rc); 129 error(EDISK,rc);
140 130
141 printf("Loading firmware"); 131 printf("Loading firmware");
142 rc = load_firmware((unsigned char *)CONFIG_SDRAM_START, BOOTFILE, 0x400000); 132 rc = load_firmware((unsigned char *)CONFIG_SDRAM_START, BOOTFILE, 0x400000);
143 if(rc < 0) 133 if(rc < 0)
@@ -147,14 +137,16 @@ int main(void)
147 { 137 {
148 printf("Starting Rockbox..."); 138 printf("Starting Rockbox...");
149 adc_close(); /* Disable SADC */ 139 adc_close(); /* Disable SADC */
140 _backlight_off(); /* Force backlight off to prevent LCD 'flicker' */
141
150 disable_interrupt(); 142 disable_interrupt();
151 kernel_entry = (void*) CONFIG_SDRAM_START; 143 kernel_entry = (void*) CONFIG_SDRAM_START;
152 kernel_entry(); 144 kernel_entry();
153 } 145 }
154 146
155 /* Halt */ 147 /* Halt */
156 while (1) 148 while (1)
157 core_idle(); 149 core_idle();
158 150
159 return 0; 151 return 0;
160} 152}