1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2008 by Maurus Cuelenaere
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"
34 static void load_fw(unsigned char* ptr
, unsigned int len
)
38 asm volatile("ldr pc, =0x1EE0000");
43 unsigned char* loadbuffer
;
45 int(*kernel_entry
)(void);
48 /* Make sure interrupts are disabled */
49 set_irq_level(IRQ_DISABLED
);
50 set_fiq_status(FIQ_DISABLED
);
54 /* Now enable interrupts */
55 set_irq_level(IRQ_ENABLED
);
56 set_fiq_status(FIQ_ENABLED
);
63 #ifdef HAVE_LCD_ENABLE
66 lcd_setfont(FONT_SYSFIXED
);
68 printf("Rockbox boot loader");
69 printf("Version %s", APPSVERSION
);
73 printf("ATA error: %d", ret
);
75 /* If no button is held, start the OF */
76 if(button_read_device() == 0)
78 printf("Loading Creative firmware...");
80 loadbuffer
= (unsigned char*)0x00A00000;
81 ret
= load_minifs_file("creativeos.jrm", loadbuffer
);
84 set_irq_level(IRQ_DISABLED
);
85 set_fiq_status(FIQ_DISABLED
);
87 load_fw(loadbuffer
, ret
);
96 ret
= disk_mount_all();
100 printf("Loading Rockbox firmware...");
102 loadbuffer
= (unsigned char*)0x00900000;
103 buffer_size
= (unsigned char*)0x01900000 - loadbuffer
;
105 ret
= load_firmware(loadbuffer
, BOOTFILE
, buffer_size
);
107 error(EBOOTFILE
, ret
);
111 kernel_entry
= (void*) loadbuffer
;
112 ret
= kernel_entry();