ufshcd-pltfrm.txt 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. * Universal Flash Storage (UFS) Host Controller
  2. UFSHC nodes are defined to describe on-chip UFS host controllers.
  3. Each UFS controller instance should have its own node.
  4. Required properties:
  5. - compatible : must contain "jedec,ufs-1.1", may also list one or more
  6. of the following:
  7. "qcom,msm8994-ufshc"
  8. "qcom,msm8996-ufshc"
  9. "qcom,ufshc"
  10. - interrupts : <interrupt mapping for UFS host controller IRQ>
  11. - reg : <registers mapping>
  12. first entry should contain UFS host controller register address space (mandatory),
  13. second entry is the device ref. clock control register map (optional).
  14. - reset : reset specifier pair consists of phandle for the reset provider
  15. and reset lines used by this controller.
  16. - reset-names : reset signal name strings sorted in the same order as the resets property.
  17. Optional properties:
  18. - phys : phandle to UFS PHY node
  19. - phy-names : the string "ufsphy" when is found in a node, along
  20. with "phys" attribute, provides phandle to UFS PHY node
  21. - vdd-hba-supply : phandle to UFS host controller supply regulator node
  22. - vcc-supply : phandle to VCC supply regulator node
  23. - vcc-voltage-level : specifies voltage levels for VCC supply.
  24. Should be specified in pairs (min, max), units uV.
  25. - vccq-supply : phandle to VCCQ supply regulator node
  26. - vccq2-supply : phandle to VCCQ2 supply regulator node
  27. - vcc-supply-1p8 : For embedded UFS devices, valid VCC range is 1.7-1.95V
  28. or 2.7-3.6V. This boolean property when set, specifies
  29. to use low voltage range of 1.7-1.95V. Note for external
  30. UFS cards this property is invalid and valid VCC range is
  31. always 2.7-3.6V.
  32. - vcc-max-microamp : specifies max. load that can be drawn from vcc supply
  33. - vccq-max-microamp : specifies max. load that can be drawn from vccq supply
  34. - vccq2-max-microamp : specifies max. load that can be drawn from vccq2 supply
  35. - <name>-fixed-regulator : boolean property specifying that <name>-supply is a fixed regulator
  36. - clocks : List of phandle and clock specifier pairs
  37. - clock-names : List of clock input name strings sorted in the same
  38. order as the clocks property.
  39. - freq-table-hz : Array of <min max> operating frequencies stored in the same
  40. order as the clocks property. If this property is not
  41. defined or a value in the array is "0" then it is assumed
  42. that the frequency is set by the parent clock or a
  43. fixed rate clock source.
  44. - rpm-level : UFS Runtime power management level. Following PM levels are suppported:
  45. 0 - Both UFS device and Link in active state (Highest power consumption)
  46. 1 - UFS device in active state but Link in Hibern8 state
  47. 2 - UFS device in Sleep state but Link in active state
  48. 3 - UFS device in Sleep state and Link in hibern8 state (default PM level)
  49. 4 - UFS device in Power-down state and Link in Hibern8 state
  50. 5 - UFS device in Power-down state and Link in OFF state (Lowest power consumption)
  51. - spm-level : UFS System power management level. Allowed PM levels are same as rpm-level.
  52. - ufs-qcom-crypto : phandle to UFS-QCOM ICE (Inline Cryptographic Engine) node
  53. - lanes-per-direction: number of lanes available per direction - either 1 or 2.
  54. Note that it is assume same number of lanes is used both directions at once.
  55. If not specified, default is 2 lanes per direction.
  56. - pinctrl-names, pinctrl-0, pinctrl-1,.. pinctrl-n: Refer to "Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt"
  57. for these optional properties
  58. - limit-tx-hs-gear : Specify the max. limit on the TX HS gear.
  59. Valid range: 1-3. 1 => HS-G1, 2 => HS-G2, 3 => HS-G3
  60. - limit-rx-hs-gear : Specify the max. limit on the RX HS gear. Refer "limit-tx-hs-gear" for expected values.
  61. - limit-tx-pwm-gear : Specify the max. limit on the TX PWM gear
  62. Valid range: 1-4. 1 => PWM-G1, 2 => PWM-G2, 3 => PWM-G3, 4 => PWM-G4
  63. - limit-rx-pwm-gear : Specify the max. limit on the RX PWM gear. Refer "limit-tx-pwm-gear" for expected values.
  64. - scsi-cmd-timeout : Specify the command timeout (in seconds) for scsi commands
  65. - dev-ref-clk-freq : Specify the device reference clock frequency, must be one of the following:
  66. 0: 19.2 MHz
  67. 1: 26 MHz
  68. 2: 38.4 MHz
  69. 3: 52 MHz
  70. Defaults to 26 MHz if not specified.
  71. - extcon: phandle to external connector (Refer Documentation/devicetree/bindings/extcon/extcon-gpio.txt for more details).
  72. - non-removable : defines if the connected ufs device is not removable
  73. Note: If above properties are not defined it can be assumed that the supply
  74. regulators or clocks are always on.
  75. Example:
  76. ufshc@0xfc598000 {
  77. compatible = "jedec,ufs-1.1";
  78. reg = <0xfc598000 0x800>, <0xfd512074 0x4>;
  79. interrupts = <0 28 0>;
  80. ufs-qcom-crypto = <&ufs_ice>;
  81. vdd-hba-supply = <&xxx_reg0>;
  82. vdd-hba-fixed-regulator;
  83. vcc-supply = <&xxx_reg1>;
  84. vcc-supply-1p8;
  85. vccq-supply = <&xxx_reg2>;
  86. vccq2-supply = <&xxx_reg3>;
  87. vcc-max-microamp = 500000;
  88. vccq-max-microamp = 200000;
  89. vccq2-max-microamp = 200000;
  90. clocks = <&core 0>, <&ref 0>, <&iface 0>;
  91. clock-names = "core_clk", "ref_clk", "iface_clk";
  92. freq-table-hz = <100000000 200000000>, <0 0>, <0 0>;
  93. resets = <clock_gcc GCC_UFS_BCR>;
  94. reset-names = "core_reset";
  95. phys = <&ufsphy1>;
  96. phy-names = "ufsphy";
  97. rpm-level = <3>;
  98. spm-level = <5>;
  99. dev-ref-clk-freq = <0>; /* reference clock freq: 19.2 MHz */
  100. };
  101. ==== MSM UFS platform driver properties =====
  102. * For UFS host controller in MSM platform following clocks are required -
  103. Controller clock source -
  104. "core_clk_src", max-clock-frequency-hz = 200MHz
  105. Controller System clock branch:
  106. "core_clk" - Controller core clock
  107. AHB/AXI interface clocks:
  108. "iface_clk" - AHB interface clock
  109. "bus_clk" - AXI bus master clock
  110. PHY to controller symbol synchronization clocks:
  111. "rx_lane0_sync_clk" - RX Lane 0
  112. "rx_lane1_sync_clk" - RX Lane 1
  113. "tx_lane0_sync_clk" - TX Lane 0
  114. "tx_lane1_sync_clk" - TX Lane 1
  115. Optional reference clock input to UFS device
  116. "ref_clk", max-clock-frequency-hz = 19.2MHz
  117. * Following bus parameters are required -
  118. - qcom,msm-bus,name
  119. - qcom,msm-bus,num-cases
  120. - qcom,msm-bus,num-paths
  121. - qcom,msm-bus,vectors-KBps
  122. For the above four properties please refer to
  123. Documentation/devicetree/bindings/arm/msm/msm_bus.txt
  124. Note: The instantaneous bandwidth (IB) value in the vectors-KBps field should
  125. be zero as UFS data transfer path doesn't have latency requirements and
  126. voting for aggregated bandwidth (AB) should take care of providing
  127. optimum throughput requested.
  128. - qcom,bus-vector-names: specifies string IDs for the corresponding
  129. bus vectors in the same order as qcom,msm-bus,vectors-KBps property.
  130. * The following parameters are optional, but required in order for PM QoS to be
  131. enabled and functional in the driver:
  132. - qcom,pm-qos-cpu-groups: arrays of unsigned integers representing the cpu groups.
  133. The number of values in the array defines the number of cpu-groups.
  134. Each value is a bit-mask defining the cpus that take part in that cpu group.
  135. i.e. if bit N is set, then cpuN is a part of the cpu group. So basically,
  136. a cpu group corelated to a cpu cluster.
  137. A PM QoS request object is maintained for each cpu-group.
  138. - qcom,pm-qos-cpu-group-latency-us: array of values used for PM QoS voting, one for each cpu-group defined.
  139. the number of values must match the number of values defined in
  140. qcom,pm-qos-cpu-mask property.
  141. - qcom,pm-qos-default-cpu: PM QoS voting is based on the cpu associated with each IO request by the block layer.
  142. This defined the default cpu used for PM QoS voting in case a specific cpu value is not available.
  143. - qcom,vddp-ref-clk-supply : reference clock to ufs device. Controlled by the host driver.
  144. - qcom,vddp-ref-clk-max-microamp : specifies max. load that can be drawn for
  145. ref-clk supply.
  146. Example:
  147. ufshc@0xfc598000 {
  148. ...
  149. qcom,msm-bus,name = "ufs1";
  150. qcom,msm-bus,num-cases = <22>;
  151. qcom,msm-bus,num-paths = <2>;
  152. qcom,msm-bus,vectors-KBps =
  153. <95 512 0 0>, <1 650 0 0>, /* No vote */
  154. <95 512 922 0>, <1 650 1000 0>, /* PWM G1 */
  155. <95 512 1844 0>, <1 650 1000 0>, /* PWM G2 */
  156. <95 512 3688 0>, <1 650 1000 0>, /* PWM G3 */
  157. <95 512 7376 0>, <1 650 1000 0>, /* PWM G4 */
  158. <95 512 1844 0>, <1 650 1000 0>, /* PWM G1 L2 */
  159. <95 512 3688 0>, <1 650 1000 0>, /* PWM G2 L2 */
  160. <95 512 7376 0>, <1 650 1000 0>, /* PWM G3 L2 */
  161. <95 512 14752 0>, <1 650 1000 0>, /* PWM G4 L2 */
  162. <95 512 127796 0>, <1 650 1000 0>, /* HS G1 RA */
  163. <95 512 255591 0>, <1 650 1000 0>, /* HS G2 RA */
  164. <95 512 511181 0>, <1 650 1000 0>, /* HS G3 RA */
  165. <95 512 255591 0>, <1 650 1000 0>, /* HS G1 RA L2 */
  166. <95 512 511181 0>, <1 650 1000 0>, /* HS G2 RA L2 */
  167. <95 512 1022362 0>, <1 650 1000 0>, /* HS G3 RA L2 */
  168. <95 512 149422 0>, <1 650 1000 0>, /* HS G1 RB */
  169. <95 512 298189 0>, <1 650 1000 0>, /* HS G2 RB */
  170. <95 512 596378 0>, <1 650 1000 0>, /* HS G3 RB */
  171. <95 512 298189 0>, <1 650 1000 0>, /* HS G1 RB L2 */
  172. <95 512 596378 0>, <1 650 1000 0>, /* HS G2 RB L2 */
  173. <95 512 1192756 0>, <1 650 1000 0>, /* HS G3 RB L2 */
  174. <95 512 4096000 0>, <1 650 1000 0>; /* Max. bandwidth */
  175. qcom,bus-vector-names = "MIN",
  176. "PWM_G1_L1", "PWM_G2_L1", "PWM_G3_L1", "PWM_G4_L1",
  177. "PWM_G1_L2", "PWM_G2_L2", "PWM_G3_L2", "PWM_G4_L2",
  178. "HS_RA_G1_L1", "HS_RA_G2_L1", "HS_RA_G3_L1",
  179. "HS_RA_G1_L2", "HS_RA_G2_L2", "HS_RA_G3_L2",
  180. "HS_RB_G1_L1", "HS_RB_G2_L1", "HS_RB_G3_L1",
  181. "HS_RB_G1_L2", "HS_RB_G2_L2", "HS_RB_G3_L2",
  182. "MAX";
  183. qcom,pm-qos-cpu-groups = <0x03 0x0C>; /* group0: cpu0, cpu1, group1: cpu2, cpu3 */
  184. qcom,pm-qos-cpu-group-latency-us = <200 300>; /* group0: 200us, group1: 300us */
  185. qcom,pm-qos-default-cpu = <0>;
  186. };