diff options
Diffstat (limited to 'bootloader/mini2440.c')
-rw-r--r-- | bootloader/mini2440.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/bootloader/mini2440.c b/bootloader/mini2440.c index 2ff93a407e..7750d07559 100644 --- a/bootloader/mini2440.c +++ b/bootloader/mini2440.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #include "power.h" | 39 | #include "power.h" |
40 | #include "file.h" | 40 | #include "file.h" |
41 | #include "common.h" | 41 | #include "common.h" |
42 | #include "rb-loader.h" | ||
43 | #include "loader_strerror.h" | ||
42 | #include "sd.h" | 44 | #include "sd.h" |
43 | #include "backlight-target.h" | 45 | #include "backlight-target.h" |
44 | #include "lcd-target.h" | 46 | #include "lcd-target.h" |
@@ -97,26 +99,23 @@ int main(void) | |||
97 | printf("Loading firmware"); | 99 | printf("Loading firmware"); |
98 | 100 | ||
99 | /* Flush out anything pending first */ | 101 | /* Flush out anything pending first */ |
100 | cpucache_invalidate(); | 102 | commit_discard_idcache(); |
101 | 103 | ||
102 | loadbuffer = (unsigned char*) 0x31000000; | 104 | loadbuffer = (unsigned char*) 0x31000000; |
103 | buffer_size = (unsigned char*)0x31400000 - loadbuffer; | 105 | buffer_size = (unsigned char*)0x31400000 - loadbuffer; |
104 | 106 | ||
105 | rc = load_firmware(loadbuffer, BOOTFILE, buffer_size); | 107 | rc = load_firmware(loadbuffer, BOOTFILE, buffer_size); |
106 | if(rc < 0) | 108 | if(rc <= 0) |
107 | error(EBOOTFILE, rc, true); | 109 | error(EBOOTFILE, rc, true); |
108 | 110 | ||
109 | printf("Loaded firmware %d\n", rc); | 111 | printf("Loaded firmware %d\n", rc); |
110 | 112 | ||
111 | /* storage_close(); */ | 113 | /* storage_close(); */ |
112 | system_prepare_fw_start(); | 114 | system_prepare_fw_start(); |
113 | 115 | ||
114 | if (rc == EOK) | 116 | commit_discard_idcache(); |
115 | { | 117 | kernel_entry = (void*) loadbuffer; |
116 | cpucache_invalidate(); | 118 | rc = kernel_entry(); |
117 | kernel_entry = (void*) loadbuffer; | ||
118 | rc = kernel_entry(); | ||
119 | } | ||
120 | 119 | ||
121 | /* end stop - should not get here */ | 120 | /* end stop - should not get here */ |
122 | led_flash(LED_ALL, LED_NONE); | 121 | led_flash(LED_ALL, LED_NONE); |