usb: host: xhci-tegra: Add Tegra264 XHCI support
Subsystems (4)
v3 cover usb: host: xhci-tegra: Add Tegra264 XHCI support
Add Tegra264 support to the Tegra XUSB host (xhci-tegra) driver and its binding, as part of enabling USB host functions on the Tegra264 Jetson AGX Thor platform.
This series was previously posted as part of a single 8-patch series covering phy, USB host and arm64 DTS changes together [1]. Per review feedback, it has been split by subsystem so each maintainer can pick up only what belongs to their tree:
- usb: host: xhci-tegra + its dt-bindings/usb: this series
- phy: tegra: xusb + its dt-bindings/phy: separate series [2], sent ahead of this one
- arm64: tegra DTS enablement: separate series, to be sent once the binding patches from this series and [2] have landed, since it depends on both
Patch 1/3 (dt-bindings: usb) also addresses Krzysztof's V2 review
comments: the iommus entries are now listed individually, and Tegra264 gets its own allOf conditional pinning interrupts to 10 and iommus to 5, instead of inheriting Tegra234's wider top-level bounds unconstrained.
[1] https://lore.kernel.org/linux-tegra/[email protected]/
[2] https://lore.kernel.org/linux-tegra/[email protected]/
Wayne Chang (3):
dt-bindings: usb: Add Tegra264 XUSB host support
usb: host: xhci-tegra: Skip MBOX MSG_ENABLED on Tegra264
usb: host: xhci-tegra: Add Tegra264 XHCI support
.../bindings/usb/nvidia,tegra234-xusb.yaml | 52 ++++++++++++++++++++--- drivers/usb/host/xhci-tegra.c | 37 ++++++++++++++++ 2 files changed, 84 insertions(+), 5 deletions(-)
base-commit: 940de590b839f71d6dc846160534bf202401b8b7 --
2.25.1
PATCH v3 1/3 dt-bindings: usb: Add Tegra264 XUSB host support
Extend the Tegra234 XUSB host binding to cover Tegra264:
- Add nvidia,tegra264-xusb compatible string
- Document optional USB wake interrupts for Tegra264
- Document Tegra264 PMC wake event to port mapping
- List the up to five IOMMU specifiers for the additional XUSB host stream IDs, since their order is now significant
- Constrain interrupts and iommus counts for both Tegra234 and Tegra264 via allOf conditionals, since each SoC wires up a fixed number of wake interrupts and stream IDs
---
V2 -> V3: List the iommus entries instead of just bounding minItems/ maxItems, and clarify that entries 1-4 correspond to XHCI virtual functions 1-4. Add an allOf conditional that also constrains Tegra264 to interrupts maxItems 10 and iommus minItems 5, instead of leaving Tegra264 with the same flexible top-level bounds as Tegra234.
V1 -> V2: Property definitions are back at the top level with the widest constraints, The allOf conditional only tightens Tegra234 to interrupts maxItems 9 and iommus maxItems 1.
.../bindings/usb/nvidia,tegra234-xusb.yaml | 52 +++++++++++++++++++++--- 1 file changed, 47 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml +47 -5
@@ -17,7 +17,9 @@ description: | properties: compatible: - const: nvidia,tegra234-xusb + enum: + - nvidia,tegra234-xusb + - nvidia,tegra264-xusb reg: items:
@@ -43,6 +45,7 @@ properties: - description: USB wake event 4 - description: USB wake event 5 - description: USB wake event 6 + - description: USB wake event 7 description: | The first two interrupts are required for the USB host controller. The remaining USB wake event interrupts are optional. Each USB wake event is
@@ -50,10 +53,9 @@ properties: platform. The USB host controller can function even if no wake-up events are defined. The USB wake event interrupts are handled by the Tegra PMC; hence, the interrupt controller for these is the PMC and the interrupt - IDs correspond to the PMC wake event IDs. A complete list of wake event - IDs is provided below, and this information is also present in the Tegra - TRM document. + IDs correspond to the PMC wake event IDs. + Tegra234 PMC wake events: PMC wake-up 76 for USB3 port 0 wakeup PMC wake-up 77 for USB3 port 1 wakeup PMC wake-up 78 for USB3 port 2 and port 3 wakeup
@@ -62,6 +64,16 @@ properties: PMC wake-up 81 for USB2 port 2 wakeup PMC wake-up 82 for USB2 port 3 wakeup + Tegra264 PMC wake events: + PMC wake-up 79 for USB3 port 0 wakeup + PMC wake-up 80 for USB3 port 1 wakeup + PMC wake-up 81 for USB3 port 2 wakeup + PMC wake-up 82 for USB3 port 3 wakeup + PMC wake-up 83 for USB2 port 0 wakeup + PMC wake-up 84 for USB2 port 1 wakeup + PMC wake-up 85 for USB2 port 2 wakeup + PMC wake-up 86 for USB2 port 3 wakeup + clocks: items: - description: XUSB host clock
@@ -97,7 +109,13 @@ properties: - const: write iommus: - maxItems: 1 + minItems: 1 + items: + - description: XUSB host stream ID + - description: XUSB host stream ID for virtual function 1 + - description: XUSB host stream ID for virtual function 2 + - description: XUSB host stream ID for virtual function 3 + - description: XUSB host stream ID for virtual function 4 nvidia,xusb-padctl: $ref: /schemas/types.yaml#/definitions/phandle
@@ -137,6 +155,30 @@ properties: allOf: - $ref: usb-xhci.yaml + - if: + properties: + compatible: + contains: + const: nvidia,tegra234-xusb + then: + properties: + interrupts: + maxItems: 9 + iommus: + maxItems: 1 + + - if: + properties: + compatible: + contains: + const: nvidia,tegra264-xusb + then: + properties: + interrupts: + maxItems: 10 + iommus: + minItems: 5 + unevaluatedProperties: false examples:
--
2.25.1
Re: [PATCH V3 1/3] dt-bindings: usb: Add Tegra264 XUSB host support
pw-bot: not-applicable
PATCH v3 2/3 usb: host: xhci-tegra: Skip MBOX MSG_ENABLED on Tegra264
In reply to Wayne ChangTegra264 XUSB does not use the firmware mailbox handshake to enable controller messages (MBOX_CMD_MSG_ENABLED). Add a per-SoC flag and short-circuit __tegra_xusb_enable_firmware_messages() so both probe and resume avoid sending the command.
---
V2 -> V3: No change
V1 -> V2: No change
drivers/usb/host/xhci-tegra.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/usb/host/xhci-tegra.c +9 -0
@@ -250,6 +250,7 @@ struct tegra_xusb_soc {bool otg_set_port_power;bool has_bar2; +bool enable_firmware_messages; };struct tegra_xusb_context {
@@ -1260,6 +1261,9 @@ static int __tegra_xusb_enable_firmware_messages(struct tegra_xusb *tegra)struct tegra_xusb_mbox_msg msg;int err; +if (!tegra->soc->enable_firmware_messages) +return 0 ; +/* Enable firmware messages from controller. */ msg.cmd =MBOX_CMD_MSG_ENABLED ; msg.data =0 ;
@@ -2580,6 +2584,7 @@ static const struct tegra_xusb_soc tegra124_soc = { .owner = 0xf0, .smi_intr = XUSB_CFG_ARU_SMI_INTR, }, + .enable_firmware_messages = true, };#if IS_ENABLED (CONFIG_ARCH_TEGRA_124_SOC ) ||IS_ENABLED (CONFIG_ARCH_TEGRA_132_SOC )MODULE_FIRMWARE ("nvidia/tegra124/xusb.bin" );
@@ -2621,6 +2626,7 @@ static const struct tegra_xusb_soc tegra210_soc = { .owner = 0xf0, .smi_intr = XUSB_CFG_ARU_SMI_INTR, }, + .enable_firmware_messages = true, };#if IS_ENABLED (CONFIG_ARCH_TEGRA_210_SOC )MODULE_FIRMWARE ("nvidia/tegra210/xusb.bin" );
@@ -2670,6 +2676,7 @@ static const struct tegra_xusb_soc tegra186_soc = { .smi_intr = XUSB_CFG_ARU_SMI_INTR, }, .lpm_support = true, + .enable_firmware_messages = true, }; static const char * const tegra194_supply_names[] = {
@@ -2704,6 +2711,7 @@ static const struct tegra_xusb_soc tegra194_soc = { .smi_intr = XUSB_CFG_ARU_SMI_INTR, }, .lpm_support = true, + .enable_firmware_messages = true, };#if IS_ENABLED (CONFIG_ARCH_TEGRA_194_SOC )MODULE_FIRMWARE ("nvidia/tegra194/xusb.bin" );
@@ -2741,6 +2749,7 @@ static const struct tegra_xusb_soc tegra234_soc = { }, .lpm_support = true, .has_bar2 = true, + .enable_firmware_messages = true, };static const struct of_device_id tegra_xusb_of_match[] = {
Signature · 1 line
2.25.1
PATCH v3 3/3 usb: host: xhci-tegra: Add Tegra264 XHCI support
In reply to Wayne ChangThis change adds Tegra264 XUSB host mode controller support. The host controller is very similar to the existing Tegra234 XHCI, except the number of max_num_wakes.
---
V2 -> V3: No change
V1 -> V2: No change
drivers/usb/host/xhci-tegra.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/usb/host/xhci-tegra.c +28 -0
@@ -2752,12 +2752,40 @@ static const struct tegra_xusb_soc tegra234_soc = { .enable_firmware_messages = true, }; +static const struct tegra_xusb_soc tegra264_soc = { + .supply_names = tegra194_supply_names, + .num_supplies =ARRAY_SIZE (tegra194_supply_names), + .phy_types = tegra194_phy_types, + .num_types =ARRAY_SIZE (tegra194_phy_types), + .max_num_wakes =8 , + .context = &tegra186_xusb_context, + .ports = { + .usb3 = { .offset =0 , .count =4 , }, + .usb2 = { .offset =4 , .count =4 , }, + }, + .scale_ss_clock = false, + .has_ipfs = false, + .otg_reset_sspi = false, + .ops = &tegra234_ops, + .mbox = { + .cmd =XUSB_BAR2_ARU_MBOX_CMD , + .data_in =XUSB_BAR2_ARU_MBOX_DATA_IN , + .data_out =XUSB_BAR2_ARU_MBOX_DATA_OUT , + .owner =XUSB_BAR2_ARU_MBOX_OWNER , + .smi_intr =XUSB_BAR2_ARU_SMI_INTR , + }, + .lpm_support = true, + .has_bar2 = true, + .enable_firmware_messages = false, +}; +static const struct of_device_id tegra_xusb_of_match[] = { { .compatible ="nvidia,tegra124-xusb" , .data = &tegra124_soc }, { .compatible ="nvidia,tegra210-xusb" , .data = &tegra210_soc }, { .compatible ="nvidia,tegra186-xusb" , .data = &tegra186_soc }, { .compatible ="nvidia,tegra194-xusb" , .data = &tegra194_soc }, { .compatible ="nvidia,tegra234-xusb" , .data = &tegra234_soc }, + { .compatible ="nvidia,tegra264-xusb" , .data = &tegra264_soc }, { }, };MODULE_DEVICE_TABLE (of, tegra_xusb_of_match);
Signature · 1 line
2.25.1
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Undocumented behavioral change: `.enable_firmware_messages` is disabled for Tegra264…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Undocumented behavioral change: .enable_firmware_messages is disabled for Tegra264, contradicting the commit message. --
commit 9801b6744662599081fdad0fae6db596ecae9f70
Author: Wayne Chang <[email protected]>
usb: host: xhci-tegra: Add Tegra264 XHCI support
This commit adds Tegra264 XUSB host mode controller support. The new host controller is described as being identical to the existing Tegra234 XHCI with the exception of the max_num_wakes value.
Quoted 4 lines
drivers/usb/host/xhci-tegra.c +0
-0
[ ... ]
Quoted 5 lines
drivers/usb/host/xhci-tegra.c +1
-0@@ -2753,12 +2753,40 @@ static const struct tegra_xusb_soc tegra234_soc = { .enable_firmware_messages = true, }; +static const struct tegra_xusb_soc tegra264_soc = {
[ ... ]
drivers/usb/host/xhci-tegra.c static const struct tegra_xusb_soc tegra234_soc = { · line 2779
Quoted 3 lines
drivers/usb/host/xhci-tegra.c +3
-0+ .lpm_support = true, + .has_bar2 = true, + .enable_firmware_messages = false,
[Severity: Medium]
The commit message states that the Tegra264 host controller is very similar to the existing Tegra234 XHCI, except for the number of max_num_wakes. However, this structure explicitly disables firmware messages for tegra264_soc, whereas it is enabled for tegra234_soc.
Is this undocumented change intentional? If so, could the commit message be updated to reflect that firmware messages are also disabled for Tegra264?
Quoted 1 line
+};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Quoted 24 lines · Wayne Chang
Add Tegra264 support to the Tegra XUSB host (xhci-tegra) driver and its binding, as part of enabling USB host functions on the Tegra264 Jetson AGX Thor platform.
This series was previously posted as part of a single 8-patch series covering phy, USB host and arm64 DTS changes together [1]. Per review feedback, it has been split by subsystem so each maintainer can pick up only what belongs to their tree:
- usb: host: xhci-tegra + its dt-bindings/usb: this series
- phy: tegra: xusb + its dt-bindings/phy: separate series [2], sent ahead of this one
- arm64: tegra DTS enablement: separate series, to be sent once the binding patches from this series and [2] have landed, since it depends on bothPatch 1/3 (dt-bindings: usb) also addresses Krzysztof's V2 review
comments: the iommus entries are now listed individually, and Tegra264 gets its own allOf conditional pinning interrupts to 10 and iommus to 5, instead of inheriting Tegra234's wider top-level bounds unconstrained.[1] https://lore.kernel.org/linux-tegra/[email protected]/
[2] https://lore.kernel.org/linux-tegra/[email protected]/
Quoted 8 lines
Wayne Chang (3):
dt-bindings: usb: Add Tegra264 XUSB host support
usb: host: xhci-tegra: Skip MBOXMSG_ENABLEDon Tegra264
usb: host: xhci-tegra: Add Tegra264 XHCI support.../bindings/usb/nvidia,tegra234-xusb.yaml | 52 ++++++++++++++++++++--- drivers/usb/host/xhci-tegra.c | 37 ++++++++++++++++ 2 files changed, 84 insertions(+), 5 deletions(-)
For the series ...
Thanks!
Jon
Signature · 1 line
nvpublic
Jon Hunter
maintainerHi Greg, Mathias,
Quoted 31 lines · Jon Hunter
Quoted 29 lines · Wayne Chang
Add Tegra264 support to the Tegra XUSB host (xhci-tegra) driver and its binding, as part of enabling USB host functions on the Tegra264 Jetson AGX Thor platform.
This series was previously posted as part of a single 8-patch series covering phy, USB host and arm64 DTS changes together [1]. Per review feedback, it has been split by subsystem so each maintainer can pick up only what belongs to their tree:
- usb: host: xhci-tegra + its dt-bindings/usb: this series
- phy: tegra: xusb + its dt-bindings/phy: separate series [2], sent ahead of this one
- arm64: tegra DTS enablement: separate series, to be sent once the binding patches from this series and [2] have landed, since it depends on bothPatch 1/3 (dt-bindings: usb) also addresses Krzysztof's V2 review
comments: the iommus entries are now listed individually, and Tegra264 gets its own allOf conditional pinning interrupts to 10 and iommus to 5, instead of inheriting Tegra234's wider top-level bounds unconstrained.[1] https://lore.kernel.org/linux-tegra/[email protected]/
[2] https://lore.kernel.org/linux-tegra/[email protected]/Wayne Chang (3):
dt-bindings: usb: Add Tegra264 XUSB host support
usb: host: xhci-tegra: Skip MBOXMSG_ENABLEDon Tegra264
usb: host: xhci-tegra: Add Tegra264 XHCI support
Quoted 8 lines
Quoted 3 lines
.../bindings/usb/nvidia,tegra234-xusb.yaml | 52 ++++++++++++++++++++--- drivers/usb/host/xhci-tegra.c | 37 ++++++++++++++++
2 files changed, 84 insertions(+), 5 deletions(-)For the series ...
Reviewed-by Jon Hunter <[email protected]>Tested-by Jon Hunter <[email protected]>
Let me know if you are OK with these changes or if you have any comments.
Thanks
Jon
Signature · 1 line
nvpublic