]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
implement Fastboot via USB OTG on bcm28155_ap boards
authorJiandong Zheng <jdzheng@broadcom.com>
Thu, 9 Jul 2015 21:26:40 +0000 (14:26 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:49:01 +0000 (13:49 +0200)
Signed-off-by: Jiandong Zheng <jdzheng@broadcom.com>
Signed-off-by: Steve Rae <srae@broadcom.com>
board/broadcom/bcm28155_ap/bcm28155_ap.c
drivers/usb/gadget/Makefile
include/configs/bcm28155_ap.h

index 940a1c2c5066578571700243368ccbf604e090b7..20eb19142a958622cb5718f7143e33b35e39ba00 100644 (file)
 #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
index 4e15323131c0ed1e0a113c983a881fd5cc0479b4..4c11a7e32677ab4d62aae367cd74f7aafa01b07b 100644 (file)
@@ -11,6 +11,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
 obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o
+obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o
 obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
index 8f0f7f03fc20740abf90dd6889623bab28542503..97e15086d5d1907806f2a1ba05ee387f190a6546 100644 (file)
  * for example.
  */
 #define CONFIG_DOS_PARTITION
+#define CONFIG_EFI_PARTITION
 
 /* version string, parser, etc */
 #define CONFIG_VERSION_VARIABLE
 #define CONFIG_FAT_WRITE
 
 
+/* Fastboot and USB OTG */
+#define CONFIG_USB_FUNCTION_FASTBOOT
+#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 - SZ_1M)
+#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_DOWNLOAD
+#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 */