Patchwork [U-Boot,07/11] MIPS: bootm: add support for generic relocation of init ramdisks

login
register
mail settings
Submitter Daniel Schwierzeck
Date June 8, 2013, 10:42 p.m.
Message ID <1370731370-32767-8-git-send-email-daniel.schwierzeck@gmail.com>
Download mbox | patch
Permalink /patch/249988/
State Superseded
Delegated to: Daniel Schwierzeck
Headers show

Comments

Daniel Schwierzeck - June 8, 2013, 10:42 p.m.
All linux kernels after v2.6 require a page-aligned location of
an external init ramdisk. Enable CONFIG_SYS_BOOT_RAMDISK_HIGH to
support this with the generic U-Boot relocation code.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
---
 arch/mips/include/asm/config.h | 1 +
 arch/mips/lib/bootm.c          | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

Patch

diff --git a/arch/mips/include/asm/config.h b/arch/mips/include/asm/config.h
index 36438be..6ddc349 100644
--- a/arch/mips/include/asm/config.h
+++ b/arch/mips/include/asm/config.h
@@ -22,5 +22,6 @@ 
 #define _ASM_CONFIG_H_
 
 #define CONFIG_LMB
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
 #endif
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index e13e0d5..741e088 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -170,6 +170,7 @@  static void boot_prep_linux_legacy(bootm_headers_t *images)
 {
 	char env_buf[12];
 	const char *cp;
+	ulong rd_start, rd_size;
 
 #ifdef CONFIG_MEMSIZE_IN_BYTES
 	sprintf(env_buf, "%lu", (ulong)gd->ram_size);
@@ -180,14 +181,17 @@  static void boot_prep_linux_legacy(bootm_headers_t *images)
 	      (ulong)(gd->ram_size >> 20));
 #endif /* CONFIG_MEMSIZE_IN_BYTES */
 
+	rd_start = UNCACHED_SDRAM(images->initrd_start);
+	rd_size = images->initrd_end - images->initrd_start;
+
 	linux_env_init();
 
 	linux_env_set("memsize", env_buf);
 
-	sprintf(env_buf, "0x%08X", (uint) UNCACHED_SDRAM(images->rd_start));
+	sprintf(env_buf, "0x%08lX", rd_start);
 	linux_env_set("initrd_start", env_buf);
 
-	sprintf(env_buf, "0x%X", (uint) (images->rd_end - images->rd_start));
+	sprintf(env_buf, "0x%lX", rd_size);
 	linux_env_set("initrd_size", env_buf);
 
 	sprintf(env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart));