aboutsummaryrefslogtreecommitdiffstats
path: root/lib_sparc/bootm.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-08-15 08:24:37 -0500
committerWolfgang Denk <wd@denx.de>2008-08-26 23:35:24 +0200
commitc4f9419c6b54958e0eddbcbc9e5a4a7b7ec99865 (patch)
treecdd3de7eec29a70630a6a98f1de434a4ae868cf7 /lib_sparc/bootm.c
parentc160a9544743e80e8889edb2275538e7764ce334 (diff)
downloadu-boot-midas-c4f9419c6b54958e0eddbcbc9e5a4a7b7ec99865.tar.gz
u-boot-midas-c4f9419c6b54958e0eddbcbc9e5a4a7b7ec99865.tar.bz2
u-boot-midas-c4f9419c6b54958e0eddbcbc9e5a4a7b7ec99865.zip
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 'lib_sparc/bootm.c')
-rw-r--r--lib_sparc/bootm.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c
index ac15396f69..71d34baadd 100644
--- a/lib_sparc/bootm.c
+++ b/lib_sparc/bootm.c
@@ -89,7 +89,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
char *bootargs;
ulong load;
ulong initrd_start, initrd_end;
- ulong rd_data_start, rd_data_end, rd_len;
+ ulong rd_len;
unsigned int data, len, checksum;
unsigned int initrd_addr, kernend;
void (*kernel) (struct linux_romvec *, void *);
@@ -139,19 +139,8 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
* extracted and is writeable.
*/
- /*
- * Are we going to use an initrd image?
- */
- ret = boot_get_ramdisk(argc, argv, images, IH_ARCH_SPARC,
- &rd_data_start, &rd_data_end);
- if (ret) {
- /* RAM disk found but was corrupt */
- puts("RAM Disk corrupt\n");
- goto error;
- }
-
/* Calc length of RAM disk, if zero no ramdisk available */
- rd_len = rd_data_end - rd_data_start;
+ rd_len = images->rd_end - images->rd_start;
if (rd_len) {
@@ -161,7 +150,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
*/
lmb_reserve(lmb, CFG_RELOC_MONITOR_BASE, CFG_RAM_END);
- ret = boot_ramdisk_high(lmb, rd_data_start, rd_len,
+ ret = boot_ramdisk_high(lmb, images->rd_start, rd_len,
&initrd_start, &initrd_end);
if (ret) {
puts("### Failed to relocate RAM disk\n");