Skip to contentSkip to conversation

Add support MediaTek USB3 DRD driver

PATCH Superseded Chunfeng Yun 1 participant 11 messages Aug 10, 2020

Subsystems (5)
Arm (32-bit) USB Kbuild Arm MediaTek +1 more subsystems

v4 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Chunfeng Yun

author maintainer
#0 lore raw

v4 cover Add support MediaTek USB3 DRD driver

These patches introduce the MediaTek USB3 Dual-Role Controller driver.
The driver can be configured as Peripheral only and Host only(xHCI) modes, and it's ported from Linux Kernel 5.8-rc1

v4 changes:
1. [4/10], [9/10] and [10/10] are new patches
2. add a glue driver
3. add host driver and rebuild host flow
4. support force_vbus mode for device
5. update bindings to support glue driver

v3 changes:
1. add patch [5/7]
2. add udc_set_speed()
3. simplify some code flow

v2 changes:
1. simplify QMU operations

Chunfeng Yun (10):
dt-binding: usb: add bindings for some common properties
dt-bindings: usb: mtu3: add bindings for MediaTek USB3 DRD
usb: add USB_SPEED_SUPER_PLUS
usb: common: add define of usb_speed_string()
usb: add MediaTek USB3 DRD driver
usb: gadget: Add bcdDevice for the MTU3 USB Gadget Controller
arm: dts: mt8512: add usb related nodes
configs: mt8512: enable fastboot
configs: mt8512: add USB host related configs
MAINTAINERS: add mtu3 driver to ARM MEDIATEK

 MAINTAINERS                                    |   1 +
 Makefile                                       |   1 +
 arch/arm/dts/mt8512-bm1-emmc.dts               |  34 +
 arch/arm/dts/mt8512.dtsi                       |  49 +-
 configs/mt8512_bm1_emmc_defconfig              |  26 +
 doc/device-tree-bindings/usb/generic.txt       |  31 +
 doc/device-tree-bindings/usb/mediatek,mtu3.txt |  79 +++
 drivers/usb/Kconfig                            |   2 +
 drivers/usb/common/common.c                    |   8 +
 drivers/usb/gadget/gadget_chips.h              |   8 +
 drivers/usb/mtu3/Kconfig                       |  45 ++
 drivers/usb/mtu3/Makefile                      |  11 +
 drivers/usb/mtu3/mtu3.h                        | 423 +++++++++++
 drivers/usb/mtu3/mtu3_core.c                   | 838 ++++++++++++++++++++++
 drivers/usb/mtu3/mtu3_dr.h                     |  52 ++
 drivers/usb/mtu3/mtu3_gadget.c                 | 686 ++++++++++++++++++
 drivers/usb/mtu3/mtu3_gadget_ep0.c             | 933 +++++++++++++++++++++++++
 drivers/usb/mtu3/mtu3_host.c                   | 141 ++++
 drivers/usb/mtu3/mtu3_hw_regs.h                | 515 ++++++++++++++
 drivers/usb/mtu3/mtu3_plat.c                   | 367 ++++++++++
 drivers/usb/mtu3/mtu3_qmu.c                    | 504 +++++++++++++
 drivers/usb/mtu3/mtu3_qmu.h                    |  37 +
 include/linux/usb/ch9.h                        |   5 +-
 23 files changed, 4791 insertions(+), 5 deletions(-)
 create mode 100644 doc/device-tree-bindings/usb/generic.txt
 create mode 100644 doc/device-tree-bindings/usb/mediatek,mtu3.txt
 create mode 100644 drivers/usb/mtu3/Kconfig
 create mode 100644 drivers/usb/mtu3/Makefile
 create mode 100644 drivers/usb/mtu3/mtu3.h
 create mode 100644 drivers/usb/mtu3/mtu3_core.c
 create mode 100644 drivers/usb/mtu3/mtu3_dr.h
 create mode 100644 drivers/usb/mtu3/mtu3_gadget.c
 create mode 100644 drivers/usb/mtu3/mtu3_gadget_ep0.c
 create mode 100644 drivers/usb/mtu3/mtu3_host.c
 create mode 100644 drivers/usb/mtu3/mtu3_hw_regs.h
 create mode 100644 drivers/usb/mtu3/mtu3_plat.c
 create mode 100644 drivers/usb/mtu3/mtu3_qmu.c
 create mode 100644 drivers/usb/mtu3/mtu3_qmu.h
