From 9bd67f5e6184ecd03b8e052706218f2a741027c3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 9 Jan 2014 09:59:59 +0100 Subject: bootm: introduce bootm_load_os helper The common bootm code used to load uImage contents to SDRAM before calling into the handlers if possible. This makes the handlers complicated since they have to handle many cases. Instead, introduce a helper to load the os after the handlers have figured out a good load address. Signed-off-by: Sascha Hauer --- arch/nios2/lib/bootm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arch/nios2/lib') diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c index cc96290b8d..77da119bde 100644 --- a/arch/nios2/lib/bootm.c +++ b/arch/nios2/lib/bootm.c @@ -36,9 +36,11 @@ static int do_bootm_linux(struct image_data *idata) { void (*kernel)(int, int, int, const char *); const char *commandline = linux_bootargs_get(); + int ret; - if (!idata->os_res) - return -EINVAL; + ret = bootm_load_os(idata, idata->os_address); + if (ret) + return ret; kernel = (void *)(idata->os_address + idata->os_entry); -- cgit v1.2.3