[PATCH 0/5] board: mediatek: pumpkin: add fastboot support

This series adds USB/Fastboot support on MT8516 Pumpkin board.
Fabien Parent (5): arm: dts: mt8516: add support for USB arm: dts: mt8516-pumpkin: enable usb port board: mediatek: pumpkin: initialize usb device configs: pumpkin: enable USB gadget configs: pumpkin: enable fastboot
arch/arm/dts/mt8516-pumpkin.dts | 10 ++++++++++ arch/arm/dts/mt8516.dtsi | 14 ++++++++++++++ board/mediatek/pumpkin/pumpkin.c | 17 +++++++++++++++++ configs/pumpkin_defconfig | 15 ++++++++++++++- 4 files changed, 55 insertions(+), 1 deletion(-)

Add support for USB on mt8516 based SoC.
Signed-off-by: Fabien Parent fparent@baylibre.com --- arch/arm/dts/mt8516.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/arch/arm/dts/mt8516.dtsi b/arch/arm/dts/mt8516.dtsi index 1c3358208614..c4577ceea386 100644 --- a/arch/arm/dts/mt8516.dtsi +++ b/arch/arm/dts/mt8516.dtsi @@ -123,6 +123,20 @@ status = "disabled"; };
+ usb0: usb@11100000 { + compatible = "mediatek,mt8516-musb", + "mediatek,mt8518-musb"; + reg = <0x11100000 0x1000>; + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "mc"; + clocks = <&topckgen CLK_TOP_USB_PHY48M>, + <&topckgen_cg CLK_TOP_USBIF>, + <&topckgen_cg CLK_TOP_USB>, + <&topckgen_cg CLK_TOP_USB_1P>; + clock-names = "usbpll", "usbmcu", "usb", "icusb"; + status = "disabled"; + }; + uart0: serial@11005000 { compatible = "mediatek,hsuart"; reg = <0x11005000 0x1000>;

On Fri, Oct 16, 2020 at 05:40:05PM +0200, Fabien Parent wrote:
Add support for USB on mt8516 based SoC.
Signed-off-by: Fabien Parent fparent@baylibre.com
Applied to u-boot/master, thanks!

Enable the USB port for MT8516 Pumpkin Board.
Signed-off-by: Fabien Parent fparent@baylibre.com --- arch/arm/dts/mt8516-pumpkin.dts | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/arch/arm/dts/mt8516-pumpkin.dts b/arch/arm/dts/mt8516-pumpkin.dts index cd43c1f5e32c..292b00f0ffb1 100644 --- a/arch/arm/dts/mt8516-pumpkin.dts +++ b/arch/arm/dts/mt8516-pumpkin.dts @@ -108,3 +108,13 @@ &watchdog { status = "okay"; }; + +&usb0 { + status = "okay"; + dr_mode = "peripheral"; + + usb_con_c: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + }; +};

On Fri, Oct 16, 2020 at 05:40:06PM +0200, Fabien Parent wrote:
Enable the USB port for MT8516 Pumpkin Board.
Signed-off-by: Fabien Parent fparent@baylibre.com
Applied to u-boot/master, thanks!

Initialize USB device on pumpkin if it is enabled in the config.
Signed-off-by: Fabien Parent fparent@baylibre.com --- board/mediatek/pumpkin/pumpkin.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/board/mediatek/pumpkin/pumpkin.c b/board/mediatek/pumpkin/pumpkin.c index 666e4d6a26fe..37daf1c51b92 100644 --- a/board/mediatek/pumpkin/pumpkin.c +++ b/board/mediatek/pumpkin/pumpkin.c @@ -4,8 +4,25 @@ */
#include <common.h> +#include <dm.h>
int board_init(void) { return 0; } + +int board_late_init(void) +{ + struct udevice *dev; + int ret; + + if (CONFIG_IS_ENABLED(USB_GADGET)) { + ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev); + if (ret) { + pr_err("%s: Cannot find USB device\n", __func__); + return ret; + } + } + + return 0; +}

On Fri, Oct 16, 2020 at 05:40:07PM +0200, Fabien Parent wrote:
Initialize USB device on pumpkin if it is enabled in the config.
Signed-off-by: Fabien Parent fparent@baylibre.com
Applied to u-boot/master, thanks!

