diff options
author | Tanmay Upadhyay <tanmay.upadhyay@einfochips.com> | 2011-07-20 00:30:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-22 18:38:30 -0400 |
commit | 3abd7f68b28dcf6394c71c998376fc7bc92342c4 (patch) | |
tree | 31bda72bb574ba7766607ab19f3b2d121fc45808 /arch/arm/mach-mmp | |
parent | 7a01f496c5218d98ea4542f74fccb60c23b6185c (diff) |
USB: pxa168: Add onchip USB host controller support
- Add EHCI Host controller driver
- Add wrapper that creates resources for host controller driver
v2 - Call clk_put() after clk_disable() in probe function
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r-- | arch/arm/mach-mmp/include/mach/pxa168.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-mmp/pxa168.c | 46 |
2 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index 7f005843a707..7fb568d2845b 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h | |||
@@ -35,6 +35,13 @@ extern struct pxa_device_desc pxa168_device_fb; | |||
35 | extern struct pxa_device_desc pxa168_device_keypad; | 35 | extern struct pxa_device_desc pxa168_device_keypad; |
36 | extern struct pxa_device_desc pxa168_device_eth; | 36 | extern struct pxa_device_desc pxa168_device_eth; |
37 | 37 | ||
38 | struct pxa168_usb_pdata { | ||
39 | /* If NULL, default phy init routine for PXA168 would be called */ | ||
40 | int (*phy_init)(void __iomem *usb_phy_reg_base); | ||
41 | }; | ||
42 | /* pdata can be NULL */ | ||
43 | int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata); | ||
44 | |||
38 | static inline int pxa168_add_uart(int id) | 45 | static inline int pxa168_add_uart(int id) |
39 | { | 46 | { |
40 | struct pxa_device_desc *d = NULL; | 47 | struct pxa_device_desc *d = NULL; |
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 0156f535dae7..b2b280c517dd 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -25,6 +25,9 @@ | |||
25 | #include <mach/dma.h> | 25 | #include <mach/dma.h> |
26 | #include <mach/devices.h> | 26 | #include <mach/devices.h> |
27 | #include <mach/mfp.h> | 27 | #include <mach/mfp.h> |
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/dma-mapping.h> | ||
30 | #include <mach/pxa168.h> | ||
28 | 31 | ||
29 | #include "common.h" | 32 | #include "common.h" |
30 | #include "clock.h" | 33 | #include "clock.h" |
@@ -83,6 +86,7 @@ static APBC_CLK(keypad, PXA168_KPC, 0, 32000); | |||
83 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | 86 | static APMU_CLK(nand, NAND, 0x19b, 156000000); |
84 | static APMU_CLK(lcd, LCD, 0x7f, 312000000); | 87 | static APMU_CLK(lcd, LCD, 0x7f, 312000000); |
85 | static APMU_CLK(eth, ETH, 0x09, 0); | 88 | static APMU_CLK(eth, ETH, 0x09, 0); |
89 | static APMU_CLK(usb, USB, 0x12, 0); | ||
86 | 90 | ||
87 | /* device and clock bindings */ | 91 | /* device and clock bindings */ |
88 | static struct clk_lookup pxa168_clkregs[] = { | 92 | static struct clk_lookup pxa168_clkregs[] = { |
@@ -104,6 +108,7 @@ static struct clk_lookup pxa168_clkregs[] = { | |||
104 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), | 108 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), |
105 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), | 109 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), |
106 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), | 110 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), |
111 | INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), | ||
107 | }; | 112 | }; |
108 | 113 | ||
109 | static int __init pxa168_init(void) | 114 | static int __init pxa168_init(void) |
@@ -169,3 +174,44 @@ PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61); | |||
169 | PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); | 174 | PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); |
170 | PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); | 175 | PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); |
171 | PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff); | 176 | PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff); |
177 | |||
178 | struct resource pxa168_usb_host_resources[] = { | ||
179 | /* USB Host conroller register base */ | ||
180 | [0] = { | ||
181 | .start = 0xd4209000, | ||
182 | .end = 0xd4209000 + 0x200, | ||
183 | .flags = IORESOURCE_MEM, | ||
184 | .name = "pxa168-usb-host", | ||
185 | }, | ||
186 | /* USB PHY register base */ | ||
187 | [1] = { | ||
188 | .start = 0xd4206000, | ||
189 | .end = 0xd4206000 + 0xff, | ||
190 | .flags = IORESOURCE_MEM, | ||
191 | .name = "pxa168-usb-phy", | ||
192 | }, | ||
193 | [2] = { | ||
194 | .start = IRQ_PXA168_USB2, | ||
195 | .end = IRQ_PXA168_USB2, | ||
196 | .flags = IORESOURCE_IRQ, | ||
197 | }, | ||
198 | }; | ||
199 | |||
200 | static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32); | ||
201 | struct platform_device pxa168_device_usb_host = { | ||
202 | .name = "pxa168-ehci", | ||
203 | .id = -1, | ||
204 | .dev = { | ||
205 | .dma_mask = &pxa168_usb_host_dmamask, | ||
206 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
207 | }, | ||
208 | |||
209 | .num_resources = ARRAY_SIZE(pxa168_usb_host_resources), | ||
210 | .resource = pxa168_usb_host_resources, | ||
211 | }; | ||
212 | |||
213 | int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata) | ||
214 | { | ||
215 | pxa168_device_usb_host.dev.platform_data = pdata; | ||
216 | return platform_device_register(&pxa168_device_usb_host); | ||
217 | } | ||