diff options
author | Neil Zhang <zhangwm@marvell.com> | 2012-05-03 02:19:15 -0400 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@gmail.com> | 2012-05-03 03:06:05 -0400 |
commit | 161105bcb82a5df88f7594cb3b036ec13c6df626 (patch) | |
tree | cb8e5bbee7187b60df1785d724b71894f4e94bc2 /arch/arm/mach-mmp | |
parent | 673eef981436ffb015f491e2c58b83b2015ed878 (diff) |
ARM: mmp: add usb host support for PXA168
The ehci-mv can support PXA168, PXA910 and PXA920, use this driver to
support pxa168 SPH usb.
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/devices.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/pxa168.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-mmp/pxa168.c | 20 |
3 files changed, 15 insertions, 15 deletions
diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c index 262179f45109..dd2d8b103cc8 100644 --- a/arch/arm/mach-mmp/devices.c +++ b/arch/arm/mach-mmp/devices.c | |||
@@ -114,7 +114,7 @@ static void u2o_write(void __iomem *base, unsigned int offset, | |||
114 | 114 | ||
115 | #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV) | 115 | #if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV) |
116 | 116 | ||
117 | #if defined(CONFIG_CPU_PXA910) | 117 | #if defined(CONFIG_CPU_PXA910) || defined(CONFIG_CPU_PXA168) |
118 | 118 | ||
119 | static DEFINE_MUTEX(phy_lock); | 119 | static DEFINE_MUTEX(phy_lock); |
120 | static int phy_init_cnt; | 120 | static int phy_init_cnt; |
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index dc03d580a06d..09dcd6e2b6a8 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h | |||
@@ -16,6 +16,7 @@ extern void pxa168_clear_keypad_wakeup(void); | |||
16 | #include <plat/pxa27x_keypad.h> | 16 | #include <plat/pxa27x_keypad.h> |
17 | #include <mach/cputype.h> | 17 | #include <mach/cputype.h> |
18 | #include <linux/pxa168_eth.h> | 18 | #include <linux/pxa168_eth.h> |
19 | #include <linux/platform_data/mv_usb.h> | ||
19 | 20 | ||
20 | extern struct pxa_device_desc pxa168_device_uart1; | 21 | extern struct pxa_device_desc pxa168_device_uart1; |
21 | extern struct pxa_device_desc pxa168_device_uart2; | 22 | extern struct pxa_device_desc pxa168_device_uart2; |
@@ -36,12 +37,9 @@ extern struct pxa_device_desc pxa168_device_fb; | |||
36 | extern struct pxa_device_desc pxa168_device_keypad; | 37 | extern struct pxa_device_desc pxa168_device_keypad; |
37 | extern struct pxa_device_desc pxa168_device_eth; | 38 | extern struct pxa_device_desc pxa168_device_eth; |
38 | 39 | ||
39 | struct pxa168_usb_pdata { | ||
40 | /* If NULL, default phy init routine for PXA168 would be called */ | ||
41 | int (*phy_init)(void __iomem *usb_phy_reg_base); | ||
42 | }; | ||
43 | /* pdata can be NULL */ | 40 | /* pdata can be NULL */ |
44 | int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata); | 41 | extern int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata); |
42 | |||
45 | 43 | ||
46 | extern struct platform_device pxa168_device_gpio; | 44 | extern struct platform_device pxa168_device_gpio; |
47 | 45 | ||
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index b24d2c32cba9..62d787c34475 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/platform_data/mv_usb.h> | ||
17 | 18 | ||
18 | #include <asm/mach/time.h> | 19 | #include <asm/mach/time.h> |
19 | #include <asm/system_misc.h> | 20 | #include <asm/system_misc.h> |
@@ -27,6 +28,7 @@ | |||
27 | #include <mach/mfp.h> | 28 | #include <mach/mfp.h> |
28 | #include <linux/dma-mapping.h> | 29 | #include <linux/dma-mapping.h> |
29 | #include <mach/pxa168.h> | 30 | #include <mach/pxa168.h> |
31 | #include <mach/regs-usb.h> | ||
30 | 32 | ||
31 | #include "common.h" | 33 | #include "common.h" |
32 | #include "clock.h" | 34 | #include "clock.h" |
@@ -93,7 +95,7 @@ static struct clk_lookup pxa168_clkregs[] = { | |||
93 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | 95 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), |
94 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), | 96 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), |
95 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), | 97 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), |
96 | INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), | 98 | INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"), |
97 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | 99 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), |
98 | }; | 100 | }; |
99 | 101 | ||
@@ -184,17 +186,17 @@ struct platform_device pxa168_device_gpio = { | |||
184 | struct resource pxa168_usb_host_resources[] = { | 186 | struct resource pxa168_usb_host_resources[] = { |
185 | /* USB Host conroller register base */ | 187 | /* USB Host conroller register base */ |
186 | [0] = { | 188 | [0] = { |
187 | .start = 0xd4209000, | 189 | .start = PXA168_U2H_REGBASE + U2x_CAPREGS_OFFSET, |
188 | .end = 0xd4209000 + 0x200, | 190 | .end = PXA168_U2H_REGBASE + USB_REG_RANGE, |
189 | .flags = IORESOURCE_MEM, | 191 | .flags = IORESOURCE_MEM, |
190 | .name = "pxa168-usb-host", | 192 | .name = "capregs", |
191 | }, | 193 | }, |
192 | /* USB PHY register base */ | 194 | /* USB PHY register base */ |
193 | [1] = { | 195 | [1] = { |
194 | .start = 0xd4206000, | 196 | .start = PXA168_U2H_PHYBASE, |
195 | .end = 0xd4206000 + 0xff, | 197 | .end = PXA168_U2H_PHYBASE + USB_PHY_RANGE, |
196 | .flags = IORESOURCE_MEM, | 198 | .flags = IORESOURCE_MEM, |
197 | .name = "pxa168-usb-phy", | 199 | .name = "phyregs", |
198 | }, | 200 | }, |
199 | [2] = { | 201 | [2] = { |
200 | .start = IRQ_PXA168_USB2, | 202 | .start = IRQ_PXA168_USB2, |
@@ -205,7 +207,7 @@ struct resource pxa168_usb_host_resources[] = { | |||
205 | 207 | ||
206 | static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32); | 208 | static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32); |
207 | struct platform_device pxa168_device_usb_host = { | 209 | struct platform_device pxa168_device_usb_host = { |
208 | .name = "pxa168-ehci", | 210 | .name = "pxa-sph", |
209 | .id = -1, | 211 | .id = -1, |
210 | .dev = { | 212 | .dev = { |
211 | .dma_mask = &pxa168_usb_host_dmamask, | 213 | .dma_mask = &pxa168_usb_host_dmamask, |
@@ -216,7 +218,7 @@ struct platform_device pxa168_device_usb_host = { | |||
216 | .resource = pxa168_usb_host_resources, | 218 | .resource = pxa168_usb_host_resources, |
217 | }; | 219 | }; |
218 | 220 | ||
219 | int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata) | 221 | int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata) |
220 | { | 222 | { |
221 | pxa168_device_usb_host.dev.platform_data = pdata; | 223 | pxa168_device_usb_host.dev.platform_data = pdata; |
222 | return platform_device_register(&pxa168_device_usb_host); | 224 | return platform_device_register(&pxa168_device_usb_host); |