Signature · 1 line
1.9.1
author maintainer
#1 lore raw

PATCH v4 1/10 dt-binding: usb: add bindings for some common properties

Add bindings for common properties, include maximum-speed, dr_mode and phy_type

---
v2~v4: no changes

---
 doc/device-tree-bindings/usb/generic.txt | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 doc/device-tree-bindings/usb/generic.txt
doc/device-tree-bindings/usb/generic.txt new file +31 -0
new file mode 100644
index 0000000..a02a198
@@ -0,0 +1,31 @@
+Generic USB Properties
+
+Optional properties:
+ - maximum-speed: tells USB controllers we want to work up to a certain
+			speed. Valid arguments are "super-speed-plus",
+			"super-speed", "high-speed", "full-speed" and
+			"low-speed". In case this isn't passed via DT, USB
+			controllers should default to their maximum HW
+			capability.
+ - dr_mode: tells Dual-Role USB controllers that we want to work on a
+			particular mode. Valid arguments are "host",
+			"peripheral" and "otg". In case this attribute isn't
+			passed via DT, USB DRD controllers should default to
+			OTG.
+ - phy_type: tells USB controllers that we want to configure the core to support
+			a UTMI+ PHY with an 8- or 16-bit interface if UTMI+ is
+			selected. Valid arguments are "utmi" and "utmi_wide".
+			In case this isn't passed via DT, USB controllers should
+			default to HW capability.
+
+This is an attribute to a USB controller such as:
+
+dwc3 at 4a030000 {
+	compatible = "synopsys,dwc3";
+	reg = <0x4a030000 0xcfff>;
+	interrupts = <0 92 4>
+	usb-phy = <&usb2_phy>, <&usb3,phy>;
+	maximum-speed = "super-speed";
+	dr_mode = "otg";
+	phy_type = "utmi_wide";
+};
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH v4 2/10 dt-bindings: usb: mtu3: add bindings for MediaTek USB3 DRD

In reply to Chunfeng Yun

Add dt-binding for MediaTek USB3 DRD Driver

---
v4:
Add support host mode, introduce some new properties and subnode

v2~v3: no changes

---
 doc/device-tree-bindings/usb/mediatek,mtu3.txt | 79 ++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 doc/device-tree-bindings/usb/mediatek,mtu3.txt
