diff options
author | Neil Zhang <zhangwm@marvell.com> | 2012-05-03 02:19:13 -0400 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@gmail.com> | 2012-05-03 03:05:10 -0400 |
commit | 75b1bdf51c4b5c383296de2df9ad83b1b8dd287f (patch) | |
tree | 9f5c8d852438ac07ddda81696cfa4842a84265bb /arch/arm/mach-mmp | |
parent | 1334d86b55d2ec1b50fdcb440c2642ae7a4620ba (diff) |
ARM: mmp: add usb device support for PXA910
Add usb device support for Marvell PXA910.
Actually PXA920 will use the same device.
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r-- | arch/arm/mach-mmp/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-mmp/devices.c | 282 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/devices.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/pxa910.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/regs-usb.h | 253 | ||||
-rw-r--r-- | arch/arm/mach-mmp/pxa910.c | 2 |
6 files changed, 549 insertions, 1 deletions
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig index 5a90b9a3ab6e..fa03974fd838 100644 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig | |||
@@ -113,4 +113,11 @@ config CPU_MMP2 | |||
113 | select CPU_PJ4 | 113 | select CPU_PJ4 |
114 | help | 114 | help |
115 | Select code specific to MMP2. MMP2 is ARMv7 compatible. | 115 | Select code specific to MMP2. MMP2 is ARMv7 compatible. |
116 | |||
117 | config USB_EHCI_MV_U2O | ||
118 | bool "EHCI support for PXA USB OTG controller" | ||
119 | depends on USB_EHCI_MV | ||
120 | help | ||
121 | Enables support for OTG controller which can be switched to host mode. | ||
122 | |||
116 | endif | 123 | endif |
diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c index 191d9dea8731..262179f45109 100644 --- a/arch/arm/mach-mmp/devices.c +++ b/arch/arm/mach-mmp/devices.c | |||
@@ -9,9 +9,13 @@ | |||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
11 | #include <linux/dma-mapping.h> | 11 | #include <linux/dma-mapping.h> |
12 | #include <linux/delay.h> | ||
12 | 13 | ||
13 | #include <asm/irq.h> | 14 | #include <asm/irq.h> |
15 | #include <mach/irqs.h> | ||
14 | #include <mach/devices.h> | 16 | #include <mach/devices.h> |
17 | #include <mach/cputype.h> | ||
18 | #include <mach/regs-usb.h> | ||
15 | 19 | ||
16 | int __init pxa_register_device(struct pxa_device_desc *desc, | 20 | int __init pxa_register_device(struct pxa_device_desc *desc, |
17 | void *data, size_t size) | 21 | void *data, size_t size) |
@@ -67,3 +71,281 @@ int __init pxa_register_device(struct pxa_device_desc *desc, | |||
67 | 71 | ||
68 | return platform_device_add(pdev); | 72 | return platform_device_add(pdev); |
69 | } | 73 | } |
74 | |||
75 | #if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET) | ||
76 | |||
77 | /***************************************************************************** | ||
78 | * The registers read/write routines | ||
79 | *****************************************************************************/ | ||
80 | |||
81 | static unsigned int u2o_get(void __iomem *base, unsigned int offset) | ||
82 | { | ||
83 | return readl_relaxed(base + offset); | ||
84 | } | ||
85 | |||
86 | static void u2o_set(void __iomem *base, unsigned int offset, | ||
87 | unsigned int value) | ||
88 | { | ||
89 | u32 reg; | ||
90 | |||
91 | reg = readl_relaxed(base + offset); | ||
92 | reg |= value; | ||
93 | writel_relaxed(reg, base + offset); | ||
94 | readl_relaxed(base + offset); | ||
95 | } | ||
96 | |||
97 | static void u2o_clear(void __iomem *base, unsigned int offset, | ||
98 | unsigned int value) | ||
99 | { | ||
100 | u32 reg; | ||
101 | |||
102 | reg = readl_relaxed(base + offset); | ||
103 | reg &= ~value; | ||
104 | writel_relaxed(reg, base + offset); | ||
105 | readl_relaxed(base + offset); | ||
106 | } | ||
107 | |||
108 | static void u2o_write(void __iomem *base, unsigned int offset, | ||
109 | unsigned int value) | ||
110 | { | ||
111 | writel_relaxed(value, base + offset); | ||
112 | readl_relaxed(base + offset); | ||
113 | } | ||
114 | |||
115 | #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV) | ||
116 | |||
117 | #if defined(CONFIG_CPU_PXA910) | ||
118 | |||
119 | static DEFINE_MUTEX(phy_lock); | ||
120 | static int phy_init_cnt; | ||
121 | |||
122 | static int usb_phy_init_internal(void __iomem *base) | ||
123 | { | ||
124 | int loops; | ||
125 | |||
126 | pr_info("Init usb phy!!!\n"); | ||
127 | |||
128 | /* Initialize the USB PHY power */ | ||
129 | if (cpu_is_pxa910()) { | ||
130 | u2o_set(base, UTMI_CTRL, (1<<UTMI_CTRL_INPKT_DELAY_SOF_SHIFT) | ||
131 | | (1<<UTMI_CTRL_PU_REF_SHIFT)); | ||
132 | } | ||
133 | |||
134 | u2o_set(base, UTMI_CTRL, 1<<UTMI_CTRL_PLL_PWR_UP_SHIFT); | ||
135 | u2o_set(base, UTMI_CTRL, 1<<UTMI_CTRL_PWR_UP_SHIFT); | ||
136 | |||
137 | /* UTMI_PLL settings */ | ||
138 | u2o_clear(base, UTMI_PLL, UTMI_PLL_PLLVDD18_MASK | ||
139 | | UTMI_PLL_PLLVDD12_MASK | UTMI_PLL_PLLCALI12_MASK | ||
140 | | UTMI_PLL_FBDIV_MASK | UTMI_PLL_REFDIV_MASK | ||
141 | | UTMI_PLL_ICP_MASK | UTMI_PLL_KVCO_MASK); | ||
142 | |||
143 | u2o_set(base, UTMI_PLL, 0xee<<UTMI_PLL_FBDIV_SHIFT | ||
144 | | 0xb<<UTMI_PLL_REFDIV_SHIFT | 3<<UTMI_PLL_PLLVDD18_SHIFT | ||
145 | | 3<<UTMI_PLL_PLLVDD12_SHIFT | 3<<UTMI_PLL_PLLCALI12_SHIFT | ||
146 | | 1<<UTMI_PLL_ICP_SHIFT | 3<<UTMI_PLL_KVCO_SHIFT); | ||
147 | |||
148 | /* UTMI_TX */ | ||
149 | u2o_clear(base, UTMI_TX, UTMI_TX_REG_EXT_FS_RCAL_EN_MASK | ||
150 | | UTMI_TX_TXVDD12_MASK | UTMI_TX_CK60_PHSEL_MASK | ||
151 | | UTMI_TX_IMPCAL_VTH_MASK | UTMI_TX_REG_EXT_FS_RCAL_MASK | ||
152 | | UTMI_TX_AMP_MASK); | ||
153 | u2o_set(base, UTMI_TX, 3<<UTMI_TX_TXVDD12_SHIFT | ||
154 | | 4<<UTMI_TX_CK60_PHSEL_SHIFT | 4<<UTMI_TX_IMPCAL_VTH_SHIFT | ||
155 | | 8<<UTMI_TX_REG_EXT_FS_RCAL_SHIFT | 3<<UTMI_TX_AMP_SHIFT); | ||
156 | |||
157 | /* UTMI_RX */ | ||
158 | u2o_clear(base, UTMI_RX, UTMI_RX_SQ_THRESH_MASK | ||
159 | | UTMI_REG_SQ_LENGTH_MASK); | ||
160 | u2o_set(base, UTMI_RX, 7<<UTMI_RX_SQ_THRESH_SHIFT | ||
161 | | 2<<UTMI_REG_SQ_LENGTH_SHIFT); | ||
162 | |||
163 | /* UTMI_IVREF */ | ||
164 | if (cpu_is_pxa168()) | ||
165 | /* fixing Microsoft Altair board interface with NEC hub issue - | ||
166 | * Set UTMI_IVREF from 0x4a3 to 0x4bf */ | ||
167 | u2o_write(base, UTMI_IVREF, 0x4bf); | ||
168 | |||
169 | /* toggle VCOCAL_START bit of UTMI_PLL */ | ||
170 | udelay(200); | ||
171 | u2o_set(base, UTMI_PLL, VCOCAL_START); | ||
172 | udelay(40); | ||
173 | u2o_clear(base, UTMI_PLL, VCOCAL_START); | ||
174 | |||
175 | /* toggle REG_RCAL_START bit of UTMI_TX */ | ||
176 | udelay(400); | ||
177 | u2o_set(base, UTMI_TX, REG_RCAL_START); | ||
178 | udelay(40); | ||
179 | u2o_clear(base, UTMI_TX, REG_RCAL_START); | ||
180 | udelay(400); | ||
181 | |||
182 | /* Make sure PHY PLL is ready */ | ||
183 | loops = 0; | ||
184 | while ((u2o_get(base, UTMI_PLL) & PLL_READY) == 0) { | ||
185 | mdelay(1); | ||
186 | loops++; | ||
187 | if (loops > 100) { | ||
188 | printk(KERN_WARNING "calibrate timeout, UTMI_PLL %x\n", | ||
189 | u2o_get(base, UTMI_PLL)); | ||
190 | break; | ||
191 | } | ||
192 | } | ||
193 | |||
194 | if (cpu_is_pxa168()) { | ||
195 | u2o_set(base, UTMI_RESERVE, 1 << 5); | ||
196 | /* Turn on UTMI PHY OTG extension */ | ||
197 | u2o_write(base, UTMI_OTG_ADDON, 1); | ||
198 | } | ||
199 | |||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static int usb_phy_deinit_internal(void __iomem *base) | ||
204 | { | ||
205 | pr_info("Deinit usb phy!!!\n"); | ||
206 | |||
207 | if (cpu_is_pxa168()) | ||
208 | u2o_clear(base, UTMI_OTG_ADDON, UTMI_OTG_ADDON_OTG_ON); | ||
209 | |||
210 | u2o_clear(base, UTMI_CTRL, UTMI_CTRL_RXBUF_PDWN); | ||
211 | u2o_clear(base, UTMI_CTRL, UTMI_CTRL_TXBUF_PDWN); | ||
212 | u2o_clear(base, UTMI_CTRL, UTMI_CTRL_USB_CLK_EN); | ||
213 | u2o_clear(base, UTMI_CTRL, 1<<UTMI_CTRL_PWR_UP_SHIFT); | ||
214 | u2o_clear(base, UTMI_CTRL, 1<<UTMI_CTRL_PLL_PWR_UP_SHIFT); | ||
215 | |||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | int pxa_usb_phy_init(void __iomem *phy_reg) | ||
220 | { | ||
221 | mutex_lock(&phy_lock); | ||
222 | if (phy_init_cnt++ == 0) | ||
223 | usb_phy_init_internal(phy_reg); | ||
224 | mutex_unlock(&phy_lock); | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | void pxa_usb_phy_deinit(void __iomem *phy_reg) | ||
229 | { | ||
230 | WARN_ON(phy_init_cnt == 0); | ||
231 | |||
232 | mutex_lock(&phy_lock); | ||
233 | if (--phy_init_cnt == 0) | ||
234 | usb_phy_deinit_internal(phy_reg); | ||
235 | mutex_unlock(&phy_lock); | ||
236 | } | ||
237 | #endif | ||
238 | #endif | ||
239 | #endif | ||
240 | |||
241 | #ifdef CONFIG_USB_SUPPORT | ||
242 | static u64 usb_dma_mask = ~(u32)0; | ||
243 | |||
244 | #ifdef CONFIG_USB_MV_UDC | ||
245 | struct resource pxa168_u2o_resources[] = { | ||
246 | /* regbase */ | ||
247 | [0] = { | ||
248 | .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET, | ||
249 | .end = PXA168_U2O_REGBASE + USB_REG_RANGE, | ||
250 | .flags = IORESOURCE_MEM, | ||
251 | .name = "capregs", | ||
252 | }, | ||
253 | /* phybase */ | ||
254 | [1] = { | ||
255 | .start = PXA168_U2O_PHYBASE, | ||
256 | .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE, | ||
257 | .flags = IORESOURCE_MEM, | ||
258 | .name = "phyregs", | ||
259 | }, | ||
260 | [2] = { | ||
261 | .start = IRQ_PXA168_USB1, | ||
262 | .end = IRQ_PXA168_USB1, | ||
263 | .flags = IORESOURCE_IRQ, | ||
264 | }, | ||
265 | }; | ||
266 | |||
267 | struct platform_device pxa168_device_u2o = { | ||
268 | .name = "mv-udc", | ||
269 | .id = -1, | ||
270 | .resource = pxa168_u2o_resources, | ||
271 | .num_resources = ARRAY_SIZE(pxa168_u2o_resources), | ||
272 | .dev = { | ||
273 | .dma_mask = &usb_dma_mask, | ||
274 | .coherent_dma_mask = 0xffffffff, | ||
275 | } | ||
276 | }; | ||
277 | #endif /* CONFIG_USB_MV_UDC */ | ||
278 | |||
279 | #ifdef CONFIG_USB_EHCI_MV_U2O | ||
280 | struct resource pxa168_u2oehci_resources[] = { | ||
281 | /* regbase */ | ||
282 | [0] = { | ||
283 | .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET, | ||
284 | .end = PXA168_U2O_REGBASE + USB_REG_RANGE, | ||
285 | .flags = IORESOURCE_MEM, | ||
286 | .name = "capregs", | ||
287 | }, | ||
288 | /* phybase */ | ||
289 | [1] = { | ||
290 | .start = PXA168_U2O_PHYBASE, | ||
291 | .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE, | ||
292 | .flags = IORESOURCE_MEM, | ||
293 | .name = "phyregs", | ||
294 | }, | ||
295 | [2] = { | ||
296 | .start = IRQ_PXA168_USB1, | ||
297 | .end = IRQ_PXA168_USB1, | ||
298 | .flags = IORESOURCE_IRQ, | ||
299 | }, | ||
300 | }; | ||
301 | |||
302 | struct platform_device pxa168_device_u2oehci = { | ||
303 | .name = "pxa-u2oehci", | ||
304 | .id = -1, | ||
305 | .dev = { | ||
306 | .dma_mask = &usb_dma_mask, | ||
307 | .coherent_dma_mask = 0xffffffff, | ||
308 | }, | ||
309 | |||
310 | .num_resources = ARRAY_SIZE(pxa168_u2oehci_resources), | ||
311 | .resource = pxa168_u2oehci_resources, | ||
312 | }; | ||
313 | #endif | ||
314 | |||
315 | #if defined(CONFIG_USB_MV_OTG) | ||
316 | struct resource pxa168_u2ootg_resources[] = { | ||
317 | /* regbase */ | ||
318 | [0] = { | ||
319 | .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET, | ||
320 | .end = PXA168_U2O_REGBASE + USB_REG_RANGE, | ||
321 | .flags = IORESOURCE_MEM, | ||
322 | .name = "capregs", | ||
323 | }, | ||
324 | /* phybase */ | ||
325 | [1] = { | ||
326 | .start = PXA168_U2O_PHYBASE, | ||
327 | .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE, | ||
328 | .flags = IORESOURCE_MEM, | ||
329 | .name = "phyregs", | ||
330 | }, | ||
331 | [2] = { | ||
332 | .start = IRQ_PXA168_USB1, | ||
333 | .end = IRQ_PXA168_USB1, | ||
334 | .flags = IORESOURCE_IRQ, | ||
335 | }, | ||
336 | }; | ||
337 | |||
338 | struct platform_device pxa168_device_u2ootg = { | ||
339 | .name = "mv-otg", | ||
340 | .id = -1, | ||
341 | .dev = { | ||
342 | .dma_mask = &usb_dma_mask, | ||
343 | .coherent_dma_mask = 0xffffffff, | ||
344 | }, | ||
345 | |||
346 | .num_resources = ARRAY_SIZE(pxa168_u2ootg_resources), | ||
347 | .resource = pxa168_u2ootg_resources, | ||
348 | }; | ||
349 | #endif /* CONFIG_USB_MV_OTG */ | ||
350 | |||
351 | #endif | ||
diff --git a/arch/arm/mach-mmp/include/mach/devices.h b/arch/arm/mach-mmp/include/mach/devices.h index d0ec7dae88e4..21217ef11b64 100644 --- a/arch/arm/mach-mmp/include/mach/devices.h +++ b/arch/arm/mach-mmp/include/mach/devices.h | |||
@@ -50,4 +50,7 @@ struct pxa_device_desc mmp2_device_##_name __initdata = { \ | |||
50 | } | 50 | } |
51 | 51 | ||
52 | extern int pxa_register_device(struct pxa_device_desc *, void *, size_t); | 52 | extern int pxa_register_device(struct pxa_device_desc *, void *, size_t); |
53 | extern int pxa_usb_phy_init(void __iomem *phy_reg); | ||
54 | extern void pxa_usb_phy_deinit(void __iomem *phy_reg); | ||
55 | |||
53 | #endif /* __MACH_DEVICE_H */ | 56 | #endif /* __MACH_DEVICE_H */ |
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h index e2e1f1e5e124..793634c837ef 100644 --- a/arch/arm/mach-mmp/include/mach/pxa910.h +++ b/arch/arm/mach-mmp/include/mach/pxa910.h | |||
@@ -20,6 +20,9 @@ extern struct pxa_device_desc pxa910_device_pwm2; | |||
20 | extern struct pxa_device_desc pxa910_device_pwm3; | 20 | extern struct pxa_device_desc pxa910_device_pwm3; |
21 | extern struct pxa_device_desc pxa910_device_pwm4; | 21 | extern struct pxa_device_desc pxa910_device_pwm4; |
22 | extern struct pxa_device_desc pxa910_device_nand; | 22 | extern struct pxa_device_desc pxa910_device_nand; |
23 | extern struct platform_device pxa168_device_u2o; | ||
24 | extern struct platform_device pxa168_device_u2ootg; | ||
25 | extern struct platform_device pxa168_device_u2oehci; | ||
23 | 26 | ||
24 | extern struct platform_device pxa910_device_gpio; | 27 | extern struct platform_device pxa910_device_gpio; |
25 | extern struct platform_device pxa910_device_rtc; | 28 | extern struct platform_device pxa910_device_rtc; |
diff --git a/arch/arm/mach-mmp/include/mach/regs-usb.h b/arch/arm/mach-mmp/include/mach/regs-usb.h new file mode 100644 index 000000000000..b047bf487506 --- /dev/null +++ b/arch/arm/mach-mmp/include/mach/regs-usb.h | |||
@@ -0,0 +1,253 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Marvell International Ltd. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the | ||
6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
7 | * option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_REGS_USB_H | ||
11 | #define __ASM_ARCH_REGS_USB_H | ||
12 | |||
13 | #define PXA168_U2O_REGBASE (0xd4208000) | ||
14 | #define PXA168_U2O_PHYBASE (0xd4207000) | ||
15 | |||
16 | #define PXA168_U2H_REGBASE (0xd4209000) | ||
17 | #define PXA168_U2H_PHYBASE (0xd4206000) | ||
18 | |||
19 | #define MMP3_HSIC1_REGBASE (0xf0001000) | ||
20 | #define MMP3_HSIC1_PHYBASE (0xf0001800) | ||
21 | |||
22 | #define MMP3_HSIC2_REGBASE (0xf0002000) | ||
23 | #define MMP3_HSIC2_PHYBASE (0xf0002800) | ||
24 | |||
25 | #define MMP3_FSIC_REGBASE (0xf0003000) | ||
26 | #define MMP3_FSIC_PHYBASE (0xf0003800) | ||
27 | |||
28 | |||
29 | #define USB_REG_RANGE (0x1ff) | ||
30 | #define USB_PHY_RANGE (0xff) | ||
31 | |||
32 | /* registers */ | ||
33 | #define U2x_CAPREGS_OFFSET 0x100 | ||
34 | |||
35 | /* phy regs */ | ||
36 | #define UTMI_REVISION 0x0 | ||
37 | #define UTMI_CTRL 0x4 | ||
38 | #define UTMI_PLL 0x8 | ||
39 | #define UTMI_TX 0xc | ||
40 | #define UTMI_RX 0x10 | ||
41 | #define UTMI_IVREF 0x14 | ||
42 | #define UTMI_T0 0x18 | ||
43 | #define UTMI_T1 0x1c | ||
44 | #define UTMI_T2 0x20 | ||
45 | #define UTMI_T3 0x24 | ||
46 | #define UTMI_T4 0x28 | ||
47 | #define UTMI_T5 0x2c | ||
48 | #define UTMI_RESERVE 0x30 | ||
49 | #define UTMI_USB_INT 0x34 | ||
50 | #define UTMI_DBG_CTL 0x38 | ||
51 | #define UTMI_OTG_ADDON 0x3c | ||
52 | |||
53 | /* For UTMICTRL Register */ | ||
54 | #define UTMI_CTRL_USB_CLK_EN (1 << 31) | ||
55 | /* pxa168 */ | ||
56 | #define UTMI_CTRL_SUSPEND_SET1 (1 << 30) | ||
57 | #define UTMI_CTRL_SUSPEND_SET2 (1 << 29) | ||
58 | #define UTMI_CTRL_RXBUF_PDWN (1 << 24) | ||
59 | #define UTMI_CTRL_TXBUF_PDWN (1 << 11) | ||
60 | |||
61 | #define UTMI_CTRL_INPKT_DELAY_SHIFT 30 | ||
62 | #define UTMI_CTRL_INPKT_DELAY_SOF_SHIFT 28 | ||
63 | #define UTMI_CTRL_PU_REF_SHIFT 20 | ||
64 | #define UTMI_CTRL_ARC_PULLDN_SHIFT 12 | ||
65 | #define UTMI_CTRL_PLL_PWR_UP_SHIFT 1 | ||
66 | #define UTMI_CTRL_PWR_UP_SHIFT 0 | ||
67 | |||
68 | /* For UTMI_PLL Register */ | ||
69 | #define UTMI_PLL_PLLCALI12_SHIFT 29 | ||
70 | #define UTMI_PLL_PLLCALI12_MASK (0x3 << 29) | ||
71 | |||
72 | #define UTMI_PLL_PLLVDD18_SHIFT 27 | ||
73 | #define UTMI_PLL_PLLVDD18_MASK (0x3 << 27) | ||
74 | |||
75 | #define UTMI_PLL_PLLVDD12_SHIFT 25 | ||
76 | #define UTMI_PLL_PLLVDD12_MASK (0x3 << 25) | ||
77 | |||
78 | #define UTMI_PLL_CLK_BLK_EN_SHIFT 24 | ||
79 | #define CLK_BLK_EN (0x1 << 24) | ||
80 | #define PLL_READY (0x1 << 23) | ||
81 | #define KVCO_EXT (0x1 << 22) | ||
82 | #define VCOCAL_START (0x1 << 21) | ||
83 | |||
84 | #define UTMI_PLL_KVCO_SHIFT 15 | ||
85 | #define UTMI_PLL_KVCO_MASK (0x7 << 15) | ||
86 | |||
87 | #define UTMI_PLL_ICP_SHIFT 12 | ||
88 | #define UTMI_PLL_ICP_MASK (0x7 << 12) | ||
89 | |||
90 | #define UTMI_PLL_FBDIV_SHIFT 4 | ||
91 | #define UTMI_PLL_FBDIV_MASK (0xFF << 4) | ||
92 | |||
93 | #define UTMI_PLL_REFDIV_SHIFT 0 | ||
94 | #define UTMI_PLL_REFDIV_MASK (0xF << 0) | ||
95 | |||
96 | /* For UTMI_TX Register */ | ||
97 | #define UTMI_TX_REG_EXT_FS_RCAL_SHIFT 27 | ||
98 | #define UTMI_TX_REG_EXT_FS_RCAL_MASK (0xf << 27) | ||
99 | |||
100 | #define UTMI_TX_REG_EXT_FS_RCAL_EN_SHIFT 26 | ||
101 | #define UTMI_TX_REG_EXT_FS_RCAL_EN_MASK (0x1 << 26) | ||
102 | |||
103 | #define UTMI_TX_TXVDD12_SHIFT 22 | ||
104 | #define UTMI_TX_TXVDD12_MASK (0x3 << 22) | ||
105 | |||
106 | #define UTMI_TX_CK60_PHSEL_SHIFT 17 | ||
107 | #define UTMI_TX_CK60_PHSEL_MASK (0xf << 17) | ||
108 | |||
109 | #define UTMI_TX_IMPCAL_VTH_SHIFT 14 | ||
110 | #define UTMI_TX_IMPCAL_VTH_MASK (0x7 << 14) | ||
111 | |||
112 | #define REG_RCAL_START (0x1 << 12) | ||
113 | |||
114 | #define UTMI_TX_LOW_VDD_EN_SHIFT 11 | ||
115 | |||
116 | #define UTMI_TX_AMP_SHIFT 0 | ||
117 | #define UTMI_TX_AMP_MASK (0x7 << 0) | ||
118 | |||
119 | /* For UTMI_RX Register */ | ||
120 | #define UTMI_REG_SQ_LENGTH_SHIFT 15 | ||
121 | #define UTMI_REG_SQ_LENGTH_MASK (0x3 << 15) | ||
122 | |||
123 | #define UTMI_RX_SQ_THRESH_SHIFT 4 | ||
124 | #define UTMI_RX_SQ_THRESH_MASK (0xf << 4) | ||
125 | |||
126 | #define UTMI_OTG_ADDON_OTG_ON (1 << 0) | ||
127 | |||
128 | /* For MMP3 USB Phy */ | ||
129 | #define USB2_PLL_REG0 0x4 | ||
130 | #define USB2_PLL_REG1 0x8 | ||
131 | #define USB2_TX_REG0 0x10 | ||
132 | #define USB2_TX_REG1 0x14 | ||
133 | #define USB2_TX_REG2 0x18 | ||
134 | #define USB2_RX_REG0 0x20 | ||
135 | #define USB2_RX_REG1 0x24 | ||
136 | #define USB2_RX_REG2 0x28 | ||
137 | #define USB2_ANA_REG0 0x30 | ||
138 | #define USB2_ANA_REG1 0x34 | ||
139 | #define USB2_ANA_REG2 0x38 | ||
140 | #define USB2_DIG_REG0 0x3C | ||
141 | #define USB2_DIG_REG1 0x40 | ||
142 | #define USB2_DIG_REG2 0x44 | ||
143 | #define USB2_DIG_REG3 0x48 | ||
144 | #define USB2_TEST_REG0 0x4C | ||
145 | #define USB2_TEST_REG1 0x50 | ||
146 | #define USB2_TEST_REG2 0x54 | ||
147 | #define USB2_CHARGER_REG0 0x58 | ||
148 | #define USB2_OTG_REG0 0x5C | ||
149 | #define USB2_PHY_MON0 0x60 | ||
150 | #define USB2_RESETVE_REG0 0x64 | ||
151 | #define USB2_ICID_REG0 0x78 | ||
152 | #define USB2_ICID_REG1 0x7C | ||
153 | |||
154 | /* USB2_PLL_REG0 */ | ||
155 | /* This is for Ax stepping */ | ||
156 | #define USB2_PLL_FBDIV_SHIFT_MMP3 0 | ||
157 | #define USB2_PLL_FBDIV_MASK_MMP3 (0xFF << 0) | ||
158 | |||
159 | #define USB2_PLL_REFDIV_SHIFT_MMP3 8 | ||
160 | #define USB2_PLL_REFDIV_MASK_MMP3 (0xF << 8) | ||
161 | |||
162 | #define USB2_PLL_VDD12_SHIFT_MMP3 12 | ||
163 | #define USB2_PLL_VDD18_SHIFT_MMP3 14 | ||
164 | |||
165 | /* This is for B0 stepping */ | ||
166 | #define USB2_PLL_FBDIV_SHIFT_MMP3_B0 0 | ||
167 | #define USB2_PLL_REFDIV_SHIFT_MMP3_B0 9 | ||
168 | #define USB2_PLL_VDD18_SHIFT_MMP3_B0 14 | ||
169 | #define USB2_PLL_FBDIV_MASK_MMP3_B0 0x01FF | ||
170 | #define USB2_PLL_REFDIV_MASK_MMP3_B0 0x3E00 | ||
171 | |||
172 | #define USB2_PLL_CAL12_SHIFT_MMP3 0 | ||
173 | #define USB2_PLL_CALI12_MASK_MMP3 (0x3 << 0) | ||
174 | |||
175 | #define USB2_PLL_VCOCAL_START_SHIFT_MMP3 2 | ||
176 | |||
177 | #define USB2_PLL_KVCO_SHIFT_MMP3 4 | ||
178 | #define USB2_PLL_KVCO_MASK_MMP3 (0x7<<4) | ||
179 | |||
180 | #define USB2_PLL_ICP_SHIFT_MMP3 8 | ||
181 | #define USB2_PLL_ICP_MASK_MMP3 (0x7<<8) | ||
182 | |||
183 | #define USB2_PLL_LOCK_BYPASS_SHIFT_MMP3 12 | ||
184 | |||
185 | #define USB2_PLL_PU_PLL_SHIFT_MMP3 13 | ||
186 | #define USB2_PLL_PU_PLL_MASK (0x1 << 13) | ||
187 | |||
188 | #define USB2_PLL_READY_MASK_MMP3 (0x1 << 15) | ||
189 | |||
190 | /* USB2_TX_REG0 */ | ||
191 | #define USB2_TX_IMPCAL_VTH_SHIFT_MMP3 8 | ||
192 | #define USB2_TX_IMPCAL_VTH_MASK_MMP3 (0x7 << 8) | ||
193 | |||
194 | #define USB2_TX_RCAL_START_SHIFT_MMP3 13 | ||
195 | |||
196 | /* USB2_TX_REG1 */ | ||
197 | #define USB2_TX_CK60_PHSEL_SHIFT_MMP3 0 | ||
198 | #define USB2_TX_CK60_PHSEL_MASK_MMP3 (0xf << 0) | ||
199 | |||
200 | #define USB2_TX_AMP_SHIFT_MMP3 4 | ||
201 | #define USB2_TX_AMP_MASK_MMP3 (0x7 << 4) | ||
202 | |||
203 | #define USB2_TX_VDD12_SHIFT_MMP3 8 | ||
204 | #define USB2_TX_VDD12_MASK_MMP3 (0x3 << 8) | ||
205 | |||
206 | /* USB2_TX_REG2 */ | ||
207 | #define USB2_TX_DRV_SLEWRATE_SHIFT 10 | ||
208 | |||
209 | /* USB2_RX_REG0 */ | ||
210 | #define USB2_RX_SQ_THRESH_SHIFT_MMP3 4 | ||
211 | #define USB2_RX_SQ_THRESH_MASK_MMP3 (0xf << 4) | ||
212 | |||
213 | #define USB2_RX_SQ_LENGTH_SHIFT_MMP3 10 | ||
214 | #define USB2_RX_SQ_LENGTH_MASK_MMP3 (0x3 << 10) | ||
215 | |||
216 | /* USB2_ANA_REG1*/ | ||
217 | #define USB2_ANA_PU_ANA_SHIFT_MMP3 14 | ||
218 | |||
219 | /* USB2_OTG_REG0 */ | ||
220 | #define USB2_OTG_PU_OTG_SHIFT_MMP3 3 | ||
221 | |||
222 | /* fsic registers */ | ||
223 | #define FSIC_MISC 0x4 | ||
224 | #define FSIC_INT 0x28 | ||
225 | #define FSIC_CTRL 0x30 | ||
226 | |||
227 | /* HSIC registers */ | ||
228 | #define HSIC_PAD_CTRL 0x4 | ||
229 | |||
230 | #define HSIC_CTRL 0x8 | ||
231 | #define HSIC_CTRL_HSIC_ENABLE (1<<7) | ||
232 | #define HSIC_CTRL_PLL_BYPASS (1<<4) | ||
233 | |||
234 | #define TEST_GRP_0 0xc | ||
235 | #define TEST_GRP_1 0x10 | ||
236 | |||
237 | #define HSIC_INT 0x14 | ||
238 | #define HSIC_INT_READY_INT_EN (1<<10) | ||
239 | #define HSIC_INT_CONNECT_INT_EN (1<<9) | ||
240 | #define HSIC_INT_CORE_INT_EN (1<<8) | ||
241 | #define HSIC_INT_HS_READY (1<<2) | ||
242 | #define HSIC_INT_CONNECT (1<<1) | ||
243 | #define HSIC_INT_CORE (1<<0) | ||
244 | |||
245 | #define HSIC_CONFIG 0x18 | ||
246 | #define USBHSIC_CTRL 0x20 | ||
247 | |||
248 | #define HSIC_USB_CTRL 0x28 | ||
249 | #define HSIC_USB_CTRL_CLKEN 1 | ||
250 | #define HSIC_USB_CLK_PHY 0x0 | ||
251 | #define HSIC_USB_CLK_PMU 0x1 | ||
252 | |||
253 | #endif /* __ASM_ARCH_PXA_U2O_H */ | ||
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 43f8bcc29b67..6da52e9f2bdc 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -109,7 +109,7 @@ static struct clk_lookup pxa910_clkregs[] = { | |||
109 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), | 109 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), |
110 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 110 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
111 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | 111 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), |
112 | INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), | 112 | INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"), |
113 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | 113 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), |
114 | }; | 114 | }; |
115 | 115 | ||