powerdomains.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. #include "powerdomains24xx.h"
  93. /*
  94. * OMAP2/3 common powerdomains
  95. */
  96. /* XXX add sleepdeps for this powerdomain : 3430 */
  97. /*
  98. * The GFX powerdomain is not present on 3430ES2, but currently we do not
  99. * have a macro to filter it out at compile-time.
  100. */
  101. static struct powerdomain gfx_pwrdm = {
  102. .name = "gfx_pwrdm",
  103. .prcm_offs = GFX_MOD,
  104. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
  105. CHIP_IS_OMAP3430ES1),
  106. .wkdep_srcs = gfx_sgx_wkdeps,
  107. .pwrsts = PWRSTS_OFF_RET_ON,
  108. .pwrsts_logic_ret = PWRDM_POWER_RET,
  109. .banks = 1,
  110. .pwrsts_mem_ret = {
  111. [0] = PWRDM_POWER_RET, /* MEMRETSTATE */
  112. },
  113. .pwrsts_mem_on = {
  114. [0] = PWRDM_POWER_ON, /* MEMONSTATE */
  115. },
  116. };
  117. static struct powerdomain wkup_pwrdm = {
  118. .name = "wkup_pwrdm",
  119. .prcm_offs = WKUP_MOD,
  120. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
  121. .dep_bit = OMAP_EN_WKUP_SHIFT,
  122. };
  123. /* As powerdomains are added or removed above, this list must also be changed */
  124. static struct powerdomain *powerdomains_omap[] __initdata = {
  125. &gfx_pwrdm,
  126. &wkup_pwrdm,
  127. #ifdef CONFIG_ARCH_OMAP24XX
  128. &dsp_pwrdm,
  129. &mpu_24xx_pwrdm,
  130. &core_24xx_pwrdm,
  131. #endif
  132. #ifdef CONFIG_ARCH_OMAP2430
  133. &mdm_pwrdm,
  134. #endif
  135. NULL
  136. };
  137. #endif