core_cia.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. #ifndef __ALPHA_CIA__H__
  2. #define __ALPHA_CIA__H__
  3. /* Define to experiment with fitting everything into one 512MB HAE window. */
  4. #define CIA_ONE_HAE_WINDOW 1
  5. #include <linux/config.h>
  6. #include <linux/types.h>
  7. #include <asm/compiler.h>
  8. /*
  9. * CIA is the internal name for the 21171 chipset which provides
  10. * memory controller and PCI access for the 21164 chip based systems.
  11. * Also supported here is the 21172 (CIA-2) and 21174 (PYXIS).
  12. *
  13. * The lineage is a bit confused, since the 21174 was reportedly started
  14. * from the 21171 Pass 1 mask, and so is missing bug fixes that appear
  15. * in 21171 Pass 2 and 21172, but it also contains additional features.
  16. *
  17. * This file is based on:
  18. *
  19. * DECchip 21171 Core Logic Chipset
  20. * Technical Reference Manual
  21. *
  22. * EC-QE18B-TE
  23. *
  24. * david.rusling@reo.mts.dec.com Initial Version.
  25. *
  26. */
  27. /*
  28. * CIA ADDRESS BIT DEFINITIONS
  29. *
  30. * 3333 3333 3322 2222 2222 1111 1111 11
  31. * 9876 5432 1098 7654 3210 9876 5432 1098 7654 3210
  32. * ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
  33. * 1 000
  34. * ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
  35. * | |\|
  36. * | Byte Enable --+ |
  37. * | Transfer Length --+
  38. * +-- IO space, not cached
  39. *
  40. * Byte Transfer
  41. * Enable Length Transfer Byte Address
  42. * adr<6:5> adr<4:3> Length Enable Adder
  43. * ---------------------------------------------
  44. * 00 00 Byte 1110 0x000
  45. * 01 00 Byte 1101 0x020
  46. * 10 00 Byte 1011 0x040
  47. * 11 00 Byte 0111 0x060
  48. *
  49. * 00 01 Word 1100 0x008
  50. * 01 01 Word 1001 0x028 <= Not supported in this code.
  51. * 10 01 Word 0011 0x048
  52. *
  53. * 00 10 Tribyte 1000 0x010
  54. * 01 10 Tribyte 0001 0x030
  55. *
  56. * 10 11 Longword 0000 0x058
  57. *
  58. * Note that byte enables are asserted low.
  59. *
  60. */
  61. #define CIA_MEM_R1_MASK 0x1fffffff /* SPARSE Mem region 1 mask is 29 bits */
  62. #define CIA_MEM_R2_MASK 0x07ffffff /* SPARSE Mem region 2 mask is 27 bits */
  63. #define CIA_MEM_R3_MASK 0x03ffffff /* SPARSE Mem region 3 mask is 26 bits */
  64. /*
  65. * 21171-CA Control and Status Registers
  66. */
  67. #define CIA_IOC_CIA_REV (IDENT_ADDR + 0x8740000080UL)
  68. # define CIA_REV_MASK 0xff
  69. #define CIA_IOC_PCI_LAT (IDENT_ADDR + 0x87400000C0UL)
  70. #define CIA_IOC_CIA_CTRL (IDENT_ADDR + 0x8740000100UL)
  71. # define CIA_CTRL_PCI_EN (1 << 0)
  72. # define CIA_CTRL_PCI_LOCK_EN (1 << 1)
  73. # define CIA_CTRL_PCI_LOOP_EN (1 << 2)
  74. # define CIA_CTRL_FST_BB_EN (1 << 3)
  75. # define CIA_CTRL_PCI_MST_EN (1 << 4)
  76. # define CIA_CTRL_PCI_MEM_EN (1 << 5)
  77. # define CIA_CTRL_PCI_REQ64_EN (1 << 6)
  78. # define CIA_CTRL_PCI_ACK64_EN (1 << 7)
  79. # define CIA_CTRL_ADDR_PE_EN (1 << 8)
  80. # define CIA_CTRL_PERR_EN (1 << 9)
  81. # define CIA_CTRL_FILL_ERR_EN (1 << 10)
  82. # define CIA_CTRL_MCHK_ERR_EN (1 << 11)
  83. # define CIA_CTRL_ECC_CHK_EN (1 << 12)
  84. # define CIA_CTRL_ASSERT_IDLE_BC (1 << 13)
  85. # define CIA_CTRL_COM_IDLE_BC (1 << 14)
  86. # define CIA_CTRL_CSR_IOA_BYPASS (1 << 15)
  87. # define CIA_CTRL_IO_FLUSHREQ_EN (1 << 16)
  88. # define CIA_CTRL_CPU_FLUSHREQ_EN (1 << 17)
  89. # define CIA_CTRL_ARB_CPU_EN (1 << 18)
  90. # define CIA_CTRL_EN_ARB_LINK (1 << 19)
  91. # define CIA_CTRL_RD_TYPE_SHIFT 20
  92. # define CIA_CTRL_RL_TYPE_SHIFT 24
  93. # define CIA_CTRL_RM_TYPE_SHIFT 28
  94. # define CIA_CTRL_EN_DMA_RD_PERF (1 << 31)
  95. #define CIA_IOC_CIA_CNFG (IDENT_ADDR + 0x8740000140UL)
  96. # define CIA_CNFG_IOA_BWEN (1 << 0)
  97. # define CIA_CNFG_PCI_MWEN (1 << 4)
  98. # define CIA_CNFG_PCI_DWEN (1 << 5)
  99. # define CIA_CNFG_PCI_WLEN (1 << 8)
  100. #define CIA_IOC_FLASH_CTRL (IDENT_ADDR + 0x8740000200UL)
  101. #define CIA_IOC_HAE_MEM (IDENT_ADDR + 0x8740000400UL)
  102. #define CIA_IOC_HAE_IO (IDENT_ADDR + 0x8740000440UL)
  103. #define CIA_IOC_CFG (IDENT_ADDR + 0x8740000480UL)
  104. #define CIA_IOC_CACK_EN (IDENT_ADDR + 0x8740000600UL)
  105. # define CIA_CACK_EN_LOCK_EN (1 << 0)
  106. # define CIA_CACK_EN_MB_EN (1 << 1)
  107. # define CIA_CACK_EN_SET_DIRTY_EN (1 << 2)
  108. # define CIA_CACK_EN_BC_VICTIM_EN (1 << 3)
  109. /*
  110. * 21171-CA Diagnostic Registers
  111. */
  112. #define CIA_IOC_CIA_DIAG (IDENT_ADDR + 0x8740002000UL)
  113. #define CIA_IOC_DIAG_CHECK (IDENT_ADDR + 0x8740003000UL)
  114. /*
  115. * 21171-CA Performance Monitor registers
  116. */
  117. #define CIA_IOC_PERF_MONITOR (IDENT_ADDR + 0x8740004000UL)
  118. #define CIA_IOC_PERF_CONTROL (IDENT_ADDR + 0x8740004040UL)
  119. /*
  120. * 21171-CA Error registers
  121. */
  122. #define CIA_IOC_CPU_ERR0 (IDENT_ADDR + 0x8740008000UL)
  123. #define CIA_IOC_CPU_ERR1 (IDENT_ADDR + 0x8740008040UL)
  124. #define CIA_IOC_CIA_ERR (IDENT_ADDR + 0x8740008200UL)
  125. # define CIA_ERR_COR_ERR (1 << 0)
  126. # define CIA_ERR_UN_COR_ERR (1 << 1)
  127. # define CIA_ERR_CPU_PE (1 << 2)
  128. # define CIA_ERR_MEM_NEM (1 << 3)
  129. # define CIA_ERR_PCI_SERR (1 << 4)
  130. # define CIA_ERR_PERR (1 << 5)
  131. # define CIA_ERR_PCI_ADDR_PE (1 << 6)
  132. # define CIA_ERR_RCVD_MAS_ABT (1 << 7)
  133. # define CIA_ERR_RCVD_TAR_ABT (1 << 8)
  134. # define CIA_ERR_PA_PTE_INV (1 << 9)
  135. # define CIA_ERR_FROM_WRT_ERR (1 << 10)
  136. # define CIA_ERR_IOA_TIMEOUT (1 << 11)
  137. # define CIA_ERR_LOST_CORR_ERR (1 << 16)
  138. # define CIA_ERR_LOST_UN_CORR_ERR (1 << 17)
  139. # define CIA_ERR_LOST_CPU_PE (1 << 18)
  140. # define CIA_ERR_LOST_MEM_NEM (1 << 19)
  141. # define CIA_ERR_LOST_PERR (1 << 21)
  142. # define CIA_ERR_LOST_PCI_ADDR_PE (1 << 22)
  143. # define CIA_ERR_LOST_RCVD_MAS_ABT (1 << 23)
  144. # define CIA_ERR_LOST_RCVD_TAR_ABT (1 << 24)
  145. # define CIA_ERR_LOST_PA_PTE_INV (1 << 25)
  146. # define CIA_ERR_LOST_FROM_WRT_ERR (1 << 26)
  147. # define CIA_ERR_LOST_IOA_TIMEOUT (1 << 27)
  148. # define CIA_ERR_VALID (1 << 31)
  149. #define CIA_IOC_CIA_STAT (IDENT_ADDR + 0x8740008240UL)
  150. #define CIA_IOC_ERR_MASK (IDENT_ADDR + 0x8740008280UL)
  151. #define CIA_IOC_CIA_SYN (IDENT_ADDR + 0x8740008300UL)
  152. #define CIA_IOC_MEM_ERR0 (IDENT_ADDR + 0x8740008400UL)
  153. #define CIA_IOC_MEM_ERR1 (IDENT_ADDR + 0x8740008440UL)
  154. #define CIA_IOC_PCI_ERR0 (IDENT_ADDR + 0x8740008800UL)
  155. #define CIA_IOC_PCI_ERR1 (IDENT_ADDR + 0x8740008840UL)
  156. #define CIA_IOC_PCI_ERR3 (IDENT_ADDR + 0x8740008880UL)
  157. /*
  158. * 21171-CA System configuration registers
  159. */
  160. #define CIA_IOC_MCR (IDENT_ADDR + 0x8750000000UL)
  161. #define CIA_IOC_MBA0 (IDENT_ADDR + 0x8750000600UL)
  162. #define CIA_IOC_MBA2 (IDENT_ADDR + 0x8750000680UL)
  163. #define CIA_IOC_MBA4 (IDENT_ADDR + 0x8750000700UL)
  164. #define CIA_IOC_MBA6 (IDENT_ADDR + 0x8750000780UL)
  165. #define CIA_IOC_MBA8 (IDENT_ADDR + 0x8750000800UL)
  166. #define CIA_IOC_MBAA (IDENT_ADDR + 0x8750000880UL)
  167. #define CIA_IOC_MBAC (IDENT_ADDR + 0x8750000900UL)
  168. #define CIA_IOC_MBAE (IDENT_ADDR + 0x8750000980UL)
  169. #define CIA_IOC_TMG0 (IDENT_ADDR + 0x8750000B00UL)
  170. #define CIA_IOC_TMG1 (IDENT_ADDR + 0x8750000B40UL)
  171. #define CIA_IOC_TMG2 (IDENT_ADDR + 0x8750000B80UL)
  172. /*
  173. * 2117A-CA PCI Address and Scatter-Gather Registers.
  174. */
  175. #define CIA_IOC_PCI_TBIA (IDENT_ADDR + 0x8760000100UL)
  176. #define CIA_IOC_PCI_W0_BASE (IDENT_ADDR + 0x8760000400UL)
  177. #define CIA_IOC_PCI_W0_MASK (IDENT_ADDR + 0x8760000440UL)
  178. #define CIA_IOC_PCI_T0_BASE (IDENT_ADDR + 0x8760000480UL)
  179. #define CIA_IOC_PCI_W1_BASE (IDENT_ADDR + 0x8760000500UL)
  180. #define CIA_IOC_PCI_W1_MASK (IDENT_ADDR + 0x8760000540UL)
  181. #define CIA_IOC_PCI_T1_BASE (IDENT_ADDR + 0x8760000580UL)
  182. #define CIA_IOC_PCI_W2_BASE (IDENT_ADDR + 0x8760000600UL)
  183. #define CIA_IOC_PCI_W2_MASK (IDENT_ADDR + 0x8760000640UL)
  184. #define CIA_IOC_PCI_T2_BASE (IDENT_ADDR + 0x8760000680UL)
  185. #define CIA_IOC_PCI_W3_BASE (IDENT_ADDR + 0x8760000700UL)
  186. #define CIA_IOC_PCI_W3_MASK (IDENT_ADDR + 0x8760000740UL)
  187. #define CIA_IOC_PCI_T3_BASE (IDENT_ADDR + 0x8760000780UL)
  188. #define CIA_IOC_PCI_Wn_BASE(N) (IDENT_ADDR + 0x8760000400UL + (N)*0x100)
  189. #define CIA_IOC_PCI_Wn_MASK(N) (IDENT_ADDR + 0x8760000440UL + (N)*0x100)
  190. #define CIA_IOC_PCI_Tn_BASE(N) (IDENT_ADDR + 0x8760000480UL + (N)*0x100)
  191. #define CIA_IOC_PCI_W_DAC (IDENT_ADDR + 0x87600007C0UL)
  192. /*
  193. * 2117A-CA Address Translation Registers.
  194. */
  195. /* 8 tag registers, the first 4 of which are lockable. */
  196. #define CIA_IOC_TB_TAGn(n) \
  197. (IDENT_ADDR + 0x8760000800UL + (n)*0x40)
  198. /* 4 page registers per tag register. */
  199. #define CIA_IOC_TBn_PAGEm(n,m) \
  200. (IDENT_ADDR + 0x8760001000UL + (n)*0x100 + (m)*0x40)
  201. /*
  202. * Memory spaces:
  203. */
  204. #define CIA_IACK_SC (IDENT_ADDR + 0x8720000000UL)
  205. #define CIA_CONF (IDENT_ADDR + 0x8700000000UL)
  206. #define CIA_IO (IDENT_ADDR + 0x8580000000UL)
  207. #define CIA_SPARSE_MEM (IDENT_ADDR + 0x8000000000UL)
  208. #define CIA_SPARSE_MEM_R2 (IDENT_ADDR + 0x8400000000UL)
  209. #define CIA_SPARSE_MEM_R3 (IDENT_ADDR + 0x8500000000UL)
  210. #define CIA_DENSE_MEM (IDENT_ADDR + 0x8600000000UL)
  211. #define CIA_BW_MEM (IDENT_ADDR + 0x8800000000UL)
  212. #define CIA_BW_IO (IDENT_ADDR + 0x8900000000UL)
  213. #define CIA_BW_CFG_0 (IDENT_ADDR + 0x8a00000000UL)
  214. #define CIA_BW_CFG_1 (IDENT_ADDR + 0x8b00000000UL)
  215. /*
  216. * ALCOR's GRU ASIC registers
  217. */
  218. #define GRU_INT_REQ (IDENT_ADDR + 0x8780000000UL)
  219. #define GRU_INT_MASK (IDENT_ADDR + 0x8780000040UL)
  220. #define GRU_INT_EDGE (IDENT_ADDR + 0x8780000080UL)
  221. #define GRU_INT_HILO (IDENT_ADDR + 0x87800000C0UL)
  222. #define GRU_INT_CLEAR (IDENT_ADDR + 0x8780000100UL)
  223. #define GRU_CACHE_CNFG (IDENT_ADDR + 0x8780000200UL)
  224. #define GRU_SCR (IDENT_ADDR + 0x8780000300UL)
  225. #define GRU_LED (IDENT_ADDR + 0x8780000800UL)
  226. #define GRU_RESET (IDENT_ADDR + 0x8780000900UL)
  227. #define ALCOR_GRU_INT_REQ_BITS 0x800fffffUL
  228. #define XLT_GRU_INT_REQ_BITS 0x80003fffUL
  229. #define GRU_INT_REQ_BITS (alpha_mv.sys.cia.gru_int_req_bits+0)
  230. /*
  231. * PYXIS interrupt control registers
  232. */
  233. #define PYXIS_INT_REQ (IDENT_ADDR + 0x87A0000000UL)
  234. #define PYXIS_INT_MASK (IDENT_ADDR + 0x87A0000040UL)
  235. #define PYXIS_INT_HILO (IDENT_ADDR + 0x87A00000C0UL)
  236. #define PYXIS_INT_ROUTE (IDENT_ADDR + 0x87A0000140UL)
  237. #define PYXIS_GPO (IDENT_ADDR + 0x87A0000180UL)
  238. #define PYXIS_INT_CNFG (IDENT_ADDR + 0x87A00001C0UL)
  239. #define PYXIS_RT_COUNT (IDENT_ADDR + 0x87A0000200UL)
  240. #define PYXIS_INT_TIME (IDENT_ADDR + 0x87A0000240UL)
  241. #define PYXIS_IIC_CTRL (IDENT_ADDR + 0x87A00002C0UL)
  242. #define PYXIS_RESET (IDENT_ADDR + 0x8780000900UL)
  243. /* Offset between ram physical addresses and pci64 DAC bus addresses. */
  244. #define PYXIS_DAC_OFFSET (1UL << 40)
  245. /*
  246. * Data structure for handling CIA machine checks.
  247. */
  248. /* System-specific info. */
  249. struct el_CIA_sysdata_mcheck {
  250. unsigned long cpu_err0;
  251. unsigned long cpu_err1;
  252. unsigned long cia_err;
  253. unsigned long cia_stat;
  254. unsigned long err_mask;
  255. unsigned long cia_syn;
  256. unsigned long mem_err0;
  257. unsigned long mem_err1;
  258. unsigned long pci_err0;
  259. unsigned long pci_err1;
  260. unsigned long pci_err2;
  261. };
  262. #ifdef __KERNEL__
  263. #ifndef __EXTERN_INLINE
  264. /* Do not touch, this should *NOT* be static inline */
  265. #define __EXTERN_INLINE extern inline
  266. #define __IO_EXTERN_INLINE
  267. #endif
  268. /*
  269. * I/O functions:
  270. *
  271. * CIA (the 2117x PCI/memory support chipset for the EV5 (21164)
  272. * series of processors uses a sparse address mapping scheme to
  273. * get at PCI memory and I/O.
  274. */
  275. /*
  276. * Memory functions. 64-bit and 32-bit accesses are done through
  277. * dense memory space, everything else through sparse space.
  278. *
  279. * For reading and writing 8 and 16 bit quantities we need to
  280. * go through one of the three sparse address mapping regions
  281. * and use the HAE_MEM CSR to provide some bits of the address.
  282. * The following few routines use only sparse address region 1
  283. * which gives 1Gbyte of accessible space which relates exactly
  284. * to the amount of PCI memory mapping *into* system address space.
  285. * See p 6-17 of the specification but it looks something like this:
  286. *
  287. * 21164 Address:
  288. *
  289. * 3 2 1
  290. * 9876543210987654321098765432109876543210
  291. * 1ZZZZ0.PCI.QW.Address............BBLL
  292. *
  293. * ZZ = SBZ
  294. * BB = Byte offset
  295. * LL = Transfer length
  296. *
  297. * PCI Address:
  298. *
  299. * 3 2 1
  300. * 10987654321098765432109876543210
  301. * HHH....PCI.QW.Address........ 00
  302. *
  303. * HHH = 31:29 HAE_MEM CSR
  304. *
  305. */
  306. #define vip volatile int __force *
  307. #define vuip volatile unsigned int __force *
  308. #define vulp volatile unsigned long __force *
  309. __EXTERN_INLINE unsigned int cia_ioread8(void __iomem *xaddr)
  310. {
  311. unsigned long addr = (unsigned long) xaddr;
  312. unsigned long result, base_and_type;
  313. if (addr >= CIA_DENSE_MEM)
  314. base_and_type = CIA_SPARSE_MEM + 0x00;
  315. else
  316. base_and_type = CIA_IO + 0x00;
  317. /* We can use CIA_MEM_R1_MASK for io ports too, since it is large
  318. enough to cover all io ports, and smaller than CIA_IO. */
  319. addr &= CIA_MEM_R1_MASK;
  320. result = *(vip) ((addr << 5) + base_and_type);
  321. return __kernel_extbl(result, addr & 3);
  322. }
  323. __EXTERN_INLINE void cia_iowrite8(u8 b, void __iomem *xaddr)
  324. {
  325. unsigned long addr = (unsigned long) xaddr;
  326. unsigned long w, base_and_type;
  327. if (addr >= CIA_DENSE_MEM)
  328. base_and_type = CIA_SPARSE_MEM + 0x00;
  329. else
  330. base_and_type = CIA_IO + 0x00;
  331. addr &= CIA_MEM_R1_MASK;
  332. w = __kernel_insbl(b, addr & 3);
  333. *(vuip) ((addr << 5) + base_and_type) = w;
  334. }
  335. __EXTERN_INLINE unsigned int cia_ioread16(void __iomem *xaddr)
  336. {
  337. unsigned long addr = (unsigned long) xaddr;
  338. unsigned long result, base_and_type;
  339. if (addr >= CIA_DENSE_MEM)
  340. base_and_type = CIA_SPARSE_MEM + 0x08;
  341. else
  342. base_and_type = CIA_IO + 0x08;
  343. addr &= CIA_MEM_R1_MASK;
  344. result = *(vip) ((addr << 5) + base_and_type);
  345. return __kernel_extwl(result, addr & 3);
  346. }
  347. __EXTERN_INLINE void cia_iowrite16(u16 b, void __iomem *xaddr)
  348. {
  349. unsigned long addr = (unsigned long) xaddr;
  350. unsigned long w, base_and_type;
  351. if (addr >= CIA_DENSE_MEM)
  352. base_and_type = CIA_SPARSE_MEM + 0x08;
  353. else
  354. base_and_type = CIA_IO + 0x08;
  355. addr &= CIA_MEM_R1_MASK;
  356. w = __kernel_inswl(b, addr & 3);
  357. *(vuip) ((addr << 5) + base_and_type) = w;
  358. }
  359. __EXTERN_INLINE unsigned int cia_ioread32(void __iomem *xaddr)
  360. {
  361. unsigned long addr = (unsigned long) xaddr;
  362. if (addr < CIA_DENSE_MEM)
  363. addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
  364. return *(vuip)addr;
  365. }
  366. __EXTERN_INLINE void cia_iowrite32(u32 b, void __iomem *xaddr)
  367. {
  368. unsigned long addr = (unsigned long) xaddr;
  369. if (addr < CIA_DENSE_MEM)
  370. addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
  371. *(vuip)addr = b;
  372. }
  373. __EXTERN_INLINE void __iomem *cia_ioportmap(unsigned long addr)
  374. {
  375. return (void __iomem *)(addr + CIA_IO);
  376. }
  377. __EXTERN_INLINE void __iomem *cia_ioremap(unsigned long addr,
  378. unsigned long size)
  379. {
  380. return (void __iomem *)(addr + CIA_DENSE_MEM);
  381. }
  382. __EXTERN_INLINE int cia_is_ioaddr(unsigned long addr)
  383. {
  384. return addr >= IDENT_ADDR + 0x8000000000UL;
  385. }
  386. __EXTERN_INLINE int cia_is_mmio(const volatile void __iomem *addr)
  387. {
  388. return (unsigned long)addr >= CIA_DENSE_MEM;
  389. }
  390. __EXTERN_INLINE void __iomem *cia_bwx_ioportmap(unsigned long addr)
  391. {
  392. return (void __iomem *)(addr + CIA_BW_IO);
  393. }
  394. __EXTERN_INLINE void __iomem *cia_bwx_ioremap(unsigned long addr,
  395. unsigned long size)
  396. {
  397. return (void __iomem *)(addr + CIA_BW_MEM);
  398. }
  399. __EXTERN_INLINE int cia_bwx_is_ioaddr(unsigned long addr)
  400. {
  401. return addr >= IDENT_ADDR + 0x8000000000UL;
  402. }
  403. __EXTERN_INLINE int cia_bwx_is_mmio(const volatile void __iomem *addr)
  404. {
  405. return (unsigned long)addr < CIA_BW_IO;
  406. }
  407. #undef vip
  408. #undef vuip
  409. #undef vulp
  410. #undef __IO_PREFIX
  411. #define __IO_PREFIX cia
  412. #define cia_trivial_rw_bw 2
  413. #define cia_trivial_rw_lq 1
  414. #define cia_trivial_io_bw 0
  415. #define cia_trivial_io_lq 0
  416. #define cia_trivial_iounmap 1
  417. #include <asm/io_trivial.h>
  418. #undef __IO_PREFIX
  419. #define __IO_PREFIX cia_bwx
  420. #define cia_bwx_trivial_rw_bw 1
  421. #define cia_bwx_trivial_rw_lq 1
  422. #define cia_bwx_trivial_io_bw 1
  423. #define cia_bwx_trivial_io_lq 1
  424. #define cia_bwx_trivial_iounmap 1
  425. #include <asm/io_trivial.h>
  426. #undef __IO_PREFIX
  427. #ifdef CONFIG_ALPHA_PYXIS
  428. #define __IO_PREFIX cia_bwx
  429. #else
  430. #define __IO_PREFIX cia
  431. #endif
  432. #ifdef __IO_EXTERN_INLINE
  433. #undef __EXTERN_INLINE
  434. #undef __IO_EXTERN_INLINE
  435. #endif
  436. #endif /* __KERNEL__ */
  437. #endif /* __ALPHA_CIA__H__ */