From: "Eric Bénard" <eric@eukrea.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] mx28-evk: enable USB
Date: Tue, 10 Sep 2013 19:57:56 +0200 [thread overview]
Message-ID: <1378835876-29402-3-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1378835876-29402-1-git-send-email-eric@eukrea.com>
- USB1 is host (tested with a mass storage)
- USB0 is device (quickly tested with DFU)
Signed-off-by: Eric Bénard <eric@eukrea.com>
---
arch/arm/boards/freescale-mx28-evk/mx28-evk.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/boards/freescale-mx28-evk/mx28-evk.c b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
index 92f0a75..fa631df 100644
--- a/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
+++ b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
@@ -32,6 +32,8 @@
#include <mach/iomux.h>
#include <mach/ocotp.h>
#include <mach/devices.h>
+#include <mach/usb.h>
+#include <usb/fsl_usb2.h>
#include <spi/spi.h>
#include <asm/armlinux.h>
@@ -135,6 +137,11 @@ static const uint32_t mx28evk_pads[] = {
SSP2_D3 | VE_3_3V | PULLUP(1) | STRENGTH(S8MA), /* SS0 !CS */
SSP2_CMD | VE_3_3V | PULLUP(1) | STRENGTH(S8MA), /* MOSI DIO */
SSP2_SCK | VE_3_3V | PULLUP(1) | STRENGTH(S8MA), /* CLK */
+
+ /* USB VBUS1 ENABLE - default to ON */
+ AUART2_RX_GPIO | VE_3_3V | PULLUP(0) | GPIO_OUT | GPIO_VALUE(1),
+ /* USB VBUS0 ENABLE - default to OFF */
+ AUART2_TX_GPIO | VE_3_3V | PULLUP(0) | GPIO_OUT | GPIO_VALUE(0),
};
static struct mxs_mci_platform_data mci_pdata = {
@@ -247,6 +254,12 @@ static const struct spi_board_info mx28evk_spi_board_info[] = {
}
};
+#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 mx28_evk_devices_init(void)
{
int i;
@@ -280,6 +293,14 @@ static int mx28_evk_devices_init(void)
add_generic_device("mxs_spi", 2, NULL, IMX_SSP2_BASE, 0x2000,
IORESOURCE_MEM, NULL);
+#ifdef CONFIG_USB_GADGET_DRIVER_ARC
+ imx28_usb_phy0_enable();
+ imx28_usb_phy1_enable();
+ add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, IMX_USB1_BASE, NULL);
+ add_generic_device("fsl-udc", DEVICE_ID_DYNAMIC, NULL, IMX_USB0_BASE,
+ 0x200, IORESOURCE_MEM, &usb_pdata);
+#endif
+
return 0;
}
device_initcall(mx28_evk_devices_init);
--
1.8.3.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-09-10 17:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-10 17:57 [PATCH 1/3] usb-imx28: fix enable Eric Bénard
2013-09-10 17:57 ` [PATCH 2/3] imx28-regs: i.MX28 has 2 USB controllers Eric Bénard
2013-09-10 17:57 ` Eric Bénard [this message]
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=1378835876-29402-3-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