Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Tanure <tanure@linux.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Vinod Koul <vkoul@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/9] Add USB support for the Amlogic T7
Date: Sun, 29 Nov 2026 09:28:01 +0000	[thread overview]
Message-ID: <20261129092810.146043-1-tanure@linux.com> (raw)

The Amlogic T7 (A311D2) has the G12A USB 2 PHY, the G12A USB3 + PCIe
combo PHY, and two Corigine dual-role USB controllers. In the host role
each controller is a plain xHCI. This series adds the host role for both
controllers, both USB 2 PHYs and the USB 3 lane of the combo PHY, and
enables the three USB ports of the Khadas VIM4.

Patches by tree:
 - phy: 1, 2 (USB 2 PHY), 7, 8 (USB3 + PCIe combo PHY)
 - usb: 3, 4 (controller binding, xhci-plat)
 - amlogic: 5, 6, 9 (device tree)

The series is based on next-20261127. Patches 1 and 2 build on the S4
support in the phy tree ("phy: amlogic: meson-g12a-usb2: add S4
support"); the T7 PHY is close to the S4 one. Patch 6 only has context
from the VIM4 thermal changes in the amlogic tree.

Notes for review:
 - Each USB 2 port has a small block of control registers (power-on
   reset, host mode, PHY ready) at 0xfe03a000 + 0x20 * port. The vendor
   driver handles them in its PHY driver, and so does this series: they
   are the second register range of each USB 2 PHY node. The USB 3
   registers of the same block (0xfe03a080) are the second range of the
   combo PHY node. No range is shared between nodes.
 - The controllers can also be USB devices. Mainline has no driver for
   the Corigine device controller, so only the host role is supported.
   The binding already includes usb-drd.yaml and the board sets
   dr_mode = "host", so device mode can be added later without changing
   existing device trees.
 - The controllers report 64-bit addressing but use only the lower 32
   bits (patch 4, XHCI_NO_64BIT_SUPPORT, as on R-Car).
 - A warm reboot left the USB 2 PHY stuck; a reset pulse does not clear
   it, holding the reset does (patch 2). The combo PHY gets the same
   treatment (patch 8).
 - Patch 8 sets bits 18:17 of combo PHY register 0x18 to 2, as the
   vendor driver does. Neither the vendor code nor the datasheet names
   this field.

Tested on the Khadas VIM4, on next-20261127 after warm reboots, and
with the same patches on v7.4-rc4 also after a cold boot:
 - USB 3.0 socket: SuperSpeed, 101-110 MB/s read from a USB 3 flash drive
 - USB 2.0 socket (on-board hub): 44 MB/s read with the same drive
 - USB-C port, host role through a powered hub: flash drive (41 MB/s),
   network adapter (287/343 Mbit/s with iperf3), card reader
 - hot plug; no errors in the log

next-20261127 does not boot on the T7 as is: since 8954a462e433
("firmware: arm: scmi: Add centralized detection of truncated
replies") every SCMI clock fails, because the T7 firmware answers
CLOCK_ATTRIBUTES with 20 bytes instead of 24, and the SD and eMMC
hosts then fail to probe. The tests above ran with that check reduced
to a warning. This is unrelated to the series; reported here:
https://lore.kernel.org/arm-scmi/CAJX_Q+21a1UVE1CCXEGQc4-pdgu_fu32ohxspg5h=Sw7zPdKdQ@mail.gmail.com/

Lucas Tanure (9):
  dt-bindings: phy: amlogic,g12a-usb2-phy: add the T7 compatible
  phy: amlogic: phy-meson-g12a-usb2: add T7 support
  dt-bindings: usb: add the Amlogic T7 USB controller
  usb: host: xhci-plat: add Amlogic T7 support
  arm64: dts: amlogic: t7: add the USB controllers
  arm64: dts: amlogic: khadas-vim4: enable the USB ports
  dt-bindings: phy: amlogic,g12a-usb3-pcie-phy: add the T7 compatible
  phy: amlogic: phy-meson-g12a-usb3-pcie: add T7 support
  arm64: dts: amlogic: t7: add the USB3 PHY

 .../bindings/phy/amlogic,g12a-usb2-phy.yaml   |  53 ++++++---
 .../phy/amlogic,g12a-usb3-pcie-phy.yaml       |  46 +++++++-
 .../bindings/usb/amlogic,t7-usb.yaml          |  78 +++++++++++++
 .../amlogic/amlogic-t7-a311d2-khadas-vim4.dts |  14 +++
 arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi   |  63 ++++++++++
 drivers/phy/amlogic/phy-meson-g12a-usb2.c     |  95 +++++++++++++--
 .../phy/amlogic/phy-meson-g12a-usb3-pcie.c    | 108 +++++++++++++++++-
 drivers/usb/host/xhci-plat.c                  |   7 ++
 8 files changed, 432 insertions(+), 32 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/amlogic,t7-usb.yaml


base-commit: e5aad2bdbbee783611d32599f89cea3f12f9593d
-- 
2.56.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

             reply	other threads:[~2026-11-29  9:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  9:28 Lucas Tanure [this message]
2026-11-29  9:28 ` [PATCH 1/9] dt-bindings: phy: amlogic,g12a-usb2-phy: add the T7 compatible Lucas Tanure
2026-11-29  9:28 ` [PATCH 2/9] phy: amlogic: phy-meson-g12a-usb2: add T7 support Lucas Tanure
2026-11-29  9:28 ` [PATCH 3/9] dt-bindings: usb: add the Amlogic T7 USB controller Lucas Tanure
2026-11-29  9:32   ` sashiko-bot
2026-11-29  9:28 ` [PATCH 4/9] usb: host: xhci-plat: add Amlogic T7 support Lucas Tanure
2026-11-29  9:28 ` [PATCH 5/9] arm64: dts: amlogic: t7: add the USB controllers Lucas Tanure
2026-11-29  9:28 ` [PATCH 6/9] arm64: dts: amlogic: khadas-vim4: enable the USB ports Lucas Tanure
2026-11-29  9:28 ` [PATCH 7/9] dt-bindings: phy: amlogic,g12a-usb3-pcie-phy: add the T7 compatible Lucas Tanure
2026-11-29  9:28 ` [PATCH 8/9] phy: amlogic: phy-meson-g12a-usb3-pcie: add T7 support Lucas Tanure
2026-11-29  9:28 ` [PATCH 9/9] arm64: dts: amlogic: t7: add the USB3 PHY Lucas Tanure

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261129092810.146043-1-tanure@linux.com \
    --to=tanure@linux.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mathias.nyman@intel.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox