aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c2
-rw-r--r--arch/powerpc/mm/hash_low_32.S4
-rw-r--r--arch/powerpc/mm/init_32.c13
-rw-r--r--arch/powerpc/mm/init_64.c3
-rw-r--r--arch/powerpc/mm/mem.c37
-rw-r--r--arch/powerpc/mm/numa.c1
-rw-r--r--arch/powerpc/mm/pgtable_32.c23
7 files changed, 62 insertions, 21 deletions
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index ada249bf9779..ce10e2b1b902 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -202,7 +202,7 @@ adjust_total_lowmem(void)
202 cam_max_size = max_lowmem_size; 202 cam_max_size = max_lowmem_size;
203 203
204 /* adjust lowmem size to max_lowmem_size */ 204 /* adjust lowmem size to max_lowmem_size */
205 ram = min(max_lowmem_size, total_lowmem); 205 ram = min(max_lowmem_size, (phys_addr_t)total_lowmem);
206 206
207 /* Calculate CAM values */ 207 /* Calculate CAM values */
208 __cam0 = 1UL << 2 * (__ilog2(ram) / 2); 208 __cam0 = 1UL << 2 * (__ilog2(ram) / 2);
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
index e10d76a860d3..ddeaf9e38ad5 100644
--- a/arch/powerpc/mm/hash_low_32.S
+++ b/arch/powerpc/mm/hash_low_32.S
@@ -191,7 +191,7 @@ _GLOBAL(add_hash_page)
191 add r3,r3,r0 /* note create_hpte trims to 24 bits */ 191 add r3,r3,r0 /* note create_hpte trims to 24 bits */
192 192
193#ifdef CONFIG_SMP 193#ifdef CONFIG_SMP
194 rlwinm r8,r1,0,0,18 /* use cpu number to make tag */ 194 rlwinm r8,r1,0,0,(31-THREAD_SHIFT) /* use cpu number to make tag */
195 lwz r8,TI_CPU(r8) /* to go in mmu_hash_lock */ 195 lwz r8,TI_CPU(r8) /* to go in mmu_hash_lock */
196 oris r8,r8,12 196 oris r8,r8,12
197#endif /* CONFIG_SMP */ 197#endif /* CONFIG_SMP */
@@ -526,7 +526,7 @@ _GLOBAL(flush_hash_pages)
526#ifdef CONFIG_SMP 526#ifdef CONFIG_SMP
527 addis r9,r7,mmu_hash_lock@ha 527 addis r9,r7,mmu_hash_lock@ha
528 addi r9,r9,mmu_hash_lock@l 528 addi r9,r9,mmu_hash_lock@l
529 rlwinm r8,r1,0,0,18 529 rlwinm r8,r1,0,0,(31-THREAD_SHIFT)
530 add r8,r8,r7 530 add r8,r8,r7
531 lwz r8,TI_CPU(r8) 531 lwz r8,TI_CPU(r8)
532 oris r8,r8,9 532 oris r8,r8,9
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 47325f23c51f..1952b4d3fa7f 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -59,7 +59,10 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
59unsigned long total_memory; 59unsigned long total_memory;
60unsigned long total_lowmem; 60unsigned long total_lowmem;
61 61
62phys_addr_t memstart_addr; 62phys_addr_t memstart_addr = (phys_addr_t)~0ull;
63EXPORT_SYMBOL(memstart_addr);
64phys_addr_t kernstart_addr;
65EXPORT_SYMBOL(kernstart_addr);
63phys_addr_t lowmem_end_addr; 66phys_addr_t lowmem_end_addr;
64 67
65int boot_mapsize; 68int boot_mapsize;
@@ -68,14 +71,6 @@ unsigned long agp_special_page;
68EXPORT_SYMBOL(agp_special_page); 71EXPORT_SYMBOL(agp_special_page);
69#endif 72#endif
70 73
71#ifdef CONFIG_HIGHMEM
72pte_t *kmap_pte;
73pgprot_t kmap_prot;
74
75EXPORT_SYMBOL(kmap_prot);
76EXPORT_SYMBOL(kmap_pte);
77#endif
78
79void MMU_init(void); 74void MMU_init(void);
80 75
81/* XXX should be in current.h -- paulus */ 76/* XXX should be in current.h -- paulus */
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 698bd000f98b..c5ac532a0161 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -72,7 +72,8 @@
72#warning TASK_SIZE is smaller than it needs to be. 72#warning TASK_SIZE is smaller than it needs to be.
73#endif 73#endif
74 74
75phys_addr_t memstart_addr; 75phys_addr_t memstart_addr = ~0;
76phys_addr_t kernstart_addr;
76 77
77void free_initmem(void) 78void free_initmem(void)
78{ 79{
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 16def4dcff6d..5ccb579b81e4 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -45,6 +45,7 @@
45#include <asm/tlb.h> 45#include <asm/tlb.h>
46#include <asm/sections.h> 46#include <asm/sections.h>
47#include <asm/vdso.h> 47#include <asm/vdso.h>
48#include <asm/fixmap.h>
48 49
49#include "mmu_decl.h" 50#include "mmu_decl.h"
50 51
@@ -57,6 +58,20 @@ int init_bootmem_done;
57int mem_init_done; 58int mem_init_done;
58unsigned long memory_limit; 59unsigned long memory_limit;
59 60
61#ifdef CONFIG_HIGHMEM
62pte_t *kmap_pte;
63pgprot_t kmap_prot;
64
65EXPORT_SYMBOL(kmap_prot);
66EXPORT_SYMBOL(kmap_pte);
67
68static inline pte_t *virt_to_kpte(unsigned long vaddr)
69{
70 return pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr),
71 vaddr), vaddr), vaddr);
72}
73#endif
74
60int page_is_ram(unsigned long pfn) 75int page_is_ram(unsigned long pfn)
61{ 76{
62 unsigned long paddr = (pfn << PAGE_SHIFT); 77 unsigned long paddr = (pfn << PAGE_SHIFT);
@@ -216,7 +231,7 @@ void __init do_init_bootmem(void)
216 unsigned long total_pages; 231 unsigned long total_pages;
217 int boot_mapsize; 232 int boot_mapsize;
218 233
219 max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT; 234 max_low_pfn = max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
220 total_pages = (lmb_end_of_DRAM() - memstart_addr) >> PAGE_SHIFT; 235 total_pages = (lmb_end_of_DRAM() - memstart_addr) >> PAGE_SHIFT;
221#ifdef CONFIG_HIGHMEM 236#ifdef CONFIG_HIGHMEM
222 total_pages = total_lowmem >> PAGE_SHIFT; 237 total_pages = total_lowmem >> PAGE_SHIFT;
@@ -232,7 +247,8 @@ void __init do_init_bootmem(void)
232 247
233 start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); 248 start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE);
234 249
235 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); 250 min_low_pfn = MEMORY_START >> PAGE_SHIFT;
251 boot_mapsize = init_bootmem_node(NODE_DATA(0), start >> PAGE_SHIFT, min_low_pfn, max_low_pfn);
236 252
237 /* Add active regions with valid PFNs */ 253 /* Add active regions with valid PFNs */
238 for (i = 0; i < lmb.memory.cnt; i++) { 254 for (i = 0; i < lmb.memory.cnt; i++) {
@@ -310,14 +326,19 @@ void __init paging_init(void)
310 unsigned long top_of_ram = lmb_end_of_DRAM(); 326 unsigned long top_of_ram = lmb_end_of_DRAM();
311 unsigned long max_zone_pfns[MAX_NR_ZONES]; 327 unsigned long max_zone_pfns[MAX_NR_ZONES];
312 328
329#ifdef CONFIG_PPC32
330 unsigned long v = __fix_to_virt(__end_of_fixed_addresses - 1);
331 unsigned long end = __fix_to_virt(FIX_HOLE);
332
333 for (; v < end; v += PAGE_SIZE)
334 map_page(v, 0, 0); /* XXX gross */
335#endif
336
313#ifdef CONFIG_HIGHMEM 337#ifdef CONFIG_HIGHMEM
314 map_page(PKMAP_BASE, 0, 0); /* XXX gross */ 338 map_page(PKMAP_BASE, 0, 0); /* XXX gross */
315 pkmap_page_table = pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k 339 pkmap_page_table = virt_to_kpte(PKMAP_BASE);
316 (PKMAP_BASE), PKMAP_BASE), PKMAP_BASE), PKMAP_BASE); 340
317 map_page(KMAP_FIX_BEGIN, 0, 0); /* XXX gross */ 341 kmap_pte = virt_to_kpte(__fix_to_virt(FIX_KMAP_BEGIN));
318 kmap_pte = pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k
319 (KMAP_FIX_BEGIN), KMAP_FIX_BEGIN), KMAP_FIX_BEGIN),
320 KMAP_FIX_BEGIN);
321 kmap_prot = PAGE_KERNEL; 342 kmap_prot = PAGE_KERNEL;
322#endif /* CONFIG_HIGHMEM */ 343#endif /* CONFIG_HIGHMEM */
323 344
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 1efd631211ef..dc704da363eb 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -18,6 +18,7 @@
18#include <linux/cpu.h> 18#include <linux/cpu.h>
19#include <linux/notifier.h> 19#include <linux/notifier.h>
20#include <linux/lmb.h> 20#include <linux/lmb.h>
21#include <linux/of.h>
21#include <asm/sparsemem.h> 22#include <asm/sparsemem.h>
22#include <asm/prom.h> 23#include <asm/prom.h>
23#include <asm/system.h> 24#include <asm/system.h>
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 64c44bcc68de..80d1babb230d 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -29,6 +29,7 @@
29 29
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/pgalloc.h> 31#include <asm/pgalloc.h>
32#include <asm/fixmap.h>
32#include <asm/io.h> 33#include <asm/io.h>
33 34
34#include "mmu_decl.h" 35#include "mmu_decl.h"
@@ -387,3 +388,25 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
387 change_page_attr(page, numpages, enable ? PAGE_KERNEL : __pgprot(0)); 388 change_page_attr(page, numpages, enable ? PAGE_KERNEL : __pgprot(0));
388} 389}
389#endif /* CONFIG_DEBUG_PAGEALLOC */ 390#endif /* CONFIG_DEBUG_PAGEALLOC */
391
392static int fixmaps;
393unsigned long FIXADDR_TOP = 0xfffff000;
394EXPORT_SYMBOL(FIXADDR_TOP);
395
396void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)
397{
398 unsigned long address = __fix_to_virt(idx);
399
400 if (idx >= __end_of_fixed_addresses) {
401 BUG();
402 return;
403 }
404
405 map_page(address, phys, flags);
406 fixmaps++;
407}
408
409void __this_fixmap_does_not_exist(void)
410{
411 WARN_ON(1);
412}