doc/device-tree-bindings/usb/mediatek,mtu3.txt new file +79 -0
new file mode 100644
index 0000000..ab877bf
@@ -0,0 +1,79 @@
+The device node for Mediatek USB3 DRD controller
+
+Required properties:
+ - compatible : should be "mediatek,<soc-model>-mtu3", "mediatek,mtu3",
+	soc-model is the name of SoC, such as mt8512 etc,
+	when using "mediatek,mtu3" compatible string, you need SoC specific
+	ones in addition, one of:
+	- "mediatek,mt8512-mtu3"
+ - reg : specifies physical base address and size of the registers
+ - reg-names: should be
+	- "ippc" : IP Port Control
+ - power-domains : a phandle to USB power domain node to control USB's MTCMOS
+ - clocks : a list of phandle + clock-specifier pairs, one for each
+	entry in clock-names
+ - clock-names : must contain "sys_ck" for clock of controller,
+	the following clocks are optional:
+	"ref_ck", "mcu_ck", "dma_ck" and "xhci_ck";
+ - phys : list of all the USB PHYs on this HCD
+ - #address-cells, #size-cells : used for sub-nodes with 'reg' property
+ - ranges : allows valid 1:1 translation between child's address space and
+	parent's address space
+
+Optional properties:
+ - vusb33-supply : regulator of USB AVDD3.3v
+ - vbus-supply : regulator of VBUS 5v, needed when supports host mode.
+
+Sub-nodes:
+Required properties:
+ - compatible : should be "mediatek,ssusb"
+ - reg : specifies physical base address and size of the registers
+ - reg-names: should be
+	- "mac" : SSUSB MAC, include xHCI and device
+ - interrupts : interrupt used by xHCI or device
+ - dr_mode : should be one of "host" or "peripheral",
+	see : usb/generic.txt
+
+Optional properties:
+ - pinctrl-names : a pinctrl state named "default" is optional
+ - pinctrl-0 : pin control group
+	See: pinctrl/pinctrl-bindings.txt
+
+ - device mode:
+   - maximum-speed : valid arguments are "full-speed", "high-speed",
+	"super-speed" and "super-speed-plus",
+	see: usb/generic.txt
+   - mediatek,force-vbus : force vbus as valid by SW
+
+ - host mode (dr_mode is "host"):
+   - mediatek,u3p-dis-msk : mask to disable u3ports, bit0 for u3port0,
+	bit1 for u3port1, ... etc;
+
+Example:
+usb3: usb at 11213e00 {
+	compatible = "mediatek,mt8512-mtu3", "mediatek,mtu3";
+	reg = <0x11213e00 0x0100>;
+	reg-names = "ippc";
+	phys = <&u2port0 PHY_TYPE_USB2>, <&u2port1 PHY_TYPE_USB2>;
+	power-domains = <&scpsys MT8512_POWER_DOMAIN_USB>;
+	clocks = <&infracfg CLK_INFRA_USB_SYS>,
+		 <&topckgen CLK_TOP_SSUSB_TOP_CK_EN>,
+		 <&infracfg CLK_INFRA_ICUSB>;
+	clock-names = "sys_ck", "ref_ck", "mcu_ck";
+	vusb33-supply = <reg_3p3v>;
+	vbus-supply = <&usb_p0_vbus>;
+	#address-cells = <1>;
+	#size-cells = <1>;
+	ranges;
+	status = "disabled";
+
+	ssusb: usb at 11210000 {
+		compatible = "mediatek,ssusb";
+		reg = <0x11210000 0x3e00>;
+		interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_LOW>;
+		reg-names = "mac";
+		dr_mode = "peripheral";
+		maximum-speed = "high-speed";
+		status = "disabled";
+	};
+};
Signature · 1 line
1.9.1
author maintainer
#3 lore raw

PATCH v4 3/10 usb: add USB_SPEED_SUPER_PLUS

In reply to Chunfeng Yun

Add enum USB_SPEED_SUPER_PLUS for USB3.1

---
v4: also add it into speed_names array

v2~v3: no changes

---
 include/linux/usb/ch9.h     | 1 +
 2 files changed, 2 insertions(+)
drivers/usb/common/common.c +1 -0
index d4ae186..76f5a9c 100644
@@ -46,6 +46,7 @@ static const char *const speed_names[] = {
 	[USB_SPEED_HIGH] = "high-speed",
 	[USB_SPEED_WIRELESS] = "wireless",
 	[USB_SPEED_SUPER] = "super-speed",
+	[USB_SPEED_SUPER_PLUS] = "super-speed-plus",
 };
 
 enum usb_device_speed usb_get_maximum_speed(ofnode node)
include/linux/usb/ch9.h +1 -0
index 989a5fc..7d225ee 100644
@@ -956,6 +956,7 @@ enum usb_device_speed {
 	USB_SPEED_HIGH,				/* usb 2.0 */
 	USB_SPEED_WIRELESS,			/* wireless (usb 2.5) */
 	USB_SPEED_SUPER,			/* usb 3.0 */
+	USB_SPEED_SUPER_PLUS,			/* usb 3.1 */
 };
 
 #ifdef __KERNEL__
Signature · 1 line
1.9.1
author maintainer
#4 lore raw

PATCH v4 4/10 usb: common: add define of usb_speed_string()

In reply to Chunfeng Yun

There is only declear of usb_speed_string(), but not define it.

---
v4: new patch

---
 drivers/usb/common/common.c | 7 +++++++
 include/linux/usb/ch9.h     | 4 ----
 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/usb/common/common.c +7 -0
index 76f5a9c..5e5c3c3 100644
@@ -49,6 +49,13 @@ static const char *const speed_names[] = {
 	[USB_SPEED_SUPER_PLUS] = "super-speed-plus",
 };
 
