This source file includes following definitions.
- irongate_ioportmap
- irongate_is_ioaddr
- irongate_is_mmio
1
2 #ifndef __ALPHA_IRONGATE__H__
3 #define __ALPHA_IRONGATE__H__
4
5 #include <linux/types.h>
6 #include <asm/compiler.h>
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 typedef volatile __u32 igcsr32;
36
37 typedef struct {
38 igcsr32 dev_vendor;
39 igcsr32 stat_cmd;
40 igcsr32 class;
41 igcsr32 latency;
42 igcsr32 bar0;
43 igcsr32 bar1;
44 igcsr32 bar2;
45
46 igcsr32 rsrvd0[6];
47
48 igcsr32 capptr;
49
50 igcsr32 rsrvd1[2];
51
52 igcsr32 bacsr10;
53 igcsr32 bacsr32;
54 igcsr32 bacsr54_eccms761;
55
56
57 igcsr32 rsrvd2[1];
58
59 igcsr32 drammap;
60 igcsr32 dramtm;
61 igcsr32 dramms;
62
63 igcsr32 rsrvd3[1];
64
65 igcsr32 biu0;
66 igcsr32 biusip;
67
68 igcsr32 rsrvd4[2];
69
70 igcsr32 mro;
71
72 igcsr32 rsrvd5[3];
73
74 igcsr32 whami;
75 igcsr32 pciarb;
76 igcsr32 pcicfg;
77
78 igcsr32 rsrvd6[4];
79
80 igcsr32 pci_mem;
81
82
83
84 igcsr32 agpcap;
85 igcsr32 agpstat;
86 igcsr32 agpcmd;
87 igcsr32 agpva;
88 igcsr32 agpmode;
89 } Irongate0;
90
91
92 typedef struct {
93
94 igcsr32 dev_vendor;
95 igcsr32 stat_cmd;
96 igcsr32 class;
97 igcsr32 htype;
98 igcsr32 rsrvd0[2];
99 igcsr32 busnos;
100 igcsr32 io_baselim_regs;
101 igcsr32 mem_baselim;
102 igcsr32 pfmem_baselim;
103 igcsr32 rsrvd1[2];
104 igcsr32 io_baselim;
105 igcsr32 rsrvd2[2];
106 igcsr32 interrupt;
107
108 } Irongate1;
109
110 extern igcsr32 *IronECC;
111
112
113
114
115
116
117 #ifdef USE_48_BIT_KSEG
118 #define IRONGATE_BIAS 0x80000000000UL
119 #else
120 #define IRONGATE_BIAS 0x10000000000UL
121 #endif
122
123
124 #define IRONGATE_MEM (IDENT_ADDR | IRONGATE_BIAS | 0x000000000UL)
125 #define IRONGATE_IACK_SC (IDENT_ADDR | IRONGATE_BIAS | 0x1F8000000UL)
126 #define IRONGATE_IO (IDENT_ADDR | IRONGATE_BIAS | 0x1FC000000UL)
127 #define IRONGATE_CONF (IDENT_ADDR | IRONGATE_BIAS | 0x1FE000000UL)
128
129
130
131
132
133
134
135
136
137 #define IGCSR(dev,fun,reg) ( IRONGATE_CONF | \
138 ((dev)<<11) | \
139 ((fun)<<8) | \
140 (reg) )
141
142 #define IRONGATE0 ((Irongate0 *) IGCSR(0, 0, 0))
143 #define IRONGATE1 ((Irongate1 *) IGCSR(1, 0, 0))
144
145
146
147
148
149
150 #define SCB_Q_SYSERR 0x620
151 #define SCB_Q_PROCERR 0x630
152 #define SCB_Q_SYSMCHK 0x660
153 #define SCB_Q_PROCMCHK 0x670
154
155 struct el_IRONGATE_sysdata_mcheck {
156 __u32 FrameSize;
157 __u32 FrameFlags;
158 __u32 CpuOffset;
159 __u32 SystemOffset;
160 __u32 MCHK_Code;
161 __u32 MCHK_Frame_Rev;
162 __u64 I_STAT;
163 __u64 DC_STAT;
164 __u64 C_ADDR;
165 __u64 DC1_SYNDROME;
166 __u64 DC0_SYNDROME;
167 __u64 C_STAT;
168 __u64 C_STS;
169 __u64 RESERVED0;
170 __u64 EXC_ADDR;
171 __u64 IER_CM;
172 __u64 ISUM;
173 __u64 MM_STAT;
174 __u64 PAL_BASE;
175 __u64 I_CTL;
176 __u64 PCTX;
177 };
178
179
180 #ifdef __KERNEL__
181
182 #ifndef __EXTERN_INLINE
183 #define __EXTERN_INLINE extern inline
184 #define __IO_EXTERN_INLINE
185 #endif
186
187
188
189
190
191
192
193
194
195
196
197
198 __EXTERN_INLINE void __iomem *irongate_ioportmap(unsigned long addr)
199 {
200 return (void __iomem *)(addr + IRONGATE_IO);
201 }
202
203 extern void __iomem *irongate_ioremap(unsigned long addr, unsigned long size);
204 extern void irongate_iounmap(volatile void __iomem *addr);
205
206 __EXTERN_INLINE int irongate_is_ioaddr(unsigned long addr)
207 {
208 return addr >= IRONGATE_MEM;
209 }
210
211 __EXTERN_INLINE int irongate_is_mmio(const volatile void __iomem *xaddr)
212 {
213 unsigned long addr = (unsigned long)xaddr;
214 return addr < IRONGATE_IO || addr >= IRONGATE_CONF;
215 }
216
217 #undef __IO_PREFIX
218 #define __IO_PREFIX irongate
219 #define irongate_trivial_rw_bw 1
220 #define irongate_trivial_rw_lq 1
221 #define irongate_trivial_io_bw 1
222 #define irongate_trivial_io_lq 1
223 #define irongate_trivial_iounmap 0
224 #include <asm/io_trivial.h>
225
226 #ifdef __IO_EXTERN_INLINE
227 #undef __EXTERN_INLINE
228 #undef __IO_EXTERN_INLINE
229 #endif
230
231 #endif
232
233 #endif