2020-03-27 20:49:18

by Al Cooper

[permalink] [raw]
Subject: [PATCH v2 0/4] Add XHCI, EHCI and OHCI support for Broadcom STB SoS's

v2 - Addressed Andy Shevchenko's review comments.
- Fixed dt_binding_check error pointed out by Rob Herring.
- Removed pr_info message in ehci_brcm_init as suggested by
Greg Kroah-Hartman.

This adds support for the XHCI, EHCI and OHCI host controllers found
in Broadcom STB SoC's. These drivers depend on getting access to the
new Broadcom STB USB PHY driver through a device-tree phandle and
will fail if the driver is not available.

Al Cooper (4):
dt-bindings: Add Broadcom STB USB support
usb: xhci: xhci-plat: Add support for Broadcom STB SoC's
usb: ehci: Add new EHCI driver for Broadcom STB SoC's
usb: host: Add ability to build new Broadcom STB USB drivers

.../bindings/usb/brcm,bcm7445-ehci.yaml | 61 ++++
.../devicetree/bindings/usb/usb-xhci.txt | 1 +
MAINTAINERS | 9 +
drivers/usb/host/Kconfig | 20 ++
drivers/usb/host/Makefile | 20 +-
drivers/usb/host/ehci-brcm.c | 290 ++++++++++++++++++
drivers/usb/host/xhci-brcm.c | 16 +
drivers/usb/host/xhci-brcm.h | 16 +
drivers/usb/host/xhci-plat.c | 11 +
9 files changed, 438 insertions(+), 6 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
create mode 100644 drivers/usb/host/ehci-brcm.c
create mode 100644 drivers/usb/host/xhci-brcm.c
create mode 100644 drivers/usb/host/xhci-brcm.h

--
2.17.1


2020-03-27 20:49:56

by Al Cooper

[permalink] [raw]
Subject: [PATCH v2 1/4] dt-bindings: Add Broadcom STB USB support

Add DT bindings for Broadcom STB USB EHCI and XHCI drivers.

NOTE: The OHCI driver is not included because it uses the generic
platform driver.

Signed-off-by: Al Cooper <[email protected]>
---
.../bindings/usb/brcm,bcm7445-ehci.yaml | 61 +++++++++++++++++++
.../devicetree/bindings/usb/usb-xhci.txt | 1 +
2 files changed, 62 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml

diff --git a/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml b/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
new file mode 100644
index 000000000000..34b2f80296ce
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/brcm,bcm7445-ehci.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom STB USB EHCI Controller Device Tree Bindings
+
+allOf:
+ - $ref: "usb-hcd.yaml"
+
+maintainers:
+ - Al Cooper <[email protected]>
+
+properties:
+ compatible:
+ contains:
+ const: brcm,bcm7445-ehci
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+ description: Clock specifier for the EHCI clock
+
+ clock-names:
+ const: sw_usb
+
+ phys:
+ description: PHY specifier for the USB PHY
+
+ phy-names:
+ const: usbphy
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - phys
+ - clocks
+
+additionalProperties: false
+
+examples:
+ - |
+ ehci@f0b00300 {
+ compatible = "brcm,bcm7445-ehci";
+ reg = <0xf0b00300 0xa8>;
+ interrupts = <0x0 0x5a 0x0>;
+ interrupt-names = "usb0_ehci_0";
+ phys = <&usbphy_0 0x0>;
+ phy-names = "usbphy";
+ clocks = <&usb20>;
+ clock-names = "sw_usb";
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt
index 3f378951d624..aafc316b5a8e 100644
--- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
+++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt
@@ -23,6 +23,7 @@ Required properties:
device
- "renesas,rcar-gen3-xhci" for a generic R-Car Gen3 or RZ/G2 compatible
device
+ - "brcm,bcm7445-xhci" for Broadcom STB SoCs with XHCI
- "xhci-platform" (deprecated)

When compatible with the generic version, nodes must list the
--
2.17.1

2020-03-30 16:33:34

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] dt-bindings: Add Broadcom STB USB support

On Fri, 27 Mar 2020 16:47:08 -0400, Al Cooper wrote:
> Add DT bindings for Broadcom STB USB EHCI and XHCI drivers.
>
> NOTE: The OHCI driver is not included because it uses the generic
> platform driver.
>
> Signed-off-by: Al Cooper <[email protected]>
> ---
> .../bindings/usb/brcm,bcm7445-ehci.yaml | 61 +++++++++++++++++++
> .../devicetree/bindings/usb/usb-xhci.txt | 1 +
> 2 files changed, 62 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
>

