diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2008-08-15 08:24:37 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-08-26 23:35:24 +0200 |
commit | c4f9419c6b54958e0eddbcbc9e5a4a7b7ec99865 (patch) | |
tree | cdd3de7eec29a70630a6a98f1de434a4ae868cf7 /common/cmd_bootm.c | |
parent | c160a9544743e80e8889edb2275538e7764ce334 (diff) |
bootm: refactor ramdisk locating code
Move determing if we have a ramdisk and where its located into the
common code. Keep track of the ramdisk start and end in the
bootm_headers_t image struct.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r-- | common/cmd_bootm.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 3f63b847f0b..56236b91324 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -116,6 +116,33 @@ void __board_lmb_reserve(struct lmb *lmb) } void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve"))); +#if defined(__ARM__) + #define IH_INITRD_ARCH IH_ARCH_ARM +#elif defined(__avr32__) + #define IH_INITRD_ARCH IH_ARCH_AVR32 +#elif defined(__bfin__) + #define IH_INITRD_ARCH IH_ARCH_BLACKFIN +#elif defined(__I386__) + #define IH_INITRD_ARCH IH_ARCH_I386 +#elif defined(__M68K__) + #define IH_INITRD_ARCH IH_ARCH_M68K +#elif defined(__microblaze__) + #define IH_INITRD_ARCH IH_ARCH_MICROBLAZE +#elif defined(__mips__) + #define IH_INITRD_ARCH IH_ARCH_MIPS +#elif defined(__nios__) + #define IH_INITRD_ARCH IH_ARCH_NIOS +#elif defined(__nios2__) + #define IH_INITRD_ARCH IH_ARCH_NIOS2 +#elif defined(__PPC__) + #define IH_INITRD_ARCH IH_ARCH_PPC +#elif defined(__sh__) + #define IH_INITRD_ARCH IH_ARCH_SH +#elif defined(__sparc__) + #define IH_INITRD_ARCH IH_ARCH_SPARC +#else +# error Unknown CPU type +#endif /*******************************************************************/ /* bootm - boot application image from image in memory */ @@ -133,6 +160,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ulong load_start, load_end; ulong mem_start; phys_size_t mem_size; + int ret; struct lmb lmb; @@ -222,6 +250,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } + if (os == IH_OS_LINUX) { + /* find ramdisk */ + ret = boot_get_ramdisk (argc, argv, &images, IH_INITRD_ARCH, + &images.rd_start, &images.rd_end); + if (ret) { + puts ("Ramdisk image is corrupt\n"); + return 1; + } + } + image_start = (ulong)os_hdr; load_end = 0; type_name = genimg_get_type_name (type); |