summaryrefslogtreecommitdiff
path: root/bootloader/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/main.c')
-rw-r--r--bootloader/main.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/bootloader/main.c b/bootloader/main.c
index 5cc995c855..63641c5d9a 100644
--- a/bootloader/main.c
+++ b/bootloader/main.c
@@ -45,6 +45,13 @@
45 45
46int line = 0; 46int line = 0;
47 47
48char *modelname[] =
49{
50 "H120/140",
51 "H110/115",
52 "H300"
53};
54
48int usb_screen(void) 55int usb_screen(void)
49{ 56{
50 return 0; 57 return 0;
@@ -94,6 +101,7 @@ int load_firmware(void)
94 int rc; 101 int rc;
95 int len; 102 int len;
96 unsigned long chksum; 103 unsigned long chksum;
104 char model[5];
97 unsigned long sum; 105 unsigned long sum;
98 int i; 106 int i;
99 unsigned char *buf = (unsigned char *)DRAM_START; 107 unsigned char *buf = (unsigned char *)DRAM_START;
@@ -119,6 +127,16 @@ int load_firmware(void)
119 lcd_puts(0, line++, str); 127 lcd_puts(0, line++, str);
120 lcd_update(); 128 lcd_update();
121 129
130 rc = read(fd, model, 4);
131 if(rc < 4)
132 return -3;
133
134 model[4] = 0;
135
136 snprintf(str, 80, "Model name: %s", model);
137 lcd_puts(0, line++, str);
138 lcd_update();
139
122 lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET); 140 lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET);
123 141
124 rc = read(fd, buf, len); 142 rc = read(fd, buf, len);
@@ -197,12 +215,13 @@ void main(void)
197 215
198 lcd_setfont(FONT_SYSFIXED); 216 lcd_setfont(FONT_SYSFIXED);
199 217
200 snprintf(buf, 256, "Rockboot version 2"); 218 snprintf(buf, 256, "Rockboot version 3");
201 lcd_puts(0, line++, buf); 219 lcd_puts(0, line++, buf);
202 220
203 sleep(HZ/50); /* Allow the button driver to check the buttons */ 221 sleep(HZ/50); /* Allow the button driver to check the buttons */
204 222
205 if(button_status() & BUTTON_REC) { 223 if(button_status() & BUTTON_REC ||
224 button_status() & BUTTON_RC_REC) {
206 lcd_puts(0, 8, "Starting original firmware..."); 225 lcd_puts(0, 8, "Starting original firmware...");
207 lcd_update(); 226 lcd_update();
208 start_iriver_fw(); 227 start_iriver_fw();