/arch/alpha/include/asm/core_polaris.h

http://github.com/mirrors/linux · C Header · 111 lines · 58 code · 18 blank · 35 comment · 0 complexity · 5a2f42de122fb547be30e2a0f8a47b7d MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ALPHA_POLARIS__H__
  3. #define __ALPHA_POLARIS__H__
  4. #include <linux/types.h>
  5. #include <asm/compiler.h>
  6. /*
  7. * POLARIS is the internal name for a core logic chipset which provides
  8. * memory controller and PCI access for the 21164PC chip based systems.
  9. *
  10. * This file is based on:
  11. *
  12. * Polaris System Controller
  13. * Device Functional Specification
  14. * 22-Jan-98
  15. * Rev. 4.2
  16. *
  17. */
  18. /* Polaris memory regions */
  19. #define POLARIS_SPARSE_MEM_BASE (IDENT_ADDR + 0xf800000000UL)
  20. #define POLARIS_DENSE_MEM_BASE (IDENT_ADDR + 0xf900000000UL)
  21. #define POLARIS_SPARSE_IO_BASE (IDENT_ADDR + 0xf980000000UL)
  22. #define POLARIS_SPARSE_CONFIG_BASE (IDENT_ADDR + 0xf9c0000000UL)
  23. #define POLARIS_IACK_BASE (IDENT_ADDR + 0xf9f8000000UL)
  24. #define POLARIS_DENSE_IO_BASE (IDENT_ADDR + 0xf9fc000000UL)
  25. #define POLARIS_DENSE_CONFIG_BASE (IDENT_ADDR + 0xf9fe000000UL)
  26. #define POLARIS_IACK_SC POLARIS_IACK_BASE
  27. /* The Polaris command/status registers live in PCI Config space for
  28. * bus 0/device 0. As such, they may be bytes, words, or doublewords.
  29. */
  30. #define POLARIS_W_VENID (POLARIS_DENSE_CONFIG_BASE)
  31. #define POLARIS_W_DEVID (POLARIS_DENSE_CONFIG_BASE+2)
  32. #define POLARIS_W_CMD (POLARIS_DENSE_CONFIG_BASE+4)
  33. #define POLARIS_W_STATUS (POLARIS_DENSE_CONFIG_BASE+6)
  34. /*
  35. * Data structure for handling POLARIS machine checks:
  36. */
  37. struct el_POLARIS_sysdata_mcheck {
  38. u_long psc_status;
  39. u_long psc_pcictl0;
  40. u_long psc_pcictl1;
  41. u_long psc_pcictl2;
  42. };
  43. #ifdef __KERNEL__
  44. #ifndef __EXTERN_INLINE
  45. #define __EXTERN_INLINE extern inline
  46. #define __IO_EXTERN_INLINE
  47. #endif
  48. /*
  49. * I/O functions:
  50. *
  51. * POLARIS, the PCI/memory support chipset for the PCA56 (21164PC)
  52. * processors, can use either a sparse address mapping scheme, or the
  53. * so-called byte-word PCI address space, to get at PCI memory and I/O.
  54. *
  55. * However, we will support only the BWX form.
  56. */
  57. /*
  58. * Memory functions. Polaris allows all accesses (byte/word
  59. * as well as long/quad) to be done through dense space.
  60. *
  61. * We will only support DENSE access via BWX insns.
  62. */
  63. __EXTERN_INLINE void __iomem *polaris_ioportmap(unsigned long addr)
  64. {
  65. return (void __iomem *)(addr + POLARIS_DENSE_IO_BASE);
  66. }
  67. __EXTERN_INLINE void __iomem *polaris_ioremap(unsigned long addr,
  68. unsigned long size)
  69. {
  70. return (void __iomem *)(addr + POLARIS_DENSE_MEM_BASE);
  71. }
  72. __EXTERN_INLINE int polaris_is_ioaddr(unsigned long addr)
  73. {
  74. return addr >= POLARIS_SPARSE_MEM_BASE;
  75. }
  76. __EXTERN_INLINE int polaris_is_mmio(const volatile void __iomem *addr)
  77. {
  78. return (unsigned long)addr < POLARIS_SPARSE_IO_BASE;
  79. }
  80. #undef __IO_PREFIX
  81. #define __IO_PREFIX polaris
  82. #define polaris_trivial_rw_bw 1
  83. #define polaris_trivial_rw_lq 1
  84. #define polaris_trivial_io_bw 1
  85. #define polaris_trivial_io_lq 1
  86. #define polaris_trivial_iounmap 1
  87. #include <asm/io_trivial.h>
  88. #ifdef __IO_EXTERN_INLINE
  89. #undef __EXTERN_INLINE
  90. #undef __IO_EXTERN_INLINE
  91. #endif
  92. #endif /* __KERNEL__ */
  93. #endif /* __ALPHA_POLARIS__H__ */