linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] arm64: qcom: QCM2290: add the Embedded USB Debugger
@ 2026-11-14 15:39 Igor Opaniuk
  2026-11-14 15:39 ` [PATCH 1/4] dt-bindings: soc: qcom: eud: add the QCM2290 EUD Igor Opaniuk
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Igor Opaniuk @ 2026-11-14 15:39 UTC (permalink / raw)
  To: Souradeep Chowdhury, Bjorn Andersson, Konrad Dybcio, Abel Vesa,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Greg Kroah-Hartman
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-usb, Elson Serrao,
	Igor Opaniuk

The Embedded USB Debugger of the QCM2290 is the block the SC7280 has,
with one difference: its mode manager ignores the enable (EUD_EN2)
unless the TCSR register TCSR_APSS_SPARE_REG1 is set first. XBL_SEC,
the secure part of the boot loader, does exactly that when it enables
the EUD itself: it sets TCSR_APSS_SPARE_REG1, then EUD_EN2.

Patch 1 adds the compatible and describes that register as a third
reg entry, patch 2 has qcom_eud write it through the secure IO call
like EUD_EN2, patch 3 adds the EUD to agatti.dtsi and patch 4 enables
it on the Arduino UNO Q.

Why Linux sets the bit and not the firmware:
- XBL_SEC runs that sequence only when the device's debug policy (an
  optional signed image that enables JTAG) asks for it. Without one,
  as on the Arduino UNO Q, the board boots with both registers clear.
- The stock TEE (QTEE) does not set the bit either. It allow-lists
  TCSR_APSS_SPARE_REG1 for the HLOS secure IO calls next to EUD_EN2,
  with the same policy (write allowed when secure boot is off or
  debug is not disabled), i.e. it expects the OS to set it before
  EUD_EN2.
- TF-A does the same on Agatti [1][2]: TCSR_APSS_SPARE_REG1 is open to
  the normal world in all builds ("this register only permits EUD to
  be enabled"), EUD_EN2 in debug builds only.
So with either TEE only the driver can complete the sequence, while
the secure firmware keeps deciding whether the EUD may be enabled at
all. Where EUD_EN2 is refused, enabling fails with -EINVAL as before.

Tested on the Arduino UNO Q (QRB2210) with next-20261112 plus the board
support it needs. The A/B runs use the same kernel, with and without
the third reg in the EUD node; without it the driver only writes
EUD_EN2, as today:
- TF-A, built to allow EUD_EN2: with the TCSR write the host enumerates
  the EUD hub (05c6:9500) and its control function (05c6:9501) in each
  of three enable/disable cycles; without it the writes are accepted
  and the enable reports success, but nothing enumerates in three
  cycles.
- Stock QTEE + Gunyah (secure boot off): with the TCSR write the first
  enable after a fresh boot attaches (two boots); without it nothing
  attaches (two boots). Reading both registers back through the secure
  IO call shows them taking every write. The USB controller node was
  disabled in this setup (Linux cannot program the SMMU under Gunyah
  with this DT), and there only the first enable per boot attached;
  re-enabling after a disable was not looked into further.
- OpenOCD's EUD adapter attached over SWD on the TF-A setup (earlier
  build, same enable sequence). Not tested: RB1.

dt_binding_check, dtbs_check (qrb2210-arduino-imola, qrb2210-rb1) and
W=1 are clean. Elson Serrao's pending EUD rework touches the same
binding and driver; this series does not depend on it, whichever lands
second needs a small rebase.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/55733
[2] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/55964

---
Igor Opaniuk (4):
      dt-bindings: soc: qcom: eud: add the QCM2290 EUD
      usb: misc: qcom_eud: set the TCSR check register before enabling on QCM2290
      arm64: dts: qcom: agatti: add the Embedded USB Debugger
      arm64: dts: qcom: qrb2210-arduino-imola: enable the EUD

 .../devicetree/bindings/soc/qcom/qcom,eud.yaml     | 19 +++++++++++++
 arch/arm64/boot/dts/qcom/agatti.dtsi               | 33 +++++++++++++++++++++-
 arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts |  4 +++
 drivers/usb/misc/qcom_eud.c                        | 19 +++++++++++++
 4 files changed, 74 insertions(+), 1 deletion(-)
---
base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48
change-id: 20261114-qcm2290-eud-81e10f3a8e5f

Best regards,
-- 
Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>


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

end of thread, other threads:[~2026-11-14 15:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 15:39 [PATCH 0/4] arm64: qcom: QCM2290: add the Embedded USB Debugger Igor Opaniuk
2026-11-14 15:39 ` [PATCH 1/4] dt-bindings: soc: qcom: eud: add the QCM2290 EUD Igor Opaniuk
2026-11-14 15:49   ` sashiko-bot
2026-11-14 15:39 ` [PATCH 2/4] usb: misc: qcom_eud: set the TCSR check register before enabling on QCM2290 Igor Opaniuk
2026-11-14 15:49   ` sashiko-bot
2026-11-14 15:39 ` [PATCH 3/4] arm64: dts: qcom: agatti: add the Embedded USB Debugger Igor Opaniuk
2026-11-14 15:49   ` sashiko-bot
2026-11-14 15:39 ` [PATCH 4/4] arm64: dts: qcom: qrb2210-arduino-imola: enable the EUD Igor Opaniuk
2026-11-14 15:46   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).