1*5def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*5def4c47SEmmanuel Vadot%YAML 1.2 3*5def4c47SEmmanuel Vadot--- 4*5def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/usb/usb-device.yaml# 5*5def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*5def4c47SEmmanuel Vadot 7*5def4c47SEmmanuel Vadottitle: The device tree bindings for the Generic USB Device 8*5def4c47SEmmanuel Vadot 9*5def4c47SEmmanuel Vadotmaintainers: 10*5def4c47SEmmanuel Vadot - Greg Kroah-Hartman <gregkh@linuxfoundation.org> 11*5def4c47SEmmanuel Vadot 12*5def4c47SEmmanuel Vadotdescription: | 13*5def4c47SEmmanuel Vadot Usually, we only use device tree for hard wired USB device. 14*5def4c47SEmmanuel Vadot The reference binding doc is from: 15*5def4c47SEmmanuel Vadot http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps 16*5def4c47SEmmanuel Vadot 17*5def4c47SEmmanuel Vadot Four types of device-tree nodes are defined: "host-controller nodes" 18*5def4c47SEmmanuel Vadot representing USB host controllers, "device nodes" representing USB devices, 19*5def4c47SEmmanuel Vadot "interface nodes" representing USB interfaces and "combined nodes" 20*5def4c47SEmmanuel Vadot representing simple USB devices. 21*5def4c47SEmmanuel Vadot 22*5def4c47SEmmanuel Vadot A combined node shall be used instead of a device node and an interface node 23*5def4c47SEmmanuel Vadot for devices of class 0 or 9 (hub) with a single configuration and a single 24*5def4c47SEmmanuel Vadot interface. 25*5def4c47SEmmanuel Vadot 26*5def4c47SEmmanuel Vadot A "hub node" is a combined node or an interface node that represents a USB 27*5def4c47SEmmanuel Vadot hub. 28*5def4c47SEmmanuel Vadot 29*5def4c47SEmmanuel Vadotproperties: 30*5def4c47SEmmanuel Vadot compatible: 31*5def4c47SEmmanuel Vadot pattern: "^usb[0-9a-f]{1,4},[0-9a-f]{1,4}$" 32*5def4c47SEmmanuel Vadot description: Device nodes or combined nodes. 33*5def4c47SEmmanuel Vadot "usbVID,PID", where VID is the vendor id and PID the product id. 34*5def4c47SEmmanuel Vadot The textual representation of VID and PID shall be in lower case 35*5def4c47SEmmanuel Vadot hexadecimal with leading zeroes suppressed. The other compatible 36*5def4c47SEmmanuel Vadot strings from the above standard binding could also be used, 37*5def4c47SEmmanuel Vadot but a device adhering to this binding may leave out all except 38*5def4c47SEmmanuel Vadot for "usbVID,PID". 39*5def4c47SEmmanuel Vadot 40*5def4c47SEmmanuel Vadot reg: 41*5def4c47SEmmanuel Vadot description: the number of the USB hub port or the USB host-controller 42*5def4c47SEmmanuel Vadot port to which this device is attached. The range is 1-255. 43*5def4c47SEmmanuel Vadot maxItems: 1 44*5def4c47SEmmanuel Vadot 45*5def4c47SEmmanuel Vadot "#address-cells": 46*5def4c47SEmmanuel Vadot description: should be 1 for hub nodes with device nodes, 47*5def4c47SEmmanuel Vadot should be 2 for device nodes with interface nodes. 48*5def4c47SEmmanuel Vadot enum: [1, 2] 49*5def4c47SEmmanuel Vadot 50*5def4c47SEmmanuel Vadot "#size-cells": 51*5def4c47SEmmanuel Vadot const: 0 52*5def4c47SEmmanuel Vadot 53*5def4c47SEmmanuel VadotpatternProperties: 54*5def4c47SEmmanuel Vadot "^interface@[0-9a-f]{1,2}(,[0-9a-f]{1,2})$": 55*5def4c47SEmmanuel Vadot type: object 56*5def4c47SEmmanuel Vadot description: USB interface nodes. 57*5def4c47SEmmanuel Vadot The configuration component is not included in the textual 58*5def4c47SEmmanuel Vadot representation of an interface-node unit address for configuration 1. 59*5def4c47SEmmanuel Vadot 60*5def4c47SEmmanuel Vadot properties: 61*5def4c47SEmmanuel Vadot compatible: 62*5def4c47SEmmanuel Vadot pattern: "^usbif[0-9a-f]{1,4},[0-9a-f]{1,4}.config[0-9a-f]{1,2}.[0-9a-f]{1,2}$" 63*5def4c47SEmmanuel Vadot description: Interface nodes. 64*5def4c47SEmmanuel Vadot "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is 65*5def4c47SEmmanuel Vadot the product id, CN is the configuration value and IN is the interface 66*5def4c47SEmmanuel Vadot number. The textual representation of VID, PID, CN and IN shall be 67*5def4c47SEmmanuel Vadot in lower case hexadecimal with leading zeroes suppressed. 68*5def4c47SEmmanuel Vadot The other compatible strings from the above standard binding could 69*5def4c47SEmmanuel Vadot also be used, but a device adhering to this binding may leave out 70*5def4c47SEmmanuel Vadot all except for "usbifVID,PID.configCN.IN". 71*5def4c47SEmmanuel Vadot 72*5def4c47SEmmanuel Vadot reg: 73*5def4c47SEmmanuel Vadot description: should be 2 cells long, the first cell represents 74*5def4c47SEmmanuel Vadot the interface number and the second cell represents the 75*5def4c47SEmmanuel Vadot configuration value. 76*5def4c47SEmmanuel Vadot maxItems: 1 77*5def4c47SEmmanuel Vadot 78*5def4c47SEmmanuel Vadotrequired: 79*5def4c47SEmmanuel Vadot - compatible 80*5def4c47SEmmanuel Vadot - reg 81*5def4c47SEmmanuel Vadot 82*5def4c47SEmmanuel VadotadditionalProperties: true 83*5def4c47SEmmanuel Vadot 84*5def4c47SEmmanuel Vadotexamples: 85*5def4c47SEmmanuel Vadot #hub connected to port 1 86*5def4c47SEmmanuel Vadot #device connected to port 2 87*5def4c47SEmmanuel Vadot #device connected to port 3 88*5def4c47SEmmanuel Vadot # interface 0 of configuration 1 89*5def4c47SEmmanuel Vadot # interface 0 of configuration 2 90*5def4c47SEmmanuel Vadot - | 91*5def4c47SEmmanuel Vadot usb@11270000 { 92*5def4c47SEmmanuel Vadot reg = <0x11270000 0x1000>; 93*5def4c47SEmmanuel Vadot interrupts = <0x0 0x4e 0x0>; 94*5def4c47SEmmanuel Vadot #address-cells = <1>; 95*5def4c47SEmmanuel Vadot #size-cells = <0>; 96*5def4c47SEmmanuel Vadot 97*5def4c47SEmmanuel Vadot hub@1 { 98*5def4c47SEmmanuel Vadot compatible = "usb5e3,608"; 99*5def4c47SEmmanuel Vadot reg = <1>; 100*5def4c47SEmmanuel Vadot }; 101*5def4c47SEmmanuel Vadot 102*5def4c47SEmmanuel Vadot device@2 { 103*5def4c47SEmmanuel Vadot compatible = "usb123,4567"; 104*5def4c47SEmmanuel Vadot reg = <2>; 105*5def4c47SEmmanuel Vadot }; 106*5def4c47SEmmanuel Vadot 107*5def4c47SEmmanuel Vadot device@3 { 108*5def4c47SEmmanuel Vadot compatible = "usb123,abcd"; 109*5def4c47SEmmanuel Vadot reg = <3>; 110*5def4c47SEmmanuel Vadot 111*5def4c47SEmmanuel Vadot #address-cells = <2>; 112*5def4c47SEmmanuel Vadot #size-cells = <0>; 113*5def4c47SEmmanuel Vadot 114*5def4c47SEmmanuel Vadot interface@0 { 115*5def4c47SEmmanuel Vadot compatible = "usbif123,abcd.config1.0"; 116*5def4c47SEmmanuel Vadot reg = <0 1>; 117*5def4c47SEmmanuel Vadot }; 118*5def4c47SEmmanuel Vadot 119*5def4c47SEmmanuel Vadot interface@0,2 { 120*5def4c47SEmmanuel Vadot compatible = "usbif123,abcd.config2.0"; 121*5def4c47SEmmanuel Vadot reg = <0 2>; 122*5def4c47SEmmanuel Vadot }; 123*5def4c47SEmmanuel Vadot }; 124*5def4c47SEmmanuel Vadot }; 125