My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.example.dt.yaml: ehci@f0b00300: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+'
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.example.dt.yaml: ehci@f0b00300: $nodename:0: 'ehci@f0b00300' does not match '^usb(@.*)?'

See https://patchwork.ozlabs.org/patch/1263005

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.

2020-04-07 20:29:32

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] dt-bindings: Add Broadcom STB USB support

On 3/30/2020 8:40 AM, Rob Herring wrote:
> On Fri, 27 Mar 2020 16:47:08 -0400, Al Cooper wrote:
>> Add DT bindings for Broadcom STB USB EHCI and XHCI drivers.
>>
>> NOTE: The OHCI driver is not included because it uses the generic
>> platform driver.
>>
>> Signed-off-by: Al Cooper <[email protected]>
>> ---
>> .../bindings/usb/brcm,bcm7445-ehci.yaml | 61 +++++++++++++++++++
>> .../devicetree/bindings/usb/usb-xhci.txt | 1 +
>> 2 files changed, 62 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
>>
>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.example.dt.yaml: ehci@f0b00300: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+'

This warning does not seem to be legitimate, the 'interrupt-names'
property is a valid one, where do we update the schema such that it
knows about it?

> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.example.dt.yaml: ehci@f0b00300: $nodename:0: 'ehci@f0b00300' does not match '^usb(@.*)?'

This one is a legitimate one and should be fixed.
--
Florian


2020-04-08 13:50:36

by Al Cooper

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] dt-bindings: Add Broadcom STB USB support

Sending again in plain text.

On Tue, Apr 7, 2020 at 4:28 PM Florian Fainelli <[email protected]> wrote:
>
> On 3/30/2020 8:40 AM, Rob Herring wrote:
> > On Fri, 27 Mar 2020 16:47:08 -0400, Al Cooper wrote:
> >> Add DT bindings for Broadcom STB USB EHCI and XHCI drivers.
> >>
> >> NOTE: The OHCI driver is not included because it uses the generic
> >> platform driver.
> >>
> >> Signed-off-by: Al Cooper <[email protected]>
> >> ---
> >> .../bindings/usb/brcm,bcm7445-ehci.yaml | 61 +++++++++++++++++++
> >> .../devicetree/bindings/usb/usb-xhci.txt | 1 +
> >> 2 files changed, 62 insertions(+)
> >> create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
> >>
> >
> > My bot found errors running 'make dt_binding_check' on your patch:
> >
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.example.dt.yaml: ehci@f0b00300: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+'
>
> This warning does not seem to be legitimate, the 'interrupt-names'
> property is a valid one, where do we update the schema such that it
> knows about it?

It looks like I need to specify it in the specification portion of my
file if I want it in the example, like I did for "clock-names" and
"phy-names".
Since the driver always get the interrupt by index, I'm going to
remove "interrupt-names" from the example.

Al

>
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.example.dt.yaml: ehci@f0b00300: $nodename:0: 'ehci@f0b00300' does not match '^usb(@.*)?'
>
> This one is a legitimate one and should be fixed.
> --
> Florian
>
>

2020-04-08 19:48:31

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] dt-bindings: Add Broadcom STB USB support



On 4/8/2020 6:13 AM, Alan Cooper wrote:
> Sending again in plain text.
>
> On Tue, Apr 7, 2020 at 4:28 PM Florian Fainelli <[email protected]> wrote:
>>
>> On 3/30/2020 8:40 AM, Rob Herring wrote:
>>> On Fri, 27 Mar 2020 16:47:08 -0400, Al Cooper wrote:
>>>> Add DT bindings for Broadcom STB USB EHCI and XHCI drivers.
>>>>
>>>> NOTE: The OHCI driver is not included because it uses the generic
>>>> platform driver.
>>>>
>>>> Signed-off-by: Al Cooper <[email protected]>
>>>> ---
>>>> .../bindings/usb/brcm,bcm7445-ehci.yaml | 61 +++++++++++++++++++
>>>> .../devicetree/bindings/usb/usb-xhci.txt | 1 +
>>>> 2 files changed, 62 insertions(+)
>>>> create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.yaml
>>>>
>>>
>>> My bot found errors running 'make dt_binding_check' on your patch:
>>>
>>> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.example.dt.yaml: ehci@f0b00300: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+'
>>
>> This warning does not seem to be legitimate, the 'interrupt-names'
>> property is a valid one, where do we update the schema such that it
>> knows about it?
>
> It looks like I need to specify it in the specification portion of my
> file if I want it in the example, like I did for "clock-names" and
> "phy-names".
> Since the driver always get the interrupt by index, I'm going to
> remove "interrupt-names" from the example.

Ah indeed, that makes sense now, thanks!
--
Florian