usb-connector.yaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/connector/usb-connector.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: USB Connector
  7. maintainers:
  8. - Rob Herring <robh@kernel.org>
  9. description:
  10. A USB connector node represents a physical USB connector. It should be a child
  11. of a USB interface controller or a separate node when it is attached to both
  12. MUX and USB interface controller.
  13. properties:
  14. compatible:
  15. oneOf:
  16. - enum:
  17. - usb-a-connector
  18. - usb-b-connector
  19. - usb-c-connector
  20. - items:
  21. - const: gpio-usb-b-connector
  22. - const: usb-b-connector
  23. - items:
  24. - const: samsung,usb-connector-11pin
  25. - const: usb-b-connector
  26. reg:
  27. maxItems: 1
  28. label:
  29. description: Symbolic name for the connector.
  30. type:
  31. description: Size of the connector, should be specified in case of
  32. non-fullsize 'usb-a-connector' or 'usb-b-connector' compatible
  33. connectors.
  34. $ref: /schemas/types.yaml#/definitions/string
  35. enum:
  36. - mini
  37. - micro
  38. self-powered:
  39. description: Set this property if the USB device has its own power source.
  40. type: boolean
  41. # The following are optional properties for "usb-b-connector".
  42. id-gpios:
  43. description: An input gpio for USB ID pin.
  44. maxItems: 1
  45. vbus-gpios:
  46. description: An input gpio for USB VBus pin, used to detect presence of
  47. VBUS 5V.
  48. maxItems: 1
  49. vbus-supply:
  50. description: A phandle to the regulator for USB VBUS if needed when host
  51. mode or dual role mode is supported.
  52. Particularly, if use an output GPIO to control a VBUS regulator, should
  53. model it as a regulator. See bindings/regulator/fixed-regulator.yaml
  54. power-role:
  55. description: Determines the power role that the Type C connector will
  56. support. "dual" refers to Dual Role Port (DRP).
  57. $ref: /schemas/types.yaml#/definitions/string
  58. enum:
  59. - source
  60. - sink
  61. - dual
  62. try-power-role:
  63. description: Preferred power role.
  64. $ref: /schemas/types.yaml#/definitions/string
  65. enum:
  66. - source
  67. - sink
  68. - dual
  69. data-role:
  70. description: Data role if Type C connector supports USB data. "dual" refers
  71. Dual Role Device (DRD).
  72. $ref: /schemas/types.yaml#/definitions/string
  73. enum:
  74. - host
  75. - device
  76. - dual
  77. typec-power-opmode:
  78. description: Determines the power operation mode that the Type C connector
  79. will support and will advertise through CC pins when it has no power
  80. delivery support.
  81. - "default" corresponds to default USB voltage and current defined by the
  82. USB 2.0 and USB 3.2 specifications, 5V 500mA for USB 2.0 ports and
  83. 5V 900mA or 1500mA for USB 3.2 ports in single-lane or dual-lane
  84. operation respectively.
  85. - "1.5A" and "3.0A", 5V 1.5A and 5V 3.0A respectively, as defined in USB
  86. Type-C Cable and Connector specification, when Power Delivery is not
  87. supported.
  88. $ref: /schemas/types.yaml#/definitions/string
  89. enum:
  90. - default
  91. - 1.5A
  92. - 3.0A
  93. pd-disable:
  94. description: Set this property if the Type-C connector has no power delivery support.
  95. type: boolean
  96. # The following are optional properties for "usb-c-connector" with power
  97. # delivery support.
  98. sink-vdos:
  99. description: An array of u32 with each entry, a Vendor Defined Message Object (VDO),
  100. providing additional information corresponding to the product, the detailed bit
  101. definitions and the order of each VDO can be found in
  102. "USB Power Delivery Specification Revision 3.0, Version 2.0 + ECNs 2020-12-10"
  103. chapter 6.4.4.3.1 Discover Identity. User can specify the VDO array via
  104. VDO_IDH/_CERT/_PRODUCT/_UFP/_DFP/_PCABLE/_ACABLE(1/2)/_VPD() defined in
  105. dt-bindings/usb/pd.h.
  106. minItems: 3
  107. maxItems: 6
  108. $ref: /schemas/types.yaml#/definitions/uint32-array
  109. sink-vdos-v1:
  110. description: An array of u32 with each entry, a Vendor Defined Message Object (VDO),
  111. providing additional information corresponding to the product, the detailed bit
  112. definitions and the order of each VDO can be found in
  113. "USB Power Delivery Specification Revision 2.0, Version 1.3" chapter 6.4.4.3.1 Discover
  114. Identity. User can specify the VDO array via VDO_IDH/_CERT/_PRODUCT/_CABLE/_AMA defined in
  115. dt-bindings/usb/pd.h.
  116. minItems: 3
  117. maxItems: 6
  118. $ref: /schemas/types.yaml#/definitions/uint32-array
  119. accessory-mode-audio:
  120. type: boolean
  121. description: Whether the device supports Audio Adapter Accessory Mode. This
  122. is only necessary if there are no other means to discover supported
  123. alternative modes (e.g. through the UCSI firmware interface).
  124. accessory-mode-debug:
  125. type: boolean
  126. description: Whether the device supports Debug Accessory Mode. This
  127. is only necessary if there are no other means to discover supported
  128. alternative modes (e.g. through the UCSI firmware interface).
  129. altmodes:
  130. type: object
  131. description: List of Alternative Modes supported by the schematics on the
  132. particular device. This is only necessary if there are no other means to
  133. discover supported alternative modes (e.g. through the UCSI firmware
  134. interface).
  135. additionalProperties: false
  136. patternProperties:
  137. "^(displayport)$":
  138. type: object
  139. description:
  140. A single USB-C Alternative Mode as supported by the USB-C connector logic.
  141. additionalProperties: false
  142. properties:
  143. svid:
  144. $ref: /schemas/types.yaml#/definitions/uint16
  145. description: Unique value assigned by USB-IF to the Vendor / AltMode.
  146. enum: [ 0xff01 ]
  147. vdo:
  148. $ref: /schemas/types.yaml#/definitions/uint32
  149. description: VDO returned by Discover Modes USB PD command.
  150. port:
  151. $ref: /schemas/graph.yaml#/properties/port
  152. description: OF graph bindings modeling a data bus to the connector, e.g.
  153. there is a single High Speed (HS) port present in this connector. If there
  154. is more than one bus (several port, with 'reg' property), they can be grouped
  155. under 'ports'.
  156. ports:
  157. $ref: /schemas/graph.yaml#/properties/ports
  158. description: OF graph bindings modeling any data bus to the connector
  159. unless the bus is between parent node and the connector. Since a single
  160. connector can have multiple data buses every bus has an assigned OF graph
  161. port number as described below.
  162. properties:
  163. port@0:
  164. $ref: /schemas/graph.yaml#/properties/port
  165. description: High Speed (HS), present in all connectors.
  166. port@1:
  167. $ref: /schemas/graph.yaml#/properties/port
  168. description: Super Speed (SS), present in SS capable connectors.
  169. port@2:
  170. $ref: /schemas/graph.yaml#/properties/port
  171. description: Sideband Use (SBU), present in USB-C. This describes the
  172. alternate mode connection of which SBU is a part.
  173. required:
  174. - port@0
  175. new-source-frs-typec-current:
  176. description: Initial current capability of the new source when vSafe5V
  177. is applied during PD3.0 Fast Role Swap. "Table 6-14 Fixed Supply PDO - Sink"
  178. of "USB Power Delivery Specification Revision 3.0, Version 1.2" provides the
  179. different power levels and "6.4.1.3.1.6 Fast Role Swap USB Type-C Current"
  180. provides a detailed description of the field. The sink PDO from current source
  181. reflects the current source's(i.e. transmitter of the FRS signal) power
  182. requirement during fr swap. The current sink (i.e. receiver of the FRS signal),
  183. a.k.a new source, should check if it will be able to satisfy the current source's,
  184. new sink's, requirement during frswap before enabling the frs signal reception.
  185. This property refers to maximum current capability that the current sink can
  186. satisfy. During FRS, VBUS voltage is at 5V, as the partners are in implicit
  187. contract, hence, the power level is only a function of the current capability.
  188. "1" refers to default USB power level as described by "Table 6-14 Fixed Supply PDO - Sink".
  189. "2" refers to 1.5A@5V.
  190. "3" refers to 3.0A@5V.
  191. $ref: /schemas/types.yaml#/definitions/uint32
  192. enum: [1, 2, 3]
  193. slow-charger-loop:
  194. description: Allows PMIC charger loops which are slow(i.e. cannot meet the 15ms deadline) to
  195. still comply to pSnkStby i.e Maximum power that can be consumed by sink while in Sink Standby
  196. state as defined in 7.4.2 Sink Electrical Parameters of USB Power Delivery Specification
  197. Revision 3.0, Version 1.2. When the property is set, the port requests pSnkStby(2.5W -
  198. 5V@500mA) upon entering SNK_DISCOVERY(instead of 3A or the 1.5A, Rp current advertised, during
  199. SNK_DISCOVERY) and the actual current limit after reception of PS_Ready for PD link or during
  200. SNK_READY for non-pd link.
  201. type: boolean
  202. capabilities:
  203. description: A child node to contain all the selectable USB Power Delivery capabilities.
  204. type: object
  205. patternProperties:
  206. "^caps-[0-9]+$":
  207. description: Child nodes under "capabilities" node. Each node contains a selectable USB
  208. Power Delivery capability.
  209. type: object
  210. $ref: "#/$defs/capabilities"
  211. unevaluatedProperties: false
  212. additionalProperties: false
  213. dependencies:
  214. sink-vdos-v1: [ sink-vdos ]
  215. sink-vdos: [ sink-vdos-v1 ]
  216. required:
  217. - compatible
  218. $defs:
  219. capabilities:
  220. type: object
  221. properties:
  222. source-pdos:
  223. description: An array of u32 with each entry providing supported power
  224. source data object(PDO), the detailed bit definitions of PDO can be found
  225. in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2
  226. Source_Capabilities Message, the order of each entry(PDO) should follow
  227. the PD spec chapter 6.4.1. Required for power source and power dual role.
  228. User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO()
  229. defined in dt-bindings/usb/pd.h.
  230. minItems: 1
  231. maxItems: 7
  232. $ref: /schemas/types.yaml#/definitions/uint32-array
  233. sink-pdos:
  234. description: An array of u32 with each entry providing supported power sink
  235. data object(PDO), the detailed bit definitions of PDO can be found in
  236. "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3
  237. Sink Capabilities Message, the order of each entry(PDO) should follow the
  238. PD spec chapter 6.4.1. Required for power sink and power dual role. User
  239. can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined
  240. in dt-bindings/usb/pd.h.
  241. minItems: 1
  242. maxItems: 7
  243. $ref: /schemas/types.yaml#/definitions/uint32-array
  244. op-sink-microwatt:
  245. description: Sink required operating power in microwatt, if source can't
  246. offer the power, Capability Mismatch is set. Required for power sink and
  247. power dual role.
  248. allOf:
  249. - $ref: "#/$defs/capabilities"
  250. - if:
  251. properties:
  252. compatible:
  253. contains:
  254. const: gpio-usb-b-connector
  255. then:
  256. anyOf:
  257. - required:
  258. - vbus-gpios
  259. - required:
  260. - id-gpios
  261. - if:
  262. properties:
  263. compatible:
  264. contains:
  265. const: samsung,usb-connector-11pin
  266. then:
  267. properties:
  268. type:
  269. const: micro
  270. anyOf:
  271. - not:
  272. required:
  273. - typec-power-opmode
  274. - new-source-frs-typec-current
  275. unevaluatedProperties: false
  276. examples:
  277. # Micro-USB connector with HS lines routed via controller (MUIC).
  278. - |
  279. muic-max77843 {
  280. usb_con1: connector {
  281. compatible = "usb-b-connector";
  282. label = "micro-USB";
  283. type = "micro";
  284. };
  285. };
  286. # USB-C connector attached to CC controller (s2mm005), HS lines routed
  287. # to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort.
  288. # DisplayPort video lines are routed to the connector via SS mux in USB3 PHY.
  289. - |
  290. ccic: s2mm005 {
  291. usb_con2: connector {
  292. compatible = "usb-c-connector";
  293. label = "USB-C";
  294. altmodes {
  295. displayport {
  296. svid = /bits/ 16 <0xff01>;
  297. vdo = <0x00001c46>;
  298. };
  299. };
  300. ports {
  301. #address-cells = <1>;
  302. #size-cells = <0>;
  303. port@0 {
  304. reg = <0>;
  305. usb_con_hs: endpoint {
  306. remote-endpoint = <&max77865_usbc_hs>;
  307. };
  308. };
  309. port@1 {
  310. reg = <1>;
  311. usb_con_ss: endpoint {
  312. remote-endpoint = <&usbdrd_phy_ss>;
  313. };
  314. };
  315. port@2 {
  316. reg = <2>;
  317. usb_con_sbu: endpoint {
  318. remote-endpoint = <&dp_aux>;
  319. };
  320. };
  321. };
  322. };
  323. };
  324. # USB-C connector attached to a typec port controller(ptn5110), which has
  325. # power delivery support and enables drp.
  326. - |
  327. #include <dt-bindings/usb/pd.h>
  328. typec: ptn5110 {
  329. usb_con3: connector {
  330. compatible = "usb-c-connector";
  331. label = "USB-C";
  332. power-role = "dual";
  333. try-power-role = "sink";
  334. source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
  335. sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)
  336. PDO_VAR(5000, 12000, 2000)>;
  337. op-sink-microwatt = <10000000>;
  338. };
  339. };
  340. # USB-C connector attached to SoC with a single High-Speed controller
  341. - |
  342. connector {
  343. compatible = "usb-c-connector";
  344. label = "USB-C";
  345. port {
  346. high_speed_ep: endpoint {
  347. remote-endpoint = <&usb_hs_ep>;
  348. };
  349. };
  350. };
  351. # USB-C connector attached to SoC and USB3 typec port controller(hd3ss3220)
  352. # with SS 2:1 MUX. HS lines routed to SoC, SS lines routed to the MUX and
  353. # the output of MUX is connected to the SoC.
  354. - |
  355. connector {
  356. compatible = "usb-c-connector";
  357. label = "USB-C";
  358. data-role = "dual";
  359. ports {
  360. #address-cells = <1>;
  361. #size-cells = <0>;
  362. port@0 {
  363. reg = <0>;
  364. hs_ep: endpoint {
  365. remote-endpoint = <&usb3_hs_ep>;
  366. };
  367. };
  368. port@1 {
  369. reg = <1>;
  370. ss_ep: endpoint {
  371. remote-endpoint = <&hd3ss3220_in_ep>;
  372. };
  373. };
  374. };
  375. };
  376. # USB connector with GPIO control lines
  377. - |
  378. #include <dt-bindings/gpio/gpio.h>
  379. usb {
  380. connector {
  381. compatible = "gpio-usb-b-connector", "usb-b-connector";
  382. type = "micro";
  383. id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
  384. vbus-supply = <&usb_p0_vbus>;
  385. };
  386. };
  387. # Micro-USB connector with HS lines routed via controller (MUIC) and MHL
  388. # lines connected to HDMI-MHL bridge (sii8620) on Samsung Exynos5433-based
  389. # mobile phone
  390. - |
  391. muic-max77843 {
  392. usb_con4: connector {
  393. compatible = "samsung,usb-connector-11pin", "usb-b-connector";
  394. label = "micro-USB";
  395. type = "micro";
  396. ports {
  397. #address-cells = <1>;
  398. #size-cells = <0>;
  399. port@0 {
  400. reg = <0>;
  401. muic_to_usb: endpoint {
  402. remote-endpoint = <&usb_to_muic>;
  403. };
  404. };
  405. port@3 {
  406. reg = <3>;
  407. usb_con_mhl: endpoint {
  408. remote-endpoint = <&sii8620_mhl>;
  409. };
  410. };
  411. };
  412. };
  413. };