From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1A1A1DDDEA for ; Thu, 10 Jul 2008 06:24:25 +1000 (EST) Subject: Re: [PATCH] powerpc: Fix problems with 32bit PPC's running with more than 2GB of RAM From: Benjamin Herrenschmidt To: Stefan Roese In-Reply-To: <1215611076-13518-1-git-send-email-sr@denx.de> References: <1215611076-13518-1-git-send-email-sr@denx.de> Content-Type: text/plain Date: Thu, 10 Jul 2008 06:02:38 +1000 Message-Id: <1215633758.8970.372.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org Reply-To: benh@kernel.crashing.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2008-07-09 at 15:44 +0200, Stefan Roese wrote: > This patch enables 32bit PPC's (with 36bit physical address space, e.g. > IBM/AMCC PPC44x) to run with more than 2GB 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 But DMAs will break no ? Ben. > --- > arch/powerpc/mm/init_32.c | 4 ++-- > arch/powerpc/mm/mem.c | 8 ++++---- > arch/powerpc/mm/mmu_decl.h | 4 ++-- > 3 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c > index 1952b4d..325ccdd 100644 > --- a/arch/powerpc/mm/init_32.c > +++ b/arch/powerpc/mm/init_32.c > @@ -56,8 +56,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); > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > index 51f82d8..55ef772 100644 > --- a/arch/powerpc/mm/mem.c > +++ b/arch/powerpc/mm/mem.c > @@ -329,7 +329,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 > @@ -348,10 +348,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; > diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h > index 0480225..4e46c63 100644 > --- a/arch/powerpc/mm/mmu_decl.h > +++ b/arch/powerpc/mm/mmu_decl.h > @@ -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; >