summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/bootm.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-01-09 11:05:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-01-10 11:53:19 +0100
commit1984af4f28bdabc88881ec8d04eea039855b62e4 (patch)
treef6c10f21ade8620e0083ad614a006e7513ee9a08 /arch/arm/lib/bootm.c
parent9bd67f5e6184ecd03b8e052706218f2a741027c3 (diff)
downloadbarebox-1984af4f28bdabc88881ec8d04eea039855b62e4.tar.gz
barebox-1984af4f28bdabc88881ec8d04eea039855b62e4.tar.xz
ARM: bootm: move os loading to do_bootm_linux
__do_bootm_linux is called from the uImage, zImage and raw handlers. In case of the zImage handler the kernel will already be loaded and the kernel load code in __do_bootm_linux will do nothing. Move the loading code to do_bootm_linux so that __do_bootm_linux will always be called with the kernel already loaded. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib/bootm.c')
-rw-r--r--arch/arm/lib/bootm.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 7401f2f05d..6f84cb309d 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -26,24 +26,6 @@ static int __do_bootm_linux(struct image_data *data, int swap)
{
unsigned long kernel;
unsigned long initrd_start = 0, initrd_size = 0, initrd_end = 0;
- struct memory_bank *bank;
- unsigned long load_address;
- int ret;
-
- if (data->os_address == UIMAGE_INVALID_ADDRESS) {
- bank = list_first_entry(&memory_banks,
- struct memory_bank, list);
- load_address = bank->start + SZ_32K;
- if (bootm_verbose(data))
- printf("no os load address, defaulting to 0x%08lx\n",
- load_address);
- } else {
- load_address = data->os_address;
- }
-
- ret = bootm_load_os(data, load_address);
- if (ret)
- return ret;
kernel = data->os_res->start + data->os_entry;
@@ -104,6 +86,25 @@ static int __do_bootm_linux(struct image_data *data, int swap)
static int do_bootm_linux(struct image_data *data)
{
+ struct memory_bank *bank;
+ unsigned long load_address;
+ int ret;
+
+ load_address = data->os_address;
+
+ if (load_address == UIMAGE_INVALID_ADDRESS) {
+ bank = list_first_entry(&memory_banks,
+ struct memory_bank, list);
+ load_address = bank->start + SZ_32K;
+ if (bootm_verbose(data))
+ printf("no os load address, defaulting to 0x%08lx\n",
+ load_address);
+ }
+
+ ret = bootm_load_os(data, load_address);
+ if (ret)
+ return ret;
+
return __do_bootm_linux(data, 0);
}