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 ****************************************************************************/
25 #include "ata-target.h"
28 #include "backlight.h"
32 #include "uart-target.h"
35 extern void show_logo(void);
39 unsigned char* loadbuffer
;
41 int(*kernel_entry
)(void);
45 /* Make sure interrupts are disabled */
46 set_irq_level(IRQ_DISABLED
);
47 set_fiq_status(FIQ_DISABLED
);
51 /* Now enable interrupts */
52 set_irq_level(IRQ_ENABLED
);
53 set_fiq_status(FIQ_ENABLED
);
59 #ifdef HAVE_LCD_ENABLE
62 lcd_setfont(FONT_SYSFIXED
);
66 btn
= button_read_device();
68 printf("Rockbox boot loader");
69 printf("Version " RBVERSION
);
73 printf("SD error: %d", ret
);
77 ret
= disk_mount_all();
79 error(EDISK
, ret
, true);
81 if (btn
& BUTTON_PREV
)
83 printf("Loading OF firmware...");
84 printf("Loading vmlinux.bin...");
85 loadbuffer
= (unsigned char*)0x01008000;
86 buffer_size
= 0x200000;
88 ret
= load_raw_firmware(loadbuffer
, "/vmlinux.bin", buffer_size
);
92 printf("Unable to load vmlinux.bin");
96 printf("Loading initrd.bin...");
97 loadbuffer
= (unsigned char*)0x04400020;
98 buffer_size
= 0x200000;
99 ret
= load_raw_firmware(loadbuffer
, "/initrd.bin", buffer_size
);
104 system_prepare_fw_start();
106 kernel_entry
= (void*)0x01008000;
107 ret
= kernel_entry();
108 printf("FAILED to boot OF");
112 printf("Loading Rockbox firmware...");
114 loadbuffer
= (unsigned char*)CONFIG_SDRAM_START
;
115 buffer_size
= 0x1000000;
117 ret
= load_firmware(loadbuffer
, BOOTFILE
, buffer_size
);
121 error(EBOOTFILE
, ret
, true);
125 system_prepare_fw_start();
127 kernel_entry
= (void*) loadbuffer
;
128 ret
= kernel_entry();