u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] board: mediatek: pumpkin: add fastboot support
@ 2020-10-16 15:40 Fabien Parent
  2020-10-16 15:40 ` [PATCH 1/5] arm: dts: mt8516: add support for USB Fabien Parent
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Fabien Parent @ 2020-10-16 15:40 UTC (permalink / raw)
  To: u-boot

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(-)

-- 
2.28.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] arm: dts: mt8516: add support for USB
  2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
@ 2020-10-16 15:40 ` Fabien Parent
  2021-01-19 13:02   ` Tom Rini
  2020-10-16 15:40 ` [PATCH 2/5] arm: dts: mt8516-pumpkin: enable usb port Fabien Parent
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Fabien Parent @ 2020-10-16 15:40 UTC (permalink / raw)
  To: u-boot

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 at 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 at 11005000 {
 		compatible = "mediatek,hsuart";
 		reg = <0x11005000 0x1000>;
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/5] arm: dts: mt8516-pumpkin: enable usb port
  2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
  2020-10-16 15:40 ` [PATCH 1/5] arm: dts: mt8516: add support for USB Fabien Parent
@ 2020-10-16 15:40 ` Fabien Parent
  2021-01-19 13:02   ` Tom Rini
  2020-10-16 15:40 ` [PATCH 3/5] board: mediatek: pumpkin: initialize usb device Fabien Parent
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Fabien Parent @ 2020-10-16 15:40 UTC (permalink / raw)
  To: u-boot

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";
+	};
+};
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/5] board: mediatek: pumpkin: initialize usb device
  2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
  2020-10-16 15:40 ` [PATCH 1/5] arm: dts: mt8516: add support for USB Fabien Parent
  2020-10-16 15:40 ` [PATCH 2/5] arm: dts: mt8516-pumpkin: enable usb port Fabien Parent
@ 2020-10-16 15:40 ` Fabien Parent
  2021-01-19 13:02   ` Tom Rini
  2020-10-16 15:40 ` [PATCH 4/5] configs: pumpkin: enable USB gadget Fabien Parent
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Fabien Parent @ 2020-10-16 15:40 UTC (permalink / raw)
  To: u-boot

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;
+}
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/5] configs: pumpkin: enable USB gadget
  2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
                   ` (2 preceding siblings ...)
  2020-10-16 15:40 ` [PATCH 3/5] board: mediatek: pumpkin: initialize usb device Fabien Parent
@ 2020-10-16 15:40 ` Fabien Parent
  2021-01-19 13:02   ` Tom Rini
  2020-10-16 15:40 ` [PATCH 5/5] configs: pumpkin: enable fastboot Fabien Parent
  2021-11-13 14:20 ` [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Simon Glass
  5 siblings, 1 reply; 13+ messages in thread
From: Fabien Parent @ 2020-10-16 15:40 UTC (permalink / raw)
  To: u-boot

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
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/5] configs: pumpkin: enable fastboot
  2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
                   ` (3 preceding siblings ...)
  2020-10-16 15:40 ` [PATCH 4/5] configs: pumpkin: enable USB gadget Fabien Parent
@ 2020-10-16 15:40 ` Fabien Parent
  2021-01-19 13:03   ` Tom Rini
  2021-11-13 14:20 ` [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Simon Glass
  5 siblings, 1 reply; 13+ messages in thread
From: Fabien Parent @ 2020-10-16 15:40 UTC (permalink / raw)
  To: u-boot

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
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 1/5] arm: dts: mt8516: add support for USB
  2020-10-16 15:40 ` [PATCH 1/5] arm: dts: mt8516: add support for USB Fabien Parent
@ 2021-01-19 13:02   ` Tom Rini
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Rini @ 2021-01-19 13:02 UTC (permalink / raw)
  To: u-boot

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!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/24fd1fe9/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/5] arm: dts: mt8516-pumpkin: enable usb port
  2020-10-16 15:40 ` [PATCH 2/5] arm: dts: mt8516-pumpkin: enable usb port Fabien Parent
@ 2021-01-19 13:02   ` Tom Rini
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Rini @ 2021-01-19 13:02 UTC (permalink / raw)
  To: u-boot

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!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/9a711b80/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/5] board: mediatek: pumpkin: initialize usb device
  2020-10-16 15:40 ` [PATCH 3/5] board: mediatek: pumpkin: initialize usb device Fabien Parent
@ 2021-01-19 13:02   ` Tom Rini
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Rini @ 2021-01-19 13:02 UTC (permalink / raw)
  To: u-boot

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!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/2699bc05/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/5] configs: pumpkin: enable USB gadget
  2020-10-16 15:40 ` [PATCH 4/5] configs: pumpkin: enable USB gadget Fabien Parent
@ 2021-01-19 13:02   ` Tom Rini
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Rini @ 2021-01-19 13:02 UTC (permalink / raw)
  To: u-boot

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!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/dbd4a856/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 5/5] configs: pumpkin: enable fastboot
  2020-10-16 15:40 ` [PATCH 5/5] configs: pumpkin: enable fastboot Fabien Parent
@ 2021-01-19 13:03   ` Tom Rini
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Rini @ 2021-01-19 13:03 UTC (permalink / raw)
  To: u-boot

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!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/7442a41a/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/5] board: mediatek: pumpkin: add fastboot support
  2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
                   ` (4 preceding siblings ...)
  2020-10-16 15:40 ` [PATCH 5/5] configs: pumpkin: enable fastboot Fabien Parent
@ 2021-11-13 14:20 ` Simon Glass
  2021-12-16 19:02   ` Fabien Parent
  5 siblings, 1 reply; 13+ messages in thread
From: Simon Glass @ 2021-11-13 14:20 UTC (permalink / raw)
  To: Fabien Parent; +Cc: u-boot, GSS_MTK_Uboot_upstream, weijie.gao, ryder.lee

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/5] board: mediatek: pumpkin: add fastboot support
  2021-11-13 14:20 ` [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Simon Glass
@ 2021-12-16 19:02   ` Fabien Parent
  0 siblings, 0 replies; 13+ messages in thread
From: Fabien Parent @ 2021-12-16 19:02 UTC (permalink / raw)
  To: Simon Glass
  Cc: u-boot, GSS_MTK_Uboot_upstream, Weijie Gao,
	Ryder Lee (李庚諺)

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-4263.html

> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-12-16 19:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 15:40 [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Fabien Parent
2020-10-16 15:40 ` [PATCH 1/5] arm: dts: mt8516: add support for USB Fabien Parent
2021-01-19 13:02   ` Tom Rini
2020-10-16 15:40 ` [PATCH 2/5] arm: dts: mt8516-pumpkin: enable usb port Fabien Parent
2021-01-19 13:02   ` Tom Rini
2020-10-16 15:40 ` [PATCH 3/5] board: mediatek: pumpkin: initialize usb device Fabien Parent
2021-01-19 13:02   ` Tom Rini
2020-10-16 15:40 ` [PATCH 4/5] configs: pumpkin: enable USB gadget Fabien Parent
2021-01-19 13:02   ` Tom Rini
2020-10-16 15:40 ` [PATCH 5/5] configs: pumpkin: enable fastboot Fabien Parent
2021-01-19 13:03   ` Tom Rini
2021-11-13 14:20 ` [PATCH 0/5] board: mediatek: pumpkin: add fastboot support Simon Glass
2021-12-16 19:02   ` Fabien Parent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).