mediatek,tphy.yaml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. # Copyright (c) 2020 MediaTek
  3. %YAML 1.2
  4. ---
  5. $id: http://devicetree.org/schemas/phy/mediatek,tphy.yaml#
  6. $schema: http://devicetree.org/meta-schemas/core.yaml#
  7. title: MediaTek T-PHY Controller
  8. maintainers:
  9. - Chunfeng Yun <chunfeng.yun@mediatek.com>
  10. description: |
  11. The T-PHY controller supports physical layer functionality for a number of
  12. controllers on MediaTek SoCs, includes USB2.0, USB3.0, PCIe and SATA.
  13. Layout differences of banks between T-PHY V1 (mt8173/mt2701) and
  14. T-PHY V2 (mt2712) / V3 (mt8195) when works on USB mode:
  15. -----------------------------------
  16. Version 1:
  17. port offset bank
  18. shared 0x0000 SPLLC
  19. 0x0100 FMREG
  20. u2 port0 0x0800 U2PHY_COM
  21. u3 port0 0x0900 U3PHYD
  22. 0x0a00 U3PHYD_BANK2
  23. 0x0b00 U3PHYA
  24. 0x0c00 U3PHYA_DA
  25. u2 port1 0x1000 U2PHY_COM
  26. u3 port1 0x1100 U3PHYD
  27. 0x1200 U3PHYD_BANK2
  28. 0x1300 U3PHYA
  29. 0x1400 U3PHYA_DA
  30. u2 port2 0x1800 U2PHY_COM
  31. ...
  32. Version 2/3:
  33. port offset bank
  34. u2 port0 0x0000 MISC
  35. 0x0100 FMREG
  36. 0x0300 U2PHY_COM
  37. u3 port0 0x0700 SPLLC
  38. 0x0800 CHIP
  39. 0x0900 U3PHYD
  40. 0x0a00 U3PHYD_BANK2
  41. 0x0b00 U3PHYA
  42. 0x0c00 U3PHYA_DA
  43. u2 port1 0x1000 MISC
  44. 0x1100 FMREG
  45. 0x1300 U2PHY_COM
  46. u3 port1 0x1700 SPLLC
  47. 0x1800 CHIP
  48. 0x1900 U3PHYD
  49. 0x1a00 U3PHYD_BANK2
  50. 0x1b00 U3PHYA
  51. 0x1c00 U3PHYA_DA
  52. u2 port2 0x2000 MISC
  53. ...
  54. SPLLC shared by u3 ports and FMREG shared by u2 ports on V1 are put back
  55. into each port; a new bank MISC for u2 ports and CHIP for u3 ports are
  56. added on V2; the FMREG bank for slew rate calibration is not used anymore
  57. and reserved on V3;
  58. properties:
  59. $nodename:
  60. pattern: "^t-phy(@[0-9a-f]+)?$"
  61. compatible:
  62. oneOf:
  63. - items:
  64. - enum:
  65. - mediatek,mt2701-tphy
  66. - mediatek,mt7623-tphy
  67. - mediatek,mt7622-tphy
  68. - mediatek,mt8516-tphy
  69. - const: mediatek,generic-tphy-v1
  70. - items:
  71. - enum:
  72. - mediatek,mt2712-tphy
  73. - mediatek,mt7629-tphy
  74. - mediatek,mt7986-tphy
  75. - mediatek,mt8183-tphy
  76. - mediatek,mt8186-tphy
  77. - mediatek,mt8192-tphy
  78. - mediatek,mt8365-tphy
  79. - const: mediatek,generic-tphy-v2
  80. - items:
  81. - enum:
  82. - mediatek,mt8188-tphy
  83. - mediatek,mt8195-tphy
  84. - const: mediatek,generic-tphy-v3
  85. - const: mediatek,mt2701-u3phy
  86. deprecated: true
  87. - const: mediatek,mt2712-u3phy
  88. deprecated: true
  89. - const: mediatek,mt8173-u3phy
  90. reg:
  91. description:
  92. Register shared by multiple ports, exclude port's private register.
  93. It is needed for T-PHY V1, such as mt2701 and mt8173, but not for
  94. T-PHY V2/V3, such as mt2712.
  95. maxItems: 1
  96. "#address-cells":
  97. enum: [1, 2]
  98. "#size-cells":
  99. enum: [1, 2]
  100. # Used with non-empty value if optional 'reg' is not provided.
  101. # The format of the value is an arbitrary number of triplets of
  102. # (child-bus-address, parent-bus-address, length).
  103. ranges: true
  104. mediatek,src-ref-clk-mhz:
  105. description:
  106. Frequency of reference clock for slew rate calibrate
  107. default: 26
  108. mediatek,src-coef:
  109. description:
  110. Coefficient for slew rate calibrate, depends on SoC process
  111. $ref: /schemas/types.yaml#/definitions/uint32
  112. default: 28
  113. # Required child node:
  114. patternProperties:
  115. "^(usb|pcie|sata)-phy@[0-9a-f]+$":
  116. type: object
  117. description:
  118. A sub-node is required for each port the controller provides.
  119. Address range information including the usual 'reg' property
  120. is used inside these nodes to describe the controller's topology.
  121. properties:
  122. reg:
  123. maxItems: 1
  124. clocks:
  125. minItems: 1
  126. items:
  127. - description: Reference clock, (HS is 48Mhz, SS/P is 24~27Mhz)
  128. - description: Reference clock of analog phy
  129. description:
  130. Uses both clocks if the clock of analog and digital phys are
  131. separated, otherwise uses "ref" clock only if needed.
  132. clock-names:
  133. minItems: 1
  134. items:
  135. - const: ref
  136. - const: da_ref
  137. "#phy-cells":
  138. const: 1
  139. description: |
  140. The cells contain the following arguments.
  141. - description: The PHY type
  142. enum:
  143. - PHY_TYPE_USB2
  144. - PHY_TYPE_USB3
  145. - PHY_TYPE_PCIE
  146. - PHY_TYPE_SATA
  147. - PHY_TYPE_SGMII
  148. nvmem-cells:
  149. items:
  150. - description: internal R efuse for U2 PHY or U3/PCIe PHY
  151. - description: rx_imp_sel efuse for U3/PCIe PHY
  152. - description: tx_imp_sel efuse for U3/PCIe PHY
  153. description: |
  154. Phandles to nvmem cell that contains the efuse data;
  155. Available only for U2 PHY or U3/PCIe PHY of version 2/3, these
  156. three items should be provided at the same time for U3/PCIe PHY,
  157. when use software to load efuse;
  158. If unspecified, will use hardware auto-load efuse.
  159. nvmem-cell-names:
  160. items:
  161. - const: intr
  162. - const: rx_imp
  163. - const: tx_imp
  164. # The following optional vendor properties are only for debug or HQA test
  165. mediatek,eye-src:
  166. description:
  167. The value of slew rate calibrate (U2 phy)
  168. $ref: /schemas/types.yaml#/definitions/uint32
  169. minimum: 1
  170. maximum: 7
  171. mediatek,eye-vrt:
  172. description:
  173. The selection of VRT reference voltage (U2 phy)
  174. $ref: /schemas/types.yaml#/definitions/uint32
  175. minimum: 1
  176. maximum: 7
  177. mediatek,eye-term:
  178. description:
  179. The selection of HS_TX TERM reference voltage (U2 phy)
  180. $ref: /schemas/types.yaml#/definitions/uint32
  181. minimum: 1
  182. maximum: 7
  183. mediatek,intr:
  184. description:
  185. The selection of internal resistor (U2 phy)
  186. $ref: /schemas/types.yaml#/definitions/uint32
  187. minimum: 1
  188. maximum: 31
  189. mediatek,discth:
  190. description:
  191. The selection of disconnect threshold (U2 phy)
  192. $ref: /schemas/types.yaml#/definitions/uint32
  193. minimum: 1
  194. maximum: 15
  195. mediatek,pre-emphasis:
  196. description:
  197. The level of pre-emphasis which used to widen the eye opening and
  198. boost eye swing, the unit step is about 4.16% increment; e.g. the
  199. level 1 means amplitude increases about 4.16%, the level 2 is about
  200. 8.3% etc. (U2 phy)
  201. $ref: /schemas/types.yaml#/definitions/uint32
  202. minimum: 1
  203. maximum: 3
  204. mediatek,bc12:
  205. description:
  206. Specify the flag to enable BC1.2 if support it
  207. type: boolean
  208. mediatek,force-mode:
  209. description:
  210. The force mode is used to manually switch the shared phy mode between
  211. USB3 and PCIe, when USB3 phy type is selected by the consumer, and
  212. force-mode is set, will cause phy's power and pipe toggled and force
  213. phy as USB3 mode which switched from default PCIe mode. But prefer to
  214. use the property "mediatek,syscon-type" for newer SoCs that support it.
  215. type: boolean
  216. mediatek,syscon-type:
  217. $ref: /schemas/types.yaml#/definitions/phandle-array
  218. maxItems: 1
  219. description:
  220. A phandle to syscon used to access the register of type switch,
  221. the field should always be 3 cells long.
  222. items:
  223. items:
  224. - description:
  225. The first cell represents a phandle to syscon
  226. - description:
  227. The second cell represents the register offset
  228. - description:
  229. The third cell represents the index of config segment
  230. enum: [0, 1, 2, 3]
  231. required:
  232. - reg
  233. - "#phy-cells"
  234. additionalProperties: false
  235. required:
  236. - compatible
  237. - "#address-cells"
  238. - "#size-cells"
  239. - ranges
  240. additionalProperties: false
  241. examples:
  242. - |
  243. #include <dt-bindings/clock/mt8173-clk.h>
  244. #include <dt-bindings/interrupt-controller/arm-gic.h>
  245. #include <dt-bindings/interrupt-controller/irq.h>
  246. #include <dt-bindings/phy/phy.h>
  247. usb@11271000 {
  248. compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3";
  249. reg = <0x11271000 0x3000>, <0x11280700 0x0100>;
  250. reg-names = "mac", "ippc";
  251. phys = <&u2port0 PHY_TYPE_USB2>,
  252. <&u3port0 PHY_TYPE_USB3>,
  253. <&u2port1 PHY_TYPE_USB2>;
  254. interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>;
  255. clocks = <&topckgen CLK_TOP_USB30_SEL>;
  256. clock-names = "sys_ck";
  257. };
  258. t-phy@11290000 {
  259. compatible = "mediatek,mt8173-u3phy";
  260. reg = <0x11290000 0x800>;
  261. #address-cells = <1>;
  262. #size-cells = <1>;
  263. ranges;
  264. u2port0: usb-phy@11290800 {
  265. reg = <0x11290800 0x100>;
  266. clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>, <&clk48m>;
  267. clock-names = "ref", "da_ref";
  268. #phy-cells = <1>;
  269. };
  270. u3port0: usb-phy@11290900 {
  271. reg = <0x11290900 0x700>;
  272. clocks = <&clk26m>;
  273. clock-names = "ref";
  274. #phy-cells = <1>;
  275. };
  276. u2port1: usb-phy@11291000 {
  277. reg = <0x11291000 0x100>;
  278. #phy-cells = <1>;
  279. };
  280. };
  281. ...