diff options
author | Eric Bénard <eric@eukrea.com> | 2010-06-08 05:02:56 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-07-26 08:18:08 -0400 |
commit | 648beaf5bd7072031bddd84bf7bb482ec459a603 (patch) | |
tree | 80c434e806cc3d341cc5ade3669b418b7f83e9fd /arch/arm/plat-mxc/ehci.c | |
parent | 5a36c399234d511a347b2be4382c7a55f28c18ba (diff) |
plat-mxc/ehci.c: add i.MX25 support
i.MX25's OTG has the same USBCTRL registers than i.MX35 so reuse
most of the i.MX35's defines.
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/ehci.c')
-rw-r--r-- | arch/arm/plat-mxc/ehci.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c index 2a8646173c2f..618479258bb6 100644 --- a/arch/arm/plat-mxc/ehci.c +++ b/arch/arm/plat-mxc/ehci.c | |||
@@ -73,7 +73,51 @@ | |||
73 | int mxc_initialize_usb_hw(int port, unsigned int flags) | 73 | int mxc_initialize_usb_hw(int port, unsigned int flags) |
74 | { | 74 | { |
75 | unsigned int v; | 75 | unsigned int v; |
76 | #ifdef CONFIG_ARCH_MX3 | 76 | #if defined(CONFIG_ARCH_MX25) |
77 | if (cpu_is_mx25()) { | ||
78 | v = readl(MX25_IO_ADDRESS(MX25_OTG_BASE_ADDR + | ||
79 | USBCTRL_OTGBASE_OFFSET)); | ||
80 | |||
81 | switch (port) { | ||
82 | case 0: /* OTG port */ | ||
83 | v &= ~(MX35_OTG_SIC_MASK | MX35_OTG_PM_BIT); | ||
84 | v |= (flags & MXC_EHCI_INTERFACE_MASK) | ||
85 | << MX35_OTG_SIC_SHIFT; | ||
86 | if (!(flags & MXC_EHCI_POWER_PINS_ENABLED)) | ||
87 | v |= MX35_OTG_PM_BIT; | ||
88 | |||
89 | break; | ||
90 | case 1: /* H1 port */ | ||
91 | v &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT | | ||
92 | MX35_H1_USBTE_BIT | MX35_H1_IPPUE_DOWN_BIT | MX35_H1_IPPUE_UP_BIT); | ||
93 | v |= (flags & MXC_EHCI_INTERFACE_MASK) | ||
94 | << MX35_H1_SIC_SHIFT; | ||
95 | if (!(flags & MXC_EHCI_POWER_PINS_ENABLED)) | ||
96 | v |= MX35_H1_PM_BIT; | ||
97 | |||
98 | if (!(flags & MXC_EHCI_TTL_ENABLED)) | ||
99 | v |= MX35_H1_TLL_BIT; | ||
100 | |||
101 | if (flags & MXC_EHCI_INTERNAL_PHY) | ||
102 | v |= MX35_H1_USBTE_BIT; | ||
103 | |||
104 | if (flags & MXC_EHCI_IPPUE_DOWN) | ||
105 | v |= MX35_H1_IPPUE_DOWN_BIT; | ||
106 | |||
107 | if (flags & MXC_EHCI_IPPUE_UP) | ||
108 | v |= MX35_H1_IPPUE_UP_BIT; | ||
109 | |||
110 | break; | ||
111 | default: | ||
112 | return -EINVAL; | ||
113 | } | ||
114 | |||
115 | writel(v, MX25_IO_ADDRESS(MX25_OTG_BASE_ADDR + | ||
116 | USBCTRL_OTGBASE_OFFSET)); | ||
117 | return 0; | ||
118 | } | ||
119 | #endif /* CONFIG_ARCH_MX25 */ | ||
120 | #if defined(CONFIG_ARCH_MX3) | ||
77 | if (cpu_is_mx31()) { | 121 | if (cpu_is_mx31()) { |
78 | v = readl(MX31_IO_ADDRESS(MX31_OTG_BASE_ADDR + | 122 | v = readl(MX31_IO_ADDRESS(MX31_OTG_BASE_ADDR + |
79 | USBCTRL_OTGBASE_OFFSET)); | 123 | USBCTRL_OTGBASE_OFFSET)); |