powerdomains43xx_data.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * AM43xx Power domains framework
  3. *
  4. * Copyright (C) 2013 Texas Instruments, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include "powerdomain.h"
  13. #include "prcm-common.h"
  14. #include "prcm44xx.h"
  15. #include "prcm43xx.h"
  16. static struct powerdomain gfx_43xx_pwrdm = {
  17. .name = "gfx_pwrdm",
  18. .voltdm = { .name = "core" },
  19. .prcm_offs = AM43XX_PRM_GFX_INST,
  20. .prcm_partition = AM43XX_PRM_PARTITION,
  21. .pwrsts = PWRSTS_OFF_ON,
  22. .banks = 1,
  23. .pwrsts_mem_on = {
  24. [0] = PWRSTS_ON, /* gfx_mem */
  25. },
  26. .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
  27. };
  28. static struct powerdomain mpu_43xx_pwrdm = {
  29. .name = "mpu_pwrdm",
  30. .voltdm = { .name = "mpu" },
  31. .prcm_offs = AM43XX_PRM_MPU_INST,
  32. .prcm_partition = AM43XX_PRM_PARTITION,
  33. .pwrsts = PWRSTS_OFF_RET_ON,
  34. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  35. .banks = 3,
  36. .pwrsts_mem_ret = {
  37. [0] = PWRSTS_OFF_RET, /* mpu_l1 */
  38. [1] = PWRSTS_OFF_RET, /* mpu_l2 */
  39. [2] = PWRSTS_OFF_RET, /* mpu_ram */
  40. },
  41. .pwrsts_mem_on = {
  42. [0] = PWRSTS_ON, /* mpu_l1 */
  43. [1] = PWRSTS_ON, /* mpu_l2 */
  44. [2] = PWRSTS_ON, /* mpu_ram */
  45. },
  46. .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
  47. };
  48. static struct powerdomain rtc_43xx_pwrdm = {
  49. .name = "rtc_pwrdm",
  50. .voltdm = { .name = "rtc" },
  51. .prcm_offs = AM43XX_PRM_RTC_INST,
  52. .prcm_partition = AM43XX_PRM_PARTITION,
  53. .pwrsts = PWRSTS_ON,
  54. };
  55. static struct powerdomain wkup_43xx_pwrdm = {
  56. .name = "wkup_pwrdm",
  57. .voltdm = { .name = "core" },
  58. .prcm_offs = AM43XX_PRM_WKUP_INST,
  59. .prcm_partition = AM43XX_PRM_PARTITION,
  60. .pwrsts = PWRSTS_ON,
  61. .banks = 1,
  62. .pwrsts_mem_on = {
  63. [0] = PWRSTS_ON, /* debugss_mem */
  64. },
  65. };
  66. static struct powerdomain tamper_43xx_pwrdm = {
  67. .name = "tamper_pwrdm",
  68. .voltdm = { .name = "tamper" },
  69. .prcm_offs = AM43XX_PRM_TAMPER_INST,
  70. .prcm_partition = AM43XX_PRM_PARTITION,
  71. .pwrsts = PWRSTS_ON,
  72. };
  73. static struct powerdomain cefuse_43xx_pwrdm = {
  74. .name = "cefuse_pwrdm",
  75. .voltdm = { .name = "core" },
  76. .prcm_offs = AM43XX_PRM_CEFUSE_INST,
  77. .prcm_partition = AM43XX_PRM_PARTITION,
  78. .pwrsts = PWRSTS_OFF_ON,
  79. .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
  80. };
  81. static struct powerdomain per_43xx_pwrdm = {
  82. .name = "per_pwrdm",
  83. .voltdm = { .name = "core" },
  84. .prcm_offs = AM43XX_PRM_PER_INST,
  85. .prcm_partition = AM43XX_PRM_PARTITION,
  86. .pwrsts = PWRSTS_OFF_RET_ON,
  87. .pwrsts_logic_ret = PWRSTS_OFF_RET,
  88. .banks = 4,
  89. .pwrsts_mem_ret = {
  90. [0] = PWRSTS_OFF_RET, /* icss_mem */
  91. [1] = PWRSTS_OFF_RET, /* per_mem */
  92. [2] = PWRSTS_OFF_RET, /* ram1_mem */
  93. [3] = PWRSTS_OFF_RET, /* ram2_mem */
  94. },
  95. .pwrsts_mem_on = {
  96. [0] = PWRSTS_ON, /* icss_mem */
  97. [1] = PWRSTS_ON, /* per_mem */
  98. [2] = PWRSTS_ON, /* ram1_mem */
  99. [3] = PWRSTS_ON, /* ram2_mem */
  100. },
  101. .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
  102. };
  103. static struct powerdomain *powerdomains_am43xx[] __initdata = {
  104. &gfx_43xx_pwrdm,
  105. &mpu_43xx_pwrdm,
  106. &rtc_43xx_pwrdm,
  107. &wkup_43xx_pwrdm,
  108. &tamper_43xx_pwrdm,
  109. &cefuse_43xx_pwrdm,
  110. &per_43xx_pwrdm,
  111. NULL
  112. };
  113. static int am43xx_check_vcvp(void)
  114. {
  115. return 0;
  116. }
  117. void __init am43xx_powerdomains_init(void)
  118. {
  119. omap4_pwrdm_operations.pwrdm_has_voltdm = am43xx_check_vcvp;
  120. pwrdm_register_platform_funcs(&omap4_pwrdm_operations);
  121. pwrdm_register_pwrdms(powerdomains_am43xx);
  122. pwrdm_complete_init();
  123. }