mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: host: ohci: restrict the driver to 32-bit builds
@ 2026-12-01 11:41 Alexander Shiyan
  0 siblings, 0 replies; only message in thread
From: Alexander Shiyan @ 2026-12-01 11:41 UTC (permalink / raw)
  To: barebox; +Cc: Alexander Shiyan

The OHCI driver stores physical addresses in the host controller's 32-bit
ED/TD link fields and converts them back with casts like

	((struct ed *)m32_swap((unsigned long)ed_p))->hwNextED

Adding a 64BIT (i.e. x86_64) randconfig makes USB_OHCI selectable and the
build then fails with 18 int-to-pointer-cast / pointer-to-int-cast errors:

  drivers/usb/host/ohci-hcd.c:608:46: error: cast to pointer from integer
  of different size [-Werror=int-to-pointer-cast]

The driver has always been 32-bit only in practice: it depends on !MMU and
every board using it (dss11, at91) is a 32-bit ARM target. Fixing the casts
properly means teaching the ED/TD handling about 64-bit physical addresses,
which the hardware spec cannot express without the HCCA/ED layout changes
Linux does through hc32_to_cpup()/cpu_to_hc32().

Until such a port exists, make the 32-bit requirement explicit in Kconfig
so that randconfig cannot enable an unbuildable configuration.

Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 drivers/usb/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 186c17fecc..b879ed0f2c 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -34,7 +34,7 @@ config USB_EFI_IO_PROTOCOL
 
 config USB_OHCI
 	bool "OHCI driver"
-	depends on !MMU && HAS_DMA
+	depends on !MMU && HAS_DMA && !64BIT
 
 config USB_OHCI_AT91
 	depends on ARCH_AT91
-- 
2.54.0




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-01 11:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 11:41 [PATCH] usb: host: ohci: restrict the driver to 32-bit builds Alexander Shiyan

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