powerdomains3xxx_data.c 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. /*
  2. * OMAP3 powerdomain definitions
  3. *
  4. * Copyright (C) 2007-2008, 2011 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 <linux/bug.h>
  16. #include <plat/cpu.h>
  17. #include "powerdomain.h"
  18. #include "powerdomains2xxx_3xxx_data.h"
  19. #include "prcm-common.h"
  20. #include "prm2xxx_3xxx.h"
  21. #include "prm-regbits-34xx.h"
  22. #include "cm2xxx_3xxx.h"
  23. #include "cm-regbits-34xx.h"
  24. /*
  25. * 34XX-specific powerdomains, dependencies
  26. */
  27. /*
  28. * Powerdomains
  29. */
  30. static struct powerdomain iva2_pwrdm = {
  31. .name = "iva2_pwrdm",
  32. .prcm_offs = OMAP3430_IVA2_MOD,
  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. .voltdm = { .name = "mpu_iva" },
  49. };
  50. static struct powerdomain mpu_3xxx_pwrdm = {
  51. .name = "mpu_pwrdm",
  52. .prcm_offs = MPU_MOD,
  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. .voltdm = { .name = "mpu_iva" },
  64. };
  65. static struct powerdomain mpu_am35x_pwrdm = {
  66. .name = "mpu_pwrdm",
  67. .prcm_offs = MPU_MOD,
  68. .pwrsts = PWRSTS_ON,
  69. .pwrsts_logic_ret = PWRSTS_ON,
  70. .flags = PWRDM_HAS_MPU_QUIRK,
  71. .banks = 1,
  72. .pwrsts_mem_ret = {
  73. [0] = PWRSTS_ON,
  74. },
  75. .pwrsts_mem_on = {
  76. [0] = PWRSTS_ON,
  77. },
  78. .voltdm = { .name = "mpu_iva" },
  79. };
  80. /*
  81. * The USBTLL Save-and-Restore mechanism is broken on
  82. * 3430s up to ES3.0 and 3630ES1.0. Hence this feature
  83. * needs to be disabled on these chips.
  84. * Refer: 3430 errata ID i459 and 3630 errata ID i579
  85. *
  86. * Note: setting the SAR flag could help for errata ID i478
  87. * which applies to 3430 <= ES3.1, but since the SAR feature
  88. * is broken, do not use it.
  89. */
  90. static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
  91. .name = "core_pwrdm",
  92. .prcm_offs = CORE_MOD,
  93. .pwrsts = PWRSTS_OFF_RET_ON,
  94. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  95. .banks = 2,
  96. .pwrsts_mem_ret = {
  97. [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
  98. [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
  99. },
  100. .pwrsts_mem_on = {
  101. [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
  102. [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
  103. },
  104. .voltdm = { .name = "core" },
  105. };
  106. static struct powerdomain core_3xxx_es3_1_pwrdm = {
  107. .name = "core_pwrdm",
  108. .prcm_offs = CORE_MOD,
  109. .pwrsts = PWRSTS_OFF_RET_ON,
  110. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  111. /*
  112. * Setting the SAR flag for errata ID i478 which applies
  113. * to 3430 <= ES3.1
  114. */
  115. .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
  116. .banks = 2,
  117. .pwrsts_mem_ret = {
  118. [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
  119. [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
  120. },
  121. .pwrsts_mem_on = {
  122. [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
  123. [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
  124. },
  125. .voltdm = { .name = "core" },
  126. };
  127. static struct powerdomain core_am35x_pwrdm = {
  128. .name = "core_pwrdm",
  129. .prcm_offs = CORE_MOD,
  130. .pwrsts = PWRSTS_ON,
  131. .pwrsts_logic_ret = PWRSTS_ON,
  132. .banks = 2,
  133. .pwrsts_mem_ret = {
  134. [0] = PWRSTS_ON, /* MEM1RETSTATE */
  135. [1] = PWRSTS_ON, /* MEM2RETSTATE */
  136. },
  137. .pwrsts_mem_on = {
  138. [0] = PWRSTS_ON, /* MEM1ONSTATE */
  139. [1] = PWRSTS_ON, /* MEM2ONSTATE */
  140. },
  141. .voltdm = { .name = "core" },
  142. };
  143. static struct powerdomain dss_pwrdm = {
  144. .name = "dss_pwrdm",
  145. .prcm_offs = OMAP3430_DSS_MOD,
  146. .pwrsts = PWRSTS_OFF_RET_ON,
  147. .pwrsts_logic_ret = PWRSTS_RET,
  148. .banks = 1,
  149. .pwrsts_mem_ret = {
  150. [0] = PWRSTS_RET, /* MEMRETSTATE */
  151. },
  152. .pwrsts_mem_on = {
  153. [0] = PWRSTS_ON, /* MEMONSTATE */
  154. },
  155. .voltdm = { .name = "core" },
  156. };
  157. static struct powerdomain dss_am35x_pwrdm = {
  158. .name = "dss_pwrdm",
  159. .prcm_offs = OMAP3430_DSS_MOD,
  160. .pwrsts = PWRSTS_ON,
  161. .pwrsts_logic_ret = PWRSTS_ON,
  162. .banks = 1,
  163. .pwrsts_mem_ret = {
  164. [0] = PWRSTS_ON, /* MEMRETSTATE */
  165. },
  166. .pwrsts_mem_on = {
  167. [0] = PWRSTS_ON, /* MEMONSTATE */
  168. },
  169. .voltdm = { .name = "core" },
  170. };
  171. /*
  172. * Although the 34XX TRM Rev K Table 4-371 notes that retention is a
  173. * possible SGX powerstate, the SGX device itself does not support
  174. * retention.
  175. */
  176. static struct powerdomain sgx_pwrdm = {
  177. .name = "sgx_pwrdm",
  178. .prcm_offs = OMAP3430ES2_SGX_MOD,
  179. /* XXX This is accurate for 3430 SGX, but what about GFX? */
  180. .pwrsts = PWRSTS_OFF_ON,
  181. .pwrsts_logic_ret = PWRSTS_RET,
  182. .banks = 1,
  183. .pwrsts_mem_ret = {
  184. [0] = PWRSTS_RET, /* MEMRETSTATE */
  185. },
  186. .pwrsts_mem_on = {
  187. [0] = PWRSTS_ON, /* MEMONSTATE */
  188. },
  189. .voltdm = { .name = "core" },
  190. };
  191. static struct powerdomain sgx_am35x_pwrdm = {
  192. .name = "sgx_pwrdm",
  193. .prcm_offs = OMAP3430ES2_SGX_MOD,
  194. .pwrsts = PWRSTS_ON,
  195. .pwrsts_logic_ret = PWRSTS_ON,
  196. .banks = 1,
  197. .pwrsts_mem_ret = {
  198. [0] = PWRSTS_ON, /* MEMRETSTATE */
  199. },
  200. .pwrsts_mem_on = {
  201. [0] = PWRSTS_ON, /* MEMONSTATE */
  202. },
  203. .voltdm = { .name = "core" },
  204. };
  205. static struct powerdomain cam_pwrdm = {
  206. .name = "cam_pwrdm",
  207. .prcm_offs = OMAP3430_CAM_MOD,
  208. .pwrsts = PWRSTS_OFF_RET_ON,
  209. .pwrsts_logic_ret = PWRSTS_RET,
  210. .banks = 1,
  211. .pwrsts_mem_ret = {
  212. [0] = PWRSTS_RET, /* MEMRETSTATE */
  213. },
  214. .pwrsts_mem_on = {
  215. [0] = PWRSTS_ON, /* MEMONSTATE */
  216. },
  217. .voltdm = { .name = "core" },
  218. };
  219. static struct powerdomain per_pwrdm = {
  220. .name = "per_pwrdm",
  221. .prcm_offs = OMAP3430_PER_MOD,
  222. .pwrsts = PWRSTS_OFF_RET_ON,
  223. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  224. .banks = 1,
  225. .pwrsts_mem_ret = {
  226. [0] = PWRSTS_RET, /* MEMRETSTATE */
  227. },
  228. .pwrsts_mem_on = {
  229. [0] = PWRSTS_ON, /* MEMONSTATE */
  230. },
  231. .voltdm = { .name = "core" },
  232. };
  233. static struct powerdomain per_am35x_pwrdm = {
  234. .name = "per_pwrdm",
  235. .prcm_offs = OMAP3430_PER_MOD,
  236. .pwrsts = PWRSTS_ON,
  237. .pwrsts_logic_ret = PWRSTS_ON,
  238. .banks = 1,
  239. .pwrsts_mem_ret = {
  240. [0] = PWRSTS_ON, /* MEMRETSTATE */
  241. },
  242. .pwrsts_mem_on = {
  243. [0] = PWRSTS_ON, /* MEMONSTATE */
  244. },
  245. .voltdm = { .name = "core" },
  246. };
  247. static struct powerdomain emu_pwrdm = {
  248. .name = "emu_pwrdm",
  249. .prcm_offs = OMAP3430_EMU_MOD,
  250. .voltdm = { .name = "core" },
  251. };
  252. static struct powerdomain neon_pwrdm = {
  253. .name = "neon_pwrdm",
  254. .prcm_offs = OMAP3430_NEON_MOD,
  255. .pwrsts = PWRSTS_OFF_RET_ON,
  256. .pwrsts_logic_ret = PWRSTS_RET,
  257. .voltdm = { .name = "mpu_iva" },
  258. };
  259. static struct powerdomain neon_am35x_pwrdm = {
  260. .name = "neon_pwrdm",
  261. .prcm_offs = OMAP3430_NEON_MOD,
  262. .pwrsts = PWRSTS_ON,
  263. .pwrsts_logic_ret = PWRSTS_ON,
  264. .voltdm = { .name = "mpu_iva" },
  265. };
  266. static struct powerdomain usbhost_pwrdm = {
  267. .name = "usbhost_pwrdm",
  268. .prcm_offs = OMAP3430ES2_USBHOST_MOD,
  269. .pwrsts = PWRSTS_OFF_RET_ON,
  270. .pwrsts_logic_ret = PWRSTS_RET,
  271. /*
  272. * REVISIT: Enabling usb host save and restore mechanism seems to
  273. * leave the usb host domain permanently in ACTIVE mode after
  274. * changing the usb host power domain state from OFF to active once.
  275. * Disabling for now.
  276. */
  277. /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
  278. .banks = 1,
  279. .pwrsts_mem_ret = {
  280. [0] = PWRSTS_RET, /* MEMRETSTATE */
  281. },
  282. .pwrsts_mem_on = {
  283. [0] = PWRSTS_ON, /* MEMONSTATE */
  284. },
  285. .voltdm = { .name = "core" },
  286. };
  287. static struct powerdomain dpll1_pwrdm = {
  288. .name = "dpll1_pwrdm",
  289. .prcm_offs = MPU_MOD,
  290. .voltdm = { .name = "mpu_iva" },
  291. };
  292. static struct powerdomain dpll2_pwrdm = {
  293. .name = "dpll2_pwrdm",
  294. .prcm_offs = OMAP3430_IVA2_MOD,
  295. .voltdm = { .name = "mpu_iva" },
  296. };
  297. static struct powerdomain dpll3_pwrdm = {
  298. .name = "dpll3_pwrdm",
  299. .prcm_offs = PLL_MOD,
  300. .voltdm = { .name = "core" },
  301. };
  302. static struct powerdomain dpll4_pwrdm = {
  303. .name = "dpll4_pwrdm",
  304. .prcm_offs = PLL_MOD,
  305. .voltdm = { .name = "core" },
  306. };
  307. static struct powerdomain dpll5_pwrdm = {
  308. .name = "dpll5_pwrdm",
  309. .prcm_offs = PLL_MOD,
  310. .voltdm = { .name = "core" },
  311. };
  312. /* As powerdomains are added or removed above, this list must also be changed */
  313. static struct powerdomain *powerdomains_omap3430_common[] __initdata = {
  314. &wkup_omap2_pwrdm,
  315. &iva2_pwrdm,
  316. &mpu_3xxx_pwrdm,
  317. &neon_pwrdm,
  318. &cam_pwrdm,
  319. &dss_pwrdm,
  320. &per_pwrdm,
  321. &emu_pwrdm,
  322. &dpll1_pwrdm,
  323. &dpll2_pwrdm,
  324. &dpll3_pwrdm,
  325. &dpll4_pwrdm,
  326. NULL
  327. };
  328. static struct powerdomain *powerdomains_omap3430es1[] __initdata = {
  329. &gfx_omap2_pwrdm,
  330. &core_3xxx_pre_es3_1_pwrdm,
  331. NULL
  332. };
  333. /* also includes 3630ES1.0 */
  334. static struct powerdomain *powerdomains_omap3430es2_es3_0[] __initdata = {
  335. &core_3xxx_pre_es3_1_pwrdm,
  336. &sgx_pwrdm,
  337. &usbhost_pwrdm,
  338. &dpll5_pwrdm,
  339. NULL
  340. };
  341. /* also includes 3630ES1.1+ */
  342. static struct powerdomain *powerdomains_omap3430es3_1plus[] __initdata = {
  343. &core_3xxx_es3_1_pwrdm,
  344. &sgx_pwrdm,
  345. &usbhost_pwrdm,
  346. &dpll5_pwrdm,
  347. NULL
  348. };
  349. static struct powerdomain *powerdomains_am35x[] __initdata = {
  350. &wkup_omap2_pwrdm,
  351. &mpu_am35x_pwrdm,
  352. &neon_am35x_pwrdm,
  353. &core_am35x_pwrdm,
  354. &sgx_am35x_pwrdm,
  355. &dss_am35x_pwrdm,
  356. &per_am35x_pwrdm,
  357. &emu_pwrdm,
  358. &dpll1_pwrdm,
  359. &dpll3_pwrdm,
  360. &dpll4_pwrdm,
  361. &dpll5_pwrdm,
  362. NULL
  363. };
  364. void __init omap3xxx_powerdomains_init(void)
  365. {
  366. unsigned int rev;
  367. if (!cpu_is_omap34xx())
  368. return;
  369. pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
  370. rev = omap_rev();
  371. if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) {
  372. pwrdm_register_pwrdms(powerdomains_am35x);
  373. } else {
  374. pwrdm_register_pwrdms(powerdomains_omap3430_common);
  375. switch (rev) {
  376. case OMAP3430_REV_ES1_0:
  377. pwrdm_register_pwrdms(powerdomains_omap3430es1);
  378. break;
  379. case OMAP3430_REV_ES2_0:
  380. case OMAP3430_REV_ES2_1:
  381. case OMAP3430_REV_ES3_0:
  382. case OMAP3630_REV_ES1_0:
  383. pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0);
  384. break;
  385. case OMAP3430_REV_ES3_1:
  386. case OMAP3430_REV_ES3_1_2:
  387. case OMAP3630_REV_ES1_1:
  388. case OMAP3630_REV_ES1_2:
  389. pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus);
  390. break;
  391. default:
  392. WARN(1, "OMAP3 powerdomain init: unknown chip type\n");
  393. }
  394. }
  395. pwrdm_complete_init();
  396. }