]> err.no Git - linux-2.6/commitdiff
powerpc: Fix problems with 32bit PPC's running with >= 4GB of RAM
authorStefan Roese <sr@denx.de>
Wed, 9 Jul 2008 15:09:23 +0000 (01:09 +1000)
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>
Wed, 9 Jul 2008 18:13:01 +0000 (14:13 -0400)
This patch enables 32bit PPC's (with 36bit physical address space, e.g.
IBM/AMCC PPC44x) to run with >= 4GB of RAM. Mostly its just replacing types
(unsigned long -> phys_addr_t).

Tested on an AMCC Katmai with 4GB of DDR2.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
arch/powerpc/mm/init_32.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/mmu_decl.h

index 45418590b6a925587aa9bfb16c3e0c6eb9691524..388ceda632f346fa5314c4254512807b414802b3 100644 (file)
@@ -57,8 +57,8 @@
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
-unsigned long total_memory;
-unsigned long total_lowmem;
+phys_addr_t total_memory;
+phys_addr_t total_lowmem;
 
 phys_addr_t memstart_addr = (phys_addr_t)~0ull;
 EXPORT_SYMBOL(memstart_addr);
index 776ba6ad5e1e7d7ed11bac9be5951b48f77e8cc4..1ca2235f0965339e3d7ec3d2c4f1c0d40c225a25 100644 (file)
@@ -330,7 +330,7 @@ static int __init mark_nonram_nosave(void)
 void __init paging_init(void)
 {
        unsigned long total_ram = lmb_phys_mem_size();
-       unsigned long top_of_ram = lmb_end_of_DRAM();
+       phys_addr_t top_of_ram = lmb_end_of_DRAM();
        unsigned long max_zone_pfns[MAX_NR_ZONES];
 
 #ifdef CONFIG_PPC32
@@ -349,10 +349,10 @@ void __init paging_init(void)
        kmap_prot = PAGE_KERNEL;
 #endif /* CONFIG_HIGHMEM */
 
-       printk(KERN_DEBUG "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
-              top_of_ram, total_ram);
+       printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%lx\n",
+              (u64)top_of_ram, total_ram);
        printk(KERN_DEBUG "Memory hole size: %ldMB\n",
-              (top_of_ram - total_ram) >> 20);
+              (long int)((top_of_ram - total_ram) >> 20));
        memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
 #ifdef CONFIG_HIGHMEM
        max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT;
index 46585b7bb19418e5436ea878f91019b79ca47935..fab3cfad40992d45dcae4113b862497dfea42632 100644 (file)
@@ -49,8 +49,8 @@ extern unsigned int num_tlbcam_entries;
 extern unsigned long ioremap_bot;
 extern unsigned long __max_low_memory;
 extern phys_addr_t __initial_memory_limit_addr;
-extern unsigned long total_memory;
-extern unsigned long total_lowmem;
+extern phys_addr_t total_memory;
+extern phys_addr_t total_lowmem;
 extern phys_addr_t memstart_addr;
 extern phys_addr_t lowmem_end_addr;