[RFC DNM PATCH 00/15] Qualcomm USB4 host router
From: Konrad Dybcio
Date: Tue Nov 24 2026 - 15:02:20 EST
This is an early RFC, mostly looking for acks/naks regarding the
bespoke power state machine and Type-C handling in qcom.c. This version
of the driver can power up the hardware, have it suspend/resume, but
notably not drive any tunnels (as that depends on dozens of patches to
other subsystems, many with shaky dependencies on the still-forming
usb4 dt-bindings [1]). Absolutely not intended for merging (unless you
want to take some of the intermediate tbt patches, Mika).
Speaking of dt-bindings, this posting comes with none, as it makes no
sense to waste maintainer time until that GitHub discussion is settled.
Said state machine is an attempt to tame the delicate clock setup,
which if we don't get perfectly right results in the machine hard-
crashing. More on that in the big comment at the top of the driver.
The Qualcomm USB4 host router is an in-house design, implementing a
standard NHI front-end with a lot of vendor glue. Because the USB, PCIe
and DP blocks live outside the subsystem (and are wholly disjoint), a
lot of elbow grease it required to have it all behave (similarly to the
Apple implementation, but with more manual clock control and firmware
handshakes). Native protocol controllers can only resume after the
router has re-enabled the links (which collides with today's notion of
nhi_resume re-enabling the tunnels), so that requires some
consideration (again, not included in this posting).
USB3 tunneling requires:
* a bit in TCSR (tldr a syscon) to be toggled and the path to be
enabled
* a register set in DWC3 to work around an issue with the USB3 adapter
This is a fairly low-hanging fruit, but still depends on the bindings
to get the device link changes in within the USB subsystem.
PCIe tunneling requires:
* a reset in the USB4 address space to be asserted
* a number of additional settings on the RC side
* standard PCIe hotplug otherwise works as expected
The link itself works without much effort. How we set up devlinks and
whether we can go forward with or dispose of the router's power state
machine will shape the suspend/resume handling there though.
DP tunneling requires:
* handling a secondary mailbox within the USB4 subsystem (not
included)
* setting up the display crossbar/mux correctly (any of each routers'
DP adapters can be muxed to any of the available DPTXes)
* settings a couple registers in the DPTX
* driving a secondary AUX bus from within USB4SS (the AUX controller
in the DPTX is blissfully unaware about the existence of USB4, so
the OS has to ping-pong between them at runtime..)
* HPD management
Because of the muxing and runtime AUX switching, this requires
sizeable DRM changes, including Luca Ceresoli's work on bridge hotplug.
Additionally, the hardware is constructed such that the protocol
adapters need some of the native controllers' clocks and power domains
to be online, hence the odd DT references.
The uC doesn't implement a CM, it instead does some housekeeping
functions, but because it doesn't have a view directly into the SoC's
register space, it still requires a lot of OS coordination. It does
however take care of link establishment and some of the TBT-layer
chores (such as sending PERST# packets to PCIe adapters). It requires
loadable firmware which will be posted to linux-firmware soon.
This series runs as-is on a Glymur CRD board, minding its limited
usefulness given all of the above.
I know this series is not the entire feature set and that this was
promised quite some time ago now, but as I was humbled to learn,
sending 80G over a wire is no easy feat. I'm looking forward to
removing the remaining roadblocks and hopefully getting there in the
upcoming year. Please chime into the bindings discussion on GitHub if
you want to help there.
Dependencies:
* https://lore.kernel.org/linux-arm-msm/20260409-topic-phy_fastclk-v1-1-6b4aaee56b90@xxxxxxxxxxxxxxxx/
* https://lore.kernel.org/linux-arm-msm/20260928-topic-usb4phy-v6-1-815a73b063ef@xxxxxxxxxxxxxxxx/
* https://lore.kernel.org/linux-arm-msm/20261123-topic-usb4_clks-v1-0-531ab5635c03@xxxxxxxxxxxxxxxx/
* https://lore.kernel.org/linux-arm-msm/20261117-topic-pga_nousb4_glymur-v1-1-0ede74e620d0@xxxxxxxxxxxxxxxx/
The base commit (contrary to what b4 says, because of said
dependencies) is next-20261116.
[1] https://github.com/devicetree-org/dt-schema/pull/196
Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
---
Konrad Dybcio (13):
phy: qualcomm: qmp-combo: Add USB4 power_on/off to de/assert USB4 clamps
soc: qcom: smem: Add and export qcom_smem_get_serial_no()
clk: qcom: gcc-glymur: Don't poll the status bit of some USB4 clocks
thunderbolt: nhi: Clear ring interrupts when not using MSI-X
thunderbolt: nhi: Process ring completions in the threaded IRQ
thunderbolt: nhi: Add pre_switch_suspend hook
thunderbolt: nhi: Resume the domain if the NHI suspend op fails
thunderbolt: nhi: Resume a runtime suspended NHI for system suspend
thunderbolt: Raise TB_TIMEOUT to 500 ms
[HACK] thunderbolt: Refuse to activate DP/USB3/PCIe tunnels
thunderbolt: Introduce Qualcomm USB4 router driver
arm64: dts: qcom: glymur: Add USB4 topology
arm64: dts: qcom: glymur-crd: Enable the tertiary Type-C
Wesley Cheng (2):
phy: qualcomm: qmp-combo: Add Glymur USB4v1 PHY sequences
soc: qcom: pmic_glink_altmode: Enable TBT/USB4 negotiation
arch/arm64/boot/dts/qcom/glymur-crd.dtsi | 107 +-
arch/arm64/boot/dts/qcom/glymur.dtsi | 703 ++++++-
drivers/clk/qcom/gcc-glymur.c | 12 +-
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 321 ++-
drivers/phy/qualcomm/phy-qcom-qmp-dp-com-v3.h | 1 +
drivers/phy/qualcomm/phy-qcom-qmp-usb43-pcs-v8.h | 22 +
drivers/soc/qcom/pmic_glink_altmode.c | 5 +-
drivers/soc/qcom/smem.c | 22 +
drivers/thunderbolt/Kconfig | 13 +
drivers/thunderbolt/Makefile | 3 +
drivers/thunderbolt/eeprom.c | 17 -
drivers/thunderbolt/nhi.c | 168 +-
drivers/thunderbolt/nhi.h | 4 +-
drivers/thunderbolt/pci.c | 15 +-
drivers/thunderbolt/qcom.c | 2299 ++++++++++++++++++++++
drivers/thunderbolt/qcom.h | 251 +++
drivers/thunderbolt/switch.c | 4 +
drivers/thunderbolt/tb.c | 2 +-
drivers/thunderbolt/tb.h | 20 +
drivers/thunderbolt/tb_regs.h | 3 +
drivers/thunderbolt/tunnel.c | 2 +
include/linux/soc/qcom/smem.h | 1 +
include/linux/thunderbolt.h | 8 +-
23 files changed, 3914 insertions(+), 89 deletions(-)
---
base-commit: 516d5c8f674bc07eb35c3b97fc21e79e41158dee
change-id: 20261124-topic-next-20261116-fsm-mvp-b936003bd2f2
Best regards,
--
Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>