]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
MIPS: bootm: add support for generic relocation of init ramdisks
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Thu, 9 May 2013 15:10:06 +0000 (17:10 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tue, 13 Aug 2013 09:58:48 +0000 (11:58 +0200)
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
arch/mips/lib/bootm.c

index 6eb1cee2d8dd9e5a52b41ab1cc6190de7b9a1e43..3a891ba62727511706291cf292b0fb23b7ec2a02 100644 (file)
@@ -8,5 +8,6 @@
 #define _ASM_CONFIG_H_
 
 #define CONFIG_LMB
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
 #endif
index 257390b56079eaa0f55adc0d4e33f124c9792fad..27e0b1be849ce1b82b6f6c57feaa241fa1bfbf00 100644 (file)
@@ -147,6 +147,7 @@ static void boot_prep_linux(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);
@@ -157,14 +158,17 @@ static void boot_prep_linux(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));