summaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3
AgeCommit message (Collapse)Author
2026-08-09usb: mtu3: add SPL supportCarlo Caione
MediaTek platforms may need the MTU3 controller before U-Boot proper is available, but the driver is currently selected and built only with the main U-Boot configuration symbols. Add an explicit SPL controller option with host and gadget modes. Make the driver build and its role checks phase-aware so each phase can select the MTU3 role it needs without coupling it to the U-Boot proper controller configuration. The upstream binding locates the xHCI child registers through the parent ranges property. Select SPL_OF_TRANSLATE for host mode so SPL can resolve that address before mapping it. Signed-off-by: Julien Masson <[email protected]> Signed-off-by: Carlo Caione <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2026-08-09usb: mtu3: support the upstream devicetree bindingCarlo Caione
The MTU3 glue driver expects a synthetic mediatek,ssusb child that combines the device and xHCI register windows. Upstream devicetrees instead put the device resources on the controller node and describe the xHCI window with a standard child node, so U-Boot cannot use an upstream topology. Switch to the upstream layout. The controller owns the shared resources and the device MAC, with the device register offsets relative to it as in Linux. The gadget role binds as a node-less internal device, while the host role binds to an enabled xHCI child and uses its own clocks, supplies and register window. dr_mode selects the role and defaults to otg, and the Kconfig choice constrains which role the build provides. The legacy child layout is rejected explicitly so its combined register window cannot be mistaken for the device MAC. Convert the in-tree MT8183 and MT8512 devicetrees in the same commit so neither platform is left without USB. MT8512 stays peripheral-only because its xHCI host interrupt is not documented and the mediatek,mtk-xhci binding requires it. Reviewed-by: Marek Vasut <[email protected]> Signed-off-by: Carlo Caione <[email protected]>
2026-08-02usb: mtu3: wait for TX FIFO to drain before disconnectCarlo Caione
Fastboot unregisters the USB gadget from the completion callback of its final OKAY response. MTU3 QMU can report that request complete while bytes remain in the endpoint TX FIFO. Disabling the USB function immediately can therefore disconnect the host before it receives the response. Before selecting the high-speed or SuperSpeed disconnect operation, poll the FIFO state of enabled IN endpoints that have no pending requests. Bound the wait to 1 ms. If a FIFO does not drain, reset its endpoint, force the disconnect, and propagate -ETIMEDOUT through the gadget pullup operation. Endpoints with pending requests are skipped so an ordinary disconnect does not wait for an active transfer. Fixes: e09b88cd083d ("usb: add MediaTek USB3 DRD driver") Signed-off-by: Vitor Sato Eschholz <[email protected]> Signed-off-by: Carlo Caione <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2024-10-11drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <[email protected]>
2024-07-05usb: gadget: mtu3: Convert interrupt handling to usb_gadget_generic_opsMarek Vasut
Implement .handle_interrupts callback as a replacement for deprecated dm_usb_gadget_handle_interrupts() function. The new callback allows for each DM capable USB gadget controller driver to define its own IRQ handling implementation without colliding with other controller drivers. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # vim3 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07usb: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-11-03usb: mtu3: flush cache for the first GPD when allocate GPD ringChunfeng Yun
When allocate the GPD ring, and tell its address to the controller, then the driver starts or resumes the QMU, the controller will try to access the first GPD, so need flush the first one to avoid wrong GPD status. Reported-by: Xin Lin <[email protected]> Signed-off-by: Chunfeng Yun <[email protected]>
2021-07-28Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOSTSimon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <[email protected]>
2021-07-18usb: Enforce DM_USB migration for USB_HOST devices.Tom Rini
As the deadline for migration to DM_USB, when using a USB host controller has now gone two years past the deadline, enforce migration. This is done by: - Ensuring that all host controller options (other than the very legacy old MUSB ones) now select USB_HOST. USB_HOST now enforces DM_USB and OF_CONTROL. - Remove other parts of Kconfig logic that had platforms pick DM_USB. - To keep Kconfig happy, have some select statements test for USB_HOST as well. - Re-order some Kconfig entries and menus so that we can cleanly pick host or gadget roles. For the various HCD options that have platform glue options, group them together and update dependencies in some cases. - As SPL_DM_USB is not required, on platforms that had not yet enabled it, disable it. Cc: Marek Vasut <[email protected]> Cc: Icenowy Zheng <[email protected]> Cc: Samuel Holland <[email protected]> Cc: FUKAUMI Naoki <[email protected]> Cc: Andre Przywara <[email protected]> Cc: Jagan Teki <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-03-10usb: mtu3: flush cache for next GPDChunfeng Yun
When flush cache of the current GPD and resume QMU, the controller will try to access the next GPD after processing the current one, if not flush the next GPD, the controller may get wrong GPD status. Signed-off-by: Chunfeng Yun <[email protected]>
2021-01-05dm: core: Access device ofnode through functionsSimon Glass
At present ofnode is present in the device even if it is never used. With of-platdata this field is not used, so can be removed. In preparation for this, change the access to go through inline functions. Signed-off-by: Simon Glass <[email protected]>
2020-12-13dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <[email protected]>
2020-10-20usb: add MediaTek USB3 DRD driverChunfeng Yun
This patch adds support for the MediaTek USB3 DRD controller, its host side is based on xHCI, this driver supports device mode and host mode. Signed-off-by: Chunfeng Yun <[email protected]> Acked-by: Bin Meng <[email protected]>