opp3xxx_data.c 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * OMAP3 OPP table definitions.
  3. *
  4. * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/
  5. * Nishanth Menon
  6. * Kevin Hilman
  7. * Copyright (C) 2010-2011 Nokia Corporation.
  8. * Eduardo Valentin
  9. * Paul Walmsley
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  16. * kind, whether express or implied; without even the implied warranty
  17. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. */
  20. #include <linux/module.h>
  21. #include "soc.h"
  22. #include "control.h"
  23. #include "omap_opp_data.h"
  24. #include "pm.h"
  25. /* 34xx */
  26. /* VDD1 */
  27. #define OMAP3430_VDD_MPU_OPP1_UV 975000
  28. #define OMAP3430_VDD_MPU_OPP2_UV 1075000
  29. #define OMAP3430_VDD_MPU_OPP3_UV 1200000
  30. #define OMAP3430_VDD_MPU_OPP4_UV 1270000
  31. #define OMAP3430_VDD_MPU_OPP5_UV 1350000
  32. struct omap_volt_data omap34xx_vddmpu_volt_data[] = {
  33. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c),
  34. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c),
  35. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18),
  36. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18),
  37. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18),
  38. VOLT_DATA_DEFINE(0, 0, 0, 0),
  39. };
  40. /* VDD2 */
  41. #define OMAP3430_VDD_CORE_OPP1_UV 975000
  42. #define OMAP3430_VDD_CORE_OPP2_UV 1050000
  43. #define OMAP3430_VDD_CORE_OPP3_UV 1150000
  44. struct omap_volt_data omap34xx_vddcore_volt_data[] = {
  45. VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c),
  46. VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c),
  47. VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18),
  48. VOLT_DATA_DEFINE(0, 0, 0, 0),
  49. };
  50. /* 36xx */
  51. /* VDD1 */
  52. #define OMAP3630_VDD_MPU_OPP50_UV 1012500
  53. #define OMAP3630_VDD_MPU_OPP100_UV 1200000
  54. #define OMAP3630_VDD_MPU_OPP120_UV 1325000
  55. #define OMAP3630_VDD_MPU_OPP1G_UV 1375000
  56. struct omap_volt_data omap36xx_vddmpu_volt_data[] = {
  57. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c),
  58. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16),
  59. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23),
  60. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27),
  61. VOLT_DATA_DEFINE(0, 0, 0, 0),
  62. };
  63. /* VDD2 */
  64. #define OMAP3630_VDD_CORE_OPP50_UV 1000000
  65. #define OMAP3630_VDD_CORE_OPP100_UV 1200000
  66. struct omap_volt_data omap36xx_vddcore_volt_data[] = {
  67. VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c),
  68. VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16),
  69. VOLT_DATA_DEFINE(0, 0, 0, 0),
  70. };
  71. /* OPP data */
  72. static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
  73. /* MPU OPP1 */
  74. OPP_INITIALIZER("mpu", true, 125000000, OMAP3430_VDD_MPU_OPP1_UV),
  75. /* MPU OPP2 */
  76. OPP_INITIALIZER("mpu", true, 250000000, OMAP3430_VDD_MPU_OPP2_UV),
  77. /* MPU OPP3 */
  78. OPP_INITIALIZER("mpu", true, 500000000, OMAP3430_VDD_MPU_OPP3_UV),
  79. /* MPU OPP4 */
  80. OPP_INITIALIZER("mpu", true, 550000000, OMAP3430_VDD_MPU_OPP4_UV),
  81. /* MPU OPP5 */
  82. OPP_INITIALIZER("mpu", true, 600000000, OMAP3430_VDD_MPU_OPP5_UV),
  83. /*
  84. * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
  85. * almost the same than the one at 83MHz thus providing very little
  86. * gain for the power point of view. In term of energy it will even
  87. * increase the consumption due to the very negative performance
  88. * impact that frequency will do to the MPU and the whole system in
  89. * general.
  90. */
  91. OPP_INITIALIZER("l3_main", false, 41500000, OMAP3430_VDD_CORE_OPP1_UV),
  92. /* L3 OPP2 */
  93. OPP_INITIALIZER("l3_main", true, 83000000, OMAP3430_VDD_CORE_OPP2_UV),
  94. /* L3 OPP3 */
  95. OPP_INITIALIZER("l3_main", true, 166000000, OMAP3430_VDD_CORE_OPP3_UV),
  96. /* DSP OPP1 */
  97. OPP_INITIALIZER("iva", true, 90000000, OMAP3430_VDD_MPU_OPP1_UV),
  98. /* DSP OPP2 */
  99. OPP_INITIALIZER("iva", true, 180000000, OMAP3430_VDD_MPU_OPP2_UV),
  100. /* DSP OPP3 */
  101. OPP_INITIALIZER("iva", true, 360000000, OMAP3430_VDD_MPU_OPP3_UV),
  102. /* DSP OPP4 */
  103. OPP_INITIALIZER("iva", true, 400000000, OMAP3430_VDD_MPU_OPP4_UV),
  104. /* DSP OPP5 */
  105. OPP_INITIALIZER("iva", true, 430000000, OMAP3430_VDD_MPU_OPP5_UV),
  106. };
  107. static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
  108. /* MPU OPP1 - OPP50 */
  109. OPP_INITIALIZER("mpu", true, 300000000, OMAP3630_VDD_MPU_OPP50_UV),
  110. /* MPU OPP2 - OPP100 */
  111. OPP_INITIALIZER("mpu", true, 600000000, OMAP3630_VDD_MPU_OPP100_UV),
  112. /* MPU OPP3 - OPP-Turbo */
  113. OPP_INITIALIZER("mpu", false, 800000000, OMAP3630_VDD_MPU_OPP120_UV),
  114. /* MPU OPP4 - OPP-SB */
  115. OPP_INITIALIZER("mpu", false, 1000000000, OMAP3630_VDD_MPU_OPP1G_UV),
  116. /* L3 OPP1 - OPP50 */
  117. OPP_INITIALIZER("l3_main", true, 100000000, OMAP3630_VDD_CORE_OPP50_UV),
  118. /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
  119. OPP_INITIALIZER("l3_main", true, 200000000, OMAP3630_VDD_CORE_OPP100_UV),
  120. /* DSP OPP1 - OPP50 */
  121. OPP_INITIALIZER("iva", true, 260000000, OMAP3630_VDD_MPU_OPP50_UV),
  122. /* DSP OPP2 - OPP100 */
  123. OPP_INITIALIZER("iva", true, 520000000, OMAP3630_VDD_MPU_OPP100_UV),
  124. /* DSP OPP3 - OPP-Turbo */
  125. OPP_INITIALIZER("iva", false, 660000000, OMAP3630_VDD_MPU_OPP120_UV),
  126. /* DSP OPP4 - OPP-SB */
  127. OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
  128. };
  129. /**
  130. * omap3_opp_init() - initialize omap3 opp table
  131. */
  132. int __init omap3_opp_init(void)
  133. {
  134. int r = -ENODEV;
  135. if (!cpu_is_omap34xx())
  136. return r;
  137. if (cpu_is_omap3630())
  138. r = omap_init_opp_table(omap36xx_opp_def_list,
  139. ARRAY_SIZE(omap36xx_opp_def_list));
  140. else
  141. r = omap_init_opp_table(omap34xx_opp_def_list,
  142. ARRAY_SIZE(omap34xx_opp_def_list));
  143. return r;
  144. }
  145. omap_device_initcall(omap3_opp_init);