2 * Copyright 2008 Freescale Semiconductor, Inc.
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 #include <asm/processor.h>
30 void set_tlb(u8 tlb
, u32 epn
, u64 rpn
,
32 u8 ts
, u8 esel
, u8 tsize
, u8 iprot
)
34 u32 _mas0
, _mas1
, _mas2
, _mas3
, _mas7
;
36 _mas0
= FSL_BOOKE_MAS0(tlb
, esel
, 0);
37 _mas1
= FSL_BOOKE_MAS1(1, iprot
, 0, ts
, tsize
);
38 _mas2
= FSL_BOOKE_MAS2(epn
, wimge
);
39 _mas3
= FSL_BOOKE_MAS3(rpn
, 0, perms
);
46 #ifdef CONFIG_ENABLE_36BIT_PHYS
49 asm volatile("isync;msync;tlbwe;isync");
52 void disable_tlb(u8 esel
)
54 u32 _mas0
, _mas1
, _mas2
, _mas3
, _mas7
;
56 _mas0
= FSL_BOOKE_MAS0(1, esel
, 0);
66 #ifdef CONFIG_ENABLE_36BIT_PHYS
69 asm volatile("isync;msync;tlbwe;isync");
72 void invalidate_tlb(u8 tlb
)
84 for (i
= 0; i
< num_tlb_entries
; i
++) {
85 set_tlb(tlb_table
[i
].tlb
, tlb_table
[i
].epn
, tlb_table
[i
].rpn
,
86 tlb_table
[i
].perms
, tlb_table
[i
].wimge
,
87 tlb_table
[i
].ts
, tlb_table
[i
].esel
, tlb_table
[i
].tsize
,