All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board
@ 2018-12-18  9:52 Shawn Guo
  2018-12-18  9:52 ` [U-Boot] [PATCH 1/2] poplar: add DWC2 OTG gadget support Shawn Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Shawn Guo @ 2018-12-18  9:52 UTC (permalink / raw)
  To: u-boot

It enables DWC2 OTG gadget driver and fastboot support for Poplar
board.

Shawn Guo (2):
  poplar: add DWC2 OTG gadget support
  poplar_defconfig: enable fastboot support

 .../asm/arch-hi3798cv200/hi3798cv200.h        |  5 ++++
 board/hisilicon/poplar/poplar.c               | 28 +++++++++++++++++++
 configs/poplar_defconfig                      | 14 ++++++++++
 3 files changed, 47 insertions(+)

-- 
2.18.0

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

* [U-Boot] [PATCH 1/2] poplar: add DWC2 OTG gadget support
  2018-12-18  9:52 [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
@ 2018-12-18  9:52 ` Shawn Guo
  2019-01-16  2:40   ` [U-Boot] [U-Boot,1/2] " Tom Rini
  2018-12-18  9:52 ` [U-Boot] [PATCH 2/2] poplar_defconfig: enable fastboot support Shawn Guo
  2019-01-14  9:23 ` [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
  2 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2018-12-18  9:52 UTC (permalink / raw)
  To: u-boot

It enables DWC2 OTG gadget driver support for Poplar board.  As
usb2_phy_init() is being always called from board_init(), we can save
the call from board_usb_init().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 .../asm/arch-hi3798cv200/hi3798cv200.h        |  5 ++++
 board/hisilicon/poplar/poplar.c               | 28 +++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/arch/arm/include/asm/arch-hi3798cv200/hi3798cv200.h b/arch/arm/include/asm/arch-hi3798cv200/hi3798cv200.h
index f97b1eb29f84..bb221e17e0ed 100644
--- a/arch/arm/include/asm/arch-hi3798cv200/hi3798cv200.h
+++ b/arch/arm/include/asm/arch-hi3798cv200/hi3798cv200.h
@@ -13,11 +13,16 @@
 /* DEVICES */
 #define REG_BASE_MCI			0xF9830000
 #define REG_BASE_UART0			0xF8B00000
+#define HIOTG_BASE_ADDR			0xF98C0000
 
 /* PERI control registers (4KB) */
 	/* USB2 PHY01 configuration register */
 #define PERI_CTRL_USB0			(REG_BASE_PERI_CTRL + 0x120)
 
+	/* USB2 controller configuration register */
+#define PERI_CTRL_USB3			(REG_BASE_PERI_CTRL + 0x12c)
+#define USB2_2P_CHIPID			(1 << 28)
+
 /* PERI CRG registers (4KB) */
 	/* USB2 CTRL0 clock and soft reset */
 #define PERI_CRG46			(REG_BASE_CRG + 0xb8)
diff --git a/board/hisilicon/poplar/poplar.c b/board/hisilicon/poplar/poplar.c
index e1fbd5d0c669..af018ad2f8e4 100644
--- a/board/hisilicon/poplar/poplar.c
+++ b/board/hisilicon/poplar/poplar.c
@@ -168,6 +168,34 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
+#include <usb.h>
+#include <usb/dwc2_udc.h>
+#include <g_dnl.h>
+
+static struct dwc2_plat_otg_data poplar_otg_data = {
+	.regs_otg = HIOTG_BASE_ADDR
+};
+
+static void set_usb_to_device(void)
+{
+	setbits_le32(PERI_CTRL_USB3, USB2_2P_CHIPID);
+}
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+	set_usb_to_device();
+	return dwc2_udc_probe(&poplar_otg_data);
+}
+
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+	if (!env_get("serial#"))
+		g_dnl_set_serialnumber("0123456789POPLAR");
+	return 0;
+}
+#endif
+
 int board_init(void)
 {
 	usb2_phy_init();
-- 
2.18.0

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

* [U-Boot] [PATCH 2/2] poplar_defconfig: enable fastboot support
  2018-12-18  9:52 [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
  2018-12-18  9:52 ` [U-Boot] [PATCH 1/2] poplar: add DWC2 OTG gadget support Shawn Guo
