1
2
3
4
5
6
7
8
9
10
11#ifndef MCFMMU_H
12#define MCFMMU_H
13
14
15
16
17
18
19#define MMUBASE 0xfe000000
20
21
22
23
24
25#define MMUCR (MMUBASE + 0x00)
26#define MMUOR (MMUBASE + 0x04)
27#define MMUSR (MMUBASE + 0x08)
28#define MMUAR (MMUBASE + 0x10)
29#define MMUTR (MMUBASE + 0x14)
30#define MMUDR (MMUBASE + 0x18)
31
32
33
34
35#define MMUCR_EN 0x00000001
36#define MMUCR_ASM 0x00000002
37
38
39
40
41#define MMUOR_UAA 0x00000001
42#define MMUOR_ACC 0x00000002
43#define MMUOR_RD 0x00000004
44#define MMUOR_WR 0x00000000
45#define MMUOR_ADR 0x00000008
46#define MMUOR_ITLB 0x00000010
47#define MMUOR_CAS 0x00000020
48#define MMUOR_CNL 0x00000040
49#define MMUOR_CA 0x00000080
50#define MMUOR_STLB 0x00000100
51#define MMUOR_AAN 16
52#define MMUOR_AAMASK 0xffff0000
53
54
55
56
57#define MMUSR_HIT 0x00000002
58#define MMUSR_WF 0x00000008
59#define MMUSR_RF 0x00000010
60#define MMUSR_SPF 0x00000020
61
62
63
64
65#define MMUTR_V 0x00000001
66#define MMUTR_SG 0x00000002
67#define MMUTR_IDN 2
68#define MMUTR_IDMASK 0x000003fc
69#define MMUTR_VAN 10
70#define MMUTR_VAMASK 0xfffffc00
71
72
73
74
75#define MMUDR_LK 0x00000002
76#define MMUDR_X 0x00000004
77#define MMUDR_W 0x00000008
78#define MMUDR_R 0x00000010
79#define MMUDR_SP 0x00000020
80#define MMUDR_CM_CWT 0x00000000
81#define MMUDR_CM_CCB 0x00000040
82#define MMUDR_CM_NCP 0x00000080
83#define MMUDR_CM_NCI 0x000000c0
84#define MMUDR_SZ_1MB 0x00000000
85#define MMUDR_SZ_4KB 0x00000100
86#define MMUDR_SZ_8KB 0x00000200
87#define MMUDR_SZ_1KB 0x00000300
88#define MMUDR_PAN 10
89#define MMUDR_PAMASK 0xfffffc00
90
91#ifndef __ASSEMBLY__
92
93
94
95
96
97static inline u32 mmu_read(u32 a)
98{
99 return *((volatile u32 *) a);
100}
101
102static inline void mmu_write(u32 a, u32 v)
103{
104 *((volatile u32 *) a) = v;
105 __asm__ __volatile__ ("nop");
106}
107
108int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word);
109
110#endif
111
112#endif
113