powerdomains.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /*
  2. * OMAP2/3 common powerdomain definitions
  3. *
  4. * Copyright (C) 2007-8 Texas Instruments, Inc.
  5. * Copyright (C) 2007-8 Nokia Corporation
  6. *
  7. * Written by Paul Walmsley
  8. * Debugging and integration fixes by Jouni Högander
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS
  15. #define ARCH_ARM_MACH_OMAP2_POWERDOMAINS
  16. /*
  17. * This file contains all of the powerdomains that have some element
  18. * of software control for the OMAP24xx and OMAP34XX chips.
  19. *
  20. * A few notes:
  21. *
  22. * This is not an exhaustive listing of powerdomains on the chips; only
  23. * powerdomains that can be controlled in software.
  24. *
  25. * A useful validation rule for struct powerdomain:
  26. * Any powerdomain referenced by a wkdep_srcs or sleepdep_srcs array
  27. * must have a dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really
  28. * just software-controllable dependencies. Non-software-controllable
  29. * dependencies do exist, but they are not encoded below (yet).
  30. *
  31. * 24xx does not support programmable sleep dependencies (SLEEPDEP)
  32. *
  33. */
  34. /*
  35. * The names for the DSP/IVA2 powerdomains are confusing.
  36. *
  37. * Most OMAP chips have an on-board DSP.
  38. *
  39. * On the 2420, this is a 'C55 DSP called, simply, the DSP. Its
  40. * powerdomain is called the "DSP power domain." On the 2430, the
  41. * on-board DSP is a 'C64 DSP, now called the IVA2 or IVA2.1. Its
  42. * powerdomain is still called the "DSP power domain." On the 3430,
  43. * the DSP is a 'C64 DSP like the 2430, also known as the IVA2; but
  44. * its powerdomain is now called the "IVA2 power domain."
  45. *
  46. * The 2420 also has something called the IVA, which is a separate ARM
  47. * core, and has nothing to do with the DSP/IVA2.
  48. *
  49. * Ideally the DSP/IVA2 could just be the same powerdomain, but the PRCM
  50. * address offset is different between the C55 and C64 DSPs.
  51. *
  52. * The overly-specific dep_bit names are due to a bit name collision
  53. * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
  54. * value are the same for all powerdomains: 2
  55. */
  56. /*
  57. * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
  58. * sanity check?
  59. * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
  60. */
  61. #include <mach/powerdomain.h>
  62. #include "prcm-common.h"
  63. #include "prm.h"
  64. #include "cm.h"
  65. /* OMAP2/3-common powerdomains and wakeup dependencies */
  66. /*
  67. * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP
  68. * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE
  69. * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE
  70. */
  71. static struct pwrdm_dep gfx_sgx_wkdeps[] = {
  72. {
  73. .pwrdm_name = "core_pwrdm",
  74. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
  75. },
  76. {
  77. .pwrdm_name = "iva2_pwrdm",
  78. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
  79. },
  80. {
  81. .pwrdm_name = "mpu_pwrdm",
  82. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
  83. CHIP_IS_OMAP3430)
  84. },
  85. {
  86. .pwrdm_name = "wkup_pwrdm",
  87. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
  88. CHIP_IS_OMAP3430)
  89. },
  90. { NULL },
  91. };
  92. /*
  93. * 3430: CM_SLEEPDEP_CAM: MPU
  94. * 3430ES1: CM_SLEEPDEP_GFX: MPU
  95. * 3430ES2: CM_SLEEPDEP_SGX: MPU
  96. */
  97. static struct pwrdm_dep cam_gfx_sleepdeps[] = {
  98. {
  99. .pwrdm_name = "mpu_pwrdm",
  100. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
  101. },
  102. { NULL },
  103. };
  104. #include "powerdomains24xx.h"
  105. #include "powerdomains34xx.h"
  106. /*
  107. * OMAP2/3 common powerdomains
  108. */
  109. /*
  110. * The GFX powerdomain is not present on 3430ES2, but currently we do not
  111. * have a macro to filter it out at compile-time.
  112. */
  113. static struct powerdomain gfx_pwrdm = {
  114. .name = "gfx_pwrdm",
  115. .prcm_offs = GFX_MOD,
  116. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
  117. CHIP_IS_OMAP3430ES1),
  118. .wkdep_srcs = gfx_sgx_wkdeps,
  119. .sleepdep_srcs = cam_gfx_sleepdeps,
  120. .pwrsts = PWRSTS_OFF_RET_ON,
  121. .pwrsts_logic_ret = PWRDM_POWER_RET,
  122. .banks = 1,
  123. .pwrsts_mem_ret = {
  124. [0] = PWRDM_POWER_RET, /* MEMRETSTATE */
  125. },
  126. .pwrsts_mem_on = {
  127. [0] = PWRDM_POWER_ON, /* MEMONSTATE */
  128. },
  129. };
  130. static struct powerdomain wkup_pwrdm = {
  131. .name = "wkup_pwrdm",
  132. .prcm_offs = WKUP_MOD,
  133. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
  134. .dep_bit = OMAP_EN_WKUP_SHIFT,
  135. };
  136. /* As powerdomains are added or removed above, this list must also be changed */
  137. static struct powerdomain *powerdomains_omap[] __initdata = {
  138. &gfx_pwrdm,
  139. &wkup_pwrdm,
  140. #ifdef CONFIG_ARCH_OMAP24XX
  141. &dsp_pwrdm,
  142. &mpu_24xx_pwrdm,
  143. &core_24xx_pwrdm,
  144. #endif
  145. #ifdef CONFIG_ARCH_OMAP2430
  146. &mdm_pwrdm,
  147. #endif
  148. #ifdef CONFIG_ARCH_OMAP34XX
  149. &iva2_pwrdm,
  150. &mpu_34xx_pwrdm,
  151. &neon_pwrdm,
  152. &core_34xx_pre_es3_1_pwrdm,
  153. &core_34xx_es3_1_pwrdm,
  154. &cam_pwrdm,
  155. &dss_pwrdm,
  156. &per_pwrdm,
  157. &emu_pwrdm,
  158. &sgx_pwrdm,
  159. &usbhost_pwrdm,
  160. &dpll1_pwrdm,
  161. &dpll2_pwrdm,
  162. &dpll3_pwrdm,
  163. &dpll4_pwrdm,
  164. &dpll5_pwrdm,
  165. #endif
  166. NULL
  167. };
  168. #endif