piix4.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef _ASM_X86_VISWS_PIIX4_H
  2. #define _ASM_X86_VISWS_PIIX4_H
  3. /*
  4. * PIIX4 as used on SGI Visual Workstations
  5. */
  6. #define PIIX_PM_START 0x0F80
  7. #define SIO_GPIO_START 0x0FC0
  8. #define SIO_PM_START 0x0FC8
  9. #define PMBASE PIIX_PM_START
  10. #define GPIREG0 (PMBASE+0x30)
  11. #define GPIREG(x) (GPIREG0+((x)/8))
  12. #define GPIBIT(x) (1 << ((x)%8))
  13. #define PIIX_GPI_BD_ID1 18
  14. #define PIIX_GPI_BD_ID2 19
  15. #define PIIX_GPI_BD_ID3 20
  16. #define PIIX_GPI_BD_ID4 21
  17. #define PIIX_GPI_BD_REG GPIREG(PIIX_GPI_BD_ID1)
  18. #define PIIX_GPI_BD_MASK (GPIBIT(PIIX_GPI_BD_ID1) | \
  19. GPIBIT(PIIX_GPI_BD_ID2) | \
  20. GPIBIT(PIIX_GPI_BD_ID3) | \
  21. GPIBIT(PIIX_GPI_BD_ID4) )
  22. #define PIIX_GPI_BD_SHIFT (PIIX_GPI_BD_ID1 % 8)
  23. #define SIO_INDEX 0x2e
  24. #define SIO_DATA 0x2f
  25. #define SIO_DEV_SEL 0x7
  26. #define SIO_DEV_ENB 0x30
  27. #define SIO_DEV_MSB 0x60
  28. #define SIO_DEV_LSB 0x61
  29. #define SIO_GP_DEV 0x7
  30. #define SIO_GP_BASE SIO_GPIO_START
  31. #define SIO_GP_MSB (SIO_GP_BASE>>8)
  32. #define SIO_GP_LSB (SIO_GP_BASE&0xff)
  33. #define SIO_GP_DATA1 (SIO_GP_BASE+0)
  34. #define SIO_PM_DEV 0x8
  35. #define SIO_PM_BASE SIO_PM_START
  36. #define SIO_PM_MSB (SIO_PM_BASE>>8)
  37. #define SIO_PM_LSB (SIO_PM_BASE&0xff)
  38. #define SIO_PM_INDEX (SIO_PM_BASE+0)
  39. #define SIO_PM_DATA (SIO_PM_BASE+1)
  40. #define SIO_PM_FER2 0x1
  41. #define SIO_PM_GP_EN 0x80
  42. /*
  43. * This is the dev/reg where generating a config cycle will
  44. * result in a PCI special cycle.
  45. */
  46. #define SPECIAL_DEV 0xff
  47. #define SPECIAL_REG 0x00
  48. /*
  49. * PIIX4 needs to see a special cycle with the following data
  50. * to be convinced the processor has gone into the stop grant
  51. * state. PIIX4 insists on seeing this before it will power
  52. * down a system.
  53. */
  54. #define PIIX_SPECIAL_STOP 0x00120002
  55. #define PIIX4_RESET_PORT 0xcf9
  56. #define PIIX4_RESET_VAL 0x6
  57. #define PMSTS_PORT 0xf80 // 2 bytes PM Status
  58. #define PMEN_PORT 0xf82 // 2 bytes PM Enable
  59. #define PMCNTRL_PORT 0xf84 // 2 bytes PM Control
  60. #define PM_SUSPEND_ENABLE 0x2000 // start sequence to suspend state
  61. /*
  62. * PMSTS and PMEN I/O bit definitions.
  63. * (Bits are the same in both registers)
  64. */
  65. #define PM_STS_RSM (1<<15) // Resume Status
  66. #define PM_STS_PWRBTNOR (1<<11) // Power Button Override
  67. #define PM_STS_RTC (1<<10) // RTC status
  68. #define PM_STS_PWRBTN (1<<8) // Power Button Pressed?
  69. #define PM_STS_GBL (1<<5) // Global Status
  70. #define PM_STS_BM (1<<4) // Bus Master Status
  71. #define PM_STS_TMROF (1<<0) // Timer Overflow Status.
  72. /*
  73. * Stop clock GPI register
  74. */
  75. #define PIIX_GPIREG0 (0xf80 + 0x30)
  76. /*
  77. * Stop clock GPI bit in GPIREG0
  78. */
  79. #define PIIX_GPI_STPCLK 0x4 // STPCLK signal routed back in
  80. #endif /* _ASM_X86_VISWS_PIIX4_H */