xref: /freebsd/sys/contrib/device-tree/Bindings/usb/usb-device.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotGeneric USB Device Properties
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotUsually, we only use device tree for hard wired USB device.
4*c66ec88fSEmmanuel VadotThe reference binding doc is from:
5*c66ec88fSEmmanuel Vadothttp://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
6*c66ec88fSEmmanuel Vadot
7*c66ec88fSEmmanuel VadotFour types of device-tree nodes are defined: "host-controller nodes"
8*c66ec88fSEmmanuel Vadotrepresenting USB host controllers, "device nodes" representing USB devices,
9*c66ec88fSEmmanuel Vadot"interface nodes" representing USB interfaces and "combined nodes"
10*c66ec88fSEmmanuel Vadotrepresenting simple USB devices.
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel VadotA combined node shall be used instead of a device node and an interface node
13*c66ec88fSEmmanuel Vadotfor devices of class 0 or 9 (hub) with a single configuration and a single
14*c66ec88fSEmmanuel Vadotinterface.
15*c66ec88fSEmmanuel Vadot
16*c66ec88fSEmmanuel VadotA "hub node" is a combined node or an interface node that represents a USB
17*c66ec88fSEmmanuel Vadothub.
18*c66ec88fSEmmanuel Vadot
19*c66ec88fSEmmanuel Vadot
20*c66ec88fSEmmanuel VadotRequired properties for device nodes:
21*c66ec88fSEmmanuel Vadot- compatible: "usbVID,PID", where VID is the vendor id and PID the product id.
22*c66ec88fSEmmanuel Vadot  The textual representation of VID and PID shall be in lower case hexadecimal
23*c66ec88fSEmmanuel Vadot  with leading zeroes suppressed. The other compatible strings from the above
24*c66ec88fSEmmanuel Vadot  standard binding could also be used, but a device adhering to this binding
25*c66ec88fSEmmanuel Vadot  may leave out all except for "usbVID,PID".
26*c66ec88fSEmmanuel Vadot- reg: the number of the USB hub port or the USB host-controller port to which
27*c66ec88fSEmmanuel Vadot  this device is attached. The range is 1-255.
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel Vadot
30*c66ec88fSEmmanuel VadotRequired properties for device nodes with interface nodes:
31*c66ec88fSEmmanuel Vadot- #address-cells: shall be 2
32*c66ec88fSEmmanuel Vadot- #size-cells: shall be 0
33*c66ec88fSEmmanuel Vadot
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel VadotRequired properties for interface nodes:
36*c66ec88fSEmmanuel Vadot- compatible: "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is
37*c66ec88fSEmmanuel Vadot  the product id, CN is the configuration value and IN is the interface
38*c66ec88fSEmmanuel Vadot  number. The textual representation of VID, PID, CN and IN shall be in lower
39*c66ec88fSEmmanuel Vadot  case hexadecimal with leading zeroes suppressed. The other compatible
40*c66ec88fSEmmanuel Vadot  strings from the above standard binding could also be used, but a device
41*c66ec88fSEmmanuel Vadot  adhering to this binding may leave out all except for
42*c66ec88fSEmmanuel Vadot  "usbifVID,PID.configCN.IN".
43*c66ec88fSEmmanuel Vadot- reg: the interface number and configuration value
44*c66ec88fSEmmanuel Vadot
45*c66ec88fSEmmanuel VadotThe configuration component is not included in the textual representation of
46*c66ec88fSEmmanuel Vadotan interface-node unit address for configuration 1.
47*c66ec88fSEmmanuel Vadot
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel VadotRequired properties for combined nodes:
50*c66ec88fSEmmanuel Vadot- compatible: "usbVID,PID", where VID is the vendor id and PID the product id.
51*c66ec88fSEmmanuel Vadot  The textual representation of VID and PID shall be in lower case hexadecimal
52*c66ec88fSEmmanuel Vadot  with leading zeroes suppressed. The other compatible strings from the above
53*c66ec88fSEmmanuel Vadot  standard binding could also be used, but a device adhering to this binding
54*c66ec88fSEmmanuel Vadot  may leave out all except for "usbVID,PID".
55*c66ec88fSEmmanuel Vadot- reg: the number of the USB hub port or the USB host-controller port to which
56*c66ec88fSEmmanuel Vadot  this device is attached. The range is 1-255.
57*c66ec88fSEmmanuel Vadot
58*c66ec88fSEmmanuel Vadot
59*c66ec88fSEmmanuel VadotRequired properties for hub nodes with device nodes:
60*c66ec88fSEmmanuel Vadot- #address-cells: shall be 1
61*c66ec88fSEmmanuel Vadot- #size-cells: shall be 0
62*c66ec88fSEmmanuel Vadot
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel VadotRequired properties for host-controller nodes with device nodes:
65*c66ec88fSEmmanuel Vadot- #address-cells: shall be 1
66*c66ec88fSEmmanuel Vadot- #size-cells: shall be 0
67*c66ec88fSEmmanuel Vadot
68*c66ec88fSEmmanuel Vadot
69*c66ec88fSEmmanuel VadotExample:
70*c66ec88fSEmmanuel Vadot
71*c66ec88fSEmmanuel Vadot&usb1 {	/* host controller */
72*c66ec88fSEmmanuel Vadot	#address-cells = <1>;
73*c66ec88fSEmmanuel Vadot	#size-cells = <0>;
74*c66ec88fSEmmanuel Vadot
75*c66ec88fSEmmanuel Vadot	hub@1 {		/* hub connected to port 1 */
76*c66ec88fSEmmanuel Vadot		compatible = "usb5e3,608";
77*c66ec88fSEmmanuel Vadot		reg = <1>;
78*c66ec88fSEmmanuel Vadot	};
79*c66ec88fSEmmanuel Vadot
80*c66ec88fSEmmanuel Vadot	device@2 {	/* device connected to port 2 */
81*c66ec88fSEmmanuel Vadot		compatible = "usb123,4567";
82*c66ec88fSEmmanuel Vadot		reg = <2>;
83*c66ec88fSEmmanuel Vadot	};
84*c66ec88fSEmmanuel Vadot
85*c66ec88fSEmmanuel Vadot	device@3 { 	/* device connected to port 3 */
86*c66ec88fSEmmanuel Vadot		compatible = "usb123,abcd";
87*c66ec88fSEmmanuel Vadot		reg = <3>;
88*c66ec88fSEmmanuel Vadot
89*c66ec88fSEmmanuel Vadot		#address-cells = <2>;
90*c66ec88fSEmmanuel Vadot		#size-cells = <0>;
91*c66ec88fSEmmanuel Vadot
92*c66ec88fSEmmanuel Vadot		interface@0 {	/* interface 0 of configuration 1 */
93*c66ec88fSEmmanuel Vadot			compatible = "usbif123,abcd.config1.0";
94*c66ec88fSEmmanuel Vadot			reg = <0 1>;
95*c66ec88fSEmmanuel Vadot		};
96*c66ec88fSEmmanuel Vadot
97*c66ec88fSEmmanuel Vadot		interface@0,2 {	/* interface 0 of configuration 2 */
98*c66ec88fSEmmanuel Vadot			compatible = "usbif123,abcd.config2.0";
99*c66ec88fSEmmanuel Vadot			reg = <0 2>;
100*c66ec88fSEmmanuel Vadot		};
101*c66ec88fSEmmanuel Vadot	};
102*c66ec88fSEmmanuel Vadot};
103