summaryrefslogtreecommitdiffstats
path: root/bootloader/mini2440.c
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2012-03-04 15:34:29 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2013-06-27 13:50:11 +0200
commit0b29691324e5700f15ea653592bf29f8552d47d7 (patch)
tree00e4f77f28c813a493cd8af22170f486f6e82903 /bootloader/mini2440.c
parent46ea8bfe7c690c8db230fff3a582a69779f8e432 (diff)
downloadrockbox-0b29691324e5700f15ea653592bf29f8552d47d7.tar.gz
rockbox-0b29691324e5700f15ea653592bf29f8552d47d7.tar.bz2
rockbox-0b29691324e5700f15ea653592bf29f8552d47d7.zip
Move load_firmware() to separate file
The idea is to share loading code between bootloaders and rolo(). Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd Reviewed-on: http://gerrit.rockbox.org/190 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Diffstat (limited to 'bootloader/mini2440.c')
-rw-r--r--bootloader/mini2440.c17
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 @@
#include "power.h"
#include "file.h"
#include "common.h"
+#include "rb-loader.h"
+#include "loader_strerror.h"
#include "sd.h"
#include "backlight-target.h"
#include "lcd-target.h"
@@ -97,26 +99,23 @@ int main(void)
printf("Loading firmware");
/* Flush out anything pending first */
- cpucache_invalidate();
+ commit_discard_idcache();
loadbuffer = (unsigned char*) 0x31000000;
buffer_size = (unsigned char*)0x31400000 - loadbuffer;
rc = load_firmware(loadbuffer, BOOTFILE, buffer_size);
- if(rc < 0)
+ if(rc <= 0)
error(EBOOTFILE, rc, true);
-
+
printf("Loaded firmware %d\n", rc);
/* storage_close(); */
system_prepare_fw_start();
- if (rc == EOK)
- {
- cpucache_invalidate();
- kernel_entry = (void*) loadbuffer;
- rc = kernel_entry();
- }
+ commit_discard_idcache();
+ kernel_entry = (void*) loadbuffer;
+ rc = kernel_entry();
/* end stop - should not get here */
led_flash(LED_ALL, LED_NONE);