diff options
author | Thomas Abraham <thomas.ab@samsung.com> | 2011-05-07 16:26:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-10 17:16:54 -0400 |
commit | 4a98f590659113f72c021201781d5b83bc743a7c (patch) | |
tree | 791dfc7cbb9d8b10d52745e0c4c8566d6d7bc7aa /arch/arm | |
parent | 0a94c6b121c58692a9b6cbe2cd9a26ffdc2c4a82 (diff) |
ARM: S3C24XX: Add plaform device definition for USB High-Speed gadget controller.
S3C2416, S3C2443 and S3C2450 includes a USB High-Speed Gadget controller module.
This patch adds the following for supporting this controller.
1. Definition for USB High-Speed controller base address.
2. Platform device instantiation.
3. Declaration for platform data structure.
4. Functionality to setup platform data for the controller.
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/map.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 41 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/udc.h | 17 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/devs.h | 1 |
4 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h index 25bbf5a942dd..425552d84b60 100644 --- a/arch/arm/mach-s3c2410/include/mach/map.h +++ b/arch/arm/mach-s3c2410/include/mach/map.h | |||
@@ -21,6 +21,10 @@ | |||
21 | /* USB host controller */ | 21 | /* USB host controller */ |
22 | #define S3C2410_PA_USBHOST (0x49000000) | 22 | #define S3C2410_PA_USBHOST (0x49000000) |
23 | 23 | ||
24 | /* S3C2416/S3C2443/S3C2450 High-Speed USB Gadget */ | ||
25 | #define S3C2416_PA_HSUDC (0x49800000) | ||
26 | #define S3C2416_SZ_HSUDC (SZ_4K) | ||
27 | |||
24 | /* DMA controller */ | 28 | /* DMA controller */ |
25 | #define S3C2410_PA_DMA (0x4B000000) | 29 | #define S3C2410_PA_DMA (0x4B000000) |
26 | #define S3C24XX_SZ_DMA SZ_1M | 30 | #define S3C24XX_SZ_DMA SZ_1M |
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index 268f3ed0a105..73667994518a 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/string.h> | 24 | #include <linux/string.h> |
25 | #include <linux/dma-mapping.h> | ||
25 | 26 | ||
26 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
@@ -233,6 +234,46 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) | |||
233 | } | 234 | } |
234 | } | 235 | } |
235 | 236 | ||
237 | /* USB High Speed 2.0 Device (Gadget) */ | ||
238 | static struct resource s3c_hsudc_resource[] = { | ||
239 | [0] = { | ||
240 | .start = S3C2416_PA_HSUDC, | ||
241 | .end = S3C2416_PA_HSUDC + S3C2416_SZ_HSUDC - 1, | ||
242 | .flags = IORESOURCE_MEM, | ||
243 | }, | ||
244 | [1] = { | ||
245 | .start = IRQ_USBD, | ||
246 | .end = IRQ_USBD, | ||
247 | .flags = IORESOURCE_IRQ, | ||
248 | } | ||
249 | }; | ||
250 | |||
251 | static u64 s3c_hsudc_dmamask = DMA_BIT_MASK(32); | ||
252 | |||
253 | struct platform_device s3c_device_usb_hsudc = { | ||
254 | .name = "s3c-hsudc", | ||
255 | .id = -1, | ||
256 | .num_resources = ARRAY_SIZE(s3c_hsudc_resource), | ||
257 | .resource = s3c_hsudc_resource, | ||
258 | .dev = { | ||
259 | .dma_mask = &s3c_hsudc_dmamask, | ||
260 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
261 | }, | ||
262 | }; | ||
263 | |||
264 | void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) | ||
265 | { | ||
266 | struct s3c24xx_hsudc_platdata *npd; | ||
267 | |||
268 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | ||
269 | if (npd) { | ||
270 | memcpy(npd, pd, sizeof(*npd)); | ||
271 | s3c_device_usb_hsudc.dev.platform_data = npd; | ||
272 | } else { | ||
273 | printk(KERN_ERR "no memory for udc platform data\n"); | ||
274 | } | ||
275 | } | ||
276 | |||
236 | /* IIS */ | 277 | /* IIS */ |
237 | 278 | ||
238 | static struct resource s3c_iis_resource[] = { | 279 | static struct resource s3c_iis_resource[] = { |
diff --git a/arch/arm/plat-s3c24xx/include/plat/udc.h b/arch/arm/plat-s3c24xx/include/plat/udc.h index 80457c6414aa..f63884242506 100644 --- a/arch/arm/plat-s3c24xx/include/plat/udc.h +++ b/arch/arm/plat-s3c24xx/include/plat/udc.h | |||
@@ -37,4 +37,21 @@ struct s3c2410_udc_mach_info { | |||
37 | 37 | ||
38 | extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *); | 38 | extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *); |
39 | 39 | ||
40 | /** | ||
41 | * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller. | ||
42 | * @epnum: Number of endpoints to be instantiated by the controller driver. | ||
43 | * @gpio_init: Platform specific USB related GPIO initialization. | ||
44 | * @gpio_uninit: Platform specific USB releted GPIO uninitialzation. | ||
45 | * | ||
46 | * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget | ||
47 | * controllers. | ||
48 | */ | ||
49 | struct s3c24xx_hsudc_platdata { | ||
50 | unsigned int epnum; | ||
51 | void (*gpio_init)(void); | ||
52 | void (*gpio_uninit)(void); | ||
53 | }; | ||
54 | |||
55 | extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd); | ||
56 | |||
40 | #endif /* __ASM_ARM_ARCH_UDC_H */ | 57 | #endif /* __ASM_ARM_ARCH_UDC_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index 3f38debbb108..39818d8da420 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -88,6 +88,7 @@ extern struct platform_device s3c64xx_device_onenand1; | |||
88 | extern struct platform_device s5p_device_onenand; | 88 | extern struct platform_device s5p_device_onenand; |
89 | 89 | ||
90 | extern struct platform_device s3c_device_usbgadget; | 90 | extern struct platform_device s3c_device_usbgadget; |
91 | extern struct platform_device s3c_device_usb_hsudc; | ||
91 | extern struct platform_device s3c_device_usb_hsotg; | 92 | extern struct platform_device s3c_device_usb_hsotg; |
92 | 93 | ||
93 | extern struct platform_device s5pv210_device_ac97; | 94 | extern struct platform_device s5pv210_device_ac97; |