opp3xxx_data.c 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 "control.h"
  22. #include "omap_opp_data.h"
  23. #include "pm.h"
  24. /* 34xx */
  25. /* VDD1 */
  26. #define OMAP3430_VDD_MPU_OPP1_UV 975000
  27. #define OMAP3430_VDD_MPU_OPP2_UV 1075000
  28. #define OMAP3430_VDD_MPU_OPP3_UV 1200000
  29. #define OMAP3430_VDD_MPU_OPP4_UV 1270000
  30. #define OMAP3430_VDD_MPU_OPP5_UV 1350000
  31. struct omap_volt_data omap34xx_vddmpu_volt_data[] = {
  32. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c),
  33. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c),
  34. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18),
  35. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18),
  36. VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18),
  37. VOLT_DATA_DEFINE(0, 0, 0, 0),
  38. };
  39. /* VDD2 */
  40. #define OMAP3430_VDD_CORE_OPP1_UV 975000
  41. #define OMAP3430_VDD_CORE_OPP2_UV 1050000
  42. #define OMAP3430_VDD_CORE_OPP3_UV 1150000
  43. struct omap_volt_data omap34xx_vddcore_volt_data[] = {
  44. VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c),
  45. VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c),
  46. VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18),
  47. VOLT_DATA_DEFINE(0, 0, 0, 0),
  48. };
  49. /* 36xx */
  50. /* VDD1 */
  51. #define OMAP3630_VDD_MPU_OPP50_UV 1012500
  52. #define OMAP3630_VDD_MPU_OPP100_UV 1200000
  53. #define OMAP3630_VDD_MPU_OPP120_UV 1325000
  54. #define OMAP3630_VDD_MPU_OPP1G_UV 1375000
  55. struct omap_volt_data omap36xx_vddmpu_volt_data[] = {
  56. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c),
  57. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16),
  58. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23),
  59. VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27),
  60. VOLT_DATA_DEFINE(0, 0, 0, 0),
  61. };
  62. /* VDD2 */
  63. #define OMAP3630_VDD_CORE_OPP50_UV 1000000
  64. #define OMAP3630_VDD_CORE_OPP100_UV 1200000
  65. struct omap_volt_data omap36xx_vddcore_volt_data[] = {
  66. VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c),
  67. VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16),
  68. VOLT_DATA_DEFINE(0, 0, 0, 0),
  69. };
  70. /* OPP data */
  71. static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
  72. /* MPU OPP1 */
  73. OPP_INITIALIZER("mpu", true, 125000000, OMAP3430_VDD_MPU_OPP1_UV),
  74. /* MPU OPP2 */
  75. OPP_INITIALIZER("mpu", true, 250000000, OMAP3430_VDD_MPU_OPP2_UV),
  76. /* MPU OPP3 */
  77. OPP_INITIALIZER("mpu", true, 500000000, OMAP3430_VDD_MPU_OPP3_UV),
  78. /* MPU OPP4 */
  79. OPP_INITIALIZER("mpu", true, 550000000, OMAP3430_VDD_MPU_OPP4_UV),
  80. /* MPU OPP5 */
  81. OPP_INITIALIZER("mpu", true, 600000000, OMAP3430_VDD_MPU_OPP5_UV),
  82. /*
  83. * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
  84. * almost the same than the one at 83MHz thus providing very little
  85. * gain for the power point of view. In term of energy it will even
  86. * increase the consumption due to the very negative performance
  87. * impact that frequency will do to the MPU and the whole system in
  88. * general.
  89. */
  90. OPP_INITIALIZER("l3_main", false, 41500000, OMAP3430_VDD_CORE_OPP1_UV),
  91. /* L3 OPP2 */
  92. OPP_INITIALIZER("l3_main", true, 83000000, OMAP3430_VDD_CORE_OPP2_UV),
  93. /* L3 OPP3 */
  94. OPP_INITIALIZER("l3_main", true, 166000000, OMAP3430_VDD_CORE_OPP3_UV),
  95. /* DSP OPP1 */
  96. OPP_INITIALIZER("iva", true, 90000000, OMAP3430_VDD_MPU_OPP1_UV),
  97. /* DSP OPP2 */
  98. OPP_INITIALIZER("iva", true, 180000000, OMAP3430_VDD_MPU_OPP2_UV),
  99. /* DSP OPP3 */
  100. OPP_INITIALIZER("iva", true, 360000000, OMAP3430_VDD_MPU_OPP3_UV),
  101. /* DSP OPP4 */
  102. OPP_INITIALIZER("iva", true, 400000000, OMAP3430_VDD_MPU_OPP4_UV),
  103. /* DSP OPP5 */
  104. OPP_INITIALIZER("iva", true, 430000000, OMAP3430_VDD_MPU_OPP5_UV),
  105. };
  106. static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
  107. /* MPU OPP1 - OPP50 */
  108. OPP_INITIALIZER("mpu", true, 300000000, OMAP3630_VDD_MPU_OPP50_UV),
  109. /* MPU OPP2 - OPP100 */
  110. OPP_INITIALIZER("mpu", true, 600000000, OMAP3630_VDD_MPU_OPP100_UV),
  111. /* MPU OPP3 - OPP-Turbo */
  112. OPP_INITIALIZER("mpu", false, 800000000, OMAP3630_VDD_MPU_OPP120_UV),
  113. /* MPU OPP4 - OPP-SB */
  114. OPP_INITIALIZER("mpu", false, 1000000000, OMAP3630_VDD_MPU_OPP1G_UV),
  115. /* L3 OPP1 - OPP50 */
  116. OPP_INITIALIZER("l3_main", true, 100000000, OMAP3630_VDD_CORE_OPP50_UV),
  117. /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
  118. OPP_INITIALIZER("l3_main", true, 200000000, OMAP3630_VDD_CORE_OPP100_UV),
  119. /* DSP OPP1 - OPP50 */
  120. OPP_INITIALIZER("iva", true, 260000000, OMAP3630_VDD_MPU_OPP50_UV),
  121. /* DSP OPP2 - OPP100 */
  122. OPP_INITIALIZER("iva", true, 520000000, OMAP3630_VDD_MPU_OPP100_UV),
  123. /* DSP OPP3 - OPP-Turbo */
  124. OPP_INITIALIZER("iva", false, 660000000, OMAP3630_VDD_MPU_OPP120_UV),
  125. /* DSP OPP4 - OPP-SB */
  126. OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
  127. };
  128. /**
  129. * omap3_opp_init() - initialize omap3 opp table
  130. */
  131. int __init omap3_opp_init(void)
  132. {
  133. int r = -ENODEV;
  134. if (!cpu_is_omap34xx())
  135. return r;
  136. if (cpu_is_omap3630())
  137. r = omap_init_opp_table(omap36xx_opp_def_list,
  138. ARRAY_SIZE(omap36xx_opp_def_list));
  139. else
  140. r = omap_init_opp_table(omap34xx_opp_def_list,
  141. ARRAY_SIZE(omap34xx_opp_def_list));
  142. return r;
  143. }
  144. device_initcall(omap3_opp_init);