1 #ifndef __ALPHA_JENSEN_H
2 #define __ALPHA_JENSEN_H
4 #include <asm/compiler.h>
33 #define EISA_INTA (IDENT_ADDR + 0x100000000UL)
38 #define EISA_FEPROM0 (IDENT_ADDR + 0x180000000UL)
39 #define EISA_FEPROM1 (IDENT_ADDR + 0x1A0000000UL)
44 #define EISA_VL82C106 (IDENT_ADDR + 0x1C0000000UL)
49 #define EISA_HAE (IDENT_ADDR + 0x1D0000000UL)
54 #define EISA_SYSCTL (IDENT_ADDR + 0x1E0000000UL)
59 #define EISA_SPARE (IDENT_ADDR + 0x1F0000000UL)
64 #define EISA_MEM (IDENT_ADDR + 0x200000000UL)
69 #define EISA_IO (IDENT_ADDR + 0x300000000UL)
74 #ifndef __EXTERN_INLINE
75 #define __EXTERN_INLINE extern inline
76 #define __IO_EXTERN_INLINE
88 #define JENSEN_HAE_ADDRESS EISA_HAE
89 #define JENSEN_HAE_MASK 0x1ffffff
95 if (addr != alpha_mv.hae_cache)
99 #define vuip volatile unsigned int *
113 static inline unsigned int jensen_local_inb(
unsigned long addr)
118 static inline void jensen_local_outb(
u8 b,
unsigned long addr)
124 static inline unsigned int jensen_bus_inb(
unsigned long addr)
129 result = *(
volatile int *)((addr << 7) +
EISA_IO + 0x00);
133 static inline void jensen_bus_outb(
u8 b,
unsigned long addr)
136 *(
vuip)((addr << 7) +
EISA_IO + 0x00) = b * 0x01010101;
146 #define jensen_is_local(addr) ( \
147 (addr == 0x60 || addr == 0x64) || \
148 (addr == 0x170 || addr == 0x171) || \
149 (addr >= 0x2f8 && addr <= 0x2ff) || \
150 (addr >= 0x3bc && addr <= 0x3be) || \
151 (addr >= 0x3f8 && addr <= 0x3ff))
155 if (jensen_is_local(addr))
156 return jensen_local_inb(addr);
158 return jensen_bus_inb(addr);
163 if (jensen_is_local(addr))
164 jensen_local_outb(b, addr);
166 jensen_bus_outb(b, addr);
174 result = *(
volatile int *) ((addr << 7) +
EISA_IO + 0x20);
175 result >>= (addr & 3) * 8;
188 *(
vuip) ((addr << 7) +
EISA_IO + 0x20) = b * 0x00010001;
205 unsigned long addr = (
unsigned long) xaddr;
208 jensen_set_hae(addr);
209 addr &= JENSEN_HAE_MASK;
210 result = *(
volatile int *) ((addr << 7) +
EISA_MEM + 0x00);
211 result >>= (addr & 3) * 8;
217 unsigned long addr = (
unsigned long) xaddr;
220 jensen_set_hae(addr);
221 addr &= JENSEN_HAE_MASK;
222 result = *(
volatile int *) ((addr << 7) +
EISA_MEM + 0x20);
223 result >>= (addr & 3) * 8;
229 unsigned long addr = (
unsigned long) xaddr;
230 jensen_set_hae(addr);
231 addr &= JENSEN_HAE_MASK;
237 unsigned long addr = (
unsigned long) xaddr;
238 unsigned long r0,
r1;
240 jensen_set_hae(addr);
241 addr &= JENSEN_HAE_MASK;
242 addr = (addr << 7) +
EISA_MEM + 0x60;
244 r1 = *(
vuip) (addr + (4 << 7));
245 return r1 << 32 |
r0;
250 unsigned long addr = (
unsigned long) xaddr;
251 jensen_set_hae(addr);
252 addr &= JENSEN_HAE_MASK;
253 *(
vuip) ((addr << 7) +
EISA_MEM + 0x00) = b * 0x01010101;
258 unsigned long addr = (
unsigned long) xaddr;
259 jensen_set_hae(addr);
260 addr &= JENSEN_HAE_MASK;
261 *(
vuip) ((addr << 7) +
EISA_MEM + 0x20) = b * 0x00010001;
266 unsigned long addr = (
unsigned long) xaddr;
267 jensen_set_hae(addr);
268 addr &= JENSEN_HAE_MASK;
274 unsigned long addr = (
unsigned long) xaddr;
275 jensen_set_hae(addr);
276 addr &= JENSEN_HAE_MASK;
277 addr = (addr << 7) +
EISA_MEM + 0x60;
279 *(
vuip) (addr + (4 << 7)) = b >> 32;
290 return (
void __iomem *)(addr + 0x100000000ul);
295 return (
long)addr >= 0;
300 return (
unsigned long)addr >= 0x100000000ul;
306 #define IOPORT(OS, NS) \
307 __EXTERN_INLINE unsigned int jensen_ioread##NS(void __iomem *xaddr) \
309 if (jensen_is_mmio(xaddr)) \
310 return jensen_read##OS(xaddr - 0x100000000ul); \
312 return jensen_in##OS((unsigned long)xaddr); \
314 __EXTERN_INLINE void jensen_iowrite##NS(u##NS b, void __iomem *xaddr) \
316 if (jensen_is_mmio(xaddr)) \
317 jensen_write##OS(b, xaddr - 0x100000000ul); \
319 jensen_out##OS(b, (unsigned long)xaddr); \
331 #define __IO_PREFIX jensen
332 #define jensen_trivial_rw_bw 0
333 #define jensen_trivial_rw_lq 0
334 #define jensen_trivial_io_bw 0
335 #define jensen_trivial_io_lq 0
336 #define jensen_trivial_iounmap 1
339 #ifdef __IO_EXTERN_INLINE
340 #undef __EXTERN_INLINE
341 #undef __IO_EXTERN_INLINE