opp2420_data.c 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * opp2420_data.c - old-style "OPP" table for OMAP2420
  4. *
  5. * Copyright (C) 2005-2009 Texas Instruments, Inc.
  6. * Copyright (C) 2004-2009 Nokia Corporation
  7. *
  8. * Richard Woodruff <[email protected]>
  9. *
  10. * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
  11. * These configurations are characterized by voltage and speed for clocks.
  12. * The device is only validated for certain combinations. One way to express
  13. * these combinations is via the 'ratios' which the clocks operate with
  14. * respect to each other. These ratio sets are for a given voltage/DPLL
  15. * setting. All configurations can be described by a DPLL setting and a ratio.
  16. *
  17. * XXX Missing voltage data.
  18. * XXX Missing 19.2MHz sys_clk rate sets (needed for N800/N810)
  19. *
  20. * THe format described in this file is deprecated. Once a reasonable
  21. * OPP API exists, the data in this file should be converted to use it.
  22. *
  23. * This is technically part of the OMAP2xxx clock code.
  24. *
  25. * Considerable work is still needed to fully support dynamic frequency
  26. * changes on OMAP2xxx-series chips. Readers interested in such a
  27. * project are encouraged to review the Maemo Diablo RX-34 and RX-44
  28. * kernel source at:
  29. * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/
  30. */
  31. #include <linux/kernel.h>
  32. #include "opp2xxx.h"
  33. #include "sdrc.h"
  34. #include "clock.h"
  35. /*
  36. * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated.
  37. * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
  38. * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
  39. * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
  40. *
  41. * Filling in table based on H4 boards available. There are quite a
  42. * few more rate combinations which could be defined.
  43. *
  44. * When multiple values are defined the start up will try and choose
  45. * the fastest one. If a 'fast' value is defined, then automatically,
  46. * the /2 one should be included as it can be used. Generally having
  47. * more than one fast set does not make sense, as static timings need
  48. * to be changed to change the set. The exception is the bypass
  49. * setting which is available for low power bypass.
  50. *
  51. * Note: This table needs to be sorted, fastest to slowest.
  52. **/
  53. const struct prcm_config omap2420_rate_table[] = {
  54. /* PRCM I - FAST */
  55. {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
  56. RI_CM_CLKSEL_DSP_VAL, RI_CM_CLKSEL_GFX_VAL,
  57. RI_CM_CLKSEL1_CORE_VAL, MI_CM_CLKSEL1_PLL_12_VAL,
  58. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_165MHz,
  59. RATE_IN_242X},
  60. /* PRCM II - FAST */
  61. {S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
  62. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  63. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
  64. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
  65. RATE_IN_242X},
  66. {S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
  67. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  68. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
  69. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
  70. RATE_IN_242X},
  71. /* PRCM III - FAST */
  72. {S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
  73. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  74. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
  75. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
  76. RATE_IN_242X},
  77. {S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
  78. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  79. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
  80. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
  81. RATE_IN_242X},
  82. /* PRCM II - SLOW */
  83. {S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
  84. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  85. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
  86. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
  87. RATE_IN_242X},
  88. {S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
  89. RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
  90. RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
  91. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
  92. RATE_IN_242X},
  93. /* PRCM III - SLOW */
  94. {S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
  95. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  96. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
  97. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
  98. RATE_IN_242X},
  99. {S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
  100. RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
  101. RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
  102. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
  103. RATE_IN_242X},
  104. /* PRCM-VII (boot-bypass) */
  105. {S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL, /* 12MHz ARM*/
  106. RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
  107. RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
  108. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
  109. RATE_IN_242X},
  110. /* PRCM-VII (boot-bypass) */
  111. {S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL, /* 13MHz ARM */
  112. RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
  113. RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
  114. MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
  115. RATE_IN_242X},
  116. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  117. };