summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjino.cho <jino.cho@samsung.com>2016-04-14 16:33:56 +0900
committerjino.cho <jino.cho@samsung.com>2016-04-14 16:40:04 +0900
commit270efaacd171ecf43c17b1e78cc4231462639e2b (patch)
treeb699d61118a8536bbd6fe780d7ffa0f8397475ab
parente13c186820e1bcdf7134f1d1f3b99b24bfb9d9e9 (diff)
downloadu-boot-artik-270efaacd171ecf43c17b1e78cc4231462639e2b.tar.gz
u-boot-artik-270efaacd171ecf43c17b1e78cc4231462639e2b.tar.bz2
u-boot-artik-270efaacd171ecf43c17b1e78cc4231462639e2b.zip
artik5: gadget: add usb initialization functions
This patch adds usb initialization functions for the artik5 board to support thor downloader. Change-Id: Ie0a96da2f8d2b852db4aadfae6c4c4f21b612a2b Signed-off-by: jino.cho <jino.cho@samsung.com>
-rw-r--r--board/samsung/espresso3250/espresso3250.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/board/samsung/espresso3250/espresso3250.c b/board/samsung/espresso3250/espresso3250.c
index 10e1d6467..f8a5b4d9c 100644
--- a/board/samsung/espresso3250/espresso3250.c
+++ b/board/samsung/espresso3250/espresso3250.c
@@ -32,6 +32,9 @@
#include <asm/arch/pinmux.h>
#include <asm/arch/sromc.h>
#include <asm/arch/sysreg.h>
+#include <asm/unaligned.h>
+#include <usb.h>
+#include <usb/s3c_udc.h>
#include <mmc.h>
#include "pmic.h"
@@ -604,6 +607,48 @@ int board_late_init(void)
return 0;
}
+#ifdef CONFIG_USB_GADGET
+static int s5p_phy_control(int on)
+{
+ return 0;
+}
+
+struct s3c_plat_otg_data s5p_otg_data = {
+ .phy_control = s5p_phy_control,
+ .regs_phy = EXYNOS4_USBPHY_BASE,
+ .regs_otg = EXYNOS4_USBOTG_BASE,
+ .usb_phy_ctrl = EXYNOS4_USBPHY_CONTROL,
+ .usb_flags = PHY0_SLEEP,
+};
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+ return s3c_udc_probe(&s5p_otg_data);
+}
+
+int board_usb_cleanup(int index, enum usb_init_type init)
+{
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_USBDOWNLOAD_GADGET
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+ if (!strcmp(name, "usb_dnl_thor")) {
+ put_unaligned(CONFIG_G_DNL_THOR_VENDOR_NUM, &dev->idVendor);
+ put_unaligned(CONFIG_G_DNL_THOR_PRODUCT_NUM, &dev->idProduct);
+ } else if (!strcmp(name, "usb_dnl_ums")) {
+ put_unaligned(CONFIG_G_DNL_UMS_VENDOR_NUM, &dev->idVendor);
+ put_unaligned(CONFIG_G_DNL_UMS_PRODUCT_NUM, &dev->idProduct);
+ } else {
+ put_unaligned(CONFIG_G_DNL_VENDOR_NUM, &dev->idVendor);
+ put_unaligned(CONFIG_G_DNL_PRODUCT_NUM, &dev->idProduct);
+ }
+ return 0;
+}
+#endif
+
#ifdef CONFIG_SET_DFU_ALT_INFO
char *get_dfu_alt_system(char *interface, char *devstr)
{