| Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 1 | /* linux/arch/arm/plat-s3c24xx/devs.c | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * | 
|  | 3 | * Copyright (c) 2004 Simtec Electronics | 
| Ben Dooks | 916a002 | 2006-09-06 19:03:21 +0100 | [diff] [blame] | 4 | *	Ben Dooks <ben@simtec.co.uk> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * | 
| Ben Dooks | 916a002 | 2006-09-06 19:03:21 +0100 | [diff] [blame] | 6 | * Base S3C24XX platform device definitions | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * | 
|  | 8 | * This program is free software; you can redistribute it and/or modify | 
|  | 9 | * it under the terms of the GNU General Public License version 2 as | 
|  | 10 | * published by the Free Software Foundation. | 
|  | 11 | * | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | */ | 
|  | 13 |  | 
|  | 14 | #include <linux/kernel.h> | 
|  | 15 | #include <linux/types.h> | 
|  | 16 | #include <linux/interrupt.h> | 
|  | 17 | #include <linux/list.h> | 
|  | 18 | #include <linux/timer.h> | 
|  | 19 | #include <linux/init.h> | 
| Ben Dooks | b6d1f54 | 2006-12-17 23:22:26 +0100 | [diff] [blame] | 20 | #include <linux/serial_core.h> | 
| Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 21 | #include <linux/platform_device.h> | 
| Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 22 | #include <linux/io.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 |  | 
|  | 24 | #include <asm/mach/arch.h> | 
|  | 25 | #include <asm/mach/map.h> | 
|  | 26 | #include <asm/mach/irq.h> | 
| Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 27 | #include <mach/fb.h> | 
|  | 28 | #include <mach/hardware.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | #include <asm/irq.h> | 
|  | 30 |  | 
| Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 31 | #include <plat/regs-serial.h> | 
| Ben Dooks | 06cfa55 | 2007-07-22 16:23:02 +0100 | [diff] [blame] | 32 | #include <asm/plat-s3c24xx/udc.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 |  | 
| Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 34 | #include <plat/devs.h> | 
|  | 35 | #include <plat/cpu.h> | 
| Ben Dooks | 06cfa55 | 2007-07-22 16:23:02 +0100 | [diff] [blame] | 36 | #include <asm/plat-s3c24xx/regs-spi.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 |  | 
|  | 38 | /* Serial port registrations */ | 
|  | 39 |  | 
| Ben Dooks | 66a9b49 | 2006-06-18 23:04:05 +0100 | [diff] [blame] | 40 | static struct resource s3c2410_uart0_resource[] = { | 
|  | 41 | [0] = { | 
|  | 42 | .start = S3C2410_PA_UART0, | 
|  | 43 | .end   = S3C2410_PA_UART0 + 0x3fff, | 
|  | 44 | .flags = IORESOURCE_MEM, | 
|  | 45 | }, | 
|  | 46 | [1] = { | 
|  | 47 | .start = IRQ_S3CUART_RX0, | 
|  | 48 | .end   = IRQ_S3CUART_ERR0, | 
|  | 49 | .flags = IORESOURCE_IRQ, | 
|  | 50 | } | 
|  | 51 | }; | 
|  | 52 |  | 
|  | 53 | static struct resource s3c2410_uart1_resource[] = { | 
|  | 54 | [0] = { | 
|  | 55 | .start = S3C2410_PA_UART1, | 
|  | 56 | .end   = S3C2410_PA_UART1 + 0x3fff, | 
|  | 57 | .flags = IORESOURCE_MEM, | 
|  | 58 | }, | 
|  | 59 | [1] = { | 
|  | 60 | .start = IRQ_S3CUART_RX1, | 
|  | 61 | .end   = IRQ_S3CUART_ERR1, | 
|  | 62 | .flags = IORESOURCE_IRQ, | 
|  | 63 | } | 
|  | 64 | }; | 
|  | 65 |  | 
|  | 66 | static struct resource s3c2410_uart2_resource[] = { | 
|  | 67 | [0] = { | 
|  | 68 | .start = S3C2410_PA_UART2, | 
|  | 69 | .end   = S3C2410_PA_UART2 + 0x3fff, | 
|  | 70 | .flags = IORESOURCE_MEM, | 
|  | 71 | }, | 
|  | 72 | [1] = { | 
|  | 73 | .start = IRQ_S3CUART_RX2, | 
|  | 74 | .end   = IRQ_S3CUART_ERR2, | 
|  | 75 | .flags = IORESOURCE_IRQ, | 
|  | 76 | } | 
|  | 77 | }; | 
|  | 78 |  | 
|  | 79 | struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { | 
|  | 80 | [0] = { | 
|  | 81 | .resources	= s3c2410_uart0_resource, | 
|  | 82 | .nr_resources	= ARRAY_SIZE(s3c2410_uart0_resource), | 
|  | 83 | }, | 
|  | 84 | [1] = { | 
|  | 85 | .resources	= s3c2410_uart1_resource, | 
|  | 86 | .nr_resources	= ARRAY_SIZE(s3c2410_uart1_resource), | 
|  | 87 | }, | 
|  | 88 | [2] = { | 
|  | 89 | .resources	= s3c2410_uart2_resource, | 
|  | 90 | .nr_resources	= ARRAY_SIZE(s3c2410_uart2_resource), | 
|  | 91 | }, | 
|  | 92 | }; | 
|  | 93 |  | 
|  | 94 | /* yart devices */ | 
|  | 95 |  | 
|  | 96 | static struct platform_device s3c24xx_uart_device0 = { | 
|  | 97 | .id		= 0, | 
|  | 98 | }; | 
|  | 99 |  | 
|  | 100 | static struct platform_device s3c24xx_uart_device1 = { | 
|  | 101 | .id		= 1, | 
|  | 102 | }; | 
|  | 103 |  | 
|  | 104 | static struct platform_device s3c24xx_uart_device2 = { | 
|  | 105 | .id		= 2, | 
|  | 106 | }; | 
|  | 107 |  | 
|  | 108 | struct platform_device *s3c24xx_uart_src[3] = { | 
|  | 109 | &s3c24xx_uart_device0, | 
|  | 110 | &s3c24xx_uart_device1, | 
|  | 111 | &s3c24xx_uart_device2, | 
|  | 112 | }; | 
|  | 113 |  | 
|  | 114 | struct platform_device *s3c24xx_uart_devs[3] = { | 
|  | 115 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 |  | 
|  | 117 | /* USB Host Controller */ | 
|  | 118 |  | 
|  | 119 | static struct resource s3c_usb_resource[] = { | 
|  | 120 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 121 | .start = S3C24XX_PA_USBHOST, | 
|  | 122 | .end   = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | .flags = IORESOURCE_MEM, | 
|  | 124 | }, | 
|  | 125 | [1] = { | 
|  | 126 | .start = IRQ_USBH, | 
|  | 127 | .end   = IRQ_USBH, | 
|  | 128 | .flags = IORESOURCE_IRQ, | 
|  | 129 | } | 
|  | 130 | }; | 
|  | 131 |  | 
|  | 132 | static u64 s3c_device_usb_dmamask = 0xffffffffUL; | 
|  | 133 |  | 
|  | 134 | struct platform_device s3c_device_usb = { | 
|  | 135 | .name		  = "s3c2410-ohci", | 
|  | 136 | .id		  = -1, | 
|  | 137 | .num_resources	  = ARRAY_SIZE(s3c_usb_resource), | 
|  | 138 | .resource	  = s3c_usb_resource, | 
|  | 139 | .dev              = { | 
|  | 140 | .dma_mask = &s3c_device_usb_dmamask, | 
|  | 141 | .coherent_dma_mask = 0xffffffffUL | 
|  | 142 | } | 
|  | 143 | }; | 
|  | 144 |  | 
|  | 145 | EXPORT_SYMBOL(s3c_device_usb); | 
|  | 146 |  | 
|  | 147 | /* LCD Controller */ | 
|  | 148 |  | 
|  | 149 | static struct resource s3c_lcd_resource[] = { | 
|  | 150 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 151 | .start = S3C24XX_PA_LCD, | 
|  | 152 | .end   = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 153 | .flags = IORESOURCE_MEM, | 
|  | 154 | }, | 
|  | 155 | [1] = { | 
|  | 156 | .start = IRQ_LCD, | 
|  | 157 | .end   = IRQ_LCD, | 
|  | 158 | .flags = IORESOURCE_IRQ, | 
|  | 159 | } | 
|  | 160 |  | 
|  | 161 | }; | 
|  | 162 |  | 
|  | 163 | static u64 s3c_device_lcd_dmamask = 0xffffffffUL; | 
|  | 164 |  | 
|  | 165 | struct platform_device s3c_device_lcd = { | 
|  | 166 | .name		  = "s3c2410-lcd", | 
|  | 167 | .id		  = -1, | 
|  | 168 | .num_resources	  = ARRAY_SIZE(s3c_lcd_resource), | 
|  | 169 | .resource	  = s3c_lcd_resource, | 
|  | 170 | .dev              = { | 
| Ben Dooks | 6904b24 | 2005-06-29 11:09:15 +0100 | [diff] [blame] | 171 | .dma_mask		= &s3c_device_lcd_dmamask, | 
|  | 172 | .coherent_dma_mask	= 0xffffffffUL | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | } | 
|  | 174 | }; | 
|  | 175 |  | 
|  | 176 | EXPORT_SYMBOL(s3c_device_lcd); | 
|  | 177 |  | 
| Ben Dooks | 893b030 | 2005-10-28 15:31:45 +0100 | [diff] [blame] | 178 | void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) | 
| Arnaud Patard | f92273c | 2005-09-09 13:10:10 -0700 | [diff] [blame] | 179 | { | 
| Ben Dooks | 893b030 | 2005-10-28 15:31:45 +0100 | [diff] [blame] | 180 | struct s3c2410fb_mach_info *npd; | 
|  | 181 |  | 
|  | 182 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | 
|  | 183 | if (npd) { | 
|  | 184 | memcpy(npd, pd, sizeof(*npd)); | 
|  | 185 | s3c_device_lcd.dev.platform_data = npd; | 
|  | 186 | } else { | 
|  | 187 | printk(KERN_ERR "no memory for LCD platform data\n"); | 
|  | 188 | } | 
| Arnaud Patard | f92273c | 2005-09-09 13:10:10 -0700 | [diff] [blame] | 189 | } | 
| Arnaud Patard | f92273c | 2005-09-09 13:10:10 -0700 | [diff] [blame] | 190 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | /* NAND Controller */ | 
|  | 192 |  | 
|  | 193 | static struct resource s3c_nand_resource[] = { | 
|  | 194 | [0] = { | 
|  | 195 | .start = S3C2410_PA_NAND, | 
| Ben Dooks | a0e0adb | 2005-10-28 15:26:42 +0100 | [diff] [blame] | 196 | .end   = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | .flags = IORESOURCE_MEM, | 
|  | 198 | } | 
|  | 199 | }; | 
|  | 200 |  | 
|  | 201 | struct platform_device s3c_device_nand = { | 
|  | 202 | .name		  = "s3c2410-nand", | 
|  | 203 | .id		  = -1, | 
|  | 204 | .num_resources	  = ARRAY_SIZE(s3c_nand_resource), | 
|  | 205 | .resource	  = s3c_nand_resource, | 
|  | 206 | }; | 
|  | 207 |  | 
|  | 208 | EXPORT_SYMBOL(s3c_device_nand); | 
|  | 209 |  | 
|  | 210 | /* USB Device (Gadget)*/ | 
|  | 211 |  | 
|  | 212 | static struct resource s3c_usbgadget_resource[] = { | 
|  | 213 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 214 | .start = S3C24XX_PA_USBDEV, | 
|  | 215 | .end   = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | .flags = IORESOURCE_MEM, | 
|  | 217 | }, | 
|  | 218 | [1] = { | 
|  | 219 | .start = IRQ_USBD, | 
|  | 220 | .end   = IRQ_USBD, | 
|  | 221 | .flags = IORESOURCE_IRQ, | 
|  | 222 | } | 
|  | 223 |  | 
|  | 224 | }; | 
|  | 225 |  | 
|  | 226 | struct platform_device s3c_device_usbgadget = { | 
|  | 227 | .name		  = "s3c2410-usbgadget", | 
|  | 228 | .id		  = -1, | 
|  | 229 | .num_resources	  = ARRAY_SIZE(s3c_usbgadget_resource), | 
|  | 230 | .resource	  = s3c_usbgadget_resource, | 
|  | 231 | }; | 
|  | 232 |  | 
|  | 233 | EXPORT_SYMBOL(s3c_device_usbgadget); | 
|  | 234 |  | 
| Arnaud Patard | 0dcfc32 | 2007-02-13 00:18:33 +0100 | [diff] [blame] | 235 | void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) | 
|  | 236 | { | 
|  | 237 | struct s3c2410_udc_mach_info *npd; | 
|  | 238 |  | 
|  | 239 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | 
|  | 240 | if (npd) { | 
|  | 241 | memcpy(npd, pd, sizeof(*npd)); | 
|  | 242 | s3c_device_usbgadget.dev.platform_data = npd; | 
|  | 243 | } else { | 
|  | 244 | printk(KERN_ERR "no memory for udc platform data\n"); | 
|  | 245 | } | 
|  | 246 | } | 
|  | 247 |  | 
|  | 248 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | /* Watchdog */ | 
|  | 250 |  | 
|  | 251 | static struct resource s3c_wdt_resource[] = { | 
|  | 252 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 253 | .start = S3C24XX_PA_WATCHDOG, | 
|  | 254 | .end   = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | .flags = IORESOURCE_MEM, | 
|  | 256 | }, | 
|  | 257 | [1] = { | 
|  | 258 | .start = IRQ_WDT, | 
|  | 259 | .end   = IRQ_WDT, | 
|  | 260 | .flags = IORESOURCE_IRQ, | 
|  | 261 | } | 
|  | 262 |  | 
|  | 263 | }; | 
|  | 264 |  | 
|  | 265 | struct platform_device s3c_device_wdt = { | 
|  | 266 | .name		  = "s3c2410-wdt", | 
|  | 267 | .id		  = -1, | 
|  | 268 | .num_resources	  = ARRAY_SIZE(s3c_wdt_resource), | 
|  | 269 | .resource	  = s3c_wdt_resource, | 
|  | 270 | }; | 
|  | 271 |  | 
|  | 272 | EXPORT_SYMBOL(s3c_device_wdt); | 
|  | 273 |  | 
|  | 274 | /* I2C */ | 
|  | 275 |  | 
|  | 276 | static struct resource s3c_i2c_resource[] = { | 
|  | 277 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 278 | .start = S3C24XX_PA_IIC, | 
|  | 279 | .end   = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | .flags = IORESOURCE_MEM, | 
|  | 281 | }, | 
|  | 282 | [1] = { | 
|  | 283 | .start = IRQ_IIC, | 
|  | 284 | .end   = IRQ_IIC, | 
|  | 285 | .flags = IORESOURCE_IRQ, | 
|  | 286 | } | 
|  | 287 |  | 
|  | 288 | }; | 
|  | 289 |  | 
|  | 290 | struct platform_device s3c_device_i2c = { | 
|  | 291 | .name		  = "s3c2410-i2c", | 
|  | 292 | .id		  = -1, | 
|  | 293 | .num_resources	  = ARRAY_SIZE(s3c_i2c_resource), | 
|  | 294 | .resource	  = s3c_i2c_resource, | 
|  | 295 | }; | 
|  | 296 |  | 
|  | 297 | EXPORT_SYMBOL(s3c_device_i2c); | 
|  | 298 |  | 
|  | 299 | /* IIS */ | 
|  | 300 |  | 
|  | 301 | static struct resource s3c_iis_resource[] = { | 
|  | 302 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 303 | .start = S3C24XX_PA_IIS, | 
|  | 304 | .end   = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | .flags = IORESOURCE_MEM, | 
|  | 306 | } | 
|  | 307 | }; | 
|  | 308 |  | 
|  | 309 | static u64 s3c_device_iis_dmamask = 0xffffffffUL; | 
|  | 310 |  | 
|  | 311 | struct platform_device s3c_device_iis = { | 
|  | 312 | .name		  = "s3c2410-iis", | 
|  | 313 | .id		  = -1, | 
|  | 314 | .num_resources	  = ARRAY_SIZE(s3c_iis_resource), | 
|  | 315 | .resource	  = s3c_iis_resource, | 
|  | 316 | .dev              = { | 
|  | 317 | .dma_mask = &s3c_device_iis_dmamask, | 
|  | 318 | .coherent_dma_mask = 0xffffffffUL | 
|  | 319 | } | 
|  | 320 | }; | 
|  | 321 |  | 
|  | 322 | EXPORT_SYMBOL(s3c_device_iis); | 
|  | 323 |  | 
|  | 324 | /* RTC */ | 
|  | 325 |  | 
|  | 326 | static struct resource s3c_rtc_resource[] = { | 
|  | 327 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 328 | .start = S3C24XX_PA_RTC, | 
|  | 329 | .end   = S3C24XX_PA_RTC + 0xff, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | .flags = IORESOURCE_MEM, | 
|  | 331 | }, | 
|  | 332 | [1] = { | 
|  | 333 | .start = IRQ_RTC, | 
|  | 334 | .end   = IRQ_RTC, | 
|  | 335 | .flags = IORESOURCE_IRQ, | 
|  | 336 | }, | 
|  | 337 | [2] = { | 
|  | 338 | .start = IRQ_TICK, | 
|  | 339 | .end   = IRQ_TICK, | 
|  | 340 | .flags = IORESOURCE_IRQ | 
|  | 341 | } | 
|  | 342 | }; | 
|  | 343 |  | 
|  | 344 | struct platform_device s3c_device_rtc = { | 
|  | 345 | .name		  = "s3c2410-rtc", | 
|  | 346 | .id		  = -1, | 
|  | 347 | .num_resources	  = ARRAY_SIZE(s3c_rtc_resource), | 
|  | 348 | .resource	  = s3c_rtc_resource, | 
|  | 349 | }; | 
|  | 350 |  | 
|  | 351 | EXPORT_SYMBOL(s3c_device_rtc); | 
|  | 352 |  | 
|  | 353 | /* ADC */ | 
|  | 354 |  | 
|  | 355 | static struct resource s3c_adc_resource[] = { | 
|  | 356 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 357 | .start = S3C24XX_PA_ADC, | 
|  | 358 | .end   = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | .flags = IORESOURCE_MEM, | 
|  | 360 | }, | 
|  | 361 | [1] = { | 
|  | 362 | .start = IRQ_TC, | 
| Ben Dooks | 083d06e | 2006-02-08 22:03:31 +0000 | [diff] [blame] | 363 | .end   = IRQ_TC, | 
|  | 364 | .flags = IORESOURCE_IRQ, | 
|  | 365 | }, | 
|  | 366 | [2] = { | 
|  | 367 | .start = IRQ_ADC, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | .end   = IRQ_ADC, | 
|  | 369 | .flags = IORESOURCE_IRQ, | 
|  | 370 | } | 
|  | 371 |  | 
|  | 372 | }; | 
|  | 373 |  | 
|  | 374 | struct platform_device s3c_device_adc = { | 
|  | 375 | .name		  = "s3c2410-adc", | 
|  | 376 | .id		  = -1, | 
|  | 377 | .num_resources	  = ARRAY_SIZE(s3c_adc_resource), | 
|  | 378 | .resource	  = s3c_adc_resource, | 
|  | 379 | }; | 
|  | 380 |  | 
|  | 381 | /* SDI */ | 
|  | 382 |  | 
|  | 383 | static struct resource s3c_sdi_resource[] = { | 
|  | 384 | [0] = { | 
|  | 385 | .start = S3C2410_PA_SDI, | 
| Ben Dooks | a0e0adb | 2005-10-28 15:26:42 +0100 | [diff] [blame] | 386 | .end   = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 387 | .flags = IORESOURCE_MEM, | 
|  | 388 | }, | 
|  | 389 | [1] = { | 
|  | 390 | .start = IRQ_SDI, | 
|  | 391 | .end   = IRQ_SDI, | 
|  | 392 | .flags = IORESOURCE_IRQ, | 
|  | 393 | } | 
|  | 394 |  | 
|  | 395 | }; | 
|  | 396 |  | 
|  | 397 | struct platform_device s3c_device_sdi = { | 
|  | 398 | .name		  = "s3c2410-sdi", | 
|  | 399 | .id		  = -1, | 
|  | 400 | .num_resources	  = ARRAY_SIZE(s3c_sdi_resource), | 
|  | 401 | .resource	  = s3c_sdi_resource, | 
|  | 402 | }; | 
|  | 403 |  | 
|  | 404 | EXPORT_SYMBOL(s3c_device_sdi); | 
|  | 405 |  | 
| Ben Dooks | 69e9c93 | 2007-05-20 18:13:32 +0100 | [diff] [blame] | 406 | /* High-speed MMC/SD */ | 
|  | 407 |  | 
|  | 408 | static struct resource s3c_hsmmc_resource[] = { | 
|  | 409 | [0] = { | 
|  | 410 | .start = S3C2443_PA_HSMMC, | 
|  | 411 | .end   = S3C2443_PA_HSMMC + S3C2443_SZ_HSMMC - 1, | 
|  | 412 | .flags = IORESOURCE_MEM, | 
|  | 413 | }, | 
|  | 414 | [1] = { | 
|  | 415 | .start = IRQ_S3C2443_HSMMC, | 
|  | 416 | .end   = IRQ_S3C2443_HSMMC, | 
|  | 417 | .flags = IORESOURCE_IRQ, | 
|  | 418 | } | 
|  | 419 | }; | 
|  | 420 |  | 
|  | 421 | static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL; | 
|  | 422 |  | 
|  | 423 | struct platform_device s3c_device_hsmmc = { | 
|  | 424 | .name		  = "s3c-sdhci", | 
|  | 425 | .id		  = -1, | 
|  | 426 | .num_resources	  = ARRAY_SIZE(s3c_hsmmc_resource), | 
|  | 427 | .resource	  = s3c_hsmmc_resource, | 
|  | 428 | .dev              = { | 
|  | 429 | .dma_mask = &s3c_device_hsmmc_dmamask, | 
|  | 430 | .coherent_dma_mask = 0xffffffffUL | 
|  | 431 | } | 
|  | 432 | }; | 
|  | 433 |  | 
|  | 434 |  | 
|  | 435 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | /* SPI (0) */ | 
|  | 437 |  | 
|  | 438 | static struct resource s3c_spi0_resource[] = { | 
|  | 439 | [0] = { | 
| Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 440 | .start = S3C24XX_PA_SPI, | 
|  | 441 | .end   = S3C24XX_PA_SPI + 0x1f, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 442 | .flags = IORESOURCE_MEM, | 
|  | 443 | }, | 
|  | 444 | [1] = { | 
|  | 445 | .start = IRQ_SPI0, | 
|  | 446 | .end   = IRQ_SPI0, | 
|  | 447 | .flags = IORESOURCE_IRQ, | 
|  | 448 | } | 
|  | 449 |  | 
|  | 450 | }; | 
|  | 451 |  | 
| Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 452 | static u64 s3c_device_spi0_dmamask = 0xffffffffUL; | 
|  | 453 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 454 | struct platform_device s3c_device_spi0 = { | 
|  | 455 | .name		  = "s3c2410-spi", | 
|  | 456 | .id		  = 0, | 
|  | 457 | .num_resources	  = ARRAY_SIZE(s3c_spi0_resource), | 
|  | 458 | .resource	  = s3c_spi0_resource, | 
| Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 459 | .dev              = { | 
|  | 460 | .dma_mask = &s3c_device_spi0_dmamask, | 
|  | 461 | .coherent_dma_mask = 0xffffffffUL | 
|  | 462 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 463 | }; | 
|  | 464 |  | 
|  | 465 | EXPORT_SYMBOL(s3c_device_spi0); | 
|  | 466 |  | 
|  | 467 | /* SPI (1) */ | 
|  | 468 |  | 
|  | 469 | static struct resource s3c_spi1_resource[] = { | 
|  | 470 | [0] = { | 
| Sandeep Sanjay Patil | e903382 | 2007-05-16 10:51:45 +0100 | [diff] [blame] | 471 | .start = S3C24XX_PA_SPI + S3C2410_SPI1, | 
|  | 472 | .end   = S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 473 | .flags = IORESOURCE_MEM, | 
|  | 474 | }, | 
|  | 475 | [1] = { | 
|  | 476 | .start = IRQ_SPI1, | 
|  | 477 | .end   = IRQ_SPI1, | 
|  | 478 | .flags = IORESOURCE_IRQ, | 
|  | 479 | } | 
|  | 480 |  | 
|  | 481 | }; | 
|  | 482 |  | 
| Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 483 | static u64 s3c_device_spi1_dmamask = 0xffffffffUL; | 
|  | 484 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 485 | struct platform_device s3c_device_spi1 = { | 
|  | 486 | .name		  = "s3c2410-spi", | 
|  | 487 | .id		  = 1, | 
|  | 488 | .num_resources	  = ARRAY_SIZE(s3c_spi1_resource), | 
|  | 489 | .resource	  = s3c_spi1_resource, | 
| Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 490 | .dev              = { | 
|  | 491 | .dma_mask = &s3c_device_spi1_dmamask, | 
|  | 492 | .coherent_dma_mask = 0xffffffffUL | 
|  | 493 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 494 | }; | 
|  | 495 |  | 
|  | 496 | EXPORT_SYMBOL(s3c_device_spi1); | 
|  | 497 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | #ifdef CONFIG_CPU_S3C2440 | 
|  | 499 |  | 
|  | 500 | /* Camif Controller */ | 
|  | 501 |  | 
|  | 502 | static struct resource s3c_camif_resource[] = { | 
|  | 503 | [0] = { | 
|  | 504 | .start = S3C2440_PA_CAMIF, | 
| Ben Dooks | a0e0adb | 2005-10-28 15:26:42 +0100 | [diff] [blame] | 505 | .end   = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 506 | .flags = IORESOURCE_MEM, | 
|  | 507 | }, | 
|  | 508 | [1] = { | 
|  | 509 | .start = IRQ_CAM, | 
|  | 510 | .end   = IRQ_CAM, | 
|  | 511 | .flags = IORESOURCE_IRQ, | 
|  | 512 | } | 
|  | 513 |  | 
|  | 514 | }; | 
|  | 515 |  | 
|  | 516 | static u64 s3c_device_camif_dmamask = 0xffffffffUL; | 
|  | 517 |  | 
|  | 518 | struct platform_device s3c_device_camif = { | 
|  | 519 | .name		  = "s3c2440-camif", | 
|  | 520 | .id		  = -1, | 
|  | 521 | .num_resources	  = ARRAY_SIZE(s3c_camif_resource), | 
|  | 522 | .resource	  = s3c_camif_resource, | 
|  | 523 | .dev              = { | 
|  | 524 | .dma_mask = &s3c_device_camif_dmamask, | 
|  | 525 | .coherent_dma_mask = 0xffffffffUL | 
|  | 526 | } | 
|  | 527 | }; | 
|  | 528 |  | 
|  | 529 | EXPORT_SYMBOL(s3c_device_camif); | 
|  | 530 |  | 
|  | 531 | #endif // CONFIG_CPU_S32440 |