aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/pgtable-ppc64.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-07-27 21:59:34 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-19 20:25:06 -0400
commit57e2a99f74b0d3720c97a6aadb57ae6aad3c61ea (patch)
tree4268a98ad222dbcf790749aed52417eb0a3a2a35 /arch/powerpc/include/asm/pgtable-ppc64.h
parent0257c99cdfaca53a881339e1cbca638c61569b05 (diff)
powerpc: Add memory management headers for new 64-bit BookE
This adds the PTE and pgtable format definitions, along with changes to the kernel memory map and other definitions related to implementing support for 64-bit Book3E. This also shields some asm-offset bits that are currently only relevant on 32-bit We also move the definition of the "linux" page size constants to the common mmu.h file and add a few sizes that are relevant to embedded processors. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/pgtable-ppc64.h')
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h61
1 files changed, 44 insertions, 17 deletions
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index 8cd083c61503..7254c5a3187c 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -5,11 +5,6 @@
5 * the ppc64 hashed page table. 5 * the ppc64 hashed page table.
6 */ 6 */
7 7
8#ifndef __ASSEMBLY__
9#include <linux/stddef.h>
10#include <asm/tlbflush.h>
11#endif /* __ASSEMBLY__ */
12
13#ifdef CONFIG_PPC_64K_PAGES 8#ifdef CONFIG_PPC_64K_PAGES
14#include <asm/pgtable-ppc64-64k.h> 9#include <asm/pgtable-ppc64-64k.h>
15#else 10#else
@@ -38,26 +33,46 @@
38#endif 33#endif
39 34
40/* 35/*
41 * Define the address range of the vmalloc VM area. 36 * Define the address range of the kernel non-linear virtual area
37 */
38
39#ifdef CONFIG_PPC_BOOK3E
40#define KERN_VIRT_START ASM_CONST(0x8000000000000000)
41#else
42#define KERN_VIRT_START ASM_CONST(0xD000000000000000)
43#endif
44#define KERN_VIRT_SIZE PGTABLE_RANGE
45
46/*
47 * The vmalloc space starts at the beginning of that region, and
48 * occupies half of it on hash CPUs and a quarter of it on Book3E
42 */ 49 */
43#define VMALLOC_START ASM_CONST(0xD000000000000000) 50#define VMALLOC_START KERN_VIRT_START
44#define VMALLOC_SIZE (PGTABLE_RANGE >> 1) 51#ifdef CONFIG_PPC_BOOK3E
45#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) 52#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 2)
53#else
54#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
55#endif
56#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
46 57
47/* 58/*
48 * Define the address ranges for MMIO and IO space : 59 * The second half of the kernel virtual space is used for IO mappings,
60 * it's itself carved into the PIO region (ISA and PHB IO space) and
61 * the ioremap space
49 * 62 *
50 * ISA_IO_BASE = VMALLOC_END, 64K reserved area 63 * ISA_IO_BASE = KERN_IO_START, 64K reserved area
51 * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces 64 * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
52 * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE 65 * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
53 */ 66 */
67#define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
54#define FULL_IO_SIZE 0x80000000ul 68#define FULL_IO_SIZE 0x80000000ul
55#define ISA_IO_BASE (VMALLOC_END) 69#define ISA_IO_BASE (KERN_IO_START)
56#define ISA_IO_END (VMALLOC_END + 0x10000ul) 70#define ISA_IO_END (KERN_IO_START + 0x10000ul)
57#define PHB_IO_BASE (ISA_IO_END) 71#define PHB_IO_BASE (ISA_IO_END)
58#define PHB_IO_END (VMALLOC_END + FULL_IO_SIZE) 72#define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)
59#define IOREMAP_BASE (PHB_IO_END) 73#define IOREMAP_BASE (PHB_IO_END)
60#define IOREMAP_END (VMALLOC_START + PGTABLE_RANGE) 74#define IOREMAP_END (KERN_VIRT_START + KERN_VIRT_SIZE)
75
61 76
62/* 77/*
63 * Region IDs 78 * Region IDs
@@ -72,19 +87,28 @@
72#define USER_REGION_ID (0UL) 87#define USER_REGION_ID (0UL)
73 88
74/* 89/*
75 * Defines the address of the vmemap area, in its own region 90 * Defines the address of the vmemap area, in its own region on
91 * hash table CPUs and after the vmalloc space on Book3E
76 */ 92 */
93#ifdef CONFIG_PPC_BOOK3E
94#define VMEMMAP_BASE VMALLOC_END
95#define VMEMMAP_END KERN_IO_START
96#else
77#define VMEMMAP_BASE (VMEMMAP_REGION_ID << REGION_SHIFT) 97#define VMEMMAP_BASE (VMEMMAP_REGION_ID << REGION_SHIFT)
98#endif
78#define vmemmap ((struct page *)VMEMMAP_BASE) 99#define vmemmap ((struct page *)VMEMMAP_BASE)
79 100
80 101
81/* 102/*
82 * Include the PTE bits definitions 103 * Include the PTE bits definitions
83 */ 104 */
105#ifdef CONFIG_PPC_BOOK3S
84#include <asm/pte-hash64.h> 106#include <asm/pte-hash64.h>
107#else
108#include <asm/pte-book3e.h>
109#endif
85#include <asm/pte-common.h> 110#include <asm/pte-common.h>
86 111
87
88#ifdef CONFIG_PPC_MM_SLICES 112#ifdef CONFIG_PPC_MM_SLICES
89#define HAVE_ARCH_UNMAPPED_AREA 113#define HAVE_ARCH_UNMAPPED_AREA
90#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN 114#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
@@ -92,6 +116,9 @@
92 116
93#ifndef __ASSEMBLY__ 117#ifndef __ASSEMBLY__
94 118
119#include <linux/stddef.h>
120#include <asm/tlbflush.h>
121
95/* 122/*
96 * This is the default implementation of various PTE accessors, it's 123 * This is the default implementation of various PTE accessors, it's
97 * used in all cases except Book3S with 64K pages where we have a 124 * used in all cases except Book3S with 64K pages where we have a