control.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. /*
  2. * arch/arm/mach-omap2/control.h
  3. *
  4. * OMAP2/3/4 System Control Module definitions
  5. *
  6. * Copyright (C) 2007-2010 Texas Instruments, Inc.
  7. * Copyright (C) 2007-2008, 2010 Nokia Corporation
  8. *
  9. * Written by Paul Walmsley
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation.
  14. */
  15. #ifndef __ARCH_ARM_MACH_OMAP2_CONTROL_H
  16. #define __ARCH_ARM_MACH_OMAP2_CONTROL_H
  17. #include "am33xx.h"
  18. #ifndef __ASSEMBLY__
  19. #define OMAP242X_CTRL_REGADDR(reg) \
  20. OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
  21. #define OMAP243X_CTRL_REGADDR(reg) \
  22. OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
  23. #define OMAP343X_CTRL_REGADDR(reg) \
  24. OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
  25. #define AM33XX_CTRL_REGADDR(reg) \
  26. AM33XX_L4_WK_IO_ADDRESS(AM33XX_SCM_BASE + (reg))
  27. #else
  28. #define OMAP242X_CTRL_REGADDR(reg) \
  29. OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
  30. #define OMAP243X_CTRL_REGADDR(reg) \
  31. OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
  32. #define OMAP343X_CTRL_REGADDR(reg) \
  33. OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
  34. #define AM33XX_CTRL_REGADDR(reg) \
  35. AM33XX_L4_WK_IO_ADDRESS(AM33XX_SCM_BASE + (reg))
  36. #endif /* __ASSEMBLY__ */
  37. /*
  38. * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for
  39. * OMAP24XX and OMAP34XX.
  40. */
  41. /* Control submodule offsets */
  42. #define OMAP2_CONTROL_INTERFACE 0x000
  43. #define OMAP2_CONTROL_PADCONFS 0x030
  44. #define OMAP2_CONTROL_GENERAL 0x270
  45. #define OMAP343X_CONTROL_MEM_WKUP 0x600
  46. #define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
  47. #define OMAP343X_CONTROL_GENERAL_WKUP 0xa60
  48. /* TI81XX spefic control submodules */
  49. #define TI81XX_CONTROL_DEVBOOT 0x040
  50. #define TI81XX_CONTROL_DEVCONF 0x600
  51. /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
  52. #define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10)
  53. /* CONTROL_GENERAL register offsets common to OMAP2 & 3 */
  54. #define OMAP2_CONTROL_DEVCONF0 (OMAP2_CONTROL_GENERAL + 0x0004)
  55. #define OMAP2_CONTROL_MSUSPENDMUX_0 (OMAP2_CONTROL_GENERAL + 0x0020)
  56. #define OMAP2_CONTROL_MSUSPENDMUX_1 (OMAP2_CONTROL_GENERAL + 0x0024)
  57. #define OMAP2_CONTROL_MSUSPENDMUX_2 (OMAP2_CONTROL_GENERAL + 0x0028)
  58. #define OMAP2_CONTROL_MSUSPENDMUX_3 (OMAP2_CONTROL_GENERAL + 0x002c)
  59. #define OMAP2_CONTROL_MSUSPENDMUX_4 (OMAP2_CONTROL_GENERAL + 0x0030)
  60. #define OMAP2_CONTROL_MSUSPENDMUX_5 (OMAP2_CONTROL_GENERAL + 0x0034)
  61. #define OMAP2_CONTROL_SEC_CTRL (OMAP2_CONTROL_GENERAL + 0x0040)
  62. #define OMAP2_CONTROL_RPUB_KEY_H_0 (OMAP2_CONTROL_GENERAL + 0x0090)
  63. #define OMAP2_CONTROL_RPUB_KEY_H_1 (OMAP2_CONTROL_GENERAL + 0x0094)
  64. #define OMAP2_CONTROL_RPUB_KEY_H_2 (OMAP2_CONTROL_GENERAL + 0x0098)
  65. #define OMAP2_CONTROL_RPUB_KEY_H_3 (OMAP2_CONTROL_GENERAL + 0x009c)
  66. /* 242x-only CONTROL_GENERAL register offsets */
  67. #define OMAP242X_CONTROL_DEVCONF OMAP2_CONTROL_DEVCONF0 /* match TRM */
  68. #define OMAP242X_CONTROL_OCM_RAM_PERM (OMAP2_CONTROL_GENERAL + 0x0068)
  69. /* 243x-only CONTROL_GENERAL register offsets */
  70. /* CONTROL_IVA2_BOOT{ADDR,MOD} are at the same place on 343x - noted below */
  71. #define OMAP243X_CONTROL_DEVCONF1 (OMAP2_CONTROL_GENERAL + 0x0078)
  72. #define OMAP243X_CONTROL_CSIRXFE (OMAP2_CONTROL_GENERAL + 0x007c)
  73. #define OMAP243X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
  74. #define OMAP243X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
  75. #define OMAP243X_CONTROL_IVA2_GEMCFG (OMAP2_CONTROL_GENERAL + 0x0198)
  76. #define OMAP243X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x0230)
  77. /* 24xx-only CONTROL_GENERAL register offsets */
  78. #define OMAP24XX_CONTROL_DEBOBS (OMAP2_CONTROL_GENERAL + 0x0000)
  79. #define OMAP24XX_CONTROL_EMU_SUPPORT (OMAP2_CONTROL_GENERAL + 0x0008)
  80. #define OMAP24XX_CONTROL_SEC_TEST (OMAP2_CONTROL_GENERAL + 0x0044)
  81. #define OMAP24XX_CONTROL_PSA_CTRL (OMAP2_CONTROL_GENERAL + 0x0048)
  82. #define OMAP24XX_CONTROL_PSA_CMD (OMAP2_CONTROL_GENERAL + 0x004c)
  83. #define OMAP24XX_CONTROL_PSA_VALUE (OMAP2_CONTROL_GENERAL + 0x0050)
  84. #define OMAP24XX_CONTROL_SEC_EMU (OMAP2_CONTROL_GENERAL + 0x0060)
  85. #define OMAP24XX_CONTROL_SEC_TAP (OMAP2_CONTROL_GENERAL + 0x0064)
  86. #define OMAP24XX_CONTROL_OCM_PUB_RAM_ADD (OMAP2_CONTROL_GENERAL + 0x006c)
  87. #define OMAP24XX_CONTROL_EXT_SEC_RAM_START_ADD (OMAP2_CONTROL_GENERAL + 0x0070)
  88. #define OMAP24XX_CONTROL_EXT_SEC_RAM_STOP_ADD (OMAP2_CONTROL_GENERAL + 0x0074)
  89. #define OMAP24XX_CONTROL_SEC_STATUS (OMAP2_CONTROL_GENERAL + 0x0080)
  90. #define OMAP24XX_CONTROL_SEC_ERR_STATUS (OMAP2_CONTROL_GENERAL + 0x0084)
  91. #define OMAP24XX_CONTROL_STATUS (OMAP2_CONTROL_GENERAL + 0x0088)
  92. #define OMAP24XX_CONTROL_GENERAL_PURPOSE_STATUS (OMAP2_CONTROL_GENERAL + 0x008c)
  93. #define OMAP24XX_CONTROL_RAND_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00a0)
  94. #define OMAP24XX_CONTROL_RAND_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00a4)
  95. #define OMAP24XX_CONTROL_RAND_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00a8)
  96. #define OMAP24XX_CONTROL_RAND_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00ac)
  97. #define OMAP24XX_CONTROL_CUST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00b0)
  98. #define OMAP24XX_CONTROL_CUST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00b4)
  99. #define OMAP24XX_CONTROL_TEST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00c0)
  100. #define OMAP24XX_CONTROL_TEST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00c4)
  101. #define OMAP24XX_CONTROL_TEST_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00c8)
  102. #define OMAP24XX_CONTROL_TEST_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00cc)
  103. #define OMAP24XX_CONTROL_TEST_KEY_4 (OMAP2_CONTROL_GENERAL + 0x00d0)
  104. #define OMAP24XX_CONTROL_TEST_KEY_5 (OMAP2_CONTROL_GENERAL + 0x00d4)
  105. #define OMAP24XX_CONTROL_TEST_KEY_6 (OMAP2_CONTROL_GENERAL + 0x00d8)
  106. #define OMAP24XX_CONTROL_TEST_KEY_7 (OMAP2_CONTROL_GENERAL + 0x00dc)
  107. #define OMAP24XX_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e0)
  108. #define OMAP24XX_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00e4)
  109. #define OMAP343X_CONTROL_PADCONF_SYSNIRQ (OMAP2_CONTROL_INTERFACE + 0x01b0)
  110. /* 34xx-only CONTROL_GENERAL register offsets */
  111. #define OMAP343X_CONTROL_PADCONF_OFF (OMAP2_CONTROL_GENERAL + 0x0000)
  112. #define OMAP343X_CONTROL_MEM_DFTRW0 (OMAP2_CONTROL_GENERAL + 0x0008)
  113. #define OMAP343X_CONTROL_MEM_DFTRW1 (OMAP2_CONTROL_GENERAL + 0x000c)
  114. #define OMAP343X_CONTROL_DEVCONF1 (OMAP2_CONTROL_GENERAL + 0x0068)
  115. #define OMAP343X_CONTROL_CSIRXFE (OMAP2_CONTROL_GENERAL + 0x006c)
  116. #define OMAP343X_CONTROL_SEC_STATUS (OMAP2_CONTROL_GENERAL + 0x0070)
  117. #define OMAP343X_CONTROL_SEC_ERR_STATUS (OMAP2_CONTROL_GENERAL + 0x0074)
  118. #define OMAP343X_CONTROL_SEC_ERR_STATUS_DEBUG (OMAP2_CONTROL_GENERAL + 0x0078)
  119. #define OMAP343X_CONTROL_STATUS (OMAP2_CONTROL_GENERAL + 0x0080)
  120. #define OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS (OMAP2_CONTROL_GENERAL + 0x0084)
  121. #define OMAP343X_CONTROL_RPUB_KEY_H_4 (OMAP2_CONTROL_GENERAL + 0x00a0)
  122. #define OMAP343X_CONTROL_RAND_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00a8)
  123. #define OMAP343X_CONTROL_RAND_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00ac)
  124. #define OMAP343X_CONTROL_RAND_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00b0)
  125. #define OMAP343X_CONTROL_RAND_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00b4)
  126. #define OMAP343X_CONTROL_TEST_KEY_0 (OMAP2_CONTROL_GENERAL + 0x00c8)
  127. #define OMAP343X_CONTROL_TEST_KEY_1 (OMAP2_CONTROL_GENERAL + 0x00cc)
  128. #define OMAP343X_CONTROL_TEST_KEY_2 (OMAP2_CONTROL_GENERAL + 0x00d0)
  129. #define OMAP343X_CONTROL_TEST_KEY_3 (OMAP2_CONTROL_GENERAL + 0x00d4)
  130. #define OMAP343X_CONTROL_TEST_KEY_4 (OMAP2_CONTROL_GENERAL + 0x00d8)
  131. #define OMAP343X_CONTROL_TEST_KEY_5 (OMAP2_CONTROL_GENERAL + 0x00dc)
  132. #define OMAP343X_CONTROL_TEST_KEY_6 (OMAP2_CONTROL_GENERAL + 0x00e0)
  133. #define OMAP343X_CONTROL_TEST_KEY_7 (OMAP2_CONTROL_GENERAL + 0x00e4)
  134. #define OMAP343X_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e8)
  135. #define OMAP343X_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00ec)
  136. #define OMAP343X_CONTROL_TEST_KEY_10 (OMAP2_CONTROL_GENERAL + 0x00f0)
  137. #define OMAP343X_CONTROL_TEST_KEY_11 (OMAP2_CONTROL_GENERAL + 0x00f4)
  138. #define OMAP343X_CONTROL_TEST_KEY_12 (OMAP2_CONTROL_GENERAL + 0x00f8)
  139. #define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc)
  140. #define OMAP343X_CONTROL_FUSE_OPP1_VDD1 (OMAP2_CONTROL_GENERAL + 0x0110)
  141. #define OMAP343X_CONTROL_FUSE_OPP2_VDD1 (OMAP2_CONTROL_GENERAL + 0x0114)
  142. #define OMAP343X_CONTROL_FUSE_OPP3_VDD1 (OMAP2_CONTROL_GENERAL + 0x0118)
  143. #define OMAP343X_CONTROL_FUSE_OPP4_VDD1 (OMAP2_CONTROL_GENERAL + 0x011c)
  144. #define OMAP343X_CONTROL_FUSE_OPP5_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120)
  145. #define OMAP343X_CONTROL_FUSE_OPP1_VDD2 (OMAP2_CONTROL_GENERAL + 0x0124)
  146. #define OMAP343X_CONTROL_FUSE_OPP2_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)
  147. #define OMAP343X_CONTROL_FUSE_OPP3_VDD2 (OMAP2_CONTROL_GENERAL + 0x012c)
  148. #define OMAP343X_CONTROL_FUSE_SR (OMAP2_CONTROL_GENERAL + 0x0130)
  149. #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
  150. #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
  151. #define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \
  152. + ((i) >> 1) * 4 + (!((i) & 1)) * 2)
  153. #define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4)
  154. #define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8)
  155. #define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0)
  156. #define OMAP343X_CONTROL_CORE_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E4)
  157. #define OMAP343X_CONTROL_PER_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E8)
  158. #define OMAP343X_CONTROL_USBHOST_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01EC)
  159. #define OMAP343X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x02B0)
  160. #define OMAP343X_CONTROL_TEMP_SENSOR (OMAP2_CONTROL_GENERAL + 0x02B4)
  161. #define OMAP343X_CONTROL_SRAMLDO4 (OMAP2_CONTROL_GENERAL + 0x02B8)
  162. #define OMAP343X_CONTROL_SRAMLDO5 (OMAP2_CONTROL_GENERAL + 0x02C0)
  163. #define OMAP343X_CONTROL_CSI (OMAP2_CONTROL_GENERAL + 0x02C4)
  164. /* OMAP3630 only CONTROL_GENERAL register offsets */
  165. #define OMAP3630_CONTROL_FUSE_OPP1G_VDD1 (OMAP2_CONTROL_GENERAL + 0x0110)
  166. #define OMAP3630_CONTROL_FUSE_OPP50_VDD1 (OMAP2_CONTROL_GENERAL + 0x0114)
  167. #define OMAP3630_CONTROL_FUSE_OPP100_VDD1 (OMAP2_CONTROL_GENERAL + 0x0118)
  168. #define OMAP3630_CONTROL_FUSE_OPP120_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120)
  169. #define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)
  170. #define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL + 0x012C)
  171. #define OMAP3630_CONTROL_CAMERA_PHY_CTRL (OMAP2_CONTROL_GENERAL + 0x02f0)
  172. /* OMAP44xx control efuse offsets */
  173. #define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22C
  174. #define OMAP44XX_CONTROL_FUSE_IVA_OPP100 0x22F
  175. #define OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO 0x232
  176. #define OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO 0x235
  177. #define OMAP44XX_CONTROL_FUSE_MPU_OPP50 0x240
  178. #define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243
  179. #define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246
  180. #define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249
  181. #define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254
  182. #define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257
  183. #define OMAP44XX_CONTROL_FUSE_CORE_OPP100OV 0x25A
  184. /* AM35XX only CONTROL_GENERAL register offsets */
  185. #define AM35XX_CONTROL_MSUSPENDMUX_6 (OMAP2_CONTROL_GENERAL + 0x0038)
  186. #define AM35XX_CONTROL_DEVCONF2 (OMAP2_CONTROL_GENERAL + 0x0310)
  187. #define AM35XX_CONTROL_DEVCONF3 (OMAP2_CONTROL_GENERAL + 0x0314)
  188. #define AM35XX_CONTROL_CBA_PRIORITY (OMAP2_CONTROL_GENERAL + 0x0320)
  189. #define AM35XX_CONTROL_LVL_INTR_CLEAR (OMAP2_CONTROL_GENERAL + 0x0324)
  190. #define AM35XX_CONTROL_IP_SW_RESET (OMAP2_CONTROL_GENERAL + 0x0328)
  191. #define AM35XX_CONTROL_IPSS_CLK_CTRL (OMAP2_CONTROL_GENERAL + 0x032C)
  192. /* 34xx PADCONF register offsets */
  193. #define OMAP343X_PADCONF_ETK(i) (OMAP2_CONTROL_PADCONFS + 0x5a8 + \
  194. (i)*2)
  195. #define OMAP343X_PADCONF_ETK_CLK OMAP343X_PADCONF_ETK(0)
  196. #define OMAP343X_PADCONF_ETK_CTL OMAP343X_PADCONF_ETK(1)
  197. #define OMAP343X_PADCONF_ETK_D0 OMAP343X_PADCONF_ETK(2)
  198. #define OMAP343X_PADCONF_ETK_D1 OMAP343X_PADCONF_ETK(3)
  199. #define OMAP343X_PADCONF_ETK_D2 OMAP343X_PADCONF_ETK(4)
  200. #define OMAP343X_PADCONF_ETK_D3 OMAP343X_PADCONF_ETK(5)
  201. #define OMAP343X_PADCONF_ETK_D4 OMAP343X_PADCONF_ETK(6)
  202. #define OMAP343X_PADCONF_ETK_D5 OMAP343X_PADCONF_ETK(7)
  203. #define OMAP343X_PADCONF_ETK_D6 OMAP343X_PADCONF_ETK(8)
  204. #define OMAP343X_PADCONF_ETK_D7 OMAP343X_PADCONF_ETK(9)
  205. #define OMAP343X_PADCONF_ETK_D8 OMAP343X_PADCONF_ETK(10)
  206. #define OMAP343X_PADCONF_ETK_D9 OMAP343X_PADCONF_ETK(11)
  207. #define OMAP343X_PADCONF_ETK_D10 OMAP343X_PADCONF_ETK(12)
  208. #define OMAP343X_PADCONF_ETK_D11 OMAP343X_PADCONF_ETK(13)
  209. #define OMAP343X_PADCONF_ETK_D12 OMAP343X_PADCONF_ETK(14)
  210. #define OMAP343X_PADCONF_ETK_D13 OMAP343X_PADCONF_ETK(15)
  211. #define OMAP343X_PADCONF_ETK_D14 OMAP343X_PADCONF_ETK(16)
  212. #define OMAP343X_PADCONF_ETK_D15 OMAP343X_PADCONF_ETK(17)
  213. /* 34xx GENERAL_WKUP register offsets */
  214. #define OMAP34XX_CONTROL_WKUP_CTRL (OMAP343X_CONTROL_GENERAL_WKUP - 0x4)
  215. #define OMAP36XX_GPIO_IO_PWRDNZ BIT(6)
  216. #define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \
  217. 0x008 + (i))
  218. #define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008)
  219. #define OMAP343X_CONTROL_WKUP_DEBOBS1 (OMAP343X_CONTROL_GENERAL_WKUP + 0x00C)
  220. #define OMAP343X_CONTROL_WKUP_DEBOBS2 (OMAP343X_CONTROL_GENERAL_WKUP + 0x010)
  221. #define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014)
  222. #define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018)
  223. /* 36xx-only RTA - Retention till Access control registers and bits */
  224. #define OMAP36XX_CONTROL_MEM_RTA_CTRL 0x40C
  225. #define OMAP36XX_RTA_DISABLE 0x0
  226. /* 34xx D2D idle-related pins, handled by PM core */
  227. #define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
  228. #define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
  229. /* TI81XX CONTROL_DEVBOOT register offsets */
  230. #define TI81XX_CONTROL_STATUS (TI81XX_CONTROL_DEVBOOT + 0x000)
  231. /* TI81XX CONTROL_DEVCONF register offsets */
  232. #define TI81XX_CONTROL_DEVICE_ID (TI81XX_CONTROL_DEVCONF + 0x000)
  233. /* OMAP4 CONTROL MODULE */
  234. #define OMAP4_CTRL_MODULE_PAD_WKUP 0x4a31e000
  235. #define OMAP4_CTRL_MODULE_PAD_WKUP_CONTROL_I2C_2 0x0604
  236. #define OMAP4_CTRL_MODULE_CORE_STATUS 0x02c4
  237. #define OMAP4_CTRL_MODULE_CORE_STD_FUSE_PROD_ID_1 0x0218
  238. #define OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR 0x0304
  239. #define OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY 0x0618
  240. #define OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX 0x0608
  241. /* OMAP4 CONTROL_DSIPHY */
  242. #define OMAP4_DSI2_LANEENABLE_SHIFT 29
  243. #define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29)
  244. #define OMAP4_DSI1_LANEENABLE_SHIFT 24
  245. #define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24)
  246. #define OMAP4_DSI1_PIPD_SHIFT 19
  247. #define OMAP4_DSI1_PIPD_MASK (0x1f << 19)
  248. #define OMAP4_DSI2_PIPD_SHIFT 14
  249. #define OMAP4_DSI2_PIPD_MASK (0x1f << 14)
  250. /* OMAP4 CONTROL_CAMERA_RX */
  251. #define OMAP4_CAMERARX_CSI21_LANEENABLE_SHIFT 24
  252. #define OMAP4_CAMERARX_CSI21_LANEENABLE_MASK (0x1f << 24)
  253. #define OMAP4_CAMERARX_CSI22_LANEENABLE_SHIFT 29
  254. #define OMAP4_CAMERARX_CSI22_LANEENABLE_MASK (0x3 << 29)
  255. #define OMAP4_CAMERARX_CSI22_CTRLCLKEN_SHIFT 21
  256. #define OMAP4_CAMERARX_CSI22_CTRLCLKEN_MASK (1 << 21)
  257. #define OMAP4_CAMERARX_CSI22_CAMMODE_SHIFT 19
  258. #define OMAP4_CAMERARX_CSI22_CAMMODE_MASK (0x3 << 19)
  259. #define OMAP4_CAMERARX_CSI21_CTRLCLKEN_SHIFT 18
  260. #define OMAP4_CAMERARX_CSI21_CTRLCLKEN_MASK (1 << 18)
  261. #define OMAP4_CAMERARX_CSI21_CAMMODE_SHIFT 16
  262. #define OMAP4_CAMERARX_CSI21_CAMMODE_MASK (0x3 << 16)
  263. /* OMAP54XX CONTROL STATUS register */
  264. #define OMAP5XXX_CONTROL_STATUS 0x134
  265. #define OMAP5_DEVICETYPE_MASK (0x7 << 6)
  266. /* DRA7XX CONTROL CORE BOOTSTRAP */
  267. #define DRA7_CTRL_CORE_BOOTSTRAP 0x6c4
  268. #define DRA7_SPEEDSELECT_MASK (0x3 << 8)
  269. /*
  270. * REVISIT: This list of registers is not comprehensive - there are more
  271. * that should be added.
  272. */
  273. /*
  274. * Control module register bit defines - these should eventually go into
  275. * their own regbits file. Some of these will be complicated, depending
  276. * on the device type (general-purpose, emulator, test, secure, bad, other)
  277. * and the security mode (secure, non-secure, don't care)
  278. */
  279. /* CONTROL_DEVCONF0 bits */
  280. #define OMAP2_MMCSDIO1ADPCLKISEL (1 << 24) /* MMC1 loop back clock */
  281. #define OMAP24XX_USBSTANDBYCTRL (1 << 15)
  282. #define OMAP2_MCBSP2_CLKS_MASK (1 << 6)
  283. #define OMAP2_MCBSP1_FSR_MASK (1 << 4)
  284. #define OMAP2_MCBSP1_CLKR_MASK (1 << 3)
  285. #define OMAP2_MCBSP1_CLKS_MASK (1 << 2)
  286. /* CONTROL_DEVCONF1 bits */
  287. #define OMAP243X_MMC1_ACTIVE_OVERWRITE (1 << 31)
  288. #define OMAP2_MMCSDIO2ADPCLKISEL (1 << 6) /* MMC2 loop back clock */
  289. #define OMAP2_MCBSP5_CLKS_MASK (1 << 4) /* > 242x */
  290. #define OMAP2_MCBSP4_CLKS_MASK (1 << 2) /* > 242x */
  291. #define OMAP2_MCBSP3_CLKS_MASK (1 << 0) /* > 242x */
  292. /* CONTROL_STATUS bits */
  293. #define OMAP2_DEVICETYPE_MASK (0x7 << 8)
  294. #define OMAP2_SYSBOOT_5_MASK (1 << 5)
  295. #define OMAP2_SYSBOOT_4_MASK (1 << 4)
  296. #define OMAP2_SYSBOOT_3_MASK (1 << 3)
  297. #define OMAP2_SYSBOOT_2_MASK (1 << 2)
  298. #define OMAP2_SYSBOOT_1_MASK (1 << 1)
  299. #define OMAP2_SYSBOOT_0_MASK (1 << 0)
  300. /* CONTROL_PBIAS_LITE bits */
  301. #define OMAP343X_PBIASLITESUPPLY_HIGH1 (1 << 15)
  302. #define OMAP343X_PBIASLITEVMODEERROR1 (1 << 11)
  303. #define OMAP343X_PBIASSPEEDCTRL1 (1 << 10)
  304. #define OMAP343X_PBIASLITEPWRDNZ1 (1 << 9)
  305. #define OMAP343X_PBIASLITEVMODE1 (1 << 8)
  306. #define OMAP343X_PBIASLITESUPPLY_HIGH0 (1 << 7)
  307. #define OMAP343X_PBIASLITEVMODEERROR0 (1 << 3)
  308. #define OMAP2_PBIASSPEEDCTRL0 (1 << 2)
  309. #define OMAP2_PBIASLITEPWRDNZ0 (1 << 1)
  310. #define OMAP2_PBIASLITEVMODE0 (1 << 0)
  311. /* CONTROL_PROG_IO1 bits */
  312. #define OMAP3630_PRG_SDMMC1_SPEEDCTRL (1 << 20)
  313. /* CONTROL_IVA2_BOOTMOD bits */
  314. #define OMAP3_IVA2_BOOTMOD_SHIFT 0
  315. #define OMAP3_IVA2_BOOTMOD_MASK (0xf << 0)
  316. #define OMAP3_IVA2_BOOTMOD_IDLE (0x1 << 0)
  317. /* CONTROL_PADCONF_X bits */
  318. #define OMAP3_PADCONF_WAKEUPEVENT0 (1 << 15)
  319. #define OMAP3_PADCONF_WAKEUPENABLE0 (1 << 14)
  320. #define OMAP343X_SCRATCHPAD_ROM (OMAP343X_CTRL_BASE + 0x860)
  321. #define OMAP343X_SCRATCHPAD (OMAP343X_CTRL_BASE + 0x910)
  322. #define OMAP343X_SCRATCHPAD_ROM_OFFSET 0x19C
  323. #define OMAP343X_SCRATCHPAD_REGADDR(reg) OMAP2_L4_IO_ADDRESS(\
  324. OMAP343X_SCRATCHPAD + reg)
  325. /* AM35XX_CONTROL_IPSS_CLK_CTRL bits */
  326. #define AM35XX_USBOTG_VBUSP_CLK_SHIFT 0
  327. #define AM35XX_CPGMAC_VBUSP_CLK_SHIFT 1
  328. #define AM35XX_VPFE_VBUSP_CLK_SHIFT 2
  329. #define AM35XX_HECC_VBUSP_CLK_SHIFT 3
  330. #define AM35XX_USBOTG_FCLK_SHIFT 8
  331. #define AM35XX_CPGMAC_FCLK_SHIFT 9
  332. #define AM35XX_VPFE_FCLK_SHIFT 10
  333. /* AM35XX CONTROL_LVL_INTR_CLEAR bits */
  334. #define AM35XX_CPGMAC_C0_MISC_PULSE_CLR BIT(0)
  335. #define AM35XX_CPGMAC_C0_RX_PULSE_CLR BIT(1)
  336. #define AM35XX_CPGMAC_C0_RX_THRESH_CLR BIT(2)
  337. #define AM35XX_CPGMAC_C0_TX_PULSE_CLR BIT(3)
  338. #define AM35XX_USBOTGSS_INT_CLR BIT(4)
  339. #define AM35XX_VPFE_CCDC_VD0_INT_CLR BIT(5)
  340. #define AM35XX_VPFE_CCDC_VD1_INT_CLR BIT(6)
  341. #define AM35XX_VPFE_CCDC_VD2_INT_CLR BIT(7)
  342. /* AM35XX CONTROL_IP_SW_RESET bits */
  343. #define AM35XX_USBOTGSS_SW_RST BIT(0)
  344. #define AM35XX_CPGMACSS_SW_RST BIT(1)
  345. #define AM35XX_VPFE_VBUSP_SW_RST BIT(2)
  346. #define AM35XX_HECC_SW_RST BIT(3)
  347. #define AM35XX_VPFE_PCLK_SW_RST BIT(4)
  348. /* AM33XX CONTROL_STATUS register */
  349. #define AM33XX_CONTROL_STATUS 0x040
  350. #define AM33XX_CONTROL_SEC_CLK_CTRL 0x1bc
  351. /* AM33XX CONTROL_STATUS bitfields (partial) */
  352. #define AM33XX_CONTROL_STATUS_SYSBOOT1_SHIFT 22
  353. #define AM33XX_CONTROL_STATUS_SYSBOOT1_WIDTH 0x2
  354. #define AM33XX_CONTROL_STATUS_SYSBOOT1_MASK (0x3 << 22)
  355. /* AM33XX PWMSS Control register */
  356. #define AM33XX_PWMSS_TBCLK_CLKCTRL 0x664
  357. /* AM33XX PWMSS Control bitfields */
  358. #define AM33XX_PWMSS0_TBCLKEN_SHIFT 0
  359. #define AM33XX_PWMSS1_TBCLKEN_SHIFT 1
  360. #define AM33XX_PWMSS2_TBCLKEN_SHIFT 2
  361. /* DEV Feature register to identify AM33XX features */
  362. #define AM33XX_DEV_FEATURE 0x604
  363. #define AM33XX_SGX_MASK BIT(29)
  364. /* CONTROL OMAP STATUS register to identify OMAP3 features */
  365. #define OMAP3_CONTROL_OMAP_STATUS 0x044c
  366. #define OMAP3_SGX_SHIFT 13
  367. #define OMAP3_SGX_MASK (3 << OMAP3_SGX_SHIFT)
  368. #define FEAT_SGX_FULL 0
  369. #define FEAT_SGX_HALF 1
  370. #define FEAT_SGX_NONE 2
  371. #define OMAP3_IVA_SHIFT 12
  372. #define OMAP3_IVA_MASK (1 << OMAP3_IVA_SHIFT)
  373. #define FEAT_IVA 0
  374. #define FEAT_IVA_NONE 1
  375. #define OMAP3_L2CACHE_SHIFT 10
  376. #define OMAP3_L2CACHE_MASK (3 << OMAP3_L2CACHE_SHIFT)
  377. #define FEAT_L2CACHE_NONE 0
  378. #define FEAT_L2CACHE_64KB 1
  379. #define FEAT_L2CACHE_128KB 2
  380. #define FEAT_L2CACHE_256KB 3
  381. #define OMAP3_ISP_SHIFT 5
  382. #define OMAP3_ISP_MASK (1 << OMAP3_ISP_SHIFT)
  383. #define FEAT_ISP 0
  384. #define FEAT_ISP_NONE 1
  385. #define OMAP3_NEON_SHIFT 4
  386. #define OMAP3_NEON_MASK (1 << OMAP3_NEON_SHIFT)
  387. #define FEAT_NEON 0
  388. #define FEAT_NEON_NONE 1
  389. #ifndef __ASSEMBLY__
  390. #ifdef CONFIG_ARCH_OMAP2PLUS
  391. extern u8 omap_ctrl_readb(u16 offset);
  392. extern u16 omap_ctrl_readw(u16 offset);
  393. extern u32 omap_ctrl_readl(u16 offset);
  394. extern void omap_ctrl_writeb(u8 val, u16 offset);
  395. extern void omap_ctrl_writew(u16 val, u16 offset);
  396. extern void omap_ctrl_writel(u32 val, u16 offset);
  397. extern void omap3_save_scratchpad_contents(void);
  398. extern void omap3_clear_scratchpad_contents(void);
  399. extern void omap3_restore(void);
  400. extern void omap3_restore_es3(void);
  401. extern void omap3_restore_3630(void);
  402. extern u32 omap3_arm_context[128];
  403. extern void omap3_control_save_context(void);
  404. extern void omap3_control_restore_context(void);
  405. extern void omap3_ctrl_write_boot_mode(u8 bootmode);
  406. extern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr);
  407. extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode);
  408. extern void omap3630_ctrl_disable_rta(void);
  409. extern int omap3_ctrl_save_padconf(void);
  410. void omap3_ctrl_init(void);
  411. int omap2_control_base_init(void);
  412. int omap_control_init(void);
  413. void omap2_set_globals_control(void __iomem *ctrl);
  414. void __init omap3_control_legacy_iomap_init(void);
  415. #else
  416. #define omap_ctrl_readb(x) 0
  417. #define omap_ctrl_readw(x) 0
  418. #define omap_ctrl_readl(x) 0
  419. #define omap4_ctrl_pad_readl(x) 0
  420. #define omap_ctrl_writeb(x, y) WARN_ON(1)
  421. #define omap_ctrl_writew(x, y) WARN_ON(1)
  422. #define omap_ctrl_writel(x, y) WARN_ON(1)
  423. #define omap4_ctrl_pad_writel(x, y) WARN_ON(1)
  424. #endif
  425. #endif /* __ASSEMBLY__ */
  426. #endif /* __ARCH_ARM_MACH_OMAP2_CONTROL_H */