linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema
@ 2020-10-10 22:41 Serge Semin
  2020-10-10 22:41 ` [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to " Serge Semin
                   ` (17 more replies)
  0 siblings, 18 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

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.

Alas the new DWC USB3 DT schema doesn't support all the DT nodes defined
as compatible with "snps,dwc3". There are next problems we've discovered
while were working on this patchset:

1) There are many "snps,dwc3"-compatible DT nodes, which names are defined
as "^usb[0-9](@.*)", "^dwc3(@.*)" and even "^dwusb(@.*)". It contradicts
to what usb-hcd.yaml requires. Since it's included into the allOf property
of the DWC USB3 DT binding, some USB DT nodes declared for Freescale,
Qualcomm, HiSilicon, Exynos, Allwinner, Omap, Stih and APM will fail the
dtbs_check validation. This is the main problem and currently I don't
really know how to fix it better. Ideally we should convert all the
problematic DT nodes to have "usb@"-prefixed names. But it will be very
painful due to having a lot of such nodes defined. On the other hand we
could just fix the usb-hcd.yaml file either by detaching the generic
properties into a separate DT schema and allOf-ing it in the HCDs with
non-standard node-names instead of using usb-hcd.yaml there, or just add
the non-standard node-names into the usb-hcd.yaml file. What do you think
would be better?

2) amlogic/meson-g12-common.dtsi has got a USB controller node defined
with boolean "snps,quirk-frame-length-adjustment", which actually is
supposed to have u32 type.

3) freescale/imx8mq.dtsi defines a USB controller node with unknown
"usb3-resume-missing-cas" property.

4) marvell/armada-37xx.dtsi defines a USB controller with unknown
"marvell,usb-misc-reg" property.

5) socionext/uniphier-pxs3.dtsi, uniphier-pxs2.dtsi define a USB
controller with too many PHYs.

