usb: Add U-Boot xhci driver
This adds the xhci driver from U-Boot-2020.04-rc2. The usual things
like adjusting to the barebox driver model and using dev_* instead of
printf/puts/debug messages are made.

The previously existing PCI support is not present in this driver
currently. XHCI PCI support was not enabled in any defconfig, so we
boldly assume it was unused. It shouldn't be much effort though to
add it again.

The memory handling has been changed for barebox. The various
descriptor rings and descriptors are allocated with dma_alloc_coherent()
which makes the cache flushing/invalidating unnecessary. They are left
in the driver in case we want to change that.

The XHCI has a nasty limitation in that the TRBs may not cross a 64KiB
boundary. This limitation has been handled in the U-Boot driver, but the
handling seems to be broken. We help ourselves with using a bounce
buffer which is sufficiently aligned, but this limits the maximum bulk
transfer size to 64KiB.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent fddd1c7 commit 105b2eabd55aa0d6f548ce29e487c9dd98836ec5
@Sascha Hauer Sascha Hauer authored on 27 Feb 2020
Showing 7 changed files
View
drivers/usb/host/Kconfig
View
drivers/usb/host/Makefile
View
drivers/usb/host/xhci-mem.c 0 → 100644
View
drivers/usb/host/xhci-ring.c 0 → 100644
View
drivers/usb/host/xhci.c 0 → 100644
Too large (Show diff)
View
drivers/usb/host/xhci.h 0 → 100644
Too large (Show diff)
View
include/usb/xhci.h