summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-08 23:31:05 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-08 23:31:05 +0000
commitcb0610802495d2f767c78a0b07a0b8359238f590 (patch)
treeecf223f8233cedb90ee5ad055cab1b4bdd2c9ee8 /bootloader
parentea929a3e4547e9c709560803d2cea760ffe3e6a3 (diff)
downloadrockbox-cb0610802495d2f767c78a0b07a0b8359238f590.tar.gz
rockbox-cb0610802495d2f767c78a0b07a0b8359238f590.tar.bz2
rockbox-cb0610802495d2f767c78a0b07a0b8359238f590.zip
Meg-FX: Enable a real tick in the bootloader. Do cleanups before switching to firmware and cache handling. Put proper main return address in lr.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19368 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/gigabeat.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/bootloader/gigabeat.c b/bootloader/gigabeat.c
index 11ab93a5e2..a3732b0e06 100644
--- a/bootloader/gigabeat.c
+++ b/bootloader/gigabeat.c
@@ -75,11 +75,14 @@ void main(void)
int(*kernel_entry)(void);
system_init();
+ kernel_init(); /* Need the kernel to sleep */
+
+ enable_interrupt(IRQ_FIQ_STATUS);
+
lcd_init();
backlight_init();
button_init();
font_init();
- kernel_init(); /* Need the kernel to sleep */
adc_init();
lcd_setfont(FONT_SYSFIXED);
@@ -192,6 +195,9 @@ void main(void)
printf("Loading firmware");
+ /* Flush out anything pending first */
+ invalidate_icache();
+
loadbuffer = (unsigned char*) 0x31000000;
buffer_size = (unsigned char*)0x31400000 - loadbuffer;
@@ -199,10 +205,22 @@ void main(void)
if(rc < 0)
error(EBOOTFILE, rc);
+ storage_close();
+ system_prepare_fw_start();
+
if (rc == EOK)
{
+ invalidate_icache();
kernel_entry = (void*) loadbuffer;
rc = kernel_entry();
}
+
+#if 0
+ /* Halt */
+ while (1)
+ core_idle();
+#else
+ /* Return and restart */
+#endif
}