void e500_disable_tlb(u8 esel) { mtspr(MAS0, FSL_BOOKE_MAS0(1, esel, 0)); mtspr(MAS1, 0); mtspr(MAS2, 0); mtspr(MAS3, 0); asm volatile("isync;msync;tlbwe;isync"); }
void e500_set_tlb(u8 tlb, u32 epn, u64 rpn, u8 perms, u8 wimge, u8 ts, u8 esel, u8 tsize, u8 iprot) { u32 _mas0, _mas1, _mas2, _mas3, _mas7; _mas0 = FSL_BOOKE_MAS0(tlb, esel, 0); _mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize); _mas2 = FSL_BOOKE_MAS2(epn, wimge); _mas3 = FSL_BOOKE_MAS3(rpn, 0, perms); _mas7 = FSL_BOOKE_MAS7(rpn); e500_write_tlb(_mas0, _mas1, _mas2, _mas3, _mas7); }
static int e500_find_free_tlbcam(void) { int ix; u32 _mas1; unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff; for (ix = 0; ix < num_cam; ix++) { mtspr(MAS0, FSL_BOOKE_MAS0(1, ix, 0)); asm volatile("tlbre;isync"); _mas1 = mfspr(MAS1); if (!(_mas1 & MAS1_VALID)) return ix; } if (ix >= NUM_TLBCAMS) panic("No more free TLBs"); return ix; }
void disable_tlb(u8 esel) { u32 _mas0, _mas1, _mas2, _mas3, _mas7; _mas0 = FSL_BOOKE_MAS0(1, esel, 0); _mas1 = 0; _mas2 = 0; _mas3 = 0; _mas7 = 0; mtspr(MAS0, _mas0); mtspr(MAS1, _mas1); mtspr(MAS2, _mas2); mtspr(MAS3, _mas3); #ifdef CONFIG_ENABLE_36BIT_PHYS mtspr(MAS7, _mas7); #endif asm volatile("isync;msync;tlbwe;isync"); }
void set_tlb(u8 tlb, u32 epn, u64 rpn, u8 perms, u8 wimge, u8 ts, u8 esel, u8 tsize, u8 iprot) { u32 _mas0, _mas1, _mas2, _mas3, _mas7; _mas0 = FSL_BOOKE_MAS0(tlb, esel, 0); _mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize); _mas2 = FSL_BOOKE_MAS2(epn, wimge); _mas3 = FSL_BOOKE_MAS3(rpn, 0, perms); _mas7 = FSL_BOOKE_MAS7(rpn); write_tlb(_mas0, _mas1, _mas2, _mas3, _mas7); #ifdef CONFIG_ADDR_MAP if ((tlb == 1) && (gd->flags & GD_FLG_RELOC)) addrmap_set_entry(epn, rpn, (1UL << ((tsize * 2) + 10)), esel); #endif }
void set_tlb(u8 tlb, u32 epn, u64 rpn, u8 perms, u8 wimge, u8 ts, u8 esel, u8 tsize, u8 iprot) { u32 _mas0, _mas1, _mas2, _mas3, _mas7; _mas0 = FSL_BOOKE_MAS0(tlb, esel, 0); _mas1 = FSL_BOOKE_MAS1(1, iprot, 0, ts, tsize); _mas2 = FSL_BOOKE_MAS2(epn, wimge); _mas3 = FSL_BOOKE_MAS3(rpn, 0, perms); _mas7 = rpn >> 32; mtspr(MAS0, _mas0); mtspr(MAS1, _mas1); mtspr(MAS2, _mas2); mtspr(MAS3, _mas3); #ifdef CONFIG_ENABLE_36BIT_PHYS mtspr(MAS7, _mas7); #endif asm volatile("isync;msync;tlbwe;isync"); }
void disable_tlb(u8 esel) { u32 _mas0, _mas1, _mas2, _mas3, _mas7; _mas0 = FSL_BOOKE_MAS0(1, esel, 0); _mas1 = 0; _mas2 = 0; _mas3 = 0; _mas7 = 0; mtspr(MAS0, _mas0); mtspr(MAS1, _mas1); mtspr(MAS2, _mas2); mtspr(MAS3, _mas3); #ifdef CONFIG_ENABLE_36BIT_PHYS mtspr(MAS7, _mas7); #endif asm volatile("isync;msync;tlbwe;isync"); #ifdef CONFIG_ADDR_MAP if (gd->flags & GD_FLG_RELOC) addrmap_set_entry(0, 0, 0, esel); #endif }