summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-05-08 08:06:06 +0000
committerTom Rini <trini@ti.com>2013-05-14 15:37:26 -0400
commit2a08b740e39d618f9428cfdcf8e1caa7239bcb8f (patch)
treeaf92c2e9df1589c85446bf64d6c29d4618bc6eb5
parent24507cf50aa7438649bc4fafe80fb2eb0bf9dd90 (diff)
downloadu-boot-imx-2a08b740e39d618f9428cfdcf8e1caa7239bcb8f.zip
u-boot-imx-2a08b740e39d618f9428cfdcf8e1caa7239bcb8f.tar.gz
u-boot-imx-2a08b740e39d618f9428cfdcf8e1caa7239bcb8f.tar.bz2
sparc: Use image_setup_linux() instead of local code
Sparc only really sets up the ramdisk, but we should still use image_setup_linux() so that setup is common across all architectures that use the FDT. Cover-letter Introduce a common image_setup_linux() function This series continues the work to tidy up the image code. Each architecture has its own code for setting up ready for booting linux. An attempt is made here to unify these in a single image_setup_linux() function. The part of the image code that deals with FDT is split into image-fdt.c and a few tweaks are added to make FIT images more viable in SPL. END Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/sparc/lib/bootm.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/sparc/lib/bootm.c b/arch/sparc/lib/bootm.c
index bcc6358..1a9343c 100644
--- a/arch/sparc/lib/bootm.c
+++ b/arch/sparc/lib/bootm.c
@@ -95,10 +95,8 @@ void arch_lmb_reserve(struct lmb *lmb)
int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t * images)
{
char *bootargs;
- ulong initrd_start, initrd_end;
ulong rd_len;
void (*kernel) (struct linux_romvec *, void *);
- struct lmb *lmb = &images->lmb;
int ret;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
@@ -131,24 +129,23 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t * im
* extracted and is writeable.
*/
+ ret = image_setup_linux(images);
+ if (ret) {
+ puts("### Failed to relocate RAM disk\n");
+ goto error;
+ }
+
/* Calc length of RAM disk, if zero no ramdisk available */
rd_len = images->rd_end - images->rd_start;
if (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");
- goto error;
- }
-
/* Update SPARC kernel header so that Linux knows
* what is going on and where to find RAM disk.
*
* Set INITRD Image address relative to RAM Start
*/
linux_hdr->hdr_input.ver_0203.sparc_ramdisk_image =
- initrd_start - CONFIG_SYS_RAM_BASE;
+ images->initrd_start - CONFIG_SYS_RAM_BASE;
linux_hdr->hdr_input.ver_0203.sparc_ramdisk_size = rd_len;
/* Clear READ ONLY flag if set to non-zero */
linux_hdr->hdr_input.ver_0203.root_flags = 1;