On 8/6/26 2:54 PM, Carlo Caione wrote:
[...]
+++ b/drivers/usb/mtu3/Kconfig
@@ -42,3 +42,23 @@ config USB_MTU3_DEBUG
Say Y here to enable debugging messages in the MTU3 Driver.
endif
+
+config SPL_USB_MTU3
+ bool "MediaTek USB3 controller support in SPL"
+ depends on ARCH_MEDIATEK
+ depends on SPL_DM_USB_GADGET && SPL_USB_GADGET
+ help
+ Enable the MediaTek USB3 controller in SPL. The SPL driver currently
+ supports peripheral mode only.
+
+if SPL_USB_MTU3
+
+config SPL_USB_MTU3_GADGET
+ bool "Gadget mode in SPL"
+ default y
+ select USB_GADGET_DUALSPEED
+ help
+ Enable the MTU3 peripheral controller in SPL so USB gadget
+ functions can use it before U-Boot proper starts.
HOST seems to be missing here ?
+endif
diff --git a/drivers/usb/mtu3/Makefile b/drivers/usb/mtu3/Makefile
index 234f3a380a3..d1f0cd24875 100644
--- a/drivers/usb/mtu3/Makefile
+++ b/drivers/usb/mtu3/Makefile
@@ -1,11 +1,11 @@
# SPDX-License-Identifier: GPL-2.0
-ccflags-$(CONFIG_USB_MTU3_DEBUG) += -DDEBUG
+ccflags-$(CONFIG_$(PHASE_)USB_MTU3_DEBUG) += -DDEBUG
-obj-$(CONFIG_USB_MTU3) += mtu3.o
+obj-$(CONFIG_$(PHASE_)USB_MTU3) += mtu3.o
mtu3-y := mtu3_plat.o
-obj-$(CONFIG_USB_MTU3_GADGET) += mtu3_core.o mtu3_gadget_ep0.o mtu3_gadget.o
-obj-$(CONFIG_USB_MTU3_GADGET) += mtu3_qmu.o
-obj-$(CONFIG_USB_MTU3_HOST) += mtu3_host.o
+obj-$(CONFIG_$(PHASE_)USB_MTU3_GADGET) += mtu3_core.o mtu3_gadget_ep0.o
+obj-$(CONFIG_$(PHASE_)USB_MTU3_GADGET) += mtu3_gadget.o mtu3_qmu.o
+obj-$(CONFIG_$(PHASE_)USB_MTU3_HOST) += mtu3_host.o
[...]