1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 by Bob Cousins, Lyre Project
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 /* Include Standard files */
36 #include "backlight.h"
43 #include "backlight-target.h"
44 #include "lcd-target.h"
45 #include "debug-target.h"
46 #include "dma-target.h"
47 #include "uart-s3c2440.h"
48 #include "led-mini2440.h"
53 unsigned char* loadbuffer
;
56 int(*kernel_entry
)(void);
60 /* NB: something in system_init() prevents H-JTAG from downloading */
63 /* enable_interrupt(IRQ_FIQ_STATUS); */
66 lcd_setfont(FONT_SYSFIXED
);
71 uart_init_device(DEBUG_UART_PORT
);
73 /* mini2440_test(); */
75 /* Show debug messages if button is pressed */
76 if(button_read_device() & BUTTON_MENU
)
79 printf("Rockbox boot loader");
80 printf("Version %s", APPSVERSION
);
90 rc
= disk_mount_all();
96 printf("Loading firmware");
98 /* Flush out anything pending first */
99 cpucache_invalidate();
101 loadbuffer
= (unsigned char*) 0x31000000;
102 buffer_size
= (unsigned char*)0x31400000 - loadbuffer
;
104 rc
= load_firmware(loadbuffer
, BOOTFILE
, buffer_size
);
106 error(EBOOTFILE
, rc
);
108 printf("Loaded firmware %d\n", rc
);
110 /* storage_close(); */
111 system_prepare_fw_start();
115 cpucache_invalidate();
116 kernel_entry
= (void*) loadbuffer
;
120 /* end stop - should not get here */
121 led_flash(LED_ALL
, LED_NONE
);
122 while (1); /* avoid warning */