pmc_atom.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Intel Atom SOC Power Management Controller Header File
  3. * Copyright (c) 2014, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. */
  15. #ifndef PMC_ATOM_H
  16. #define PMC_ATOM_H
  17. /* ValleyView Power Control Unit PCI Device ID */
  18. #define PCI_DEVICE_ID_VLV_PMC 0x0F1C
  19. /* PMC Memory mapped IO registers */
  20. #define PMC_BASE_ADDR_OFFSET 0x44
  21. #define PMC_BASE_ADDR_MASK 0xFFFFFE00
  22. #define PMC_MMIO_REG_LEN 0x100
  23. #define PMC_REG_BIT_WIDTH 32
  24. /* BIOS uses FUNC_DIS to disable specific function */
  25. #define PMC_FUNC_DIS 0x34
  26. #define PMC_FUNC_DIS_2 0x38
  27. /* S0ix wake event control */
  28. #define PMC_S0IX_WAKE_EN 0x3C
  29. #define BIT_LPC_CLOCK_RUN BIT(4)
  30. #define BIT_SHARED_IRQ_GPSC BIT(5)
  31. #define BIT_ORED_DEDICATED_IRQ_GPSS BIT(18)
  32. #define BIT_ORED_DEDICATED_IRQ_GPSC BIT(19)
  33. #define BIT_SHARED_IRQ_GPSS BIT(20)
  34. #define PMC_WAKE_EN_SETTING ~(BIT_LPC_CLOCK_RUN | \
  35. BIT_SHARED_IRQ_GPSC | \
  36. BIT_ORED_DEDICATED_IRQ_GPSS | \
  37. BIT_ORED_DEDICATED_IRQ_GPSC | \
  38. BIT_SHARED_IRQ_GPSS)
  39. /* The timers acumulate time spent in sleep state */
  40. #define PMC_S0IR_TMR 0x80
  41. #define PMC_S0I1_TMR 0x84
  42. #define PMC_S0I2_TMR 0x88
  43. #define PMC_S0I3_TMR 0x8C
  44. #define PMC_S0_TMR 0x90
  45. /* Sleep state counter is in units of of 32us */
  46. #define PMC_TMR_SHIFT 5
  47. /* These registers reflect D3 status of functions */
  48. #define PMC_D3_STS_0 0xA0
  49. #define BIT_LPSS1_F0_DMA BIT(0)
  50. #define BIT_LPSS1_F1_PWM1 BIT(1)
  51. #define BIT_LPSS1_F2_PWM2 BIT(2)
  52. #define BIT_LPSS1_F3_HSUART1 BIT(3)
  53. #define BIT_LPSS1_F4_HSUART2 BIT(4)
  54. #define BIT_LPSS1_F5_SPI BIT(5)
  55. #define BIT_LPSS1_F6_XXX BIT(6)
  56. #define BIT_LPSS1_F7_XXX BIT(7)
  57. #define BIT_SCC_EMMC BIT(8)
  58. #define BIT_SCC_SDIO BIT(9)
  59. #define BIT_SCC_SDCARD BIT(10)
  60. #define BIT_SCC_MIPI BIT(11)
  61. #define BIT_HDA BIT(12)
  62. #define BIT_LPE BIT(13)
  63. #define BIT_OTG BIT(14)
  64. #define BIT_USH BIT(15)
  65. #define BIT_GBE BIT(16)
  66. #define BIT_SATA BIT(17)
  67. #define BIT_USB_EHCI BIT(18)
  68. #define BIT_SEC BIT(19)
  69. #define BIT_PCIE_PORT0 BIT(20)
  70. #define BIT_PCIE_PORT1 BIT(21)
  71. #define BIT_PCIE_PORT2 BIT(22)
  72. #define BIT_PCIE_PORT3 BIT(23)
  73. #define BIT_LPSS2_F0_DMA BIT(24)
  74. #define BIT_LPSS2_F1_I2C1 BIT(25)
  75. #define BIT_LPSS2_F2_I2C2 BIT(26)
  76. #define BIT_LPSS2_F3_I2C3 BIT(27)
  77. #define BIT_LPSS2_F4_I2C4 BIT(28)
  78. #define BIT_LPSS2_F5_I2C5 BIT(29)
  79. #define BIT_LPSS2_F6_I2C6 BIT(30)
  80. #define BIT_LPSS2_F7_I2C7 BIT(31)
  81. #define PMC_D3_STS_1 0xA4
  82. #define BIT_SMB BIT(0)
  83. #define BIT_OTG_SS_PHY BIT(1)
  84. #define BIT_USH_SS_PHY BIT(2)
  85. #define BIT_DFX BIT(3)
  86. /* PMC I/O Registers */
  87. #define ACPI_BASE_ADDR_OFFSET 0x40
  88. #define ACPI_BASE_ADDR_MASK 0xFFFFFE00
  89. #define ACPI_MMIO_REG_LEN 0x100
  90. #define PM1_CNT 0x4
  91. #define SLEEP_TYPE_MASK 0xFFFFECFF
  92. #define SLEEP_TYPE_S5 0x1C00
  93. #define SLEEP_ENABLE 0x2000
  94. #endif /* PMC_ATOM_H */