This source file includes following definitions.
- iommu_invalidate
- iommu_invalidate_page
1
2
3
4
5 #ifndef _SPARC_IOMMU_H
6 #define _SPARC_IOMMU_H
7
8 #include <asm/page.h>
9
10
11
12
13
14
15
16
17
18
19
20 struct iommu_regs {
21
22 volatile unsigned long control;
23 volatile unsigned long base;
24 volatile unsigned long _unused1[3];
25 volatile unsigned long tlbflush;
26 volatile unsigned long pageflush;
27 volatile unsigned long _unused2[1017];
28
29 volatile unsigned long afsr;
30 volatile unsigned long afar;
31 volatile unsigned long _unused3[2];
32 volatile unsigned long sbuscfg0;
33 volatile unsigned long sbuscfg1;
34 volatile unsigned long sbuscfg2;
35 volatile unsigned long sbuscfg3;
36 volatile unsigned long mfsr;
37 volatile unsigned long mfar;
38 volatile unsigned long _unused4[1014];
39
40 volatile unsigned long mid;
41 };
42
43 #define IOMMU_CTRL_IMPL 0xf0000000
44 #define IOMMU_CTRL_VERS 0x0f000000
45 #define IOMMU_CTRL_RNGE 0x0000001c
46 #define IOMMU_RNGE_16MB 0x00000000
47 #define IOMMU_RNGE_32MB 0x00000004
48 #define IOMMU_RNGE_64MB 0x00000008
49 #define IOMMU_RNGE_128MB 0x0000000c
50 #define IOMMU_RNGE_256MB 0x00000010
51 #define IOMMU_RNGE_512MB 0x00000014
52 #define IOMMU_RNGE_1GB 0x00000018
53 #define IOMMU_RNGE_2GB 0x0000001c
54 #define IOMMU_CTRL_ENAB 0x00000001
55
56 #define IOMMU_AFSR_ERR 0x80000000
57 #define IOMMU_AFSR_LE 0x40000000
58 #define IOMMU_AFSR_TO 0x20000000
59 #define IOMMU_AFSR_BE 0x10000000
60 #define IOMMU_AFSR_SIZE 0x0e000000
61 #define IOMMU_AFSR_S 0x01000000
62 #define IOMMU_AFSR_RESV 0x00f00000
63 #define IOMMU_AFSR_ME 0x00080000
64 #define IOMMU_AFSR_RD 0x00040000
65 #define IOMMU_AFSR_FAV 0x00020000
66
67 #define IOMMU_SBCFG_SAB30 0x00010000
68 #define IOMMU_SBCFG_BA16 0x00000004
69 #define IOMMU_SBCFG_BA8 0x00000002
70 #define IOMMU_SBCFG_BYPASS 0x00000001
71
72
73
74 #define IOMMU_MFSR_ERR 0x80000000
75 #define IOMMU_MFSR_S 0x01000000
76 #define IOMMU_MFSR_CPU 0x00800000
77 #define IOMMU_MFSR_ME 0x00080000
78 #define IOMMU_MFSR_PERR 0x00006000
79
80
81 #define IOMMU_MFSR_BM 0x00001000
82 #define IOMMU_MFSR_C 0x00000800
83 #define IOMMU_MFSR_RTYP 0x000000f0
84
85 #define IOMMU_MID_SBAE 0x001f0000
86 #define IOMMU_MID_SE 0x00100000
87 #define IOMMU_MID_SB3 0x00080000
88 #define IOMMU_MID_SB2 0x00040000
89 #define IOMMU_MID_SB1 0x00020000
90 #define IOMMU_MID_SB0 0x00010000
91 #define IOMMU_MID_MID 0x0000000f
92
93
94 #define IOPTE_PAGE 0x07ffff00
95 #define IOPTE_WRITE 0x00000004
96 #define IOPTE_VALID 0x00000002
97 #define IOPTE_WAZ 0x00000001
98
99 struct iommu_struct {
100 struct iommu_regs *regs;
101 iopte_t *page_table;
102
103 unsigned long start;
104 unsigned long end;
105 };
106
107 extern inline void iommu_invalidate(struct iommu_regs *regs)
108 {
109 regs->tlbflush = 0;
110 }
111
112 extern inline void iommu_invalidate_page(struct iommu_regs *regs, unsigned long page)
113 {
114 regs->pageflush = (page & PAGE_MASK);
115 }
116
117 #endif