usb-device.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. Generic USB Device Properties
  2. Usually, we only use device tree for hard wired USB device.
  3. The reference binding doc is from:
  4. http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps
  5. Four types of device-tree nodes are defined: "host-controller nodes"
  6. representing USB host controllers, "device nodes" representing USB devices,
  7. "interface nodes" representing USB interfaces and "combined nodes"
  8. representing simple USB devices.
  9. A combined node shall be used instead of a device node and an interface node
  10. for devices of class 0 or 9 (hub) with a single configuration and a single
  11. interface.
  12. A "hub node" is a combined node or an interface node that represents a USB
  13. hub.
  14. Required properties for device nodes:
  15. - compatible: "usbVID,PID", where VID is the vendor id and PID the product id.
  16. The textual representation of VID and PID shall be in lower case hexadecimal
  17. with leading zeroes suppressed. The other compatible strings from the above
  18. standard binding could also be used, but a device adhering to this binding
  19. may leave out all except for "usbVID,PID".
  20. - reg: the number of the USB hub port or the USB host-controller port to which
  21. this device is attached. The range is 1-255.
  22. Required properties for device nodes with interface nodes:
  23. - #address-cells: shall be 2
  24. - #size-cells: shall be 0
  25. Required properties for interface nodes:
  26. - compatible: "usbifVID,PID.configCN.IN", where VID is the vendor id, PID is
  27. the product id, CN is the configuration value and IN is the interface
  28. number. The textual representation of VID, PID, CN and IN shall be in lower
  29. case hexadecimal with leading zeroes suppressed. The other compatible
  30. strings from the above standard binding could also be used, but a device
  31. adhering to this binding may leave out all except for
  32. "usbifVID,PID.configCN.IN".
  33. - reg: the interface number and configuration value
  34. The configuration component is not included in the textual representation of
  35. an interface-node unit address for configuration 1.
  36. Required properties for combined nodes:
  37. - compatible: "usbVID,PID", where VID is the vendor id and PID the product id.
  38. The textual representation of VID and PID shall be in lower case hexadecimal
  39. with leading zeroes suppressed. The other compatible strings from the above
  40. standard binding could also be used, but a device adhering to this binding
  41. may leave out all except for "usbVID,PID".
  42. - reg: the number of the USB hub port or the USB host-controller port to which
  43. this device is attached. The range is 1-255.
  44. Required properties for hub nodes with device nodes:
  45. - #address-cells: shall be 1
  46. - #size-cells: shall be 0
  47. Required properties for host-controller nodes with device nodes:
  48. - #address-cells: shall be 1
  49. - #size-cells: shall be 0
  50. Example:
  51. &usb1 { /* host controller */
  52. #address-cells = <1>;
  53. #size-cells = <0>;
  54. hub@1 { /* hub connected to port 1 */
  55. compatible = "usb5e3,608";
  56. reg = <1>;
  57. };
  58. device@2 { /* device connected to port 2 */
  59. compatible = "usb123,4567";
  60. reg = <2>;
  61. };
  62. device@3 { /* device connected to port 3 */
  63. compatible = "usb123,abcd";
  64. reg = <3>;
  65. #address-cells = <2>;
  66. #size-cells = <0>;
  67. interface@0 { /* interface 0 of configuration 1 */
  68. compatible = "usbif123,abcd.config1.0";
  69. reg = <0 1>;
  70. };
  71. interface@0,2 { /* interface 0 of configuration 2 */
  72. compatible = "usbif123,abcd.config2.0";
  73. reg = <0 2>;
  74. };
  75. };
  76. };