summaryrefslogtreecommitdiff
path: root/lib_m68k/bootm.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-02-27 21:51:46 -0600
committerMarian Balakowicz <m8@semihalf.com>2008-02-29 12:32:50 +0100
commit274cea2bddbca10cdad7daa518951b75c44ef6bc (patch)
tree8978d23a1fbcbcc5811db1b1b2fc1351fa542665 /lib_m68k/bootm.c
parentd2bc095a639672def11d5d043b5688d0dbd692ec (diff)
downloadu-boot-imx-274cea2bddbca10cdad7daa518951b75c44ef6bc.zip
u-boot-imx-274cea2bddbca10cdad7daa518951b75c44ef6bc.tar.gz
u-boot-imx-274cea2bddbca10cdad7daa518951b75c44ef6bc.tar.bz2
[new uImage] rework error handling so common functions don't reset
Changed image_get_ramdisk() to just return NULL on error and have get_ramdisk() propogate that error to the caller. It's left to the caller to call do_reset() if it wants to. Also moved calling do_reset() in get_fdt() and fdt_relocate() on ppc to a common location. In the future we will change get_fdt() and fdt_relocate() to return success/failure and not call do_reset() at all. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Marian Balakowicz <m8@semihalf.com>
Diffstat (limited to 'lib_m68k/bootm.c')
-rw-r--r--lib_m68k/bootm.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c
index 74240af..c9d2a27 100644
--- a/lib_m68k/bootm.c
+++ b/lib_m68k/bootm.c
@@ -35,6 +35,8 @@
DECLARE_GLOBAL_DATA_PTR;
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
#define PHYSADDR(x) x
#define LINUX_MAX_ENVS 256
@@ -52,6 +54,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
ulong rd_data_start, rd_data_end, rd_len;
ulong initrd_start, initrd_end;
+ int ret;
ulong cmd_start, cmd_end;
bd_t *kbd;
@@ -95,9 +98,12 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
/* find ramdisk */
- get_ramdisk (cmdtp, flag, argc, argv, images,
+ ret = get_ramdisk (cmdtp, flag, argc, argv, images,
IH_ARCH_M68K, &rd_data_start, &rd_data_end);
+ if (ret)
+ goto error;
+
rd_len = rd_data_end - rd_data_start;
alloc_current = ramdisk_high (alloc_current, rd_data_start, rd_len,
sp_limit, get_sp (), &initrd_start, &initrd_end);
@@ -117,6 +123,11 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
*/
(*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
/* does not return */
+ return ;
+
+error:
+ do_reset (cmdtp, flag, argc, argv);
+ return ;
}
static ulong get_sp (void)