+const char *usb_speed_string(enum usb_device_speed speed)
+{
+	if (speed < 0 || speed >= ARRAY_SIZE(speed_names))
+		speed = USB_SPEED_UNKNOWN;
+	return speed_names[speed];
+}
+
 enum usb_device_speed usb_get_maximum_speed(ofnode node)
 {
 	const char *max_speed;
include/linux/usb/ch9.h +0 -4
index 7d225ee..a8fa5d7 100644
@@ -959,8 +959,6 @@ enum usb_device_speed {
 	USB_SPEED_SUPER_PLUS,			/* usb 3.1 */
 };
 
-#ifdef __KERNEL__
-
 /**
  * usb_speed_string() - Returns human readable-name of the speed.
  * @speed: The speed to return human-readable name for.  If it's not
@@ -969,8 +967,6 @@ enum usb_device_speed {
  */
 extern const char *usb_speed_string(enum usb_device_speed speed);
 
-#endif
-
 enum usb_device_state {
 	/* NOTATTACHED isn't in the USB spec, and this state acts
 	 * the same as ATTACHED ... but it's clearer this way.
Signature · 1 line
1.9.1
author maintainer
#5 lore raw

PATCH v4 5/10 usb: add MediaTek USB3 DRD driver

In reply to Chunfeng 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.

---
v4:
1. remove unused member @busy and @wedged, use their flags instead
2. support force_vbus mode
3. add a glue driver using UCLASS_NOP
4. add host driver, and rebuild host flow

v3 changes
1. add ->udc_set_speed()
2. simplify some code flow

v2: simplify QMU operations

---
 Makefile                           |   1 +
 drivers/usb/Kconfig                |   2 +
 drivers/usb/mtu3/Kconfig           |  45 ++
 drivers/usb/mtu3/Makefile          |  11 +
 drivers/usb/mtu3/mtu3.h            | 423 +++++++++++++++++
 drivers/usb/mtu3/mtu3_core.c       | 838 +++++++++++++++++++++++++++++++++
 drivers/usb/mtu3/mtu3_dr.h         |  52 +++
 drivers/usb/mtu3/mtu3_gadget.c     | 686 +++++++++++++++++++++++++++
 drivers/usb/mtu3/mtu3_gadget_ep0.c | 933 +++++++++++++++++++++++++++++++++++++
 drivers/usb/mtu3/mtu3_host.c       | 141 ++++++
 drivers/usb/mtu3/mtu3_hw_regs.h    | 515 ++++++++++++++++++++
 drivers/usb/mtu3/mtu3_plat.c       | 367 +++++++++++++++
 drivers/usb/mtu3/mtu3_qmu.c        | 504 ++++++++++++++++++++
 drivers/usb/mtu3/mtu3_qmu.h        |  37 ++
 14 files changed, 4555 insertions(+)
 create mode 100644 drivers/usb/mtu3/Kconfig
 create mode 100644 drivers/usb/mtu3/Makefile
 create mode 100644 drivers/usb/mtu3/mtu3.h
 create mode 100644 drivers/usb/mtu3/mtu3_core.c
 create mode 100644 drivers/usb/mtu3/mtu3_dr.h
 create mode 100644 drivers/usb/mtu3/mtu3_gadget.c
 create mode 100644 drivers/usb/mtu3/mtu3_gadget_ep0.c
 create mode 100644 drivers/usb/mtu3/mtu3_host.c
 create mode 100644 drivers/usb/mtu3/mtu3_hw_regs.h
 create mode 100644 drivers/usb/mtu3/mtu3_plat.c
 create mode 100644 drivers/usb/mtu3/mtu3_qmu.c
 create mode 100644 drivers/usb/mtu3/mtu3_qmu.h
Makefile +1 -0
index 73e1f1d..9e90317 100644
@@ -795,6 +795,7 @@ libs-y += drivers/usb/eth/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/udc/
 libs-y += drivers/usb/host/
+libs-y += drivers/usb/mtu3/
 libs-y += drivers/usb/musb/
 libs-y += drivers/usb/musb-new/
 libs-y += drivers/usb/phy/
drivers/usb/Kconfig +2 -0
index 756a4ec..91d11f2 100644
@@ -72,6 +72,8 @@ source "drivers/usb/cdns3/Kconfig"
 
 source "drivers/usb/dwc3/Kconfig"
 
+source "drivers/usb/mtu3/Kconfig"
+
 source "drivers/usb/musb/Kconfig"
 
 source "drivers/usb/musb-new/Kconfig"
drivers/usb/mtu3/Kconfig new file +45 -0

45 lines not on this page · raw message

drivers/usb/mtu3/Makefile new file +11 -0
new file mode 100644
index 0000000..234f3a3
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0
+
+ccflags-$(CONFIG_USB_MTU3_DEBUG)	+= -DDEBUG
+
+obj-$(CONFIG_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
drivers/usb/mtu3/mtu3.h new file +423 -0

423 lines not on this page · raw message

drivers/usb/mtu3/mtu3_core.c new file +838 -0

838 lines not on this page · raw message

drivers/usb/mtu3/mtu3_dr.h new file +52 -0

52 lines not on this page · raw message

drivers/usb/mtu3/mtu3_gadget.c new file +686 -0

686 lines not on this page · raw message

drivers/usb/mtu3/mtu3_gadget_ep0.c new file +933 -0

930 lines not on this page · raw message

drivers/usb/mtu3/mtu3_host.c new file +141 -0

141 lines not on this page · raw message

drivers/usb/mtu3/mtu3_hw_regs.h new file +515 -0

515 lines not on this page · raw message

drivers/usb/mtu3/mtu3_plat.c new file +367 -0

367 lines not on this page · raw message

drivers/usb/mtu3/mtu3_qmu.c new file +504 -0

504 lines not on this page · raw message

drivers/usb/mtu3/mtu3_qmu.h new file +37 -0
new file mode 100644
index 0000000..ba8a3aa

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

author maintainer
#6 lore raw

PATCH v4 6/10 usb: gadget: Add bcdDevice for the MTU3 USB Gadget Controller

In reply to Chunfeng Yun

Add an entry in usb_gadget_controller_number() for the MTU3 gadget controller. It is used to bind the USB Ethernet driver.

---
v4: no changes

v3: new patch

---
 drivers/usb/gadget/gadget_chips.h | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/usb/gadget/gadget_chips.h +8 -0
index 91b0285..2dc4c47 100644
@@ -155,6 +155,12 @@
 #define gadget_is_cdns3(g)        0
 #endif
 
+#ifdef CONFIG_USB_MTU3_GADGET
+#define gadget_is_mtu3(g)        (!strcmp("mtu3-gadget", (g)->name))
+#else
+#define gadget_is_mtu3(g)        0
+#endif
+
 /**
  * usb_gadget_controller_number - support bcdDevice id convention
  * @gadget: the controller being driven
@@ -216,5 +222,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
 		return 0x23;
 	else if (gadget_is_cdns3(gadget))
 		return 0x24;
+	else if (gadget_is_mtu3(gadget))
+		return 0x25;
 	return -ENOENT;
 }
Signature · 1 line
1.9.1
author maintainer
#7 lore raw

PATCH v4 7/10 arm: dts: mt8512: add usb related nodes

In reply to Chunfeng Yun

Add usb, usb phy, and fixed regulators nodes

---
v4: add host related properties, add subnode.

v3: remove unused property mediatek,discth

v2: no changes

 arch/arm/dts/mt8512-bm1-emmc.dts | 34 ++++++++++++++++++++++++++++
 arch/arm/dts/mt8512.dtsi         | 49 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 82 insertions(+), 1 deletion(-)
arch/arm/dts/mt8512-bm1-emmc.dts +34 -0
index 296ed93..12511b5 100644
@@ -43,6 +43,25 @@
 		regulator-boot-on;
 		regulator-always-on;
 	};
+
+	usb_p0_vbus: regulator at 0 {
+		compatible = "regulator-fixed";
+		regulator-name = "p0_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio 27 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	usb_p1_vbus: regulator at 1 {
+		compatible = "regulator-fixed";
+		regulator-name = "p1_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio 32 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
 };
 
 &mmc0 {
@@ -95,6 +114,21 @@
 		};
 };
 
+&ssusb {
+	dr_mode = "peripheral";
+	maximum-speed = "high-speed";
+	status = "okay";
+};
+
+&usb3 {
+	vbus-supply = <&usb_p0_vbus>;
+	status = "okay";
+};
+
+&u3phy {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins>;
arch/arm/dts/mt8512.dtsi +48 -1

65 lines not on this page · raw message

Signature · 1 line
1.9.1
author maintainer
#8 lore raw

PATCH v4 8/10 configs: mt8512: enable fastboot

In reply to Chunfeng Yun

Enable fastboot to support download image from usb, also enable usb related drivers, such as usb phy etc.

---
v2~v4: no changes

---
 configs/mt8512_bm1_emmc_defconfig | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
configs/mt8512_bm1_emmc_defconfig +19 -0
index 10a2083..4b94bff 100644
@@ -9,6 +9,7 @@ CONFIG_TARGET_MT8512=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEFAULT_DEVICE_TREE="mt8512-bm1-emmc"
 CONFIG_FIT=y
+CONFIG_EFI_PARTITION=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_DEFAULT_FDT_FILE="mt8512-bm1-emmc.dtb"
 CONFIG_SYS_PROMPT="MT8512> "
@@ -26,6 +27,15 @@ CONFIG_PINCONF=y
 CONFIG_PINCTRL_MT8512=y
 CONFIG_RAM=y
 CONFIG_BAUDRATE=921600
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x56000000
+CONFIG_FASTBOOT_BUF_SIZE=0x1e00000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
+CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
+CONFIG_PHY=y
+CONFIG_PHY_MTK_TPHY=y
+CONFIG_DM_REGULATOR=y
 CONFIG_DM_SERIAL=y
 CONFIG_MTK_SERIAL=y
 CONFIG_TIMER=y
@@ -33,3 +43,12 @@ CONFIG_MTK_TIMER=y
 CONFIG_WDT=y
 CONFIG_WDT_MTK=y
 CONFIG_LZO=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_DM_USB_GADGET=y
+CONFIG_USB_MTU3=y
+CONFIG_USB_MTU3_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="MediaTek"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0e8d
+CONFIG_USB_GADGET_PRODUCT_NUM=0x201c
Signature · 1 line
1.9.1
author maintainer
#9 lore raw

PATCH v4 9/10 configs: mt8512: add USB host related configs

In reply to Chunfeng Yun

Add USB, FAT commands, and fixed regulator, mass storage drivers.
Due to device mode is enabled by default, comment out the host mode config here.

---
v4: new patch

---
 configs/mt8512_bm1_emmc_defconfig | 7 +++++++
 1 file changed, 7 insertions(+)
configs/mt8512_bm1_emmc_defconfig +7 -0
index 4b94bff..1ed3dd2 100644
@@ -15,6 +15,10 @@ CONFIG_DEFAULT_FDT_FILE="mt8512-bm1-emmc.dtb"
 CONFIG_SYS_PROMPT="MT8512> "
 CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+# CONFIG_DOS_PARTITION is not set
 CONFIG_ENV_OVERWRITE=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
@@ -36,6 +40,7 @@ CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y
 CONFIG_PHY=y
 CONFIG_PHY_MTK_TPHY=y
 CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_SERIAL=y
 CONFIG_MTK_SERIAL=y
 CONFIG_TIMER=y
@@ -48,6 +53,8 @@ CONFIG_DM_USB=y
 CONFIG_DM_USB_GADGET=y
 CONFIG_USB_MTU3=y
 CONFIG_USB_MTU3_GADGET=y
+#CONFIG_USB_MTU3_HOST=y
+CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="MediaTek"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0e8d
Signature · 1 line
1.9.1
author maintainer
#10 lore raw

PATCH v4 10/10 MAINTAINERS: add mtu3 driver to ARM MEDIATEK

In reply to Chunfeng Yun

Add MediaTek USB3 Dual-Role controller driver to ARM MEDIATEK

---
v4: new patch

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 889a73f..e3fe859 100644
@@ -265,6 +265,7 @@ F:	drivers/power/domain/mtk-power-domain.c
 F:	drivers/ram/mediatek/
 F:	drivers/spi/mtk_snfi_spi.c
 F:	drivers/timer/mtk_timer.c
+F:	drivers/usb/mtu3/
 F:	drivers/watchdog/mtk_wdt.c
 F:	drivers/net/mtk_eth.c
 F:	drivers/reset/reset-mediatek.c
Signature · 1 line
1.9.1