Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ALPHA_CIA__H__
0003 #define __ALPHA_CIA__H__
0004 
0005 /* Define to experiment with fitting everything into one 512MB HAE window.  */
0006 #define CIA_ONE_HAE_WINDOW 1
0007 
0008 #include <linux/types.h>
0009 #include <asm/compiler.h>
0010 
0011 /*
0012  * CIA is the internal name for the 21171 chipset which provides
0013  * memory controller and PCI access for the 21164 chip based systems.
0014  * Also supported here is the 21172 (CIA-2) and 21174 (PYXIS).
0015  *
0016  * The lineage is a bit confused, since the 21174 was reportedly started
0017  * from the 21171 Pass 1 mask, and so is missing bug fixes that appear
0018  * in 21171 Pass 2 and 21172, but it also contains additional features.
0019  *
0020  * This file is based on:
0021  *
0022  * DECchip 21171 Core Logic Chipset
0023  * Technical Reference Manual
0024  *
0025  * EC-QE18B-TE
0026  *
0027  * david.rusling@reo.mts.dec.com Initial Version.
0028  *
0029  */
0030 
0031 /*
0032  * CIA ADDRESS BIT DEFINITIONS
0033  *
0034  *  3333 3333 3322 2222 2222 1111 1111 11
0035  *  9876 5432 1098 7654 3210 9876 5432 1098 7654 3210
0036  *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
0037  *  1                                             000
0038  *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
0039  *  |                                             |\|
0040  *  |                               Byte Enable --+ |
0041  *  |                             Transfer Length --+
0042  *  +-- IO space, not cached
0043  *
0044  *   Byte      Transfer
0045  *   Enable    Length    Transfer  Byte    Address
0046  *   adr<6:5>  adr<4:3>  Length    Enable  Adder
0047  *   ---------------------------------------------
0048  *      00        00      Byte      1110   0x000
0049  *      01        00      Byte      1101   0x020
0050  *      10        00      Byte      1011   0x040
0051  *      11        00      Byte      0111   0x060
0052  *
0053  *      00        01      Word      1100   0x008
0054  *      01        01      Word      1001   0x028 <= Not supported in this code.
0055  *      10        01      Word      0011   0x048
0056  *
0057  *      00        10      Tribyte   1000   0x010
0058  *      01        10      Tribyte   0001   0x030
0059  *
0060  *      10        11      Longword  0000   0x058
0061  *
0062  *      Note that byte enables are asserted low.
0063  *
0064  */
0065 
0066 #define CIA_MEM_R1_MASK 0x1fffffff  /* SPARSE Mem region 1 mask is 29 bits */
0067 #define CIA_MEM_R2_MASK 0x07ffffff  /* SPARSE Mem region 2 mask is 27 bits */
0068 #define CIA_MEM_R3_MASK 0x03ffffff  /* SPARSE Mem region 3 mask is 26 bits */
0069 
0070 /*
0071  * 21171-CA Control and Status Registers
0072  */
0073 #define CIA_IOC_CIA_REV         (IDENT_ADDR + 0x8740000080UL)
0074 #  define CIA_REV_MASK          0xff
0075 #define CIA_IOC_PCI_LAT         (IDENT_ADDR + 0x87400000C0UL)
0076 #define CIA_IOC_CIA_CTRL        (IDENT_ADDR + 0x8740000100UL)
0077 #  define CIA_CTRL_PCI_EN       (1 << 0)
0078 #  define CIA_CTRL_PCI_LOCK_EN      (1 << 1)
0079 #  define CIA_CTRL_PCI_LOOP_EN      (1 << 2)
0080 #  define CIA_CTRL_FST_BB_EN        (1 << 3)
0081 #  define CIA_CTRL_PCI_MST_EN       (1 << 4)
0082 #  define CIA_CTRL_PCI_MEM_EN       (1 << 5)
0083 #  define CIA_CTRL_PCI_REQ64_EN     (1 << 6)
0084 #  define CIA_CTRL_PCI_ACK64_EN     (1 << 7)
0085 #  define CIA_CTRL_ADDR_PE_EN       (1 << 8)
0086 #  define CIA_CTRL_PERR_EN      (1 << 9)
0087 #  define CIA_CTRL_FILL_ERR_EN      (1 << 10)
0088 #  define CIA_CTRL_MCHK_ERR_EN      (1 << 11)
0089 #  define CIA_CTRL_ECC_CHK_EN       (1 << 12)
0090 #  define CIA_CTRL_ASSERT_IDLE_BC   (1 << 13)
0091 #  define CIA_CTRL_COM_IDLE_BC      (1 << 14)
0092 #  define CIA_CTRL_CSR_IOA_BYPASS   (1 << 15)
0093 #  define CIA_CTRL_IO_FLUSHREQ_EN   (1 << 16)
0094 #  define CIA_CTRL_CPU_FLUSHREQ_EN  (1 << 17)
0095 #  define CIA_CTRL_ARB_CPU_EN       (1 << 18)
0096 #  define CIA_CTRL_EN_ARB_LINK      (1 << 19)
0097 #  define CIA_CTRL_RD_TYPE_SHIFT    20
0098 #  define CIA_CTRL_RL_TYPE_SHIFT    24
0099 #  define CIA_CTRL_RM_TYPE_SHIFT    28
0100 #  define CIA_CTRL_EN_DMA_RD_PERF   (1 << 31)
0101 #define CIA_IOC_CIA_CNFG        (IDENT_ADDR + 0x8740000140UL)
0102 #  define CIA_CNFG_IOA_BWEN     (1 << 0)
0103 #  define CIA_CNFG_PCI_MWEN     (1 << 4)
0104 #  define CIA_CNFG_PCI_DWEN     (1 << 5)
0105 #  define CIA_CNFG_PCI_WLEN     (1 << 8)
0106 #define CIA_IOC_FLASH_CTRL      (IDENT_ADDR + 0x8740000200UL)
0107 #define CIA_IOC_HAE_MEM         (IDENT_ADDR + 0x8740000400UL)
0108 #define CIA_IOC_HAE_IO          (IDENT_ADDR + 0x8740000440UL)
0109 #define CIA_IOC_CFG         (IDENT_ADDR + 0x8740000480UL)
0110 #define CIA_IOC_CACK_EN         (IDENT_ADDR + 0x8740000600UL)
0111 #  define CIA_CACK_EN_LOCK_EN       (1 << 0)
0112 #  define CIA_CACK_EN_MB_EN     (1 << 1)
0113 #  define CIA_CACK_EN_SET_DIRTY_EN  (1 << 2)
0114 #  define CIA_CACK_EN_BC_VICTIM_EN  (1 << 3)
0115 
0116 
0117 /*
0118  * 21171-CA Diagnostic Registers
0119  */
0120 #define CIA_IOC_CIA_DIAG        (IDENT_ADDR + 0x8740002000UL)
0121 #define CIA_IOC_DIAG_CHECK      (IDENT_ADDR + 0x8740003000UL)
0122 
0123 /*
0124  * 21171-CA Performance Monitor registers
0125  */
0126 #define CIA_IOC_PERF_MONITOR        (IDENT_ADDR + 0x8740004000UL)
0127 #define CIA_IOC_PERF_CONTROL        (IDENT_ADDR + 0x8740004040UL)
0128 
0129 /*
0130  * 21171-CA Error registers
0131  */
0132 #define CIA_IOC_CPU_ERR0        (IDENT_ADDR + 0x8740008000UL)
0133 #define CIA_IOC_CPU_ERR1        (IDENT_ADDR + 0x8740008040UL)
0134 #define CIA_IOC_CIA_ERR         (IDENT_ADDR + 0x8740008200UL)
0135 #  define CIA_ERR_COR_ERR       (1 << 0)
0136 #  define CIA_ERR_UN_COR_ERR        (1 << 1)
0137 #  define CIA_ERR_CPU_PE        (1 << 2)
0138 #  define CIA_ERR_MEM_NEM       (1 << 3)
0139 #  define CIA_ERR_PCI_SERR      (1 << 4)
0140 #  define CIA_ERR_PERR          (1 << 5)
0141 #  define CIA_ERR_PCI_ADDR_PE       (1 << 6)
0142 #  define CIA_ERR_RCVD_MAS_ABT      (1 << 7)
0143 #  define CIA_ERR_RCVD_TAR_ABT      (1 << 8)
0144 #  define CIA_ERR_PA_PTE_INV        (1 << 9)
0145 #  define CIA_ERR_FROM_WRT_ERR      (1 << 10)
0146 #  define CIA_ERR_IOA_TIMEOUT       (1 << 11)
0147 #  define CIA_ERR_LOST_CORR_ERR     (1 << 16)
0148 #  define CIA_ERR_LOST_UN_CORR_ERR  (1 << 17)
0149 #  define CIA_ERR_LOST_CPU_PE       (1 << 18)
0150 #  define CIA_ERR_LOST_MEM_NEM      (1 << 19)
0151 #  define CIA_ERR_LOST_PERR     (1 << 21)
0152 #  define CIA_ERR_LOST_PCI_ADDR_PE  (1 << 22)
0153 #  define CIA_ERR_LOST_RCVD_MAS_ABT (1 << 23)
0154 #  define CIA_ERR_LOST_RCVD_TAR_ABT (1 << 24)
0155 #  define CIA_ERR_LOST_PA_PTE_INV   (1 << 25)
0156 #  define CIA_ERR_LOST_FROM_WRT_ERR (1 << 26)
0157 #  define CIA_ERR_LOST_IOA_TIMEOUT  (1 << 27)
0158 #  define CIA_ERR_VALID         (1 << 31)
0159 #define CIA_IOC_CIA_STAT        (IDENT_ADDR + 0x8740008240UL)
0160 #define CIA_IOC_ERR_MASK        (IDENT_ADDR + 0x8740008280UL)
0161 #define CIA_IOC_CIA_SYN         (IDENT_ADDR + 0x8740008300UL)
0162 #define CIA_IOC_MEM_ERR0        (IDENT_ADDR + 0x8740008400UL)
0163 #define CIA_IOC_MEM_ERR1        (IDENT_ADDR + 0x8740008440UL)
0164 #define CIA_IOC_PCI_ERR0        (IDENT_ADDR + 0x8740008800UL)
0165 #define CIA_IOC_PCI_ERR1        (IDENT_ADDR + 0x8740008840UL)
0166 #define CIA_IOC_PCI_ERR3        (IDENT_ADDR + 0x8740008880UL)
0167 
0168 /*
0169  * 21171-CA System configuration registers
0170  */
0171 #define CIA_IOC_MCR         (IDENT_ADDR + 0x8750000000UL)
0172 #define CIA_IOC_MBA0            (IDENT_ADDR + 0x8750000600UL)
0173 #define CIA_IOC_MBA2            (IDENT_ADDR + 0x8750000680UL)
0174 #define CIA_IOC_MBA4            (IDENT_ADDR + 0x8750000700UL)
0175 #define CIA_IOC_MBA6            (IDENT_ADDR + 0x8750000780UL)
0176 #define CIA_IOC_MBA8            (IDENT_ADDR + 0x8750000800UL)
0177 #define CIA_IOC_MBAA            (IDENT_ADDR + 0x8750000880UL)
0178 #define CIA_IOC_MBAC            (IDENT_ADDR + 0x8750000900UL)
0179 #define CIA_IOC_MBAE            (IDENT_ADDR + 0x8750000980UL)
0180 #define CIA_IOC_TMG0            (IDENT_ADDR + 0x8750000B00UL)
0181 #define CIA_IOC_TMG1            (IDENT_ADDR + 0x8750000B40UL)
0182 #define CIA_IOC_TMG2            (IDENT_ADDR + 0x8750000B80UL)
0183 
0184 /*
0185  * 2117A-CA PCI Address and Scatter-Gather Registers.
0186  */
0187 #define CIA_IOC_PCI_TBIA        (IDENT_ADDR + 0x8760000100UL)
0188 
0189 #define CIA_IOC_PCI_W0_BASE     (IDENT_ADDR + 0x8760000400UL)
0190 #define CIA_IOC_PCI_W0_MASK     (IDENT_ADDR + 0x8760000440UL)
0191 #define CIA_IOC_PCI_T0_BASE     (IDENT_ADDR + 0x8760000480UL)
0192 
0193 #define CIA_IOC_PCI_W1_BASE     (IDENT_ADDR + 0x8760000500UL)
0194 #define CIA_IOC_PCI_W1_MASK     (IDENT_ADDR + 0x8760000540UL)
0195 #define CIA_IOC_PCI_T1_BASE     (IDENT_ADDR + 0x8760000580UL)
0196 
0197 #define CIA_IOC_PCI_W2_BASE     (IDENT_ADDR + 0x8760000600UL)
0198 #define CIA_IOC_PCI_W2_MASK     (IDENT_ADDR + 0x8760000640UL)
0199 #define CIA_IOC_PCI_T2_BASE     (IDENT_ADDR + 0x8760000680UL)
0200 
0201 #define CIA_IOC_PCI_W3_BASE     (IDENT_ADDR + 0x8760000700UL)
0202 #define CIA_IOC_PCI_W3_MASK     (IDENT_ADDR + 0x8760000740UL)
0203 #define CIA_IOC_PCI_T3_BASE     (IDENT_ADDR + 0x8760000780UL)
0204 
0205 #define CIA_IOC_PCI_Wn_BASE(N)  (IDENT_ADDR + 0x8760000400UL + (N)*0x100) 
0206 #define CIA_IOC_PCI_Wn_MASK(N)  (IDENT_ADDR + 0x8760000440UL + (N)*0x100) 
0207 #define CIA_IOC_PCI_Tn_BASE(N)  (IDENT_ADDR + 0x8760000480UL + (N)*0x100) 
0208 
0209 #define CIA_IOC_PCI_W_DAC       (IDENT_ADDR + 0x87600007C0UL)
0210 
0211 /*
0212  * 2117A-CA Address Translation Registers.
0213  */
0214 
0215 /* 8 tag registers, the first 4 of which are lockable.  */
0216 #define CIA_IOC_TB_TAGn(n) \
0217     (IDENT_ADDR + 0x8760000800UL + (n)*0x40)
0218 
0219 /* 4 page registers per tag register.  */
0220 #define CIA_IOC_TBn_PAGEm(n,m) \
0221     (IDENT_ADDR + 0x8760001000UL + (n)*0x100 + (m)*0x40)
0222 
0223 /*
0224  * Memory spaces:
0225  */
0226 #define CIA_IACK_SC         (IDENT_ADDR + 0x8720000000UL)
0227 #define CIA_CONF            (IDENT_ADDR + 0x8700000000UL)
0228 #define CIA_IO              (IDENT_ADDR + 0x8580000000UL)
0229 #define CIA_SPARSE_MEM          (IDENT_ADDR + 0x8000000000UL)
0230 #define CIA_SPARSE_MEM_R2       (IDENT_ADDR + 0x8400000000UL)
0231 #define CIA_SPARSE_MEM_R3       (IDENT_ADDR + 0x8500000000UL)
0232 #define CIA_DENSE_MEM               (IDENT_ADDR + 0x8600000000UL)
0233 #define CIA_BW_MEM          (IDENT_ADDR + 0x8800000000UL)
0234 #define CIA_BW_IO           (IDENT_ADDR + 0x8900000000UL)
0235 #define CIA_BW_CFG_0            (IDENT_ADDR + 0x8a00000000UL)
0236 #define CIA_BW_CFG_1            (IDENT_ADDR + 0x8b00000000UL)
0237 
0238 /*
0239  * ALCOR's GRU ASIC registers
0240  */
0241 #define GRU_INT_REQ         (IDENT_ADDR + 0x8780000000UL)
0242 #define GRU_INT_MASK            (IDENT_ADDR + 0x8780000040UL)
0243 #define GRU_INT_EDGE            (IDENT_ADDR + 0x8780000080UL)
0244 #define GRU_INT_HILO            (IDENT_ADDR + 0x87800000C0UL)
0245 #define GRU_INT_CLEAR           (IDENT_ADDR + 0x8780000100UL)
0246 
0247 #define GRU_CACHE_CNFG          (IDENT_ADDR + 0x8780000200UL)
0248 #define GRU_SCR             (IDENT_ADDR + 0x8780000300UL)
0249 #define GRU_LED             (IDENT_ADDR + 0x8780000800UL)
0250 #define GRU_RESET           (IDENT_ADDR + 0x8780000900UL)
0251 
0252 #define ALCOR_GRU_INT_REQ_BITS      0x800fffffUL
0253 #define XLT_GRU_INT_REQ_BITS        0x80003fffUL
0254 #define GRU_INT_REQ_BITS        (alpha_mv.sys.cia.gru_int_req_bits+0)
0255 
0256 /*
0257  * PYXIS interrupt control registers
0258  */
0259 #define PYXIS_INT_REQ           (IDENT_ADDR + 0x87A0000000UL)
0260 #define PYXIS_INT_MASK          (IDENT_ADDR + 0x87A0000040UL)
0261 #define PYXIS_INT_HILO          (IDENT_ADDR + 0x87A00000C0UL)
0262 #define PYXIS_INT_ROUTE         (IDENT_ADDR + 0x87A0000140UL)
0263 #define PYXIS_GPO           (IDENT_ADDR + 0x87A0000180UL)
0264 #define PYXIS_INT_CNFG          (IDENT_ADDR + 0x87A00001C0UL)
0265 #define PYXIS_RT_COUNT          (IDENT_ADDR + 0x87A0000200UL)
0266 #define PYXIS_INT_TIME          (IDENT_ADDR + 0x87A0000240UL)
0267 #define PYXIS_IIC_CTRL          (IDENT_ADDR + 0x87A00002C0UL)
0268 #define PYXIS_RESET         (IDENT_ADDR + 0x8780000900UL)
0269 
0270 /* Offset between ram physical addresses and pci64 DAC bus addresses.  */
0271 #define PYXIS_DAC_OFFSET        (1UL << 40)
0272 
0273 /*
0274  * Data structure for handling CIA machine checks.
0275  */
0276 
0277 /* System-specific info.  */
0278 struct el_CIA_sysdata_mcheck {
0279     unsigned long   cpu_err0;
0280     unsigned long   cpu_err1;
0281     unsigned long   cia_err;
0282     unsigned long   cia_stat;
0283     unsigned long   err_mask;
0284     unsigned long   cia_syn;
0285     unsigned long   mem_err0;
0286     unsigned long   mem_err1;
0287     unsigned long   pci_err0;
0288     unsigned long   pci_err1;
0289     unsigned long   pci_err2;
0290 };
0291 
0292 
0293 #ifdef __KERNEL__
0294 
0295 #ifndef __EXTERN_INLINE
0296 /* Do not touch, this should *NOT* be static inline */
0297 #define __EXTERN_INLINE extern inline
0298 #define __IO_EXTERN_INLINE
0299 #endif
0300 
0301 /*
0302  * I/O functions:
0303  *
0304  * CIA (the 2117x PCI/memory support chipset for the EV5 (21164)
0305  * series of processors uses a sparse address mapping scheme to
0306  * get at PCI memory and I/O.
0307  */
0308 
0309 /*
0310  * Memory functions.  64-bit and 32-bit accesses are done through
0311  * dense memory space, everything else through sparse space.
0312  *
0313  * For reading and writing 8 and 16 bit quantities we need to
0314  * go through one of the three sparse address mapping regions
0315  * and use the HAE_MEM CSR to provide some bits of the address.
0316  * The following few routines use only sparse address region 1
0317  * which gives 1Gbyte of accessible space which relates exactly
0318  * to the amount of PCI memory mapping *into* system address space.
0319  * See p 6-17 of the specification but it looks something like this:
0320  *
0321  * 21164 Address:
0322  *
0323  *          3         2         1
0324  * 9876543210987654321098765432109876543210
0325  * 1ZZZZ0.PCI.QW.Address............BBLL
0326  *
0327  * ZZ = SBZ
0328  * BB = Byte offset
0329  * LL = Transfer length
0330  *
0331  * PCI Address:
0332  *
0333  * 3         2         1
0334  * 10987654321098765432109876543210
0335  * HHH....PCI.QW.Address........ 00
0336  *
0337  * HHH = 31:29 HAE_MEM CSR
0338  *
0339  */
0340 
0341 #define vip volatile int __force *
0342 #define vuip    volatile unsigned int __force *
0343 #define vulp    volatile unsigned long __force *
0344 
0345 __EXTERN_INLINE unsigned int cia_ioread8(const void __iomem *xaddr)
0346 {
0347     unsigned long addr = (unsigned long) xaddr;
0348     unsigned long result, base_and_type;
0349 
0350     if (addr >= CIA_DENSE_MEM)
0351         base_and_type = CIA_SPARSE_MEM + 0x00;
0352     else
0353         base_and_type = CIA_IO + 0x00;
0354 
0355     /* We can use CIA_MEM_R1_MASK for io ports too, since it is large
0356        enough to cover all io ports, and smaller than CIA_IO.  */
0357     addr &= CIA_MEM_R1_MASK;
0358     result = *(vip) ((addr << 5) + base_and_type);
0359     return __kernel_extbl(result, addr & 3);
0360 }
0361 
0362 __EXTERN_INLINE void cia_iowrite8(u8 b, void __iomem *xaddr)
0363 {
0364     unsigned long addr = (unsigned long) xaddr;
0365     unsigned long w, base_and_type;
0366 
0367     if (addr >= CIA_DENSE_MEM)
0368         base_and_type = CIA_SPARSE_MEM + 0x00;
0369     else
0370         base_and_type = CIA_IO + 0x00;
0371 
0372     addr &= CIA_MEM_R1_MASK;
0373     w = __kernel_insbl(b, addr & 3);
0374     *(vuip) ((addr << 5) + base_and_type) = w;
0375 }
0376 
0377 __EXTERN_INLINE unsigned int cia_ioread16(const void __iomem *xaddr)
0378 {
0379     unsigned long addr = (unsigned long) xaddr;
0380     unsigned long result, base_and_type;
0381 
0382     if (addr >= CIA_DENSE_MEM)
0383         base_and_type = CIA_SPARSE_MEM + 0x08;
0384     else
0385         base_and_type = CIA_IO + 0x08;
0386 
0387     addr &= CIA_MEM_R1_MASK;
0388     result = *(vip) ((addr << 5) + base_and_type);
0389     return __kernel_extwl(result, addr & 3);
0390 }
0391 
0392 __EXTERN_INLINE void cia_iowrite16(u16 b, void __iomem *xaddr)
0393 {
0394     unsigned long addr = (unsigned long) xaddr;
0395     unsigned long w, base_and_type;
0396 
0397     if (addr >= CIA_DENSE_MEM)
0398         base_and_type = CIA_SPARSE_MEM + 0x08;
0399     else
0400         base_and_type = CIA_IO + 0x08;
0401 
0402     addr &= CIA_MEM_R1_MASK;
0403     w = __kernel_inswl(b, addr & 3);
0404     *(vuip) ((addr << 5) + base_and_type) = w;
0405 }
0406 
0407 __EXTERN_INLINE unsigned int cia_ioread32(const void __iomem *xaddr)
0408 {
0409     unsigned long addr = (unsigned long) xaddr;
0410     if (addr < CIA_DENSE_MEM)
0411         addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
0412     return *(vuip)addr;
0413 }
0414 
0415 __EXTERN_INLINE void cia_iowrite32(u32 b, void __iomem *xaddr)
0416 {
0417     unsigned long addr = (unsigned long) xaddr;
0418     if (addr < CIA_DENSE_MEM)
0419         addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
0420     *(vuip)addr = b;
0421 }
0422 
0423 __EXTERN_INLINE void __iomem *cia_ioportmap(unsigned long addr)
0424 {
0425     return (void __iomem *)(addr + CIA_IO);
0426 }
0427 
0428 __EXTERN_INLINE void __iomem *cia_ioremap(unsigned long addr,
0429                       unsigned long size)
0430 {
0431     return (void __iomem *)(addr + CIA_DENSE_MEM);
0432 }
0433 
0434 __EXTERN_INLINE int cia_is_ioaddr(unsigned long addr)
0435 {
0436     return addr >= IDENT_ADDR + 0x8000000000UL;
0437 }
0438 
0439 __EXTERN_INLINE int cia_is_mmio(const volatile void __iomem *addr)
0440 {
0441     return (unsigned long)addr >= CIA_DENSE_MEM;
0442 }
0443 
0444 __EXTERN_INLINE void __iomem *cia_bwx_ioportmap(unsigned long addr)
0445 {
0446     return (void __iomem *)(addr + CIA_BW_IO);
0447 }
0448 
0449 __EXTERN_INLINE void __iomem *cia_bwx_ioremap(unsigned long addr,
0450                           unsigned long size)
0451 {
0452     return (void __iomem *)(addr + CIA_BW_MEM);
0453 }
0454 
0455 __EXTERN_INLINE int cia_bwx_is_ioaddr(unsigned long addr)
0456 {
0457     return addr >= IDENT_ADDR + 0x8000000000UL;
0458 }
0459 
0460 __EXTERN_INLINE int cia_bwx_is_mmio(const volatile void __iomem *addr)
0461 {
0462     return (unsigned long)addr < CIA_BW_IO;
0463 }
0464 
0465 #undef vip
0466 #undef vuip
0467 #undef vulp
0468 
0469 #undef __IO_PREFIX
0470 #define __IO_PREFIX     cia
0471 #define cia_trivial_rw_bw   2
0472 #define cia_trivial_rw_lq   1
0473 #define cia_trivial_io_bw   0
0474 #define cia_trivial_io_lq   0
0475 #define cia_trivial_iounmap 1
0476 #include <asm/io_trivial.h>
0477 
0478 #undef __IO_PREFIX
0479 #define __IO_PREFIX     cia_bwx
0480 #define cia_bwx_trivial_rw_bw   1
0481 #define cia_bwx_trivial_rw_lq   1
0482 #define cia_bwx_trivial_io_bw   1
0483 #define cia_bwx_trivial_io_lq   1
0484 #define cia_bwx_trivial_iounmap 1
0485 #include <asm/io_trivial.h>
0486 
0487 #undef __IO_PREFIX
0488 #ifdef CONFIG_ALPHA_PYXIS
0489 #define __IO_PREFIX     cia_bwx
0490 #else
0491 #define __IO_PREFIX     cia
0492 #endif
0493 
0494 #ifdef __IO_EXTERN_INLINE
0495 #undef __EXTERN_INLINE
0496 #undef __IO_EXTERN_INLINE
0497 #endif
0498 
0499 #endif /* __KERNEL__ */
0500 
0501 #endif /* __ALPHA_CIA__H__ */