From: jino.cho Date: Thu, 14 Apr 2016 07:33:56 +0000 (+0900) Subject: artik5: gadget: add usb initialization functions X-Git-Tag: submit/tizen/20160419.084959~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F65956%2F2;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik.git 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 --- 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 #include #include +#include +#include +#include #include #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) {