Linux USB
 help / color / mirror / Atom feed
* [PATCH v2 0/2] usb: ehci-pci: Intel CE5300 TDI EHCI support
@ 2026-10-27 23:38 Joseph Telaak via B4 Relay
  2026-10-27 23:38 ` [PATCH v2 1/2] usb: ehci-pci: Skip SBRN and port-wake reads on Intel CE5300 Joseph Telaak via B4 Relay
  2026-10-27 23:38 ` [PATCH v2 2/2] usb: ehci-pci: Set has_hostpc for TDI EHCI " Joseph Telaak via B4 Relay
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-10-27 23:38 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Joseph Telaak

The TDI EHCI core in the Intel CE5300 SoCs needs two quirks: its PCI
config space has no EHCI registers at 0x60 (patch 1), and host mode
lives in USBMODE_EX rather than USBMODE (patch 2). Without them no
device is ever detected, and the controller is not stopped on
shutdown.

CONFIG_USB_EHCI_ROOT_HUB_TT=y is still required, as for any TDI
core. These are device quirks rather than regression fixes, so there
are no Fixes: tags; they may be suitable for stable if you think so.

Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
Changes in v2:
- 1/2: new; skip the SBRN and port-wake reads at PCI config
  0x60-0x62, which this core doesn't have. A zero SBRN made
  ehci_shutdown() a no-op. Adds the is_intel_ce_tdi() helper used
  by 2/2.
- 2/2: tdi_in_host_mode() reads host mode back from USBMODE_EX on
  this core (new has_usbmode_ex flag); in v1 ehci_halt() returned
  without stopping the controller. Reported by the Sashiko AI review.
- Dropped CE2600 from the subjects: only the CE5300 was tested.
- Link to v1: https://patch.msgid.link/20261015-ehci-ce5300-hostpc-v1-1-3cae67c11946@telaak.dev

---
Joseph Telaak (2):
      usb: ehci-pci: Skip SBRN and port-wake reads on Intel CE5300
      usb: ehci-pci: Set has_hostpc for TDI EHCI on Intel CE5300

 drivers/usb/host/ehci-hcd.c |  5 +++++
 drivers/usb/host/ehci-pci.c | 22 +++++++++++++++++++++-
 drivers/usb/host/ehci.h     |  1 +
 3 files changed, 27 insertions(+), 1 deletion(-)
---
base-commit: bbf6b99a57b2479bf51c3c8ad0946f4b8c33ed69
change-id: 20261015-ehci-ce5300-hostpc-8722cf06fc88

Best regards,
--  
Joseph Telaak <joseph@telaak.dev>



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

* [PATCH v2 1/2] usb: ehci-pci: Skip SBRN and port-wake reads on Intel CE5300
  2026-10-27 23:38 [PATCH v2 0/2] usb: ehci-pci: Intel CE5300 TDI EHCI support Joseph Telaak via B4 Relay
@ 2026-10-27 23:38 ` Joseph Telaak via B4 Relay
  2026-10-27 23:41   ` sashiko-bot
  2026-10-27 23:38 ` [PATCH v2 2/2] usb: ehci-pci: Set has_hostpc for TDI EHCI " Joseph Telaak via B4 Relay
  1 sibling, 1 reply; 5+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-10-27 23:38 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Joseph Telaak

From: Joseph Telaak <joseph@telaak.dev>

The TDI EHCI core in the Intel CE5300 SoCs (192e:0101, revision >= 6)
has no EHCI-specific PCI config registers at 0x60: those bytes shadow
BAR3. ehci_pci_setup() reads two of them anyway.

SBRN (0x60) reads as 0 and overwrites the HCD_USB2 default, so the
controller reports "USB 0.0 started" and ehci_shutdown() returns
early because sbrn is 0, so the controller is never stopped on reboot
or kexec. The port-wake word (0x62) is whatever BAR3 holds, so on
some instances bit 0 is set and the driver prints "Enabling legacy
PCI PM" and marks the controller wakeup-capable.

Skip both reads for this core, as is already done for SBRN on the ST
ConneXT and HiSilicon Kunpeng920 controllers. The new helper is also
used by the next patch.

Tested on a Control4 EA-3 (Intel Atom CE5310) with v7.3-rc6: the
controllers report "USB 2.0 started" and the legacy PCI PM message is
gone.

Assisted-by: LLM
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
 drivers/usb/host/ehci-pci.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index bd3a635555..3c7430a06e 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -31,6 +31,14 @@ static inline bool is_intel_quark_x1000(struct pci_dev *pdev)
 		pdev->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC;
 }
 
+/* The TDI EHCI core in the Intel CE5300 SoCs */
+static inline bool is_intel_ce_tdi(struct pci_dev *pdev)
+{
+	return pdev->vendor == PCI_VENDOR_ID_TDI &&
+		pdev->device == PCI_DEVICE_ID_TDI_EHCI &&
+		pdev->revision >= 0x6;
+}
+
 /*
  * This is the list of PCI IDs for the devices that have EHCI USB class and
  * specific drivers for that. One of the example is a ChipIdea device installed
@@ -312,6 +320,8 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 	else if (pdev->vendor == PCI_VENDOR_ID_HUAWEI
 			 && pdev->device == 0xa239)
 		;	/* HUAWEI Kunpeng920 USB EHCI has no sbrn register */
+	else if (is_intel_ce_tdi(pdev))
+		;	/* no EHCI registers at 0x60; those bytes shadow a BAR */
 	else
 		pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
 
@@ -320,7 +330,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 	 * can be removed on 17 Dec 2009 if the dev_warn() hasn't
 	 * been triggered by then.
 	 */
-	if (!device_can_wakeup(&pdev->dev)) {
+	if (!device_can_wakeup(&pdev->dev) && !is_intel_ce_tdi(pdev)) {
 		u16	port_wake;
 
 		pci_read_config_word(pdev, 0x62, &port_wake);

-- 
Git-155)



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

* [PATCH v2 2/2] usb: ehci-pci: Set has_hostpc for TDI EHCI on Intel CE5300
  2026-10-27 23:38 [PATCH v2 0/2] usb: ehci-pci: Intel CE5300 TDI EHCI support Joseph Telaak via B4 Relay
  2026-10-27 23:38 ` [PATCH v2 1/2] usb: ehci-pci: Skip SBRN and port-wake reads on Intel CE5300 Joseph Telaak via B4 Relay
