Add Google Tensor SoC USB support
Subsystems (6)
v2 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 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,gs-usb-phy.yaml | 96 +++ .../bindings/usb/google,gs-dwc3.yaml | 145 +++++ drivers/phy/Kconfig | 14 + 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, 1150 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml create mode 100644 Documentation/devicetree/bindings/usb/google,gs-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.710.ga91ca5db03-goog
PATCH v2 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 and drivers 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,gs-dwc3.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +145 -0
@@ -0,0 +1,145 @@ +# 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,gs-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: + items: + - enum: + - google,gs5-dwc3 + + reg: + minItems: 3 + maxItems: 3 + + reg-names: + description: | + The following memory regions must present: + - dwc3_core: Core DWC3 IP registers. + - host_cfg_csr: Hibernation control registers. + - usbint_csr: Hibernation interrupt registers. + items: + - const: dwc3_core + - const: host_cfg_csr + - const: usbint_csr + + interrupts: + minItems: 3 + maxItems: 3 + + interrupt-names: + description: | + The following interrupts must present: + - dwc_usb3: Core DWC3 interrupt. + - hs_pme_irq: High speed remote wakeup interrupt for hibernation. + - ss_pme_irq: Super speed remote wakeup interrupt for hibernation. + items: + - const: dwc_usb3 + - const: hs_pme_irq + - const: ss_pme_irq + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + minItems: 3 + maxItems: 3 + + resets: + minItems: 5 + maxItems: 5 + + reset-names: + items: + - const: usbc_non_sticky + - const: usbc_sticky + - const: usb_drd_bus + - const: u2phy_apb + - const: usb_top_csr + + power-domains: + minItems: 2 + maxItems: 2 + + power-domain-names: + description: | + The following power domain must present: + - usb_psw_pd: The child power domain of usb_top_pd. Turning it on puts the controller + into full power state, turning it off puts the controller into power + gated state. + - usb_top_pd: The parent power domain of usb_psw_pd. Turning it on puts the controller + into power gated state, turning it off completely shuts off the + controller. + items: + - const: usb_psw_pd + - const: usb_top_pd + + iommus: + maxItems: 1 + +required: + - compatible + - reg + - reg-names + - interrupts + - interrupt-names + - clocks + - 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_csr", "usbint_csr"; + 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_irq", "ss_pme_irq"; + clocks = <&hsion_usbc_non_sticky_clk>, <&hsion_usbc_sticky_clk>, + <&hsion_u2phy_apb_clk>; + clock-names = "usbc_non_sticky", "usbc_sticky", "u2phy_apb"; + resets = <&hsion_resets_usbc_non_sticky>, <&hsion_resets_usbc_sticky>, + <&hsion_resets_usb_drd_bus>, <&hsion_resets_u2phy_apb>, + <&hsion_resets_usb_top_csr>; + reset-names = "usbc_non_sticky", "usbc_sticky", + "usb_drd_bus", "u2phy_apb", + "usb_top_csr"; + power-domains = <&hsio_n_usb_psw_pd>, <&hsio_n_usb_pd>; + power-domain-names = "usb_psw_pd", "usb_top_pd"; + 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.710.ga91ca5db03-goog
PATCH v2 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 usb_psw_pd and usb_top_pd power domains, managing their states and device links to support hibernation.
- A notifier callback dwc3_google_usb_psw_pd_notifier() for usb_psw_pd power domain events to manage controller state transitions to/from D3.
- Coordination of the usbc_non_sticky reset during power state transitions, asserting it on D3 entry and deasserting on D0 entry in hibernation scenario.
- Handling of U2 (high-speed) and U3 (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.710.ga91ca5db03-goog
PATCH v2 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.
Due to a complete architectural overhaul in the Google Tensor G5, the existing Samsung/Exynos USB PHY driver and binding for older generations of Google silicons such as gs101 are no longer compatible.
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. Currently only USB high-speed is described and supported.
--- .../bindings/phy/google,gs-usb-phy.yaml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +96 -0
@@ -0,0 +1,96 @@ +# 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,gs-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 first phandle argument within the PHY specifier is used to identify the + desired PHY. The currently supported value is:: + 0 - USB high-speed. + +properties: + compatible: + items: + - enum: + - google,gs5-usb-phy + + reg: + minItems: 3 + maxItems: 3 + + reg-names: + items: + - const: usb2_cfg_csr + - const: dp_top_csr + - const: usb_top_cfg_csr + + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: usb2_phy_clk + + resets: + maxItems: 1 + + reset-names: + items: + - const: usb2_phy_reset + + 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 + - clock-names + - resets + - reset-names + +unevaluatedProperties: 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 = "usb2_cfg_csr", "dp_top_csr", "usb_top_cfg_csr"; + #phy-cells = <1>; + clocks = <&hsion_usb2_phy_reset_clk>; + clock-names = "usb2_phy_clk"; + resets = <&hsion_resets_usb2_phy>; + reset-names = "usb2_phy_reset"; + power-domains = <&hsio_n_usb_pd>; + orientation-switch; + }; + }; +...
Signature · 1 line
2.51.0.710.ga91ca5db03-goog
PATCH v2 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 | 14 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-google-usb.c | 286 +++++++++++++++++++++++++++++++++++ 3 files changed, 301 insertions(+) create mode 100644 drivers/phy/phy-google-usb.c
drivers/phy/Kconfig +14 -0
@@ -101,6 +101,20 @@ 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. + 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.710.ga91ca5db03-goog
Re: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Roy LuoDocumentation/devicetree/bindings/usb/google,gs-dwc3.yaml
Quoted 23 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 and drivers 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.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs-dwc3.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +0
-0
filename matching the compatible please.
Quoted 13 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0@@ -0,0 +1,145 @@ +# 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,gs-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> +
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+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: + items: + - enum: + - google,gs5-dwc3
items is redundant here.
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 33
Quoted 11 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +11
-0+ + reg: + minItems: 3 + maxItems: 3 + + reg-names: + description: | + The following memory regions must present: + - dwc3_core: Core DWC3 IP registers. + - host_cfg_csr: Hibernation control registers. + - usbint_csr: Hibernation interrupt registers.
Put this into reg as an items list, and you can drop the min/max items from there.
Same applies to interrupts and power-domains.
Quoted 9 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +9
-0+ items: + - const: dwc3_core + - const: host_cfg_csr + - const: usbint_csr + + interrupts: + minItems: 3 + maxItems: 3 +
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 52
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ interrupt-names: + description: | + The following interrupts must present: + - dwc_usb3: Core DWC3 interrupt. + - hs_pme_irq: High speed remote wakeup interrupt for hibernation. + - ss_pme_irq: Super speed remote wakeup interrupt for hibernation. + items: + - const: dwc_usb3 + - const: hs_pme_irq + - const: ss_pme_irq
s/_irq//
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 64
Quoted 12 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + minItems: 3 + maxItems: 3 + + resets: + minItems: 5 + maxItems: 5
For clocks and resets, please provide descriptions. For clock-names, you provided no names and therefore cannot use the property since anything is valid!
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 72
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ + reset-names: + items: + - const: usbc_non_sticky + - const: usbc_sticky + - const: usb_drd_bus + - const: u2phy_apb + - const: usb_top_csr
"csr" is an odd thing to have in a reset name, since it usually means "control and status register". Why is it here.
Quoted 7 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ + power-domains: + minItems: 2 + maxItems: 2 + + power-domain-names: + description: |
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 89
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ The following power domain must present: + - usb_psw_pd: The child power domain of usb_top_pd. Turning it on puts the controller + into full power state, turning it off puts the controller into power + gated state. + - usb_top_pd: The parent power domain of usb_psw_pd. Turning it on puts the controller + into power gated state, turning it off completely shuts off the + controller. + items: + - const: usb_psw_pd + - const: usb_top_pd
s/_pd// at the very least, but I would question the need to put "usb" in any of the names given that this is a usb device.
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ + iommus: + maxItems: 1 + +required: + - compatible + - reg + - reg-names + - interrupts + - interrupt-names
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 109
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ - clocks + - resets + - reset-names + - power-domains + - power-domain-names + +allOf: + - $ref: snps,dwc3-common.yaml# + +unevaluatedProperties: false
So every property from snps,dwc3-common.yaml is valid here, with any of the permitted values?
Quoted 26 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +26
-0+ +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_csr", "usbint_csr"; + 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_irq", "ss_pme_irq"; + clocks = <&hsion_usbc_non_sticky_clk>, <&hsion_usbc_sticky_clk>, + <&hsion_u2phy_apb_clk>; + clock-names = "usbc_non_sticky", "usbc_sticky", "u2phy_apb"; + resets = <&hsion_resets_usbc_non_sticky>, <&hsion_resets_usbc_sticky>, + <&hsion_resets_usb_drd_bus>, <&hsion_resets_u2phy_apb>, + <&hsion_resets_usb_top_csr>; + reset-names = "usbc_non_sticky", "usbc_sticky", + "usb_drd_bus", "u2phy_apb", + "usb_top_csr";
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 145
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ power-domains = <&hsio_n_usb_psw_pd>, <&hsio_n_usb_pd>; + power-domain-names = "usb_psw_pd", "usb_top_pd"; + 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>; + }; + }; +...
pw-bot: cr
Krzysztof Kozlowski
maintainerRe: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Roy LuoQuoted 4 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
G5 does not have a model number like G1-G4?
Quoted 3 lines
previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings and drivers are incompatible,
Do not reference drivers. Explain the hardware.
Quoted 20 lines
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.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs-dwc3.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +3
-0@@ -0,0 +1,145 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright (c) 2025, Google LLC +%YAML 1.2
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 13
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+--- +$id: http://devicetree.org/schemas/usb/google,gs-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: |
Do not need '|' unless you need to preserve formatting.
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 25
Quoted 12 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ 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: + items: + - enum: + - google,gs5-dwc3 + + reg: + minItems: 3
Drop
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 33
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + reg-names: + description: | + The following memory regions must present: + - dwc3_core: Core DWC3 IP registers. + - host_cfg_csr: Hibernation control registers. + - usbint_csr: Hibernation interrupt registers.
Drop description or move it to items in reg. See other bindings.
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 40
Quoted 7 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ items: + - const: dwc3_core + - const: host_cfg_csr + - const: usbint_csr + + interrupts: + minItems: 3
Drop
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 48
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + interrupt-names: + description: | + The following interrupts must present: + - dwc_usb3: Core DWC3 interrupt. + - hs_pme_irq: High speed remote wakeup interrupt for hibernation. + - ss_pme_irq: Super speed remote wakeup interrupt for hibernation.
From where did you get this style? Don't write bindings with chat gpt or whatever other tool. it is a waste of our time.
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 60
Quoted 12 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ items: + - const: dwc_usb3 + - const: hs_pme_irq + - const: ss_pme_irq + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + minItems: 3 + maxItems: 3
From where did you get such syntax?
Quoted 16 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +16
-0+ + resets: + minItems: 5 + maxItems: 5 + + reset-names: + items: + - const: usbc_non_sticky + - const: usbc_sticky + - const: usb_drd_bus + - const: u2phy_apb + - const: usb_top_csr + + power-domains: + minItems: 2 + maxItems: 2
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 86
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ + power-domain-names: + description: | + The following power domain must present: + - usb_psw_pd: The child power domain of usb_top_pd. Turning it on puts the controller + into full power state, turning it off puts the controller into power + gated state. + - usb_top_pd: The parent power domain of usb_psw_pd. Turning it on puts the controller + into power gated state, turning it off completely shuts off the + controller.
Same comments.
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 93
Quoted 7 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ items: + - const: usb_psw_pd + - const: usb_top_pd + + iommus: + maxItems: 1 +
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v2 3/4] dt-bindings: phy: google: Add Google Tensor G5 USB PHY
In reply to Roy LuoQuoted 33 lines · Roy Luo
Document the device tree bindings for the USB PHY interfaces integrated with the DWC3 controller on Google Tensor SoCs, starting with G5 generation.
Due to a complete architectural overhaul in the Google Tensor G5, the existing Samsung/Exynos USB PHY driver and binding for older generations of Google silicons such as gs101 are no longer compatible.
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. Currently only USB high-speed is described and supported.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/phy/google,gs-usb-phy.yaml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/google,gs-usb-phy.yamlDocumentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +9
-0@@ -0,0 +1,96 @@ +# 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,gs-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) USB PHY +
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 19
Quoted 10 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +10
-0+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 first phandle argument within the PHY specifier is used to identify the + desired PHY. The currently supported value is::
Currently supported as hardware will change? You describe here hardware ONLY.
Quoted 7 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +7
-0+ 0 - USB high-speed. + +properties: + compatible: + items: + - enum: + - google,gs5-usb-phy
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 36
Quoted 10 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +10
-0+ + reg: + minItems: 3 + maxItems: 3 + + reg-names: + items: + - const: usb2_cfg_csr + - const: dp_top_csr + - const: usb_top_cfg_csr
Drop csr
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +10
-0+ + "#phy-cells": + const: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: usb2_phy_clk
Drop names, pointless for one entry.
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 53
Quoted 7 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +7
-0+ + resets: + maxItems: 1 + + reset-names: + items: + - const: usb2_phy_reset
Drop names, pointless for one entry.
Quoted 11 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +11
-0+ + power-domains: + maxItems: 1 + + orientation-switch: + type: boolean + description: + Indicates the PHY as a handler of USB Type-C orientation changes + +required: + - compatible
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 74
Quoted 10 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +10
-0+ - reg + - reg-names + - "#phy-cells" + - clocks + - clock-names + - resets + - reset-names + +unevaluatedProperties: false +
additionalProps instead. Read writing schema or example schema.
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Conor DooleyQuoted 157 lines · Conor Dooley
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml
Quoted 23 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 and drivers 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.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs-dwc3.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +0
-0filename matching the compatible please.
Quoted 13 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0@@ -0,0 +1,145 @@ +# 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,gs-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller + +maintainers: + - Roy Luo <[email protected]> +Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+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: + items: + - enum: + - google,gs5-dwc3items is redundant here.
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 33
Quoted 11 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +11
-0+ + reg: + minItems: 3 + maxItems: 3 + + reg-names: + description: | + The following memory regions must present: + - dwc3_core: Core DWC3 IP registers. + - host_cfg_csr: Hibernation control registers. + - usbint_csr: Hibernation interrupt registers.Put this into reg as an items list, and you can drop the min/max items from there.
Same applies to interrupts and power-domains.Quoted 9 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +9
-0+ items: + - const: dwc3_core + - const: host_cfg_csr + - const: usbint_csr + + interrupts: + minItems: 3 + maxItems: 3 +Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 52
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ interrupt-names: + description: | + The following interrupts must present: + - dwc_usb3: Core DWC3 interrupt. + - hs_pme_irq: High speed remote wakeup interrupt for hibernation. + - ss_pme_irq: Super speed remote wakeup interrupt for hibernation. + items: + - const: dwc_usb3 + - const: hs_pme_irq + - const: ss_pme_irqs/_irq//
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 64
Quoted 12 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + minItems: 3 + maxItems: 3 + + resets: + minItems: 5 + maxItems: 5For clocks and resets, please provide descriptions. For clock-names, you provided no names and therefore cannot use the property since anything is valid!
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 72
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ + reset-names: + items: + - const: usbc_non_sticky + - const: usbc_sticky + - const: usb_drd_bus + - const: u2phy_apb + - const: usb_top_csr"csr" is an odd thing to have in a reset name, since it usually means "control and status register". Why is it here.
Quoted 7 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ + power-domains: + minItems: 2 + maxItems: 2 + + power-domain-names: + description: |Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 89
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ The following power domain must present: + - usb_psw_pd: The child power domain of usb_top_pd. Turning it on puts the controller + into full power state, turning it off puts the controller into power + gated state. + - usb_top_pd: The parent power domain of usb_psw_pd. Turning it on puts the controller + into power gated state, turning it off completely shuts off the + controller. + items: + - const: usb_psw_pd + - const: usb_top_pds/_pd// at the very least, but I would question the need to put "usb" in any of the names given that this is a usb device.
Quoted 15 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +15
-0+ + iommus: + maxItems: 1 + +required: + - compatible + - reg + - reg-names + - interrupts + - interrupt-names + - clocks + - resets + - reset-names + - power-domains + - power-domain-names
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 109
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +5
-0+ +allOf: + - $ref: snps,dwc3-common.yaml# + +unevaluatedProperties: falseSo every property from snps,dwc3-common.yaml is valid here, with any of the permitted values?
Conor,
Appreciate the review.
Ack to all the comments, will fix them in the next patch. And yes, every property from snps,dwc3-common.yaml is valid here. You can find more context here [1], essentially the dwc3 glue would be operating on the same platform device as the dwc3 core, hence all properties are allowed.
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
Roy Luo
Quoted 38 lines
Quoted 26 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +26
-0+ +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_csr", "usbint_csr"; + 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_irq", "ss_pme_irq"; + clocks = <&hsion_usbc_non_sticky_clk>, <&hsion_usbc_sticky_clk>, + <&hsion_u2phy_apb_clk>; + clock-names = "usbc_non_sticky", "usbc_sticky", "u2phy_apb"; + resets = <&hsion_resets_usbc_non_sticky>, <&hsion_resets_usbc_sticky>, + <&hsion_resets_usb_drd_bus>, <&hsion_resets_u2phy_apb>, + <&hsion_resets_usb_top_csr>; + reset-names = "usbc_non_sticky", "usbc_sticky", + "usb_drd_bus", "u2phy_apb", + "usb_top_csr";Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 145
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ power-domains = <&hsio_n_usb_psw_pd>, <&hsio_n_usb_pd>; + power-domain-names = "usb_psw_pd", "usb_top_pd"; + 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>; + }; + }; +...pw-bot: cr
Re: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Krzysztof KozlowskiQuoted 9 lines · Krzysztof Kozlowski
Quoted 4 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
G5 does not have a model number like G1-G4?
There's no model number for G5, I'm sticking to the existing "gs" prefix as they're still in the same SoC family. Please let me know if you have any concerns.
Quoted 6 lines
Quoted 4 lines
previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings and drivers are incompatible,
Do not reference drivers. Explain the hardware.
Ack, all mentions of "driver" will be removed in the next patch.
Quoted 26 lines
Quoted 26 lines
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.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs-dwc3.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0@@ -0,0 +1,145 @@ +# 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,gs-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC Controller
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 13
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +5
-0+ +maintainers: + - Roy Luo <[email protected]> + +description: |Do not need '|' unless you need to preserve formatting.
Ack, will fix this in the next patch.
Quoted 25 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 25
Quoted 13 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ 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: + items: + - enum: + - google,gs5-dwc3 + + reg: + minItems: 3Drop
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 33
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + reg-names: + description: | + The following memory regions must present: + - dwc3_core: Core DWC3 IP registers. + - host_cfg_csr: Hibernation control registers. + - usbint_csr: Hibernation interrupt registers.
Quoted 1 line
Drop description or move it to items in reg. See other bindings.
Ack, will use an item list in reg instead.
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 40
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ items: + - const: dwc3_core + - const: host_cfg_csr + - const: usbint_csr + + interrupts: + minItems: 3Drop
Ack, will use an item list instead.
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 48
Quoted 9 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + interrupt-names: + description: | + The following interrupts must present: + - dwc_usb3: Core DWC3 interrupt. + - hs_pme_irq: High speed remote wakeup interrupt for hibernation. + - ss_pme_irq: Super speed remote wakeup interrupt for hibernation.
Quoted 2 lines
From where did you get this style? Don't write bindings with chat gpt or whatever other tool. it is a waste of our time.
I referenced the style from a recent dt binding change [1] that adds "Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml". I thought it would be a good reference because it's relatively new and is also a binding for SNPS dwc3 glue logic. Perhaps that style doesn't apply here because qcom,snps-dwc3.yaml supports multiple compatible and here we have only one?
Just to clarify, I'm a Gemini user and this patch is 100% organic, hand-crafted by a living human brain :)
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
Roy Luo
Quoted 55 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 60
Quoted 13 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ items: + - const: dwc_usb3 + - const: hs_pme_irq + - const: ss_pme_irq + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + minItems: 3 + maxItems: 3From where did you get such syntax?
Quoted 16 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +16
-0+ + resets: + minItems: 5 + maxItems: 5 + + reset-names: + items: + - const: usbc_non_sticky + - const: usbc_sticky + - const: usb_drd_bus + - const: u2phy_apb + - const: usb_top_csr + + power-domains: + minItems: 2 + maxItems: 2Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 86
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +10
-0+ + power-domain-names: + description: | + The following power domain must present: + - usb_psw_pd: The child power domain of usb_top_pd. Turning it on puts the controller + into full power state, turning it off puts the controller into power + gated state. + - usb_top_pd: The parent power domain of usb_psw_pd. Turning it on puts the controller + into power gated state, turning it off completely shuts off the + controller.Same comments.
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 93
Quoted 7 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ items: + - const: usb_psw_pd + - const: usb_top_pd + + iommus: + maxItems: 1 +Best regards,
Krzysztof
Re: [PATCH v2 3/4] dt-bindings: phy: google: Add Google Tensor G5 USB PHY
In reply to Krzysztof KozlowskiQuoted 40 lines · Krzysztof Kozlowski
Quoted 38 lines · Roy Luo
Document the device tree bindings for the USB PHY interfaces integrated with the DWC3 controller on Google Tensor SoCs, starting with G5 generation.
Due to a complete architectural overhaul in the Google Tensor G5, the existing Samsung/Exynos USB PHY driver and binding for older generations of Google silicons such as gs101 are no longer compatible.
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. Currently only USB high-speed is described and supported.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/phy/google,gs-usb-phy.yaml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/google,gs-usb-phy.yamlDocumentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +14
-0@@ -0,0 +1,96 @@ +# 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,gs-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
Quoted 8 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 19
Quoted 5 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +5
-0+ 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 first phandle argument within the PHY specifier is used to identify the + desired PHY. The currently supported value is::Currently supported as hardware will change? You describe here hardware ONLY.
I wanted to explain the PHY specifier as I saw other bindings are also doing it, e.g. "Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml". Theoretically the hardware supports 3 PHY interfaces: high-speed, super-speed and DP, however, the corresponding driver only supports high-speed at the moment.
I can still document all the 3 PHY interfaces and assign them with a theoretical specifier value here as that's what the hardware is capable of, and then make it clear that only high-speed is currently supported on the driver side. Does this make sense to you?
Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +11
-0+ 0 - USB high-speed. + +properties: + compatible: + items: + - enum: + - google,gs5-usb-phy + + reg: + minItems: 3 + maxItems: 3
Quoted 9 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 36
Quoted 6 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +6
-0+ + reg-names: + items: + - const: usb2_cfg_csr + - const: dp_top_csr + - const: usb_top_cfg_csrDrop csr
Ack, will fix it in the next patch.
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +4
-0+ + "#phy-cells": + const: 1 +
Quoted 9 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 46
Quoted 6 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +6
-0+ clocks: + maxItems: 1 + + clock-names: + items: + - const: usb2_phy_clkDrop names, pointless for one entry.
Ack, will fix it in the next patch.
Quoted 10 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 53
Quoted 7 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +7
-0+ + resets: + maxItems: 1 + + reset-names: + items: + - const: usb2_phy_resetDrop names, pointless for one entry.
Ack, will fix it in the next patch.
Quoted 16 lines
Quoted 16 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +16
-0+ + 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 + - clock-names
Quoted 9 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml line 74
Quoted 5 lines
Documentation/devicetree/bindings/phy/google,gs-usb-phy.yaml new file +5
-0+ - resets + - reset-names + +unevaluatedProperties: false +additionalProps instead. Read writing schema or example schema.
Ack, will fix this in the next patch.
Appreciate the review!
Thanks,
Roy Luo
Quoted 3 lines
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Roy LuoQuoted 123 lines · Roy Luo
Quoted 9 lines · Krzysztof Kozlowski
Quoted 4 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
G5 does not have a model number like G1-G4?
There's no model number for G5, I'm sticking to the existing "gs" prefix as they're still in the same SoC family. Please let me know if you have any concerns.
Quoted 6 lines
Quoted 4 lines
previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings and drivers are incompatible,
Do not reference drivers. Explain the hardware.
Ack, all mentions of "driver" will be removed in the next patch.
Quoted 26 lines
Quoted 26 lines
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.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs-dwc3.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0@@ -0,0 +1,145 @@ +# 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,gs-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC ControllerQuoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 13
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +5
-0+ +maintainers: + - Roy Luo <[email protected]> + +description: |Do not need '|' unless you need to preserve formatting.
Ack, will fix this in the next patch.
Quoted 25 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 25
Quoted 13 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ 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: + items: + - enum: + - google,gs5-dwc3 + + reg: + minItems: 3Drop
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 33
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + reg-names: + description: | + The following memory regions must present: + - dwc3_core: Core DWC3 IP registers. + - host_cfg_csr: Hibernation control registers. + - usbint_csr: Hibernation interrupt registers.Quoted 1 line
Drop description or move it to items in reg. See other bindings.
Ack, will use an item list in reg instead.
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 40
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ items: + - const: dwc3_core + - const: host_cfg_csr + - const: usbint_csr + + interrupts: + minItems: 3Drop
Ack, will use an item list instead.
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 48
Quoted 9 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + interrupt-names: + description: | + The following interrupts must present: + - dwc_usb3: Core DWC3 interrupt. + - hs_pme_irq: High speed remote wakeup interrupt for hibernation. + - ss_pme_irq: Super speed remote wakeup interrupt for hibernation.Quoted 2 lines
From where did you get this style? Don't write bindings with chat gpt or whatever other tool. it is a waste of our time.
I referenced the style from a recent dt binding change [1] that adds "
Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml". I thought it would be a good reference because it's relatively new and is also a binding for SNPS dwc3 glue logic. Perhaps that style doesn't apply here because qcom,snps-dwc3.yaml supports multiple compatible and here we have only one?
Quoted 4 lines
Just to clarify, I'm a Gemini user and this patch is 100% organic, hand-crafted by a living human brain :)
Your code is not at all like above, you do not have any variants here, so you cannot use that syntax - is not correct here.
Best regards,
Krzysztof
Re: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Roy LuoQuoted 14 lines · Roy Luo
Quoted 10 lines · Conor Dooley
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 109
Quoted 4 lines · Roy Luo
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +4
-0+allOf: + - $ref: snps,dwc3-common.yaml# + +unevaluatedProperties: falseSo every property from snps,dwc3-common.yaml is valid here, with any of the permitted values?
Conor,
Quoted 8 lines
Appreciate the review.
Ack to all the comments, will fix them in the next patch. And yes, every property from snps,dwc3-common.yaml is valid here. You can find more context here [1], essentially the dwc3 glue would be operating on the same platform device as the dwc3 core, hence all properties are allowed.
I find it exceedingly hard to believe that every property from that file, with every permitted value, is possible. AFAIU, the tensor g5 is a phone chip that's only used in pixel devices, not something that people can just buy and integrate into whatever device they feel like. There should be a vanishingly small number of possible configurations, possibly exactly one configuration. There are dozens of properties in the dwc3 common binding, of which at least 10 are for "quirks" or other sorts of hardware errata that are not going to be variable from one phone to another.
Re: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Krzysztof KozlowskiQuoted 128 lines · Krzysztof Kozlowski
Quoted 126 lines · Roy Luo
Quoted 9 lines · Krzysztof Kozlowski
Quoted 4 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
G5 does not have a model number like G1-G4?
There's no model number for G5, I'm sticking to the existing "gs" prefix as they're still in the same SoC family. Please let me know if you have any concerns.
Quoted 6 lines
Quoted 4 lines
previous generations (like gs101), including entirely new clock/reset schemes, top-level wrapper and register interface. Consequently, existing Samsung/Exynos DWC3 USB bindings and drivers are incompatible,
Do not reference drivers. Explain the hardware.
Ack, all mentions of "driver" will be removed in the next patch.
Quoted 26 lines
Quoted 26 lines
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.
Signed-off-by Roy Luo <[email protected]>--- .../bindings/usb/google,gs-dwc3.yaml | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/google,gs-dwc3.yamlDocumentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0@@ -0,0 +1,145 @@ +# 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,gs-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Tensor Series (G5+) DWC3 USB SoC ControllerQuoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 13
Quoted 5 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +5
-0+ +maintainers: + - Roy Luo <[email protected]> + +description: |Do not need '|' unless you need to preserve formatting.
Ack, will fix this in the next patch.
Quoted 25 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 25
Quoted 13 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +12
-0+ 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: + items: + - enum: + - google,gs5-dwc3 + + reg: + minItems: 3Drop
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 33
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + reg-names: + description: | + The following memory regions must present: + - dwc3_core: Core DWC3 IP registers. + - host_cfg_csr: Hibernation control registers. + - usbint_csr: Hibernation interrupt registers.Quoted 1 line
Drop description or move it to items in reg. See other bindings.
Ack, will use an item list in reg instead.
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 40
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +7
-0+ items: + - const: dwc3_core + - const: host_cfg_csr + - const: usbint_csr + + interrupts: + minItems: 3Drop
Ack, will use an item list instead.
Quoted 10 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 48
Quoted 9 lines
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +8
-0+ maxItems: 3 + + interrupt-names: + description: | + The following interrupts must present: + - dwc_usb3: Core DWC3 interrupt. + - hs_pme_irq: High speed remote wakeup interrupt for hibernation. + - ss_pme_irq: Super speed remote wakeup interrupt for hibernation.Quoted 2 lines
From where did you get this style? Don't write bindings with chat gpt or whatever other tool. it is a waste of our time.
I referenced the style from a recent dt binding change [1] that adds "
Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml". I thought it would be a good reference because it's relatively new and is also a binding for SNPS dwc3 glue logic. Perhaps that style doesn't apply here because qcom,snps-dwc3.yaml supports multiple compatible and here we have only one?Just to clarify, I'm a Gemini user and this patch is 100% organic, hand-crafted by a living human brain :)
Quoted 7 lines
Quoted 1 line
Your code is not at all like above, you do not have any variants here, so you cannot use that syntax - is not correct here.
Best regards,
Krzysztof
Thanks for the clarification.
Regards,
Roy Luo
Re: [PATCH v2 1/4] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3
In reply to Conor DooleyQuoted 25 lines · Conor Dooley
Quoted 14 lines · Roy Luo
Quoted 10 lines · Conor Dooley
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml line 109
Quoted 4 lines · Roy Luo
Documentation/devicetree/bindings/usb/google,gs-dwc3.yaml new file +4
-0+allOf: + - $ref: snps,dwc3-common.yaml# + +unevaluatedProperties: falseSo every property from snps,dwc3-common.yaml is valid here, with any of the permitted values?
Conor,
Quoted 8 lines
Appreciate the review.
Ack to all the comments, will fix them in the next patch. And yes, every property from snps,dwc3-common.yaml is valid here. You can find more context here [1], essentially the dwc3 glue would be operating on the same platform device as the dwc3 core, hence all properties are allowed.
Quoted 9 lines
I find it exceedingly hard to believe that every property from that file, with every permitted value, is possible. AFAIU, the tensor g5 is a phone chip that's only used in pixel devices, not something that people can just buy and integrate into whatever device they feel like. There should be a vanishingly small number of possible configurations, possibly exactly one configuration. There are dozens of properties in the dwc3 common binding, of which at least 10 are for "quirks" or other sorts of hardware errata that are not going to be variable from one phone to another.
To my knowledge, the properties in snps,dwc3-common.yaml can generally be categorized into two types:
- Function knobs: These properties translate directly to register writes that modify the controller's fundamental behavior. Most quirks fall into this category. For example, "snps,gfladj-refclk-lpm-sel-quirk" enables SOF counter.
- Tunable Values: These properties also map to register writes to influence hardware behavior, but they typically adjust performance or interoperability rather than essential function. While the hardware usually works fine with default settings, these values allow for optimization. For example, "tx-fifo-max-num" usually affects data throughput.
For DWC3 hardware errata and workarounds, my understanding is that they are typically handled within the dwc3 driver, often involving a DWC3 revision check (e.g. [1]), instead of in the device tree binding. While you may find properties related to errata, they generally serve to enable or disable an existing workaround (e.g. [2]).
For Pixel devices, it's shipped with a preferred configuration, but the hardware is fundamentally capable of supporting other configurations since the properties are backed by the SNPS DWC3 IP. Whether that's optimal is a different story. I haven't tried toggling every single property but I'm not aware of any property that obviously does not work on Tensor G5.
I hope this addresses your concern.
[1] https://github.com/torvalds/linux/commit/32a4a135847b1e600c64756b7c7c7a91eb2f0aa9
(sorry I'm unable to find the kernel lore link for this commit)
[2] https://lore.kernel.org/all/[email protected]/
Regards,
Roy Luo