preliminaryDataProcessing.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * opp2xxx.h - macros for old-style OMAP2xxx "OPP" definitions
  3. *
  4. * Copyright (C) 2005-2009 Texas Instruments, Inc.
  5. * Copyright (C) 2004-2009 Nokia Corporation
  6. *
  7. * Richard Woodruff <r-woodruff2@ti.com>
  8. *
  9. * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
  10. * These configurations are characterized by voltage and speed for clocks.
  11. * The device is only validated for certain combinations. One way to express
  12. * these combinations is via the 'ratio's' which the clocks operate with
  13. * respect to each other. These ratio sets are for a given voltage/DPLL
  14. * setting. All configurations can be described by a DPLL setting and a ratio
  15. * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
  16. *
  17. * 2430 differs from 2420 in that there are no more phase synchronizers used.
  18. * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
  19. * 2430 (iva2.1, NOdsp, mdm)
  20. *
  21. * XXX Missing voltage data.
  22. *
  23. * THe format described in this file is deprecated. Once a reasonable
  24. * OPP API exists, the data in this file should be converted to use it.
  25. *
  26. * This is technically part of the OMAP2xxx clock code.
  27. */
  28. #ifndef __ARCH_ARM_MACH_OMAP2_OPP2XXX_H
  29. #define __ARCH_ARM_MACH_OMAP2_OPP2XXX_H
  30. /**
  31. * struct prcm_config - define clock rates on a per-OPP basis (24xx)
  32. *
  33. * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
  34. * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP
  35. * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM
  36. *
  37. * This is deprecated. As soon as we have a decent OPP API, we should
  38. * move all this stuff to it.
  39. */
  40. struct prcm_config {
  41. unsigned long xtal_speed; /* crystal rate */
  42. unsigned long dpll_speed; /* dpll: out*xtal*M/(N-1)table_recalc */
  43. unsigned long mpu_speed; /* speed of MPU */
  44. unsigned long cm_clksel_mpu; /* mpu divider */
  45. unsigned long cm_clksel_dsp; /* dsp+iva1 div(2420), iva2.1(2430) */
  46. unsigned long cm_clksel_gfx; /* gfx dividers */
  47. unsigned long cm_clksel1_core; /* major subsystem dividers */
  48. unsigned long cm_clksel1_pll; /* m,n */
  49. unsigned long cm_clksel2_pll; /* dpllx1 or x2 out */
  50. unsigned long cm_clksel_mdm; /* modem dividers 2430 only */
  51. unsigned long base_sdrc_rfr; /* base refresh timing for a set */
  52. unsigned short flags;
  53. };
  54. /* Core fields for cm_clksel, not ratio governed */
  55. #define RX_CLKSEL_DSS1 (0x10 << 8)
  56. #define RX_CLKSEL_DSS2 (0x0 << 13)
  57. #define RX_CLKSEL_SSI (0x5 << 20)
  58. /*-------------------------------------------------------------------------
  59. * Voltage/DPLL ratios
  60. *-------------------------------------------------------------------------*/
  61. /* 2430 Ratio's, 2430-Ratio Config 1 */
  62. #define R1_CLKSEL_L3 (4 << 0)
  63. #define R1_CLKSEL_L4 (2 << 5)
  64. #define R1_CLKSEL_USB (4 << 25)
  65. #define R1_CM_CLKSEL1_CORE_VAL (R1_CLKSEL_USB | RX_CLKSEL_SSI | \
  66. RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
  67. R1_CLKSEL_L4 | R1_CLKSEL_L3)
  68. #define R1_CLKSEL_MPU (2 << 0)
  69. #define R1_CM_CLKSEL_MPU_VAL R1_CLKSEL_MPU
  70. #define R1_CLKSEL_DSP (2 << 0)
  71. #define R1_CLKSEL_DSP_IF (2 << 5)
  72. #define R1_CM_CLKSEL_DSP_VAL (R1_CLKSEL_DSP | R1_CLKSEL_DSP_IF)
  73. #define R1_CLKSEL_GFX (2 << 0)
  74. #define R1_CM_CLKSEL_GFX_VAL R1_CLKSEL_GFX
  75. #define R1_CLKSEL_MDM (4 << 0)
  76. #define R1_CM_CLKSEL_MDM_VAL R1_CLKSEL_MDM
  77. /* 2430-Ratio Config 2 */
  78. #define R2_CLKSEL_L3 (6 << 0)
  79. #define R2_CLKSEL_L4 (2 << 5)
  80. #define R2_CLKSEL_USB (2 << 25)
  81. #define R2_CM_CLKSEL1_CORE_VAL (R2_CLKSEL_USB | RX_CLKSEL_SSI | \
  82. RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
  83. R2_CLKSEL_L4 | R2_CLKSEL_L3)
  84. #define R2_CLKSEL_MPU (2 << 0)
  85. #define R2_CM_CLKSEL_MPU_VAL R2_CLKSEL_MPU
  86. #define R2_CLKSEL_DSP (2 << 0)
  87. #define R2_CLKSEL_DSP_IF (3 << 5)
  88. #define R2_CM_CLKSEL_DSP_VAL (R2_CLKSEL_DSP | R2_CLKSEL_DSP_IF)
  89. #define R2_CLKSEL_GFX (2 << 0)
  90. #define R2_CM_CLKSEL_GFX_VAL R2_CLKSEL_GFX
  91. #define R2_CLKSEL_MDM (6 << 0)
  92. #define R2_CM_CLKSEL_MDM_VAL R2_CLKSEL_MDM
  93. /* 2430-Ratio Bootm (BYPASS) */
  94. #define RB_CLKSEL_L3 (1 << 0)
  95. #define RB_CLKSEL_L4 (1 << 5)
  96. #define RB_CLKSEL_USB (1 << 25)
  97. #define RB_CM_CLKSEL1_CORE_VAL (RB_CLKSEL_USB | RX_CLKSEL_SSI | \
  98. RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
  99. RB_CLKSEL_L4 | RB_CLKSEL_L3)
  100. #define RB_CLKSEL_MPU (1 << 0)
  101. #define RB_CM_CLKSEL_MPU_VAL RB_CLKSEL_MPU
  102. #define RB_CLKSEL_DSP (1 << 0)
  103. #define RB_CLKSEL_DSP_IF (1 << 5)
  104. #define RB_CM_CLKSEL_DSP_VAL (RB_CLKSEL_DSP | RB_CLKSEL_DSP_IF)
  105. #define RB_CLKSEL_GFX (1 << 0)
  106. #define RB_CM_CLKSEL_GFX_VAL RB_CLKSEL_GFX
  107. #define RB_CLKSEL_MDM (1 << 0)
  108. #define RB_CM_CLKSEL_MDM_VAL RB_CLKSEL_MDM
  109. /* 2420 Ratio Equivalents */
  110. #define RXX_CLKSEL_VLYNQ (0x12 << 15)
  111. #define RXX_CLKSEL_SSI (0x8 << 20)
  112. /* 2420-PRCM III 532MHz core */
  113. #define RIII_CLKSEL_L3 (4 << 0) /* 133MHz */
  114. #define RIII_CLKSEL_L4 (2 << 5) /* 66.5MHz */
  115. #define RIII_CLKSEL_USB (4 << 25) /* 33.25MHz */
  116. #define RIII_CM_CLKSEL1_CORE_VAL (RIII_CLKSEL_USB | RXX_CLKSEL_SSI | \
  117. RXX_CLKSEL_VLYNQ | RX_CLKSEL_DSS2 | \
  118. RX_CLKSEL_DSS1 | RIII_CLKSEL_L4 | \
  119. RIII_CLKSEL_L3)
  120. #define RIII_CLKSEL_MPU (2 << 0) /* 266MHz */
  121. #define RIII_CM_CLKSEL_MPU_VAL RIII_CLKSEL_MPU
  122. #define RIII_CLKSEL_DSP (3 << 0) /* c5x - 177.3MHz */
  123. #define RIII_CLKSEL_DSP_IF (2 << 5) /* c5x - 88.67MHz */
  124. #define RIII_SYNC_DSP (1 << 7) /* Enable sync */
  125. #define RIII_CLKSEL_IVA (6 << 8) /* iva1 - 88.67MHz */
  126. #define RIII_SYNC_IVA (1 << 13) /* Enable sync */
  127. #define RIII_CM_CLKSEL_DSP_VAL (RIII_SYNC_IVA | RIII_CLKSEL_IVA | \
  128. RIII_SYNC_DSP | RIII_CLKSEL_DSP_IF | \
  129. RIII_CLKSEL_DSP)
  130. #define RIII_CLKSEL_GFX (2 << 0) /* 66.5MHz */
  131. #define RIII_CM_CLKSEL_GFX_VAL RIII_CLKSEL_GFX
  132. /* 2420-PRCM II 600MHz core */
  133. #define RII_CLKSEL_L3 (6 << 0) /* 100MHz */
  134. #define RII_CLKSEL_L4 (2 << 5) /* 50MHz */
  135. #define RII_CLKSEL_USB (2 << 25) /* 50MHz */
  136. #define RII_CM_CLKSEL1_CORE_VAL (RII_CLKSEL_USB | RXX_CLKSEL_SSI | \