Commit c9639421fd877fa0e95d7744dade002042eb721e

Authored by Daniel Schwierzeck
1 parent 426f87045c

MIPS: bootm: add missing initramfs relocation

The initramfs is currently only relocated if the user calls
the bootm ramdisk subcommand. If bootm should be used without
subcommands, the arch-specific bootm code needs to implement
the relocation.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

Showing 1 changed file with 20 additions and 0 deletions Side-by-side Diff

arch/mips/lib/bootm.c
... ... @@ -52,6 +52,20 @@
52 52 lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp);
53 53 }
54 54  
  55 +static int boot_setup_linux(bootm_headers_t *images)
  56 +{
  57 + int ret;
  58 + ulong rd_len;
  59 +
  60 + rd_len = images->rd_end - images->rd_start;
  61 + ret = boot_ramdisk_high(&images->lmb, images->rd_start,
  62 + rd_len, &images->initrd_start, &images->initrd_end);
  63 + if (ret)
  64 + return ret;
  65 +
  66 + return 0;
  67 +}
  68 +
55 69 static void linux_cmdline_init(void)
56 70 {
57 71 linux_argc = 1;
... ... @@ -224,6 +238,8 @@
224 238 int do_bootm_linux(int flag, int argc, char * const argv[],
225 239 bootm_headers_t *images)
226 240 {
  241 + int ret;
  242 +
227 243 /* No need for those on MIPS */
228 244 if (flag & BOOTM_STATE_OS_BD_T)
229 245 return -1;
... ... @@ -242,6 +258,10 @@
242 258 boot_jump_linux(images);
243 259 return 0;
244 260 }
  261 +
  262 + ret = boot_setup_linux(images);
  263 + if (ret)
  264 + return ret;
245 265  
246 266 boot_cmdline_linux(images);
247 267 boot_prep_linux(images);