1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2011 by Tomasz Moń
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
27 #include "backlight.h"
31 #include "uart-target.h"
34 extern void show_logo(void);
38 unsigned char* loadbuffer
;
40 int(*kernel_entry
)(void);
44 /* Make sure interrupts are disabled */
45 set_irq_level(IRQ_DISABLED
);
46 set_fiq_status(FIQ_DISABLED
);
50 /* Now enable interrupts */
51 set_irq_level(IRQ_ENABLED
);
52 set_fiq_status(FIQ_ENABLED
);
58 #ifdef HAVE_LCD_ENABLE
61 lcd_setfont(FONT_SYSFIXED
);
65 btn
= button_read_device();
67 printf("Rockbox boot loader");
68 printf("Version " RBVERSION
);
72 printf("SD error: %d", ret
);
76 ret
= disk_mount_all();
78 error(EDISK
, ret
, true);
80 if (btn
& BUTTON_PREV
)
82 printf("Loading OF firmware...");
83 printf("Loading vmlinux.bin...");
84 loadbuffer
= (unsigned char*)0x01008000;
85 buffer_size
= 0x200000;
87 ret
= load_raw_firmware(loadbuffer
, "/vmlinux.bin", buffer_size
);
91 printf("Unable to load vmlinux.bin");
95 printf("Loading initrd.bin...");
96 loadbuffer
= (unsigned char*)0x04400020;
97 buffer_size
= 0x200000;
98 ret
= load_raw_firmware(loadbuffer
, "/initrd.bin", buffer_size
);
103 system_prepare_fw_start();
105 kernel_entry
= (void*)0x01008000;
106 ret
= kernel_entry();
107 printf("FAILED to boot OF");
111 printf("Loading Rockbox firmware...");
113 loadbuffer
= (unsigned char*)CONFIG_SDRAM_START
;
114 buffer_size
= 0x1000000;
116 ret
= load_firmware(loadbuffer
, BOOTFILE
, buffer_size
);
120 error(EBOOTFILE
, ret
, true);
124 system_prepare_fw_start();
126 kernel_entry
= (void*) loadbuffer
;
127 ret
= kernel_entry();