@ 2026-10-27 23:38 ` Joseph Telaak via B4 Relay
  2026-10-27 23:44   ` sashiko-bot
  1 sibling, 1 reply; 5+ messages in thread
From: Joseph Telaak via B4 Relay @ 2026-10-27 23:38 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Joseph Telaak

From: Joseph Telaak <joseph@telaak.dev>

The TransDimension EHCI core in the Intel CE5300 SoCs (192e:0101,
revision >= 6) has the Moorestown-style register extensions: host
mode is selected in USBMODE_EX rather than USBMODE, and the port speed
is reported in HOSTPC.

Without has_hostpc, ehci_reset() never programs USBMODE_EX, so the
core stays in idle mode: USBMODE_EX reads back 0, USBCMD.RS never
sets and no device is ever reported as connected, even though the
probe itself succeeds. With it, USBMODE_EX reads back 0x23 and
devices enumerate.

USBMODE itself always reads back 0 on this core, so
tdi_in_host_mode() would report a running controller as not in host
mode and ehci_halt() would return without stopping it. Add
has_usbmode_ex so that, for this core only, tdi_in_host_mode() reads
host mode back from USBMODE_EX. ChipIdea also sets has_hostpc but
keeps host mode in USBMODE, so it is unaffected.

Intel's CE5300 BSP sets has_hostpc for device 0x0101, revision >= 6.

Tested on a Control4 EA-3 (Intel Atom CE5310) with v7.3-rc6: a
full-speed CP2104 USB-UART bridge (10c4:ea60) and a high-speed USB
flash drive (0781:5575) enumerate with this change, and
ehci_shutdown() leaves the controller halted (USBCMD.RS clear,
USBSTS.HCHalted set); without the USBMODE_EX check it stays running.

Assisted-by: LLM
Signed-off-by: Joseph Telaak <joseph@telaak.dev>
---
 drivers/usb/host/ehci-hcd.c |  5 +++++
 drivers/usb/host/ehci-pci.c | 10 ++++++++++
 drivers/usb/host/ehci.h     |  1 +
 3 files changed, 16 insertions(+)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 75f780ec3b..fd7b47c0f0 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -170,6 +170,11 @@ static int tdi_in_host_mode (struct ehci_hcd *ehci)
 {
 	u32		tmp;
 
+	if (ehci->has_usbmode_ex) {
+		tmp = ehci_readl(ehci, &ehci->regs->usbmode_ex);
+		return (tmp & USBMODE_EX_HC) == USBMODE_EX_HC;
+	}
+
 	tmp = ehci_readl(ehci, &ehci->regs->usbmode);
 	return (tmp & 3) == USBMODE_CM_HC;
 }
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 3c7430a06e..183002ed7d 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -155,6 +155,16 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 	case PCI_VENDOR_ID_TDI:
 		if (pdev->device == PCI_DEVICE_ID_TDI_EHCI)
 			hcd->has_tt = 1;
+		/*
+		 * The Intel CE5300 core selects host mode in USBMODE_EX and
+		 * reports port speed in HOSTPC, as on Moorestown. USBMODE
+		 * reads as 0 on it, so host mode is read back from
+		 * USBMODE_EX too.
+		 */
+		if (is_intel_ce_tdi(pdev)) {
+			ehci->has_hostpc = 1;
+			ehci->has_usbmode_ex = 1;
+		}
 		break;
 	case PCI_VENDOR_ID_AMD:
 		/* AMD PLL quirk */
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 855a9d08b0..e26e913ad5 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -248,6 +248,7 @@ struct ehci_hcd {			/* one per controller */
 	#define OHCI_HCCTRL_LEN         0x4
 	__hc32			*ohci_hcctrl_reg;
 	unsigned		has_hostpc:1;
+	unsigned		has_usbmode_ex:1; /* host mode is in USBMODE_EX */
 	unsigned		has_tdi_phy_lpm:1;
 	unsigned		has_ppcd:1; /* support per-port change bits */
 	u8			sbrn;		/* packed release number */

-- 
Git-155)



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

