regs-clock.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /*
  2. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  3. * http://www.samsung.com/
  4. *
  5. * S5PV210 - Clock register definitions
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef __ASM_ARCH_REGS_CLOCK_H
  12. #define __ASM_ARCH_REGS_CLOCK_H __FILE__
  13. #include <plat/map-base.h>
  14. #define S5P_CLKREG(x) (S3C_VA_SYS + (x))
  15. #define S5P_APLL_LOCK S5P_CLKREG(0x00)
  16. #define S5P_MPLL_LOCK S5P_CLKREG(0x08)
  17. #define S5P_EPLL_LOCK S5P_CLKREG(0x10)
  18. #define S5P_VPLL_LOCK S5P_CLKREG(0x20)
  19. #define S5P_APLL_CON S5P_CLKREG(0x100)
  20. #define S5P_MPLL_CON S5P_CLKREG(0x108)
  21. #define S5P_EPLL_CON S5P_CLKREG(0x110)
  22. #define S5P_EPLL_CON1 S5P_CLKREG(0x114)
  23. #define S5P_VPLL_CON S5P_CLKREG(0x120)
  24. #define S5P_CLK_SRC0 S5P_CLKREG(0x200)
  25. #define S5P_CLK_SRC1 S5P_CLKREG(0x204)
  26. #define S5P_CLK_SRC2 S5P_CLKREG(0x208)
  27. #define S5P_CLK_SRC3 S5P_CLKREG(0x20C)
  28. #define S5P_CLK_SRC4 S5P_CLKREG(0x210)
  29. #define S5P_CLK_SRC5 S5P_CLKREG(0x214)
  30. #define S5P_CLK_SRC6 S5P_CLKREG(0x218)
  31. #define S5P_CLK_SRC_MASK0 S5P_CLKREG(0x280)
  32. #define S5P_CLK_SRC_MASK1 S5P_CLKREG(0x284)
  33. #define S5P_CLK_DIV0 S5P_CLKREG(0x300)
  34. #define S5P_CLK_DIV1 S5P_CLKREG(0x304)
  35. #define S5P_CLK_DIV2 S5P_CLKREG(0x308)
  36. #define S5P_CLK_DIV3 S5P_CLKREG(0x30C)
  37. #define S5P_CLK_DIV4 S5P_CLKREG(0x310)
  38. #define S5P_CLK_DIV5 S5P_CLKREG(0x314)
  39. #define S5P_CLK_DIV6 S5P_CLKREG(0x318)
  40. #define S5P_CLK_DIV7 S5P_CLKREG(0x31C)
  41. #define S5P_CLKGATE_MAIN0 S5P_CLKREG(0x400)
  42. #define S5P_CLKGATE_MAIN1 S5P_CLKREG(0x404)
  43. #define S5P_CLKGATE_MAIN2 S5P_CLKREG(0x408)
  44. #define S5P_CLKGATE_PERI0 S5P_CLKREG(0x420)
  45. #define S5P_CLKGATE_PERI1 S5P_CLKREG(0x424)
  46. #define S5P_CLKGATE_SCLK0 S5P_CLKREG(0x440)
  47. #define S5P_CLKGATE_SCLK1 S5P_CLKREG(0x444)
  48. #define S5P_CLKGATE_IP0 S5P_CLKREG(0x460)
  49. #define S5P_CLKGATE_IP1 S5P_CLKREG(0x464)
  50. #define S5P_CLKGATE_IP2 S5P_CLKREG(0x468)
  51. #define S5P_CLKGATE_IP3 S5P_CLKREG(0x46C)
  52. #define S5P_CLKGATE_IP4 S5P_CLKREG(0x470)
  53. #define S5P_CLKGATE_BLOCK S5P_CLKREG(0x480)
  54. #define S5P_CLKGATE_BUS0 S5P_CLKREG(0x484)
  55. #define S5P_CLKGATE_BUS1 S5P_CLKREG(0x488)
  56. #define S5P_CLK_OUT S5P_CLKREG(0x500)
  57. /* DIV/MUX STATUS */
  58. #define S5P_CLKDIV_STAT0 S5P_CLKREG(0x1000)
  59. #define S5P_CLKDIV_STAT1 S5P_CLKREG(0x1004)
  60. #define S5P_CLKMUX_STAT0 S5P_CLKREG(0x1100)
  61. #define S5P_CLKMUX_STAT1 S5P_CLKREG(0x1104)
  62. /* CLKSRC0 */
  63. #define S5P_CLKSRC0_MUX200_SHIFT (16)
  64. #define S5P_CLKSRC0_MUX200_MASK (0x1 << S5P_CLKSRC0_MUX200_SHIFT)
  65. #define S5P_CLKSRC0_MUX166_MASK (0x1<<20)
  66. #define S5P_CLKSRC0_MUX133_MASK (0x1<<24)
  67. /* CLKSRC2 */
  68. #define S5P_CLKSRC2_G3D_SHIFT (0)
  69. #define S5P_CLKSRC2_G3D_MASK (0x3 << S5P_CLKSRC2_G3D_SHIFT)
  70. #define S5P_CLKSRC2_MFC_SHIFT (4)
  71. #define S5P_CLKSRC2_MFC_MASK (0x3 << S5P_CLKSRC2_MFC_SHIFT)
  72. /* CLKSRC6*/
  73. #define S5P_CLKSRC6_ONEDRAM_SHIFT (24)
  74. #define S5P_CLKSRC6_ONEDRAM_MASK (0x3 << S5P_CLKSRC6_ONEDRAM_SHIFT)
  75. /* CLKDIV0 */
  76. #define S5P_CLKDIV0_APLL_SHIFT (0)
  77. #define S5P_CLKDIV0_APLL_MASK (0x7 << S5P_CLKDIV0_APLL_SHIFT)
  78. #define S5P_CLKDIV0_A2M_SHIFT (4)
  79. #define S5P_CLKDIV0_A2M_MASK (0x7 << S5P_CLKDIV0_A2M_SHIFT)
  80. #define S5P_CLKDIV0_HCLK200_SHIFT (8)
  81. #define S5P_CLKDIV0_HCLK200_MASK (0x7 << S5P_CLKDIV0_HCLK200_SHIFT)
  82. #define S5P_CLKDIV0_PCLK100_SHIFT (12)
  83. #define S5P_CLKDIV0_PCLK100_MASK (0x7 << S5P_CLKDIV0_PCLK100_SHIFT)
  84. #define S5P_CLKDIV0_HCLK166_SHIFT (16)
  85. #define S5P_CLKDIV0_HCLK166_MASK (0xF << S5P_CLKDIV0_HCLK166_SHIFT)
  86. #define S5P_CLKDIV0_PCLK83_SHIFT (20)
  87. #define S5P_CLKDIV0_PCLK83_MASK (0x7 << S5P_CLKDIV0_PCLK83_SHIFT)
  88. #define S5P_CLKDIV0_HCLK133_SHIFT (24)
  89. #define S5P_CLKDIV0_HCLK133_MASK (0xF << S5P_CLKDIV0_HCLK133_SHIFT)
  90. #define S5P_CLKDIV0_PCLK66_SHIFT (28)
  91. #define S5P_CLKDIV0_PCLK66_MASK (0x7 << S5P_CLKDIV0_PCLK66_SHIFT)
  92. /* CLKDIV2 */
  93. #define S5P_CLKDIV2_G3D_SHIFT (0)
  94. #define S5P_CLKDIV2_G3D_MASK (0xF << S5P_CLKDIV2_G3D_SHIFT)
  95. #define S5P_CLKDIV2_MFC_SHIFT (4)
  96. #define S5P_CLKDIV2_MFC_MASK (0xF << S5P_CLKDIV2_MFC_SHIFT)
  97. /* CLKDIV6 */
  98. #define S5P_CLKDIV6_ONEDRAM_SHIFT (28)
  99. #define S5P_CLKDIV6_ONEDRAM_MASK (0xF << S5P_CLKDIV6_ONEDRAM_SHIFT)
  100. #define S5P_SWRESET S5P_CLKREG(0x2000)
  101. #define S5P_ARM_MCS_CON S5P_CLKREG(0x6100)
  102. /* Registers related to power management */
  103. #define S5P_PWR_CFG S5P_CLKREG(0xC000)
  104. #define S5P_EINT_WAKEUP_MASK S5P_CLKREG(0xC004)
  105. #define S5P_WAKEUP_MASK S5P_CLKREG(0xC008)
  106. #define S5P_PWR_MODE S5P_CLKREG(0xC00C)
  107. #define S5P_NORMAL_CFG S5P_CLKREG(0xC010)
  108. #define S5P_IDLE_CFG S5P_CLKREG(0xC020)
  109. #define S5P_STOP_CFG S5P_CLKREG(0xC030)
  110. #define S5P_STOP_MEM_CFG S5P_CLKREG(0xC034)
  111. #define S5P_SLEEP_CFG S5P_CLKREG(0xC040)
  112. #define S5P_OSC_FREQ S5P_CLKREG(0xC100)
  113. #define S5P_OSC_STABLE S5P_CLKREG(0xC104)
  114. #define S5P_PWR_STABLE S5P_CLKREG(0xC108)
  115. #define S5P_MTC_STABLE S5P_CLKREG(0xC110)
  116. #define S5P_CLAMP_STABLE S5P_CLKREG(0xC114)
  117. #define S5P_WAKEUP_STAT S5P_CLKREG(0xC200)
  118. #define S5P_BLK_PWR_STAT S5P_CLKREG(0xC204)
  119. #define S5P_OTHERS S5P_CLKREG(0xE000)
  120. #define S5P_OM_STAT S5P_CLKREG(0xE100)
  121. #define S5P_HDMI_PHY_CONTROL S5P_CLKREG(0xE804)
  122. #define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C)
  123. #define S5P_DAC_PHY_CONTROL S5P_CLKREG(0xE810)
  124. #define S5P_INFORM0 S5P_CLKREG(0xF000)
  125. #define S5P_INFORM1 S5P_CLKREG(0xF004)
  126. #define S5P_INFORM2 S5P_CLKREG(0xF008)
  127. #define S5P_INFORM3 S5P_CLKREG(0xF00C)
  128. #define S5P_INFORM4 S5P_CLKREG(0xF010)
  129. #define S5P_INFORM5 S5P_CLKREG(0xF014)
  130. #define S5P_INFORM6 S5P_CLKREG(0xF018)
  131. #define S5P_INFORM7 S5P_CLKREG(0xF01C)
  132. #define S5P_RST_STAT S5P_CLKREG(0xA000)
  133. #define S5P_OSC_CON S5P_CLKREG(0x8000)
  134. #define S5P_MDNIE_SEL S5P_CLKREG(0x7008)
  135. #define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200)
  136. #define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204)
  137. #define S5P_IDLE_CFG_TL_MASK (3 << 30)
  138. #define S5P_IDLE_CFG_TM_MASK (3 << 28)
  139. #define S5P_IDLE_CFG_TL_ON (2 << 30)
  140. #define S5P_IDLE_CFG_TM_ON (2 << 28)
  141. #define S5P_IDLE_CFG_DIDLE (1 << 0)
  142. #define S5P_CFG_WFI_CLEAN (~(3 << 8))
  143. #define S5P_CFG_WFI_IDLE (1 << 8)
  144. #define S5P_CFG_WFI_STOP (2 << 8)
  145. #define S5P_CFG_WFI_SLEEP (3 << 8)
  146. #define S5P_OTHER_SYS_INT 24
  147. #define S5P_OTHER_STA_TYPE 23
  148. #define S5P_OTHER_SYSC_INTOFF (1 << 0)
  149. #define STA_TYPE_EXPON 0
  150. #define STA_TYPE_SFR 1
  151. #define S5P_PWR_STA_EXP_SCALE 0
  152. #define S5P_PWR_STA_CNT 4
  153. #define S5P_PWR_STABLE_COUNT 85500
  154. #define S5P_SLEEP_CFG_OSC_EN (1 << 0)
  155. #define S5P_SLEEP_CFG_USBOSC_EN (1 << 1)
  156. /* OTHERS Resgister */
  157. #define S5P_OTHERS_RET_IO (1 << 31)
  158. #define S5P_OTHERS_RET_CF (1 << 30)
  159. #define S5P_OTHERS_RET_MMC (1 << 29)
  160. #define S5P_OTHERS_RET_UART (1 << 28)
  161. #define S5P_OTHERS_USB_SIG_MASK (1 << 16)
  162. /* S5P_DAC_CONTROL */
  163. #define S5P_DAC_ENABLE (1)
  164. #define S5P_DAC_DISABLE (0)
  165. #endif /* __ASM_ARCH_REGS_CLOCK_H */