@ 2018-12-18  9:52 ` Shawn Guo
  2019-01-16  2:40   ` [U-Boot] [U-Boot, " Tom Rini
  2019-01-14  9:23 ` [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
  2 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2018-12-18  9:52 UTC (permalink / raw)
  To: u-boot

It enables fastboot support on Poplar board by using DWC2 OTG gadget
driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 configs/poplar_defconfig | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/configs/poplar_defconfig b/configs/poplar_defconfig
index 946e7caf6bea..48e9c6eaac26 100644
--- a/configs/poplar_defconfig
+++ b/configs/poplar_defconfig
@@ -6,6 +6,13 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=2
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="poplar# "
+CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x20000000
+CONFIG_FASTBOOT_BUF_SIZE=0x10000000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 # CONFIG_ISO_PARTITION is not set
@@ -18,6 +25,13 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_GADGET_MANUFACTURER="HiSilicon"
+CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd00d
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_FAT_WRITE=y
-- 
2.18.0

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

* [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board
  2018-12-18  9:52 [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
  2018-12-18  9:52 ` [U-Boot] [PATCH 1/2] poplar: add DWC2 OTG gadget support Shawn Guo
  2018-12-18  9:52 ` [U-Boot] [PATCH 2/2] poplar_defconfig: enable fastboot support Shawn Guo
@ 2019-01-14  9:23 ` Shawn Guo
  2019-01-14 14:08   ` Tom Rini
  2 siblings, 1 reply; 7+ messages in thread
From: Shawn Guo @ 2019-01-14  9:23 UTC (permalink / raw)
  To: u-boot

On Tue, Dec 18, 2018 at 05:52:05PM +0800, Shawn Guo wrote:
> It enables DWC2 OTG gadget driver and fastboot support for Poplar
> board.
> 
> Shawn Guo (2):
>   poplar: add DWC2 OTG gadget support
>   poplar_defconfig: enable fastboot support

Hi Tom,

Are you okay with these two patches?

Shawn

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

* [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board
  2019-01-14  9:23 ` [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
@ 2019-01-14 14:08   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2019-01-14 14:08 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 14, 2019 at 05:23:22PM +0800, Shawn Guo wrote:

> On Tue, Dec 18, 2018 at 05:52:05PM +0800, Shawn Guo wrote:
> > It enables DWC2 OTG gadget driver and fastboot support for Poplar
> > board.
> > 
> > Shawn Guo (2):
> >   poplar: add DWC2 OTG gadget support
> >   poplar_defconfig: enable fastboot support
> 
> Hi Tom,
> 
> Are you okay with these two patches?

Yes, but I'll pick them up once the merge window opens again.

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

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

* [U-Boot] [U-Boot,1/2] poplar: add DWC2 OTG gadget support
  2018-12-18  9:52 ` [U-Boot] [PATCH 1/2] poplar: add DWC2 OTG gadget support Shawn Guo
@ 2019-01-16  2:40   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2019-01-16  2:40 UTC (permalink / raw)
  To: u-boot

On Tue, Dec 18, 2018 at 05:52:06PM +0800, Shawn Guo wrote:

> It enables DWC2 OTG gadget driver support for Poplar board.  As
> usb2_phy_init() is being always called from board_init(), we can save
> the call from board_usb_init().
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190115/6501cf8f/attachment.sig>

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

* [U-Boot] [U-Boot, 2/2] poplar_defconfig: enable fastboot support
  2018-12-18  9:52 ` [U-Boot] [PATCH 2/2] poplar_defconfig: enable fastboot support Shawn Guo
@ 2019-01-16  2:40   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2019-01-16  2:40 UTC (permalink / raw)
  To: u-boot

On Tue, Dec 18, 2018 at 05:52:07PM +0800, Shawn Guo wrote:

> It enables fastboot support on Poplar board by using DWC2 OTG gadget
> driver.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Applied to u-boot/master, thanks!

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

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

end of thread, other threads:[~2019-01-16  2:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18  9:52 [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
2018-12-18  9:52 ` [U-Boot] [PATCH 1/2] poplar: add DWC2 OTG gadget support Shawn Guo
2019-01-16  2:40   ` [U-Boot] [U-Boot,1/2] " Tom Rini
2018-12-18  9:52 ` [U-Boot] [PATCH 2/2] poplar_defconfig: enable fastboot support Shawn Guo
2019-01-16  2:40   ` [U-Boot] [U-Boot, " Tom Rini
2019-01-14  9:23 ` [U-Boot] [PATCH 0/2] Enable fastboot support for Poplar board Shawn Guo
2019-01-14 14:08   ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.