* Re: [PATCH v2 1/2] usb: ehci-pci: Skip SBRN and port-wake reads on Intel CE5300
  2026-10-27 23:38 ` [PATCH v2 1/2] usb: ehci-pci: Skip SBRN and port-wake reads on Intel CE5300 Joseph Telaak via B4 Relay
@ 2026-10-27 23:41   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-10-27 23:41 UTC (permalink / raw)
  To: Joseph Telaak; +Cc: linux-usb

> From: Joseph Telaak <joseph@telaak.dev>
> 
> The TDI EHCI core in the Intel CE5300 SoCs (192e:0101, revision >= 6)
> has no EHCI-specific PCI config registers at 0x60: those bytes shadow
> BAR3. ehci_pci_setup() reads two of them anyway.
> 
> SBRN (0x60) reads as 0 and overwrites the HCD_USB2 default, so the
> controller reports "USB 0.0 started" and ehci_shutdown() returns
> early because sbrn is 0, so the controller is never stopped on reboot
> or kexec. The port-wake word (0x62) is whatever BAR3 holds, so on
> some instances bit 0 is set and the driver prints "Enabling legacy
> PCI PM" and marks the controller wakeup-capable.
> 
> Skip both reads for this core, as is already done for SBRN on the ST
> ConneXT and HiSilicon Kunpeng920 controllers. The new helper is also
> used by the next patch.
> 
> Tested on a Control4 EA-3 (Intel Atom CE5310) with v7.3-rc6: the
> controllers report "USB 2.0 started" and the legacy PCI PM message is
> gone.
> 
> Assisted-by: LLM
> Signed-off-by: Joseph Telaak <joseph@telaak.dev>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027-ehci-ce5300-hostpc-v2-0-375e9d362d74@telaak.dev?part=1


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

* Re: [PATCH v2 2/2] usb: ehci-pci: Set has_hostpc for TDI EHCI on Intel CE5300
  2026-10-27 23:38 ` [PATCH v2 2/2] usb: ehci-pci: Set has_hostpc for TDI EHCI " Joseph Telaak via B4 Relay
@ 2026-10-27 23:44   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-10-27 23:44 UTC (permalink / raw)
  To: Joseph Telaak; +Cc: linux-usb

> From: Joseph Telaak <joseph@telaak.dev>
> 
> The TransDimension EHCI core in the Intel CE5300 SoCs (192e:0101,
> revision >= 6) has the Moorestown-style register extensions: host
> mode is selected in USBMODE_EX rather than USBMODE, and the port speed
> is reported in HOSTPC.
> 
> Without has_hostpc, ehci_reset() never programs USBMODE_EX, so the
> core stays in idle mode: USBMODE_EX reads back 0, USBCMD.RS never
> sets and no device is ever reported as connected, even though the
> probe itself succeeds. With it, USBMODE_EX reads back 0x23 and
> devices enumerate.
> 
> USBMODE itself always reads back 0 on this core, so
> tdi_in_host_mode() would report a running controller as not in host
> mode and ehci_halt() would return without stopping it. Add
> has_usbmode_ex so that, for this core only, tdi_in_host_mode() reads
> host mode back from USBMODE_EX. ChipIdea also sets has_hostpc but
> keeps host mode in USBMODE, so it is unaffected.
> 
> Intel's CE5300 BSP sets has_hostpc for device 0x0101, revision >= 6.
> 
> Tested on a Control4 EA-3 (Intel Atom CE5310) with v7.3-rc6: a
> full-speed CP2104 USB-UART bridge (10c4:ea60) and a high-speed USB
> flash drive (0781:5575) enumerate with this change, and
> ehci_shutdown() leaves the controller halted (USBCMD.RS clear,
> USBSTS.HCHalted set); without the USBMODE_EX check it stays running.
> 
> Assisted-by: LLM
> Signed-off-by: Joseph Telaak <joseph@telaak.dev>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027-ehci-ce5300-hostpc-v2-0-375e9d362d74@telaak.dev?part=2


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

end of thread, other threads:[~2026-10-27 23:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27 23:38 [PATCH v2 0/2] usb: ehci-pci: Intel CE5300 TDI EHCI support Joseph Telaak via B4 Relay
2026-10-27 23:38 ` [PATCH v2 1/2] usb: ehci-pci: Skip SBRN and port-wake reads on Intel CE5300 Joseph Telaak via B4 Relay
2026-10-27 23:41   ` sashiko-bot
2026-10-27 23:38 ` [PATCH v2 2/2] usb: ehci-pci: Set has_hostpc for TDI EHCI " Joseph Telaak via B4 Relay
2026-10-27 23:44   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox