31 #include <asm/cacheflush.h>
44 static void __cpuinit ppc44x_update_tlb_hwater(
void)
46 extern unsigned int tlb_44x_patch_hwater_D[];
47 extern unsigned int tlb_44x_patch_hwater_I[];
54 tlb_44x_patch_hwater_D[0] = (tlb_44x_patch_hwater_D[0] & 0xffff0000) |
57 (
unsigned long)&tlb_44x_patch_hwater_D[1]);
58 tlb_44x_patch_hwater_I[0] = (tlb_44x_patch_hwater_I[0] & 0xffff0000) |
61 (
unsigned long)&tlb_44x_patch_hwater_I[1]);
67 static void __init ppc44x_pin_tlb(
unsigned int virt,
unsigned int phys)
71 ppc44x_update_tlb_hwater();
89 static int __init ppc47x_find_free_bolted(
void)
91 unsigned int mmube0 =
mfspr(SPRN_MMUBE0);
92 unsigned int mmube1 =
mfspr(SPRN_MMUBE1);
94 if (!(mmube0 & MMUBE0_VBE0))
96 if (!(mmube0 & MMUBE0_VBE1))
98 if (!(mmube0 & MMUBE0_VBE2))
100 if (!(mmube1 & MMUBE1_VBE3))
102 if (!(mmube1 & MMUBE1_VBE4))
104 if (!(mmube1 & MMUBE1_VBE5))
109 static void __init ppc47x_update_boltmap(
void)
111 unsigned int mmube0 =
mfspr(SPRN_MMUBE0);
112 unsigned int mmube1 =
mfspr(SPRN_MMUBE1);
114 if (mmube0 & MMUBE0_VBE0)
115 __set_bit((mmube0 >> MMUBE0_IBE0_SHIFT) & 0xff,
117 if (mmube0 & MMUBE0_VBE1)
118 __set_bit((mmube0 >> MMUBE0_IBE1_SHIFT) & 0xff,
120 if (mmube0 & MMUBE0_VBE2)
121 __set_bit((mmube0 >> MMUBE0_IBE2_SHIFT) & 0xff,
123 if (mmube1 & MMUBE1_VBE3)
124 __set_bit((mmube1 >> MMUBE1_IBE3_SHIFT) & 0xff,
126 if (mmube1 & MMUBE1_VBE4)
127 __set_bit((mmube1 >> MMUBE1_IBE4_SHIFT) & 0xff,
129 if (mmube1 & MMUBE1_VBE5)
130 __set_bit((mmube1 >> MMUBE1_IBE5_SHIFT) & 0xff,
137 static void __cpuinit ppc47x_pin_tlb(
unsigned int virt,
unsigned int phys)
146 bolted = ppc47x_find_free_bolted();
152 pr_debug(
"256M TLB entry for 0x%08x->0x%08x in bolt slot %d\n",
155 mtspr(SPRN_MMUCR, 0);
176 ppc44x_update_tlb_hwater();
190 if (mmu_has_feature(MMU_FTR_TYPE_47x))
195 if (mmu_has_feature(MMU_FTR_TYPE_47x)) {
196 ppc47x_update_boltmap();
203 for (i = 0; i < 255; i++) {
219 #ifndef CONFIG_NONSTATIC_KERNEL
223 BUG_ON(first_memblock_base != 0);
248 if (mmu_has_feature(MMU_FTR_TYPE_47x))