Add Google Tensor SoC USB support
Subsystems (6)
v3 cover Add Google Tensor SoC USB support
This series introduces USB controller and PHY support for the Google Tensor G5 SoC (codename: Laguna), a new generation of Google silicon first launched with Pixel 10 devices.
The Tensor G5 represents a significant architectural overhaul compared to previous Tensor generations (e.g., gs101), which were based on Samsung Exynos IP. Although the G5 still utilizes Synopsys IP for the USB components, the custom top-level integration introduces a completely new design for clock, reset scheme, register interfaces and programming sequence, necessitating new drivers and device tree bindings.
The USB subsystem on Tensor G5 integrates a Synopsys DWC3 USB 3.1 DRD-Single Port controller with hibernation support, and a custom PHY block comprising Synopsys eUSB2 and USB 3.2/DP combo PHYs.
---
Changes in v3:
- Align binding file name with the compatible string
- Simplify the compatible property in binding to a single const value.
- Add descriptive comments and use item list in binding.
- Rename binding entries for clarity and brevity.
Link to v2: https://lore.kernel.org/linux-usb/[email protected]
Changes in v2:
- Reorder patches to present bindings first.
- Update dt binding compatible strings to be SoC-specific (google,gs5-*).
- Better describe the hardware in dt binding commit messages and descriptions.
- Adjust PHY driver commit subjects to use correct prefixes ("phy:").
- Move PHY driver from a subdirectory to drivers/phy/.
Link to v1: https://lore.kernel.org/linux-usb/[email protected]/
---
Roy Luo (4):
dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
usb: dwc3: Add Google Tensor SoC DWC3 glue driver
dt-bindings: phy: google: Add Google Tensor G5 USB PHY
phy: Add Google Tensor SoC USB PHY driver
.../bindings/phy/google,gs5-usb-phy.yaml | 88 +++ .../bindings/usb/google,gs5-dwc3.yaml | 141 +++++ drivers/phy/Kconfig | 15 + drivers/phy/Makefile | 1 + drivers/phy/phy-google-usb.c | 286 +++++++++ drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-google.c | 597 ++++++++++++++++++ 8 files changed, 1139 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml create mode 100644 drivers/phy/phy-google-usb.c create mode 100644 drivers/usb/dwc3/dwc3-google.c
base-commit: e5f0a698b34ed76002dc5cff3804a61c80233a7a
Signature · 1 line
2.51.0.740.g6adb054d12-goog
PATCH v3 1/4 dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
Document the device tree bindings for the DWC3 USB controller found in Google Tensor SoCs, starting with the G5 generation.
The Tensor G5 silicon represents a complete architectural departure from previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings are incompatible, necessitating this new device tree binding.
The USB controller on Tensor G5 is based on Synopsys DWC3 IP and features Dual-Role Device single port with hibernation support.
--- .../bindings/usb/google,gs5-dwc3.yaml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +141 -0
@@ -0,0 +1,141 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/google,gs5-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> + +description: + Describes the DWC3 USB controller block implemented on Google Tensor SoCs, + starting with the G5 generation. Based on Synopsys DWC3 IP, the controller + features Dual-Role Device single port with hibernation add-on. + +properties: + compatible: + const: google,gs5-dwc3 + + reg: + items: + - description: Core DWC3 IP registers. + - description: USB host controller configuration registers. + - description: USB custom interrrupts control registers. + + reg-names: + items: + - const: dwc3_core + - const: host_cfg + - const: usbint_cfg + + interrupts: + items: + - description: Core DWC3 interrupt. + - description: High speed power management event for remote wakeup from hibernation. + - description: Super speed power management event for remote wakeup from hibernation. + + interrupt-names: + items: + - const: dwc_usb3 + - const: hs_pme + - const: ss_pme + + clocks: + items: + - description: Non-sticky module clock. + - description: Sticky module clock. + - description: USB2 PHY APB clock. + + clock-names: + items: + - const: non_sticky + - const: sticky + - const: u2phy_apb + + resets: + items: + - description: Non-sticky module reset. + - description: Sticky module reset. + - description: USB2 PHY APB reset. + - description: DRD bus reset. + - description: Top-level reset. + + reset-names: + items: + - const: non_sticky + - const: sticky + - const: u2phy_apb + - const: drd_bus + - const: top + + power-domains: + items: + - description: Power switchable domain, the child of top domain. + Turning it on puts the controller into full power state, + turning it off puts the controller into power gated state. + - description: Top domain, the parent of power switchable domain. + Turning it on puts the controller into power gated state, + turning it off completely shuts off the controller. + + power-domain-names: + items: + - const: psw + - const: top + + iommus: + maxItems: 1 + +required: + - compatible + - reg + - reg-names + - interrupts + - interrupt-names + - clocks + - clock-names + - resets + - reset-names + - power-domains + - power-domain-names + +allOf: + - $ref: snps,dwc3-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + soc { + #address-cells = <2>; + #size-cells = <2>; + + usb@c400000 { + compatible = "google,gs5-dwc3"; + reg = <0 0x0c400000 0 0xd060>, <0 0x0c450000 0 0x14>, <0 0x0c450020 0 0x8>; + reg-names = "dwc3_core", "host_cfg", "usbint_cfg"; + interrupts = <GIC_SPI 580 IRQ_TYPE_LEVEL_HIGH 0>, + <GIC_SPI 597 IRQ_TYPE_LEVEL_HIGH 0>, + <GIC_SPI 598 IRQ_TYPE_LEVEL_HIGH 0>; + interrupt-names = "dwc_usb3", "hs_pme", "ss_pme"; + clocks = <&hsion_usbc_non_sticky_clk>, <&hsion_usbc_sticky_clk>, + <&hsion_u2phy_apb_clk>; + clock-names = "non_sticky", "sticky", "u2phy_apb"; + resets = <&hsion_resets_usbc_non_sticky>, <&hsion_resets_usbc_sticky>, + <&hsion_resets_u2phy_apb>, <&hsion_resets_usb_drd_bus>, + <&hsion_resets_usb_top>; + reset-names = "non_sticky", "sticky", "u2phy_apb", "drd_bus", "top"; + power-domains = <&hsio_n_usb_psw>, <&hsio_n_usb>; + power-domain-names = "psw", "top"; + phys = <&usb_phy 0>; + phy-names = "usb2-phy"; + snps,quirk-frame-length-adjustment = <0x20>; + snps,gfladj-refclk-lpm-sel-quirk; + snps,incr-burst-type-adjustment = <4>; + }; + }; +...
Signature · 1 line
2.51.0.740.g6adb054d12-goog
Krzysztof Kozlowski
maintainerRe: [PATCH v3 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
Quoted 11 lines · Roy Luo
Document the device tree bindings for the DWC3 USB controller found in Google Tensor SoCs, starting with the G5 generation.
The Tensor G5 silicon represents a complete architectural departure from previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings are incompatible, necessitating this new device tree binding.
The USB controller on Tensor G5 is based on Synopsys DWC3 IP and features Dual-Role Device single port with hibernation support.
You still mix, completely unnecessarily, subsystems. For Greg this is actually even undesired, but regardless don't do this for any cases because it just makes everything slower or more difficult to apply.
Really, think how maintainers should deal with your patches.
Quoted 41 lines
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs5-dwc3.yaml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +28
-0@@ -0,0 +1,141 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/google,gs5-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> + +description: + Describes the DWC3 USB controller block implemented on Google Tensor SoCs, + starting with the G5 generation. Based on Synopsys DWC3 IP, the controller + features Dual-Role Device single port with hibernation add-on. + +properties: + compatible: + const: google,gs5-dwc3 + + reg: + items: + - description: Core DWC3 IP registers. + - description: USB host controller configuration registers. + - description: USB custom interrrupts control registers. + + reg-names:
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 38
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +10
-0+ items: + - const: dwc3_core + - const: host_cfg + - const: usbint_cfg + + interrupts: + items: + - description: Core DWC3 interrupt. + - description: High speed power management event for remote wakeup from hibernation. + - description: Super speed power management event for remote wakeup from hibernation.
Wrap at 80 (see coding style) or just shorten these.
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 42
Quoted 4 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +4
-0+ + interrupt-names: + items: + - const: dwc_usb3
So just "core"?
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 50
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +8
-0+ - const: hs_pme + - const: ss_pme + + clocks: + items: + - description: Non-sticky module clock. + - description: Sticky module clock. + - description: USB2 PHY APB clock.
This looks wrong. This is not the USB2 phy, so how can it consume APB clock?
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 62
Quoted 12 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +12
-0+ + clock-names: + items: + - const: non_sticky + - const: sticky + - const: u2phy_apb + + resets: + items: + - description: Non-sticky module reset. + - description: Sticky module reset. + - description: USB2 PHY APB reset.
This as well.
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 72
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +10
-0+ - description: DRD bus reset. + - description: Top-level reset. + + reset-names: + items: + - const: non_sticky + - const: sticky + - const: u2phy_apb + - const: drd_bus + - const: top
Best regards,
Krzysztof
Re: [PATCH v3 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Roy Luo
Document the device tree bindings for the DWC3 USB controller found in Google Tensor SoCs, starting with the G5 generation.
The Tensor G5 silicon represents a complete architectural departure from previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings are incompatible, necessitating this new device tree binding.
Quoted 9 lines
Quoted 2 lines
The USB controller on Tensor G5 is based on Synopsys DWC3 IP and features Dual-Role Device single port with hibernation support.
You still mix, completely unnecessarily, subsystems. For Greg this is actually even undesired, but regardless don't do this for any cases because it just makes everything slower or more difficult to apply.
Really, think how maintainers should deal with your patches.
Understood, I will separate the patches into two distinct series: one for the controller and one for the PHY.
Appreciate the feedback and the explanation.
Quoted 45 lines
Quoted 45 lines
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs5-dwc3.yaml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +32
-0@@ -0,0 +1,141 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/google,gs5-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> + +description: + Describes the DWC3 USB controller block implemented on Google Tensor SoCs, + starting with the G5 generation. Based on Synopsys DWC3 IP, the controller + features Dual-Role Device single port with hibernation add-on. + +properties: + compatible: + const: google,gs5-dwc3 + + reg: + items: + - description: Core DWC3 IP registers. + - description: USB host controller configuration registers. + - description: USB custom interrrupts control registers. + + reg-names: + items: + - const: dwc3_core + - const: host_cfg + - const: usbint_cfg
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 38
Quoted 6 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +6
-0+ + interrupts: + items: + - description: Core DWC3 interrupt. + - description: High speed power management event for remote wakeup from hibernation. + - description: Super speed power management event for remote wakeup from hibernation.Wrap at 80 (see coding style) or just shorten these.
Ack, will fix it in the next patch.
Quoted 7 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 42
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +4
-0+ + interrupt-names: + items: + - const: dwc_usb3So just "core"?
I'd prefer to stick to "dwc_usb3" as that's
1. more expressive by referring to the underlying IP name,
2. consistent with established dwc3 bindings such as Documentation/devicetree/bindings/usb/snps,dwc3.yaml, Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml,
unless you have a strong preference for the alternative naming.
Quoted 11 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 50
Quoted 9 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +8
-0+ - const: hs_pme + - const: ss_pme + + clocks: + items: + - description: Non-sticky module clock. + - description: Sticky module clock. + - description: USB2 PHY APB clock.This looks wrong. This is not the USB2 phy, so how can it consume APB clock?
That's a fair point, I'll look into the necessity and placement of this specific clk/reset and get back.
Thanks,
Roy Luo
Quoted 30 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 62
Quoted 13 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +12
-0+ + clock-names: + items: + - const: non_sticky + - const: sticky + - const: u2phy_apb + + resets: + items: + - description: Non-sticky module reset. + - description: Sticky module reset. + - description: USB2 PHY APB reset.This as well.
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 72
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +10
-0+ - description: DRD bus reset. + - description: Top-level reset. + + reset-names: + items: + - const: non_sticky + - const: sticky + - const: u2phy_apb + - const: drd_bus + - const: topBest regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v3 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
Quoted 88 lines · Roy Luo
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Roy Luo
Document the device tree bindings for the DWC3 USB controller found in Google Tensor SoCs, starting with the G5 generation.
The Tensor G5 silicon represents a complete architectural departure from previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings are incompatible, necessitating this new device tree binding.
Quoted 9 lines
Quoted 2 lines
The USB controller on Tensor G5 is based on Synopsys DWC3 IP and features Dual-Role Device single port with hibernation support.
You still mix, completely unnecessarily, subsystems. For Greg this is actually even undesired, but regardless don't do this for any cases because it just makes everything slower or more difficult to apply.
Really, think how maintainers should deal with your patches.
Understood, I will separate the patches into two distinct series: one for the controller and one for the PHY.
Appreciate the feedback and the explanation.Quoted 45 lines
Quoted 45 lines
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs5-dwc3.yaml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +32
-0@@ -0,0 +1,141 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/google,gs5-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> + +description: + Describes the DWC3 USB controller block implemented on Google Tensor SoCs, + starting with the G5 generation. Based on Synopsys DWC3 IP, the controller + features Dual-Role Device single port with hibernation add-on. + +properties: + compatible: + const: google,gs5-dwc3 + + reg: + items: + - description: Core DWC3 IP registers. + - description: USB host controller configuration registers. + - description: USB custom interrrupts control registers. + + reg-names: + items: + - const: dwc3_core + - const: host_cfg + - const: usbint_cfgQuoted 8 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 38
Quoted 6 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +6
-0+ + interrupts: + items: + - description: Core DWC3 interrupt. + - description: High speed power management event for remote wakeup from hibernation. + - description: Super speed power management event for remote wakeup from hibernation.Wrap at 80 (see coding style) or just shorten these.
Ack, will fix it in the next patch.
Quoted 6 lines
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +4
-0+ + interrupt-names: + items: + - const: dwc_usb3
Quoted 4 lines
Quoted 1 line
So just "core"?
I'd prefer to stick to "
dwc_usb3" as that's
1. more expressive by referring to the underlying IP name,
But that's completely redundant name.
Quoted 2 lines
2. consistent with established dwc3 bindings such as
Documentation/devicetree/bindings/usb/snps,dwc3.yaml,
If you use only one interrupt. You don't use one interrupt here.
Quoted 2 lines
Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml,
unless you have a strong preference for the alternative naming.
Such namings are discouraged, because they tell absolutely nothing. Also, schematics or datasheets usually do not use them, either.
Best regards,
Krzysztof
Re: [PATCH v3 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
Quoted 96 lines · Krzysztof Kozlowski
Quoted 88 lines · Roy Luo
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Roy Luo
Document the device tree bindings for the DWC3 USB controller found in Google Tensor SoCs, starting with the G5 generation.
The Tensor G5 silicon represents a complete architectural departure from previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings are incompatible, necessitating this new device tree binding.
Quoted 9 lines
Quoted 2 lines
The USB controller on Tensor G5 is based on Synopsys DWC3 IP and features Dual-Role Device single port with hibernation support.
You still mix, completely unnecessarily, subsystems. For Greg this is actually even undesired, but regardless don't do this for any cases because it just makes everything slower or more difficult to apply.
Really, think how maintainers should deal with your patches.
Understood, I will separate the patches into two distinct series: one for the controller and one for the PHY.
Appreciate the feedback and the explanation.Quoted 45 lines
Quoted 45 lines
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs5-dwc3.yaml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +32
-0@@ -0,0 +1,141 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/google,gs5-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> + +description: + Describes the DWC3 USB controller block implemented on Google Tensor SoCs, + starting with the G5 generation. Based on Synopsys DWC3 IP, the controller + features Dual-Role Device single port with hibernation add-on. + +properties: + compatible: + const: google,gs5-dwc3 + + reg: + items: + - description: Core DWC3 IP registers. + - description: USB host controller configuration registers. + - description: USB custom interrrupts control registers. + + reg-names: + items: + - const: dwc3_core + - const: host_cfg + - const: usbint_cfgQuoted 8 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 38
Quoted 6 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +6
-0+ + interrupts: + items: + - description: Core DWC3 interrupt. + - description: High speed power management event for remote wakeup from hibernation. + - description: Super speed power management event for remote wakeup from hibernation.Wrap at 80 (see coding style) or just shorten these.
Ack, will fix it in the next patch.
Quoted 6 lines
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +4
-0+ + interrupt-names: + items: + - const: dwc_usb3Quoted 4 lines
Quoted 1 line
So just "core"?
I'd prefer to stick to "
dwc_usb3" as that's
1. more expressive by referring to the underlying IP name,
Quoted 6 lines
But that's completely redundant name.
Quoted 2 lines
2. consistent with established dwc3 bindings such as
Documentation/devicetree/bindings/usb/snps,dwc3.yaml,If you use only one interrupt. You don't use one interrupt here.
After looking into it further, I found that the interrupt name "dwc_usb3" must be used here to adhere to the interrupt naming defined in "snps,dwc3.yaml".
This requirement stems from the device's corresponding glue driver utilizing a so-called "flattened" model (see [1] for context). This model causes the glue driver to probe an underlying "snps,dwc3" device. Consequently, the core DWC3 interrupt defined here is consumed by the driver handling the "snps,dwc3" device, making it mandatory to follow the interrupt naming established in "snps,dwc3.yaml". Essentially, the interrupts defined here are a mix of vendor specific implementation (like "hs_pme", "ss_pme") and the DWC3 core in "snps,dwc3.yaml" ("dwc_usb3").
I don't know if there's a better way to express this implicit dependency of the core DWC3 interrupt except for documenting it in the binding description. Any advice would be welcome.
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
Roy Luo
Quoted 10 lines
Quoted 3 lines
Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml,
unless you have a strong preference for the alternative naming.Such namings are discouraged, because they tell absolutely nothing. Also, schematics or datasheets usually do not use them, either.
Best regards,
Krzysztof
Re: [PATCH v3 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
Quoted 99 lines · Roy Luo
Quoted 98 lines · Krzysztof Kozlowski
Quoted 88 lines · Roy Luo
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Roy Luo
Document the device tree bindings for the DWC3 USB controller found in Google Tensor SoCs, starting with the G5 generation.
The Tensor G5 silicon represents a complete architectural departure from previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings are incompatible, necessitating this new device tree binding.
Quoted 9 lines
Quoted 2 lines
The USB controller on Tensor G5 is based on Synopsys DWC3 IP and features Dual-Role Device single port with hibernation support.
You still mix, completely unnecessarily, subsystems. For Greg this is actually even undesired, but regardless don't do this for any cases because it just makes everything slower or more difficult to apply.
Really, think how maintainers should deal with your patches.
Understood, I will separate the patches into two distinct series: one for the controller and one for the PHY.
Appreciate the feedback and the explanation.Quoted 45 lines
Quoted 45 lines
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs5-dwc3.yaml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +32
-0@@ -0,0 +1,141 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/google,gs5-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> + +description: + Describes the DWC3 USB controller block implemented on Google Tensor SoCs, + starting with the G5 generation. Based on Synopsys DWC3 IP, the controller + features Dual-Role Device single port with hibernation add-on. + +properties: + compatible: + const: google,gs5-dwc3 + + reg: + items: + - description: Core DWC3 IP registers. + - description: USB host controller configuration registers. + - description: USB custom interrrupts control registers. + + reg-names: + items: + - const: dwc3_core + - const: host_cfg + - const: usbint_cfgQuoted 8 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 38
Quoted 6 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +6
-0+ + interrupts: + items: + - description: Core DWC3 interrupt. + - description: High speed power management event for remote wakeup from hibernation. + - description: Super speed power management event for remote wakeup from hibernation.Wrap at 80 (see coding style) or just shorten these.
Ack, will fix it in the next patch.
Quoted 6 lines
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +4
-0+ + interrupt-names: + items: + - const: dwc_usb3Quoted 4 lines
Quoted 1 line
So just "core"?
I'd prefer to stick to "
dwc_usb3" as that's
1. more expressive by referring to the underlying IP name,But that's completely redundant name.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
2. consistent with established dwc3 bindings such as
Documentation/devicetree/bindings/usb/snps,dwc3.yaml,If you use only one interrupt. You don't use one interrupt here.
After looking into it further, I found that the interrupt name "
dwc_usb3" must be used here to adhere to the interrupt naming defined in "snps,dwc3.yaml".
Did you just chose to not read what Krzysztof said here? It must be used only when that's the sole interrupt, which he stated is not the case for your platform.
Quoted 6 lines
This requirement stems from the device's corresponding glue driver utilizing a so-called "flattened" model (see [1] for context). This model causes the glue driver to probe an underlying "snps,dwc3" device. Consequently, the core DWC3 interrupt defined here is consumed by the driver handling the "snps,dwc3" device, making it mandatory to follow the interrupt naming established in "snps,dwc3.yaml".
I look at the binding and noticed that interrupt-names isn't even a required property by snps,dwc3.yaml, and this comment about driver behaviour likely isn't accurate given that the code in for host mode (and the others are identical) is written so that it will grab the first interrupt if the specific names it looks for are absent:
| static int dwc3_host_get_irq(struct dwc3 *dwc)
| {
| struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
| int irq;
|
| irq = platform_get_irq_byname_optional(dwc3_pdev, "host");
| if (irq > 0) {
| dwc3_host_fill_xhci_irq_res(dwc, irq, "host");
| goto out;
| }
|
| if (irq == -EPROBE_DEFER)
| goto out;
|
| irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3");
| if (irq > 0) {
| dwc3_host_fill_xhci_irq_res(dwc, irq, "dwc_usb3");
| goto out;
| }
|
| if (irq == -EPROBE_DEFER)
| goto out;
|
| irq = platform_get_irq(dwc3_pdev, 0);
| if (irq > 0)
| dwc3_host_fill_xhci_irq_res(dwc, irq, NULL);
|
| out:
| return irq;
| }Since it grabs the first interrupt, as a fallback, in order to support not having the interrupt-names property, the name of the first interrupt ultimately doesn't matter at all to this driver (and likely any other driver written in compliance with the bindings for the dwc3 core).
I'm not here to argue about what the name for the single interrupt should be (keeping consistency with other devices might actually be good), but ignoring what a maintainer says and the seemingly providing an incorrect analysis is annoying. Did you perform the analysis on this yourself, or did it perhaps come from Gemini?
Thanks,
Conor.
Quoted 23 lines
Essentially, the interrupts defined here are a mix of vendor specific implementation (like "
hs_pme", "ss_pme") and the DWC3 core in "snps,dwc3.yaml" ("dwc_usb3").I don't know if there's a better way to express this implicit dependency of the core DWC3 interrupt except for documenting it in the binding description. Any advice would be welcome.
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
Roy LuoQuoted 10 lines
Quoted 3 lines
Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml,
unless you have a strong preference for the alternative naming.Such namings are discouraged, because they tell absolutely nothing. Also, schematics or datasheets usually do not use them, either.
Best regards,
Krzysztof
Re: [PATCH v3 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
Quoted 162 lines · Conor Dooley
Quoted 99 lines · Roy Luo
Quoted 98 lines · Krzysztof Kozlowski
Quoted 88 lines · Roy Luo
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Roy Luo
Document the device tree bindings for the DWC3 USB controller found in Google Tensor SoCs, starting with the G5 generation.
The Tensor G5 silicon represents a complete architectural departure from previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings are incompatible, necessitating this new device tree binding.
Quoted 9 lines
Quoted 2 lines
The USB controller on Tensor G5 is based on Synopsys DWC3 IP and features Dual-Role Device single port with hibernation support.
You still mix, completely unnecessarily, subsystems. For Greg this is actually even undesired, but regardless don't do this for any cases because it just makes everything slower or more difficult to apply.
Really, think how maintainers should deal with your patches.
Understood, I will separate the patches into two distinct series: one for the controller and one for the PHY.
Appreciate the feedback and the explanation.Quoted 45 lines
Quoted 45 lines
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs5-dwc3.yaml | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs5-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +32
-0@@ -0,0 +1,141 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/google,gs5-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> + +description: + Describes the DWC3 USB controller block implemented on Google Tensor SoCs, + starting with the G5 generation. Based on Synopsys DWC3 IP, the controller + features Dual-Role Device single port with hibernation add-on. + +properties: + compatible: + const: google,gs5-dwc3 + + reg: + items: + - description: Core DWC3 IP registers. + - description: USB host controller configuration registers. + - description: USB custom interrrupts control registers. + + reg-names: + items: + - const: dwc3_core + - const: host_cfg + - const: usbint_cfgQuoted 8 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml line 38
Quoted 6 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +6
-0+ + interrupts: + items: + - description: Core DWC3 interrupt. + - description: High speed power management event for remote wakeup from hibernation. + - description: Super speed power management event for remote wakeup from hibernation.Wrap at 80 (see coding style) or just shorten these.
Ack, will fix it in the next patch.
Quoted 6 lines
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs5-dwc3.yaml new file +4
-0+ + interrupt-names: + items: + - const: dwc_usb3Quoted 4 lines
Quoted 1 line
So just "core"?
I'd prefer to stick to "
dwc_usb3" as that's
1. more expressive by referring to the underlying IP name,But that's completely redundant name.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
2. consistent with established dwc3 bindings such as
Documentation/devicetree/bindings/usb/snps,dwc3.yaml,If you use only one interrupt. You don't use one interrupt here.
After looking into it further, I found that the interrupt name "
dwc_usb3" must be used here to adhere to the interrupt naming defined in "snps,dwc3.yaml".Did you just chose to not read what Krzysztof said here? It must be used only when that's the sole interrupt, which he stated is not the case for your platform.
Quoted 6 lines
This requirement stems from the device's corresponding glue driver utilizing a so-called "flattened" model (see [1] for context). This model causes the glue driver to probe an underlying "snps,dwc3" device. Consequently, the core DWC3 interrupt defined here is consumed by the driver handling the "snps,dwc3" device, making it mandatory to follow the interrupt naming established in "snps,dwc3.yaml".
I look at the binding and noticed that interrupt-names isn't even a required property by snps,dwc3.yaml, and this comment about driver behaviour likely isn't accurate given that the code in for host mode (and the others are identical) is written so that it will grab the first interrupt if the specific names it looks for are absent:
| static int dwc3_host_get_irq(struct dwc3 *dwc) | { | struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); | int irq; | | irq = platform_get_irq_byname_optional(dwc3_pdev, "host"); | if (irq > 0) { | dwc3_host_fill_xhci_irq_res(dwc, irq, "host"); | goto out; | } | | if (irq == -EPROBE_DEFER) | goto out; | | irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3"); | if (irq > 0) { | dwc3_host_fill_xhci_irq_res(dwc, irq, "dwc_usb3"); | goto out; | } | | if (irq == -EPROBE_DEFER) | goto out; | | irq = platform_get_irq(dwc3_pdev, 0); | if (irq > 0) | dwc3_host_fill_xhci_irq_res(dwc, irq, NULL); | | out: | return irq; | }Since it grabs the first interrupt, as a fallback, in order to support not having the interrupt-names property, the name of the first interrupt ultimately doesn't matter at all to this driver (and likely any other driver written in compliance with the bindings for the dwc3 core).
Quoted 8 lines
I'm not here to argue about what the name for the single interrupt should be (keeping consistency with other devices might actually be good), but ignoring what a maintainer says and the seemingly providing an incorrect analysis is annoying. Did you perform the analysis on this yourself, or did it perhaps come from Gemini?
Thanks,
Conor.
Hi Conor,
My apologies for the incorrect analysis. I misinterpreted the code, which was a big mistake. I can assure you that I do value your feedback and take every comment seriously.
Thanks for pointing out the error and raising your concern. This won't happen again.
Thanks,
Roy Luo
Quoted 24 lines
Quoted 24 lines
Essentially, the interrupts defined here are a mix of vendor specific implementation (like "
hs_pme", "ss_pme") and the DWC3 core in "snps,dwc3.yaml" ("dwc_usb3").I don't know if there's a better way to express this implicit dependency of the core DWC3 interrupt except for documenting it in the binding description. Any advice would be welcome.
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
Roy LuoQuoted 10 lines
Quoted 3 lines
Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml,
unless you have a strong preference for the alternative naming.Such namings are discouraged, because they tell absolutely nothing. Also, schematics or datasheets usually do not use them, either.
Best regards,
Krzysztof
PATCH v3 2/4 usb: dwc3: Add Google Tensor SoC DWC3 glue driver
In reply to Roy LuoAdd support for the DWC3 USB controller found on Google Tensor G5. The controller features dual-role functionality and hibernation.
The primary focus is implementing hibernation support in host mode, enabling the controller to enter a low-power state (D3). This is particularly relevant during system power state transition and runtime power management for power efficiency. Highlights:
- Align suspend callback with dwc3_suspend_common() for deciding between a full teardown and hibernation in host mode.
- Integration with psw (power switchable) and top power domains, managing their states and device links to support hibernation.
- A notifier callback dwc3_google_usb_psw_pd_notifier() for psw power domain events to manage controller state transitions to/from D3.
- Coordination of the non_sticky reset during power state transitions, asserting it on D3 entry and deasserting on D0 entry in hibernation scenario.
- Handling of high-speed and super-speed PME interrupts that are generated by remote wakeup during hibernation.
--- drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-google.c | 597 +++++++++++++++++++++++++++++++++ 3 files changed, 608 insertions(+) create mode 100644 drivers/usb/dwc3/dwc3-google.c
drivers/usb/dwc3/Kconfig +10 -0
@@ -189,4 +189,14 @@ config USB_DWC3_RTK or dual-role mode. Say 'Y' or 'M' if you have such device. +config USB_DWC3_GOOGLE + tristate "Google Platform" + depends on OF && COMMON_CLK && RESET_CONTROLLER + default n + help + Support the DesignWare Core USB3 IP found on Google Tensor + SoCs, starting with the G5 generation. This driver includes + support for hibernation in host mode. + Say 'Y' or 'M' if you have one such device. + endif
drivers/usb/dwc3/Makefile +1 -0
@@ -57,3 +57,4 @@ obj-$(CONFIG_USB_DWC3_IMX8MP) += dwc3-imx8mp.o obj-$(CONFIG_USB_DWC3_XILINX) += dwc3-xilinx.o obj-$(CONFIG_USB_DWC3_OCTEON) += dwc3-octeon.o obj-$(CONFIG_USB_DWC3_RTK) += dwc3-rtk.o +obj-$(CONFIG_USB_DWC3_GOOGLE) += dwc3-google.o
drivers/usb/dwc3/dwc3-google.c new file +597 -0
597 lines not on this page · raw message
Signature · 1 line
2.51.0.740.g6adb054d12-goog
Thinh Nguyen
maintainerRe: [PATCH v3 2/4] usb: dwc3: Add Google Tensor SoC DWC3 glue driver
Hi,
drivers/usb/dwc3/dwc3-google.c line 574
Quoted 6 lines · Roy Luo
drivers/usb/dwc3/dwc3-google.c new file +6
-0+#endif /* CONFIG_PM */ + +static const struct dev_pm_ops dwc3_google_dev_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(dwc3_google_pm_suspend, dwc3_google_pm_resume) +SET_RUNTIME_PM_OPS (dwc3_google_runtime_suspend, dwc3_google_runtime_resume, + dwc3_google_runtime_idle)
Can we use the new pm_ptr() and *_PM_OPS macros to get rid of the ifdef CONFIG_PM guards?
Quoted 26 lines
drivers/usb/dwc3/dwc3-google.c new file +23
-0+ .complete = dwc3_google_complete, + .prepare = dwc3_google_prepare, +}; + +static const struct of_device_id dwc3_google_of_match[] = { + { .compatible ="google,gs5-dwc3" }, + { } +}; +MODULE_DEVICE_TABLE (of, dwc3_google_of_match); + +static struct platform_driver dwc3_google_driver = { + .probe = dwc3_google_probe, + .remove = dwc3_google_remove, + .driver = { + .name ="google-dwc3" , + .pm = &dwc3_google_dev_pm_ops, + .of_match_table = dwc3_google_of_match, + }, +}; + +module_platform_driver (dwc3_google_driver); +MODULE_LICENSE ("GPL" ); +MODULE_DESCRIPTION ("DesignWare DWC3 Google Glue Driver" );Signature · 1 line
2.51.0.740.g6adb054d12-goog
Give me some time, and I'll review the rest of this patch.
Thanks,
Thinh
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH v3 2/4] usb: dwc3: Add Google Tensor SoC DWC3 glue driver
Quoted 4 lines · Thinh Nguyen
Hi,
On Fri, Oct 10, 2025, Roy Luo wrote:
Quoted 9 lines
drivers/usb/dwc3/dwc3-google.c line 574
Quoted 6 lines
drivers/usb/dwc3/dwc3-google.c new file +6
-0+#endif /* CONFIG_PM */ + +static const struct dev_pm_ops dwc3_google_dev_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(dwc3_google_pm_suspend, dwc3_google_pm_resume) +SET_RUNTIME_PM_OPS (dwc3_google_runtime_suspend, dwc3_google_runtime_resume, + dwc3_google_runtime_idle)Can we use the new
pm_ptr()and*_PM_OPSmacros to get rid of the ifdefCONFIG_PMguards?
Yes, will replace it with pm_ptr in the next patch. P.S. The kernel test robot is also complaining about it. [1]
[1] https://lore.kernel.org/linux-usb/[email protected]/
Quoted 21 lines
Quoted 21 lines
drivers/usb/dwc3/dwc3-google.c new file +20
-0+ .complete = dwc3_google_complete, + .prepare = dwc3_google_prepare, +}; + +static const struct of_device_id dwc3_google_of_match[] = { + { .compatible ="google,gs5-dwc3" }, + { } +}; +MODULE_DEVICE_TABLE (of, dwc3_google_of_match); + +static struct platform_driver dwc3_google_driver = { + .probe = dwc3_google_probe, + .remove = dwc3_google_remove, + .driver = { + .name ="google-dwc3" , + .pm = &dwc3_google_dev_pm_ops, + .of_match_table = dwc3_google_of_match, + }, +}; +
Quoted 8 lines
Quoted 6 lines
drivers/usb/dwc3/dwc3-google.c new file +3
-1+module_platform_driver (dwc3_google_driver); +MODULE_LICENSE ("GPL" ); +MODULE_DESCRIPTION ("DesignWare DWC3 Google Glue Driver" ); --2.51.0.740.g6adb054d12-goog
Give me some time, and I'll review the rest of this patch.
Thanks Thinh! and a heads up, I'm splitting this patset into two separate series as Krzysztof suggested; one for the controller and one for the phy, so the series title might change in the next version.
Regards,
Roy Luo
Quoted 3 lines
Thanks,
Thinh
Thinh Nguyen
maintainerRe: [PATCH v3 2/4] usb: dwc3: Add Google Tensor SoC DWC3 glue driver
Quoted 9 lines · Roy Luo
Quoted 2 lines · Thinh Nguyen
Give me some time, and I'll review the rest of this patch.
Thanks Thinh! and a heads up, I'm splitting this patset into two separate series as Krzysztof suggested; one for the controller and one for the phy, so the series title might change in the next version.
Ok. I'll review them after you push out the new changes.
BR,
Thinh
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v3 3/4 dt-bindings: phy: google: Add Google Tensor G5 USB PHY
In reply to Roy LuoDocument the device tree bindings for the USB PHY interfaces integrated with the DWC3 controller on Google Tensor SoCs, starting with G5 generation. The USB PHY on Tensor G5 includes two integrated Synopsys PHY IPs: the eUSB 2.0 PHY IP and the USB 3.2/DisplayPort combo PHY IP.
Due to a complete architectural overhaul in the Google Tensor G5, the existing Samsung/Exynos USB PHY binding for older generations of Google silicons such as gs101 are no longer compatible, necessitating this new device tree binding.
--- .../bindings/phy/google,gs5-usb-phy.yaml | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +88 -0
@@ -0,0 +1,88 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (C) 2025, Google LLC +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/google,gs5-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) USB PHY + +maintainers: + - Roy Luo <[email protected]> + +description: | + Describes the USB PHY interfaces integrated with the DWC3 USB controller on + Google Tensor SoCs, starting with the G5 generation. + Two specific PHY IPs from Synopsys are integrated, including eUSB 2.0 PHY IP + and USB 3.2/DisplayPort combo PHY IP. + The hardware can support three PHY interfaces, which are selected using the + first phandle argument in the PHY specifier:: + 0 - USB high-speed. + 1 - USB super-speed. + 2 - DisplayPort + +properties: + compatible: + const: google,gs5-usb-phy + + reg: + items: + - description: USB2 PHY configuration registers. + - description: DisplayPort top-level registers. + - description: USB top-level configuration registers. + + reg-names: + items: + - const: u2phy_cfg + - const: dp_top + - const: usb_top_cfg + + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + power-domains: + maxItems: 1 + + orientation-switch: + type: boolean + description: + Indicates the PHY as a handler of USB Type-C orientation changes + +required: + - compatible + - reg + - reg-names + - "#phy-cells" + - clocks + - resets + - power-domains + - orientation-switch + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + usb_phy: usb_phy@c410000 { + compatible = "google,gs5-usb-phy"; + reg = <0 0x0c450014 0 0xc>, + <0 0x0c637000 0 0xa0>, + <0 0x0c45002c 0 0x4>; + reg-names = "u2phy_cfg", "dp_top", "usb_top_cfg"; + #phy-cells = <1>; + clocks = <&hsion_usb2_phy_reset_clk>; + resets = <&hsion_resets_usb2_phy>; + power-domains = <&hsio_n_usb_pd>; + orientation-switch; + }; + }; +...
Signature · 1 line
2.51.0.740.g6adb054d12-goog
Krzysztof Kozlowski
maintainerRe: [PATCH v3 3/4] dt-bindings: phy: google: Add Google Tensor G5 USB PHY
Quoted 41 lines · Roy Luo
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +41
-0+ reg: + items: + - description: USB2 PHY configuration registers. + - description: DisplayPort top-level registers. + - description: USB top-level configuration registers. + + reg-names: + items: + - const: u2phy_cfg + - const: dp_top + - const: usb_top_cfg + + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + power-domains: + maxItems: 1 + + orientation-switch: + type: boolean + description: + Indicates the PHY as a handler of USB Type-C orientation changes + +required: + - compatible + - reg + - reg-names + - "#phy-cells" + - clocks + - resets + - power-domains + - orientation-switch + +additionalProperties: false +
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml line 78
Quoted 10 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +10
-0+examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + usb_phy: usb_phy@c410000 { + compatible = "google,gs5-usb-phy"; + reg = <0 0x0c450014 0 0xc>, + <0 0x0c637000 0 0xa0>,
You probably miss DP support and this does not belong here.
Quoted 1 line
+ <0
0x0c45002c00x4>;
That's not a separate address space. I really, really doubt that hardware engineers came with address spaces of one word long.
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml line 88
Quoted 9 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +9
-0+ reg-names = "u2phy_cfg", "dp_top", "usb_top_cfg"; + #phy-cells = <1>; + clocks = <&hsion_usb2_phy_reset_clk>; + resets = <&hsion_resets_usb2_phy>; + power-domains = <&hsio_n_usb_pd>; + orientation-switch; + }; + }; +...
Best regards,
Krzysztof
Re: [PATCH v3 3/4] dt-bindings: phy: google: Add Google Tensor G5 USB PHY
Quoted 47 lines · Krzysztof Kozlowski
Quoted 45 lines · Roy Luo
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +45
-0+ reg: + items: + - description: USB2 PHY configuration registers. + - description: DisplayPort top-level registers. + - description: USB top-level configuration registers. + + reg-names: + items: + - const: u2phy_cfg + - const: dp_top + - const: usb_top_cfg + + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + power-domains: + maxItems: 1 + + orientation-switch: + type: boolean + description: + Indicates the PHY as a handler of USB Type-C orientation changes + +required: + - compatible + - reg + - reg-names + - "#phy-cells" + - clocks + - resets + - power-domains + - orientation-switch + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>;
Quoted 8 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml line 78
Quoted 6 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +6
-0+ #size-cells = <2>; + + usb_phy: usb_phy@c410000 { + compatible = "google,gs5-usb-phy"; + reg = <0 0x0c450014 0 0xc>, + <0 0x0c637000 0 0xa0>,You probably miss DP support and this does not belong here.
This register space isn't solely for DP operation, a significant portion manages the custom combo PHY. Consequently, this space is essential even for USB-only operation. We can expect more registers in the space to be utilized when DP support is added.
While I acknowledge the current name is confusing, it directly reflects the hardware documentation. We can either adhere to the hardware documentation's naming or propose a more descriptive alternative. What's your preference?
Quoted 5 lines
Quoted 2 lines
+ <0
0x0c45002c00x4>;That's not a separate address space. I really, really doubt that hardware engineers came with address spaces of one word long.
I initially created this space to access the usb2only mode register, which must be programmed when the controller operates in high-speed only mode without the USB3 PHY initialized. Upon review, I now believe the controller driver is the better location for this configuration, as the register logically belongs there and the controller can tell whether usb3 phy is going to be initialized.
That is, I'm removing this register space in the next patch.
Thanks,
Roy Luo
Quoted 14 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml line 88
Quoted 10 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +9
-0+ reg-names = "u2phy_cfg", "dp_top", "usb_top_cfg"; + #phy-cells = <1>; + clocks = <&hsion_usb2_phy_reset_clk>; + resets = <&hsion_resets_usb2_phy>; + power-domains = <&hsio_n_usb_pd>; + orientation-switch; + }; + }; +...Best regards,
Krzysztof
Rob Herring
maintainerRe: [PATCH v3 3/4] dt-bindings: phy: google: Add Google Tensor G5 USB PHY
Quoted 73 lines · Roy Luo
Quoted 47 lines · Krzysztof Kozlowski
Quoted 45 lines · Roy Luo
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +45
-0+ reg: + items: + - description: USB2 PHY configuration registers. + - description: DisplayPort top-level registers. + - description: USB top-level configuration registers. + + reg-names: + items: + - const: u2phy_cfg + - const: dp_top + - const: usb_top_cfg + + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + power-domains: + maxItems: 1 + + orientation-switch: + type: boolean + description: + Indicates the PHY as a handler of USB Type-C orientation changes + +required: + - compatible + - reg + - reg-names + - "#phy-cells" + - clocks + - resets + - power-domains + - orientation-switch + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>;Quoted 8 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml line 78
Quoted 6 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +6
-0+ #size-cells = <2>; + + usb_phy: usb_phy@c410000 { + compatible = "google,gs5-usb-phy"; + reg = <0 0x0c450014 0 0xc>, + <0 0x0c637000 0 0xa0>,You probably miss DP support and this does not belong here.
This register space isn't solely for DP operation, a significant portion manages the custom combo PHY. Consequently, this space is essential even for USB-only operation. We can expect more registers in the space to be utilized when DP support is added.
While I acknowledge the current name is confusing, it directly reflects the hardware documentation. We can either adhere to the hardware documentation's naming or propose a more descriptive alternative. What's your preference?
Quoted 5 lines
Quoted 2 lines
+ <0
0x0c45002c00x4>;That's not a separate address space. I really, really doubt that hardware engineers came with address spaces of one word long.
Quoted 8 lines
I initially created this space to access the usb2only mode register, which must be programmed when the controller operates in high-speed only mode without the USB3 PHY initialized. Upon review, I now believe the controller driver is the better location for this configuration, as the register logically belongs there and the controller can tell whether usb3 phy is going to be initialized.
That is, I'm removing this register space in the next patch.
You are missing the point. What exists from 0x0c450020-2c and 0x0c450000-0x14 for that matter? Hardware blocks don't just start on unaligned boundaries like 0x14 or 0x2c. DT describes the h/w blocks, not just nodes of what a driver needs. So if the 0x2c register needs to be accessed by the USB driver, that's fine, but the register doesn't go in the USB controller node 'reg'. A property with a phandle to the node defining all the 0x0c450000 registers and an offset (if needed) is typically what we do there. Or you can just find that node by compatible.
Rob
Re: [PATCH v3 3/4] dt-bindings: phy: google: Add Google Tensor G5 USB PHY
Quoted 82 lines · Rob Herring
Quoted 80 lines · Roy Luo
Quoted 47 lines · Krzysztof Kozlowski
Quoted 45 lines · Roy Luo
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +45
-0+ reg: + items: + - description: USB2 PHY configuration registers. + - description: DisplayPort top-level registers. + - description: USB top-level configuration registers. + + reg-names: + items: + - const: u2phy_cfg + - const: dp_top + - const: usb_top_cfg + + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + power-domains: + maxItems: 1 + + orientation-switch: + type: boolean + description: + Indicates the PHY as a handler of USB Type-C orientation changes + +required: + - compatible + - reg + - reg-names + - "#phy-cells" + - clocks + - resets + - power-domains + - orientation-switch + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>;Quoted 8 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml line 78
Quoted 6 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +6
-0+ #size-cells = <2>; + + usb_phy: usb_phy@c410000 { + compatible = "google,gs5-usb-phy"; + reg = <0 0x0c450014 0 0xc>, + <0 0x0c637000 0 0xa0>,You probably miss DP support and this does not belong here.
This register space isn't solely for DP operation, a significant portion manages the custom combo PHY. Consequently, this space is essential even for USB-only operation. We can expect more registers in the space to be utilized when DP support is added.
While I acknowledge the current name is confusing, it directly reflects the hardware documentation. We can either adhere to the hardware documentation's naming or propose a more descriptive alternative. What's your preference?
Quoted 5 lines
Quoted 2 lines
+ <0
0x0c45002c00x4>;That's not a separate address space. I really, really doubt that hardware engineers came with address spaces of one word long.
I initially created this space to access the usb2only mode register, which must be programmed when the controller operates in high-speed only mode without the USB3 PHY initialized. Upon review, I now believe the controller driver is the better location for this configuration, as the register logically belongs there and the controller can tell whether usb3 phy is going to be initialized.
Quoted 5 lines
Quoted 1 line
That is, I'm removing this register space in the next patch.
You are missing the point. What exists from 0x0c450020-2c and 0x0c450000-0x14 for that matter? Hardware blocks don't just start on unaligned boundaries like
0x14or0x2c. DT describes the h/w blocks, not
Rob,
Thanks for chiming in. Let me elaborate the register layout here:
The register space 0x0c450000 - 0x00450043 is supposed to be assigned to the USB controller. However, the USB phy has to access a small portion of it, i.e. 0x0c450014 - 0x0c450020, in order to initialize usb2 phy. This is really unfortunate and makes things more complicated than it should've been.
The current patch is addressing it by splitting the register space:
- USB phy: <0 0x0c450014 0 0xc>
- USB controller: <0 0x0c450000 0 0x14>, <0 0x0c450020 0 0x23>
Quoted 6 lines
just nodes of what a driver needs. So if the
0x2cregister needs to be accessed by the USB driver, that's fine, but the register doesn't go in the USB controller node 'reg'. A property with a phandle to the node defining all the0x0c450000registers and an offset (if needed) is typically what we do there. Or you can just find that node by compatible.
Just to make sure we're on the same page, are you suggesting making the register space a syscon node [1]? something like this:
usb_cfg_csr: usb_cfg_csr@c450000 {
compatible = "syscon";
reg = <0 0x0c450000 0x0 0x43>;
};
usb@c400000 {
...
usb-cfg-syscon = <&usb_cfg_csr>;
...
};
usb_phy@c637000 {
...
usb-cfg-syscon = <&usb_cfg_csr>;
...
}
[1] Documentation/devicetree/bindings/mfd/syscon.yaml
Thanks,
Roy Luo
Quoted 2 lines
Rob
Re: [PATCH v3 3/4] dt-bindings: phy: google: Add Google Tensor G5 USB PHY
Quoted 130 lines · Roy Luo
Quoted 82 lines · Rob Herring
Quoted 80 lines · Roy Luo
Quoted 47 lines · Krzysztof Kozlowski
Quoted 45 lines · Roy Luo
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +45
-0+ reg: + items: + - description: USB2 PHY configuration registers. + - description: DisplayPort top-level registers. + - description: USB top-level configuration registers. + + reg-names: + items: + - const: u2phy_cfg + - const: dp_top + - const: usb_top_cfg + + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + power-domains: + maxItems: 1 + + orientation-switch: + type: boolean + description: + Indicates the PHY as a handler of USB Type-C orientation changes + +required: + - compatible + - reg + - reg-names + - "#phy-cells" + - clocks + - resets + - power-domains + - orientation-switch + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>;Quoted 8 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml line 78
Quoted 6 lines
Documentation/devicetree/bindings/phy/google,gs5-usb-phy.yaml new file +6
-0+ #size-cells = <2>; + + usb_phy: usb_phy@c410000 { + compatible = "google,gs5-usb-phy"; + reg = <0 0x0c450014 0 0xc>, + <0 0x0c637000 0 0xa0>,You probably miss DP support and this does not belong here.
This register space isn't solely for DP operation, a significant portion manages the custom combo PHY. Consequently, this space is essential even for USB-only operation. We can expect more registers in the space to be utilized when DP support is added.
While I acknowledge the current name is confusing, it directly reflects the hardware documentation. We can either adhere to the hardware documentation's naming or propose a more descriptive alternative. What's your preference?
Quoted 5 lines
Quoted 2 lines
+ <0
0x0c45002c00x4>;That's not a separate address space. I really, really doubt that hardware engineers came with address spaces of one word long.
I initially created this space to access the usb2only mode register, which must be programmed when the controller operates in high-speed only mode without the USB3 PHY initialized. Upon review, I now believe the controller driver is the better location for this configuration, as the register logically belongs there and the controller can tell whether usb3 phy is going to be initialized.
Quoted 5 lines
Quoted 1 line
That is, I'm removing this register space in the next patch.
You are missing the point. What exists from 0x0c450020-2c and 0x0c450000-0x14 for that matter? Hardware blocks don't just start on unaligned boundaries like
0x14or0x2c. DT describes the h/w blocks, notRob,
Thanks for chiming in. Let me elaborate the register layout here:
The register space0x0c450000-0x00450043is supposed to be assigned to the USB controller. However, the USB phy has to access a small portion of it, i.e.0x0c450014-0x0c450020, in order to initialize usb2 phy. This is really unfortunate and makes things more complicated than it should've been.The current patch is addressing it by splitting the register space:
- USB phy: <00x0c45001400xc>
- USB controller: <00x0c45000000x14>, <00x0c45002000x23>Quoted 6 lines
just nodes of what a driver needs. So if the
0x2cregister needs to be accessed by the USB driver, that's fine, but the register doesn't go in the USB controller node 'reg'. A property with a phandle to the node defining all the0x0c450000registers and an offset (if needed) is typically what we do there. Or you can just find that node by compatible.Just to make sure we're on the same page, are you suggesting making the register space a syscon node [1]? something like this:
usb_cfg_csr: usb_cfg_csr@c450000 {
compatible = "syscon";
reg = <00x0c4500000x00x43>;
};usb@c400000 {
...
usb-cfg-syscon = <&usb_cfg_csr>;
...
};usb_phy@c637000 {
...
usb-cfg-syscon = <&usb_cfg_csr>;
...
}
Quoted 5 lines
[1]
Documentation/devicetree/bindings/mfd/syscon.yamlThanks,
Roy Luo
Hi Rob,
I'm sending out a new version of the patchset.
Although this specific comment isn't fully resolved yet, I've integrated enough new content and fixes into this and other patches that I believe it's ready for another round of review.
I'm happy to continue the discussion on this specific point here or in
the new patchset. Here are the links to the new patches FYI:
- controller https://lore.kernel.org/linux-usb/[email protected]
- phy https://lore.kernel.org/linux-phy/[email protected]
Thanks,
Roy Luo
Quoted 2 lines
Quoted 2 lines
Rob
PATCH v3 4/4 phy: Add Google Tensor SoC USB PHY driver
In reply to Roy LuoSupport the USB PHY found on Google Tensor G5. This particular USB PHY supports both high-speed and super-speed operations, and is integrated with the SNPS DWC3 controller that's also on the SoC.
This initial patch specifically adds functionality for high-speed.
--- drivers/phy/Kconfig | 15 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-google-usb.c | 286 +++++++++++++++++++++++++++++++++++ 3 files changed, 302 insertions(+) create mode 100644 drivers/phy/phy-google-usb.c
drivers/phy/Kconfig +15 -0
@@ -101,6 +101,21 @@ config PHY_NXP_PTN3222 schemes. It supports all three USB 2.0 data rates: Low Speed, Full Speed and High Speed. +config PHY_GOOGLE_USB + tristate "Google Tensor SoC USB PHY driver" + depends on HAS_IOMEM + depends on OF + depends on TYPEC + depends on USB_DWC3_GOOGLE + select GENERIC_PHY + default USB_DWC3_GOOGLE + help + Enable support for the USB PHY on Google Tensor SoCs, starting with + the G5 generation. This driver provides the PHY interfaces to + interact with the SNPS eUSB2 and USB 3.2/DisplayPort Combo PHY, both + of which are integrated with the DWC3 USB controller. + This driver currently supports USB high-speed. + source "drivers/phy/allwinner/Kconfig" source "drivers/phy/amlogic/Kconfig" source "drivers/phy/broadcom/Kconfig"
drivers/phy/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_PHY_SNPS_EUSB2) += phy-snps-eusb2.o obj-$(CONFIG_USB_LGM_PHY) += phy-lgm-usb.o obj-$(CONFIG_PHY_AIROHA_PCIE) += phy-airoha-pcie.o obj-$(CONFIG_PHY_NXP_PTN3222) += phy-nxp-ptn3222.o +obj-$(CONFIG_PHY_GOOGLE_USB) += phy-google-usb.o obj-y += allwinner/ \ amlogic/ \ broadcom/ \
drivers/phy/phy-google-usb.c new file +286 -0
286 lines not on this page · raw message
Signature · 1 line
2.51.0.740.g6adb054d12-goog