Enable USB gadget on pumpkin. This requires to also enable BOARD_LATE_INIT since the init is done in board_late_init function.
Signed-off-by: Fabien Parent fparent@baylibre.com --- configs/pumpkin_defconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/configs/pumpkin_defconfig b/configs/pumpkin_defconfig index 3d6af03d2209..94831adfa354 100644 --- a/configs/pumpkin_defconfig +++ b/configs/pumpkin_defconfig @@ -17,6 +17,7 @@ CONFIG_FIT=y # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set CONFIG_DEFAULT_FDT_FILE="mt8516-pumpkin" # CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_BOARD_LATE_INIT=y CONFIG_HUSH_PARSER=y # CONFIG_CMD_BDI is not set # CONFIG_CMD_CONSOLE is not set @@ -59,6 +60,13 @@ CONFIG_BAUDRATE=921600 CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_MTK_SERIAL=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_MUSB_MT85XX=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x0e8d +CONFIG_USB_GADGET_PRODUCT_NUM=0x201c CONFIG_WDT=y CONFIG_WDT_MTK=y # CONFIG_EFI_LOADER is not set

On Fri, Oct 16, 2020 at 05:40:08PM +0200, Fabien Parent wrote:
Enable USB gadget on pumpkin. This requires to also enable BOARD_LATE_INIT since the init is done in board_late_init function.
Signed-off-by: Fabien Parent fparent@baylibre.com
Applied to u-boot/master, thanks!

Enable fastboot commands for mt8516 pumpkin board.
Signed-off-by: Fabien Parent fparent@baylibre.com --- configs/pumpkin_defconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/configs/pumpkin_defconfig b/configs/pumpkin_defconfig index 94831adfa354..3f2cc6d023c1 100644 --- a/configs/pumpkin_defconfig +++ b/configs/pumpkin_defconfig @@ -46,8 +46,13 @@ CONFIG_CMD_PART=y # CONFIG_CMD_MISC is not set CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_NET is not set CONFIG_CLK=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x4d000000 +CONFIG_FASTBOOT_BUF_SIZE=0x4000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT=y # CONFIG_INPUT is not set CONFIG_DM_MMC=y # CONFIG_MMC_QUIRKS is not set

On Fri, Oct 16, 2020 at 05:40:09PM +0200, Fabien Parent wrote:
Enable fastboot commands for mt8516 pumpkin board.
Signed-off-by: Fabien Parent fparent@baylibre.com
Applied to u-boot/master, thanks!

Hi Fabien,
On Fri, 16 Oct 2020 at 09:40, Fabien Parent fparent@baylibre.com wrote:
This series adds USB/Fastboot support on MT8516 Pumpkin board.
Fabien Parent (5): arm: dts: mt8516: add support for USB arm: dts: mt8516-pumpkin: enable usb port board: mediatek: pumpkin: initialize usb device configs: pumpkin: enable USB gadget configs: pumpkin: enable fastboot
arch/arm/dts/mt8516-pumpkin.dts | 10 ++++++++++ arch/arm/dts/mt8516.dtsi | 14 ++++++++++++++ board/mediatek/pumpkin/pumpkin.c | 17 +++++++++++++++++ configs/pumpkin_defconfig | 15 ++++++++++++++- 4 files changed, 55 insertions(+), 1 deletion(-)
Do you have a link for this board, please? Also it would help to have some basic docs about it (building, installing U-Boot, basic specs)
Regards, Simon

Hi Simon,
On Sat, Nov 13, 2021 at 3:20 PM Simon Glass sjg@chromium.org wrote:
Hi Fabien,
On Fri, 16 Oct 2020 at 09:40, Fabien Parent fparent@baylibre.com wrote:
This series adds USB/Fastboot support on MT8516 Pumpkin board.
Fabien Parent (5): arm: dts: mt8516: add support for USB arm: dts: mt8516-pumpkin: enable usb port board: mediatek: pumpkin: initialize usb device configs: pumpkin: enable USB gadget configs: pumpkin: enable fastboot
arch/arm/dts/mt8516-pumpkin.dts | 10 ++++++++++ arch/arm/dts/mt8516.dtsi | 14 ++++++++++++++ board/mediatek/pumpkin/pumpkin.c | 17 +++++++++++++++++ configs/pumpkin_defconfig | 15 ++++++++++++++- 4 files changed, 55 insertions(+), 1 deletion(-)
Do you have a link for this board, please?
Sorry for the late reply. Here is a link to the board: https://www.seeedstudio.com/Pumpkin-Evaluation-Kit-Smart-Audio-Edition-p-426...
Also it would help to have some basic docs about it (building, installing U-Boot, basic specs)
Right now there is no public doc, but it will be released in the next couple of months alongside docs for the other pumpkin boards: mt8183 and mt8365.
Regards, Simon
participants (3)
-
Fabien Parent
-
Simon Glass
-
Tom Rini