From 1984af4f28bdabc88881ec8d04eea039855b62e4 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 9 Jan 2014 11:05:33 +0100 Subject: 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 --- arch/arm/lib/bootm.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'arch/arm/lib/bootm.c') 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); } -- cgit v1.2.3