From fbe9a322c064745994d210e7e1e0040cb2afe15f Mon Sep 17 00:00:00 2001 From: Eric Bénard Date: Sun, 10 Feb 2013 17:22:50 +0100 Subject: mx23-evk: add USB gadget support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - enable the USB OTG device in gadget mode - tested on i.MX23 EVH rev B1 with DFU Signed-off-by: Eric Bénard Signed-off-by: Sascha Hauer --- arch/arm/boards/freescale-mx23-evk/mx23-evk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c index 043b62be27..76377b1a36 100644 --- a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c +++ b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include static struct mxs_mci_platform_data mci_pdata = { .caps = MMC_MODE_4BIT | MMC_MODE_HS | MMC_MODE_HS_52MHz, @@ -42,6 +44,13 @@ static const uint32_t pad_setup[] = { SSP1_DETECT | PULLUP(1), }; +#ifdef CONFIG_USB_GADGET_DRIVER_ARC +static struct fsl_usb2_platform_data usb_pdata = { + .operating_mode = FSL_USB2_DR_DEVICE, + .phy_mode = FSL_USB2_PHY_UTMI, +}; +#endif + static int mx23_evk_mem_init(void) { arm_add_mem_device("ram0", IMX_MEMORY_BASE, 32 * 1024 * 1024); @@ -111,6 +120,12 @@ static int mx23_evk_devices_init(void) printf("Cannot create the 'env0' persistant " "environment storage (%d)\n", rc); +#ifdef CONFIG_USB_GADGET_DRIVER_ARC + imx23_usb_phy_enable(); + add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, IMX_USB_BASE, NULL); + add_generic_device("fsl-udc", DEVICE_ID_DYNAMIC, NULL, IMX_USB_BASE, + 0x200, IORESOURCE_MEM, &usb_pdata); +#endif return 0; } -- cgit v1.2.3