public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH V3 0/3] ARM: dts: bcm2711: Add BCM2711 xHCI support
@ 2023-12-02 23:22 Stefan Wahren
  2023-12-02 23:22 ` [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711 Stefan Wahren
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Stefan Wahren @ 2023-12-02 23:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Florian Fainelli, Mathias Nyman
  Cc: bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel, Stefan Wahren

In contrast to the Raspberry Pi 4, the Compute Module 4 or the IO board
does not have a VL805 USB 3.0 host controller, which is connected via
PCIe. Instead, the BCM2711 on the Compute Module provides the built-in
xHCI.

Changes in V3:
- introduce a new compatible for BCM2711 in order to make the
  power domain dependency SoC specific, which also results in
  a driver change

Changes in V2:
- adjust xHCI compatible as suggested by Justin & Florian
- keep xHCI disabled in order to let the bootloader decide which
  USB block should be enabled, which result in a drop of patch 3

Stefan Wahren (3):
  dt-bindings: usb: xhci: add support for BCM2711
  usb: xhci: xhci-plat: Add support for BCM2711
  ARM: dts: bcm2711: Add BCM2711 xHCI support

 .../devicetree/bindings/usb/generic-xhci.yaml | 21 ++++++++++++++++---
 arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi   |  5 +++++
 arch/arm/boot/dts/broadcom/bcm2711.dtsi       | 14 +++++++++++++
 drivers/usb/host/xhci-plat.c                  |  3 +++
 4 files changed, 40 insertions(+), 3 deletions(-)

--
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-02 23:22 [PATCH V3 0/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Stefan Wahren
@ 2023-12-02 23:22 ` Stefan Wahren
  2023-12-03 11:06   ` Conor Dooley
  2023-12-02 23:22 ` [PATCH V3 2/3] usb: xhci: xhci-plat: Add " Stefan Wahren
  2023-12-02 23:22 ` [PATCH V3 3/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Stefan Wahren
  2 siblings, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2023-12-02 23:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Florian Fainelli, Mathias Nyman
  Cc: bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel, Stefan Wahren

The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
but also requires a power domain. So introduce a new compatible
and the specific constraints. Since the key allOf can only occur
once, merge the reference below.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 .../devicetree/bindings/usb/generic-xhci.yaml | 21 ++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
index 594ebb3ee432..b6e10b0a3c24 100644
--- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
@@ -9,9 +9,6 @@ title: USB xHCI Controller
 maintainers:
   - Mathias Nyman <mathias.nyman@intel.com>

-allOf:
-  - $ref: usb-xhci.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -28,6 +25,7 @@ properties:
       - description: Broadcom STB SoCs with xHCI
         enum:
           - brcm,xhci-brcm-v2
+          - brcm,bcm2711-xhci
           - brcm,bcm7445-xhci
       - description: Generic xHCI device
         const: xhci-platform
@@ -49,6 +47,9 @@ properties:
       - const: core
       - const: reg

+  power-domains:
+    maxItems: 1
+
 unevaluatedProperties: false

 required:
@@ -56,6 +57,20 @@ required:
   - reg
   - interrupts

+allOf:
+  - $ref: usb-xhci.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: brcm,bcm2711-xhci
+    then:
+      required:
+        - power-domains
+    else:
+      properties:
+        power-domains: false
+
 examples:
   - |
     usb@f0931000 {
--
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 2/3] usb: xhci: xhci-plat: Add support for BCM2711
  2023-12-02 23:22 [PATCH V3 0/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Stefan Wahren
  2023-12-02 23:22 ` [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711 Stefan Wahren
@ 2023-12-02 23:22 ` Stefan Wahren
  2023-12-02 23:22 ` [PATCH V3 3/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Stefan Wahren
  2 siblings, 0 replies; 11+ messages in thread
From: Stefan Wahren @ 2023-12-02 23:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Florian Fainelli, Mathias Nyman
  Cc: bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel, Stefan Wahren

With the introduction of a BCM2711 specific compatible, this also
needs to be added to the xHCI driver.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/usb/host/xhci-plat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index b93161374293..bc5e8f4cdadf 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -129,6 +129,9 @@ static const struct of_device_id usb_xhci_of_match[] = {
 	}, {
 		.compatible = "brcm,xhci-brcm-v2",
 		.data = &xhci_plat_brcm,
+	}, {
+		.compatible = "brcm,bcm2711-xhci",
+		.data = &xhci_plat_brcm,
 	}, {
 		.compatible = "brcm,bcm7445-xhci",
 		.data = &xhci_plat_brcm,
--
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 3/3] ARM: dts: bcm2711: Add BCM2711 xHCI support
  2023-12-02 23:22 [PATCH V3 0/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Stefan Wahren
  2023-12-02 23:22 ` [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711 Stefan Wahren
  2023-12-02 23:22 ` [PATCH V3 2/3] usb: xhci: xhci-plat: Add " Stefan Wahren
@ 2023-12-02 23:22 ` Stefan Wahren
  2 siblings, 0 replies; 11+ messages in thread
From: Stefan Wahren @ 2023-12-02 23:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Florian Fainelli, Mathias Nyman
  Cc: bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel, Stefan Wahren

The BCM2711 SoC also has a mostly generic xHCI. The USB port is
currently only usable on the Compute Module 4 (e.g. via IO board).
Because DWC2 and xHCI share the same PHY, we let the bootloader
enable it on demand.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi |  5 +++++
 arch/arm/boot/dts/broadcom/bcm2711.dtsi     | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi
index 98817a6675b9..d233a191c139 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "bcm2835-rpi.dtsi"

+#include <dt-bindings/power/raspberrypi-power.h>
 #include <dt-bindings/reset/raspberrypi,firmware-reset.h>

 / {
@@ -76,3 +77,7 @@ &v3d {
 &vchiq {
 	interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
 };
+
+&xhci {
+	power-domains = <&power RPI_POWER_DOMAIN_USB>;
+};
diff --git a/arch/arm/boot/dts/broadcom/bcm2711.dtsi b/arch/arm/boot/dts/broadcom/bcm2711.dtsi
index 4a379a14966d..ed5ef36e08ff 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2711.dtsi
@@ -604,6 +604,20 @@ genet_mdio: mdio@e14 {
 			};
 		};

+		xhci: usb@7e9c0000 {
+			compatible = "brcm,bcm2711-xhci";
+			reg = <0x0 0x7e9c0000 0x100000>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
+			/* DWC2 and this IP block share the same USB PHY,
+			 * enabling both at the same time results in lockups.
+			 * So keep this node disabled and let the bootloader
+			 * decide which interface should be enabled.
+			 */
+			status = "disabled";
+		};
+
 		v3d: gpu@7ec00000 {
 			compatible = "brcm,2711-v3d";
 			reg = <0x0 0x7ec00000 0x4000>,
--
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-02 23:22 ` [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711 Stefan Wahren
@ 2023-12-03 11:06   ` Conor Dooley
  2023-12-03 11:11     ` Conor Dooley
  0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2023-12-03 11:06 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Florian Fainelli, Mathias Nyman,
	bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1990 bytes --]

On Sun, Dec 03, 2023 at 12:22:15AM +0100, Stefan Wahren wrote:
> The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
> but also requires a power domain. So introduce a new compatible
> and the specific constraints. Since the key allOf can only occur
> once, merge the reference below.
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  .../devicetree/bindings/usb/generic-xhci.yaml | 21 ++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> index 594ebb3ee432..b6e10b0a3c24 100644
> --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> @@ -9,9 +9,6 @@ title: USB xHCI Controller
>  maintainers:
>    - Mathias Nyman <mathias.nyman@intel.com>
> 
> -allOf:
> -  - $ref: usb-xhci.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -28,6 +25,7 @@ properties:
>        - description: Broadcom STB SoCs with xHCI
>          enum:
>            - brcm,xhci-brcm-v2
> +          - brcm,bcm2711-xhci
>            - brcm,bcm7445-xhci
>        - description: Generic xHCI device
>          const: xhci-platform
> @@ -49,6 +47,9 @@ properties:
>        - const: core
>        - const: reg
> 
> +  power-domains:
> +    maxItems: 1
> +
>  unevaluatedProperties: false
> 
>  required:
> @@ -56,6 +57,20 @@ required:
>    - reg
>    - interrupts
> 
> +allOf:
> +  - $ref: usb-xhci.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: brcm,bcm2711-xhci
> +    then:
> +      required:
> +        - power-domains
> +    else:
> +      properties:
> +        power-domains: false
> +
>  examples:
>    - |
>      usb@f0931000 {
> --
> 2.34.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-03 11:06   ` Conor Dooley
@ 2023-12-03 11:11     ` Conor Dooley
  2023-12-03 16:56       ` Stefan Wahren
  0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2023-12-03 11:11 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Florian Fainelli, Mathias Nyman,
	bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2516 bytes --]

On Sun, Dec 03, 2023 at 11:06:43AM +0000, Conor Dooley wrote:
> On Sun, Dec 03, 2023 at 12:22:15AM +0100, Stefan Wahren wrote:
> > The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
> > but also requires a power domain.
Hmm
This & the driver change makes it look like your compatible setup should
be `compatible = "brcm,bcm2711-xhci", "brcm,xhci-brcm-v2";.
If the pattern in this patch was repeated, we'd have to modify the
driver like your 2nd patch does for each and new broadcom system that
needs the power domain.


> > So introduce a new compatible
> > and the specific constraints. Since the key allOf can only occur
> > once, merge the reference below.
> > 
> > Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> 
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> 
> Cheers,
> Conor.
> 
> > ---
> >  .../devicetree/bindings/usb/generic-xhci.yaml | 21 ++++++++++++++++---
> >  1 file changed, 18 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> > index 594ebb3ee432..b6e10b0a3c24 100644
> > --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> > +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> > @@ -9,9 +9,6 @@ title: USB xHCI Controller
> >  maintainers:
> >    - Mathias Nyman <mathias.nyman@intel.com>
> > 
> > -allOf:
> > -  - $ref: usb-xhci.yaml#
> > -
> >  properties:
> >    compatible:
> >      oneOf:
> > @@ -28,6 +25,7 @@ properties:
> >        - description: Broadcom STB SoCs with xHCI
> >          enum:
> >            - brcm,xhci-brcm-v2
> > +          - brcm,bcm2711-xhci
> >            - brcm,bcm7445-xhci
> >        - description: Generic xHCI device
> >          const: xhci-platform
> > @@ -49,6 +47,9 @@ properties:
> >        - const: core
> >        - const: reg
> > 
> > +  power-domains:
> > +    maxItems: 1
> > +
> >  unevaluatedProperties: false
> > 
> >  required:
> > @@ -56,6 +57,20 @@ required:
> >    - reg
> >    - interrupts
> > 
> > +allOf:
> > +  - $ref: usb-xhci.yaml#
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: brcm,bcm2711-xhci
> > +    then:
> > +      required:
> > +        - power-domains
> > +    else:
> > +      properties:
> > +        power-domains: false
> > +
> >  examples:
> >    - |
> >      usb@f0931000 {
> > --
> > 2.34.1
> > 



[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-03 11:11     ` Conor Dooley
@ 2023-12-03 16:56       ` Stefan Wahren
  2023-12-04 17:04         ` Conor Dooley
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2023-12-03 16:56 UTC (permalink / raw)
  To: Conor Dooley, Florian Fainelli, Justin Chen
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Mathias Nyman, bcm-kernel-feedback-list,
	Cyril Brulebois, linux-usb, devicetree, linux-arm-kernel

Hi,

Am 03.12.23 um 12:11 schrieb Conor Dooley:
> On Sun, Dec 03, 2023 at 11:06:43AM +0000, Conor Dooley wrote:
>> On Sun, Dec 03, 2023 at 12:22:15AM +0100, Stefan Wahren wrote:
>>> The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
>>> but also requires a power domain.
> Hmm
> This & the driver change makes it look like your compatible setup should
> be `compatible = "brcm,bcm2711-xhci", "brcm,xhci-brcm-v2";.
i don't have insight into the hardware, but the fact that the other
Broadcom SoC didn't require a power domain before let me think we
shouldn't do this. Otherwise this binding was broken before. But Justin
and Florian could clarify this.
> If the pattern in this patch was repeated, we'd have to modify the
> driver like your 2nd patch does for each and new broadcom system that
> needs the power domain.
 From my understanding the DT compatible should be specific as possible.
This is what i did, especially because the Raspberry Pi boards tends to
needs some quirks.

Best regards
>
>
>>> So introduce a new compatible
>>> and the specific constraints. Since the key allOf can only occur
>>> once, merge the reference below.
>>>
>>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
>> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
>>
>> Cheers,
>> Conor.
>>
>>> ---
>>>   .../devicetree/bindings/usb/generic-xhci.yaml | 21 ++++++++++++++++---
>>>   1 file changed, 18 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
>>> index 594ebb3ee432..b6e10b0a3c24 100644
>>> --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
>>> +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
>>> @@ -9,9 +9,6 @@ title: USB xHCI Controller
>>>   maintainers:
>>>     - Mathias Nyman <mathias.nyman@intel.com>
>>>
>>> -allOf:
>>> -  - $ref: usb-xhci.yaml#
>>> -
>>>   properties:
>>>     compatible:
>>>       oneOf:
>>> @@ -28,6 +25,7 @@ properties:
>>>         - description: Broadcom STB SoCs with xHCI
>>>           enum:
>>>             - brcm,xhci-brcm-v2
>>> +          - brcm,bcm2711-xhci
>>>             - brcm,bcm7445-xhci
>>>         - description: Generic xHCI device
>>>           const: xhci-platform
>>> @@ -49,6 +47,9 @@ properties:
>>>         - const: core
>>>         - const: reg
>>>
>>> +  power-domains:
>>> +    maxItems: 1
>>> +
>>>   unevaluatedProperties: false
>>>
>>>   required:
>>> @@ -56,6 +57,20 @@ required:
>>>     - reg
>>>     - interrupts
>>>
>>> +allOf:
>>> +  - $ref: usb-xhci.yaml#
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            const: brcm,bcm2711-xhci
>>> +    then:
>>> +      required:
>>> +        - power-domains
>>> +    else:
>>> +      properties:
>>> +        power-domains: false
>>> +
>>>   examples:
>>>     - |
>>>       usb@f0931000 {
>>> --
>>> 2.34.1
>>>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-03 16:56       ` Stefan Wahren
@ 2023-12-04 17:04         ` Conor Dooley
  2023-12-04 17:49           ` Florian Fainelli
  0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2023-12-04 17:04 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Florian Fainelli, Justin Chen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Mathias Nyman,
	bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1138 bytes --]

On Sun, Dec 03, 2023 at 05:56:24PM +0100, Stefan Wahren wrote:
> Hi,
> 
> Am 03.12.23 um 12:11 schrieb Conor Dooley:
> > On Sun, Dec 03, 2023 at 11:06:43AM +0000, Conor Dooley wrote:
> > > On Sun, Dec 03, 2023 at 12:22:15AM +0100, Stefan Wahren wrote:
> > > > The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
> > > > but also requires a power domain.
> > Hmm
> > This & the driver change makes it look like your compatible setup should
> > be `compatible = "brcm,bcm2711-xhci", "brcm,xhci-brcm-v2";.
> i don't have insight into the hardware, but the fact that the other
> Broadcom SoC didn't require a power domain before let me think we
> shouldn't do this. Otherwise this binding was broken before. But Justin
> and Florian could clarify this.
> > If the pattern in this patch was repeated, we'd have to modify the
> > driver like your 2nd patch does for each and new broadcom system that
> > needs the power domain.
> From my understanding the DT compatible should be specific as possible.

Note that I am suggesting have 2 compatibles. One specific, falling back
to the existing generic one.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-04 17:04         ` Conor Dooley
@ 2023-12-04 17:49           ` Florian Fainelli
  2023-12-04 20:27             ` Stefan Wahren
  0 siblings, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2023-12-04 17:49 UTC (permalink / raw)
  To: Conor Dooley, Stefan Wahren
  Cc: Justin Chen, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Mathias Nyman, bcm-kernel-feedback-list,
	Cyril Brulebois, linux-usb, devicetree, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1361 bytes --]

On 12/4/23 09:04, Conor Dooley wrote:
> On Sun, Dec 03, 2023 at 05:56:24PM +0100, Stefan Wahren wrote:
>> Hi,
>>
>> Am 03.12.23 um 12:11 schrieb Conor Dooley:
>>> On Sun, Dec 03, 2023 at 11:06:43AM +0000, Conor Dooley wrote:
>>>> On Sun, Dec 03, 2023 at 12:22:15AM +0100, Stefan Wahren wrote:
>>>>> The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
>>>>> but also requires a power domain.
>>> Hmm
>>> This & the driver change makes it look like your compatible setup should
>>> be `compatible = "brcm,bcm2711-xhci", "brcm,xhci-brcm-v2";.
>> i don't have insight into the hardware, but the fact that the other
>> Broadcom SoC didn't require a power domain before let me think we
>> shouldn't do this. Otherwise this binding was broken before. But Justin
>> and Florian could clarify this.

That seems to me like the right approach, the XHCI controller in 2711 is 
tied to a power domain, however that is not the case for other Broadcom 
STB SoCs.

>>> If the pattern in this patch was repeated, we'd have to modify the
>>> driver like your 2nd patch does for each and new broadcom system that
>>> needs the power domain.
>>  From my understanding the DT compatible should be specific as possible.
> 
> Note that I am suggesting have 2 compatibles. One specific, falling back
> to the existing generic one.

We could do that, yes.
-- 
Florian


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-04 17:49           ` Florian Fainelli
@ 2023-12-04 20:27             ` Stefan Wahren
  2023-12-04 20:42               ` Conor Dooley
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2023-12-04 20:27 UTC (permalink / raw)
  To: Florian Fainelli, Conor Dooley
  Cc: Justin Chen, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Mathias Nyman, bcm-kernel-feedback-list,
	Cyril Brulebois, linux-usb, devicetree, linux-arm-kernel

Hi,

Am 04.12.23 um 18:49 schrieb Florian Fainelli:
> On 12/4/23 09:04, Conor Dooley wrote:
>> On Sun, Dec 03, 2023 at 05:56:24PM +0100, Stefan Wahren wrote:
>>> Hi,
>>>
>>> Am 03.12.23 um 12:11 schrieb Conor Dooley:
>>>> On Sun, Dec 03, 2023 at 11:06:43AM +0000, Conor Dooley wrote:
>>>>> On Sun, Dec 03, 2023 at 12:22:15AM +0100, Stefan Wahren wrote:
>>>>>> The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
>>>>>> but also requires a power domain.
>>>> Hmm
>>>> This & the driver change makes it look like your compatible setup
>>>> should
>>>> be `compatible = "brcm,bcm2711-xhci", "brcm,xhci-brcm-v2";.
>>> i don't have insight into the hardware, but the fact that the other
>>> Broadcom SoC didn't require a power domain before let me think we
>>> shouldn't do this. Otherwise this binding was broken before. But Justin
>>> and Florian could clarify this.
>
> That seems to me like the right approach, the XHCI controller in 2711
> is tied to a power domain, however that is not the case for other
> Broadcom STB SoCs.
before i send just another trial and error version of this series, this
what i understand:

diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
index 594ebb3ee432..6f8744d1ace7 100644
--- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
@@ -9,9 +9,6 @@ title: USB xHCI Controller
  maintainers:
    - Mathias Nyman <mathias.nyman@intel.com>

-allOf:
-  - $ref: usb-xhci.yaml#
-
  properties:
    compatible:
      oneOf:
@@ -25,6 +22,11 @@ properties:
                - marvell,armada-380-xhci
                - marvell,armada-8k-xhci
            - const: generic-xhci
+      - description: Broadcom BCM2711 SoC
+        items:
+          - enum:
+              - brcm,bcm2711-xhci
+          - const: brcm,xhci-brcm-v2
        - description: Broadcom STB SoCs with xHCI
          enum:
            - brcm,xhci-brcm-v2
@@ -49,6 +51,9 @@ properties:
        - const: core
        - const: reg

+  power-domains:
+    maxItems: 1
+
  unevaluatedProperties: false

  required:
@@ -56,6 +61,20 @@ required:
    - reg
    - interrupts

+allOf:
+  - $ref: usb-xhci.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: brcm,bcm2711-xhci
+    then:
+      required:
+        - power-domains
+    else:
+      properties:
+        power-domains: false
+
  examples:
    - |
      usb@f0931000 {



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711
  2023-12-04 20:27             ` Stefan Wahren
@ 2023-12-04 20:42               ` Conor Dooley
  0 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2023-12-04 20:42 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Florian Fainelli, Justin Chen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Mathias Nyman,
	bcm-kernel-feedback-list, Cyril Brulebois, linux-usb, devicetree,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 3089 bytes --]

On Mon, Dec 04, 2023 at 09:27:54PM +0100, Stefan Wahren wrote:
> Hi,
> 
> Am 04.12.23 um 18:49 schrieb Florian Fainelli:
> > On 12/4/23 09:04, Conor Dooley wrote:
> > > On Sun, Dec 03, 2023 at 05:56:24PM +0100, Stefan Wahren wrote:
> > > > Hi,
> > > > 
> > > > Am 03.12.23 um 12:11 schrieb Conor Dooley:
> > > > > On Sun, Dec 03, 2023 at 11:06:43AM +0000, Conor Dooley wrote:
> > > > > > On Sun, Dec 03, 2023 at 12:22:15AM +0100, Stefan Wahren wrote:
> > > > > > > The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2",
> > > > > > > but also requires a power domain.
> > > > > Hmm
> > > > > This & the driver change makes it look like your compatible setup
> > > > > should
> > > > > be `compatible = "brcm,bcm2711-xhci", "brcm,xhci-brcm-v2";.
> > > > i don't have insight into the hardware, but the fact that the other
> > > > Broadcom SoC didn't require a power domain before let me think we
> > > > shouldn't do this. Otherwise this binding was broken before. But Justin
> > > > and Florian could clarify this.
> > 
> > That seems to me like the right approach, the XHCI controller in 2711
> > is tied to a power domain, however that is not the case for other
> > Broadcom STB SoCs.
> before i send just another trial and error version of this series, this
> what i understand:
> 
> diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> index 594ebb3ee432..6f8744d1ace7 100644
> --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml
> @@ -9,9 +9,6 @@ title: USB xHCI Controller
>  maintainers:
>    - Mathias Nyman <mathias.nyman@intel.com>
> 
> -allOf:
> -  - $ref: usb-xhci.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -25,6 +22,11 @@ properties:
>                - marvell,armada-380-xhci
>                - marvell,armada-8k-xhci
>            - const: generic-xhci
> +      - description: Broadcom BCM2711 SoC
> +        items:

The comment and enum here kinda contradict eachother.
I'd probably say "Broadcom SoCs with power domains" or just leave the
comment out altogether. But in general, yes. You can keep the tag.

Thanks,
Conor.

> +          - enum:
> +              - brcm,bcm2711-xhci
> +          - const: brcm,xhci-brcm-v2
>        - description: Broadcom STB SoCs with xHCI
>          enum:
>            - brcm,xhci-brcm-v2
> @@ -49,6 +51,9 @@ properties:
>        - const: core
>        - const: reg
> 
> +  power-domains:
> +    maxItems: 1
> +
>  unevaluatedProperties: false
> 
>  required:
> @@ -56,6 +61,20 @@ required:
>    - reg
>    - interrupts
> 
> +allOf:
> +  - $ref: usb-xhci.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: brcm,bcm2711-xhci
> +    then:
> +      required:
> +        - power-domains
> +    else:
> +      properties:
> +        power-domains: false
> +
>  examples:
>    - |
>      usb@f0931000 {
> 
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-12-04 20:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-02 23:22 [PATCH V3 0/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Stefan Wahren
2023-12-02 23:22 ` [PATCH V3 1/3] dt-bindings: usb: xhci: add support for BCM2711 Stefan Wahren
2023-12-03 11:06   ` Conor Dooley
2023-12-03 11:11     ` Conor Dooley
2023-12-03 16:56       ` Stefan Wahren
2023-12-04 17:04         ` Conor Dooley
2023-12-04 17:49           ` Florian Fainelli
2023-12-04 20:27             ` Stefan Wahren
2023-12-04 20:42               ` Conor Dooley
2023-12-02 23:22 ` [PATCH V3 2/3] usb: xhci: xhci-plat: Add " Stefan Wahren
2023-12-02 23:22 ` [PATCH V3 3/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Stefan Wahren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox