This source file includes following definitions.
- inb
- inw
- inl
- outb
- outw
- outl
- readb
- readw
- readl
- writeb
- writew
- writel
1 #ifndef __ALPHA_LCA__H
2 #define __ALPHA_LCA__H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 #define IDENT_ADDR (0xfffffc0000000000UL)
51
52
53
54
55 #define LCA_IOC_HAE (IDENT_ADDR + 0x180000000UL)
56 #define LCA_IOC_CONF (IDENT_ADDR + 0x180000020UL)
57 #define LCA_IOC_STAT0 (IDENT_ADDR + 0x180000040UL)
58 #define LCA_IOC_STAT1 (IDENT_ADDR + 0x180000060UL)
59 #define LCA_IOC_TBIA (IDENT_ADDR + 0x180000080UL)
60 #define LCA_IOC_TB_ENA (IDENT_ADDR + 0x1800000a0UL)
61 #define LCA_IOC_SFT_RST (IDENT_ADDR + 0x1800000c0UL)
62 #define LCA_IOC_PAR_DIS (IDENT_ADDR + 0x1800000e0UL)
63 #define LCA_IOC_W_BASE0 (IDENT_ADDR + 0x180000100UL)
64 #define LCA_IOC_W_BASE1 (IDENT_ADDR + 0x180000120UL)
65 #define LCA_IOC_W_MASK0 (IDENT_ADDR + 0x180000140UL)
66 #define LCA_IOC_W_MASK1 (IDENT_ADDR + 0x180000160UL)
67 #define LCA_IOC_T_BASE0 (IDENT_ADDR + 0x180000180UL)
68 #define LCA_IOC_T_BASE1 (IDENT_ADDR + 0x1800001a0UL)
69 #define LCA_IOC_TB_TAG0 (IDENT_ADDR + 0x188000000UL)
70 #define LCA_IOC_TB_TAG1 (IDENT_ADDR + 0x188000020UL)
71 #define LCA_IOC_TB_TAG2 (IDENT_ADDR + 0x188000040UL)
72 #define LCA_IOC_TB_TAG3 (IDENT_ADDR + 0x188000060UL)
73 #define LCA_IOC_TB_TAG4 (IDENT_ADDR + 0x188000070UL)
74 #define LCA_IOC_TB_TAG5 (IDENT_ADDR + 0x1880000a0UL)
75 #define LCA_IOC_TB_TAG6 (IDENT_ADDR + 0x1880000c0UL)
76 #define LCA_IOC_TB_TAG7 (IDENT_ADDR + 0x1880000e0UL)
77
78
79
80
81 #define LCA_IACK_SC (IDENT_ADDR + 0x1a0000000UL)
82 #define LCA_CONF (IDENT_ADDR + 0x1e0000000UL)
83 #define LCA_IO (IDENT_ADDR + 0x1c0000000UL)
84 #define LCA_SPARSE_MEM (IDENT_ADDR + 0x200000000UL)
85 #define LCA_DENSE_MEM (IDENT_ADDR + 0x300000000UL)
86
87
88
89
90 #define LCA_IOC_STAT0_CMD 0xf
91 #define LCA_IOC_STAT0_ERR (1<<4)
92 #define LCA_IOC_STAT0_LOST (1<<5)
93 #define LCA_IOC_STAT0_THIT (1<<6)
94 #define LCA_IOC_STAT0_TREF (1<<7)
95 #define LCA_IOC_STAT0_CODE_SHIFT 8
96 #define LCA_IOC_STAT0_CODE_MASK 0x7
97 #define LCA_IOC_STAT0_P_NBR_SHIFT 13
98 #define LCA_IOC_STAT0_P_NBR_MASK 0x7ffff
99
100
101
102
103
104
105
106
107
108
109
110
111 extern inline unsigned int
112 inb(unsigned long addr)
113 {
114 long result = *(volatile int *) ((addr << 5) + LCA_IO + 0x00);
115 result >>= (addr & 3) * 8;
116 return 0xffUL & result;
117 }
118
119 extern inline unsigned int
120 inw(unsigned long addr)
121 {
122 long result = *(volatile int *) ((addr << 5) + LCA_IO + 0x08);
123 result >>= (addr & 3) * 8;
124 return 0xffffUL & result;
125 }
126
127 extern inline unsigned int
128 inl(unsigned long addr)
129 {
130 return *(volatile unsigned int *) ((addr << 5) + LCA_IO + 0x18);
131 }
132
133 extern inline void
134 outb(unsigned char b, unsigned long addr)
135 {
136 *(volatile unsigned int *) ((addr << 5) + LCA_IO + 0x00) = b * 0x01010101;
137 mb();
138 }
139
140 extern inline void
141 outw(unsigned char b, unsigned long addr)
142 {
143 *(volatile unsigned int *) ((addr << 5) + LCA_IO + 0x08) = b * 0x00010001;
144 mb();
145 }
146
147 extern inline void
148 outl(unsigned char b, unsigned long addr)
149 {
150 *(volatile unsigned int *) ((addr << 5) + LCA_IO + 0x18) = b;
151 mb();
152 }
153
154
155
156
157
158
159
160 extern inline unsigned long
161 readb(unsigned long addr)
162 {
163 long result = *(volatile int *) ((addr << 5) + LCA_SPARSE_MEM + 0x00);
164 result >>= (addr & 3) * 8;
165 return 0xffUL & result;
166 }
167
168 extern inline unsigned long
169 readw(unsigned long addr)
170 {
171 long result = *(volatile int *) ((addr << 5) + LCA_SPARSE_MEM + 0x08);
172 result >>= (addr & 3) * 8;
173 return 0xffffUL & result;
174 }
175
176 extern inline unsigned long
177 readl(unsigned long addr)
178 {
179 return *(volatile int *) (addr + LCA_DENSE_MEM);
180 }
181
182 extern inline void
183 writeb(unsigned short b, unsigned long addr)
184 {
185 *(volatile unsigned int *) ((addr << 5) + LCA_SPARSE_MEM + 0x00) =
186 b * 0x01010101;
187 }
188
189 extern inline void
190 writew(unsigned short b, unsigned long addr)
191 {
192 *(volatile unsigned int *) ((addr << 5) + LCA_SPARSE_MEM + 0x08) =
193 b * 0x00010001;
194 }
195
196 extern inline void
197 writel(unsigned short b, unsigned long addr)
198 {
199 *(volatile unsigned int *) (addr + LCA_DENSE_MEM) = b;
200 }
201
202 #define inb_local inb
203 #define outb_local outb
204 #define inb_p inb
205 #define outb_p outb
206
207 #endif