arch: mips: Update initrd_start and initrd_end
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Wed, 24 Apr 2019 15:21:29 +0000 (17:21 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Fri, 3 May 2019 14:42:23 +0000 (16:42 +0200)
Microsemi SoC defines CONFIG_SYS_SDRAM_BASE to be 0x80000000, which
represents the start of kseg0 and represents a virtual address. Meaning
that the initrd_start and initrd_end point somewhere kseg0.
When these parameters are passed to linux kernel through DT
they are pointing somewhere in kseg0 which is a virtual address but linux
kernel expects the addresses to be physical addresses(in kuseg) because
it is converting the physical address to a virtual one.

Therefore update the uboot to pass the physical address of initrd_start
and initrd_end by converting them using the function virt_to_phys before
setting up the DT.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
arch/mips/lib/bootm.c

index 35152cb3f64afe122c1defb58b40fa006fe38d8a..6a462f3e5a5edf45ecb9f704d85d5bae6897a80a 100644 (file)
@@ -247,6 +247,8 @@ int arch_fixup_fdt(void *blob)
 
 static int boot_setup_fdt(bootm_headers_t *images)
 {
+       images->initrd_start = virt_to_phys((void *)images->initrd_start);
+       images->initrd_end = virt_to_phys((void *)images->initrd_end);
        return image_setup_libfdt(images, images->ft_addr, images->ft_len,
                &images->lmb);
 }