From: Sascha Hauer <s.hauer@pengutronix.de>
To: Baruch Siach <baruch@tkos.co.il>
Cc: barebox@lists.infradead.org
Subject: Re: fsl-udc (USB gadget) anyone?
Date: Mon, 16 Aug 2010 09:09:04 +0200 [thread overview]
Message-ID: <20100816070904.GG27749@pengutronix.de> (raw)
In-Reply-To: <20100816063704.GB28343@jasper.tkos.co.il>
Hi Baruch,
On Mon, Aug 16, 2010 at 09:37:04AM +0300, Baruch Siach wrote:
> Hi Barebox list,
>
> I see that there are no in-tree fsl-udc driver users. Does anyone here have
> experience with this driver on an i.MX based system? What pre-probe()
> initialization does this driver require at the platform code?
We are using it on a custom i.MX25 board (which is not in mainline
because hardly anyone could make use of the code). Here is the platform
initialization code (mixed with ehci host support). It works fine in DFU
mode, serial support is probably not working. I have tried serial
support, but had problems integrating it properly in barebox.
+static void cm3389_usb_init(void)
+{
+ unsigned int tmp;
+
+ /* Host 2 */
+ tmp = readl(IMX_OTG_BASE + 0x600);
+ tmp &= ~(3 << 21);
+ tmp |= (2 << 21) | (1 << 4) | (1 << 5);
+ writel(tmp, IMX_OTG_BASE + 0x600);
+
+ tmp = readl(IMX_OTG_BASE + 0x584);
+ tmp |= 3 << 30;
+ writel(tmp, IMX_OTG_BASE + 0x584);
+
+ /* Set to Host mode */
+ tmp = readl(IMX_OTG_BASE + 0x1a8);
+ writel(tmp | 0x3, IMX_OTG_BASE + 0x1a8);
+}
+
+static struct device_d usbh2_dev = {
+ .name = "ehci",
+ .map_base = IMX_OTG_BASE + 0x400,
+ .size = 0x200,
+};
+
+static struct fsl_usb2_platform_data usb_pdata = {
+ .operating_mode = FSL_USB2_DR_DEVICE,
+ .phy_mode = FSL_USB2_PHY_UTMI,
+};
+
+static struct device_d usbotg_dev = {
+ .name = "fsl-udc",
+ .map_base = IMX_OTG_BASE,
+ .size = 0x200,
+ .platform_data = &usb_pdata,
+};
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-08-16 7:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 6:37 Baruch Siach
2010-08-16 7:09 ` Sascha Hauer [this message]
2010-08-16 7:58 ` Eric Bénard
2010-08-17 14:13 ` Baruch Siach
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=20100816070904.GG27749@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=baruch@tkos.co.il \
/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