From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/8] i.MX35: Add USB control register access support
Date: Thu, 4 Feb 2010 17:26:29 +0100 [thread overview]
Message-ID: <20100204162629.GV6130@pengutronix.de> (raw)
In-Reply-To: <1265295825-8705-5-git-send-email-s.hauer@pengutronix.de>
On Thu, Feb 04, 2010 at 04:03:41PM +0100, Sascha Hauer wrote:
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Daniel Mack <daniel@caiaq.de>
> ---
> arch/arm/plat-mxc/ehci.c | 55 +++++++++++++++++++++++++++++
> arch/arm/plat-mxc/include/mach/mxc_ehci.h | 4 ++
> 2 files changed, 59 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c
> index 816a9cc..94b0036 100644
> --- a/arch/arm/plat-mxc/ehci.c
> +++ b/arch/arm/plat-mxc/ehci.c
> @@ -38,6 +38,18 @@
> #define MX31_H1_PM_BIT (1 << 8)
> #define MX31_H1_DT_BIT (1 << 4)
>
> +#define MX35_OTG_SIC_SHIFT 29
> +#define MX35_OTG_SIC_MASK (0x3 << MX35_OTG_SIC_SHIFT)
> +#define MX35_OTG_PM_BIT (1 << 24)
> +
> +#define MX35_H1_SIC_SHIFT 21
> +#define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT)
> +#define MX35_H1_PM_BIT (1 << 8)
> +#define MX35_OTG_IPPUE_UP_BIT (1 << 7)
> +#define MX35_OTG_IPPUE_DOWN_BIT (1 << 6)
> +#define MX35_H1_TLL_BIT (1 << 5)
> +#define MX35_OTG_USBTE_BIT (1 << 4)
> +
> int mxc_set_usbcontrol(int port, unsigned int flags)
> {
> unsigned int v;
> @@ -85,6 +97,49 @@ int mxc_set_usbcontrol(int port, unsigned int flags)
> USBCTRL_OTGBASE_OFFSET));
> return 0;
> }
> +
> + if (cpu_is_mx35()) {
> + v = readl(MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR +
> + USBCTRL_OTGBASE_OFFSET));
> +
> + switch (port) {
> + case 0: /* OTG port */
> + v &= ~(MX35_OTG_SIC_MASK | MX35_OTG_PM_BIT);
> + v |= (flags & MXC_EHCI_INTERFACE_MASK)
> + << MX35_OTG_SIC_SHIFT;
> + if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
> + v |= MX35_OTG_PM_BIT;
> +
> + break;
> + case 1: /* H1 port */
> + v &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT |
> + MX35_OTG_USBTE_BIT | MXC_EHCI_IPPUE_DOWN | MXC_EHCI_IPPUE_UP);
Gna, of course the MX35_OTG_USBTE_BIT / MX35_OTG_IPPUE_UP_BIT bits
should be cleared here, not the generic defines.
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 |
next prev parent reply other threads:[~2010-02-04 16:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 15:03 [PATCH] Add USB support for i.MX27/35 and Phytec i.MX boards Sascha Hauer
2010-02-04 15:03 ` [PATCH 1/8] fsl_mx3_udc: Add i.MX35 support Sascha Hauer
2010-02-04 15:03 ` [PATCH 2/8] i.MX ehci platform support: Some fixes Sascha Hauer
2010-02-04 15:03 ` [PATCH 3/8] i.MX27: Add USB control register access support Sascha Hauer
2010-02-04 15:03 ` [PATCH 4/8] i.MX35: " Sascha Hauer
2010-02-04 15:03 ` [PATCH 5/8] i.MX27 pca100: Add USB support Sascha Hauer
2010-02-04 15:03 ` [PATCH 6/8] i.MX27 pcm038: " Sascha Hauer
2010-02-04 15:03 ` [PATCH 7/8] i.MX31 pcm037: " Sascha Hauer
2010-02-04 15:03 ` [PATCH 8/8] i.MX27 pca100: " Sascha Hauer
2010-03-15 17:17 ` [PATCH 7/8] i.MX31 pcm037: " Alberto Panizzo
2010-02-04 16:02 ` [PATCH 4/8] i.MX35: Add USB control register access support Enrico Scholz
2010-02-04 16:22 ` Sascha Hauer
2010-02-04 16:26 ` Sascha Hauer [this message]
2010-03-12 9:56 ` [PATCH 1/8] fsl_mx3_udc: Add i.MX35 support Guennadi Liakhovetski
2010-02-04 18:34 ` [PATCH] Add USB support for i.MX27/35 and Phytec i.MX boards Baruch Siach
2010-02-04 20:29 ` 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=20100204162629.GV6130@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).