k1-syscon.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* SpacemiT clock and reset driver definitions for the K1 SoC */
  3. #ifndef __SOC_K1_SYSCON_H__
  4. #define __SOC_K1_SYSCON_H__
  5. #include "ccu.h"
  6. /* APBS register offset */
  7. #define APBS_PLL1_SWCR1 0x100
  8. #define APBS_PLL1_SWCR2 0x104
  9. #define APBS_PLL1_SWCR3 0x108
  10. #define APBS_PLL2_SWCR1 0x118
  11. #define APBS_PLL2_SWCR2 0x11c
  12. #define APBS_PLL2_SWCR3 0x120
  13. #define APBS_PLL3_SWCR1 0x124
  14. #define APBS_PLL3_SWCR2 0x128
  15. #define APBS_PLL3_SWCR3 0x12c
  16. /* MPMU register offset */
  17. #define MPMU_POSR 0x0010
  18. #define MPMU_FCCR 0x0008
  19. #define POSR_PLL1_LOCK BIT(27)
  20. #define POSR_PLL2_LOCK BIT(28)
  21. #define POSR_PLL3_LOCK BIT(29)
  22. #define MPMU_SUCCR 0x0014
  23. #define MPMU_ISCCR 0x0044
  24. #define MPMU_WDTPCR 0x0200
  25. #define MPMU_RIPCCR 0x0210
  26. #define MPMU_ACGR 0x1024
  27. #define MPMU_APBCSCR 0x1050
  28. #define MPMU_SUCCR_1 0x10b0
  29. /* APBC register offset */
  30. #define APBC_UART1_CLK_RST 0x00
  31. #define APBC_UART2_CLK_RST 0x04
  32. #define APBC_GPIO_CLK_RST 0x08
  33. #define APBC_PWM0_CLK_RST 0x0c
  34. #define APBC_PWM1_CLK_RST 0x10
  35. #define APBC_PWM2_CLK_RST 0x14
  36. #define APBC_PWM3_CLK_RST 0x18
  37. #define APBC_TWSI8_CLK_RST 0x20
  38. #define APBC_UART3_CLK_RST 0x24
  39. #define APBC_RTC_CLK_RST 0x28
  40. #define APBC_TWSI0_CLK_RST 0x2c
  41. #define APBC_TWSI1_CLK_RST 0x30
  42. #define APBC_TIMERS1_CLK_RST 0x34
  43. #define APBC_TWSI2_CLK_RST 0x38
  44. #define APBC_AIB_CLK_RST 0x3c
  45. #define APBC_TWSI4_CLK_RST 0x40
  46. #define APBC_TIMERS2_CLK_RST 0x44
  47. #define APBC_ONEWIRE_CLK_RST 0x48
  48. #define APBC_TWSI5_CLK_RST 0x4c
  49. #define APBC_DRO_CLK_RST 0x58
  50. #define APBC_IR_CLK_RST 0x5c
  51. #define APBC_TWSI6_CLK_RST 0x60
  52. #define APBC_COUNTER_CLK_SEL 0x64
  53. #define APBC_TWSI7_CLK_RST 0x68
  54. #define APBC_TSEN_CLK_RST 0x6c
  55. #define APBC_UART4_CLK_RST 0x70
  56. #define APBC_UART5_CLK_RST 0x74
  57. #define APBC_UART6_CLK_RST 0x78
  58. #define APBC_SSP3_CLK_RST 0x7c
  59. #define APBC_SSPA0_CLK_RST 0x80
  60. #define APBC_SSPA1_CLK_RST 0x84
  61. #define APBC_IPC_AP2AUD_CLK_RST 0x90
  62. #define APBC_UART7_CLK_RST 0x94
  63. #define APBC_UART8_CLK_RST 0x98
  64. #define APBC_UART9_CLK_RST 0x9c
  65. #define APBC_CAN0_CLK_RST 0xa0
  66. #define APBC_PWM4_CLK_RST 0xa8
  67. #define APBC_PWM5_CLK_RST 0xac
  68. #define APBC_PWM6_CLK_RST 0xb0
  69. #define APBC_PWM7_CLK_RST 0xb4
  70. #define APBC_PWM8_CLK_RST 0xb8
  71. #define APBC_PWM9_CLK_RST 0xbc
  72. #define APBC_PWM10_CLK_RST 0xc0
  73. #define APBC_PWM11_CLK_RST 0xc4
  74. #define APBC_PWM12_CLK_RST 0xc8
  75. #define APBC_PWM13_CLK_RST 0xcc
  76. #define APBC_PWM14_CLK_RST 0xd0
  77. #define APBC_PWM15_CLK_RST 0xd4
  78. #define APBC_PWM16_CLK_RST 0xd8
  79. #define APBC_PWM17_CLK_RST 0xdc
  80. #define APBC_PWM18_CLK_RST 0xe0
  81. #define APBC_PWM19_CLK_RST 0xe4
  82. /* APMU register offset */
  83. #define APMU_JPG_CLK_RES_CTRL 0x020
  84. #define APMU_CSI_CCIC2_CLK_RES_CTRL 0x024
  85. #define APMU_ISP_CLK_RES_CTRL 0x038
  86. #define APMU_LCD_CLK_RES_CTRL1 0x044
  87. #define APMU_LCD_SPI_CLK_RES_CTRL 0x048
  88. #define APMU_LCD_CLK_RES_CTRL2 0x04c
  89. #define APMU_CCIC_CLK_RES_CTRL 0x050
  90. #define APMU_SDH0_CLK_RES_CTRL 0x054
  91. #define APMU_SDH1_CLK_RES_CTRL 0x058
  92. #define APMU_USB_CLK_RES_CTRL 0x05c
  93. #define APMU_QSPI_CLK_RES_CTRL 0x060
  94. #define APMU_DMA_CLK_RES_CTRL 0x064
  95. #define APMU_AES_CLK_RES_CTRL 0x068
  96. #define APMU_VPU_CLK_RES_CTRL 0x0a4
  97. #define APMU_GPU_CLK_RES_CTRL 0x0cc
  98. #define APMU_SDH2_CLK_RES_CTRL 0x0e0
  99. #define APMU_PMUA_MC_CTRL 0x0e8
  100. #define APMU_PMU_CC2_AP 0x100
  101. #define APMU_PMUA_EM_CLK_RES_CTRL 0x104
  102. #define APMU_AUDIO_CLK_RES_CTRL 0x14c
  103. #define APMU_HDMI_CLK_RES_CTRL 0x1b8
  104. #define APMU_CCI550_CLK_CTRL 0x300
  105. #define APMU_ACLK_CLK_CTRL 0x388
  106. #define APMU_CPU_C0_CLK_CTRL 0x38C
  107. #define APMU_CPU_C1_CLK_CTRL 0x390
  108. #define APMU_PCIE_CLK_RES_CTRL_0 0x3cc
  109. #define APMU_PCIE_CLK_RES_CTRL_1 0x3d4
  110. #define APMU_PCIE_CLK_RES_CTRL_2 0x3dc
  111. #define APMU_EMAC0_CLK_RES_CTRL 0x3e4
  112. #define APMU_EMAC1_CLK_RES_CTRL 0x3ec
  113. /* RCPU register offsets */
  114. #define RCPU_SSP0_CLK_RST 0x0028
  115. #define RCPU_I2C0_CLK_RST 0x0030
  116. #define RCPU_UART1_CLK_RST 0x003c
  117. #define RCPU_CAN_CLK_RST 0x0048
  118. #define RCPU_IR_CLK_RST 0x004c
  119. #define RCPU_UART0_CLK_RST 0x00d8
  120. #define AUDIO_HDMI_CLK_CTRL 0x2044
  121. /* RCPU2 register offsets */
  122. #define RCPU2_PWM0_CLK_RST 0x0000
  123. #define RCPU2_PWM1_CLK_RST 0x0004
  124. #define RCPU2_PWM2_CLK_RST 0x0008
  125. #define RCPU2_PWM3_CLK_RST 0x000c
  126. #define RCPU2_PWM4_CLK_RST 0x0010
  127. #define RCPU2_PWM5_CLK_RST 0x0014
  128. #define RCPU2_PWM6_CLK_RST 0x0018
  129. #define RCPU2_PWM7_CLK_RST 0x001c
  130. #define RCPU2_PWM8_CLK_RST 0x0020
  131. #define RCPU2_PWM9_CLK_RST 0x0024
  132. /* APBC2 register offsets */
  133. #define APBC2_UART1_CLK_RST 0x0000
  134. #define APBC2_SSP2_CLK_RST 0x0004
  135. #define APBC2_TWSI3_CLK_RST 0x0008
  136. #define APBC2_RTC_CLK_RST 0x000c
  137. #define APBC2_TIMERS0_CLK_RST 0x0010
  138. #define APBC2_KPC_CLK_RST 0x0014
  139. #define APBC2_GPIO_CLK_RST 0x001c
  140. #endif /* __SOC_K1_SYSCON_H__ */