core_polaris.h 2.9 KB

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