clockdomains2430_data.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * OMAP2xxx clockdomains
  3. *
  4. * Copyright (C) 2008-2009 Texas Instruments, Inc.
  5. * Copyright (C) 2008-2010 Nokia Corporation
  6. *
  7. * Paul Walmsley, Jouni Högander
  8. *
  9. * This file contains clockdomains and clockdomain wakeup dependencies
  10. * for OMAP2xxx chips. Some notes:
  11. *
  12. * A useful validation rule for struct clockdomain: Any clockdomain
  13. * referenced by a wkdep_srcs must have a dep_bit assigned. So
  14. * wkdep_srcs are really just software-controllable dependencies.
  15. * Non-software-controllable dependencies do exist, but they are not
  16. * encoded below (yet).
  17. *
  18. * 24xx does not support programmable sleep dependencies (SLEEPDEP)
  19. *
  20. * The overly-specific dep_bit names are due to a bit name collision
  21. * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
  22. * value are the same for all powerdomains: 2
  23. *
  24. * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
  25. * sanity check?
  26. * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
  27. */
  28. /*
  29. * To-Do List
  30. * -> Port the Sleep/Wakeup dependencies for the domains
  31. * from the Power domain framework
  32. */
  33. #include <linux/kernel.h>
  34. #include <linux/io.h>
  35. #include "soc.h"
  36. #include "clockdomain.h"
  37. #include "prm2xxx_3xxx.h"
  38. #include "cm2xxx_3xxx.h"
  39. #include "cm-regbits-24xx.h"
  40. #include "prm-regbits-24xx.h"
  41. /*
  42. * Clockdomain dependencies for wkdeps
  43. *
  44. * XXX Hardware dependencies (e.g., dependencies that cannot be
  45. * changed in software) are not included here yet, but should be.
  46. */
  47. /* Wakeup dependency source arrays */
  48. /* 2430-specific possible wakeup dependencies */
  49. /* 2430 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP, MDM */
  50. static struct clkdm_dep core_2430_wkdeps[] = {
  51. { .clkdm_name = "dsp_clkdm" },
  52. { .clkdm_name = "gfx_clkdm" },
  53. { .clkdm_name = "mpu_clkdm" },
  54. { .clkdm_name = "wkup_clkdm" },
  55. { .clkdm_name = "mdm_clkdm" },
  56. { NULL },
  57. };
  58. /* 2430 PM_WKDEP_MPU: CORE, DSP, WKUP, MDM */
  59. static struct clkdm_dep mpu_2430_wkdeps[] = {
  60. { .clkdm_name = "core_l3_clkdm" },
  61. { .clkdm_name = "core_l4_clkdm" },
  62. { .clkdm_name = "dsp_clkdm" },
  63. { .clkdm_name = "wkup_clkdm" },
  64. { .clkdm_name = "mdm_clkdm" },
  65. { NULL },
  66. };
  67. /* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
  68. static struct clkdm_dep mdm_2430_wkdeps[] = {
  69. { .clkdm_name = "core_l3_clkdm" },
  70. { .clkdm_name = "core_l4_clkdm" },
  71. { .clkdm_name = "mpu_clkdm" },
  72. { .clkdm_name = "wkup_clkdm" },
  73. { NULL },
  74. };
  75. /*
  76. * 2430-only clockdomains
  77. */
  78. static struct clockdomain mpu_2430_clkdm = {
  79. .name = "mpu_clkdm",
  80. .pwrdm = { .name = "mpu_pwrdm" },
  81. .flags = CLKDM_CAN_HWSUP_SWSUP,
  82. .wkdep_srcs = mpu_2430_wkdeps,
  83. .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
  84. };
  85. /* Another case of bit name collisions between several registers: EN_MDM */
  86. static struct clockdomain mdm_clkdm = {
  87. .name = "mdm_clkdm",
  88. .pwrdm = { .name = "mdm_pwrdm" },
  89. .flags = CLKDM_CAN_HWSUP_SWSUP,
  90. .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
  91. .wkdep_srcs = mdm_2430_wkdeps,
  92. .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
  93. };
  94. static struct clockdomain dsp_2430_clkdm = {
  95. .name = "dsp_clkdm",
  96. .pwrdm = { .name = "dsp_pwrdm" },
  97. .flags = CLKDM_CAN_HWSUP_SWSUP,
  98. .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
  99. .wkdep_srcs = dsp_24xx_wkdeps,
  100. .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
  101. };
  102. static struct clockdomain gfx_2430_clkdm = {
  103. .name = "gfx_clkdm",
  104. .pwrdm = { .name = "gfx_pwrdm" },
  105. .flags = CLKDM_CAN_HWSUP_SWSUP,
  106. .wkdep_srcs = gfx_24xx_wkdeps,
  107. .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
  108. };
  109. /*
  110. * XXX add usecounting for clkdm dependencies, otherwise the presence
  111. * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
  112. * could cause trouble
  113. */
  114. static struct clockdomain core_l3_2430_clkdm = {
  115. .name = "core_l3_clkdm",
  116. .pwrdm = { .name = "core_pwrdm" },
  117. .flags = CLKDM_CAN_HWSUP,
  118. .dep_bit = OMAP24XX_EN_CORE_SHIFT,
  119. .wkdep_srcs = core_2430_wkdeps,
  120. .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
  121. };
  122. /*
  123. * XXX add usecounting for clkdm dependencies, otherwise the presence
  124. * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
  125. * could cause trouble
  126. */
  127. static struct clockdomain core_l4_2430_clkdm = {
  128. .name = "core_l4_clkdm",
  129. .pwrdm = { .name = "core_pwrdm" },
  130. .flags = CLKDM_CAN_HWSUP,
  131. .dep_bit = OMAP24XX_EN_CORE_SHIFT,
  132. .wkdep_srcs = core_2430_wkdeps,
  133. .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
  134. };
  135. static struct clockdomain dss_2430_clkdm = {
  136. .name = "dss_clkdm",
  137. .pwrdm = { .name = "core_pwrdm" },
  138. .flags = CLKDM_CAN_HWSUP,
  139. .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
  140. };
  141. static struct clockdomain *clockdomains_omap243x[] __initdata = {
  142. &wkup_common_clkdm,
  143. &mpu_2430_clkdm,
  144. &mdm_clkdm,
  145. &dsp_2430_clkdm,
  146. &gfx_2430_clkdm,
  147. &core_l3_2430_clkdm,
  148. &core_l4_2430_clkdm,
  149. &dss_2430_clkdm,
  150. NULL,
  151. };
  152. void __init omap243x_clockdomains_init(void)
  153. {
  154. if (!cpu_is_omap243x())
  155. return;
  156. clkdm_register_platform_funcs(&omap2_clkdm_operations);
  157. clkdm_register_clkdms(clockdomains_omap243x);
  158. clkdm_complete_init();
  159. }