xref: /freebsd/sys/contrib/device-tree/Bindings/usb/usb-device.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
25def4c47SEmmanuel Vadot%YAML 1.2
35def4c47SEmmanuel Vadot---
45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/usb/usb-device.yaml#
55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65def4c47SEmmanuel Vadot
7*8bab661aSEmmanuel Vadottitle: Generic USB Device
85def4c47SEmmanuel Vadot
95def4c47SEmmanuel Vadotmaintainers:
105def4c47SEmmanuel Vadot  - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
115def4c47SEmmanuel Vadot
125def4c47SEmmanuel Vadotdescription: |
135def4c47SEmmanuel Vadot  Usually, we only use device tree for hard wired USB device.
145def4c47SEmmanuel Vadot  The reference binding doc is from:
155def4c47SEmmanuel Vadot  http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
165def4c47SEmmanuel Vadot
175def4c47SEmmanuel Vadot  Four types of device-tree nodes are defined: "host-controller nodes"
185def4c47SEmmanuel Vadot  representing USB host controllers, "device nodes" representing USB devices,
195def4c47SEmmanuel Vadot  "interface nodes" representing USB interfaces and "combined nodes"
205def4c47SEmmanuel Vadot  representing simple USB devices.
215def4c47SEmmanuel Vadot
225def4c47SEmmanuel Vadot  A combined node shall be used instead of a device node and an interface node
235def4c47SEmmanuel Vadot  for devices of class 0 or 9 (hub) with a single configuration and a single
245def4c47SEmmanuel Vadot  interface.
255def4c47SEmmanuel Vadot
265def4c47SEmmanuel Vadot  A "hub node" is a combined node or an interface node that represents a USB
275def4c47SEmmanuel Vadot  hub.
285def4c47SEmmanuel Vadot
295def4c47SEmmanuel Vadotproperties:
305def4c47SEmmanuel Vadot  compatible:
315def4c47SEmmanuel Vadot    pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$"
325def4c47SEmmanuel Vadot    description: Device nodes or combined nodes.
335def4c47SEmmanuel Vadot      "usbVID,PID", where VID is the vendor id and PID the product id.
345def4c47SEmmanuel Vadot      The textual representation of VID and PID shall be in lower case
355def4c47SEmmanuel Vadot      hexadecimal with leading zeroes suppressed. The other compatible
365def4c47SEmmanuel Vadot      strings from the above standard binding could also be used,
375def4c47SEmmanuel Vadot      but a device adhering to this binding may leave out all except
385def4c47SEmmanuel Vadot      for "usbVID,PID".
395def4c47SEmmanuel Vadot
405def4c47SEmmanuel Vadot  reg:
415def4c47SEmmanuel Vadot    description: the number of the USB hub port or the USB host-controller
425def4c47SEmmanuel Vadot      port to which this device is attached. The range is 1-255.
435def4c47SEmmanuel Vadot    maxItems: 1
445def4c47SEmmanuel Vadot
455def4c47SEmmanuel Vadot  "#address-cells":
465def4c47SEmmanuel Vadot    description: should be 1 for hub nodes with device nodes,
475def4c47SEmmanuel Vadot      should be 2 for device nodes with interface nodes.
485def4c47SEmmanuel Vadot    enum: [1, 2]
495def4c47SEmmanuel Vadot
505def4c47SEmmanuel Vadot  "#size-cells":
515def4c47SEmmanuel Vadot    const: 0
525def4c47SEmmanuel Vadot
535def4c47SEmmanuel VadotpatternProperties:
545def4c47SEmmanuel Vadot  "^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})$":
555def4c47SEmmanuel Vadot    type: object
565def4c47SEmmanuel Vadot    description: USB interface nodes.
575def4c47SEmmanuel Vadot      The configuration component is not included in the textual
585def4c47SEmmanuel Vadot      representation of an interface-node unit address for configuration 1.
595def4c47SEmmanuel Vadot
605def4c47SEmmanuel Vadot    properties:
615def4c47SEmmanuel Vadot      compatible:
625def4c47SEmmanuel Vadot        pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}.config[0-9a-f]{1,2}.[0-9a-f]{1,2}$"
635def4c47SEmmanuel Vadot        description: Interface nodes.
645def4c47SEmmanuel Vadot          "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is
655def4c47SEmmanuel Vadot          the product id, CN is the configuration value and IN is the interface
665def4c47SEmmanuel Vadot          number. The textual representation of VID, PID, CN and IN shall be
675def4c47SEmmanuel Vadot          in lower case hexadecimal with leading zeroes suppressed.
685def4c47SEmmanuel Vadot          The other compatible strings from the above standard binding could
695def4c47SEmmanuel Vadot          also be used, but a device adhering to this binding may leave out
705def4c47SEmmanuel Vadot          all except for "usbifVID,PID.configCN.IN".
715def4c47SEmmanuel Vadot
725def4c47SEmmanuel Vadot      reg:
735def4c47SEmmanuel Vadot        description: should be 2 cells long, the first cell represents
745def4c47SEmmanuel Vadot          the interface number and the second cell represents the
755def4c47SEmmanuel Vadot          configuration value.
765def4c47SEmmanuel Vadot        maxItems: 1
775def4c47SEmmanuel Vadot
785def4c47SEmmanuel Vadotrequired:
795def4c47SEmmanuel Vadot  - reg
805def4c47SEmmanuel Vadot
815def4c47SEmmanuel VadotadditionalProperties: true
825def4c47SEmmanuel Vadot
835def4c47SEmmanuel Vadotexamples:
845def4c47SEmmanuel Vadot  # hub connected to port 1
855def4c47SEmmanuel Vadot  # device connected to port 2
865def4c47SEmmanuel Vadot  # device connected to port 3
875def4c47SEmmanuel Vadot  #    interface 0 of configuration 1
885def4c47SEmmanuel Vadot  #    interface 0 of configuration 2
895def4c47SEmmanuel Vadot  - |
905def4c47SEmmanuel Vadot    usb@11270000 {
915def4c47SEmmanuel Vadot        reg = <0x11270000 0x1000>;
925def4c47SEmmanuel Vadot        interrupts = <0x0 0x4e 0x0>;
935def4c47SEmmanuel Vadot        #address-cells = <1>;
945def4c47SEmmanuel Vadot        #size-cells = <0>;
955def4c47SEmmanuel Vadot
965def4c47SEmmanuel Vadot        hub@1 {
975def4c47SEmmanuel Vadot            compatible = "usb5e3,608";
985def4c47SEmmanuel Vadot            reg = <1>;
995def4c47SEmmanuel Vadot        };
1005def4c47SEmmanuel Vadot
1015def4c47SEmmanuel Vadot        device@2 {
1025def4c47SEmmanuel Vadot            compatible = "usb123,4567";
1035def4c47SEmmanuel Vadot            reg = <2>;
1045def4c47SEmmanuel Vadot        };
1055def4c47SEmmanuel Vadot
1065def4c47SEmmanuel Vadot        device@3 {
1075def4c47SEmmanuel Vadot            compatible = "usb123,abcd";
1085def4c47SEmmanuel Vadot            reg = <3>;
1095def4c47SEmmanuel Vadot
1105def4c47SEmmanuel Vadot            #address-cells = <2>;
1115def4c47SEmmanuel Vadot            #size-cells = <0>;
1125def4c47SEmmanuel Vadot
1135def4c47SEmmanuel Vadot            interface@0 {
1145def4c47SEmmanuel Vadot                compatible = "usbif123,abcd.config1.0";
1155def4c47SEmmanuel Vadot                reg = <0 1>;
1165def4c47SEmmanuel Vadot            };
1175def4c47SEmmanuel Vadot
1185def4c47SEmmanuel Vadot            interface@0,2 {
1195def4c47SEmmanuel Vadot                compatible = "usbif123,abcd.config2.0";
1205def4c47SEmmanuel Vadot                reg = <0 2>;
1215def4c47SEmmanuel Vadot            };
1225def4c47SEmmanuel Vadot        };
1235def4c47SEmmanuel Vadot    };
124