We've performed some work on the Generic USB HCD, xHCI and DWC USB3 DT
bindings in the framework of the Baikal-T1 SoC support integration into
the kernel. This patchset is a result of that work.
First of all we moved the generic USB properties from the legacy text
bindings into the USB HCD DT schema. So now the generic USB HCD-compatible
DT nodes are validated taking into account the optional properties like:
maximum-speed, dr_mode, otg-rev, usb-role-switch, etc. We've fixed these
properties a bit so they would correspond to what functionality kernel
currently supports.
Secondly we converted generic USB xHCI text bindings file into the DT
schema. It had to be split up into two bindings: DT schema with generic
xHCI properties and a generic xHCI device DT schema. The later will be
used to validate the pure xHCI-based nodes, while the former can be
utilized by some vendor-specific versions of xHCI.
Thirdly, what was primarily intended to be done for Baikal-T1 SoC USB we
converted the legacy text-based DWC USB3 bindings to DT schema and altered
the result a bit so it would be more coherent with what actually
controller and its driver support. Since we've now got the DWC USB3 DT
schema, we made it used to validate the sub-nodes of the Qualcom, TI and
Amlogic DWC3 DT nodes.
Finally we've also fixed all the OHCI/EHCI, xHCI and DW USB3 compatible DT
nodes so they would comply with the nodes naming scema declared in the USB
HCD DT bindings file.
Link: https://lore.kernel.org/linux-usb/[email protected]/
Changelog v2:
- Thanks to Sergei Shtylyov for suggesting the commit logs grammar fixes:
[PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types
[PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property
[PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support
[PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions
[PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
- Set FL-adj of the amlogiv,meson-g12a-usb controller with value 0x20 instead
of completely removing the property.
- Drop the patch:
[PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed
property value
since "wireless" speed type is depracated due to lack of the device
supporting it.
- Drop quotes from around the compat string constant.
- Discard '|' from the property descriptions, since we don't need to preserve
the text formatting.
- Convert abbreviated form of the "maximum-speed" enum constraint into
the multi-lined version of the list.
- Fix the DW USB3 "clock-names" prop description to be refererring to the
enumerated clock-names instead of the ones from the Databook.
- Add explicit "additionalProperties: true" to the usb-xhci.yaml schema,
since additionalProperties/unevaluatedProperties are going to be mandary
for each binding.
- Use "oneOf: [dwc2.yaml#, snps,dwc3.yaml#]" instead of the bulky "if:
properties: compatibe: ..." statement.
- Discard the "^dwc3@[0-9a-f]+$" nodes from being acceptable as sub-nodes
of the Qualcomm DWC3 DT nodes.
- Add new patches:
[PATCH 18/20] arch: dts: Fix EHCI/OHCI DT nodes name
[PATCH 19/20] arch: dts: Fix xHCI DT nodes name
[PATCH 20/20] arch: dts: Fix DWC USB3 DT nodes name
Link: https://lore.kernel.org/linux-usb/[email protected]
Changelog v3:
- Drop the patches:
[PATCH 18/20] arch: dts: Fix EHCI/OHCI DT nodes name
[PATCH 19/20] arch: dts: Fix xHCI DT nodes name
[PATCH 20/20] arch: dts: Fix DWC USB3 DT nodes name
as they are going to be submitted in the framework of a dedicated patchset.
- Drop the patch:
[PATCH 11/20] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string
since it's going to be replaced with the driver/dts fixup and moved to a
dedicated patchset.
- Apply usb-xhci.yaml# schema for the DWC USB3 node only if the controller is
supposed to work as either host or otg.
Signed-off-by: Serge Semin <[email protected]>
Cc: Alexey Malahov <[email protected]>
Cc: Pavel Parkhomenko <[email protected]>
Cc: Andy Gross <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: Manu Gautam <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Lad Prabhakar <[email protected]>
Cc: Yoshihiro Shimoda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Martin Blumenstingl <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Serge Semin (16):
dt-bindings: usb: usb-hcd: Convert generic USB properties to DT schema
dt-bindings: usb: usb-hcd: Add "otg-rev" property restriction
dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types
dt-bindings: usb: usb-hcd: Add "tpl-support" property
dt-bindings: usb: usb-hcd: Add generic "usb-phy" property
dt-bindings: usb: Convert xHCI bindings to DT schema
dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device
dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file
dt-bindings: usb: Convert DWC USB3 bindings to DT schema
dt-bindings: usb: dwc3: Add interrupt-names property support
dt-bindings: usb: dwc3: Add Tx De-emphasis constraints
dt-bindings: usb: dwc3: Add Frame Length Adj constraints
dt-bindings: usb: meson-g12a-usb: Fix FL-adj property value
dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
dt-bindings: usb: qcom,dwc3: Validate DWC3 sub-node
.../usb/amlogic,meson-g12a-usb-ctrl.yaml | 6 +-
.../devicetree/bindings/usb/dwc3.txt | 125 -------
.../devicetree/bindings/usb/generic-xhci.yaml | 65 ++++
.../devicetree/bindings/usb/generic.txt | 57 ----
.../devicetree/bindings/usb/qcom,dwc3.yaml | 9 +-
.../bindings/usb/renesas,usb-xhci.yaml | 4 +-
.../devicetree/bindings/usb/snps,dwc3.yaml | 319 ++++++++++++++++++
.../bindings/usb/ti,keystone-dwc3.yaml | 4 +-
.../devicetree/bindings/usb/usb-hcd.yaml | 104 ++++++
.../devicetree/bindings/usb/usb-xhci.txt | 41 ---
.../devicetree/bindings/usb/usb-xhci.yaml | 42 +++
11 files changed, 540 insertions(+), 236 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml
delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt
create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml
delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt
create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml
--
2.27.0
Even though the Generic PHY framework is the more preferable way of
setting the USB PHY up, there are still many dts-files and DT bindings
which rely on having the legacy "usb-phy" specified to attach particular
USB PHYs to USB cores. Let's have the "usb-phy" property described in
the generic USB HCD binding file so it would be validated against the
nodes in which it's specified. Mark the property as deprecated to
discourage the developers from using it.
Signed-off-by: Serge Semin <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Changelog v2:
- Discard '|' from the property description, since we don't need to preserve
the text formatting.
---
Documentation/devicetree/bindings/usb/usb-hcd.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
index 1f9b40fdea70..264a660dc6ea 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -22,6 +22,13 @@ properties:
description:
Name specifier for the USB PHY
+ usb-phy:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description:
+ List of all the USB PHYs on this HCD to be accepted by the legacy USB
+ Physical Layer subsystem.
+ deprecated: true
+
maximum-speed:
description:
Tells USB controllers we want to work up to a certain speed. In case this
--
2.27.0
Aside from the UTMI+ there are also ULPI, Serial and HSIC PHY types
that can be specified in the phy_type HCD property. Add them to the
enumeration of the acceptable values.
Signed-off-by: Serge Semin <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Changelog v2:
- Grammar fix: "s/PHY types can be/PHY types that can be"
- Drop quotes from around the string constants.
---
Documentation/devicetree/bindings/usb/usb-hcd.yaml | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
index e01d8a54971e..a1a6cde7327d 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -46,11 +46,13 @@ properties:
phy_type:
description:
Tells USB controllers that we want to configure the core to support a
- UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is selected. In case
- this isn't passed via DT, USB controllers should default to HW
- capability.
+ UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is selected, UTMI+ low
+ pin interface if ULPI is specified, Serial core/PHY interconnect if
+ serial is specified and High-Speed Inter-Chip feature if HSIC is
+ selected. In case this isn't passed via DT, USB controllers should
+ default to HW capability.
$ref: /schemas/types.yaml#/definitions/string
- enum: [utmi, utmi_wide]
+ enum: [utmi, utmi_wide, ulpi, serial, hsic]
otg-rev:
description:
--
2.27.0
The host controller device might be designed to work for the particular
products or applications. In that case its DT node is supposed to be
equipped with the tpl-support property.
Signed-off-by: Serge Semin <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
Changelog v2:
- Grammar fix: "s/it'/its"
- Discard '|' from the property description, since we don't need to preserve
the text formatting.
---
Documentation/devicetree/bindings/usb/usb-hcd.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
index a1a6cde7327d..1f9b40fdea70 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -101,6 +101,12 @@ properties:
enum: [host, peripheral]
default: peripheral
+ tpl-support:
+ description:
+ Indicates if the Targeted Peripheral List is supported for given
+ targeted hosts (non-PC hosts).
+ type: boolean
+
examples:
- |
usb {
--
2.27.0
Amlogic G12A USB DT sub-nodes are supposed to be compatible with the
generic DWC USB2 and USB3 devices. Since now we've got DT schemas for
both of the later IP cores let's make sure that the Amlogic G12A USB
DT nodes are fully evaluated including the DWC sub-nodes.
Signed-off-by: Serge Semin <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: Martin Blumenstingl <[email protected]>
---
Changelog v2:
- Use "oneOf: [dwc2.yaml#, snps,dwc3.yaml#]" instead of the bulky "if:
properties: compatibe: ..." statement.
---
.../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
index a4b44a16aaef..7b2dc905c8ce 100644
--- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
+++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
@@ -78,7 +78,9 @@ properties:
patternProperties:
"^usb@[0-9a-f]+$":
- type: object
+ oneOf:
+ - $ref: dwc2.yaml#
+ - $ref: snps,dwc3.yaml#
additionalProperties: false
--
2.27.0
On Tue, Oct 20, 2020 at 1:21 PM Serge Semin
<[email protected]> wrote:
>
> Even though the Generic PHY framework is the more preferable way of
> setting the USB PHY up, there are still many dts-files and DT bindings
> which rely on having the legacy "usb-phy" specified to attach particular
> USB PHYs to USB cores. Let's have the "usb-phy" property described in
> the generic USB HCD binding file so it would be validated against the
> nodes in which it's specified. Mark the property as deprecated to
> discourage the developers from using it.
>
> Signed-off-by: Serge Semin <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
Acked-by: Martin Blumenstingl <[email protected]>