We haven't fixed the problems denoted above in this patchset for now.
So any help, suggestions on how they (especially #1) could be fixed,
following up fixup patches would be appropriate.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Manu Gautam <mgautam@codeaurora.org>
Cc: Roger Quadros <rogerq@ti.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-usb@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Serge Semin (18):
  dt-bindings: usb: usb-hcd: Convert generic USB properties to DT schema
  dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value
  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 synopsys,dwc3 compatible string
  dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions
  dt-bindings: usb: dwc3: Add Frame Length Adj restrictions
  dt-bindings: usb: meson-g12a-usb: Discard FL-adj property
  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      |  16 +-
 .../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    | 315 ++++++++++++++++++
 .../bindings/usb/ti,keystone-dwc3.yaml        |   4 +-
 .../devicetree/bindings/usb/usb-hcd.yaml      | 100 ++++++
 .../devicetree/bindings/usb/usb-xhci.txt      |  41 ---
 .../devicetree/bindings/usb/usb-xhci.yaml     |  40 +++
 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


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to DT schema
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-13 12:14   ` Rob Herring
  2020-10-10 22:41 ` [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value Serge Semin
                   ` (16 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

The generic USB HCD properties have been described in the legacy bindings
text file: Documentation/devicetree/bindings/usb/generic.txt . Let's
convert it' content into the USB HCD DT schema properties so all USB DT
nodes would be validated to have them properly utilized.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 .../devicetree/bindings/usb/generic.txt       | 57 -------------
 .../devicetree/bindings/usb/usb-hcd.yaml      | 84 +++++++++++++++++++
 2 files changed, 84 insertions(+), 57 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt

diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt
deleted file mode 100644
index ba472e7aefc9..000000000000
--- a/Documentation/devicetree/bindings/usb/generic.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-Generic USB Properties
-
-Optional properties:
- - maximum-speed: tells USB controllers we want to work up to a certain
-			speed. Valid arguments are "super-speed-plus",
-			"super-speed", "high-speed", "full-speed" and
-			"low-speed". In case this isn't passed via DT, USB
-			controllers should default to their maximum HW
-			capability.
- - dr_mode: tells Dual-Role USB controllers that we want to work on a
-			particular mode. Valid arguments are "host",
-			"peripheral" and "otg". In case this attribute isn't
-			passed via DT, USB DRD controllers should default to
-			OTG.
- - phy_type: 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. Valid arguments are "utmi" and "utmi_wide".
-			In case this isn't passed via DT, USB controllers should
-			default to HW capability.
- - otg-rev: tells usb driver the release number of the OTG and EH supplement
-			with which the device and its descriptors are compliant,
-			in binary-coded decimal (i.e. 2.0 is 0200H). This
-			property is used if any real OTG features(HNP/SRP/ADP)
-			is enabled, if ADP is required, otg-rev should be
-			0x0200 or above.
- - companion: phandle of a companion
- - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP
-			is the basic function of real OTG except you want it
-			to be a srp-capable only B device.
- - srp-disable: tells OTG controllers we want to disable OTG SRP, SRP is
-			optional for OTG device.
- - adp-disable: tells OTG controllers we want to disable OTG ADP, ADP is
-			optional for OTG device.
- - usb-role-switch: boolean, indicates that the device is capable of assigning
-			the USB data role (USB host or USB device) for a given
-			USB connector, such as Type-C, Type-B(micro).
-			see connector/usb-connector.yaml.
- - role-switch-default-mode: indicating if usb-role-switch is enabled, the
-			device default operation mode of controller while usb
-			role is USB_ROLE_NONE. Valid arguments are "host" and
-			"peripheral". Defaults to "peripheral" if not
-			specified.
-
-
-This is an attribute to a USB controller such as:
-
-dwc3@4a030000 {
-	compatible = "synopsys,dwc3";
-	reg = <0x4a030000 0xcfff>;
-	interrupts = <0 92 4>
-	usb-phy = <&usb2_phy>, <&usb3,phy>;
-	maximum-speed = "super-speed";
-	dr_mode = "otg";
-	phy_type = "utmi_wide";
-	otg-rev = <0x0200>;
-	adp-disable;
-};
diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
index 7263b7f2b510..815de24127db 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -22,9 +22,93 @@ properties:
     description:
       Name specifier for the USB PHY
 
+  maximum-speed:
+   description: |
+     Tells USB controllers we want to work up to a certain speed. In case this
+     isn't passed via DT, USB controllers should default to their maximum HW
+     capability.
+   $ref: /schemas/types.yaml#/definitions/string
+   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
+          "super-speed-plus"]
+
+  dr_mode:
+    description: |
+      Tells Dual-Role USB controllers that we want to work on a particular
+      mode. In case this attribute isn't passed via DT, USB DRD controllers
+      should default to OTG.
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: ["host", "peripheral", "otg"]
+
+  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.
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: ["utmi", "utmi_wide"]
+
+  otg-rev:
+    description: |
+      Tells usb driver the release number of the OTG and EH supplement with
+      which the device and its descriptors are compliant, in binary-coded
+      decimal (i.e. 2.0 is 0200H). This property is used if any real OTG
+      features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be
+      0x0200 or above.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  companion:
+    description: Phandle of a companion device
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  hnp-disable:
+    description: |
+      Tells OTG controllers we want to disable OTG HNP. Normally HNP is the
+      basic function of real OTG except you want it to be a srp-capable only B
+      device.
+    type: boolean
+
+  srp-disable:
+    description: |
+      Tells OTG controllers we want to disable OTG SRP. SRP is optional for OTG
+      device.
+    type: boolean
+
+  adp-disable:
+    description: |
+      Tells OTG controllers we want to disable OTG ADP. ADP is optional for OTG
+      device.
+    type: boolean
+
+  usb-role-switch:
+    description: |
+      Indicates that the device is capable of assigning the USB data role
+      (USB host or USB device) for a given USB connector, such as Type-C,
+      Type-B(micro). See connector/usb-connector.yaml.
+
+  role-switch-default-mode:
+    description: |
+      Indicates if usb-role-switch is enabled, the device default operation
+      mode of controller while usb role is USB_ROLE_NONE.
+    $ref: /schemas/types.yaml#/definitions/string
+    enum: ["host", "peripheral"]
+    default: "peripheral"
+
 examples:
   - |
     usb {
         phys = <&usb2_phy1>, <&usb3_phy1>;
         phy-names = "usb";
     };
+  - |
+    usb@4a030000 {
+        compatible = "snps,dwc3";
+        reg = <0x4a030000 0xcfff>;
+        interrupts = <0 92 4>;
+        usb-phy = <&usb2_phy>, <&usb3_phy>;
+        maximum-speed = "super-speed";
+        dr_mode = "otg";
+        phy_type = "utmi_wide";
+        otg-rev = <0x0200>;
+        adp-disable;
+    };
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
  2020-10-10 22:41 ` [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to " Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-11 14:42   ` Greg Kroah-Hartman
  2020-10-10 22:41 ` [PATCH 03/18] dt-bindings: usb: usb-hcd: Add "otg-rev" property restriction Serge Semin
                   ` (15 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

It appears that the "maximum-speed" property can also accept the
"wireless" value. Add it to the enumeration of the possible property
values then.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/usb-hcd.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
index 815de24127db..e1a82a2b3295 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -28,7 +28,7 @@ properties:
      isn't passed via DT, USB controllers should default to their maximum HW
      capability.
    $ref: /schemas/types.yaml#/definitions/string
-   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
+   enum: ["low-speed", "full-speed", "high-speed", "wireless", "super-speed",
           "super-speed-plus"]
 
   dr_mode:
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 03/18] dt-bindings: usb: usb-hcd: Add "otg-rev" property restriction
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
  2020-10-10 22:41 ` [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to " Serge Semin
  2020-10-10 22:41 ` [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-10 22:41 ` [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types Serge Semin
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

There are only four OTG revisions are currently supported by the kernel:
0x0100, 0x0120, 0x0130, 0x0200. Any another value is considered as
invalid.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/usb-hcd.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
index e1a82a2b3295..39e90147dfcc 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -56,6 +56,7 @@ properties:
       features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be
       0x0200 or above.
     $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0x0100, 0x0120, 0x0130, 0x0200]
 
   companion:
     description: Phandle of a companion device
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (2 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 03/18] dt-bindings: usb: usb-hcd: Add "otg-rev" property restriction Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-11  8:49   ` Sergei Shtylyov
  2020-10-10 22:41 ` [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property Serge Semin
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

Aside from the UTMI+ there are also ULPI, Serial and HSIC PHY types
can be specified in the phy_type HCD property. Add them to the
enumeration of the acceptable values.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 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 39e90147dfcc..1eddcbf0a9d8 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -42,11 +42,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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (3 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-11  8:47   ` Sergei Shtylyov
  2020-10-10 22:41 ` [PATCH 06/18] dt-bindings: usb: usb-hcd: Add generic "usb-phy" property Serge Semin
                   ` (12 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

The host controller device might be designed to work for the particular
products or applications. In that case it' DT node is supposed to be
equipped with the tpl-support property.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 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 1eddcbf0a9d8..c898166a8c6c 100644
--- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
+++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
@@ -97,6 +97,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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 06/18] dt-bindings: usb: usb-hcd: Add generic "usb-phy" property
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (4 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-10 22:41 ` [PATCH 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema Serge Semin
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

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 <Sergey.Semin@baikalelectronics.ru>
---
 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 c898166a8c6c..95b1dbf2a4f2 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (5 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 06/18] dt-bindings: usb: usb-hcd: Add generic "usb-phy" property Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-13 12:30   ` Rob Herring
  2020-10-10 22:41 ` [PATCH 08/18] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device Serge Semin
                   ` (10 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

Currently the DT bindings of Generic xHCI Controllers are described by means
of the legacy text file. Since such format is deprecated in favor of the
DT schema, let's convert the Generic xHCI Controllers bindings file to the
corresponding yaml files. There will be two of them: a DT schema for the
xHCI controllers on a generic platform and a DT schema validating a generic
xHCI controllers properties. The later will be used to validate the xHCI
controllers, which aside from some vendor-specific features support the
basic xHCI functionality.

An xHCI-compatible DT node shall support the standard USB HCD properties
and custom ones like: usb2-lpm-disable, usb3-lpm-capable,
quirk-broken-port-ped and imod-interval-ns. In addition if a generic xHCI
controller is being validated against the DT schema it is also supposed to
be equipped with mandatory compatible string, single registers range,
single interrupts source, and is supposed to optionally contain up to two
reference clocks for the controller core and CSRs.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 .../devicetree/bindings/usb/generic-xhci.yaml | 63 +++++++++++++++++++
 .../devicetree/bindings/usb/usb-xhci.txt      | 41 ------------
 .../devicetree/bindings/usb/usb-xhci.yaml     | 40 ++++++++++++
 3 files changed, 103 insertions(+), 41 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml
 delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt
 create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml

diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
new file mode 100644
index 000000000000..1ea1d49a8175
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/generic-xhci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: USB xHCI Controller Device Tree Bindings
+
+maintainers:
+  - Mathias Nyman <mathias.nyman@intel.com>
+
+allOf:
+  - $ref: "usb-xhci.yaml#"
+
+properties:
+  compatible:
+    oneOf:
+      - description: Generic xHCI device
+        const: generic-xhci
+      - description: Armada 37xx/375/38x/8k SoCs
+        items:
+          - enum:
+              - marvell,armada3700-xhci
+              - marvell,armada-375-xhci
+              - marvell,armada-380-xhci
+              - marvell,armada-8k-xhci
+          - const: generic-xhci
+      - description: Broadcom STB SoCs with xHCI
+        const: brcm,bcm7445-xhci
+      - description: Generic xHCI device
+        const: xhci-platform
+        deprecated: true
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    maxItems: 2
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: core
+      - const: reg
+
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    usb@f0931000 {
+      compatible = "generic-xhci";
+      reg = <0xf0931000 0x8c8>;
+      interrupts = <0x0 0x4e 0x0>;
+    };
diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt
deleted file mode 100644
index 0c5cff84a969..000000000000
--- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-USB xHCI controllers
-
-Required properties:
-  - compatible: should be one or more of
-
-    - "generic-xhci" for generic XHCI device
-    - "marvell,armada3700-xhci" for Armada 37xx SoCs
-    - "marvell,armada-375-xhci" for Armada 375 SoCs
-    - "marvell,armada-380-xhci" for Armada 38x SoCs
-    - "brcm,bcm7445-xhci" for Broadcom STB SoCs with XHCI
-    - "xhci-platform" (deprecated)
-
-    When compatible with the generic version, nodes must list the
-    SoC-specific version corresponding to the platform first
-    followed by the generic version.
-
-  - reg: should contain address and length of the standard XHCI
-    register set for the device.
-  - interrupts: one XHCI interrupt should be described here.
-
-Optional properties:
-  - clocks: reference to the clocks
-  - clock-names: mandatory if there is a second clock, in this case
-    the name must be "core" for the first clock and "reg" for the
-    second one
-  - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
-  - usb3-lpm-capable: determines if platform is USB3 LPM capable
-  - quirk-broken-port-ped: set if the controller has broken port disable mechanism
-  - imod-interval-ns: default interrupt moderation interval is 5000ns
-  - phys : see usb-hcd.yaml in the current directory
-
-additionally the properties from usb-hcd.yaml (in the current directory) are
-supported.
-
-
-Example:
-	usb@f0931000 {
-		compatible = "generic-xhci";
-		reg = <0xf0931000 0x8c8>;
-		interrupts = <0x0 0x4e 0x0>;
-	};
diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.yaml b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
new file mode 100644
index 000000000000..c5c177f2e055
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/usb-xhci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic USB xHCI Controller Device Tree Bindings
+
+maintainers:
+  - Mathias Nyman <mathias.nyman@intel.com>
+
+allOf:
+  - $ref: "usb-hcd.yaml#"
+
+properties:
+  usb2-lpm-disable:
+    description: Indicates if we don't want to enable USB2 HW LPM
+    type: boolean
+
+  usb3-lpm-capable:
+    description: Determines if platform is USB3 LPM capable
+    type: boolean
+
+  quirk-broken-port-ped:
+    description: Set if the controller has broken port disable mechanism
+    type: boolean
+
+  imod-interval-ns:
+    description: Interrupt moderation interval
+    default: 5000
+
+examples:
+  - |
+    usb@f0930000 {
+      compatible = "generic-xhci";
+      reg = <0xf0930000 0x8c8>;
+      interrupts = <0x0 0x4e 0x0>;
+      usb2-lpm-disable;
+      usb3-lpm-capable;
+    };
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 08/18] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (6 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-10 22:41 ` [PATCH 09/18] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file Serge Semin
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

For some reason the "brcm,xhci-brcm-v2" compatible string has been missing
in the original bindings file. Add it to the Generic xHCI Controllers DT
schema since driver expects it to be supported.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/generic-xhci.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
index 1ea1d49a8175..23d73df96ea3 100644
--- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
@@ -26,7 +26,9 @@ properties:
               - marvell,armada-8k-xhci
           - const: generic-xhci
       - description: Broadcom STB SoCs with xHCI
-        const: brcm,bcm7445-xhci
+        enum:
+          - brcm,xhci-brcm-v2
+          - brcm,bcm7445-xhci
       - description: Generic xHCI device
         const: xhci-platform
         deprecated: true
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 09/18] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (7 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 08/18] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-10 22:41 ` [PATCH 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema Serge Semin
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Lad Prabhakar, Yoshihiro Shimoda
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

With minor peculiarities (like uploading some vendor-specific firmware)
these are just Generic xHCI controllers fully compatible with its
properties. Make sure the Renesas USB xHCI DT nodes are also validated
against the Generic xHCI DT schema.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml
index add9f7b66da0..4491567152a1 100644
--- a/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/renesas,usb-xhci.yaml
@@ -11,7 +11,7 @@ maintainers:
   - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
 
 allOf:
-  - $ref: "usb-hcd.yaml"
+  - $ref: "usb-xhci.yaml"
 
 properties:
   compatible:
@@ -68,7 +68,7 @@ required:
   - power-domains
   - resets
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (8 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 09/18] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-13 12:36   ` Rob Herring
  2020-10-10 22:41 ` [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support Serge Semin
                   ` (7 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

DWC USB3 DT node is supposed to be compliant with the Generic xHCI
Controller schema, but with additional vendor-specific properties, the
controller-specific reference clocks and PHYs. So let's convert the
currently available legacy text-based DWC USB3 bindings to the DT schema
and make sure the DWC USB3 nodes are also validated against the
usb-xhci.yaml schema.

Note we have to discard the nodename restriction of being prefixed with
"dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes
are supposed to be named as "^usb(@.*)".

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>

---

Alas applying the usb-hcd.yaml schema on the DWC USB3 nodes will cause
dtbs_check failures since a lot of "snps,dwc3"-compatible DT nodes are
named with prefixes like "^dwc3@", "^usb[0-9]@" and even "^dwusb@", while
usb-hcd.yaml permits the "^usb@" prefix only. As I see it the better but
more painful solution would be to fix the corresponding DTS files (it's
some of the Qualcomm, HiSilicon, Exynos, Allwinner, Omap, Stih, APM and
Freescale DTS'es) so the DWC USB3 DT nodes would comply with the generic
USB HCD node naming schema. Alternatively we could either extend the
naming space in the usb-hcd.yaml or extract the generic properties to a
dedicated DT schema file. What do you think?
---
 .../devicetree/bindings/usb/dwc3.txt          | 125 --------
 .../devicetree/bindings/usb/snps,dwc3.yaml    | 295 ++++++++++++++++++
 2 files changed, 295 insertions(+), 125 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
 create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml

diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
deleted file mode 100644
index d03edf9d3935..000000000000
--- a/Documentation/devicetree/bindings/usb/dwc3.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-synopsys DWC3 CORE
-
-DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties
-      as described in 'usb/generic.txt'
-
-Required properties:
- - compatible: must be "snps,dwc3"
- - reg : Address and length of the register set for the device
- - interrupts: Interrupts used by the dwc3 controller.
- - clock-names: list of clock names. Ideally should be "ref",
-                "bus_early", "suspend" but may be less or more.
- - clocks: list of phandle and clock specifier pairs corresponding to
-           entries in the clock-names property.
-
-Exception for clocks:
-  clocks are optional if the parent node (i.e. glue-layer) is compatible to
-  one of the following:
-    "cavium,octeon-7130-usb-uctl"
-    "qcom,dwc3"
-    "samsung,exynos5250-dwusb3"
-    "samsung,exynos5433-dwusb3"
-    "samsung,exynos7-dwusb3"
-    "sprd,sc9860-dwc3"
-    "st,stih407-dwc3"
-    "ti,am437x-dwc3"
-    "ti,dwc3"
-    "ti,keystone-dwc3"
-    "rockchip,rk3399-dwc3"
-    "xlnx,zynqmp-dwc3"
-
-Optional properties:
- - usb-phy : array of phandle for the PHY device.  The first element
-   in the array is expected to be a handle to the USB2/HS PHY and
-   the second element is expected to be a handle to the USB3/SS PHY
- - phys: from the *Generic PHY* bindings
- - phy-names: from the *Generic PHY* bindings; supported names are "usb2-phy"
-	or "usb3-phy".
- - resets: set of phandle and reset specifier pairs
- - snps,usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
- - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable
- - snps,dis-start-transfer-quirk: when set, disable isoc START TRANSFER command
-			failure SW work-around for DWC_usb31 version 1.70a-ea06
-			and prior.
- - snps,disable_scramble_quirk: true when SW should disable data scrambling.
-	Only really useful for FPGA builds.
- - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled
- - snps,lpm-nyet-threshold: LPM NYET threshold
- - snps,u2exit_lfps_quirk: set if we want to enable u2exit lfps quirk
- - snps,u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
- - snps,req_p1p2p3_quirk: when set, the core will always request for
-			P1/P2/P3 transition sequence.
- - snps,del_p1p2p3_quirk: when set core will delay P1/P2/P3 until a certain
-			amount of 8B10B errors occur.
- - snps,del_phy_power_chg_quirk: when set core will delay PHY power change
-			from P0 to P1/P2/P3.
- - snps,lfps_filter_quirk: when set core will filter LFPS reception.
- - snps,rx_detect_poll_quirk: when set core will disable a 400us delay to start
-			Polling LFPS after RX.Detect.
- - snps,tx_de_emphasis_quirk: when set core will set Tx de-emphasis value.
- - snps,tx_de_emphasis: the value driven to the PHY is controlled by the
-			LTSSM during USB3 Compliance mode.
- - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy.
- - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy.
- - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG,
-			disabling the suspend signal to the PHY.
- - snps,dis-u1-entry-quirk: set if link entering into U1 needs to be disabled.
- - snps,dis-u2-entry-quirk: set if link entering into U2 needs to be disabled.
- - snps,dis_rxdet_inp3_quirk: when set core will disable receiver detection
-			in PHY P3 power state.
- - snps,dis-u2-freeclk-exists-quirk: when set, clear the u2_freeclk_exists
-			in GUSB2PHYCFG, specify that USB2 PHY doesn't provide
-			a free-running PHY clock.
- - snps,dis-del-phy-power-chg-quirk: when set core will change PHY power
-			from P0 to P1/P2/P3 without delay.
- - snps,dis-tx-ipgap-linecheck-quirk: when set, disable u2mac linestate check
-			during HS transmit.
- - snps,parkmode-disable-ss-quirk: when set, all SuperSpeed bus instances in
-			park mode are disabled.
- - snps,dis_metastability_quirk: when set, disable metastability workaround.
-			CAUTION: use only if you are absolutely sure of it.
- - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal
-			utmi_l1_suspend_n, false when asserts utmi_sleep_n
- - snps,hird-threshold: HIRD threshold
- - snps,hsphy_interface: High-Speed PHY interface selection between "utmi" for
-   UTMI+ and "ulpi" for ULPI when the DWC_USB3_HSPHY_INTERFACE has value 3.
- - snps,quirk-frame-length-adjustment: Value for GFLADJ_30MHZ field of GFLADJ
-	register for post-silicon frame length adjustment when the
-	fladj_30mhz_sdbnd signal is invalid or incorrect.
- - snps,rx-thr-num-pkt-prd: periodic ESS RX packet threshold count - host mode
-			only. Set this and rx-max-burst-prd to a valid,
-			non-zero value 1-16 (DWC_usb31 programming guide
-			section 1.2.4) to enable periodic ESS RX threshold.
- - snps,rx-max-burst-prd: max periodic ESS RX burst size - host mode only. Set
-			this and rx-thr-num-pkt-prd to a valid, non-zero value
-			1-16 (DWC_usb31 programming guide section 1.2.4) to
-			enable periodic ESS RX threshold.
- - snps,tx-thr-num-pkt-prd: periodic ESS TX packet threshold count - host mode
-			only. Set this and tx-max-burst-prd to a valid,
-			non-zero value 1-16 (DWC_usb31 programming guide
-			section 1.2.3) to enable periodic ESS TX threshold.
- - snps,tx-max-burst-prd: max periodic ESS TX burst size - host mode only. Set
-			this and tx-thr-num-pkt-prd to a valid, non-zero value
-			1-16 (DWC_usb31 programming guide section 1.2.3) to
-			enable periodic ESS TX threshold.
-
- - <DEPRECATED> tx-fifo-resize: determines if the FIFO *has* to be reallocated.
- - snps,incr-burst-type-adjustment: Value for INCR burst type of GSBUSCFG0
-			register, undefined length INCR burst type enable and INCRx type.
-			When just one value, which means INCRX burst mode enabled. When
-			more than one value, which means undefined length INCR burst type
-			enabled. The values can be 1, 4, 8, 16, 32, 64, 128 and 256.
-
- - in addition all properties from usb-xhci.txt from the current directory are
-   supported as well
-
-
-This is usually a subnode to DWC3 glue to which it is connected.
-
-dwc3@4a030000 {
-	compatible = "snps,dwc3";
-	reg = <0x4a030000 0xcfff>;
-	interrupts = <0 92 4>
-	usb-phy = <&usb2_phy>, <&usb3,phy>;
-	snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
-};
diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
new file mode 100644
index 000000000000..24808fc2c7e3
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -0,0 +1,295 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synopsys DesignWare USB3 Controller
+
+maintainers:
+  - Felipe Balbi <balbi@kernel.org>
+
+description: |
+  This is usually a subnode to DWC3 glue to which it is connected, but can also
+  be presented as a standalone DT node with an optional vendor-specific
+  compatible string.
+
+allOf:
+  - $ref: "usb-xhci.yaml#"
+
+properties:
+  compatible:
+    contains:
+      const: "snps,dwc3"
+
+  interrupts:
+    minItems: 1
+    maxItems: 3
+
+  clocks:
+    description: |
+      In general the core supports three types of clocks. bus_clk_early is a
+      SoC Bus Clock (AHB/AXI/Native). ref_clk generates ITP when the UTMI/ULPI
+      PHY is suspended. suspend_clk clocks a small part of the USB3 core when
+      SS PHY in P3. But particular cases may differ from that having less or
+      more clock sources with another names.
+
+  clock-names:
+    contains:
+      anyOf:
+        - enum: ["bus_early", "ref", "suspend"]
+        - true
+
+  usb-phy:
+   minItems: 1
+   items:
+     - description: USB2/HS PHY
+     - description: USB3/SS PHY
+
+  phys:
+    minItems: 1
+    items:
+      - description: USB2/HS PHY
+      - description: USB3/SS PHY
+
+  phy-names:
+    minItems: 1
+    items:
+      - const: usb2-phy
+      - const: usb3-phy
+
+  resets:
+    minItems: 1
+
+  snps,usb2-lpm-disable:
+    description: Indicate if we don't want to enable USB2 HW LPM
+    type: boolean
+
+  snps,usb3_lpm_capable:
+    description: Determines if platform is USB3 LPM capable
+    type: boolean
+
+  snps,dis-start-transfer-quirk:
+    description: |
+      When set, disable isoc START TRANSFER command failure SW work-around
+      for DWC_usb31 version 1.70a-ea06 and prior.
+    type: boolean
+
+  snps,disable_scramble_quirk:
+    description: |
+      True when SW should disable data scrambling. Only really useful for FPGA
+      builds.
+    type: boolean
+
+  snps,has-lpm-erratum:
+    description: True when DWC3 was configured with LPM Erratum enabled
+    type: boolean
+
+  snps,lpm-nyet-threshold:
+    description: LPM NYET threshold
+    $ref: /schemas/types.yaml#/definitions/uint8
+
+  snps,u2exit_lfps_quirk:
+    description: Set if we want to enable u2exit lfps quirk
+    type: boolean
+
+  snps,u2ss_inp3_quirk:
+    description: Set if we enable P3 OK for U2/SS Inactive quirk
+    type: boolean
+
+  snps,req_p1p2p3_quirk:
+    description: |
+      When set, the core will always request for P1/P2/P3 transition sequence.
+    type: boolean
+
+  snps,del_p1p2p3_quirk:
+    description: |
+      When set core will delay P1/P2/P3 until a certain amount of 8B10B errors
+      occur.
+    type: boolean
+
+  snps,del_phy_power_chg_quirk:
+    description: When set core will delay PHY power change from P0 to P1/P2/P3.
+    type: boolean
+
+  snps,lfps_filter_quirk:
+    description: When set core will filter LFPS reception.
+    type: boolean
+
+  snps,rx_detect_poll_quirk:
+    description: |
+      when set core will disable a 400us delay to start Polling LFPS after
+      RX.Detect.
+    type: boolean
+
+  snps,tx_de_emphasis_quirk:
+    description: When set core will set Tx de-emphasis value
+    type: boolean
+
+  snps,tx_de_emphasis:
+    description: |
+      The value driven to the PHY is controlled by the LTSSM during USB3
+      Compliance mode.
+    $ref: /schemas/types.yaml#/definitions/uint8
+
+  snps,dis_u3_susphy_quirk:
+    description: When set core will disable USB3 suspend phy
+    type: boolean
+
+  snps,dis_u2_susphy_quirk:
+    description: When set core will disable USB2 suspend phy
+    type: boolean
+
+  snps,dis_enblslpm_quirk:
+    description: |
+      When set clears the enblslpm in GUSB2PHYCFG, disabling the suspend signal
+      to the PHY.
+    type: boolean
+
+  snps,dis-u1-entry-quirk:
+    description: Set if link entering into U1 needs to be disabled
+    type: boolean
+
+  snps,dis-u2-entry-quirk:
+    description: Set if link entering into U2 needs to be disabled
+    type: boolean
+
+  snps,dis_rxdet_inp3_quirk:
+    description: |
+      When set core will disable receiver detection in PHY P3 power state.
+    type: boolean
+
+  snps,dis-u2-freeclk-exists-quirk:
+    description: |
+      When set, clear the u2_freeclk_exists in GUSB2PHYCFG, specify that USB2
+      PHY doesn't provide a free-running PHY clock.
+    type: boolean
+
+  snps,dis-del-phy-power-chg-quirk:
+    description: |
+      When set core will change PHY power from P0 to P1/P2/P3 without delay.
+    type: boolean
+
+  snps,dis-tx-ipgap-linecheck-quirk:
+    description: When set, disable u2mac linestate check during HS transmit
+    type: boolean
+
+  snps,parkmode-disable-ss-quirk:
+    description: |
+      When set, all SuperSpeed bus instances in park mode are disabled.
+    type: boolean
+
+  snps,dis_metastability_quirk:
+    description: |
+      When set, disable metastability workaround. CAUTION! Use only if you are
+      absolutely sure of it.
+    type: boolean
+
+  snps,is-utmi-l1-suspend:
+    description: |
+      True when DWC3 asserts output signal utmi_l1_suspend_n, false when
+      asserts utmi_sleep_n.
+    type: boolean
+
+  snps,hird-threshold:
+    description: HIRD threshold
+    $ref: /schemas/types.yaml#/definitions/uint8
+
+  snps,hsphy_interface:
+    description: |
+      High-Speed PHY interface selection between UTMI+ and ULPI when the
+      DWC_USB3_HSPHY_INTERFACE has value 3.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    enum: ["utmi", "ulpi"]
+
+  snps,quirk-frame-length-adjustment:
+    description: |
+      Value for GFLADJ_30MHZ field of GFLADJ register for post-silicon frame
+      length adjustment when the fladj_30mhz_sdbnd signal is invalid or
+      incorrect.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  snps,rx-thr-num-pkt-prd:
+    description: |
+      Periodic ESS RX packet threshold count (host mode only). Set this and
+      snps,rx-max-burst-prd to a valid, non-zero value 1-16 (DWC_usb31
+      programming guide section 1.2.4) to enable periodic ESS RX threshold.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 1
+    maximum: 16
+
+  snps,rx-max-burst-prd:
+    description: |
+      Max periodic ESS RX burst size (host mode only). Set this and
+      snps,rx-thr-num-pkt-prd to a valid, non-zero value 1-16 (DWC_usb31
+      programming guide section 1.2.4) to enable periodic ESS RX threshold.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 1
+    maximum: 16
+
+  snps,tx-thr-num-pkt-prd:
+    description: |
+      Periodic ESS TX packet threshold count (host mode only). Set this and
+      snps,tx-max-burst-prd to a valid, non-zero value 1-16 (DWC_usb31
+      programming guide section 1.2.3) to enable periodic ESS TX threshold.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 1
+    maximum: 16
+
+  snps,tx-max-burst-prd:
+    description: |
+      Max periodic ESS TX burst size (host mode only). Set this and
+      snps,tx-thr-num-pkt-prd to a valid, non-zero value 1-16 (DWC_usb31
+      programming guide section 1.2.3) to enable periodic ESS TX threshold.
+    $ref: /schemas/types.yaml#/definitions/uint8
+    minimum: 1
+    maximum: 16
+
+  tx-fifo-resize:
+    description: Determines if the FIFO *has* to be reallocated
+    deprecated: true
+    type: boolean
+
+  snps,incr-burst-type-adjustment:
+    description: |
+      Value for INCR burst type of GSBUSCFG0 register, undefined length INCR
+      burst type enable and INCRx type. A single value means INCRX burst mode
+      enabled. If more than one value specified, undefined length INCR burst
+      type will be enabled with burst lengths utilized up to the maximum
+      of the values passed in this property.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 1
+    maxItems: 8
+    uniqueItems: true
+    items:
+      enum: [1, 4, 8, 16, 32, 64, 128, 256]
+
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    usb@4a030000 {
+      compatible = "snps,dwc3";
+      reg = <0x4a030000 0xcfff>;
+      interrupts = <0 92 4>;
+      usb-phy = <&usb2_phy>, <&usb3_phy>;
+      snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
+    };
+  - |
+    usb@4a000000 {
+      compatible = "snps,dwc3";
+      reg = <0x4a000000 0xcfff>;
+      interrupts = <0 92 4>;
+      clocks = <&clk 1>, <&clk 2>, <&clk 3>;
+      clock-names = "bus_early", "ref", "suspend";
+      phys = <&usb2_phy>, <&usb3_phy>;
+      phy-names = "usb2-phy", "usb3-phy";
+      snps,dis_u2_susphy_quirk;
+      snps,dis_enblslpm_quirk;
+    };
+...
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (9 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-11  8:53   ` Sergei Shtylyov
  2020-10-10 22:41 ` [PATCH 12/18] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string Serge Semin
                   ` (6 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

The controller driver supports two types of DWC USB3 devices: with a
common interrupt lane and with individual interrupts for each mode. Add
both of these cases support to the DWC USB3 DT schema.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index 24808fc2c7e3..6857086920c2 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -23,8 +23,19 @@ properties:
       const: "snps,dwc3"
 
   interrupts:
+    description: |
+      It's either a single common DWC3 interrupt (dwc_usb3) or individual
+      interrupts for the host, gadget and DRD modes.
+    minItems: 1
+    maxItems: 3
+
+  interrupt-names:
     minItems: 1
     maxItems: 3
+    oneOf:
+      - const: "dwc_usb3"
+      - items:
+          enum: ["host", "peripheral", "otg"]
 
   clocks:
     description: |
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 12/18] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (10 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-10 22:41 ` [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions Serge Semin
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

The DWC USB3 driver and some DTS files like Exynos 5250, Keystone k2e, etc
expects the DWC USB3 DT node to have the compatible string with the
"synopsys" vendor prefix. Let's add the corresponding compatible string to
the controller DT schema, but mark it as deprecated seeing the Synopsys,
Inc. is presented with just "snps" vendor prefix.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index 6857086920c2..fe1b372fda80 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -20,7 +20,10 @@ allOf:
 properties:
   compatible:
     contains:
-      const: "snps,dwc3"
+      oneOf:
+        - const: "snps,dwc3"
+        - const: "synopsys,dwc3"
+          deprecated: true
 
   interrupts:
     description: |
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (11 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 12/18] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-11  8:56   ` Sergei Shtylyov
  2020-10-10 22:41 ` [PATCH 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj restrictions Serge Semin
                   ` (4 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

In accordance with the driver comments the PIPE3 de-emphasis can be tunned
to be either -6dB, or -2.5dB or disabled. Let's add the de-emphasis
property restriction so the DT schema would make sure the controller DT
node is equipped with correct values.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index fe1b372fda80..36d4b8060d7c 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -145,6 +145,10 @@ properties:
       The value driven to the PHY is controlled by the LTSSM during USB3
       Compliance mode.
     $ref: /schemas/types.yaml#/definitions/uint8
+    enum:
+      - 0 # -6dB de-emphasis
+      - 1 # -3.5dB de-emphasis
+      - 2 # No de-emphasis
 
   snps,dis_u3_susphy_quirk:
     description: When set core will disable USB3 suspend phy
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj restrictions
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (12 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-13 12:38   ` Rob Herring
  2020-10-10 22:41 ` [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property Serge Semin
                   ` (3 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman,
	linux-usb, devicetree, linux-kernel

In accordance with the IP core databook the
snps,quirk-frame-length-adjustment property can be set within [0, 0x3F].
Let's make sure the DT schema applies a correct restriction on the
property.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index 36d4b8060d7c..f1e6c3dab1ff 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -226,6 +226,8 @@ properties:
       length adjustment when the fladj_30mhz_sdbnd signal is invalid or
       incorrect.
     $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 0x3f
 
   snps,rx-thr-num-pkt-prd:
     description: |
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (13 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj restrictions Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-12  7:54   ` Neil Armstrong
  2020-10-10 22:41 ` [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes Serge Semin
                   ` (2 subsequent siblings)
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Kevin Hilman, Neil Armstrong, Jerome Brunet, Martin Blumenstingl
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, linux-usb, devicetree,
	linux-kernel, linux-arm-kernel, linux-amlogic

An empty snps,quirk-frame-length-adjustment won't cause any change
performed by the driver. Moreover the DT schema validation will fail,
since it expects the property being assigned with some value. So just
discard the property declaration then from the example.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>

---

Note the same problem is in the DT source file
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
---
 .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml     | 1 -
 1 file changed, 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 5b04a7dfa018..88184d7e26cc 100644
--- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
+++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
@@ -209,6 +209,5 @@ examples:
               interrupts = <30>;
               dr_mode = "host";
               snps,dis_u2_susphy_quirk;
-              snps,quirk-frame-length-adjustment;
           };
     };
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (14 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-12  7:38   ` Neil Armstrong
  2020-10-13 12:42   ` Rob Herring
  2020-10-10 22:41 ` [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node Serge Semin
  2020-10-10 22:41 ` [PATCH 18/18] dt-bindings: usb: qcom,dwc3: " Serge Semin
  17 siblings, 2 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Kevin Hilman, Neil Armstrong, Jerome Brunet, Martin Blumenstingl
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Roger Quadros,
	Lad Prabhakar, Yoshihiro Shimoda, linux-usb, devicetree,
	linux-kernel, linux-arm-kernel, linux-amlogic

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 <Sergey.Semin@baikalelectronics.ru>
---
 .../bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 15 ++++++++++++++-
 1 file changed, 14 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 88184d7e26cc..3e8ac0ff90de 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,20 @@ properties:
 
 patternProperties:
   "^usb@[0-9a-f]+$":
-    type: object
+    allOf:
+      - if:
+          properties:
+            compatible:
+              contains:
+                const: snps,dwc2
+        then:
+          $ref: dwc2.yaml#
+      - if:
+          properties:
+            compatible:
+              const: snps,dwc3
+        then:
+          $ref: snps,dwc3.yaml#
 
 additionalProperties: false
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (15 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  2020-10-11  9:04   ` Sergei Shtylyov
  2020-10-10 22:41 ` [PATCH 18/18] dt-bindings: usb: qcom,dwc3: " Serge Semin
  17 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Roger Quadros
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Andy Gross, Bjorn Andersson, Manu Gautam, Lad Prabhakar,
	Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman, linux-usb,
	devicetree, linux-kernel

TI Keystone DWC3 compatible DT node is supposed to have a DWC USB3
compatible sub-node to describe a fully functioning USB interface.
Since DWC USB3 has now got a DT schema describing it' DT node, let's make
sure the TI Keystone DWC3 sub-node passes validation against it.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml
index c1b19fc5d0a2..ca7fbe3ed22e 100644
--- a/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/ti,keystone-dwc3.yaml
@@ -64,9 +64,7 @@ properties:
 
 patternProperties:
   "usb@[a-f0-9]+$":
-    type: object
-    description: This is the node representing the DWC3 controller instance
-      Documentation/devicetree/bindings/usb/dwc3.txt
+    $ref: snps,dwc3.yaml#
 
 required:
   - compatible
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH 18/18] dt-bindings: usb: qcom,dwc3: Validate DWC3 sub-node
  2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
                   ` (16 preceding siblings ...)
  2020-10-10 22:41 ` [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node Serge Semin
@ 2020-10-10 22:41 ` Serge Semin
  17 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-10 22:41 UTC (permalink / raw)
  To: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Andy Gross, Bjorn Andersson, Manu Gautam
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Pavel Parkhomenko,
	Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong,
	Kevin Hilman, linux-usb, devicetree, linux-kernel, linux-arm-msm

Qualcomm msm8996/sc7180/sdm845 DWC3 compatible DT nodes are supposed to
have a DWC USB3 compatible sub-node to describe a fully functioning USB
interface. Let's use the available DWC USB3 DT schema to validate
the Qualcomm DWC3 sub-nodes.

Note since the generic DWC USB3 DT node is supposed to be named as
generic USB HCD ("^usb(@.*)?") we have to accordingly extend the sub-nodes
naming space and fix the DT node example.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>

---

Alas there are many Qualcomm DTS files, which have got the Qualcomm DWC3
node defined with sub-nodes named as "^dwc3@.*". Since the generic DWC USB3
DT schema will be automatically selected for them and the naming doesn't
comply with the USB HCD DT schema, the dtbs_check procedure will fail.
I don't really know what is a most suitable way to fix that. It's either
to alter all the Qualcomm DTS files, or extend the USB HCD schema to
accept the "dwc3@.*" nodes, or redesign the usb-hcd.yaml schema. What do
you think?
---
 Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
index dac10848dd7f..b3737f0e4dc1 100644
--- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
@@ -103,11 +103,8 @@ properties:
 # Required child node:
 
 patternProperties:
-  "^dwc3@[0-9a-f]+$":
-    type: object
-    description:
-      A child node must exist to represent the core DWC3 IP block
-      The content of the node is defined in dwc3.txt.
+  "^(usb|dwc3)@[0-9a-f]+$":
+    $ref: snps,dwc3.yaml#
 
 required:
   - compatible
@@ -160,7 +157,7 @@ examples:
 
             resets = <&gcc GCC_USB30_PRIM_BCR>;
 
-            dwc3@a600000 {
+            usb@a600000 {
                 compatible = "snps,dwc3";
                 reg = <0 0x0a600000 0 0xcd00>;
                 interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property
  2020-10-10 22:41 ` [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property Serge Semin
@ 2020-10-11  8:47   ` Sergei Shtylyov
  2020-10-11 18:05     ` Serge Semin
  2020-10-11 18:06     ` Serge Semin
  0 siblings, 2 replies; 50+ messages in thread
From: Sergei Shtylyov @ 2020-10-11  8:47 UTC (permalink / raw)
  To: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring
  Cc: Serge Semin, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman, linux-usb,
	devicetree, linux-kernel

Hello!

On 11.10.2020 1:41, Serge Semin wrote:

> The host controller device might be designed to work for the particular
> products or applications. In that case it' DT node is supposed to be
                                          ^^^
    Its?

> equipped with the tpl-support property.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types
  2020-10-10 22:41 ` [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types Serge Semin
@ 2020-10-11  8:49   ` Sergei Shtylyov
  2020-10-11 18:03     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Sergei Shtylyov @ 2020-10-11  8:49 UTC (permalink / raw)
  To: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring
  Cc: Serge Semin, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman, linux-usb,
	devicetree, linux-kernel

On 11.10.2020 1:41, Serge Semin wrote:

> Aside from the UTMI+ there are also ULPI, Serial and HSIC PHY types

    "That" missing after "types"?

> can be specified in the phy_type HCD property. Add them to the
> enumeration of the acceptable values.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support
  2020-10-10 22:41 ` [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support Serge Semin
@ 2020-10-11  8:53   ` Sergei Shtylyov
  2020-10-11 18:09     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Sergei Shtylyov @ 2020-10-11  8:53 UTC (permalink / raw)
  To: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring
  Cc: Serge Semin, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman, linux-usb,
	devicetree, linux-kernel

On 11.10.2020 1:41, Serge Semin wrote:

> The controller driver supports two types of DWC USB3 devices: with a
> common interrupt lane and with individual interrupts for each mode. Add
> both of these cases support to the DWC USB3 DT schema.

    Add support for both these cases?

> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions
  2020-10-10 22:41 ` [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions Serge Semin
@ 2020-10-11  8:56   ` Sergei Shtylyov
  2020-10-11 18:14     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Sergei Shtylyov @ 2020-10-11  8:56 UTC (permalink / raw)
  To: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring
  Cc: Serge Semin, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman, linux-usb,
	devicetree, linux-kernel

On 11.10.2020 1:41, Serge Semin wrote:

> In accordance with the driver comments the PIPE3 de-emphasis can be tunned

    Tuned.

> to be either -6dB, or -2.5dB or disabled. Let's add the de-emphasis

    Either -6dB, -2.5dB, or disabled?

> property restriction so the DT schema would make sure the controller DT
> node is equipped with correct values.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
  2020-10-10 22:41 ` [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node Serge Semin
@ 2020-10-11  9:04   ` Sergei Shtylyov
  2020-10-11 18:18     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Sergei Shtylyov @ 2020-10-11  9:04 UTC (permalink / raw)
  To: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Roger Quadros
  Cc: Serge Semin, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On 11.10.2020 1:41, Serge Semin wrote:

> TI Keystone DWC3 compatible DT node is supposed to have a DWC USB3
> compatible sub-node to describe a fully functioning USB interface.
> Since DWC USB3 has now got a DT schema describing it' DT node, let's make
                                                     ^^^ its?

> sure the TI Keystone DWC3 sub-node passes validation against it.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value
  2020-10-10 22:41 ` [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value Serge Semin
@ 2020-10-11 14:42   ` Greg Kroah-Hartman
  2020-10-11 17:53     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Greg Kroah-Hartman @ 2020-10-11 14:42 UTC (permalink / raw)
  To: Serge Semin
  Cc: Mathias Nyman, Felipe Balbi, Rob Herring, Serge Semin,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 01:41:05AM +0300, Serge Semin wrote:
> It appears that the "maximum-speed" property can also accept the
> "wireless" value. Add it to the enumeration of the possible property
> values then.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
>  Documentation/devicetree/bindings/usb/usb-hcd.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> index 815de24127db..e1a82a2b3295 100644
> --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> @@ -28,7 +28,7 @@ properties:
>       isn't passed via DT, USB controllers should default to their maximum HW
>       capability.
>     $ref: /schemas/types.yaml#/definitions/string
> -   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
> +   enum: ["low-speed", "full-speed", "high-speed", "wireless", "super-speed",
>            "super-speed-plus"]

Are you sure?  wireless usb has been removed from the kernel, where do
you see a user of this?  If it's still in there, we need to just drop
it.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value
  2020-10-11 14:42   ` Greg Kroah-Hartman
@ 2020-10-11 17:53     ` Serge Semin
  2020-10-12 15:41       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-11 17:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Felipe Balbi, Rob Herring, Alexey Malahov,
	Pavel Parkhomenko, Andy Gross, Bjorn Andersson, Manu Gautam,
	Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong,
	Kevin Hilman, linux-usb, devicetree, linux-kernel

On Sun, Oct 11, 2020 at 04:42:36PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Oct 11, 2020 at 01:41:05AM +0300, Serge Semin wrote:
> > It appears that the "maximum-speed" property can also accept the
> > "wireless" value. Add it to the enumeration of the possible property
> > values then.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > ---
> >  Documentation/devicetree/bindings/usb/usb-hcd.yaml | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > index 815de24127db..e1a82a2b3295 100644
> > --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > @@ -28,7 +28,7 @@ properties:
> >       isn't passed via DT, USB controllers should default to their maximum HW
> >       capability.
> >     $ref: /schemas/types.yaml#/definitions/string
> > -   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
> > +   enum: ["low-speed", "full-speed", "high-speed", "wireless", "super-speed",
> >            "super-speed-plus"]
> 

> Are you sure?  wireless usb has been removed from the kernel, where do
> you see a user of this?  If it's still in there, we need to just drop
> it.

My decision on suggesting this patch has been based purely on the speed types
the USB core API supports and what usb_get_maximum_speed() can return.
USB_SPEED_WIRELESS type is one of the possible return values. As I can see
aside the rest of the USB speeds the wireless speed is also defined
in the kernel USB subsystem. Moreover it is used in some kernel drivers.
(See the USB_SPEED_WIRELESS enumeration constant usage.)
Are you sure that the wireless speed support has been really removed?

-Sergey

> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types
  2020-10-11  8:49   ` Sergei Shtylyov
@ 2020-10-11 18:03     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-11 18:03 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 11:49:10AM +0300, Sergei Shtylyov wrote:
> On 11.10.2020 1:41, Serge Semin wrote:
> 
> > Aside from the UTMI+ there are also ULPI, Serial and HSIC PHY types
> 

>    "That" missing after "types"?

Thanks. It really is. I'll fix it in v2.

-Sergey

> 
> > can be specified in the phy_type HCD property. Add them to the
> > enumeration of the acceptable values.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> [...]
> 
> MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property
  2020-10-11  8:47   ` Sergei Shtylyov
@ 2020-10-11 18:05     ` Serge Semin
  2020-10-11 18:06     ` Serge Semin
  1 sibling, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-11 18:05 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 11:47:37AM +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 11.10.2020 1:41, Serge Semin wrote:
> 
> > The host controller device might be designed to work for the particular
> > products or applications. In that case it' DT node is supposed to be
>                                          ^^^
>    Its?

Thanks. I'll fix it in v2.

-Sergey

> 
> > equipped with the tpl-support property.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> [...]
> 
> MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property
  2020-10-11  8:47   ` Sergei Shtylyov
  2020-10-11 18:05     ` Serge Semin
@ 2020-10-11 18:06     ` Serge Semin
  1 sibling, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-11 18:06 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman, linux-usb,
	devicetree, linux-kernel

On Sun, Oct 11, 2020 at 11:47:37AM +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 11.10.2020 1:41, Serge Semin wrote:
> 
> > The host controller device might be designed to work for the particular
> > products or applications. In that case it' DT node is supposed to be
>                                          ^^^
>    Its?

Thanks. I'll fix it in v2.

-Sergey

> 
> > equipped with the tpl-support property.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> [...]
> 
> MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support
  2020-10-11  8:53   ` Sergei Shtylyov
@ 2020-10-11 18:09     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-11 18:09 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 11:53:07AM +0300, Sergei Shtylyov wrote:
> On 11.10.2020 1:41, Serge Semin wrote:
> 
> > The controller driver supports two types of DWC USB3 devices: with a
> > common interrupt lane and with individual interrupts for each mode. Add
> > both of these cases support to the DWC USB3 DT schema.
> 

>    Add support for both these cases?

Ok. Thanks.

-Sergey

> 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> [...]
> 
> MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions
  2020-10-11  8:56   ` Sergei Shtylyov
@ 2020-10-11 18:14     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-11 18:14 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, Neil Armstrong, Kevin Hilman, linux-usb,
	devicetree, linux-kernel

On Sun, Oct 11, 2020 at 11:56:21AM +0300, Sergei Shtylyov wrote:
> On 11.10.2020 1:41, Serge Semin wrote:
> 
> > In accordance with the driver comments the PIPE3 de-emphasis can be tunned
> 

>    Tuned.

Oh. My spell checker accepted this as past participle of the verb "tun" .)

> 
> > to be either -6dB, or -2.5dB or disabled. Let's add the de-emphasis
> 

>    Either -6dB, -2.5dB, or disabled?

Hm, I always thought that "or" is supposed to be placed before each alternative
in the either-or construction, like "either ... or ... or ... or ...". Am I wrong?

-Sergey

> 
> > property restriction so the DT schema would make sure the controller DT
> > node is equipped with correct values.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> [...]
> 
> MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node
  2020-10-11  9:04   ` Sergei Shtylyov
@ 2020-10-11 18:18     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-11 18:18 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Rob Herring,
	Roger Quadros, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 12:04:06PM +0300, Sergei Shtylyov wrote:
> On 11.10.2020 1:41, Serge Semin wrote:
> 
> > TI Keystone DWC3 compatible DT node is supposed to have a DWC USB3
> > compatible sub-node to describe a fully functioning USB interface.
> > Since DWC USB3 has now got a DT schema describing it' DT node, let's make
>                                                     ^^^ its?

Ok. Thanks.

-Sergey

> 
> > sure the TI Keystone DWC3 sub-node passes validation against it.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> [...]
> 
> MBR, Sergei

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
  2020-10-10 22:41 ` [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes Serge Semin
@ 2020-10-12  7:38   ` Neil Armstrong
  2020-10-13 12:42   ` Rob Herring
  1 sibling, 0 replies; 50+ messages in thread
From: Neil Armstrong @ 2020-10-12  7:38 UTC (permalink / raw)
  To: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: Serge Semin, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, linux-usb, devicetree, linux-kernel,
	linux-arm-kernel, linux-amlogic

On 11/10/2020 00:41, Serge Semin wrote:
> 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 <Sergey.Semin@baikalelectronics.ru>
> ---
>  .../bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 15 ++++++++++++++-
>  1 file changed, 14 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 88184d7e26cc..3e8ac0ff90de 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,20 @@ properties:
>  
>  patternProperties:
>    "^usb@[0-9a-f]+$":
> -    type: object
> +    allOf:
> +      - if:
> +          properties:
> +            compatible:
> +              contains:
> +                const: snps,dwc2
> +        then:
> +          $ref: dwc2.yaml#
> +      - if:
> +          properties:
> +            compatible:
> +              const: snps,dwc3
> +        then:
> +          $ref: snps,dwc3.yaml#
>  
>  additionalProperties: false
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property
  2020-10-10 22:41 ` [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property Serge Semin
@ 2020-10-12  7:54   ` Neil Armstrong
  2020-10-12 14:22     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Neil Armstrong @ 2020-10-12  7:54 UTC (permalink / raw)
  To: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
  Cc: Serge Semin, Alexey Malahov, Pavel Parkhomenko, Andy Gross,
	Bjorn Andersson, Manu Gautam, Roger Quadros, Lad Prabhakar,
	Yoshihiro Shimoda, linux-usb, devicetree, linux-kernel,
	linux-arm-kernel, linux-amlogic

Hi,

On 11/10/2020 00:41, Serge Semin wrote:
> An empty snps,quirk-frame-length-adjustment won't cause any change
> performed by the driver. Moreover the DT schema validation will fail,
> since it expects the property being assigned with some value. So just
> discard the property declaration then from the example.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> 
> ---
> 
> Note the same problem is in the DT source file
> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
> ---
>  .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml     | 1 -
>  1 file changed, 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 5b04a7dfa018..88184d7e26cc 100644
> --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
> +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
> @@ -209,6 +209,5 @@ examples:
>                interrupts = <30>;
>                dr_mode = "host";
>                snps,dis_u2_susphy_quirk;
> -              snps,quirk-frame-length-adjustment;
>            };
>      };
> 

Thanks for reporting this, actually the fladj must be 0x20 on this hw,
but we do set this on the PHY side, so we can let the dwc3 side 0 here.

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

Neil


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property
  2020-10-12  7:54   ` Neil Armstrong
@ 2020-10-12 14:22     ` Serge Semin
  2020-10-12 15:01       ` Neil Armstrong
  0 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-12 14:22 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	linux-usb, devicetree, linux-kernel, linux-arm-kernel,
	linux-amlogic

On Mon, Oct 12, 2020 at 09:54:25AM +0200, Neil Armstrong wrote:
> Hi,
> 
> On 11/10/2020 00:41, Serge Semin wrote:
> > An empty snps,quirk-frame-length-adjustment won't cause any change
> > performed by the driver. Moreover the DT schema validation will fail,
> > since it expects the property being assigned with some value. So just
> > discard the property declaration then from the example.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > 
> > ---
> > 
> > Note the same problem is in the DT source file
> > arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
> > ---
> >  .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml     | 1 -
> >  1 file changed, 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 5b04a7dfa018..88184d7e26cc 100644
> > --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
> > +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
> > @@ -209,6 +209,5 @@ examples:
> >                interrupts = <30>;
> >                dr_mode = "host";
> >                snps,dis_u2_susphy_quirk;
> > -              snps,quirk-frame-length-adjustment;
> >            };
> >      };
> > 
> 

> Thanks for reporting this, actually the fladj must be 0x20 on this hw,
> but we do set this on the PHY side, so we can let the dwc3 side 0 here.

I can convert this patch to initializing the "snps,quirk-frame-length-adjustment"
property with 0x20 value instead. Since most likely I'll have to send a v2/v3/etc
of this patchset, that modification won't be too much work to do. What do you think?

Anyway please note, that I've fixed the improper property usage in the DT schema
example only. "snps,quirk-frame-length-adjustment" defined as boolean still
persists in the DTS file: arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
So if you ever try to validate that dts file with "make dtbs_check" scenario, it
will fail.

-Sergey

> 
> Acked-by: Neil Armstrong <narmstrong@baylibre.com>
> 
> Neil
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property
  2020-10-12 14:22     ` Serge Semin
@ 2020-10-12 15:01       ` Neil Armstrong
  2020-10-12 15:13         ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Neil Armstrong @ 2020-10-12 15:01 UTC (permalink / raw)
  To: Serge Semin
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	linux-usb, devicetree, linux-kernel, linux-arm-kernel,
	linux-amlogic

Hi,

On 12/10/2020 16:22, Serge Semin wrote:
> On Mon, Oct 12, 2020 at 09:54:25AM +0200, Neil Armstrong wrote:
>> Hi,
>>
>> On 11/10/2020 00:41, Serge Semin wrote:
>>> An empty snps,quirk-frame-length-adjustment won't cause any change
>>> performed by the driver. Moreover the DT schema validation will fail,
>>> since it expects the property being assigned with some value. So just
>>> discard the property declaration then from the example.
>>>
>>> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>>>
>>> ---
>>>
>>> Note the same problem is in the DT source file
>>> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
>>> ---
>>>  .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml     | 1 -
>>>  1 file changed, 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 5b04a7dfa018..88184d7e26cc 100644
>>> --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
>>> +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
>>> @@ -209,6 +209,5 @@ examples:
>>>                interrupts = <30>;
>>>                dr_mode = "host";
>>>                snps,dis_u2_susphy_quirk;
>>> -              snps,quirk-frame-length-adjustment;
>>>            };
>>>      };
>>>
>>
> 
>> Thanks for reporting this, actually the fladj must be 0x20 on this hw,
>> but we do set this on the PHY side, so we can let the dwc3 side 0 here.
> 
> I can convert this patch to initializing the "snps,quirk-frame-length-adjustment"
> property with 0x20 value instead. Since most likely I'll have to send a v2/v3/etc
> of this patchset, that modification won't be too much work to do. What do you think?

Yes, do this please, anyway it's only an example so it's ok.

> 
> Anyway please note, that I've fixed the improper property usage in the DT schema
> example only. "snps,quirk-frame-length-adjustment" defined as boolean still
> persists in the DTS file: arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
> So if you ever try to validate that dts file with "make dtbs_check" scenario, it
> will fail.

Yes, I'll push a fix to pass the dtbs_check when this is merged.

Thanks,
Neil

> 
> -Sergey
> 
>>
>> Acked-by: Neil Armstrong <narmstrong@baylibre.com>
>>
>> Neil
>>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property
  2020-10-12 15:01       ` Neil Armstrong
@ 2020-10-12 15:13         ` Serge Semin
  2020-10-12 15:29           ` Neil Armstrong
  0 siblings, 1 reply; 50+ messages in thread
From: Serge Semin @ 2020-10-12 15:13 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	linux-usb, devicetree, linux-kernel, linux-arm-kernel,
	linux-amlogic

On Mon, Oct 12, 2020 at 05:01:43PM +0200, Neil Armstrong wrote:
> Hi,
> 
> On 12/10/2020 16:22, Serge Semin wrote:
> > On Mon, Oct 12, 2020 at 09:54:25AM +0200, Neil Armstrong wrote:
> >> Hi,
> >>
> >> On 11/10/2020 00:41, Serge Semin wrote:
> >>> An empty snps,quirk-frame-length-adjustment won't cause any change
> >>> performed by the driver. Moreover the DT schema validation will fail,
> >>> since it expects the property being assigned with some value. So just
> >>> discard the property declaration then from the example.
> >>>
> >>> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> >>>
> >>> ---
> >>>
> >>> Note the same problem is in the DT source file
> >>> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
> >>> ---
> >>>  .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml     | 1 -
> >>>  1 file changed, 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 5b04a7dfa018..88184d7e26cc 100644
> >>> --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
> >>> +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
> >>> @@ -209,6 +209,5 @@ examples:
> >>>                interrupts = <30>;
> >>>                dr_mode = "host";
> >>>                snps,dis_u2_susphy_quirk;
> >>> -              snps,quirk-frame-length-adjustment;
> >>>            };
> >>>      };
> >>>
> >>
> > 
> >> Thanks for reporting this, actually the fladj must be 0x20 on this hw,
> >> but we do set this on the PHY side, so we can let the dwc3 side 0 here.
> > 
> > I can convert this patch to initializing the "snps,quirk-frame-length-adjustment"
> > property with 0x20 value instead. Since most likely I'll have to send a v2/v3/etc
> > of this patchset, that modification won't be too much work to do. What do you think?
> 

> Yes, do this please,

Ok. Shall I preserve your Acked-by tag in the new patch or you'd prefer to
review it first?

> anyway it's only an example so it's ok.

Actually examples are also validated by "make dt_binding_check". That's why I
had to fix the amlogic,meson-g12a-usb-ctrl example for at least so the new
snps,dwc3.yaml DT schema wouldn't break that full DT bindings
validation procedure.)

-Sergey

> 
> > 
> > Anyway please note, that I've fixed the improper property usage in the DT schema
> > example only. "snps,quirk-frame-length-adjustment" defined as boolean still
> > persists in the DTS file: arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
> > So if you ever try to validate that dts file with "make dtbs_check" scenario, it
> > will fail.
> 
> Yes, I'll push a fix to pass the dtbs_check when this is merged.
> 
> Thanks,
> Neil
> 
> > 
> > -Sergey
> > 
> >>
> >> Acked-by: Neil Armstrong <narmstrong@baylibre.com>
> >>
> >> Neil
> >>
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property
  2020-10-12 15:13         ` Serge Semin
@ 2020-10-12 15:29           ` Neil Armstrong
  0 siblings, 0 replies; 50+ messages in thread
From: Neil Armstrong @ 2020-10-12 15:29 UTC (permalink / raw)
  To: Serge Semin
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Rob Herring, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	linux-usb, devicetree, linux-kernel, linux-arm-kernel,
	linux-amlogic

On 12/10/2020 17:13, Serge Semin wrote:
> On Mon, Oct 12, 2020 at 05:01:43PM +0200, Neil Armstrong wrote:
>> Hi,
>>
>> On 12/10/2020 16:22, Serge Semin wrote:
>>> On Mon, Oct 12, 2020 at 09:54:25AM +0200, Neil Armstrong wrote:
>>>> Hi,
>>>>
>>>> On 11/10/2020 00:41, Serge Semin wrote:
>>>>> An empty snps,quirk-frame-length-adjustment won't cause any change
>>>>> performed by the driver. Moreover the DT schema validation will fail,
>>>>> since it expects the property being assigned with some value. So just
>>>>> discard the property declaration then from the example.
>>>>>
>>>>> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>>>>>
>>>>> ---
>>>>>
>>>>> Note the same problem is in the DT source file
>>>>> arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
>>>>> ---
>>>>>  .../devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml     | 1 -
>>>>>  1 file changed, 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 5b04a7dfa018..88184d7e26cc 100644
>>>>> --- a/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
>>>>> +++ b/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml
>>>>> @@ -209,6 +209,5 @@ examples:
>>>>>                interrupts = <30>;
>>>>>                dr_mode = "host";
>>>>>                snps,dis_u2_susphy_quirk;
>>>>> -              snps,quirk-frame-length-adjustment;
>>>>>            };
>>>>>      };
>>>>>
>>>>
>>>
>>>> Thanks for reporting this, actually the fladj must be 0x20 on this hw,
>>>> but we do set this on the PHY side, so we can let the dwc3 side 0 here.
>>>
>>> I can convert this patch to initializing the "snps,quirk-frame-length-adjustment"
>>> property with 0x20 value instead. Since most likely I'll have to send a v2/v3/etc
>>> of this patchset, that modification won't be too much work to do. What do you think?
>>
> 
>> Yes, do this please,
> 
> Ok. Shall I preserve your Acked-by tag in the new patch or you'd prefer to
> review it first?

Yes, preserve it,
Thanks,
Neil

>> anyway it's only an example so it's ok.
> 
> Actually examples are also validated by "make dt_binding_check". That's why I
> had to fix the amlogic,meson-g12a-usb-ctrl example for at least so the new
> snps,dwc3.yaml DT schema wouldn't break that full DT bindings
> validation procedure.)
> 
> -Sergey
> 
>>
>>>
>>> Anyway please note, that I've fixed the improper property usage in the DT schema
>>> example only. "snps,quirk-frame-length-adjustment" defined as boolean still
>>> persists in the DTS file: arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi .
>>> So if you ever try to validate that dts file with "make dtbs_check" scenario, it
>>> will fail.
>>
>> Yes, I'll push a fix to pass the dtbs_check when this is merged.
>>
>> Thanks,
>> Neil
>>
>>>
>>> -Sergey
>>>
>>>>
>>>> Acked-by: Neil Armstrong <narmstrong@baylibre.com>
>>>>
>>>> Neil
>>>>
>>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value
  2020-10-11 17:53     ` Serge Semin
@ 2020-10-12 15:41       ` Greg Kroah-Hartman
  2020-10-12 21:19         ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Greg Kroah-Hartman @ 2020-10-12 15:41 UTC (permalink / raw)
  To: Serge Semin
  Cc: Mathias Nyman, Felipe Balbi, Rob Herring, Alexey Malahov,
	Pavel Parkhomenko, Andy Gross, Bjorn Andersson, Manu Gautam,
	Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda, Neil Armstrong,
	Kevin Hilman, linux-usb, devicetree, linux-kernel

On Sun, Oct 11, 2020 at 08:53:33PM +0300, Serge Semin wrote:
> On Sun, Oct 11, 2020 at 04:42:36PM +0200, Greg Kroah-Hartman wrote:
> > On Sun, Oct 11, 2020 at 01:41:05AM +0300, Serge Semin wrote:
> > > It appears that the "maximum-speed" property can also accept the
> > > "wireless" value. Add it to the enumeration of the possible property
> > > values then.
> > > 
> > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > ---
> > >  Documentation/devicetree/bindings/usb/usb-hcd.yaml | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > > index 815de24127db..e1a82a2b3295 100644
> > > --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > > +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > > @@ -28,7 +28,7 @@ properties:
> > >       isn't passed via DT, USB controllers should default to their maximum HW
> > >       capability.
> > >     $ref: /schemas/types.yaml#/definitions/string
> > > -   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
> > > +   enum: ["low-speed", "full-speed", "high-speed", "wireless", "super-speed",
> > >            "super-speed-plus"]
> > 
> 
> > Are you sure?  wireless usb has been removed from the kernel, where do
> > you see a user of this?  If it's still in there, we need to just drop
> > it.
> 
> My decision on suggesting this patch has been based purely on the speed types
> the USB core API supports and what usb_get_maximum_speed() can return.
> USB_SPEED_WIRELESS type is one of the possible return values. As I can see
> aside the rest of the USB speeds the wireless speed is also defined
> in the kernel USB subsystem. Moreover it is used in some kernel drivers.
> (See the USB_SPEED_WIRELESS enumeration constant usage.)
> Are you sure that the wireless speed support has been really removed?

All of the drivers that implement and support this should have been
removed.  Code in the USB core is probably not removed, but patches are
gladly welcome.

Please do not add new wireless support as it is not going to happen,
because there are no wireless devices in the world.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value
  2020-10-12 15:41       ` Greg Kroah-Hartman
@ 2020-10-12 21:19         ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-12 21:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Rob Herring,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Mon, Oct 12, 2020 at 05:41:50PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Oct 11, 2020 at 08:53:33PM +0300, Serge Semin wrote:
> > On Sun, Oct 11, 2020 at 04:42:36PM +0200, Greg Kroah-Hartman wrote:
> > > On Sun, Oct 11, 2020 at 01:41:05AM +0300, Serge Semin wrote:
> > > > It appears that the "maximum-speed" property can also accept the
> > > > "wireless" value. Add it to the enumeration of the possible property
> > > > values then.
> > > > 
> > > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > ---
> > > >  Documentation/devicetree/bindings/usb/usb-hcd.yaml | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > > > index 815de24127db..e1a82a2b3295 100644
> > > > --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > > > +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > > > @@ -28,7 +28,7 @@ properties:
> > > >       isn't passed via DT, USB controllers should default to their maximum HW
> > > >       capability.
> > > >     $ref: /schemas/types.yaml#/definitions/string
> > > > -   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
> > > > +   enum: ["low-speed", "full-speed", "high-speed", "wireless", "super-speed",
> > > >            "super-speed-plus"]
> > > 
> > 
> > > Are you sure?  wireless usb has been removed from the kernel, where do
> > > you see a user of this?  If it's still in there, we need to just drop
> > > it.
> > 
> > My decision on suggesting this patch has been based purely on the speed types
> > the USB core API supports and what usb_get_maximum_speed() can return.
> > USB_SPEED_WIRELESS type is one of the possible return values. As I can see
> > aside the rest of the USB speeds the wireless speed is also defined
> > in the kernel USB subsystem. Moreover it is used in some kernel drivers.
> > (See the USB_SPEED_WIRELESS enumeration constant usage.)
> > Are you sure that the wireless speed support has been really removed?
> 

> All of the drivers that implement and support this should have been
> removed.  Code in the USB core is probably not removed, but patches are
> gladly welcome.
> 
> Please do not add new wireless support as it is not going to happen,
> because there are no wireless devices in the world.

Ok. Thanks for clarification. I'll drop this patch then.

-Sergey

> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to DT schema
  2020-10-10 22:41 ` [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to " Serge Semin
@ 2020-10-13 12:14   ` Rob Herring
  2020-10-13 14:00     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Rob Herring @ 2020-10-13 12:14 UTC (permalink / raw)
  To: Serge Semin
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Serge Semin,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 01:41:04AM +0300, Serge Semin wrote:
> The generic USB HCD properties have been described in the legacy bindings
> text file: Documentation/devicetree/bindings/usb/generic.txt . Let's
> convert it' content into the USB HCD DT schema properties so all USB DT
> nodes would be validated to have them properly utilized.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
>  .../devicetree/bindings/usb/generic.txt       | 57 -------------
>  .../devicetree/bindings/usb/usb-hcd.yaml      | 84 +++++++++++++++++++
>  2 files changed, 84 insertions(+), 57 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt
> 
> diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt
> deleted file mode 100644
> index ba472e7aefc9..000000000000
> --- a/Documentation/devicetree/bindings/usb/generic.txt
> +++ /dev/null
> @@ -1,57 +0,0 @@
> -Generic USB Properties
> -
> -Optional properties:
> - - maximum-speed: tells USB controllers we want to work up to a certain
> -			speed. Valid arguments are "super-speed-plus",
> -			"super-speed", "high-speed", "full-speed" and
> -			"low-speed". In case this isn't passed via DT, USB
> -			controllers should default to their maximum HW
> -			capability.
> - - dr_mode: tells Dual-Role USB controllers that we want to work on a
> -			particular mode. Valid arguments are "host",
> -			"peripheral" and "otg". In case this attribute isn't
> -			passed via DT, USB DRD controllers should default to
> -			OTG.
> - - phy_type: 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. Valid arguments are "utmi" and "utmi_wide".
> -			In case this isn't passed via DT, USB controllers should
> -			default to HW capability.
> - - otg-rev: tells usb driver the release number of the OTG and EH supplement
> -			with which the device and its descriptors are compliant,
> -			in binary-coded decimal (i.e. 2.0 is 0200H). This
> -			property is used if any real OTG features(HNP/SRP/ADP)
> -			is enabled, if ADP is required, otg-rev should be
> -			0x0200 or above.
> - - companion: phandle of a companion
> - - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP
> -			is the basic function of real OTG except you want it
> -			to be a srp-capable only B device.
> - - srp-disable: tells OTG controllers we want to disable OTG SRP, SRP is
> -			optional for OTG device.
> - - adp-disable: tells OTG controllers we want to disable OTG ADP, ADP is
> -			optional for OTG device.
> - - usb-role-switch: boolean, indicates that the device is capable of assigning
> -			the USB data role (USB host or USB device) for a given
> -			USB connector, such as Type-C, Type-B(micro).
> -			see connector/usb-connector.yaml.
> - - role-switch-default-mode: indicating if usb-role-switch is enabled, the
> -			device default operation mode of controller while usb
> -			role is USB_ROLE_NONE. Valid arguments are "host" and
> -			"peripheral". Defaults to "peripheral" if not
> -			specified.
> -
> -
> -This is an attribute to a USB controller such as:
> -
> -dwc3@4a030000 {
> -	compatible = "synopsys,dwc3";
> -	reg = <0x4a030000 0xcfff>;
> -	interrupts = <0 92 4>
> -	usb-phy = <&usb2_phy>, <&usb3,phy>;
> -	maximum-speed = "super-speed";
> -	dr_mode = "otg";
> -	phy_type = "utmi_wide";
> -	otg-rev = <0x0200>;
> -	adp-disable;
> -};
> diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> index 7263b7f2b510..815de24127db 100644
> --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> @@ -22,9 +22,93 @@ properties:
>      description:
>        Name specifier for the USB PHY
>  
> +  maximum-speed:
> +   description: |

Drop the '|' if there's no formatting to preserve.

> +     Tells USB controllers we want to work up to a certain speed. In case this
> +     isn't passed via DT, USB controllers should default to their maximum HW
> +     capability.
> +   $ref: /schemas/types.yaml#/definitions/string
> +   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
> +          "super-speed-plus"]

One per line and drop the quotes.

> +
> +  dr_mode:
> +    description: |
> +      Tells Dual-Role USB controllers that we want to work on a particular
> +      mode. In case this attribute isn't passed via DT, USB DRD controllers
> +      should default to OTG.
> +    $ref: /schemas/types.yaml#/definitions/string
> +    enum: ["host", "peripheral", "otg"]
> +
> +  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.
> +    $ref: /schemas/types.yaml#/definitions/string
> +    enum: ["utmi", "utmi_wide"]
> +
> +  otg-rev:
> +    description: |
> +      Tells usb driver the release number of the OTG and EH supplement with
> +      which the device and its descriptors are compliant, in binary-coded
> +      decimal (i.e. 2.0 is 0200H). This property is used if any real OTG
> +      features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be
> +      0x0200 or above.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +
> +  companion:
> +    description: Phandle of a companion device
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +
> +  hnp-disable:
> +    description: |
> +      Tells OTG controllers we want to disable OTG HNP. Normally HNP is the
> +      basic function of real OTG except you want it to be a srp-capable only B
> +      device.
> +    type: boolean
> +
> +  srp-disable:
> +    description: |
> +      Tells OTG controllers we want to disable OTG SRP. SRP is optional for OTG
> +      device.
> +    type: boolean
> +
> +  adp-disable:
> +    description: |
> +      Tells OTG controllers we want to disable OTG ADP. ADP is optional for OTG
> +      device.
> +    type: boolean
> +
> +  usb-role-switch:
> +    description: |
> +      Indicates that the device is capable of assigning the USB data role
> +      (USB host or USB device) for a given USB connector, such as Type-C,
> +      Type-B(micro). See connector/usb-connector.yaml.
> +
> +  role-switch-default-mode:
> +    description: |
> +      Indicates if usb-role-switch is enabled, the device default operation
> +      mode of controller while usb role is USB_ROLE_NONE.
> +    $ref: /schemas/types.yaml#/definitions/string
> +    enum: ["host", "peripheral"]
> +    default: "peripheral"
> +
>  examples:
>    - |
>      usb {
>          phys = <&usb2_phy1>, <&usb3_phy1>;
>          phy-names = "usb";
>      };
> +  - |
> +    usb@4a030000 {
> +        compatible = "snps,dwc3";
> +        reg = <0x4a030000 0xcfff>;
> +        interrupts = <0 92 4>;
> +        usb-phy = <&usb2_phy>, <&usb3_phy>;
> +        maximum-speed = "super-speed";
> +        dr_mode = "otg";
> +        phy_type = "utmi_wide";
> +        otg-rev = <0x0200>;
> +        adp-disable;
> +    };
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema
  2020-10-10 22:41 ` [PATCH 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema Serge Semin
@ 2020-10-13 12:30   ` Rob Herring
  2020-10-13 14:29     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Rob Herring @ 2020-10-13 12:30 UTC (permalink / raw)
  To: Serge Semin
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Serge Semin,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 01:41:10AM +0300, Serge Semin wrote:
> Currently the DT bindings of Generic xHCI Controllers are described by means
> of the legacy text file. Since such format is deprecated in favor of the
> DT schema, let's convert the Generic xHCI Controllers bindings file to the
> corresponding yaml files. There will be two of them: a DT schema for the
> xHCI controllers on a generic platform and a DT schema validating a generic
> xHCI controllers properties. The later will be used to validate the xHCI
> controllers, which aside from some vendor-specific features support the
> basic xHCI functionality.
> 
> An xHCI-compatible DT node shall support the standard USB HCD properties
> and custom ones like: usb2-lpm-disable, usb3-lpm-capable,
> quirk-broken-port-ped and imod-interval-ns. In addition if a generic xHCI
> controller is being validated against the DT schema it is also supposed to
> be equipped with mandatory compatible string, single registers range,
> single interrupts source, and is supposed to optionally contain up to two
> reference clocks for the controller core and CSRs.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
>  .../devicetree/bindings/usb/generic-xhci.yaml | 63 +++++++++++++++++++
>  .../devicetree/bindings/usb/usb-xhci.txt      | 41 ------------
>  .../devicetree/bindings/usb/usb-xhci.yaml     | 40 ++++++++++++
>  3 files changed, 103 insertions(+), 41 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml
>  delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt
>  create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> new file mode 100644
> index 000000000000..1ea1d49a8175
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> @@ -0,0 +1,63 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/generic-xhci.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: USB xHCI Controller Device Tree Bindings
> +
> +maintainers:
> +  - Mathias Nyman <mathias.nyman@intel.com>
> +
> +allOf:
> +  - $ref: "usb-xhci.yaml#"
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - description: Generic xHCI device
> +        const: generic-xhci
> +      - description: Armada 37xx/375/38x/8k SoCs
> +        items:
> +          - enum:
> +              - marvell,armada3700-xhci
> +              - marvell,armada-375-xhci
> +              - marvell,armada-380-xhci
> +              - marvell,armada-8k-xhci
> +          - const: generic-xhci
> +      - description: Broadcom STB SoCs with xHCI
> +        const: brcm,bcm7445-xhci
> +      - description: Generic xHCI device
> +        const: xhci-platform
> +        deprecated: true
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - const: core
> +      - const: reg
> +
> +unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    usb@f0931000 {
> +      compatible = "generic-xhci";
> +      reg = <0xf0931000 0x8c8>;
> +      interrupts = <0x0 0x4e 0x0>;
> +    };
> diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt
> deleted file mode 100644
> index 0c5cff84a969..000000000000
> --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
> +++ /dev/null
> @@ -1,41 +0,0 @@
> -USB xHCI controllers
> -
> -Required properties:
> -  - compatible: should be one or more of
> -
> -    - "generic-xhci" for generic XHCI device
> -    - "marvell,armada3700-xhci" for Armada 37xx SoCs
> -    - "marvell,armada-375-xhci" for Armada 375 SoCs
> -    - "marvell,armada-380-xhci" for Armada 38x SoCs
> -    - "brcm,bcm7445-xhci" for Broadcom STB SoCs with XHCI
> -    - "xhci-platform" (deprecated)
> -
> -    When compatible with the generic version, nodes must list the
> -    SoC-specific version corresponding to the platform first
> -    followed by the generic version.
> -
> -  - reg: should contain address and length of the standard XHCI
> -    register set for the device.
> -  - interrupts: one XHCI interrupt should be described here.
> -
> -Optional properties:
> -  - clocks: reference to the clocks
> -  - clock-names: mandatory if there is a second clock, in this case
> -    the name must be "core" for the first clock and "reg" for the
> -    second one
> -  - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
> -  - usb3-lpm-capable: determines if platform is USB3 LPM capable
> -  - quirk-broken-port-ped: set if the controller has broken port disable mechanism
> -  - imod-interval-ns: default interrupt moderation interval is 5000ns
> -  - phys : see usb-hcd.yaml in the current directory
> -
> -additionally the properties from usb-hcd.yaml (in the current directory) are
> -supported.
> -
> -
> -Example:
> -	usb@f0931000 {
> -		compatible = "generic-xhci";
> -		reg = <0xf0931000 0x8c8>;
> -		interrupts = <0x0 0x4e 0x0>;
> -	};
> diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.yaml b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
> new file mode 100644
> index 000000000000..c5c177f2e055
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/usb-xhci.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic USB xHCI Controller Device Tree Bindings
> +
> +maintainers:
> +  - Mathias Nyman <mathias.nyman@intel.com>
> +
> +allOf:
> +  - $ref: "usb-hcd.yaml#"
> +
> +properties:
> +  usb2-lpm-disable:
> +    description: Indicates if we don't want to enable USB2 HW LPM
> +    type: boolean
> +
> +  usb3-lpm-capable:
> +    description: Determines if platform is USB3 LPM capable
> +    type: boolean
> +
> +  quirk-broken-port-ped:
> +    description: Set if the controller has broken port disable mechanism
> +    type: boolean
> +
> +  imod-interval-ns:
> +    description: Interrupt moderation interval
> +    default: 5000

Having additionalProperties or unevaluatedProperties is going to be 
mandatory, so for this add:

additionalProperties: true

> +
> +examples:
> +  - |
> +    usb@f0930000 {
> +      compatible = "generic-xhci";
> +      reg = <0xf0930000 0x8c8>;
> +      interrupts = <0x0 0x4e 0x0>;
> +      usb2-lpm-disable;
> +      usb3-lpm-capable;
> +    };
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
  2020-10-10 22:41 ` [PATCH 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema Serge Semin
@ 2020-10-13 12:36   ` Rob Herring
  2020-10-13 15:16     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Rob Herring @ 2020-10-13 12:36 UTC (permalink / raw)
  To: Serge Semin
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Serge Semin,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 01:41:13AM +0300, Serge Semin wrote:
> DWC USB3 DT node is supposed to be compliant with the Generic xHCI
> Controller schema, but with additional vendor-specific properties, the
> controller-specific reference clocks and PHYs. So let's convert the
> currently available legacy text-based DWC USB3 bindings to the DT schema
> and make sure the DWC USB3 nodes are also validated against the
> usb-xhci.yaml schema.
> 
> Note we have to discard the nodename restriction of being prefixed with
> "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes
> are supposed to be named as "^usb(@.*)".
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> 
> ---
> 
> Alas applying the usb-hcd.yaml schema on the DWC USB3 nodes will cause
> dtbs_check failures since a lot of "snps,dwc3"-compatible DT nodes are
> named with prefixes like "^dwc3@", "^usb[0-9]@" and even "^dwusb@", while
> usb-hcd.yaml permits the "^usb@" prefix only. As I see it the better but
> more painful solution would be to fix the corresponding DTS files (it's
> some of the Qualcomm, HiSilicon, Exynos, Allwinner, Omap, Stih, APM and
> Freescale DTS'es) so the DWC USB3 DT nodes would comply with the generic
> USB HCD node naming schema. Alternatively we could either extend the
> naming space in the usb-hcd.yaml or extract the generic properties to a
> dedicated DT schema file. What do you think?

IMO, we should fix the node names.

> ---
>  .../devicetree/bindings/usb/dwc3.txt          | 125 --------
>  .../devicetree/bindings/usb/snps,dwc3.yaml    | 295 ++++++++++++++++++
>  2 files changed, 295 insertions(+), 125 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
>  create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> 
> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
> deleted file mode 100644
> index d03edf9d3935..000000000000
> --- a/Documentation/devicetree/bindings/usb/dwc3.txt
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -synopsys DWC3 CORE
> -
> -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties
> -      as described in 'usb/generic.txt'
> -
> -Required properties:
> - - compatible: must be "snps,dwc3"
> - - reg : Address and length of the register set for the device
> - - interrupts: Interrupts used by the dwc3 controller.
> - - clock-names: list of clock names. Ideally should be "ref",
> -                "bus_early", "suspend" but may be less or more.
> - - clocks: list of phandle and clock specifier pairs corresponding to
> -           entries in the clock-names property.
> -
> -Exception for clocks:
> -  clocks are optional if the parent node (i.e. glue-layer) is compatible to
> -  one of the following:
> -    "cavium,octeon-7130-usb-uctl"
> -    "qcom,dwc3"
> -    "samsung,exynos5250-dwusb3"
> -    "samsung,exynos5433-dwusb3"
> -    "samsung,exynos7-dwusb3"
> -    "sprd,sc9860-dwc3"
> -    "st,stih407-dwc3"
> -    "ti,am437x-dwc3"
> -    "ti,dwc3"
> -    "ti,keystone-dwc3"
> -    "rockchip,rk3399-dwc3"
> -    "xlnx,zynqmp-dwc3"
> -
> -Optional properties:
> - - usb-phy : array of phandle for the PHY device.  The first element
> -   in the array is expected to be a handle to the USB2/HS PHY and
> -   the second element is expected to be a handle to the USB3/SS PHY
> - - phys: from the *Generic PHY* bindings
> - - phy-names: from the *Generic PHY* bindings; supported names are "usb2-phy"
> -	or "usb3-phy".
> - - resets: set of phandle and reset specifier pairs
> - - snps,usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
> - - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable
> - - snps,dis-start-transfer-quirk: when set, disable isoc START TRANSFER command
> -			failure SW work-around for DWC_usb31 version 1.70a-ea06
> -			and prior.
> - - snps,disable_scramble_quirk: true when SW should disable data scrambling.
> -	Only really useful for FPGA builds.
> - - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled
> - - snps,lpm-nyet-threshold: LPM NYET threshold
> - - snps,u2exit_lfps_quirk: set if we want to enable u2exit lfps quirk
> - - snps,u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
> - - snps,req_p1p2p3_quirk: when set, the core will always request for
> -			P1/P2/P3 transition sequence.
> - - snps,del_p1p2p3_quirk: when set core will delay P1/P2/P3 until a certain
> -			amount of 8B10B errors occur.
> - - snps,del_phy_power_chg_quirk: when set core will delay PHY power change
> -			from P0 to P1/P2/P3.
> - - snps,lfps_filter_quirk: when set core will filter LFPS reception.
> - - snps,rx_detect_poll_quirk: when set core will disable a 400us delay to start
> -			Polling LFPS after RX.Detect.
> - - snps,tx_de_emphasis_quirk: when set core will set Tx de-emphasis value.
> - - snps,tx_de_emphasis: the value driven to the PHY is controlled by the
> -			LTSSM during USB3 Compliance mode.
> - - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy.
> - - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy.
> - - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG,
> -			disabling the suspend signal to the PHY.
> - - snps,dis-u1-entry-quirk: set if link entering into U1 needs to be disabled.
> - - snps,dis-u2-entry-quirk: set if link entering into U2 needs to be disabled.
> - - snps,dis_rxdet_inp3_quirk: when set core will disable receiver detection
> -			in PHY P3 power state.
> - - snps,dis-u2-freeclk-exists-quirk: when set, clear the u2_freeclk_exists
> -			in GUSB2PHYCFG, specify that USB2 PHY doesn't provide
> -			a free-running PHY clock.
> - - snps,dis-del-phy-power-chg-quirk: when set core will change PHY power
> -			from P0 to P1/P2/P3 without delay.
> - - snps,dis-tx-ipgap-linecheck-quirk: when set, disable u2mac linestate check
> -			during HS transmit.
> - - snps,parkmode-disable-ss-quirk: when set, all SuperSpeed bus instances in
> -			park mode are disabled.
> - - snps,dis_metastability_quirk: when set, disable metastability workaround.
> -			CAUTION: use only if you are absolutely sure of it.
> - - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal
> -			utmi_l1_suspend_n, false when asserts utmi_sleep_n
> - - snps,hird-threshold: HIRD threshold
> - - snps,hsphy_interface: High-Speed PHY interface selection between "utmi" for
> -   UTMI+ and "ulpi" for ULPI when the DWC_USB3_HSPHY_INTERFACE has value 3.
> - - snps,quirk-frame-length-adjustment: Value for GFLADJ_30MHZ field of GFLADJ
> -	register for post-silicon frame length adjustment when the
> -	fladj_30mhz_sdbnd signal is invalid or incorrect.
> - - snps,rx-thr-num-pkt-prd: periodic ESS RX packet threshold count - host mode
> -			only. Set this and rx-max-burst-prd to a valid,
> -			non-zero value 1-16 (DWC_usb31 programming guide
> -			section 1.2.4) to enable periodic ESS RX threshold.
> - - snps,rx-max-burst-prd: max periodic ESS RX burst size - host mode only. Set
> -			this and rx-thr-num-pkt-prd to a valid, non-zero value
> -			1-16 (DWC_usb31 programming guide section 1.2.4) to
> -			enable periodic ESS RX threshold.
> - - snps,tx-thr-num-pkt-prd: periodic ESS TX packet threshold count - host mode
> -			only. Set this and tx-max-burst-prd to a valid,
> -			non-zero value 1-16 (DWC_usb31 programming guide
> -			section 1.2.3) to enable periodic ESS TX threshold.
> - - snps,tx-max-burst-prd: max periodic ESS TX burst size - host mode only. Set
> -			this and tx-thr-num-pkt-prd to a valid, non-zero value
> -			1-16 (DWC_usb31 programming guide section 1.2.3) to
> -			enable periodic ESS TX threshold.
> -
> - - <DEPRECATED> tx-fifo-resize: determines if the FIFO *has* to be reallocated.
> - - snps,incr-burst-type-adjustment: Value for INCR burst type of GSBUSCFG0
> -			register, undefined length INCR burst type enable and INCRx type.
> -			When just one value, which means INCRX burst mode enabled. When
> -			more than one value, which means undefined length INCR burst type
> -			enabled. The values can be 1, 4, 8, 16, 32, 64, 128 and 256.
> -
> - - in addition all properties from usb-xhci.txt from the current directory are
> -   supported as well
> -
> -
> -This is usually a subnode to DWC3 glue to which it is connected.
> -
> -dwc3@4a030000 {
> -	compatible = "snps,dwc3";
> -	reg = <0x4a030000 0xcfff>;
> -	interrupts = <0 92 4>
> -	usb-phy = <&usb2_phy>, <&usb3,phy>;
> -	snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> -};
> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> new file mode 100644
> index 000000000000..24808fc2c7e3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> @@ -0,0 +1,295 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Synopsys DesignWare USB3 Controller
> +
> +maintainers:
> +  - Felipe Balbi <balbi@kernel.org>
> +
> +description: |
> +  This is usually a subnode to DWC3 glue to which it is connected, but can also
> +  be presented as a standalone DT node with an optional vendor-specific
> +  compatible string.
> +
> +allOf:
> +  - $ref: "usb-xhci.yaml#"
> +
> +properties:
> +  compatible:
> +    contains:
> +      const: "snps,dwc3"

Don't need quotes

> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 3
> +
> +  clocks:
> +    description: |
> +      In general the core supports three types of clocks. bus_clk_early is a

s/bus_clk_early/bus_early/

And the others too.

> +      SoC Bus Clock (AHB/AXI/Native). ref_clk generates ITP when the UTMI/ULPI
> +      PHY is suspended. suspend_clk clocks a small part of the USB3 core when
> +      SS PHY in P3. But particular cases may differ from that having less or
> +      more clock sources with another names.
> +
> +  clock-names:
> +    contains:
> +      anyOf:
> +        - enum: ["bus_early", "ref", "suspend"]
> +        - true

That's unfortunate...

> +
> +  usb-phy:
> +   minItems: 1
> +   items:
> +     - description: USB2/HS PHY
> +     - description: USB3/SS PHY
> +
> +  phys:
> +    minItems: 1
> +    items:
> +      - description: USB2/HS PHY
> +      - description: USB3/SS PHY
> +
> +  phy-names:
> +    minItems: 1
> +    items:
> +      - const: usb2-phy
> +      - const: usb3-phy
> +
> +  resets:
> +    minItems: 1
> +
> +  snps,usb2-lpm-disable:
> +    description: Indicate if we don't want to enable USB2 HW LPM
> +    type: boolean
> +
> +  snps,usb3_lpm_capable:
> +    description: Determines if platform is USB3 LPM capable
> +    type: boolean
> +
> +  snps,dis-start-transfer-quirk:
> +    description: |

Drop '|'.

> +      When set, disable isoc START TRANSFER command failure SW work-around
> +      for DWC_usb31 version 1.70a-ea06 and prior.
> +    type: boolean
> +
> +  snps,disable_scramble_quirk:
> +    description: |
> +      True when SW should disable data scrambling. Only really useful for FPGA
> +      builds.
> +    type: boolean
> +
> +  snps,has-lpm-erratum:
> +    description: True when DWC3 was configured with LPM Erratum enabled
> +    type: boolean
> +
> +  snps,lpm-nyet-threshold:
> +    description: LPM NYET threshold
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +
> +  snps,u2exit_lfps_quirk:
> +    description: Set if we want to enable u2exit lfps quirk
> +    type: boolean
> +
> +  snps,u2ss_inp3_quirk:
> +    description: Set if we enable P3 OK for U2/SS Inactive quirk
> +    type: boolean
> +
> +  snps,req_p1p2p3_quirk:
> +    description: |
> +      When set, the core will always request for P1/P2/P3 transition sequence.
> +    type: boolean
> +
> +  snps,del_p1p2p3_quirk:
> +    description: |
> +      When set core will delay P1/P2/P3 until a certain amount of 8B10B errors
> +      occur.
> +    type: boolean
> +
> +  snps,del_phy_power_chg_quirk:
> +    description: When set core will delay PHY power change from P0 to P1/P2/P3.
> +    type: boolean
> +
> +  snps,lfps_filter_quirk:
> +    description: When set core will filter LFPS reception.
> +    type: boolean
> +
> +  snps,rx_detect_poll_quirk:
> +    description: |
> +      when set core will disable a 400us delay to start Polling LFPS after
> +      RX.Detect.
> +    type: boolean
> +
> +  snps,tx_de_emphasis_quirk:
> +    description: When set core will set Tx de-emphasis value
> +    type: boolean
> +
> +  snps,tx_de_emphasis:
> +    description: |
> +      The value driven to the PHY is controlled by the LTSSM during USB3
> +      Compliance mode.
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +
> +  snps,dis_u3_susphy_quirk:
> +    description: When set core will disable USB3 suspend phy
> +    type: boolean
> +
> +  snps,dis_u2_susphy_quirk:
> +    description: When set core will disable USB2 suspend phy
> +    type: boolean
> +
> +  snps,dis_enblslpm_quirk:
> +    description: |
> +      When set clears the enblslpm in GUSB2PHYCFG, disabling the suspend signal
> +      to the PHY.
> +    type: boolean
> +
> +  snps,dis-u1-entry-quirk:
> +    description: Set if link entering into U1 needs to be disabled
> +    type: boolean
> +
> +  snps,dis-u2-entry-quirk:
> +    description: Set if link entering into U2 needs to be disabled
> +    type: boolean
> +
> +  snps,dis_rxdet_inp3_quirk:
> +    description: |
> +      When set core will disable receiver detection in PHY P3 power state.
> +    type: boolean
> +
> +  snps,dis-u2-freeclk-exists-quirk:
> +    description: |
> +      When set, clear the u2_freeclk_exists in GUSB2PHYCFG, specify that USB2
> +      PHY doesn't provide a free-running PHY clock.
> +    type: boolean
> +
> +  snps,dis-del-phy-power-chg-quirk:
> +    description: |
> +      When set core will change PHY power from P0 to P1/P2/P3 without delay.
> +    type: boolean
> +
> +  snps,dis-tx-ipgap-linecheck-quirk:
> +    description: When set, disable u2mac linestate check during HS transmit
> +    type: boolean
> +
> +  snps,parkmode-disable-ss-quirk:
> +    description: |
> +      When set, all SuperSpeed bus instances in park mode are disabled.
> +    type: boolean
> +
> +  snps,dis_metastability_quirk:
> +    description: |
> +      When set, disable metastability workaround. CAUTION! Use only if you are
> +      absolutely sure of it.
> +    type: boolean
> +
> +  snps,is-utmi-l1-suspend:
> +    description: |
> +      True when DWC3 asserts output signal utmi_l1_suspend_n, false when
> +      asserts utmi_sleep_n.
> +    type: boolean
> +
> +  snps,hird-threshold:
> +    description: HIRD threshold
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +
> +  snps,hsphy_interface:
> +    description: |
> +      High-Speed PHY interface selection between UTMI+ and ULPI when the
> +      DWC_USB3_HSPHY_INTERFACE has value 3.
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +    enum: ["utmi", "ulpi"]
> +
> +  snps,quirk-frame-length-adjustment:
> +    description: |
> +      Value for GFLADJ_30MHZ field of GFLADJ register for post-silicon frame
> +      length adjustment when the fladj_30mhz_sdbnd signal is invalid or
> +      incorrect.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +
> +  snps,rx-thr-num-pkt-prd:
> +    description: |
> +      Periodic ESS RX packet threshold count (host mode only). Set this and
> +      snps,rx-max-burst-prd to a valid, non-zero value 1-16 (DWC_usb31
> +      programming guide section 1.2.4) to enable periodic ESS RX threshold.
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +    minimum: 1
> +    maximum: 16
> +
> +  snps,rx-max-burst-prd:
> +    description: |
> +      Max periodic ESS RX burst size (host mode only). Set this and
> +      snps,rx-thr-num-pkt-prd to a valid, non-zero value 1-16 (DWC_usb31
> +      programming guide section 1.2.4) to enable periodic ESS RX threshold.
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +    minimum: 1
> +    maximum: 16
> +
> +  snps,tx-thr-num-pkt-prd:
> +    description: |
> +      Periodic ESS TX packet threshold count (host mode only). Set this and
> +      snps,tx-max-burst-prd to a valid, non-zero value 1-16 (DWC_usb31
> +      programming guide section 1.2.3) to enable periodic ESS TX threshold.
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +    minimum: 1
> +    maximum: 16
> +
> +  snps,tx-max-burst-prd:
> +    description: |
> +      Max periodic ESS TX burst size (host mode only). Set this and
> +      snps,tx-thr-num-pkt-prd to a valid, non-zero value 1-16 (DWC_usb31
> +      programming guide section 1.2.3) to enable periodic ESS TX threshold.
> +    $ref: /schemas/types.yaml#/definitions/uint8
> +    minimum: 1
> +    maximum: 16
> +
> +  tx-fifo-resize:
> +    description: Determines if the FIFO *has* to be reallocated
> +    deprecated: true
> +    type: boolean
> +
> +  snps,incr-burst-type-adjustment:
> +    description: |
> +      Value for INCR burst type of GSBUSCFG0 register, undefined length INCR
> +      burst type enable and INCRx type. A single value means INCRX burst mode
> +      enabled. If more than one value specified, undefined length INCR burst
> +      type will be enabled with burst lengths utilized up to the maximum
> +      of the values passed in this property.
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    minItems: 1
> +    maxItems: 8
> +    uniqueItems: true
> +    items:
> +      enum: [1, 4, 8, 16, 32, 64, 128, 256]
> +
> +unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    usb@4a030000 {
> +      compatible = "snps,dwc3";
> +      reg = <0x4a030000 0xcfff>;
> +      interrupts = <0 92 4>;
> +      usb-phy = <&usb2_phy>, <&usb3_phy>;
> +      snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> +    };
> +  - |
> +    usb@4a000000 {
> +      compatible = "snps,dwc3";
> +      reg = <0x4a000000 0xcfff>;
> +      interrupts = <0 92 4>;
> +      clocks = <&clk 1>, <&clk 2>, <&clk 3>;
> +      clock-names = "bus_early", "ref", "suspend";
> +      phys = <&usb2_phy>, <&usb3_phy>;
> +      phy-names = "usb2-phy", "usb3-phy";
> +      snps,dis_u2_susphy_quirk;
> +      snps,dis_enblslpm_quirk;
> +    };
> +...
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj restrictions
  2020-10-10 22:41 ` [PATCH 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj restrictions Serge Semin
@ 2020-10-13 12:38   ` Rob Herring
  2020-10-13 15:45     ` Serge Semin
  0 siblings, 1 reply; 50+ messages in thread
From: Rob Herring @ 2020-10-13 12:38 UTC (permalink / raw)
  To: Serge Semin
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Serge Semin,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 11, 2020 at 01:41:17AM +0300, Serge Semin wrote:
> In accordance with the IP core databook the
> snps,quirk-frame-length-adjustment property can be set within [0, 0x3F].
> Let's make sure the DT schema applies a correct restriction on the
> property.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
>  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> index 36d4b8060d7c..f1e6c3dab1ff 100644
> --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> @@ -226,6 +226,8 @@ properties:
>        length adjustment when the fladj_30mhz_sdbnd signal is invalid or
>        incorrect.
>      $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 0
> +    maximum: 0x3f

It's fine if you add the constraints during the conversion.

>  
>    snps,rx-thr-num-pkt-prd:
>      description: |
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
  2020-10-10 22:41 ` [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes Serge Semin
  2020-10-12  7:38   ` Neil Armstrong
@ 2020-10-13 12:42   ` Rob Herring
  2020-10-13 15:50     ` Serge Semin
  1 sibling, 1 reply; 50+ messages in thread
From: Rob Herring @ 2020-10-13 12:42 UTC (permalink / raw)
  To: Serge Semin
  Cc: Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman, Kevin Hilman,
	Neil Armstrong, Jerome Brunet, Martin Blumenstingl, Serge Semin,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	linux-usb, devicetree, linux-kernel, linux-arm-kernel,
	linux-amlogic

On Sun, Oct 11, 2020 at 01:41:19AM +0300, Serge Semin wrote:
> 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 <Sergey.Semin@baikalelectronics.ru>
> ---
>  .../bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 15 ++++++++++++++-
>  1 file changed, 14 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 88184d7e26cc..3e8ac0ff90de 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,20 @@ properties:
>  
>  patternProperties:
>    "^usb@[0-9a-f]+$":
> -    type: object
> +    allOf:
> +      - if:
> +          properties:
> +            compatible:
> +              contains:
> +                const: snps,dwc2
> +        then:
> +          $ref: dwc2.yaml#
> +      - if:
> +          properties:
> +            compatible:
> +              const: snps,dwc3
> +        then:
> +          $ref: snps,dwc3.yaml#

It should be enough to do just:

oneOf:
  - $ref: dwc2.yaml#
  - $ref: snps,dwc3.yaml#

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to DT schema
  2020-10-13 12:14   ` Rob Herring
@ 2020-10-13 14:00     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-13 14:00 UTC (permalink / raw)
  To: Rob Herring
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Tue, Oct 13, 2020 at 07:14:41AM -0500, Rob Herring wrote:
> On Sun, Oct 11, 2020 at 01:41:04AM +0300, Serge Semin wrote:
> > The generic USB HCD properties have been described in the legacy bindings
> > text file: Documentation/devicetree/bindings/usb/generic.txt . Let's
> > convert it' content into the USB HCD DT schema properties so all USB DT
> > nodes would be validated to have them properly utilized.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > ---
> >  .../devicetree/bindings/usb/generic.txt       | 57 -------------
> >  .../devicetree/bindings/usb/usb-hcd.yaml      | 84 +++++++++++++++++++
> >  2 files changed, 84 insertions(+), 57 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/usb/generic.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/generic.txt b/Documentation/devicetree/bindings/usb/generic.txt
> > deleted file mode 100644
> > index ba472e7aefc9..000000000000
> > --- a/Documentation/devicetree/bindings/usb/generic.txt
> > +++ /dev/null
> > @@ -1,57 +0,0 @@
> > -Generic USB Properties
> > -
> > -Optional properties:
> > - - maximum-speed: tells USB controllers we want to work up to a certain
> > -			speed. Valid arguments are "super-speed-plus",
> > -			"super-speed", "high-speed", "full-speed" and
> > -			"low-speed". In case this isn't passed via DT, USB
> > -			controllers should default to their maximum HW
> > -			capability.
> > - - dr_mode: tells Dual-Role USB controllers that we want to work on a
> > -			particular mode. Valid arguments are "host",
> > -			"peripheral" and "otg". In case this attribute isn't
> > -			passed via DT, USB DRD controllers should default to
> > -			OTG.
> > - - phy_type: 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. Valid arguments are "utmi" and "utmi_wide".
> > -			In case this isn't passed via DT, USB controllers should
> > -			default to HW capability.
> > - - otg-rev: tells usb driver the release number of the OTG and EH supplement
> > -			with which the device and its descriptors are compliant,
> > -			in binary-coded decimal (i.e. 2.0 is 0200H). This
> > -			property is used if any real OTG features(HNP/SRP/ADP)
> > -			is enabled, if ADP is required, otg-rev should be
> > -			0x0200 or above.
> > - - companion: phandle of a companion
> > - - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP
> > -			is the basic function of real OTG except you want it
> > -			to be a srp-capable only B device.
> > - - srp-disable: tells OTG controllers we want to disable OTG SRP, SRP is
> > -			optional for OTG device.
> > - - adp-disable: tells OTG controllers we want to disable OTG ADP, ADP is
> > -			optional for OTG device.
> > - - usb-role-switch: boolean, indicates that the device is capable of assigning
> > -			the USB data role (USB host or USB device) for a given
> > -			USB connector, such as Type-C, Type-B(micro).
> > -			see connector/usb-connector.yaml.
> > - - role-switch-default-mode: indicating if usb-role-switch is enabled, the
> > -			device default operation mode of controller while usb
> > -			role is USB_ROLE_NONE. Valid arguments are "host" and
> > -			"peripheral". Defaults to "peripheral" if not
> > -			specified.
> > -
> > -
> > -This is an attribute to a USB controller such as:
> > -
> > -dwc3@4a030000 {
> > -	compatible = "synopsys,dwc3";
> > -	reg = <0x4a030000 0xcfff>;
> > -	interrupts = <0 92 4>
> > -	usb-phy = <&usb2_phy>, <&usb3,phy>;
> > -	maximum-speed = "super-speed";
> > -	dr_mode = "otg";
> > -	phy_type = "utmi_wide";
> > -	otg-rev = <0x0200>;
> > -	adp-disable;
> > -};
> > diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > index 7263b7f2b510..815de24127db 100644
> > --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > @@ -22,9 +22,93 @@ properties:
> >      description:
> >        Name specifier for the USB PHY
> >  
> > +  maximum-speed:
> > +   description: |
> 

> Drop the '|' if there's no formatting to preserve.

Thanks for noticing this. I should have refreshed my YAML multi-line
knowledge https://yaml-multiline.info/ .) I'll fix it in all the patches of
the series.

> 
> > +     Tells USB controllers we want to work up to a certain speed. In case this
> > +     isn't passed via DT, USB controllers should default to their maximum HW
> > +     capability.
> > +   $ref: /schemas/types.yaml#/definitions/string
> > +   enum: ["low-speed", "full-speed", "high-speed", "super-speed",
> > +          "super-speed-plus"]
> 

> One per line and drop the quotes.

Ok.

-Sergey

> 
> > +
> > +  dr_mode:
> > +    description: |
> > +      Tells Dual-Role USB controllers that we want to work on a particular
> > +      mode. In case this attribute isn't passed via DT, USB DRD controllers
> > +      should default to OTG.
> > +    $ref: /schemas/types.yaml#/definitions/string
> > +    enum: ["host", "peripheral", "otg"]
> > +
> > +  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.
> > +    $ref: /schemas/types.yaml#/definitions/string
> > +    enum: ["utmi", "utmi_wide"]
> > +
> > +  otg-rev:
> > +    description: |
> > +      Tells usb driver the release number of the OTG and EH supplement with
> > +      which the device and its descriptors are compliant, in binary-coded
> > +      decimal (i.e. 2.0 is 0200H). This property is used if any real OTG
> > +      features (HNP/SRP/ADP) is enabled. If ADP is required, otg-rev should be
> > +      0x0200 or above.
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +
> > +  companion:
> > +    description: Phandle of a companion device
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +
> > +  hnp-disable:
> > +    description: |
> > +      Tells OTG controllers we want to disable OTG HNP. Normally HNP is the
> > +      basic function of real OTG except you want it to be a srp-capable only B
> > +      device.
> > +    type: boolean
> > +
> > +  srp-disable:
> > +    description: |
> > +      Tells OTG controllers we want to disable OTG SRP. SRP is optional for OTG
> > +      device.
> > +    type: boolean
> > +
> > +  adp-disable:
> > +    description: |
> > +      Tells OTG controllers we want to disable OTG ADP. ADP is optional for OTG
> > +      device.
> > +    type: boolean
> > +
> > +  usb-role-switch:
> > +    description: |
> > +      Indicates that the device is capable of assigning the USB data role
> > +      (USB host or USB device) for a given USB connector, such as Type-C,
> > +      Type-B(micro). See connector/usb-connector.yaml.
> > +
> > +  role-switch-default-mode:
> > +    description: |
> > +      Indicates if usb-role-switch is enabled, the device default operation
> > +      mode of controller while usb role is USB_ROLE_NONE.
> > +    $ref: /schemas/types.yaml#/definitions/string
> > +    enum: ["host", "peripheral"]
> > +    default: "peripheral"
> > +
> >  examples:
> >    - |
> >      usb {
> >          phys = <&usb2_phy1>, <&usb3_phy1>;
> >          phy-names = "usb";
> >      };
> > +  - |
> > +    usb@4a030000 {
> > +        compatible = "snps,dwc3";
> > +        reg = <0x4a030000 0xcfff>;
> > +        interrupts = <0 92 4>;
> > +        usb-phy = <&usb2_phy>, <&usb3_phy>;
> > +        maximum-speed = "super-speed";
> > +        dr_mode = "otg";
> > +        phy_type = "utmi_wide";
> > +        otg-rev = <0x0200>;
> > +        adp-disable;
> > +    };
> > -- 
> > 2.27.0
> > 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema
  2020-10-13 12:30   ` Rob Herring
@ 2020-10-13 14:29     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-13 14:29 UTC (permalink / raw)
  To: Rob Herring
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Tue, Oct 13, 2020 at 07:30:04AM -0500, Rob Herring wrote:
> On Sun, Oct 11, 2020 at 01:41:10AM +0300, Serge Semin wrote:
> > Currently the DT bindings of Generic xHCI Controllers are described by means
> > of the legacy text file. Since such format is deprecated in favor of the
> > DT schema, let's convert the Generic xHCI Controllers bindings file to the
> > corresponding yaml files. There will be two of them: a DT schema for the
> > xHCI controllers on a generic platform and a DT schema validating a generic
> > xHCI controllers properties. The later will be used to validate the xHCI
> > controllers, which aside from some vendor-specific features support the
> > basic xHCI functionality.
> > 
> > An xHCI-compatible DT node shall support the standard USB HCD properties
> > and custom ones like: usb2-lpm-disable, usb3-lpm-capable,
> > quirk-broken-port-ped and imod-interval-ns. In addition if a generic xHCI
> > controller is being validated against the DT schema it is also supposed to
> > be equipped with mandatory compatible string, single registers range,
> > single interrupts source, and is supposed to optionally contain up to two
> > reference clocks for the controller core and CSRs.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > ---
> >  .../devicetree/bindings/usb/generic-xhci.yaml | 63 +++++++++++++++++++
> >  .../devicetree/bindings/usb/usb-xhci.txt      | 41 ------------
> >  .../devicetree/bindings/usb/usb-xhci.yaml     | 40 ++++++++++++
> >  3 files changed, 103 insertions(+), 41 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/usb/generic-xhci.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.txt
> >  create mode 100644 Documentation/devicetree/bindings/usb/usb-xhci.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> > new file mode 100644
> > index 000000000000..1ea1d49a8175
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> > @@ -0,0 +1,63 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/usb/generic-xhci.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: USB xHCI Controller Device Tree Bindings
> > +
> > +maintainers:
> > +  - Mathias Nyman <mathias.nyman@intel.com>
> > +
> > +allOf:
> > +  - $ref: "usb-xhci.yaml#"
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - description: Generic xHCI device
> > +        const: generic-xhci
> > +      - description: Armada 37xx/375/38x/8k SoCs
> > +        items:
> > +          - enum:
> > +              - marvell,armada3700-xhci
> > +              - marvell,armada-375-xhci
> > +              - marvell,armada-380-xhci
> > +              - marvell,armada-8k-xhci
> > +          - const: generic-xhci
> > +      - description: Broadcom STB SoCs with xHCI
> > +        const: brcm,bcm7445-xhci
> > +      - description: Generic xHCI device
> > +        const: xhci-platform
> > +        deprecated: true
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    minItems: 1
> > +    maxItems: 2
> > +
> > +  clock-names:
> > +    minItems: 1
> > +    items:
> > +      - const: core
> > +      - const: reg
> > +
> > +unevaluatedProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +
> > +examples:
> > +  - |
> > +    usb@f0931000 {
> > +      compatible = "generic-xhci";
> > +      reg = <0xf0931000 0x8c8>;
> > +      interrupts = <0x0 0x4e 0x0>;
> > +    };
> > diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt
> > deleted file mode 100644
> > index 0c5cff84a969..000000000000
> > --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
> > +++ /dev/null
> > @@ -1,41 +0,0 @@
> > -USB xHCI controllers
> > -
> > -Required properties:
> > -  - compatible: should be one or more of
> > -
> > -    - "generic-xhci" for generic XHCI device
> > -    - "marvell,armada3700-xhci" for Armada 37xx SoCs
> > -    - "marvell,armada-375-xhci" for Armada 375 SoCs
> > -    - "marvell,armada-380-xhci" for Armada 38x SoCs
> > -    - "brcm,bcm7445-xhci" for Broadcom STB SoCs with XHCI
> > -    - "xhci-platform" (deprecated)
> > -
> > -    When compatible with the generic version, nodes must list the
> > -    SoC-specific version corresponding to the platform first
> > -    followed by the generic version.
> > -
> > -  - reg: should contain address and length of the standard XHCI
> > -    register set for the device.
> > -  - interrupts: one XHCI interrupt should be described here.
> > -
> > -Optional properties:
> > -  - clocks: reference to the clocks
> > -  - clock-names: mandatory if there is a second clock, in this case
> > -    the name must be "core" for the first clock and "reg" for the
> > -    second one
> > -  - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
> > -  - usb3-lpm-capable: determines if platform is USB3 LPM capable
> > -  - quirk-broken-port-ped: set if the controller has broken port disable mechanism
> > -  - imod-interval-ns: default interrupt moderation interval is 5000ns
> > -  - phys : see usb-hcd.yaml in the current directory
> > -
> > -additionally the properties from usb-hcd.yaml (in the current directory) are
> > -supported.
> > -
> > -
> > -Example:
> > -	usb@f0931000 {
> > -		compatible = "generic-xhci";
> > -		reg = <0xf0931000 0x8c8>;
> > -		interrupts = <0x0 0x4e 0x0>;
> > -	};
> > diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.yaml b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
> > new file mode 100644
> > index 000000000000..c5c177f2e055
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/usb-xhci.yaml
> > @@ -0,0 +1,40 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/usb/usb-xhci.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Generic USB xHCI Controller Device Tree Bindings
> > +
> > +maintainers:
> > +  - Mathias Nyman <mathias.nyman@intel.com>
> > +
> > +allOf:
> > +  - $ref: "usb-hcd.yaml#"
> > +
> > +properties:
> > +  usb2-lpm-disable:
> > +    description: Indicates if we don't want to enable USB2 HW LPM
> > +    type: boolean
> > +
> > +  usb3-lpm-capable:
> > +    description: Determines if platform is USB3 LPM capable
> > +    type: boolean
> > +
> > +  quirk-broken-port-ped:
> > +    description: Set if the controller has broken port disable mechanism
> > +    type: boolean
> > +
> > +  imod-interval-ns:
> > +    description: Interrupt moderation interval
> > +    default: 5000
> 

> Having additionalProperties or unevaluatedProperties is going to be 
> mandatory, so for this add:
> 
> additionalProperties: true

Ok. I'll get to remember this.

-Sergey

> 
> > +
> > +examples:
> > +  - |
> > +    usb@f0930000 {
> > +      compatible = "generic-xhci";
> > +      reg = <0xf0930000 0x8c8>;
> > +      interrupts = <0x0 0x4e 0x0>;
> > +      usb2-lpm-disable;
> > +      usb3-lpm-capable;
> > +    };
> > -- 
> > 2.27.0
> > 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema
  2020-10-13 12:36   ` Rob Herring
@ 2020-10-13 15:16     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-13 15:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Tue, Oct 13, 2020 at 07:36:24AM -0500, Rob Herring wrote:
> On Sun, Oct 11, 2020 at 01:41:13AM +0300, Serge Semin wrote:
> > DWC USB3 DT node is supposed to be compliant with the Generic xHCI
> > Controller schema, but with additional vendor-specific properties, the
> > controller-specific reference clocks and PHYs. So let's convert the
> > currently available legacy text-based DWC USB3 bindings to the DT schema
> > and make sure the DWC USB3 nodes are also validated against the
> > usb-xhci.yaml schema.
> > 
> > Note we have to discard the nodename restriction of being prefixed with
> > "dwc3@" string, since in accordance with the usb-hcd.yaml schema USB nodes
> > are supposed to be named as "^usb(@.*)".
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > 
> > ---
> > 
> > Alas applying the usb-hcd.yaml schema on the DWC USB3 nodes will cause
> > dtbs_check failures since a lot of "snps,dwc3"-compatible DT nodes are
> > named with prefixes like "^dwc3@", "^usb[0-9]@" and even "^dwusb@", while
> > usb-hcd.yaml permits the "^usb@" prefix only. As I see it the better but
> > more painful solution would be to fix the corresponding DTS files (it's
> > some of the Qualcomm, HiSilicon, Exynos, Allwinner, Omap, Stih, APM and
> > Freescale DTS'es) so the DWC USB3 DT nodes would comply with the generic
> > USB HCD node naming schema. Alternatively we could either extend the
> > naming space in the usb-hcd.yaml or extract the generic properties to a
> > dedicated DT schema file. What do you think?
> 

> IMO, we should fix the node names.

Ok. I'll attach a new patch to the series, which will fix it for all uncompatible
nodes. (Though the node with "^dwusb@" has got a comment, that the node-name
should be like that due to some compatibility reasons...)

> 
> > ---
> >  .../devicetree/bindings/usb/dwc3.txt          | 125 --------
> >  .../devicetree/bindings/usb/snps,dwc3.yaml    | 295 ++++++++++++++++++
> >  2 files changed, 295 insertions(+), 125 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
> >  create mode 100644 Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
> > deleted file mode 100644
> > index d03edf9d3935..000000000000
> > --- a/Documentation/devicetree/bindings/usb/dwc3.txt
> > +++ /dev/null
> > @@ -1,125 +0,0 @@
> > -synopsys DWC3 CORE
> > -
> > -DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties
> > -      as described in 'usb/generic.txt'
> > -
> > -Required properties:
> > - - compatible: must be "snps,dwc3"
> > - - reg : Address and length of the register set for the device
> > - - interrupts: Interrupts used by the dwc3 controller.
> > - - clock-names: list of clock names. Ideally should be "ref",
> > -                "bus_early", "suspend" but may be less or more.
> > - - clocks: list of phandle and clock specifier pairs corresponding to
> > -           entries in the clock-names property.
> > -
> > -Exception for clocks:
> > -  clocks are optional if the parent node (i.e. glue-layer) is compatible to
> > -  one of the following:
> > -    "cavium,octeon-7130-usb-uctl"
> > -    "qcom,dwc3"
> > -    "samsung,exynos5250-dwusb3"
> > -    "samsung,exynos5433-dwusb3"
> > -    "samsung,exynos7-dwusb3"
> > -    "sprd,sc9860-dwc3"
> > -    "st,stih407-dwc3"
> > -    "ti,am437x-dwc3"
> > -    "ti,dwc3"
> > -    "ti,keystone-dwc3"
> > -    "rockchip,rk3399-dwc3"
> > -    "xlnx,zynqmp-dwc3"
> > -
> > -Optional properties:
> > - - usb-phy : array of phandle for the PHY device.  The first element
> > -   in the array is expected to be a handle to the USB2/HS PHY and
> > -   the second element is expected to be a handle to the USB3/SS PHY
> > - - phys: from the *Generic PHY* bindings
> > - - phy-names: from the *Generic PHY* bindings; supported names are "usb2-phy"
> > -	or "usb3-phy".
> > - - resets: set of phandle and reset specifier pairs
> > - - snps,usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
> > - - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable
> > - - snps,dis-start-transfer-quirk: when set, disable isoc START TRANSFER command
> > -			failure SW work-around for DWC_usb31 version 1.70a-ea06
> > -			and prior.
> > - - snps,disable_scramble_quirk: true when SW should disable data scrambling.
> > -	Only really useful for FPGA builds.
> > - - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled
> > - - snps,lpm-nyet-threshold: LPM NYET threshold
> > - - snps,u2exit_lfps_quirk: set if we want to enable u2exit lfps quirk
> > - - snps,u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
> > - - snps,req_p1p2p3_quirk: when set, the core will always request for
> > -			P1/P2/P3 transition sequence.
> > - - snps,del_p1p2p3_quirk: when set core will delay P1/P2/P3 until a certain
> > -			amount of 8B10B errors occur.
> > - - snps,del_phy_power_chg_quirk: when set core will delay PHY power change
> > -			from P0 to P1/P2/P3.
> > - - snps,lfps_filter_quirk: when set core will filter LFPS reception.
> > - - snps,rx_detect_poll_quirk: when set core will disable a 400us delay to start
> > -			Polling LFPS after RX.Detect.
> > - - snps,tx_de_emphasis_quirk: when set core will set Tx de-emphasis value.
> > - - snps,tx_de_emphasis: the value driven to the PHY is controlled by the
> > -			LTSSM during USB3 Compliance mode.
> > - - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy.
> > - - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy.
> > - - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG,
> > -			disabling the suspend signal to the PHY.
> > - - snps,dis-u1-entry-quirk: set if link entering into U1 needs to be disabled.
> > - - snps,dis-u2-entry-quirk: set if link entering into U2 needs to be disabled.
> > - - snps,dis_rxdet_inp3_quirk: when set core will disable receiver detection
> > -			in PHY P3 power state.
> > - - snps,dis-u2-freeclk-exists-quirk: when set, clear the u2_freeclk_exists
> > -			in GUSB2PHYCFG, specify that USB2 PHY doesn't provide
> > -			a free-running PHY clock.
> > - - snps,dis-del-phy-power-chg-quirk: when set core will change PHY power
> > -			from P0 to P1/P2/P3 without delay.
> > - - snps,dis-tx-ipgap-linecheck-quirk: when set, disable u2mac linestate check
> > -			during HS transmit.
> > - - snps,parkmode-disable-ss-quirk: when set, all SuperSpeed bus instances in
> > -			park mode are disabled.
> > - - snps,dis_metastability_quirk: when set, disable metastability workaround.
> > -			CAUTION: use only if you are absolutely sure of it.
> > - - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal
> > -			utmi_l1_suspend_n, false when asserts utmi_sleep_n
> > - - snps,hird-threshold: HIRD threshold
> > - - snps,hsphy_interface: High-Speed PHY interface selection between "utmi" for
> > -   UTMI+ and "ulpi" for ULPI when the DWC_USB3_HSPHY_INTERFACE has value 3.
> > - - snps,quirk-frame-length-adjustment: Value for GFLADJ_30MHZ field of GFLADJ
> > -	register for post-silicon frame length adjustment when the
> > -	fladj_30mhz_sdbnd signal is invalid or incorrect.
> > - - snps,rx-thr-num-pkt-prd: periodic ESS RX packet threshold count - host mode
> > -			only. Set this and rx-max-burst-prd to a valid,
> > -			non-zero value 1-16 (DWC_usb31 programming guide
> > -			section 1.2.4) to enable periodic ESS RX threshold.
> > - - snps,rx-max-burst-prd: max periodic ESS RX burst size - host mode only. Set
> > -			this and rx-thr-num-pkt-prd to a valid, non-zero value
> > -			1-16 (DWC_usb31 programming guide section 1.2.4) to
> > -			enable periodic ESS RX threshold.
> > - - snps,tx-thr-num-pkt-prd: periodic ESS TX packet threshold count - host mode
> > -			only. Set this and tx-max-burst-prd to a valid,
> > -			non-zero value 1-16 (DWC_usb31 programming guide
> > -			section 1.2.3) to enable periodic ESS TX threshold.
> > - - snps,tx-max-burst-prd: max periodic ESS TX burst size - host mode only. Set
> > -			this and tx-thr-num-pkt-prd to a valid, non-zero value
> > -			1-16 (DWC_usb31 programming guide section 1.2.3) to
> > -			enable periodic ESS TX threshold.
> > -
> > - - <DEPRECATED> tx-fifo-resize: determines if the FIFO *has* to be reallocated.
> > - - snps,incr-burst-type-adjustment: Value for INCR burst type of GSBUSCFG0
> > -			register, undefined length INCR burst type enable and INCRx type.
> > -			When just one value, which means INCRX burst mode enabled. When
> > -			more than one value, which means undefined length INCR burst type
> > -			enabled. The values can be 1, 4, 8, 16, 32, 64, 128 and 256.
> > -
> > - - in addition all properties from usb-xhci.txt from the current directory are
> > -   supported as well
> > -
> > -
> > -This is usually a subnode to DWC3 glue to which it is connected.
> > -
> > -dwc3@4a030000 {
> > -	compatible = "snps,dwc3";
> > -	reg = <0x4a030000 0xcfff>;
> > -	interrupts = <0 92 4>
> > -	usb-phy = <&usb2_phy>, <&usb3,phy>;
> > -	snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> > -};
> > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > new file mode 100644
> > index 000000000000..24808fc2c7e3
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > @@ -0,0 +1,295 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/usb/snps,dwc3.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Synopsys DesignWare USB3 Controller
> > +
> > +maintainers:
> > +  - Felipe Balbi <balbi@kernel.org>
> > +
> > +description: |
> > +  This is usually a subnode to DWC3 glue to which it is connected, but can also
> > +  be presented as a standalone DT node with an optional vendor-specific
> > +  compatible string.
> > +
> > +allOf:
> > +  - $ref: "usb-xhci.yaml#"
> > +
> > +properties:
> > +  compatible:
> > +    contains:
> > +      const: "snps,dwc3"
> 

> Don't need quotes

Ok.

> 
> > +
> > +  interrupts:
> > +    minItems: 1
> > +    maxItems: 3
> > +
> > +  clocks:
> > +    description: |
> > +      In general the core supports three types of clocks. bus_clk_early is a
> 

> s/bus_clk_early/bus_early/
> 
> And the others too.

I doubted which clock names to use here, so I've utilized the names selected by the
core Databook for the corresponding clocks. Anyway. Ok. I'll replace them with the
strings enumerated below.

> 
> > +      SoC Bus Clock (AHB/AXI/Native). ref_clk generates ITP when the UTMI/ULPI
> > +      PHY is suspended. suspend_clk clocks a small part of the USB3 core when
> > +      SS PHY in P3. But particular cases may differ from that having less or
> > +      more clock sources with another names.
> > +
> > +  clock-names:
> > +    contains:
> > +      anyOf:
> > +        - enum: ["bus_early", "ref", "suspend"]
> > +        - true
> 

> That's unfortunate...

Yeah. That was the best schema I could come up with to get the original
bindings. Alas there are various clock-names have been used at some
DWC USB3-compatible DT nodes, so I couldn't just set a stricter restriction
here.

> 
> > +
> > +  usb-phy:
> > +   minItems: 1
> > +   items:
> > +     - description: USB2/HS PHY
> > +     - description: USB3/SS PHY
> > +
> > +  phys:
> > +    minItems: 1
> > +    items:
> > +      - description: USB2/HS PHY
> > +      - description: USB3/SS PHY
> > +
> > +  phy-names:
> > +    minItems: 1
> > +    items:
> > +      - const: usb2-phy
> > +      - const: usb3-phy
> > +
> > +  resets:
> > +    minItems: 1
> > +
> > +  snps,usb2-lpm-disable:
> > +    description: Indicate if we don't want to enable USB2 HW LPM
> > +    type: boolean
> > +
> > +  snps,usb3_lpm_capable:
> > +    description: Determines if platform is USB3 LPM capable
> > +    type: boolean
> > +
> > +  snps,dis-start-transfer-quirk:
> > +    description: |
> 

> Drop '|'.

Agreed.

-Sergey

> 
> > +      When set, disable isoc START TRANSFER command failure SW work-around
> > +      for DWC_usb31 version 1.70a-ea06 and prior.
> > +    type: boolean
> > +
> > +  snps,disable_scramble_quirk:
> > +    description: |
> > +      True when SW should disable data scrambling. Only really useful for FPGA
> > +      builds.
> > +    type: boolean
> > +
> > +  snps,has-lpm-erratum:
> > +    description: True when DWC3 was configured with LPM Erratum enabled
> > +    type: boolean
> > +
> > +  snps,lpm-nyet-threshold:
> > +    description: LPM NYET threshold
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +
> > +  snps,u2exit_lfps_quirk:
> > +    description: Set if we want to enable u2exit lfps quirk
> > +    type: boolean
> > +
> > +  snps,u2ss_inp3_quirk:
> > +    description: Set if we enable P3 OK for U2/SS Inactive quirk
> > +    type: boolean
> > +
> > +  snps,req_p1p2p3_quirk:
> > +    description: |
> > +      When set, the core will always request for P1/P2/P3 transition sequence.
> > +    type: boolean
> > +
> > +  snps,del_p1p2p3_quirk:
> > +    description: |
> > +      When set core will delay P1/P2/P3 until a certain amount of 8B10B errors
> > +      occur.
> > +    type: boolean
> > +
> > +  snps,del_phy_power_chg_quirk:
> > +    description: When set core will delay PHY power change from P0 to P1/P2/P3.
> > +    type: boolean
> > +
> > +  snps,lfps_filter_quirk:
> > +    description: When set core will filter LFPS reception.
> > +    type: boolean
> > +
> > +  snps,rx_detect_poll_quirk:
> > +    description: |
> > +      when set core will disable a 400us delay to start Polling LFPS after
> > +      RX.Detect.
> > +    type: boolean
> > +
> > +  snps,tx_de_emphasis_quirk:
> > +    description: When set core will set Tx de-emphasis value
> > +    type: boolean
> > +
> > +  snps,tx_de_emphasis:
> > +    description: |
> > +      The value driven to the PHY is controlled by the LTSSM during USB3
> > +      Compliance mode.
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +
> > +  snps,dis_u3_susphy_quirk:
> > +    description: When set core will disable USB3 suspend phy
> > +    type: boolean
> > +
> > +  snps,dis_u2_susphy_quirk:
> > +    description: When set core will disable USB2 suspend phy
> > +    type: boolean
> > +
> > +  snps,dis_enblslpm_quirk:
> > +    description: |
> > +      When set clears the enblslpm in GUSB2PHYCFG, disabling the suspend signal
> > +      to the PHY.
> > +    type: boolean
> > +
> > +  snps,dis-u1-entry-quirk:
> > +    description: Set if link entering into U1 needs to be disabled
> > +    type: boolean
> > +
> > +  snps,dis-u2-entry-quirk:
> > +    description: Set if link entering into U2 needs to be disabled
> > +    type: boolean
> > +
> > +  snps,dis_rxdet_inp3_quirk:
> > +    description: |
> > +      When set core will disable receiver detection in PHY P3 power state.
> > +    type: boolean
> > +
> > +  snps,dis-u2-freeclk-exists-quirk:
> > +    description: |
> > +      When set, clear the u2_freeclk_exists in GUSB2PHYCFG, specify that USB2
> > +      PHY doesn't provide a free-running PHY clock.
> > +    type: boolean
> > +
> > +  snps,dis-del-phy-power-chg-quirk:
> > +    description: |
> > +      When set core will change PHY power from P0 to P1/P2/P3 without delay.
> > +    type: boolean
> > +
> > +  snps,dis-tx-ipgap-linecheck-quirk:
> > +    description: When set, disable u2mac linestate check during HS transmit
> > +    type: boolean
> > +
> > +  snps,parkmode-disable-ss-quirk:
> > +    description: |
> > +      When set, all SuperSpeed bus instances in park mode are disabled.
> > +    type: boolean
> > +
> > +  snps,dis_metastability_quirk:
> > +    description: |
> > +      When set, disable metastability workaround. CAUTION! Use only if you are
> > +      absolutely sure of it.
> > +    type: boolean
> > +
> > +  snps,is-utmi-l1-suspend:
> > +    description: |
> > +      True when DWC3 asserts output signal utmi_l1_suspend_n, false when
> > +      asserts utmi_sleep_n.
> > +    type: boolean
> > +
> > +  snps,hird-threshold:
> > +    description: HIRD threshold
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +
> > +  snps,hsphy_interface:
> > +    description: |
> > +      High-Speed PHY interface selection between UTMI+ and ULPI when the
> > +      DWC_USB3_HSPHY_INTERFACE has value 3.
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +    enum: ["utmi", "ulpi"]
> > +
> > +  snps,quirk-frame-length-adjustment:
> > +    description: |
> > +      Value for GFLADJ_30MHZ field of GFLADJ register for post-silicon frame
> > +      length adjustment when the fladj_30mhz_sdbnd signal is invalid or
> > +      incorrect.
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +
> > +  snps,rx-thr-num-pkt-prd:
> > +    description: |
> > +      Periodic ESS RX packet threshold count (host mode only). Set this and
> > +      snps,rx-max-burst-prd to a valid, non-zero value 1-16 (DWC_usb31
> > +      programming guide section 1.2.4) to enable periodic ESS RX threshold.
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +    minimum: 1
> > +    maximum: 16
> > +
> > +  snps,rx-max-burst-prd:
> > +    description: |
> > +      Max periodic ESS RX burst size (host mode only). Set this and
> > +      snps,rx-thr-num-pkt-prd to a valid, non-zero value 1-16 (DWC_usb31
> > +      programming guide section 1.2.4) to enable periodic ESS RX threshold.
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +    minimum: 1
> > +    maximum: 16
> > +
> > +  snps,tx-thr-num-pkt-prd:
> > +    description: |
> > +      Periodic ESS TX packet threshold count (host mode only). Set this and
> > +      snps,tx-max-burst-prd to a valid, non-zero value 1-16 (DWC_usb31
> > +      programming guide section 1.2.3) to enable periodic ESS TX threshold.
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +    minimum: 1
> > +    maximum: 16
> > +
> > +  snps,tx-max-burst-prd:
> > +    description: |
> > +      Max periodic ESS TX burst size (host mode only). Set this and
> > +      snps,tx-thr-num-pkt-prd to a valid, non-zero value 1-16 (DWC_usb31
> > +      programming guide section 1.2.3) to enable periodic ESS TX threshold.
> > +    $ref: /schemas/types.yaml#/definitions/uint8
> > +    minimum: 1
> > +    maximum: 16
> > +
> > +  tx-fifo-resize:
> > +    description: Determines if the FIFO *has* to be reallocated
> > +    deprecated: true
> > +    type: boolean
> > +
> > +  snps,incr-burst-type-adjustment:
> > +    description: |
> > +      Value for INCR burst type of GSBUSCFG0 register, undefined length INCR
> > +      burst type enable and INCRx type. A single value means INCRX burst mode
> > +      enabled. If more than one value specified, undefined length INCR burst
> > +      type will be enabled with burst lengths utilized up to the maximum
> > +      of the values passed in this property.
> > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +    minItems: 1
> > +    maxItems: 8
> > +    uniqueItems: true
> > +    items:
> > +      enum: [1, 4, 8, 16, 32, 64, 128, 256]
> > +
> > +unevaluatedProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +
> > +examples:
> > +  - |
> > +    usb@4a030000 {
> > +      compatible = "snps,dwc3";
> > +      reg = <0x4a030000 0xcfff>;
> > +      interrupts = <0 92 4>;
> > +      usb-phy = <&usb2_phy>, <&usb3_phy>;
> > +      snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> > +    };
> > +  - |
> > +    usb@4a000000 {
> > +      compatible = "snps,dwc3";
> > +      reg = <0x4a000000 0xcfff>;
> > +      interrupts = <0 92 4>;
> > +      clocks = <&clk 1>, <&clk 2>, <&clk 3>;
> > +      clock-names = "bus_early", "ref", "suspend";
> > +      phys = <&usb2_phy>, <&usb3_phy>;
> > +      phy-names = "usb2-phy", "usb3-phy";
> > +      snps,dis_u2_susphy_quirk;
> > +      snps,dis_enblslpm_quirk;
> > +    };
> > +...
> > -- 
> > 2.27.0
> > 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj restrictions
  2020-10-13 12:38   ` Rob Herring
@ 2020-10-13 15:45     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-13 15:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	Neil Armstrong, Kevin Hilman, linux-usb, devicetree,
	linux-kernel

On Tue, Oct 13, 2020 at 07:38:59AM -0500, Rob Herring wrote:
> On Sun, Oct 11, 2020 at 01:41:17AM +0300, Serge Semin wrote:
> > In accordance with the IP core databook the
> > snps,quirk-frame-length-adjustment property can be set within [0, 0x3F].
> > Let's make sure the DT schema applies a correct restriction on the
> > property.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > ---
> >  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > index 36d4b8060d7c..f1e6c3dab1ff 100644
> > --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> > @@ -226,6 +226,8 @@ properties:
> >        length adjustment when the fladj_30mhz_sdbnd signal is invalid or
> >        incorrect.
> >      $ref: /schemas/types.yaml#/definitions/uint32
> > +    minimum: 0
> > +    maximum: 0x3f
> 

> It's fine if you add the constraints during the conversion.

Ok. I'll keep it in mind next time.)

-Sergey

> 
> >  
> >    snps,rx-thr-num-pkt-prd:
> >      description: |
> > -- 
> > 2.27.0
> > 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes
  2020-10-13 12:42   ` Rob Herring
@ 2020-10-13 15:50     ` Serge Semin
  0 siblings, 0 replies; 50+ messages in thread
From: Serge Semin @ 2020-10-13 15:50 UTC (permalink / raw)
  To: Rob Herring
  Cc: Serge Semin, Mathias Nyman, Felipe Balbi, Greg Kroah-Hartman,
	Kevin Hilman, Neil Armstrong, Jerome Brunet, Martin Blumenstingl,
	Alexey Malahov, Pavel Parkhomenko, Andy Gross, Bjorn Andersson,
	Manu Gautam, Roger Quadros, Lad Prabhakar, Yoshihiro Shimoda,
	linux-usb, devicetree, linux-kernel, linux-arm-kernel,
	linux-amlogic

On Tue, Oct 13, 2020 at 07:42:03AM -0500, Rob Herring wrote:
> On Sun, Oct 11, 2020 at 01:41:19AM +0300, Serge Semin wrote:
> > 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 <Sergey.Semin@baikalelectronics.ru>
> > ---
> >  .../bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 15 ++++++++++++++-
> >  1 file changed, 14 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 88184d7e26cc..3e8ac0ff90de 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,20 @@ properties:
> >  
> >  patternProperties:
> >    "^usb@[0-9a-f]+$":
> > -    type: object
> > +    allOf:
> > +      - if:
> > +          properties:
> > +            compatible:
> > +              contains:
> > +                const: snps,dwc2
> > +        then:
> > +          $ref: dwc2.yaml#
> > +      - if:
> > +          properties:
> > +            compatible:
> > +              const: snps,dwc3
> > +        then:
> > +          $ref: snps,dwc3.yaml#
> 

> It should be enough to do just:
> 
> oneOf:
>   - $ref: dwc2.yaml#
>   - $ref: snps,dwc3.yaml#

Ah, good point! Thanks.

-Sergey


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2020-10-13 15:50 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-10 22:41 [PATCH 00/18] dt-bindings: usb: Add generic USB HCD, xHCI, DWC USB3 DT schema Serge Semin
2020-10-10 22:41 ` [PATCH 01/18] dt-bindings: usb: usb-hcd: Convert generic USB properties to " Serge Semin
2020-10-13 12:14   ` Rob Herring
2020-10-13 14:00     ` Serge Semin
2020-10-10 22:41 ` [PATCH 02/18] dt-bindings: usb: usb-hcd: Add "wireless" maximum-speed property value Serge Semin
2020-10-11 14:42   ` Greg Kroah-Hartman
2020-10-11 17:53     ` Serge Semin
2020-10-12 15:41       ` Greg Kroah-Hartman
2020-10-12 21:19         ` Serge Semin
2020-10-10 22:41 ` [PATCH 03/18] dt-bindings: usb: usb-hcd: Add "otg-rev" property restriction Serge Semin
2020-10-10 22:41 ` [PATCH 04/18] dt-bindings: usb: usb-hcd: Add "ulpi/serial/hsic" PHY types Serge Semin
2020-10-11  8:49   ` Sergei Shtylyov
2020-10-11 18:03     ` Serge Semin
2020-10-10 22:41 ` [PATCH 05/18] dt-bindings: usb: usb-hcd: Add "tpl-support" property Serge Semin
2020-10-11  8:47   ` Sergei Shtylyov
2020-10-11 18:05     ` Serge Semin
2020-10-11 18:06     ` Serge Semin
2020-10-10 22:41 ` [PATCH 06/18] dt-bindings: usb: usb-hcd: Add generic "usb-phy" property Serge Semin
2020-10-10 22:41 ` [PATCH 07/18] dt-bindings: usb: Convert xHCI bindings to DT schema Serge Semin
2020-10-13 12:30   ` Rob Herring
2020-10-13 14:29     ` Serge Semin
2020-10-10 22:41 ` [PATCH 08/18] dt-bindings: usb: xhci: Add Broadcom STB v2 compatible device Serge Semin
2020-10-10 22:41 ` [PATCH 09/18] dt-bindings: usb: renesas-xhci: Refer to the usb-xhci.yaml file Serge Semin
2020-10-10 22:41 ` [PATCH 10/18] dt-bindings: usb: Convert DWC USB3 bindings to DT schema Serge Semin
2020-10-13 12:36   ` Rob Herring
2020-10-13 15:16     ` Serge Semin
2020-10-10 22:41 ` [PATCH 11/18] dt-bindings: usb: dwc3: Add interrupt-names property support Serge Semin
2020-10-11  8:53   ` Sergei Shtylyov
2020-10-11 18:09     ` Serge Semin
2020-10-10 22:41 ` [PATCH 12/18] dt-bindings: usb: dwc3: Add synopsys,dwc3 compatible string Serge Semin
2020-10-10 22:41 ` [PATCH 13/18] dt-bindings: usb: dwc3: Add Tx De-emphasis restrictions Serge Semin
2020-10-11  8:56   ` Sergei Shtylyov
2020-10-11 18:14     ` Serge Semin
2020-10-10 22:41 ` [PATCH 14/18] dt-bindings: usb: dwc3: Add Frame Length Adj restrictions Serge Semin
2020-10-13 12:38   ` Rob Herring
2020-10-13 15:45     ` Serge Semin
2020-10-10 22:41 ` [PATCH 15/18] dt-bindings: usb: meson-g12a-usb: Discard FL-adj property Serge Semin
2020-10-12  7:54   ` Neil Armstrong
2020-10-12 14:22     ` Serge Semin
2020-10-12 15:01       ` Neil Armstrong
2020-10-12 15:13         ` Serge Semin
2020-10-12 15:29           ` Neil Armstrong
2020-10-10 22:41 ` [PATCH 16/18] dt-bindings: usb: meson-g12a-usb: Validate DWC2/DWC3 sub-nodes Serge Semin
2020-10-12  7:38   ` Neil Armstrong
2020-10-13 12:42   ` Rob Herring
2020-10-13 15:50     ` Serge Semin
2020-10-10 22:41 ` [PATCH 17/18] dt-bindings: usb: keystone-dwc3: Validate DWC3 sub-node Serge Semin
2020-10-11  9:04   ` Sergei Shtylyov
2020-10-11 18:18     ` Serge Semin
2020-10-10 22:41 ` [PATCH 18/18] dt-bindings: usb: qcom,dwc3: " Serge Semin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).