powerdomains3xxx_data.c 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. /*
  2. * OMAP3 powerdomain definitions
  3. *
  4. * Copyright (C) 2007-2008 Texas Instruments, Inc.
  5. * Copyright (C) 2007-2011 Nokia Corporation
  6. *
  7. * Paul Walmsley, Jouni Högander
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include "powerdomain.h"
  16. #include "powerdomains2xxx_3xxx_data.h"
  17. #include "prcm-common.h"
  18. #include "prm2xxx_3xxx.h"
  19. #include "prm-regbits-34xx.h"
  20. #include "cm2xxx_3xxx.h"
  21. #include "cm-regbits-34xx.h"
  22. /*
  23. * 34XX-specific powerdomains, dependencies
  24. */
  25. #ifdef CONFIG_ARCH_OMAP3
  26. /*
  27. * Powerdomains
  28. */
  29. static struct powerdomain iva2_pwrdm = {
  30. .name = "iva2_pwrdm",
  31. .prcm_offs = OMAP3430_IVA2_MOD,
  32. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  33. .pwrsts = PWRSTS_OFF_RET_ON,
  34. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  35. .banks = 4,
  36. .pwrsts_mem_ret = {
  37. [0] = PWRSTS_OFF_RET,
  38. [1] = PWRSTS_OFF_RET,
  39. [2] = PWRSTS_OFF_RET,
  40. [3] = PWRSTS_OFF_RET,
  41. },
  42. .pwrsts_mem_on = {
  43. [0] = PWRSTS_ON,
  44. [1] = PWRSTS_ON,
  45. [2] = PWRSTS_OFF_ON,
  46. [3] = PWRSTS_ON,
  47. },
  48. };
  49. static struct powerdomain mpu_3xxx_pwrdm = {
  50. .name = "mpu_pwrdm",
  51. .prcm_offs = MPU_MOD,
  52. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  53. .pwrsts = PWRSTS_OFF_RET_ON,
  54. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  55. .flags = PWRDM_HAS_MPU_QUIRK,
  56. .banks = 1,
  57. .pwrsts_mem_ret = {
  58. [0] = PWRSTS_OFF_RET,
  59. },
  60. .pwrsts_mem_on = {
  61. [0] = PWRSTS_OFF_ON,
  62. },
  63. };
  64. /*
  65. * The USBTLL Save-and-Restore mechanism is broken on
  66. * 3430s up to ES3.0 and 3630ES1.0. Hence this feature
  67. * needs to be disabled on these chips.
  68. * Refer: 3430 errata ID i459 and 3630 errata ID i579
  69. *
  70. * Note: setting the SAR flag could help for errata ID i478
  71. * which applies to 3430 <= ES3.1, but since the SAR feature
  72. * is broken, do not use it.
  73. */
  74. static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
  75. .name = "core_pwrdm",
  76. .prcm_offs = CORE_MOD,
  77. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
  78. CHIP_IS_OMAP3430ES2 |
  79. CHIP_IS_OMAP3430ES3_0 |
  80. CHIP_IS_OMAP3630ES1),
  81. .pwrsts = PWRSTS_OFF_RET_ON,
  82. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  83. .banks = 2,
  84. .pwrsts_mem_ret = {
  85. [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
  86. [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
  87. },
  88. .pwrsts_mem_on = {
  89. [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
  90. [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
  91. },
  92. };
  93. static struct powerdomain core_3xxx_es3_1_pwrdm = {
  94. .name = "core_pwrdm",
  95. .prcm_offs = CORE_MOD,
  96. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1 |
  97. CHIP_GE_OMAP3630ES1_1),
  98. .pwrsts = PWRSTS_OFF_RET_ON,
  99. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  100. /*
  101. * Setting the SAR flag for errata ID i478 which applies
  102. * to 3430 <= ES3.1
  103. */
  104. .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
  105. .banks = 2,
  106. .pwrsts_mem_ret = {
  107. [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
  108. [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
  109. },
  110. .pwrsts_mem_on = {
  111. [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
  112. [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
  113. },
  114. };
  115. static struct powerdomain dss_pwrdm = {
  116. .name = "dss_pwrdm",
  117. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  118. .prcm_offs = OMAP3430_DSS_MOD,
  119. .pwrsts = PWRSTS_OFF_RET_ON,
  120. .pwrsts_logic_ret = PWRSTS_RET,
  121. .banks = 1,
  122. .pwrsts_mem_ret = {
  123. [0] = PWRSTS_RET, /* MEMRETSTATE */
  124. },
  125. .pwrsts_mem_on = {
  126. [0] = PWRSTS_ON, /* MEMONSTATE */
  127. },
  128. };
  129. /*
  130. * Although the 34XX TRM Rev K Table 4-371 notes that retention is a
  131. * possible SGX powerstate, the SGX device itself does not support
  132. * retention.
  133. */
  134. static struct powerdomain sgx_pwrdm = {
  135. .name = "sgx_pwrdm",
  136. .prcm_offs = OMAP3430ES2_SGX_MOD,
  137. .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
  138. /* XXX This is accurate for 3430 SGX, but what about GFX? */
  139. .pwrsts = PWRSTS_OFF_ON,
  140. .pwrsts_logic_ret = PWRSTS_RET,
  141. .banks = 1,
  142. .pwrsts_mem_ret = {
  143. [0] = PWRSTS_RET, /* MEMRETSTATE */
  144. },
  145. .pwrsts_mem_on = {
  146. [0] = PWRSTS_ON, /* MEMONSTATE */
  147. },
  148. };
  149. static struct powerdomain cam_pwrdm = {
  150. .name = "cam_pwrdm",
  151. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  152. .prcm_offs = OMAP3430_CAM_MOD,
  153. .pwrsts = PWRSTS_OFF_RET_ON,
  154. .pwrsts_logic_ret = PWRSTS_RET,
  155. .banks = 1,
  156. .pwrsts_mem_ret = {
  157. [0] = PWRSTS_RET, /* MEMRETSTATE */
  158. },
  159. .pwrsts_mem_on = {
  160. [0] = PWRSTS_ON, /* MEMONSTATE */
  161. },
  162. };
  163. static struct powerdomain per_pwrdm = {
  164. .name = "per_pwrdm",
  165. .prcm_offs = OMAP3430_PER_MOD,
  166. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  167. .pwrsts = PWRSTS_OFF_RET_ON,
  168. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  169. .banks = 1,
  170. .pwrsts_mem_ret = {
  171. [0] = PWRSTS_RET, /* MEMRETSTATE */
  172. },
  173. .pwrsts_mem_on = {
  174. [0] = PWRSTS_ON, /* MEMONSTATE */
  175. },
  176. };
  177. static struct powerdomain emu_pwrdm = {
  178. .name = "emu_pwrdm",
  179. .prcm_offs = OMAP3430_EMU_MOD,
  180. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  181. };
  182. static struct powerdomain neon_pwrdm = {
  183. .name = "neon_pwrdm",
  184. .prcm_offs = OMAP3430_NEON_MOD,
  185. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  186. .pwrsts = PWRSTS_OFF_RET_ON,
  187. .pwrsts_logic_ret = PWRSTS_RET,
  188. };
  189. static struct powerdomain usbhost_pwrdm = {
  190. .name = "usbhost_pwrdm",
  191. .prcm_offs = OMAP3430ES2_USBHOST_MOD,
  192. .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
  193. .pwrsts = PWRSTS_OFF_RET_ON,
  194. .pwrsts_logic_ret = PWRSTS_RET,
  195. /*
  196. * REVISIT: Enabling usb host save and restore mechanism seems to
  197. * leave the usb host domain permanently in ACTIVE mode after
  198. * changing the usb host power domain state from OFF to active once.
  199. * Disabling for now.
  200. */
  201. /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
  202. .banks = 1,
  203. .pwrsts_mem_ret = {
  204. [0] = PWRSTS_RET, /* MEMRETSTATE */
  205. },
  206. .pwrsts_mem_on = {
  207. [0] = PWRSTS_ON, /* MEMONSTATE */
  208. },
  209. };
  210. static struct powerdomain dpll1_pwrdm = {
  211. .name = "dpll1_pwrdm",
  212. .prcm_offs = MPU_MOD,
  213. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  214. };
  215. static struct powerdomain dpll2_pwrdm = {
  216. .name = "dpll2_pwrdm",
  217. .prcm_offs = OMAP3430_IVA2_MOD,
  218. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  219. };
  220. static struct powerdomain dpll3_pwrdm = {
  221. .name = "dpll3_pwrdm",
  222. .prcm_offs = PLL_MOD,
  223. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  224. };
  225. static struct powerdomain dpll4_pwrdm = {
  226. .name = "dpll4_pwrdm",
  227. .prcm_offs = PLL_MOD,
  228. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
  229. };
  230. static struct powerdomain dpll5_pwrdm = {
  231. .name = "dpll5_pwrdm",
  232. .prcm_offs = PLL_MOD,
  233. .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
  234. };
  235. /* As powerdomains are added or removed above, this list must also be changed */
  236. static struct powerdomain *powerdomains_omap3xxx[] __initdata = {
  237. &wkup_omap2_pwrdm,
  238. &gfx_omap2_pwrdm,
  239. &iva2_pwrdm,
  240. &mpu_3xxx_pwrdm,
  241. &neon_pwrdm,
  242. &core_3xxx_pre_es3_1_pwrdm,
  243. &core_3xxx_es3_1_pwrdm,
  244. &cam_pwrdm,
  245. &dss_pwrdm,
  246. &per_pwrdm,
  247. &emu_pwrdm,
  248. &sgx_pwrdm,
  249. &usbhost_pwrdm,
  250. &dpll1_pwrdm,
  251. &dpll2_pwrdm,
  252. &dpll3_pwrdm,
  253. &dpll4_pwrdm,
  254. &dpll5_pwrdm,
  255. #endif
  256. NULL
  257. };
  258. void __init omap3xxx_powerdomains_init(void)
  259. {
  260. pwrdm_init(powerdomains_omap3xxx, &omap3_pwrdm_operations);
  261. }