rk3399_dmc.txt 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. * Rockchip rk3399 DMC (Dynamic Memory Controller) device
  2. Required properties:
  3. - compatible: Must be "rockchip,rk3399-dmc".
  4. - devfreq-events: Node to get DDR loading, Refer to
  5. Documentation/devicetree/bindings/devfreq/event/
  6. rockchip-dfi.txt
  7. - clocks: Phandles for clock specified in "clock-names" property
  8. - clock-names : The name of clock used by the DFI, must be
  9. "pclk_ddr_mon";
  10. - operating-points-v2: Refer to Documentation/devicetree/bindings/opp/opp.txt
  11. for details.
  12. - center-supply: DMC supply node.
  13. - status: Marks the node enabled/disabled.
  14. Optional properties:
  15. - interrupts: The CPU interrupt number. The interrupt specifier
  16. format depends on the interrupt controller.
  17. It should be a DCF interrupt. When DDR DVFS finishes
  18. a DCF interrupt is triggered.
  19. Following properties relate to DDR timing:
  20. - rockchip,dram_speed_bin : Value reference include/dt-bindings/clock/rk3399-ddr.h,
  21. it selects the DDR3 cl-trp-trcd type. It must be
  22. set according to "Speed Bin" in DDR3 datasheet,
  23. DO NOT use a smaller "Speed Bin" than specified
  24. for the DDR3 being used.
  25. - rockchip,pd_idle : Configure the PD_IDLE value. Defines the
  26. power-down idle period in which memories are
  27. placed into power-down mode if bus is idle
  28. for PD_IDLE DFI clock cycles.
  29. - rockchip,sr_idle : Configure the SR_IDLE value. Defines the
  30. self-refresh idle period in which memories are
  31. placed into self-refresh mode if bus is idle
  32. for SR_IDLE * 1024 DFI clock cycles (DFI
  33. clocks freq is half of DRAM clock), default
  34. value is "0".
  35. - rockchip,sr_mc_gate_idle : Defines the memory self-refresh and controller
  36. clock gating idle period. Memories are placed
  37. into self-refresh mode and memory controller
  38. clock arg gating started if bus is idle for
  39. sr_mc_gate_idle*1024 DFI clock cycles.
  40. - rockchip,srpd_lite_idle : Defines the self-refresh power down idle
  41. period in which memories are placed into
  42. self-refresh power down mode if bus is idle
  43. for srpd_lite_idle * 1024 DFI clock cycles.
  44. This parameter is for LPDDR4 only.
  45. - rockchip,standby_idle : Defines the standby idle period in which
  46. memories are placed into self-refresh mode.
  47. The controller, pi, PHY and DRAM clock will
  48. be gated if bus is idle for standby_idle * DFI
  49. clock cycles.
  50. - rockchip,dram_dll_dis_freq : Defines the DDR3 DLL bypass frequency in MHz.
  51. When DDR frequency is less than DRAM_DLL_DISB_FREQ,
  52. DDR3 DLL will be bypassed. Note: if DLL was bypassed,
  53. the odt will also stop working.
  54. - rockchip,phy_dll_dis_freq : Defines the PHY dll bypass frequency in
  55. MHz (Mega Hz). When DDR frequency is less than
  56. DRAM_DLL_DISB_FREQ, PHY DLL will be bypassed.
  57. Note: PHY DLL and PHY ODT are independent.
  58. - rockchip,ddr3_odt_dis_freq : When the DRAM type is DDR3, this parameter defines
  59. the ODT disable frequency in MHz (Mega Hz).
  60. when the DDR frequency is less then ddr3_odt_dis_freq,
  61. the ODT on the DRAM side and controller side are
  62. both disabled.
  63. - rockchip,ddr3_drv : When the DRAM type is DDR3, this parameter defines
  64. the DRAM side driver strength in ohms. Default
  65. value is DDR3_DS_40ohm.
  66. - rockchip,ddr3_odt : When the DRAM type is DDR3, this parameter defines
  67. the DRAM side ODT strength in ohms. Default value
  68. is DDR3_ODT_120ohm.
  69. - rockchip,phy_ddr3_ca_drv : When the DRAM type is DDR3, this parameter defines
  70. the phy side CA line (incluing command line,
  71. address line and clock line) driver strength.
  72. Default value is PHY_DRV_ODT_40.
  73. - rockchip,phy_ddr3_dq_drv : When the DRAM type is DDR3, this parameter defines
  74. the PHY side DQ line (including DQS/DQ/DM line)
  75. driver strength. Default value is PHY_DRV_ODT_40.
  76. - rockchip,phy_ddr3_odt : When the DRAM type is DDR3, this parameter defines
  77. the PHY side ODT strength. Default value is
  78. PHY_DRV_ODT_240.
  79. - rockchip,lpddr3_odt_dis_freq : When the DRAM type is LPDDR3, this parameter defines
  80. then ODT disable frequency in MHz (Mega Hz).
  81. When DDR frequency is less then ddr3_odt_dis_freq,
  82. the ODT on the DRAM side and controller side are
  83. both disabled.
  84. - rockchip,lpddr3_drv : When the DRAM type is LPDDR3, this parameter defines
  85. the DRAM side driver strength in ohms. Default
  86. value is LP3_DS_34ohm.
  87. - rockchip,lpddr3_odt : When the DRAM type is LPDDR3, this parameter defines
  88. the DRAM side ODT strength in ohms. Default value
  89. is LP3_ODT_240ohm.
  90. - rockchip,phy_lpddr3_ca_drv : When the DRAM type is LPDDR3, this parameter defines
  91. the PHY side CA line (including command line,
  92. address line and clock line) driver strength.
  93. Default value is PHY_DRV_ODT_40.
  94. - rockchip,phy_lpddr3_dq_drv : When the DRAM type is LPDDR3, this parameter defines
  95. the PHY side DQ line (including DQS/DQ/DM line)
  96. driver strength. Default value is
  97. PHY_DRV_ODT_40.
  98. - rockchip,phy_lpddr3_odt : When dram type is LPDDR3, this parameter define
  99. the phy side odt strength, default value is
  100. PHY_DRV_ODT_240.
  101. - rockchip,lpddr4_odt_dis_freq : When the DRAM type is LPDDR4, this parameter
  102. defines the ODT disable frequency in
  103. MHz (Mega Hz). When the DDR frequency is less then
  104. ddr3_odt_dis_freq, the ODT on the DRAM side and
  105. controller side are both disabled.
  106. - rockchip,lpddr4_drv : When the DRAM type is LPDDR4, this parameter defines
  107. the DRAM side driver strength in ohms. Default
  108. value is LP4_PDDS_60ohm.
  109. - rockchip,lpddr4_dq_odt : When the DRAM type is LPDDR4, this parameter defines
  110. the DRAM side ODT on DQS/DQ line strength in ohms.
  111. Default value is LP4_DQ_ODT_40ohm.
  112. - rockchip,lpddr4_ca_odt : When the DRAM type is LPDDR4, this parameter defines
  113. the DRAM side ODT on CA line strength in ohms.
  114. Default value is LP4_CA_ODT_40ohm.
  115. - rockchip,phy_lpddr4_ca_drv : When the DRAM type is LPDDR4, this parameter defines
  116. the PHY side CA line (including command address
  117. line) driver strength. Default value is
  118. PHY_DRV_ODT_40.
  119. - rockchip,phy_lpddr4_ck_cs_drv : When the DRAM type is LPDDR4, this parameter defines
  120. the PHY side clock line and CS line driver
  121. strength. Default value is PHY_DRV_ODT_80.
  122. - rockchip,phy_lpddr4_dq_drv : When the DRAM type is LPDDR4, this parameter defines
  123. the PHY side DQ line (including DQS/DQ/DM line)
  124. driver strength. Default value is PHY_DRV_ODT_80.
  125. - rockchip,phy_lpddr4_odt : When the DRAM type is LPDDR4, this parameter defines
  126. the PHY side ODT strength. Default value is
  127. PHY_DRV_ODT_60.
  128. Example:
  129. dmc_opp_table: dmc_opp_table {
  130. compatible = "operating-points-v2";
  131. opp00 {
  132. opp-hz = /bits/ 64 <300000000>;
  133. opp-microvolt = <900000>;
  134. };
  135. opp01 {
  136. opp-hz = /bits/ 64 <666000000>;
  137. opp-microvolt = <900000>;
  138. };
  139. };
  140. dmc: dmc {
  141. compatible = "rockchip,rk3399-dmc";
  142. devfreq-events = <&dfi>;
  143. interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
  144. clocks = <&cru SCLK_DDRCLK>;
  145. clock-names = "dmc_clk";
  146. operating-points-v2 = <&dmc_opp_table>;
  147. center-supply = <&ppvar_centerlogic>;
  148. upthreshold = <15>;
  149. downdifferential = <10>;
  150. rockchip,ddr3_speed_bin = <21>;
  151. rockchip,pd_idle = <0x40>;
  152. rockchip,sr_idle = <0x2>;
  153. rockchip,sr_mc_gate_idle = <0x3>;
  154. rockchip,srpd_lite_idle = <0x4>;
  155. rockchip,standby_idle = <0x2000>;
  156. rockchip,dram_dll_dis_freq = <300>;
  157. rockchip,phy_dll_dis_freq = <125>;
  158. rockchip,auto_pd_dis_freq = <666>;
  159. rockchip,ddr3_odt_dis_freq = <333>;
  160. rockchip,ddr3_drv = <DDR3_DS_40ohm>;
  161. rockchip,ddr3_odt = <DDR3_ODT_120ohm>;
  162. rockchip,phy_ddr3_ca_drv = <PHY_DRV_ODT_40>;
  163. rockchip,phy_ddr3_dq_drv = <PHY_DRV_ODT_40>;
  164. rockchip,phy_ddr3_odt = <PHY_DRV_ODT_240>;
  165. rockchip,lpddr3_odt_dis_freq = <333>;
  166. rockchip,lpddr3_drv = <LP3_DS_34ohm>;
  167. rockchip,lpddr3_odt = <LP3_ODT_240ohm>;
  168. rockchip,phy_lpddr3_ca_drv = <PHY_DRV_ODT_40>;
  169. rockchip,phy_lpddr3_dq_drv = <PHY_DRV_ODT_40>;
  170. rockchip,phy_lpddr3_odt = <PHY_DRV_ODT_240>;
  171. rockchip,lpddr4_odt_dis_freq = <333>;
  172. rockchip,lpddr4_drv = <LP4_PDDS_60ohm>;
  173. rockchip,lpddr4_dq_odt = <LP4_DQ_ODT_40ohm>;
  174. rockchip,lpddr4_ca_odt = <LP4_CA_ODT_40ohm>;
  175. rockchip,phy_lpddr4_ca_drv = <PHY_DRV_ODT_40>;
  176. rockchip,phy_lpddr4_ck_cs_drv = <PHY_DRV_ODT_80>;
  177. rockchip,phy_lpddr4_dq_drv = <PHY_DRV_ODT_80>;
  178. rockchip,phy_lpddr4_odt = <PHY_DRV_ODT_60>;
  179. };