aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2017-10-22 10:22:40 +0200
committerStefano Babic <sbabic@denx.de>2017-10-31 11:11:10 +0100
commit506abdb4ee9664cc0d6d1321e96f7fb8dae72eb9 (patch)
tree30d3cd3c99be7d37b7282f62d4c3a8852cf226c8
parent27dc324a10de431a58e87abb84b18efea7eb734e (diff)
downloadu-boot-506abdb4ee9664cc0d6d1321e96f7fb8dae72eb9.zip
u-boot-506abdb4ee9664cc0d6d1321e96f7fb8dae72eb9.tar.gz
u-boot-506abdb4ee9664cc0d6d1321e96f7fb8dae72eb9.tar.bz2
ARM: imx6: Enable UMS and DFU on DHCOM i.MX6 PDK
Enable UMS and DFU, so that the eMMC can be accessed via the USB gadget port on the board. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de>
-rw-r--r--board/dhelectronics/dh_imx6/dh_imx6.c10
-rw-r--r--configs/dh_imx6_defconfig8
-rw-r--r--include/configs/dh_imx6.h12
3 files changed, 22 insertions, 8 deletions
diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c b/board/dhelectronics/dh_imx6/dh_imx6.c
index c76da4d..b00d0e4 100644
--- a/board/dhelectronics/dh_imx6/dh_imx6.c
+++ b/board/dhelectronics/dh_imx6/dh_imx6.c
@@ -253,16 +253,10 @@ static void setup_usb(void)
int board_usb_phy_mode(int port)
{
- return USB_INIT_HOST;
-}
-
-/* Use only Port 1 == DHCOM USB Host 1 */
-int board_ehci_hcd_init(int port)
-{
if (port == 1)
- return 0;
+ return USB_INIT_HOST;
else
- return -ENODEV;
+ return USB_INIT_DEVICE;
}
int board_ehci_power(int port, int on)
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
index 5d9eda8..175f9fa 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -19,6 +19,7 @@ CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_UNZIP=y
+CONFIG_CMD_DFU=y
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
@@ -27,6 +28,7 @@ CONFIG_CMD_PART=y
CONFIG_CMD_SATA=y
CONFIG_CMD_SF=y
CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
@@ -47,4 +49,10 @@ CONFIG_NETDEVICES=y
CONFIG_FEC_MXC=y
CONFIG_USB=y
CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="dh"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_OF_LIBFDT=y
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index 0595f60..11a01d4 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -115,6 +115,18 @@
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
+
+/* USB Gadget (DFU, UMS) */
+#if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
+#define CONFIG_USB_FUNCTION_MASS_STORAGE
+
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE (16 * 1024 * 1024)
+#define DFU_DEFAULT_POLL_TIMEOUT 300
+
+/* USB IDs */
+#define CONFIG_G_DNL_UMS_VENDOR_NUM 0x0525
+#define CONFIG_G_DNL_UMS_PRODUCT_NUM 0xA4A5
+#endif
#endif
/* Watchdog */