opp4xxx_data.c 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * OMAP4 OPP table definitions.
  3. *
  4. * Copyright (C) 2010-2012 Texas Instruments Incorporated - http://www.ti.com/
  5. * Nishanth Menon
  6. * Kevin Hilman
  7. * Thara Gopinath
  8. * Copyright (C) 2010-2011 Nokia Corporation.
  9. * Eduardo Valentin
  10. * Paul Walmsley
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  17. * kind, whether express or implied; without even the implied warranty
  18. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. */
  21. #include <linux/module.h>
  22. #include "soc.h"
  23. #include "control.h"
  24. #include "omap_opp_data.h"
  25. #include "pm.h"
  26. /*
  27. * Structures containing OMAP4430 voltage supported and various
  28. * voltage dependent data for each VDD.
  29. */
  30. #define OMAP4430_VDD_MPU_OPP50_UV 1025000
  31. #define OMAP4430_VDD_MPU_OPP100_UV 1200000
  32. #define OMAP4430_VDD_MPU_OPPTURBO_UV 1313000
  33. #define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000
  34. struct omap_volt_data omap443x_vdd_mpu_volt_data[] = {
  35. VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
  36. VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
  37. VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
  38. VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
  39. VOLT_DATA_DEFINE(0, 0, 0, 0),
  40. };
  41. #define OMAP4430_VDD_IVA_OPP50_UV 1013000
  42. #define OMAP4430_VDD_IVA_OPP100_UV 1188000
  43. #define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000
  44. struct omap_volt_data omap443x_vdd_iva_volt_data[] = {
  45. VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
  46. VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
  47. VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
  48. VOLT_DATA_DEFINE(0, 0, 0, 0),
  49. };
  50. #define OMAP4430_VDD_CORE_OPP50_UV 1025000
  51. #define OMAP4430_VDD_CORE_OPP100_UV 1200000
  52. struct omap_volt_data omap443x_vdd_core_volt_data[] = {
  53. VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
  54. VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
  55. VOLT_DATA_DEFINE(0, 0, 0, 0),
  56. };
  57. static struct omap_opp_def __initdata omap443x_opp_def_list[] = {
  58. /* MPU OPP1 - OPP50 */
  59. OPP_INITIALIZER("mpu", true, 300000000, OMAP4430_VDD_MPU_OPP50_UV),
  60. /* MPU OPP2 - OPP100 */
  61. OPP_INITIALIZER("mpu", true, 600000000, OMAP4430_VDD_MPU_OPP100_UV),
  62. /* MPU OPP3 - OPP-Turbo */
  63. OPP_INITIALIZER("mpu", true, 800000000, OMAP4430_VDD_MPU_OPPTURBO_UV),
  64. /* MPU OPP4 - OPP-SB */
  65. OPP_INITIALIZER("mpu", true, 1008000000, OMAP4430_VDD_MPU_OPPNITRO_UV),
  66. /* L3 OPP1 - OPP50 */
  67. OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4430_VDD_CORE_OPP50_UV),
  68. /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
  69. OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4430_VDD_CORE_OPP100_UV),
  70. /* IVA OPP1 - OPP50 */
  71. OPP_INITIALIZER("iva", true, 133000000, OMAP4430_VDD_IVA_OPP50_UV),
  72. /* IVA OPP2 - OPP100 */
  73. OPP_INITIALIZER("iva", true, 266100000, OMAP4430_VDD_IVA_OPP100_UV),
  74. /* IVA OPP3 - OPP-Turbo */
  75. OPP_INITIALIZER("iva", false, 332000000, OMAP4430_VDD_IVA_OPPTURBO_UV),
  76. /* TODO: add DSP, aess, fdif, gpu */
  77. };
  78. #define OMAP4460_VDD_MPU_OPP50_UV 1025000
  79. #define OMAP4460_VDD_MPU_OPP100_UV 1200000
  80. #define OMAP4460_VDD_MPU_OPPTURBO_UV 1313000
  81. #define OMAP4460_VDD_MPU_OPPNITRO_UV 1375000
  82. struct omap_volt_data omap446x_vdd_mpu_volt_data[] = {
  83. VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
  84. VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
  85. VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
  86. VOLT_DATA_DEFINE(OMAP4460_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
  87. VOLT_DATA_DEFINE(0, 0, 0, 0),
  88. };
  89. #define OMAP4460_VDD_IVA_OPP50_UV 1025000
  90. #define OMAP4460_VDD_IVA_OPP100_UV 1200000
  91. #define OMAP4460_VDD_IVA_OPPTURBO_UV 1313000
  92. #define OMAP4460_VDD_IVA_OPPNITRO_UV 1375000
  93. struct omap_volt_data omap446x_vdd_iva_volt_data[] = {
  94. VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
  95. VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
  96. VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
  97. VOLT_DATA_DEFINE(OMAP4460_VDD_IVA_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO, 0xfa, 0x23),
  98. VOLT_DATA_DEFINE(0, 0, 0, 0),
  99. };
  100. #define OMAP4460_VDD_CORE_OPP50_UV 1025000
  101. #define OMAP4460_VDD_CORE_OPP100_UV 1200000
  102. #define OMAP4460_VDD_CORE_OPP100_OV_UV 1250000
  103. struct omap_volt_data omap446x_vdd_core_volt_data[] = {
  104. VOLT_DATA_DEFINE(OMAP4460_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
  105. VOLT_DATA_DEFINE(OMAP4460_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
  106. VOLT_DATA_DEFINE(OMAP4460_VDD_CORE_OPP100_OV_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100OV, 0xf9, 0x16),
  107. VOLT_DATA_DEFINE(0, 0, 0, 0),
  108. };
  109. static struct omap_opp_def __initdata omap446x_opp_def_list[] = {
  110. /* MPU OPP1 - OPP50 */
  111. OPP_INITIALIZER("mpu", true, 350000000, OMAP4460_VDD_MPU_OPP50_UV),
  112. /* MPU OPP2 - OPP100 */
  113. OPP_INITIALIZER("mpu", true, 700000000, OMAP4460_VDD_MPU_OPP100_UV),
  114. /* MPU OPP3 - OPP-Turbo */
  115. OPP_INITIALIZER("mpu", true, 920000000, OMAP4460_VDD_MPU_OPPTURBO_UV),
  116. /*
  117. * MPU OPP4 - OPP-Nitro + Disabled as the reference schematics
  118. * recommends TPS623631 - confirm and enable the opp in board file
  119. * XXX: May be we should enable these based on mpu capability and
  120. * Exception board files disable it...
  121. */
  122. OPP_INITIALIZER("mpu", false, 1200000000, OMAP4460_VDD_MPU_OPPNITRO_UV),
  123. /* MPU OPP4 - OPP-Nitro SpeedBin */
  124. OPP_INITIALIZER("mpu", false, 1500000000, OMAP4460_VDD_MPU_OPPNITRO_UV),
  125. /* L3 OPP1 - OPP50 */
  126. OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4460_VDD_CORE_OPP50_UV),
  127. /* L3 OPP2 - OPP100 */
  128. OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4460_VDD_CORE_OPP100_UV),
  129. /* IVA OPP1 - OPP50 */
  130. OPP_INITIALIZER("iva", true, 133000000, OMAP4460_VDD_IVA_OPP50_UV),
  131. /* IVA OPP2 - OPP100 */
  132. OPP_INITIALIZER("iva", true, 266100000, OMAP4460_VDD_IVA_OPP100_UV),
  133. /*
  134. * IVA OPP3 - OPP-Turbo + Disabled as the reference schematics
  135. * recommends Phoenix VCORE2 which can supply only 600mA - so the ones
  136. * above this OPP frequency, even though OMAP is capable, should be
  137. * enabled by board file which is sure of the chip power capability
  138. */
  139. OPP_INITIALIZER("iva", false, 332000000, OMAP4460_VDD_IVA_OPPTURBO_UV),
  140. /* IVA OPP4 - OPP-Nitro */
  141. OPP_INITIALIZER("iva", false, 430000000, OMAP4460_VDD_IVA_OPPNITRO_UV),
  142. /* IVA OPP5 - OPP-Nitro SpeedBin*/
  143. OPP_INITIALIZER("iva", false, 500000000, OMAP4460_VDD_IVA_OPPNITRO_UV),
  144. /* TODO: add DSP, aess, fdif, gpu */
  145. };
  146. /**
  147. * omap4_opp_init() - initialize omap4 opp table
  148. */
  149. int __init omap4_opp_init(void)
  150. {
  151. int r = -ENODEV;
  152. if (cpu_is_omap443x())
  153. r = omap_init_opp_table(omap443x_opp_def_list,
  154. ARRAY_SIZE(omap443x_opp_def_list));
  155. else if (cpu_is_omap446x())
  156. r = omap_init_opp_table(omap446x_opp_def_list,
  157. ARRAY_SIZE(omap446x_opp_def_list));
  158. return r;
  159. }
  160. omap_device_initcall(omap4_opp_init);