Hi,
This series converts DT binding to YAML schema.
Then adds a new property to enable workaround for USB2.0 PHY
Rx compliance issues.
cheers,
-roger
Pawel Laszczak (1):
usb: cdns3: Enable workaround for USB2.0 PHY Rx compliance test PHY
lockup
Roger Quadros (2):
dt-bindings: usb: Convert cdns-usb3.txt to YAML schema
dt-bindings: usb: cdns,usb3: Add cdns,phyrst-a-enable property
.../devicetree/bindings/usb/cdns,usb3.yaml | 93 +++++++++++++++++++
.../devicetree/bindings/usb/cdns-usb3.txt | 45 ---------
drivers/usb/cdns3/core.c | 2 +
drivers/usb/cdns3/core.h | 1 +
drivers/usb/cdns3/drd.c | 12 +++
drivers/usb/cdns3/drd.h | 5 +-
6 files changed, 112 insertions(+), 46 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/cdns,usb3.yaml
delete mode 100644 Documentation/devicetree/bindings/usb/cdns-usb3.txt
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Converts cdns-usb3.txt to YAML schema cdns,usb3.yaml
Signed-off-by: Roger Quadros <[email protected]>
---
.../devicetree/bindings/usb/cdns,usb3.yaml | 89 +++++++++++++++++++
.../devicetree/bindings/usb/cdns-usb3.txt | 45 ----------
2 files changed, 89 insertions(+), 45 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/cdns,usb3.yaml
delete mode 100644 Documentation/devicetree/bindings/usb/cdns-usb3.txt
diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
new file mode 100644
index 000000000000..7bc0263accee
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/cdns,usb3.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cadence USBSS-DRD controller bindings
+
+maintainers:
+ - Pawel Laszczak <[email protected]>
+
+properties:
+ compatible:
+ oneOf:
+ - const: cdns,usb3
+
+ reg:
+ items:
+ - description: OTG controller registers
+ - description: XHCI Host controller registers
+ - description: DEVICE controller registers
+
+ reg-names:
+ items:
+ - const: otg
+ - const: xhci
+ - const: dev
+
+ interrupts:
+ items:
+ - description: OTG/DRD controller interrupt
+ - description: XHCI host controller interrupt
+ - description: Device controller interrupt
+
+ interrupt-names:
+ items:
+ - const: host
+ - const: peripheral
+ - const: otg
+
+ dr_mode:
+ enum: [host, otg, peripheral]
+
+ maximum-speed:
+ enum: [super-speed, high-speed, full-speed]
+
+ phys:
+ minItems: 1
+ maxItems: 2
+
+ phy-names:
+ minItems: 1
+ maxItems: 2
+
+ cdns,on-chip-buff-size:
+ description:
+ size of memory intended as internal memory for endpoints
+ buffers expressed in KB
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+ - compatible
+ - reg
+ - reg-names
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ bus {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ usb@6000000 {
+ compatible = "cdns,usb3";
+ reg = <0x00 0x6000000 0x00 0x10000>,
+ <0x00 0x6010000 0x00 0x10000>,
+ <0x00 0x6020000 0x00 0x10000>;
+ reg-names = "otg", "xhci", "dev";
+ interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "host", "peripheral", "otg";
+ maximum-speed = "super-speed";
+ dr_mode = "otg";
+ };
+ };
diff --git a/Documentation/devicetree/bindings/usb/cdns-usb3.txt b/Documentation/devicetree/bindings/usb/cdns-usb3.txt
deleted file mode 100644
index b7dc606d37b5..000000000000
--- a/Documentation/devicetree/bindings/usb/cdns-usb3.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-Binding for the Cadence USBSS-DRD controller
-
-Required properties:
- - reg: Physical base address and size of the controller's register areas.
- Controller has 3 different regions:
- - HOST registers area
- - DEVICE registers area
- - OTG/DRD registers area
- - reg-names - register memory area names:
- "xhci" - for HOST registers space
- "dev" - for DEVICE registers space
- "otg" - for OTG/DRD registers space
- - compatible: Should contain: "cdns,usb3"
- - interrupts: Interrupts used by cdns3 controller:
- "host" - interrupt used by XHCI driver.
- "peripheral" - interrupt used by device driver
- "otg" - interrupt used by DRD/OTG part of driver
-
-Optional properties:
- - maximum-speed : valid arguments are "super-speed", "high-speed" and
- "full-speed"; refer to usb/generic.txt
- - dr_mode: Should be one of "host", "peripheral" or "otg".
- - phys: reference to the USB PHY
- - phy-names: from the *Generic PHY* bindings;
- Supported names are:
- - cdns3,usb2-phy
- - cdns3,usb3-phy
-
- - cdns,on-chip-buff-size : size of memory intended as internal memory for endpoints
- buffers expressed in KB
-
-Example:
- usb@f3000000 {
- compatible = "cdns,usb3";
- interrupts = <GIC_USB_IRQ 7 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_USB_IRQ 7 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_USB_IRQ 8 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "host", "peripheral", "otg";
- reg = <0xf3000000 0x10000>, /* memory area for HOST registers */
- <0xf3010000 0x10000>, /* memory area for DEVICE registers */
- <0xf3020000 0x10000>; /* memory area for OTG/DRD registers */
- reg-names = "xhci", "dev", "otg";
- phys = <&usb2_phy>, <&usb3_phy>;
- phy-names = "cdns3,usb2-phy", "cnds3,usb3-phy";
- };
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Controller version 0x0002450D has USB2 PHY RX sensitivity issues
that needs to be worked around by enabling phyrst-a-enable bit
in PHYRST_CFG register.
There is no way to distinguish between the controller version
before the device controller is started so we need to add this
DT property.
Signed-off-by: Roger Quadros <[email protected]>
---
Documentation/devicetree/bindings/usb/cdns,usb3.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
index 7bc0263accee..e670adc955e1 100644
--- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
+++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
@@ -58,6 +58,10 @@ properties:
buffers expressed in KB
$ref: /schemas/types.yaml#/definitions/uint32
+ cdns,phyrst-a-enable:
+ description: Enable resetting of PHY if Rx fail is detected
+ type: boolean
+
required:
- compatible
- reg
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
On 20-08-25 15:00:58, Roger Quadros wrote:
> Controller version 0x0002450D has USB2 PHY RX sensitivity issues
> that needs to be worked around by enabling phyrst-a-enable bit
> in PHYRST_CFG register.
>
> There is no way to distinguish between the controller version
> before the device controller is started so we need to add this
> DT property.
Maybe you should say "There is no way to know controller version
at host mode, but this workaround needs for both host and device
mode, so we have to add this DT property", the same for the comments
of your driver code patch.
Peter
>
> Signed-off-by: Roger Quadros <[email protected]>
> ---
> Documentation/devicetree/bindings/usb/cdns,usb3.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> index 7bc0263accee..e670adc955e1 100644
> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> @@ -58,6 +58,10 @@ properties:
> buffers expressed in KB
> $ref: /schemas/types.yaml#/definitions/uint32
>
> + cdns,phyrst-a-enable:
> + description: Enable resetting of PHY if Rx fail is detected
> + type: boolean
> +
> required:
> - compatible
> - reg
> --
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>
--
Thanks,
Peter Chen
Peter,
On 27/08/2020 14:14, Peter Chen wrote:
> On 20-08-25 15:00:58, Roger Quadros wrote:
>> Controller version 0x0002450D has USB2 PHY RX sensitivity issues
>> that needs to be worked around by enabling phyrst-a-enable bit
>> in PHYRST_CFG register.
>>
>> There is no way to distinguish between the controller version
>> before the device controller is started so we need to add this
>> DT property.
>
> Maybe you should say "There is no way to know controller version
> at host mode, but this workaround needs for both host and device
> mode, so we have to add this DT property", the same for the comments
> of your driver code patch.
I will reword it to
"There is no way to know controller version before device controller
is started and the workaround needs to be applied for both host and
device modes, so we add this DT property"
cheers,
-roger
>
> Peter
>>
>> Signed-off-by: Roger Quadros <[email protected]>
>> ---
>> Documentation/devicetree/bindings/usb/cdns,usb3.yaml | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
>> index 7bc0263accee..e670adc955e1 100644
>> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
>> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
>> @@ -58,6 +58,10 @@ properties:
>> buffers expressed in KB
>> $ref: /schemas/types.yaml#/definitions/uint32
>>
>> + cdns,phyrst-a-enable:
>> + description: Enable resetting of PHY if Rx fail is detected
>> + type: boolean
>> +
>> required:
>> - compatible
>> - reg
>> --
>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>>
>
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
On 20-09-02 16:28:31, Roger Quadros wrote:
> Peter,
>
> On 27/08/2020 14:14, Peter Chen wrote:
> > On 20-08-25 15:00:58, Roger Quadros wrote:
> > > Controller version 0x0002450D has USB2 PHY RX sensitivity issues
> > > that needs to be worked around by enabling phyrst-a-enable bit
> > > in PHYRST_CFG register.
> > >
> > > There is no way to distinguish between the controller version
> > > before the device controller is started so we need to add this
> > > DT property.
> >
> > Maybe you should say "There is no way to know controller version
> > at host mode, but this workaround needs for both host and device
> > mode, so we have to add this DT property", the same for the comments
> > of your driver code patch.
>
> I will reword it to
>
> "There is no way to know controller version before device controller
> is started and the workaround needs to be applied for both host and
> device modes, so we add this DT property"
>
After apply it, feel free add:
Reviewed-by: Peter Chen <[email protected]>
Please apply above for device party commit log as well.
--
Thanks,
Peter Chen