aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/mm/ppc_mmu_32.c19
-rw-r--r--include/asm-powerpc/mmu-hash32.h19
2 files changed, 10 insertions, 28 deletions
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index 55ec17ed8d7c..c53145f61942 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -38,10 +38,7 @@ struct hash_pte *Hash, *Hash_end;
38unsigned long Hash_size, Hash_mask; 38unsigned long Hash_size, Hash_mask;
39unsigned long _SDR1; 39unsigned long _SDR1;
40 40
41union ubat { /* BAT register values to be loaded */ 41struct ppc_bat BATS[8][2]; /* 8 pairs of IBAT, DBAT */
42 struct ppc_bat bat;
43 u32 word[2];
44} BATS[8][2]; /* 8 pairs of IBAT, DBAT */
45 42
46struct batrange { /* stores address ranges mapped by BATs */ 43struct batrange { /* stores address ranges mapped by BATs */
47 unsigned long start; 44 unsigned long start;
@@ -124,7 +121,7 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
124{ 121{
125 unsigned int bl; 122 unsigned int bl;
126 int wimgxpp; 123 int wimgxpp;
127 union ubat *bat = BATS[index]; 124 struct ppc_bat *bat = BATS[index];
128 125
129 if (((flags & _PAGE_NO_CACHE) == 0) && 126 if (((flags & _PAGE_NO_CACHE) == 0) &&
130 cpu_has_feature(CPU_FTR_NEED_COHERENT)) 127 cpu_has_feature(CPU_FTR_NEED_COHERENT))
@@ -137,15 +134,15 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
137 wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE 134 wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
138 | _PAGE_COHERENT | _PAGE_GUARDED); 135 | _PAGE_COHERENT | _PAGE_GUARDED);
139 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX; 136 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
140 bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */ 137 bat[1].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
141 bat[1].word[1] = BAT_PHYS_ADDR(phys) | wimgxpp; 138 bat[1].batl = BAT_PHYS_ADDR(phys) | wimgxpp;
142#ifndef CONFIG_KGDB /* want user access for breakpoints */ 139#ifndef CONFIG_KGDB /* want user access for breakpoints */
143 if (flags & _PAGE_USER) 140 if (flags & _PAGE_USER)
144#endif 141#endif
145 bat[1].bat.batu.vp = 1; 142 bat[1].batu |= 1; /* Vp = 1 */
146 if (flags & _PAGE_GUARDED) { 143 if (flags & _PAGE_GUARDED) {
147 /* G bit must be zero in IBATs */ 144 /* G bit must be zero in IBATs */
148 bat[0].word[0] = bat[0].word[1] = 0; 145 bat[0].batu = bat[0].batl = 0;
149 } else { 146 } else {
150 /* make IBAT same as DBAT */ 147 /* make IBAT same as DBAT */
151 bat[0] = bat[1]; 148 bat[0] = bat[1];
@@ -158,8 +155,8 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
158 | _PAGE_COHERENT); 155 | _PAGE_COHERENT);
159 wimgxpp |= (flags & _PAGE_RW)? 156 wimgxpp |= (flags & _PAGE_RW)?
160 ((flags & _PAGE_USER)? PP_RWRW: PP_RWXX): PP_RXRX; 157 ((flags & _PAGE_USER)? PP_RWRW: PP_RWXX): PP_RXRX;
161 bat->word[0] = virt | wimgxpp | 4; /* Ks=0, Ku=1 */ 158 bat->batu = virt | wimgxpp | 4; /* Ks=0, Ku=1 */
162 bat->word[1] = phys | bl | 0x40; /* V=1 */ 159 bat->batl = phys | bl | 0x40; /* V=1 */
163 } 160 }
164 161
165 bat_addrs[index].start = virt; 162 bat_addrs[index].start = virt;
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h
index f39ff983b381..16b1a1e77e64 100644
--- a/include/asm-powerpc/mmu-hash32.h
+++ b/include/asm-powerpc/mmu-hash32.h
@@ -38,23 +38,8 @@
38#endif 38#endif
39 39
40struct ppc_bat { 40struct ppc_bat {
41 struct { 41 u32 batu;
42 unsigned long bepi:15; /* Effective page index (virtual address) */ 42 u32 batl;
43 unsigned long :4; /* Unused */
44 unsigned long bl:11; /* Block size mask */
45 unsigned long vs:1; /* Supervisor valid */
46 unsigned long vp:1; /* User valid */
47 } batu; /* Upper register */
48 struct {
49 unsigned long brpn:15; /* Real page index (physical address) */
50 unsigned long :10; /* Unused */
51 unsigned long w:1; /* Write-thru cache */
52 unsigned long i:1; /* Cache inhibit */
53 unsigned long m:1; /* Memory coherence */
54 unsigned long g:1; /* Guarded (MBZ in IBAT) */
55 unsigned long :1; /* Unused */
56 unsigned long pp:2; /* Page access protections */
57 } batl; /* Lower register */
58}; 43};
59#endif /* !__ASSEMBLY__ */ 44#endif /* !__ASSEMBLY__ */
60 45