This series implements fastboot on the "bcm28155_ap" boards.
Subsystems (4)
cover This series implements fastboot on the "bcm28155_ap" boards.
The OTG hardware is a DWC2 controller and this series uses the existing gadget driver ("s3c_udc_otg.c").
JD (Jiandong) Zheng and Steve Rae (2):
usb: gadget: bcm_udc_otg files
implement Fastboot via USB OTG on bcm28155_ap boards
Steve Rae (2):
g_dnl: add missing declaration
usb: s3c-otg: support 8-bit interface
arch/arm/include/asm/arch-bcm281xx/sysmap.h | 7 ++++ board/broadcom/bcm28155_ap/bcm28155_ap.c | 40 +++++++++++++++++++++++ drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/bcm_udc_otg.h | 17 ++++++++++ drivers/usb/gadget/bcm_udc_otg_phy.c | 50 +++++++++++++++++++++++++++++ drivers/usb/gadget/s3c_udc_otg.c | 4 +++ include/configs/bcm28155_ap.h | 20 ++++++++++++ include/g_dnl.h | 1 + 8 files changed, 140 insertions(+) create mode 100644 drivers/usb/gadget/bcm_udc_otg.h create mode 100644 drivers/usb/gadget/bcm_udc_otg_phy.c
Signature · 1 line
1.8.5
PATCH 1/4 g_dnl: add missing declaration
---
include/g_dnl.h | 1 + 1 file changed, 1 insertion(+)
include/g_dnl.h +1 -0
@@ -34,6 +34,7 @@ struct g_dnl_bind_callback { };int g_dnl_bind_fixup (struct usb_device_descriptor *,const char *); +int g_dnl_get_board_bcd_device_number (int gcnum);int g_dnl_board_usb_cable_connected (void );int g_dnl_register (const char *s);void g_dnl_unregister (void );
Signature · 1 line
1.8.5
PATCH 2/4 usb: s3c-otg: support 8-bit interface
In reply to Steve Rae---
drivers/usb/gadget/s3c_udc_otg.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/gadget/s3c_udc_otg.c +4 -0
@@ -414,7 +414,11 @@ static void reconfig_usbd(struct s3c_udc *dev) |0<<7 /* Ulpi DDR sel*/ |0 <<6 /* 0: high speed utmi+, 1: full speed serial*/ |0<<4 /* 0: utmi+, 1:ulpi*/ +#ifdef CONFIG_USB_GADGET_PHY_8_BIT + |0 <<3 /* phy i/f 0:8bit, 1:16bit*/ +#else |1 <<3 /* phy i/f 0:8bit, 1:16bit*/ +#endif |0x7 <<0 ;/* HS/FS Timeout**/ if (dev->pdata->usb_gusbcfg)
Signature · 1 line
1.8.5
PATCH 3/4 usb: gadget: bcm_udc_otg files
In reply to Steve RaeFrom: "JD (Jiandong) Zheng" <[email protected]>
Add the required files for the Broadcom UDC OTG interface.
---
arch/arm/include/asm/arch-bcm281xx/sysmap.h | 7 ++++ drivers/usb/gadget/bcm_udc_otg.h | 17 ++++++++++ drivers/usb/gadget/bcm_udc_otg_phy.c | 50 +++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 drivers/usb/gadget/bcm_udc_otg.h create mode 100644 drivers/usb/gadget/bcm_udc_otg_phy.c
arch/arm/include/asm/arch-bcm281xx/sysmap.h +7 -0
@@ -27,4 +27,11 @@#define SECWD2_BASE_ADDR 0x35002f40#define TIMER_BASE_ADDR 0x3e00d000 +#define HSOTG_DCTL_OFFSET 0x00000804 +#define HSOTG_DCTL_SFTDISCON_MASK 0x00000002 + +#define HSOTG_CTRL_PHY_P1CTL_OFFSET 0x00000008 +#define HSOTG_CTRL_PHY_P1CTL_SOFT_RESET_MASK 0x00000002 +#define HSOTG_CTRL_PHY_P1CTL_NON_DRIVING_MASK 0x00000001 +#endif
drivers/usb/gadget/bcm_udc_otg.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +* Copyright 2015 Broadcom Corporation. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __BCM_UDC_OTG_H +#define __BCM_UDC_OTG_H + +#include <linux/types.h> + +#define wfld_set (addr, fld_val, fld_mask) \ + (writel(((readl(addr) & ~(fld_mask)) | (fld_val)), (addr))) +#define wfld_clear (addr, fld_mask) \ + (writel((readl(addr) & ~(fld_mask)), (addr))) + +#endif
drivers/usb/gadget/bcm_udc_otg_phy.c new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
1.8.5
PATCH 4/4 implement Fastboot via USB OTG on bcm28155_ap boards
In reply to Steve RaeFrom: "JD (Jiandong) Zheng" <[email protected]>
---
board/broadcom/bcm28155_ap/bcm28155_ap.c | 40 ++++++++++++++++++++++++++++++++ drivers/usb/gadget/Makefile | 1 + include/configs/bcm28155_ap.h | 20 ++++++++++++++++ 3 files changed, 61 insertions(+)
board/broadcom/bcm28155_ap/bcm28155_ap.c +40 -0
@@ -12,12 +12,20 @@#include <asm/kona-common/clk.h> #include <asm/arch/sysmap.h> +#include <usb.h> +#include <usb/s3c_udc.h> +#include <g_dnl.h> +#define SECWATCHDOG_SDOGCR_OFFSET 0x00000000#define SECWATCHDOG_SDOGCR_EN_SHIFT 27#define SECWATCHDOG_SDOGCR_SRSTEN_SHIFT 26#define SECWATCHDOG_SDOGCR_CLKS_SHIFT 20#define SECWATCHDOG_SDOGCR_LD_SHIFT 0 +#ifndef CONFIG_USB_SERIALNO +#define CONFIG_USB_SERIALNO "1234567890" +#endif +DECLARE_GLOBAL_DATA_PTR ;/*
@@ -85,3 +93,35 @@ int board_mmc_init(bd_t *bis)return ret; }#endif + +#ifdef CONFIG_USB_GADGET +static struct s3c_plat_otg_data bcm_otg_data = { + .regs_otg =HSOTG_BASE_ADDR +}; + +int board_usb_init (int index,enum usb_init_type init) +{ +debug ("%s: performing s3c_udc_probe\n" , __func__); +return s3c_udc_probe (&bcm_otg_data); +} + +int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name) +{ +debug ("%s\n" , __func__); +if (!getenv ("serial#" )) +g_dnl_set_serialnumber (CONFIG_USB_SERIALNO ); +return 0 ; +} + +int g_dnl_get_board_bcd_device_number (int gcnum) +{ +debug ("%s\n" , __func__); +return 1 ; +} + +int board_usb_cleanup (int index,enum usb_init_type init) +{ +debug ("%s\n" , __func__); +return 0 ; +} +#endif
drivers/usb/gadget/Makefile +1 -0
@@ -20,6 +20,7 @@ obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o +obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o endif ifdef CONFIG_USB_ETHER obj-y += ether.o
include/configs/bcm28155_ap.h +20 -0
@@ -109,6 +109,7 @@* for example. */ #define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION /* version string, parser, etc */ #define CONFIG_VERSION_VARIABLE
@@ -136,4 +137,23 @@#undef CONFIG_CMD_NFS +/* Fastboot and USB OTG */ +#define CONFIG_CMD_FASTBOOT +#define CONFIG_FASTBOOT_FLASH +#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0 +#define CONFIG_SYS_CACHELINE_SIZE 64 +#define CONFIG_USB_FASTBOOT_BUF_SIZE (CONFIG_SYS_SDRAM_SIZE - (1024 * 1024)) +#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_SDRAM_BASE +#define CONFIG_USB_GADGET +#define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 0 +#define CONFIG_USB_GADGET_S3C_UDC_OTG +#define CONFIG_USB_GADGET_BCM_UDC_OTG_PHY +#define CONFIG_USB_GADGET_PHY_8_BIT +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_USBID_ADDR 0x34052c46 +#define CONFIG_G_DNL_VENDOR_NUM 0x18d1/* google */ +#define CONFIG_G_DNL_PRODUCT_NUM 0x0d02/* nexus one */ +#define CONFIG_G_DNL_MANUFACTURER "Broadcom Corporation" +#endif /* __BCM28155_AP_H */
Signature · 1 line
1.8.5
PATCH 4/4 implement Fastboot via USB OTG on bcm28155_ap boards
Hi,
Le lundi 06 juillet 2015 ? 09:52 -0700, Steve Rae a ?crit :
Quoted 103 lines
From: "JD (Jiandong) Zheng" <[email protected]>
Signed-off-by Steve Rae <[email protected]>---
board/broadcom/bcm28155_ap/bcm28155_ap.c | 40 ++++++++++++++++++++++++++++++++ drivers/usb/gadget/Makefile | 1 + include/configs/bcm28155_ap.h | 20 ++++++++++++++++ 3 files changed, 61 insertions(+)board/broadcom/bcm28155_ap/bcm28155_ap.c +40
-0@@ -12,12 +12,20 @@#include <asm/kona-common/clk.h> #include <asm/arch/sysmap.h> +#include <usb.h> +#include <usb/s3c_udc.h> +#include <g_dnl.h> +#define SECWATCHDOG_SDOGCR_OFFSET 0x00000000#define SECWATCHDOG_SDOGCR_EN_SHIFT 27#define SECWATCHDOG_SDOGCR_SRSTEN_SHIFT 26#define SECWATCHDOG_SDOGCR_CLKS_SHIFT 20#define SECWATCHDOG_SDOGCR_LD_SHIFT 0 +#ifndef CONFIG_USB_SERIALNO +#define CONFIG_USB_SERIALNO "1234567890" +#endif +DECLARE_GLOBAL_DATA_PTR ;/* @@ -85,3 +93,35 @@ int board_mmc_init(bd_t *bis)return ret; }#endif + +#ifdef CONFIG_USB_GADGET +static struct s3c_plat_otg_data bcm_otg_data = { + .regs_otg =HSOTG_BASE_ADDR +}; + +int board_usb_init (int index,enum usb_init_type init) +{ +debug ("%s: performing s3c_udc_probe\n" , __func__); +return s3c_udc_probe (&bcm_otg_data); +} + +int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name) +{ +debug ("%s\n" , __func__); +if (!getenv ("serial#" )) +g_dnl_set_serialnumber (CONFIG_USB_SERIALNO ); +return 0 ; +} + +int g_dnl_get_board_bcd_device_number (int gcnum) +{ +debug ("%s\n" , __func__); +return 1 ; +} + +int board_usb_cleanup (int index,enum usb_init_type init) +{ +debug ("%s\n" , __func__); +return 0 ; +} +#endif drivers/usb/gadget/Makefile +1
-0@@ -20,6 +20,7 @@ obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o +obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o endif ifdef CONFIG_USB_ETHER obj-y += ether.oinclude/configs/bcm28155_ap.h +5
-0@@ -109,6 +109,7 @@* for example. */ #define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION /* version string, parser, etc */ #define CONFIG_VERSION_VARIABLE @@ -136,4 +137,23 @@#undef CONFIG_CMD_NFS +/* Fastboot and USB OTG */ +#define CONFIG_CMD_FASTBOOT +#define CONFIG_FASTBOOT_FLASH +#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0
include/configs/bcm28155_ap.h line 153
Quoted 10 lines
include/configs/bcm28155_ap.h +10
-0+#define CONFIG_SYS_CACHELINE_SIZE 64 +#define CONFIG_USB_FASTBOOT_BUF_SIZE (CONFIG_SYS_SDRAM_SIZE - (1024 * 1024)) +#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_SDRAM_BASE +#define CONFIG_USB_GADGET +#define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 0 +#define CONFIG_USB_GADGET_S3C_UDC_OTG +#define CONFIG_USB_GADGET_BCM_UDC_OTG_PHY +#define CONFIG_USB_GADGET_PHY_8_BIT +#define CONFIG_USBDOWNLOAD_GADGET
You should probably rebase this against u-boot-dfu's latest HEAD, and adapt for the renames I made (for consistency)!
include/configs/bcm28155_ap.h line 159
Quoted 6 lines
include/configs/bcm28155_ap.h +5
-0+#define CONFIG_USBID_ADDR 0x34052c46 +#define CONFIG_G_DNL_VENDOR_NUM 0x18d1/* google */ +#define CONFIG_G_DNL_PRODUCT_NUM 0x0d02/* nexus one */ +#define CONFIG_G_DNL_MANUFACTURER "Broadcom Corporation" +#endif /* __BCM28155_AP_H */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150706/8eade7bd/attachment.sig>
PATCH 4/4 implement Fastboot via USB OTG on bcm28155_ap boards
Quoted 111 lines · Paul Kocialkowski
Hi,
Le lundi 06 juillet 2015 ? 09:52 -0700, Steve Rae a ?crit :
Quoted 108 lines
From: "JD (Jiandong) Zheng" <[email protected]>
Signed-off-by Steve Rae <[email protected]>---
board/broadcom/bcm28155_ap/bcm28155_ap.c | 40 ++++++++++++++++++++++++++++++++ drivers/usb/gadget/Makefile | 1 + include/configs/bcm28155_ap.h | 20 ++++++++++++++++ 3 files changed, 61 insertions(+)board/broadcom/bcm28155_ap/bcm28155_ap.c +40
-0@@ -12,12 +12,20 @@#include <asm/kona-common/clk.h> #include <asm/arch/sysmap.h> +#include <usb.h> +#include <usb/s3c_udc.h> +#include <g_dnl.h> +#define SECWATCHDOG_SDOGCR_OFFSET 0x00000000#define SECWATCHDOG_SDOGCR_EN_SHIFT 27#define SECWATCHDOG_SDOGCR_SRSTEN_SHIFT 26#define SECWATCHDOG_SDOGCR_CLKS_SHIFT 20#define SECWATCHDOG_SDOGCR_LD_SHIFT 0 +#ifndef CONFIG_USB_SERIALNO +#define CONFIG_USB_SERIALNO "1234567890" +#endif +DECLARE_GLOBAL_DATA_PTR ;/* @@ -85,3 +93,35 @@ int board_mmc_init(bd_t *bis)return ret; }#endif + +#ifdef CONFIG_USB_GADGET +static struct s3c_plat_otg_data bcm_otg_data = { + .regs_otg =HSOTG_BASE_ADDR +}; + +int board_usb_init (int index,enum usb_init_type init) +{ +debug ("%s: performing s3c_udc_probe\n" , __func__); +return s3c_udc_probe (&bcm_otg_data); +} + +int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name) +{ +debug ("%s\n" , __func__); +if (!getenv ("serial#" )) +g_dnl_set_serialnumber (CONFIG_USB_SERIALNO ); +return 0 ; +} + +int g_dnl_get_board_bcd_device_number (int gcnum) +{ +debug ("%s\n" , __func__); +return 1 ; +} + +int board_usb_cleanup (int index,enum usb_init_type init) +{ +debug ("%s\n" , __func__); +return 0 ; +} +#endif drivers/usb/gadget/Makefile +1
-0@@ -20,6 +20,7 @@ obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o +obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o endif ifdef CONFIG_USB_ETHER obj-y += ether.oinclude/configs/bcm28155_ap.h +10
-0@@ -109,6 +109,7 @@* for example. */ #define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION /* version string, parser, etc */ #define CONFIG_VERSION_VARIABLE @@ -136,4 +137,23 @@#undef CONFIG_CMD_NFS +/* Fastboot and USB OTG */ +#define CONFIG_CMD_FASTBOOT +#define CONFIG_FASTBOOT_FLASH +#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0 +#define CONFIG_SYS_CACHELINE_SIZE 64 +#define CONFIG_USB_FASTBOOT_BUF_SIZE (CONFIG_SYS_SDRAM_SIZE - (1024 * 1024)) +#define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_SDRAM_BASE +#define CONFIG_USB_GADGET +#define CONFIG_USB_GADGET_DUALSPEED
Quoted 8 lines
include/configs/bcm28155_ap.h line 153
Quoted 5 lines
include/configs/bcm28155_ap.h +5
-0+#define CONFIG_USB_GADGET_VBUS_DRAW 0 +#define CONFIG_USB_GADGET_S3C_UDC_OTG +#define CONFIG_USB_GADGET_BCM_UDC_OTG_PHY +#define CONFIG_USB_GADGET_PHY_8_BIT +#define CONFIG_USBDOWNLOAD_GADGET You should probably rebase this against u-boot-dfu's latest HEAD, and adapt for the renames I made (for consistency)!
OK -- see v2
Quoted 8 lines
Quoted 7 lines
include/configs/bcm28155_ap.h +5
-0+#define CONFIG_USBID_ADDR 0x34052c46 +#define CONFIG_G_DNL_VENDOR_NUM 0x18d1/* google */ +#define CONFIG_G_DNL_PRODUCT_NUM 0x0d02/* nexus one */ +#define CONFIG_G_DNL_MANUFACTURER "Broadcom Corporation" +#endif /* __BCM28155_AP_H */