mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] mx23-evk: add USB gadget support
Date: Sun, 10 Feb 2013 17:22:50 +0100	[thread overview]
Message-ID: <1360513371-16470-2-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1360513371-16470-1-git-send-email-eric@eukrea.com>

- enable the USB OTG device in gadget mode
- tested on i.MX23 EVH rev B1 with DFU

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 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 043b62b..76377b1 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 <mach/imx-regs.h>
 #include <mach/clock.h>
 #include <mach/mci.h>
+#include <usb/fsl_usb2.h>
+#include <mach/usb.h>
 
 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;
 }
 
-- 
1.7.11.7


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-02-10 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-10 16:22 [PATCH 1/3] mx23-evk: fix MCI support Eric Bénard
2013-02-10 16:22 ` Eric Bénard [this message]
2013-02-10 16:22 ` [PATCH 3/3] mx23-evk: update defconfig Eric Bénard
2013-02-11  9:31 ` [PATCH 1/3] mx23-evk: fix MCI support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360513371-16470-2-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox