path: root/arch/nios2
diff options
authorSascha Hauer <>2014-01-09 09:59:59 +0100
committerSascha Hauer <>2014-01-10 11:53:18 +0100
commit9bd67f5e6184ecd03b8e052706218f2a741027c3 (patch)
tree51a5ac95bbc796e0acd756d1fa8df9b4a65f90fb /arch/nios2
parentf1025bbf3292c8c199e23e618c062ec1e9f2f055 (diff)
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 <>
Diffstat (limited to 'arch/nios2')
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c
index cc96290..77da119 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);