~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/asm-alpha/core_polaris.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __ALPHA_POLARIS__H__
  2 #define __ALPHA_POLARIS__H__
  3 
  4 #include <linux/types.h>
  5 #include <asm/compiler.h>
  6 
  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.
 10  *
 11  * This file is based on:
 12  *
 13  * Polaris System Controller
 14  * Device Functional Specification
 15  * 22-Jan-98
 16  * Rev. 4.2
 17  *
 18  */
 19 
 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)
 28 
 29 #define POLARIS_IACK_SC                 POLARIS_IACK_BASE
 30 
 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.
 33  */
 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)
 38 
 39 /*
 40  * Data structure for handling POLARIS machine checks:
 41  */
 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;
 47 };
 48 
 49 #ifdef __KERNEL__
 50 
 51 #ifndef __EXTERN_INLINE
 52 #define __EXTERN_INLINE extern inline
 53 #define __IO_EXTERN_INLINE
 54 #endif
 55 
 56 /*
 57  * I/O functions:
 58  *
 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.
 62  *
 63  * However, we will support only the BWX form.
 64  */
 65 
 66 #define vucp    volatile unsigned char *
 67 #define vusp    volatile unsigned short *
 68 #define vuip    volatile unsigned int  *
 69 #define vulp    volatile unsigned long  *
 70 
 71 __EXTERN_INLINE unsigned int polaris_inb(unsigned long addr)
 72 {
 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.  */
 77 
 78         return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_IO_BASE));
 79 }
 80 
 81 __EXTERN_INLINE void polaris_outb(unsigned char b, unsigned long addr)
 82 {
 83         __kernel_stb(b, *(vucp)(addr + POLARIS_DENSE_IO_BASE));
 84         mb();
 85 }
 86 
 87 __EXTERN_INLINE unsigned int polaris_inw(unsigned long addr)
 88 {
 89         return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_IO_BASE));
 90 }
 91 
 92 __EXTERN_INLINE void polaris_outw(unsigned short b, unsigned long addr)
 93 {
 94         __kernel_stw(b, *(vusp)(addr + POLARIS_DENSE_IO_BASE));
 95         mb();
 96 }
 97 
 98 __EXTERN_INLINE unsigned int polaris_inl(unsigned long addr)
 99 {
100         return *(vuip)(addr + POLARIS_DENSE_IO_BASE);
101 }
102 
103 __EXTERN_INLINE void polaris_outl(unsigned int b, unsigned long addr)
104 {
105         *(vuip)(addr + POLARIS_DENSE_IO_BASE) = b;
106         mb();
107 }
108 
109 /*
110  * Memory functions.  Polaris allows all accesses (byte/word
111  * as well as long/quad) to be done through dense space.
112  *
113  * We will only support DENSE access via BWX insns.
114  */
115 
116 __EXTERN_INLINE unsigned long polaris_readb(unsigned long addr)
117 {
118         return __kernel_ldbu(*(vucp)addr);
119 }
120 
121 __EXTERN_INLINE unsigned long polaris_readw(unsigned long addr)
122 {
123         return __kernel_ldwu(*(vusp)addr);
124 }
125 
126 __EXTERN_INLINE unsigned long polaris_readl(unsigned long addr)
127 {
128         return *(vuip)addr;
129 }
130 
131 __EXTERN_INLINE unsigned long polaris_readq(unsigned long addr)
132 {
133         return *(vulp)addr;
134 }
135 
136 __EXTERN_INLINE void polaris_writeb(unsigned char b, unsigned long addr)
137 {
138         __kernel_stb(b, *(vucp)addr);
139 }
140 
141 __EXTERN_INLINE void polaris_writew(unsigned short b, unsigned long addr)
142 {
143         __kernel_stw(b, *(vusp)addr);
144 }
145 
146 __EXTERN_INLINE void polaris_writel(unsigned int b, unsigned long addr)
147 {
148         *(vuip)addr = b;
149 }
150 
151 __EXTERN_INLINE void polaris_writeq(unsigned long b, unsigned long addr)
152 {
153         *(vulp)addr = b;
154 }
155 
156 __EXTERN_INLINE unsigned long polaris_ioremap(unsigned long addr)
157 {
158         return addr + POLARIS_DENSE_MEM_BASE;
159 }
160 
161 __EXTERN_INLINE int polaris_is_ioaddr(unsigned long addr)
162 {
163         return addr >= POLARIS_SPARSE_MEM_BASE;
164 }
165 
166 #undef vucp
167 #undef vusp
168 #undef vuip
169 #undef vulp
170 
171 #ifdef __WANT_IO_DEF
172 
173 #define __inb(p)                polaris_inb((unsigned long)(p))
174 #define __inw(p)                polaris_inw((unsigned long)(p))
175 #define __inl(p)                polaris_inl((unsigned long)(p))
176 #define __outb(x,p)             polaris_outb((x),(unsigned long)(p))
177 #define __outw(x,p)             polaris_outw((x),(unsigned long)(p))
178 #define __outl(x,p)             polaris_outl((x),(unsigned long)(p))
179 #define __readb(a)              polaris_readb((unsigned long)(a))
180 #define __readw(a)              polaris_readw((unsigned long)(a))
181 #define __readl(a)              polaris_readl((unsigned long)(a))
182 #define __readq(a)              polaris_readq((unsigned long)(a))
183 #define __writeb(x,a)           polaris_writeb((x),(unsigned long)(a))
184 #define __writew(x,a)           polaris_writew((x),(unsigned long)(a))
185 #define __writel(x,a)           polaris_writel((x),(unsigned long)(a))
186 #define __writeq(x,a)           polaris_writeq((x),(unsigned long)(a))
187 #define __ioremap(a)            polaris_ioremap((unsigned long)(a))
188 #define __is_ioaddr(a)          polaris_is_ioaddr((unsigned long)(a))
189 
190 #define inb(p)                  __inb(p)
191 #define inw(p)                  __inw(p)
192 #define inl(p)                  __inl(p)
193 #define outb(x,p)               __outb((x),(p))
194 #define outw(x,p)               __outw((x),(p))
195 #define outl(x,p)               __outl((x),(p))
196 #define __raw_readb(a)          __readb(a)
197 #define __raw_readw(a)          __readw(a)
198 #define __raw_readl(a)          __readl(a)
199 #define __raw_readq(a)          __readq(a)
200 #define __raw_writeb(v,a)       __writeb((v),(a))
201 #define __raw_writew(v,a)       __writew((v),(a))
202 #define __raw_writel(v,a)       __writel((v),(a))
203 #define __raw_writeq(v,a)       __writeq((v),(a))
204 
205 #endif /* __WANT_IO_DEF */
206 
207 #ifdef __IO_EXTERN_INLINE
208 #undef __EXTERN_INLINE
209 #undef __IO_EXTERN_INLINE
210 #endif
211 
212 #endif /* __KERNEL__ */
213 
214 #endif /* __ALPHA_POLARIS__H__ */
215 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.