diff options
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/SOURCES | 3 | ||||
-rw-r--r-- | bootloader/imx233.c | 91 |
2 files changed, 94 insertions, 0 deletions
diff --git a/bootloader/SOURCES b/bootloader/SOURCES index c56acb25ba..3e173386e7 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES | |||
@@ -55,6 +55,9 @@ creativezvm.c | |||
55 | #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 | 55 | #elif CONFIG_CPU==AS3525 || CONFIG_CPU==AS3525v2 |
56 | sansa_as3525.c | 56 | sansa_as3525.c |
57 | show_logo.c | 57 | show_logo.c |
58 | #elif CONFIG_CPU==IMX233 | ||
59 | imx233.c | ||
60 | show_logo.c | ||
58 | #elif defined(LYRE_PROTO1) | 61 | #elif defined(LYRE_PROTO1) |
59 | lyre_proto1.c | 62 | lyre_proto1.c |
60 | show_logo.c | 63 | show_logo.c |
diff --git a/bootloader/imx233.c b/bootloader/imx233.c new file mode 100644 index 0000000000..cded5a119a --- /dev/null +++ b/bootloader/imx233.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2011 by amaury Pouly | ||
11 | * | ||
12 | * Based on Rockbox iriver bootloader by Linus Nielsen Feltzing | ||
13 | * and the ipodlinux bootloader by Daniel Palffy and Bernard Leach | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version 2 | ||
18 | * of the License, or (at your option) any later version. | ||
19 | * | ||
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
21 | * KIND, either express or implied. | ||
22 | * | ||
23 | ****************************************************************************/ | ||
24 | |||
25 | #include <stdio.h> | ||
26 | #include <system.h> | ||
27 | #include <inttypes.h> | ||
28 | #include "config.h" | ||
29 | #include "gcc_extensions.h" | ||
30 | #include "lcd.h" | ||
31 | #include "backlight.h" | ||
32 | #include "button-target.h" | ||
33 | #include "common.h" | ||
34 | #include "storage.h" | ||
35 | #include "disk.h" | ||
36 | #include "panic.h" | ||
37 | #include "power.h" | ||
38 | |||
39 | int show_logo(void); | ||
40 | |||
41 | void main(void) NORETURN_ATTR; | ||
42 | void main(void) | ||
43 | { | ||
44 | unsigned char* loadbuffer; | ||
45 | int buffer_size; | ||
46 | void(*kernel_entry)(void); | ||
47 | int ret; | ||
48 | |||
49 | system_init(); | ||
50 | kernel_init(); | ||
51 | |||
52 | enable_irq(); | ||
53 | |||
54 | lcd_init(); | ||
55 | show_logo(); | ||
56 | |||
57 | backlight_init(); | ||
58 | |||
59 | button_init_device(); | ||
60 | |||
61 | ret = storage_init(); | ||
62 | if(ret < 0) | ||
63 | error(EATA, ret, true); | ||
64 | |||
65 | while(!disk_init(IF_MV(0))) | ||
66 | panicf("disk_init failed!"); | ||
67 | |||
68 | while((ret = disk_mount_all()) <= 0) | ||
69 | { | ||
70 | error(EDISK, ret, true); | ||
71 | } | ||
72 | |||
73 | printf("Loading firmware"); | ||
74 | |||
75 | loadbuffer = (unsigned char*)DRAM_ORIG; /* DRAM */ | ||
76 | buffer_size = (int)(loadbuffer + DRAM_SIZE - TTB_SIZE); | ||
77 | |||
78 | while((ret = load_firmware(loadbuffer, BOOTFILE, buffer_size)) < 0) | ||
79 | { | ||
80 | error(EBOOTFILE, ret, true); | ||
81 | } | ||
82 | |||
83 | kernel_entry = (void*) loadbuffer; | ||
84 | //cpucache_invalidate(); | ||
85 | printf("Executing"); | ||
86 | kernel_entry(); | ||
87 | printf("ERR: Failed to boot"); | ||
88 | |||
89 | /* never returns */ | ||
90 | while(1) ; | ||
91 | } | ||