Make GET_SAVED_SP lowercase.
[linux-2.6/linux-mips.git] / include / asm-alpha / core_polaris.h
blobee7bdceed83008cc370292484f316e7b8df2a05d
1 #ifndef __ALPHA_POLARIS__H__
2 #define __ALPHA_POLARIS__H__
4 #include <linux/types.h>
5 #include <asm/compiler.h>
7 /*
8 * POLARIS is the internal name for a core logic chipset which provides
9 * memory controller and PCI access for the 21164PC chip based systems.
11 * This file is based on:
13 * Polaris System Controller
14 * Device Functional Specification
15 * 22-Jan-98
16 * Rev. 4.2
20 /* Polaris memory regions */
21 #define POLARIS_SPARSE_MEM_BASE (IDENT_ADDR + 0xf800000000)
22 #define POLARIS_DENSE_MEM_BASE (IDENT_ADDR + 0xf900000000)
23 #define POLARIS_SPARSE_IO_BASE (IDENT_ADDR + 0xf980000000)
24 #define POLARIS_SPARSE_CONFIG_BASE (IDENT_ADDR + 0xf9c0000000)
25 #define POLARIS_IACK_BASE (IDENT_ADDR + 0xf9f8000000)
26 #define POLARIS_DENSE_IO_BASE (IDENT_ADDR + 0xf9fc000000)
27 #define POLARIS_DENSE_CONFIG_BASE (IDENT_ADDR + 0xf9fe000000)
29 #define POLARIS_IACK_SC POLARIS_IACK_BASE
31 /* The Polaris command/status registers live in PCI Config space for
32 * bus 0/device 0. As such, they may be bytes, words, or doublewords.
34 #define POLARIS_W_VENID (POLARIS_DENSE_CONFIG_BASE)
35 #define POLARIS_W_DEVID (POLARIS_DENSE_CONFIG_BASE+2)
36 #define POLARIS_W_CMD (POLARIS_DENSE_CONFIG_BASE+4)
37 #define POLARIS_W_STATUS (POLARIS_DENSE_CONFIG_BASE+6)
40 * Data structure for handling POLARIS machine checks:
42 struct el_POLARIS_sysdata_mcheck {
43 u_long psc_status;
44 u_long psc_pcictl0;
45 u_long psc_pcictl1;
46 u_long psc_pcictl2;
49 #ifdef __KERNEL__
51 #ifndef __EXTERN_INLINE
52 #define __EXTERN_INLINE extern inline
53 #define __IO_EXTERN_INLINE
54 #endif
57 * I/O functions:
59 * POLARIS, the PCI/memory support chipset for the PCA56 (21164PC)
60 * processors, can use either a sparse address mapping scheme, or the
61 * so-called byte-word PCI address space, to get at PCI memory and I/O.
63 * However, we will support only the BWX form.
66 #define vucp volatile unsigned char *
67 #define vusp volatile unsigned short *
68 #define vuip volatile unsigned int *
69 #define vulp volatile unsigned long *
71 __EXTERN_INLINE u8 polaris_inb(unsigned long addr)
73 /* ??? I wish I could get rid of this. But there's no ioremap
74 equivalent for I/O space. PCI I/O can be forced into the
75 POLARIS I/O region, but that doesn't take care of legacy
76 ISA crap. */
78 return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_IO_BASE));
81 __EXTERN_INLINE void polaris_outb(u8 b, unsigned long addr)
83 __kernel_stb(b, *(vucp)(addr + POLARIS_DENSE_IO_BASE));
84 mb();
87 __EXTERN_INLINE u16 polaris_inw(unsigned long addr)
89 return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_IO_BASE));
92 __EXTERN_INLINE void polaris_outw(u16 b, unsigned long addr)
94 __kernel_stw(b, *(vusp)(addr + POLARIS_DENSE_IO_BASE));
95 mb();
98 __EXTERN_INLINE u32 polaris_inl(unsigned long addr)
100 return *(vuip)(addr + POLARIS_DENSE_IO_BASE);
103 __EXTERN_INLINE void polaris_outl(u32 b, unsigned long addr)
105 *(vuip)(addr + POLARIS_DENSE_IO_BASE) = b;
106 mb();
110 * Memory functions. Polaris allows all accesses (byte/word
111 * as well as long/quad) to be done through dense space.
113 * We will only support DENSE access via BWX insns.
116 __EXTERN_INLINE u8 polaris_readb(unsigned long addr)
118 return __kernel_ldbu(*(vucp)addr);
121 __EXTERN_INLINE u16 polaris_readw(unsigned long addr)
123 return __kernel_ldwu(*(vusp)addr);
126 __EXTERN_INLINE u32 polaris_readl(unsigned long addr)
128 return (*(vuip)addr) & 0xffffffff;
131 __EXTERN_INLINE u64 polaris_readq(unsigned long addr)
133 return *(vulp)addr;
136 __EXTERN_INLINE void polaris_writeb(u8 b, unsigned long addr)
138 __kernel_stb(b, *(vucp)addr);
141 __EXTERN_INLINE void polaris_writew(u16 b, unsigned long addr)
143 __kernel_stw(b, *(vusp)addr);
146 __EXTERN_INLINE void polaris_writel(u32 b, unsigned long addr)
148 *(vuip)addr = b;
151 __EXTERN_INLINE void polaris_writeq(u64 b, unsigned long addr)
153 *(vulp)addr = b;
156 __EXTERN_INLINE unsigned long polaris_ioremap(unsigned long addr,
157 unsigned long size
158 __attribute__((unused)))
160 return addr + POLARIS_DENSE_MEM_BASE;
163 __EXTERN_INLINE void polaris_iounmap(unsigned long addr)
165 return;
168 __EXTERN_INLINE int polaris_is_ioaddr(unsigned long addr)
170 return addr >= POLARIS_SPARSE_MEM_BASE;
173 #undef vucp
174 #undef vusp
175 #undef vuip
176 #undef vulp
178 #ifdef __WANT_IO_DEF
180 #define __inb(p) polaris_inb((unsigned long)(p))
181 #define __inw(p) polaris_inw((unsigned long)(p))
182 #define __inl(p) polaris_inl((unsigned long)(p))
183 #define __outb(x,p) polaris_outb((x),(unsigned long)(p))
184 #define __outw(x,p) polaris_outw((x),(unsigned long)(p))
185 #define __outl(x,p) polaris_outl((x),(unsigned long)(p))
186 #define __readb(a) polaris_readb((unsigned long)(a))
187 #define __readw(a) polaris_readw((unsigned long)(a))
188 #define __readl(a) polaris_readl((unsigned long)(a))
189 #define __readq(a) polaris_readq((unsigned long)(a))
190 #define __writeb(x,a) polaris_writeb((x),(unsigned long)(a))
191 #define __writew(x,a) polaris_writew((x),(unsigned long)(a))
192 #define __writel(x,a) polaris_writel((x),(unsigned long)(a))
193 #define __writeq(x,a) polaris_writeq((x),(unsigned long)(a))
194 #define __ioremap(a,s) polaris_ioremap((unsigned long)(a),(s))
195 #define __iounmap(a) polaris_iounmap((unsigned long)(a))
196 #define __is_ioaddr(a) polaris_is_ioaddr((unsigned long)(a))
198 #define inb(p) __inb(p)
199 #define inw(p) __inw(p)
200 #define inl(p) __inl(p)
201 #define outb(x,p) __outb((x),(p))
202 #define outw(x,p) __outw((x),(p))
203 #define outl(x,p) __outl((x),(p))
204 #define __raw_readb(a) __readb(a)
205 #define __raw_readw(a) __readw(a)
206 #define __raw_readl(a) __readl(a)
207 #define __raw_readq(a) __readq(a)
208 #define __raw_writeb(v,a) __writeb((v),(a))
209 #define __raw_writew(v,a) __writew((v),(a))
210 #define __raw_writel(v,a) __writel((v),(a))
211 #define __raw_writeq(v,a) __writeq((v),(a))
213 #endif /* __WANT_IO_DEF */
215 #ifdef __IO_EXTERN_INLINE
216 #undef __EXTERN_INLINE
217 #undef __IO_EXTERN_INLINE
218 #endif
220 #endif /* __KERNEL__ */
222 #endif /* __ALPHA_POLARIS__H__ */