clockdomains2420_data.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * OMAP2420 clockdomains
  3. *
  4. * Copyright (C) 2008-2011 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 OMAP2420 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. /* 2420-specific possible wakeup dependencies */
  49. /* 2420 PM_WKDEP_MPU: CORE, DSP, WKUP */
  50. static struct clkdm_dep mpu_2420_wkdeps[] = {
  51. { .clkdm_name = "core_l3_clkdm" },
  52. { .clkdm_name = "core_l4_clkdm" },
  53. { .clkdm_name = "dsp_clkdm" },
  54. { .clkdm_name = "wkup_clkdm" },
  55. { NULL },
  56. };
  57. /* 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP */
  58. static struct clkdm_dep core_2420_wkdeps[] = {
  59. { .clkdm_name = "dsp_clkdm" },
  60. { .clkdm_name = "gfx_clkdm" },
  61. { .clkdm_name = "mpu_clkdm" },
  62. { .clkdm_name = "wkup_clkdm" },
  63. { NULL },
  64. };
  65. /*
  66. * 2420-only clockdomains
  67. */
  68. static struct clockdomain mpu_2420_clkdm = {
  69. .name = "mpu_clkdm",
  70. .pwrdm = { .name = "mpu_pwrdm" },
  71. .flags = CLKDM_CAN_HWSUP,
  72. .wkdep_srcs = mpu_2420_wkdeps,
  73. .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
  74. };
  75. static struct clockdomain iva1_2420_clkdm = {
  76. .name = "iva1_clkdm",
  77. .pwrdm = { .name = "dsp_pwrdm" },
  78. .flags = CLKDM_CAN_HWSUP_SWSUP,
  79. .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
  80. .wkdep_srcs = dsp_24xx_wkdeps,
  81. .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
  82. };
  83. static struct clockdomain dsp_2420_clkdm = {
  84. .name = "dsp_clkdm",
  85. .pwrdm = { .name = "dsp_pwrdm" },
  86. .flags = CLKDM_CAN_HWSUP_SWSUP,
  87. .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
  88. };
  89. static struct clockdomain gfx_2420_clkdm = {
  90. .name = "gfx_clkdm",
  91. .pwrdm = { .name = "gfx_pwrdm" },
  92. .flags = CLKDM_CAN_HWSUP_SWSUP,
  93. .wkdep_srcs = gfx_24xx_wkdeps,
  94. .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
  95. };
  96. static struct clockdomain core_l3_2420_clkdm = {
  97. .name = "core_l3_clkdm",
  98. .pwrdm = { .name = "core_pwrdm" },
  99. .flags = CLKDM_CAN_HWSUP,
  100. .wkdep_srcs = core_2420_wkdeps,
  101. .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
  102. };
  103. static struct clockdomain core_l4_2420_clkdm = {
  104. .name = "core_l4_clkdm",
  105. .pwrdm = { .name = "core_pwrdm" },
  106. .flags = CLKDM_CAN_HWSUP,
  107. .wkdep_srcs = core_2420_wkdeps,
  108. .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
  109. };
  110. static struct clockdomain dss_2420_clkdm = {
  111. .name = "dss_clkdm",
  112. .pwrdm = { .name = "core_pwrdm" },
  113. .flags = CLKDM_CAN_HWSUP,
  114. .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
  115. };
  116. static struct clockdomain *clockdomains_omap242x[] __initdata = {
  117. &wkup_common_clkdm,
  118. &mpu_2420_clkdm,
  119. &iva1_2420_clkdm,
  120. &dsp_2420_clkdm,
  121. &gfx_2420_clkdm,
  122. &core_l3_2420_clkdm,
  123. &core_l4_2420_clkdm,
  124. &dss_2420_clkdm,
  125. NULL,
  126. };
  127. void __init omap242x_clockdomains_init(void)
  128. {
  129. if (!cpu_is_omap242x())
  130. return;
  131. clkdm_register_platform_funcs(&omap2_clkdm_operations);
  132. clkdm_register_clkdms(clockdomains_omap242x);
  133. clkdm_complete_init();
  134. }