ARM: LPAE: use phys_addr_t for initrd location and size
Vitaly Andrianov [Fri, 22 Jun 2012 18:26:04 +0000 (14:26 -0400)]
This patch fixes the initrd setup code to use phys_addr_t instead of assuming
32-bit addressing.  Without this we cannot boot on systems where initrd is
located above the 4G physical address limit.

Change-Id: Ib2967e18edb30695e5c40e918ecea37a1f074fdb
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/195671
Reviewed-by: Adeel Raza <araza@nvidia.com>

arch/arm/mm/init.c

index 29bd831..b0a82cc 100644 (file)
 
 #include "mm.h"
 
-static unsigned long phys_initrd_start __initdata = 0;
+static phys_addr_t phys_initrd_start __initdata = 0;
 static unsigned long phys_initrd_size __initdata = 0;
 
 static int __init early_initrd(char *p)
 {
-       unsigned long start, size;
+       phys_addr_t start;
+       unsigned long size;
        char *endp;
 
        start = memparse(p, &endp);
@@ -350,14 +351,14 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
 #ifdef CONFIG_BLK_DEV_INITRD
        if (phys_initrd_size &&
            !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) {
-               pr_err("INITRD: 0x%08lx+0x%08lx is not a memory region - disabling initrd\n",
-                      phys_initrd_start, phys_initrd_size);
+               pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n",
+                      (u64)phys_initrd_start, phys_initrd_size);
                phys_initrd_start = phys_initrd_size = 0;
        }
        if (phys_initrd_size &&
            memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) {
-               pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n",
-                      phys_initrd_start, phys_initrd_size);
+               pr_err("INITRD: 0x%08llx+0x%08lx overlaps in-use memory region - disabling initrd\n",
+                      (u64)phys_initrd_start, phys_initrd_size);
                phys_initrd_start = phys_initrd_size = 0;
        }
        if (phys_initrd_size) {