Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: usb: Convert generic USB properties to DT schemas

The generic USB properties have been described in the legacy bindings
text file: Documentation/devicetree/bindings/usb/generic.txt . Let's
convert its content into the generic USB, USB HCD and USB DRD DT
schemas. So the Generic USB schema will be applicable to all USB
controllers, USB HCD - for the generic USB Host controllers and the USB
DRD - for the USB Dual-role controllers.

Note the USB DRD schema is supposed to work in conjunction with
the USB peripheral/gadget and USB host controllers DT schemas.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20201210090944.16283-3-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Serge Semin and committed by
Greg Kroah-Hartman
b0864e1a aa624016

+104 -57
-57
Documentation/devicetree/bindings/usb/generic.txt
··· 1 - Generic USB Properties 2 - 3 - Optional properties: 4 - - maximum-speed: tells USB controllers we want to work up to a certain 5 - speed. Valid arguments are "super-speed-plus", 6 - "super-speed", "high-speed", "full-speed" and 7 - "low-speed". In case this isn't passed via DT, USB 8 - controllers should default to their maximum HW 9 - capability. 10 - - dr_mode: tells Dual-Role USB controllers that we want to work on a 11 - particular mode. Valid arguments are "host", 12 - "peripheral" and "otg". In case this attribute isn't 13 - passed via DT, USB DRD controllers should default to 14 - OTG. 15 - - phy_type: tells USB controllers that we want to configure the core to support 16 - a UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is 17 - selected. Valid arguments are "utmi" and "utmi_wide". 18 - In case this isn't passed via DT, USB controllers should 19 - default to HW capability. 20 - - otg-rev: tells usb driver the release number of the OTG and EH supplement 21 - with which the device and its descriptors are compliant, 22 - in binary-coded decimal (i.e. 2.0 is 0200H). This 23 - property is used if any real OTG features(HNP/SRP/ADP) 24 - is enabled, if ADP is required, otg-rev should be 25 - 0x0200 or above. 26 - - companion: phandle of a companion 27 - - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP 28 - is the basic function of real OTG except you want it 29 - to be a srp-capable only B device. 30 - - srp-disable: tells OTG controllers we want to disable OTG SRP, SRP is 31 - optional for OTG device. 32 - - adp-disable: tells OTG controllers we want to disable OTG ADP, ADP is 33 - optional for OTG device. 34 - - usb-role-switch: boolean, indicates that the device is capable of assigning 35 - the USB data role (USB host or USB device) for a given 36 - USB connector, such as Type-C, Type-B(micro). 37 - see connector/usb-connector.yaml. 38 - - role-switch-default-mode: indicating if usb-role-switch is enabled, the 39 - device default operation mode of controller while usb 40 - role is USB_ROLE_NONE. Valid arguments are "host" and 41 - "peripheral". Defaults to "peripheral" if not 42 - specified. 43 - 44 - 45 - This is an attribute to a USB controller such as: 46 - 47 - dwc3@4a030000 { 48 - compatible = "synopsys,dwc3"; 49 - reg = <0x4a030000 0xcfff>; 50 - interrupts = <0 92 4> 51 - usb-phy = <&usb2_phy>, <&usb3,phy>; 52 - maximum-speed = "super-speed"; 53 - dr_mode = "otg"; 54 - phy_type = "utmi_wide"; 55 - otg-rev = <0x0200>; 56 - adp-disable; 57 - };
+77
Documentation/devicetree/bindings/usb/usb-drd.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/usb/usb-drd.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Generic USB OTG Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Greg Kroah-Hartman <gregkh@linuxfoundation.org> 11 + 12 + properties: 13 + otg-rev: 14 + description: 15 + Tells usb driver the release number of the OTG and EH supplement with 16 + which the device and its descriptors are compliant, in binary-coded 17 + decimal (i.e. 2.0 is 0200H). This property is used if any real OTG 18 + features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be 19 + 0x0200 or above. 20 + $ref: /schemas/types.yaml#/definitions/uint32 21 + 22 + dr_mode: 23 + description: 24 + Tells Dual-Role USB controllers that we want to work on a particular 25 + mode. In case this attribute isn't passed via DT, USB DRD controllers 26 + should default to OTG. 27 + $ref: /schemas/types.yaml#/definitions/string 28 + enum: [host, peripheral, otg] 29 + 30 + hnp-disable: 31 + description: 32 + Tells OTG controllers we want to disable OTG HNP. Normally HNP is the 33 + basic function of real OTG except you want it to be a srp-capable only B 34 + device. 35 + type: boolean 36 + 37 + srp-disable: 38 + description: 39 + Tells OTG controllers we want to disable OTG SRP. SRP is optional for OTG 40 + device. 41 + type: boolean 42 + 43 + adp-disable: 44 + description: 45 + Tells OTG controllers we want to disable OTG ADP. ADP is optional for OTG 46 + device. 47 + type: boolean 48 + 49 + usb-role-switch: 50 + description: 51 + Indicates that the device is capable of assigning the USB data role 52 + (USB host or USB device) for a given USB connector, such as Type-C, 53 + Type-B(micro). See connector/usb-connector.yaml. 54 + 55 + role-switch-default-mode: 56 + description: 57 + Indicates if usb-role-switch is enabled, the device default operation 58 + mode of controller while usb role is USB_ROLE_NONE. 59 + $ref: /schemas/types.yaml#/definitions/string 60 + enum: [host, peripheral] 61 + default: peripheral 62 + 63 + additionalProperties: true 64 + 65 + examples: 66 + - | 67 + usb@4a030000 { 68 + compatible = "snps,dwc3"; 69 + reg = <0x4a030000 0xcfff>; 70 + interrupts = <0 92 4>; 71 + usb-phy = <&usb2_phy>, <&usb3_phy>; 72 + maximum-speed = "super-speed"; 73 + dr_mode = "otg"; 74 + phy_type = "utmi_wide"; 75 + otg-rev = <0x0200>; 76 + adp-disable; 77 + };
+5
Documentation/devicetree/bindings/usb/usb-hcd.yaml
··· 12 12 allOf: 13 13 - $ref: usb.yaml# 14 14 15 + properties: 16 + companion: 17 + description: Phandle of a companion device 18 + $ref: /schemas/types.yaml#/definitions/phandle 19 + 15 20 additionalProperties: true 16 21 17 22 examples:
+22
Documentation/devicetree/bindings/usb/usb.yaml
··· 24 24 description: 25 25 Name specifier for the USB PHY 26 26 27 + phy_type: 28 + description: 29 + Tells USB controllers that we want to configure the core to support a 30 + UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is selected. In case 31 + this isn't passed via DT, USB controllers should default to HW 32 + capability. 33 + $ref: /schemas/types.yaml#/definitions/string 34 + enum: [utmi, utmi_wide] 35 + 36 + maximum-speed: 37 + description: 38 + Tells USB controllers we want to work up to a certain speed. In case this 39 + isn't passed via DT, USB controllers should default to their maximum HW 40 + capability. 41 + $ref: /schemas/types.yaml#/definitions/string 42 + enum: 43 + - low-speed 44 + - full-speed 45 + - high-speed 46 + - super-speed 47 + - super-speed-plus 48 + 27 49 additionalProperties: true 28 50 29 51 ...