usb-connector.yaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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. sink-wait-cap-time-ms:
  214. description: Represents the max time in ms that USB Type-C port (in sink
  215. role) should wait for the port partner (source role) to send source caps.
  216. SinkWaitCap timer starts when port in sink role attaches to the source.
  217. This timer will stop when sink receives PD source cap advertisement before
  218. timeout in which case it'll move to capability negotiation stage. A
  219. timeout leads to a hard reset message by the port.
  220. minimum: 310
  221. maximum: 620
  222. default: 310
  223. ps-source-off-time-ms:
  224. description: Represents the max time in ms that a DRP in source role should
  225. take to turn off power after the PsSourceOff timer starts. PsSourceOff
  226. timer starts when a sink's PHY layer receives EOP of the GoodCRC message
  227. (corresponding to an Accept message sent in response to a PR_Swap or a
  228. FR_Swap request). This timer stops when last bit of GoodCRC EOP
  229. corresponding to the received PS_RDY message is transmitted by the PHY
  230. layer. A timeout shall lead to error recovery in the type-c port.
  231. minimum: 750
  232. maximum: 920
  233. default: 920
  234. cc-debounce-time-ms:
  235. description: Represents the max time in ms that a port shall wait to
  236. determine if it's attached to a partner.
  237. minimum: 100
  238. maximum: 200
  239. default: 200
  240. sink-bc12-completion-time-ms:
  241. description: Represents the max time in ms that a port in sink role takes
  242. to complete Battery Charger (BC1.2) Detection. BC1.2 detection is a
  243. hardware mechanism, which in some TCPC implementations, can run in
  244. parallel once the Type-C connection state machine reaches the "potential
  245. connect as sink" state. In TCPCs where this causes delays to respond to
  246. the incoming PD messages, sink-bc12-completion-time-ms is used to delay
  247. PD negotiation till BC1.2 detection completes.
  248. default: 0
  249. pd-revision:
  250. description: Specifies the maximum USB PD revision and version supported by
  251. the connector. This property is specified in the following order;
  252. <revision_major, revision_minor, version_major, version_minor>.
  253. $ref: /schemas/types.yaml#/definitions/uint8-array
  254. maxItems: 4
  255. dependencies:
  256. pd-disable: [typec-power-opmode]
  257. sink-vdos-v1: [ sink-vdos ]
  258. sink-vdos: [ sink-vdos-v1 ]
  259. required:
  260. - compatible
  261. $defs:
  262. capabilities:
  263. type: object
  264. properties:
  265. source-pdos:
  266. description: An array of u32 with each entry providing supported power
  267. source data object(PDO), the detailed bit definitions of PDO can be found
  268. in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2
  269. Source_Capabilities Message, the order of each entry(PDO) should follow
  270. the PD spec chapter 6.4.1. Required for power source and power dual role.
  271. User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO()
  272. defined in dt-bindings/usb/pd.h.
  273. minItems: 1
  274. maxItems: 7
  275. $ref: /schemas/types.yaml#/definitions/uint32-array
  276. sink-pdos:
  277. description: An array of u32 with each entry providing supported power sink
  278. data object(PDO), the detailed bit definitions of PDO can be found in
  279. "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3
  280. Sink Capabilities Message, the order of each entry(PDO) should follow the
  281. PD spec chapter 6.4.1. Required for power sink and power dual role. User
  282. can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined
  283. in dt-bindings/usb/pd.h.
  284. minItems: 1
  285. maxItems: 7
  286. $ref: /schemas/types.yaml#/definitions/uint32-array
  287. op-sink-microwatt:
  288. description: Sink required operating power in microwatt, if source can't
  289. offer the power, Capability Mismatch is set. Required for power sink and
  290. power dual role.
  291. allOf:
  292. - $ref: "#/$defs/capabilities"
  293. - if:
  294. properties:
  295. compatible:
  296. contains:
  297. const: gpio-usb-b-connector
  298. then:
  299. anyOf:
  300. - required:
  301. - vbus-gpios
  302. - required:
  303. - id-gpios
  304. - if:
  305. properties:
  306. compatible:
  307. contains:
  308. const: samsung,usb-connector-11pin
  309. then:
  310. properties:
  311. type:
  312. const: micro
  313. anyOf:
  314. - not:
  315. required:
  316. - typec-power-opmode
  317. - new-source-frs-typec-current
  318. unevaluatedProperties: false
  319. examples:
  320. # Micro-USB connector with HS lines routed via controller (MUIC).
  321. - |
  322. muic-max77843 {
  323. usb_con1: connector {
  324. compatible = "usb-b-connector";
  325. label = "micro-USB";
  326. type = "micro";
  327. };
  328. };
  329. # USB-C connector attached to CC controller (s2mm005), HS lines routed
  330. # to companion PMIC (max77865), SS lines to USB3 PHY and SBU to DisplayPort.
  331. # DisplayPort video lines are routed to the connector via SS mux in USB3 PHY.
  332. - |
  333. ccic: s2mm005 {
  334. usb_con2: connector {
  335. compatible = "usb-c-connector";
  336. label = "USB-C";
  337. altmodes {
  338. displayport {
  339. svid = /bits/ 16 <0xff01>;
  340. vdo = <0x00001c46>;
  341. };
  342. };
  343. ports {
  344. #address-cells = <1>;
  345. #size-cells = <0>;
  346. port@0 {
  347. reg = <0>;
  348. usb_con_hs: endpoint {
  349. remote-endpoint = <&max77865_usbc_hs>;
  350. };
  351. };
  352. port@1 {
  353. reg = <1>;
  354. usb_con_ss: endpoint {
  355. remote-endpoint = <&usbdrd_phy_ss>;
  356. };
  357. };
  358. port@2 {
  359. reg = <2>;
  360. usb_con_sbu: endpoint {
  361. remote-endpoint = <&dp_aux>;
  362. };
  363. };
  364. };
  365. };
  366. };
  367. # USB-C connector attached to a typec port controller(ptn5110), which has
  368. # power delivery support, explicitly defines time properties and enables drp.
  369. - |
  370. #include <dt-bindings/usb/pd.h>
  371. typec: ptn5110 {
  372. usb_con3: connector {
  373. compatible = "usb-c-connector";
  374. label = "USB-C";
  375. power-role = "dual";
  376. try-power-role = "sink";
  377. source-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
  378. sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)
  379. PDO_VAR(5000, 12000, 2000)>;
  380. op-sink-microwatt = <10000000>;
  381. sink-wait-cap-time-ms = <465>;
  382. ps-source-off-time-ms = <835>;
  383. cc-debounce-time-ms = <101>;
  384. sink-bc12-completion-time-ms = <500>;
  385. };
  386. };
  387. # USB-C connector attached to SoC with a single High-Speed controller
  388. - |
  389. connector {
  390. compatible = "usb-c-connector";
  391. label = "USB-C";
  392. port {
  393. high_speed_ep: endpoint {
  394. remote-endpoint = <&usb_hs_ep>;
  395. };
  396. };
  397. };
  398. # USB-C connector attached to SoC and USB3 typec port controller(hd3ss3220)
  399. # with SS 2:1 MUX. HS lines routed to SoC, SS lines routed to the MUX and
  400. # the output of MUX is connected to the SoC.
  401. - |
  402. connector {
  403. compatible = "usb-c-connector";
  404. label = "USB-C";
  405. data-role = "dual";
  406. ports {
  407. #address-cells = <1>;
  408. #size-cells = <0>;
  409. port@0 {
  410. reg = <0>;
  411. hs_ep: endpoint {
  412. remote-endpoint = <&usb3_hs_ep>;
  413. };
  414. };
  415. port@1 {
  416. reg = <1>;
  417. ss_ep: endpoint {
  418. remote-endpoint = <&hd3ss3220_in_ep>;
  419. };
  420. };
  421. };
  422. };
  423. # USB connector with GPIO control lines
  424. - |
  425. #include <dt-bindings/gpio/gpio.h>
  426. usb {
  427. connector {
  428. compatible = "gpio-usb-b-connector", "usb-b-connector";
  429. type = "micro";
  430. id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
  431. vbus-supply = <&usb_p0_vbus>;
  432. };
  433. };
  434. # Micro-USB connector with HS lines routed via controller (MUIC) and MHL
  435. # lines connected to HDMI-MHL bridge (sii8620) on Samsung Exynos5433-based
  436. # mobile phone
  437. - |
  438. muic-max77843 {
  439. usb_con4: connector {
  440. compatible = "samsung,usb-connector-11pin", "usb-b-connector";
  441. label = "micro-USB";
  442. type = "micro";
  443. ports {
  444. #address-cells = <1>;
  445. #size-cells = <0>;
  446. port@0 {
  447. reg = <0>;
  448. muic_to_usb: endpoint {
  449. remote-endpoint = <&usb_to_muic>;
  450. };
  451. };
  452. port@3 {
  453. reg = <3>;
  454. usb_con_mhl: endpoint {
  455. remote-endpoint = <&sii8620_mhl>;
  456. };
  457. };
  458. };
  459. };
  460. };