Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-pxa/generic.c |
| 3 | * |
| 4 | * Author: Nicolas Pitre |
| 5 | * Created: Jun 15, 2001 |
| 6 | * Copyright: MontaVista Software Inc. |
| 7 | * |
| 8 | * Code common to all PXA machines. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. |
| 13 | * |
| 14 | * Since this file should be linked before any other machine specific file, |
| 15 | * the __initcall() here will be executed first. This serves as default |
| 16 | * initialization stuff for PXA machines which can be overridden later if |
| 17 | * need be. |
| 18 | */ |
| 19 | #include <linux/module.h> |
| 20 | #include <linux/kernel.h> |
| 21 | #include <linux/init.h> |
| 22 | #include <linux/delay.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 23 | #include <linux/platform_device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <linux/ioport.h> |
| 25 | #include <linux/pm.h> |
Tim Schmielau | 4e57b68 | 2005-10-30 15:03:48 -0800 | [diff] [blame] | 26 | #include <linux/string.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
| 28 | #include <asm/hardware.h> |
| 29 | #include <asm/irq.h> |
| 30 | #include <asm/system.h> |
| 31 | #include <asm/pgtable.h> |
| 32 | #include <asm/mach/map.h> |
| 33 | |
| 34 | #include <asm/arch/pxa-regs.h> |
Philipp Zabel | 3deac04 | 2007-02-20 13:58:15 -0800 | [diff] [blame] | 35 | #include <asm/arch/gpio.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | #include <asm/arch/udc.h> |
| 37 | #include <asm/arch/pxafb.h> |
| 38 | #include <asm/arch/mmc.h> |
Nicolas Pitre | 6f475c0 | 2005-10-28 16:39:33 +0100 | [diff] [blame] | 39 | #include <asm/arch/irda.h> |
Russell King | eb9181a | 2005-09-29 09:49:25 +0100 | [diff] [blame] | 40 | #include <asm/arch/i2c.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Russell King | 46c41e6 | 2007-05-15 15:39:36 +0100 | [diff] [blame] | 42 | #include "devices.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | #include "generic.h" |
| 44 | |
| 45 | /* |
Russell King | 15a4033 | 2007-08-20 10:07:44 +0100 | [diff] [blame] | 46 | * Get the clock frequency as reflected by CCCR and the turbo flag. |
| 47 | * We assume these values have been applied via a fcs. |
| 48 | * If info is not 0 we also display the current settings. |
| 49 | */ |
| 50 | unsigned int get_clk_frequency_khz(int info) |
| 51 | { |
| 52 | if (cpu_is_pxa21x() || cpu_is_pxa25x()) |
| 53 | return pxa25x_get_clk_frequency_khz(info); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame^] | 54 | else if (cpu_is_pxa27x()) |
Russell King | 15a4033 | 2007-08-20 10:07:44 +0100 | [diff] [blame] | 55 | return pxa27x_get_clk_frequency_khz(info); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame^] | 56 | else |
| 57 | return pxa3xx_get_clk_frequency_khz(info); |
Russell King | 15a4033 | 2007-08-20 10:07:44 +0100 | [diff] [blame] | 58 | } |
| 59 | EXPORT_SYMBOL(get_clk_frequency_khz); |
| 60 | |
| 61 | /* |
| 62 | * Return the current memory clock frequency in units of 10kHz |
| 63 | */ |
| 64 | unsigned int get_memclk_frequency_10khz(void) |
| 65 | { |
| 66 | if (cpu_is_pxa21x() || cpu_is_pxa25x()) |
| 67 | return pxa25x_get_memclk_frequency_10khz(); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame^] | 68 | else if (cpu_is_pxa27x()) |
Russell King | 15a4033 | 2007-08-20 10:07:44 +0100 | [diff] [blame] | 69 | return pxa27x_get_memclk_frequency_10khz(); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame^] | 70 | else |
| 71 | return pxa3xx_get_memclk_frequency_10khz(); |
Russell King | 15a4033 | 2007-08-20 10:07:44 +0100 | [diff] [blame] | 72 | } |
| 73 | EXPORT_SYMBOL(get_memclk_frequency_10khz); |
| 74 | |
| 75 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | * Handy function to set GPIO alternate functions |
| 77 | */ |
eric miao | 30f0b40 | 2007-08-29 10:18:47 +0100 | [diff] [blame] | 78 | int pxa_last_gpio; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | |
Philipp Zabel | 3deac04 | 2007-02-20 13:58:15 -0800 | [diff] [blame] | 80 | int pxa_gpio_mode(int gpio_mode) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | { |
| 82 | unsigned long flags; |
| 83 | int gpio = gpio_mode & GPIO_MD_MASK_NR; |
| 84 | int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8; |
| 85 | int gafr; |
| 86 | |
eric miao | 30f0b40 | 2007-08-29 10:18:47 +0100 | [diff] [blame] | 87 | if (gpio > pxa_last_gpio) |
Philipp Zabel | 3deac04 | 2007-02-20 13:58:15 -0800 | [diff] [blame] | 88 | return -EINVAL; |
| 89 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | local_irq_save(flags); |
| 91 | if (gpio_mode & GPIO_DFLT_LOW) |
| 92 | GPCR(gpio) = GPIO_bit(gpio); |
| 93 | else if (gpio_mode & GPIO_DFLT_HIGH) |
| 94 | GPSR(gpio) = GPIO_bit(gpio); |
| 95 | if (gpio_mode & GPIO_MD_MASK_DIR) |
| 96 | GPDR(gpio) |= GPIO_bit(gpio); |
| 97 | else |
| 98 | GPDR(gpio) &= ~GPIO_bit(gpio); |
| 99 | gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2)); |
| 100 | GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2)); |
| 101 | local_irq_restore(flags); |
Philipp Zabel | 3deac04 | 2007-02-20 13:58:15 -0800 | [diff] [blame] | 102 | |
| 103 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | EXPORT_SYMBOL(pxa_gpio_mode); |
| 107 | |
| 108 | /* |
Philipp Zabel | 3deac04 | 2007-02-20 13:58:15 -0800 | [diff] [blame] | 109 | * Return GPIO level |
| 110 | */ |
| 111 | int pxa_gpio_get_value(unsigned gpio) |
| 112 | { |
| 113 | return __gpio_get_value(gpio); |
| 114 | } |
| 115 | |
| 116 | EXPORT_SYMBOL(pxa_gpio_get_value); |
| 117 | |
| 118 | /* |
| 119 | * Set output GPIO level |
| 120 | */ |
| 121 | void pxa_gpio_set_value(unsigned gpio, int value) |
| 122 | { |
| 123 | __gpio_set_value(gpio, value); |
| 124 | } |
| 125 | |
| 126 | EXPORT_SYMBOL(pxa_gpio_set_value); |
| 127 | |
| 128 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | * Routine to safely enable or disable a clock in the CKEN |
| 130 | */ |
Russell King | a7073b8 | 2007-09-19 09:33:55 +0100 | [diff] [blame] | 131 | void __pxa_set_cken(int clock, int enable) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | { |
| 133 | unsigned long flags; |
| 134 | local_irq_save(flags); |
| 135 | |
| 136 | if (enable) |
Eric Miao | 7053acb | 2007-04-05 04:07:20 +0100 | [diff] [blame] | 137 | CKEN |= (1 << clock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | else |
Eric Miao | 7053acb | 2007-04-05 04:07:20 +0100 | [diff] [blame] | 139 | CKEN &= ~(1 << clock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | |
| 141 | local_irq_restore(flags); |
| 142 | } |
| 143 | |
Russell King | a7073b8 | 2007-09-19 09:33:55 +0100 | [diff] [blame] | 144 | EXPORT_SYMBOL(__pxa_set_cken); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | |
| 146 | /* |
| 147 | * Intel PXA2xx internal register mapping. |
| 148 | * |
| 149 | * Note 1: not all PXA2xx variants implement all those addresses. |
| 150 | * |
| 151 | * Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table |
| 152 | * and cache flush area. |
| 153 | */ |
| 154 | static struct map_desc standard_io_desc[] __initdata = { |
Deepak Saxena | 6f9182e | 2005-10-28 15:19:01 +0100 | [diff] [blame] | 155 | { /* Devs */ |
| 156 | .virtual = 0xf2000000, |
| 157 | .pfn = __phys_to_pfn(0x40000000), |
| 158 | .length = 0x02000000, |
| 159 | .type = MT_DEVICE |
| 160 | }, { /* LCD */ |
| 161 | .virtual = 0xf4000000, |
| 162 | .pfn = __phys_to_pfn(0x44000000), |
| 163 | .length = 0x00100000, |
| 164 | .type = MT_DEVICE |
| 165 | }, { /* Mem Ctl */ |
| 166 | .virtual = 0xf6000000, |
| 167 | .pfn = __phys_to_pfn(0x48000000), |
| 168 | .length = 0x00100000, |
| 169 | .type = MT_DEVICE |
| 170 | }, { /* USB host */ |
| 171 | .virtual = 0xf8000000, |
| 172 | .pfn = __phys_to_pfn(0x4c000000), |
| 173 | .length = 0x00100000, |
| 174 | .type = MT_DEVICE |
| 175 | }, { /* Camera */ |
| 176 | .virtual = 0xfa000000, |
| 177 | .pfn = __phys_to_pfn(0x50000000), |
| 178 | .length = 0x00100000, |
| 179 | .type = MT_DEVICE |
| 180 | }, { /* IMem ctl */ |
| 181 | .virtual = 0xfe000000, |
| 182 | .pfn = __phys_to_pfn(0x58000000), |
| 183 | .length = 0x00100000, |
| 184 | .type = MT_DEVICE |
| 185 | }, { /* UNCACHED_PHYS_0 */ |
| 186 | .virtual = 0xff000000, |
| 187 | .pfn = __phys_to_pfn(0x00000000), |
| 188 | .length = 0x00100000, |
| 189 | .type = MT_DEVICE |
| 190 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | }; |
| 192 | |
| 193 | void __init pxa_map_io(void) |
| 194 | { |
| 195 | iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); |
| 196 | get_clk_frequency_khz(1); |
| 197 | } |
| 198 | |
| 199 | |
| 200 | static struct resource pxamci_resources[] = { |
| 201 | [0] = { |
| 202 | .start = 0x41100000, |
| 203 | .end = 0x41100fff, |
| 204 | .flags = IORESOURCE_MEM, |
| 205 | }, |
| 206 | [1] = { |
| 207 | .start = IRQ_MMC, |
| 208 | .end = IRQ_MMC, |
| 209 | .flags = IORESOURCE_IRQ, |
| 210 | }, |
| 211 | }; |
| 212 | |
| 213 | static u64 pxamci_dmamask = 0xffffffffUL; |
| 214 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 215 | struct platform_device pxa_device_mci = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | .name = "pxa2xx-mci", |
| 217 | .id = -1, |
| 218 | .dev = { |
| 219 | .dma_mask = &pxamci_dmamask, |
| 220 | .coherent_dma_mask = 0xffffffff, |
| 221 | }, |
| 222 | .num_resources = ARRAY_SIZE(pxamci_resources), |
| 223 | .resource = pxamci_resources, |
| 224 | }; |
| 225 | |
| 226 | void __init pxa_set_mci_info(struct pxamci_platform_data *info) |
| 227 | { |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 228 | pxa_device_mci.dev.platform_data = info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | |
| 232 | static struct pxa2xx_udc_mach_info pxa_udc_info; |
| 233 | |
| 234 | void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info) |
| 235 | { |
| 236 | memcpy(&pxa_udc_info, info, sizeof *info); |
| 237 | } |
| 238 | |
| 239 | static struct resource pxa2xx_udc_resources[] = { |
| 240 | [0] = { |
| 241 | .start = 0x40600000, |
| 242 | .end = 0x4060ffff, |
| 243 | .flags = IORESOURCE_MEM, |
| 244 | }, |
| 245 | [1] = { |
| 246 | .start = IRQ_USB, |
| 247 | .end = IRQ_USB, |
| 248 | .flags = IORESOURCE_IRQ, |
| 249 | }, |
| 250 | }; |
| 251 | |
| 252 | static u64 udc_dma_mask = ~(u32)0; |
| 253 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 254 | struct platform_device pxa_device_udc = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | .name = "pxa2xx-udc", |
| 256 | .id = -1, |
| 257 | .resource = pxa2xx_udc_resources, |
| 258 | .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), |
| 259 | .dev = { |
| 260 | .platform_data = &pxa_udc_info, |
| 261 | .dma_mask = &udc_dma_mask, |
| 262 | } |
| 263 | }; |
| 264 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | static struct resource pxafb_resources[] = { |
| 266 | [0] = { |
| 267 | .start = 0x44000000, |
| 268 | .end = 0x4400ffff, |
| 269 | .flags = IORESOURCE_MEM, |
| 270 | }, |
| 271 | [1] = { |
| 272 | .start = IRQ_LCD, |
| 273 | .end = IRQ_LCD, |
| 274 | .flags = IORESOURCE_IRQ, |
| 275 | }, |
| 276 | }; |
| 277 | |
| 278 | static u64 fb_dma_mask = ~(u64)0; |
| 279 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 280 | struct platform_device pxa_device_fb = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 | .name = "pxa2xx-fb", |
| 282 | .id = -1, |
| 283 | .dev = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | .dma_mask = &fb_dma_mask, |
| 285 | .coherent_dma_mask = 0xffffffff, |
| 286 | }, |
| 287 | .num_resources = ARRAY_SIZE(pxafb_resources), |
| 288 | .resource = pxafb_resources, |
| 289 | }; |
| 290 | |
Richard Purdie | d14b272 | 2006-09-20 22:54:21 +0100 | [diff] [blame] | 291 | void __init set_pxa_fb_info(struct pxafb_mach_info *info) |
| 292 | { |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 293 | pxa_device_fb.dev.platform_data = info; |
Richard Purdie | d14b272 | 2006-09-20 22:54:21 +0100 | [diff] [blame] | 294 | } |
| 295 | |
Richard Purdie | cb38c56 | 2005-10-14 16:07:25 +0100 | [diff] [blame] | 296 | void __init set_pxa_fb_parent(struct device *parent_dev) |
| 297 | { |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 298 | pxa_device_fb.dev.parent = parent_dev; |
Richard Purdie | cb38c56 | 2005-10-14 16:07:25 +0100 | [diff] [blame] | 299 | } |
| 300 | |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 301 | static struct resource pxa_resource_ffuart[] = { |
| 302 | { |
| 303 | .start = __PREG(FFUART), |
| 304 | .end = __PREG(FFUART) + 35, |
| 305 | .flags = IORESOURCE_MEM, |
| 306 | }, { |
| 307 | .start = IRQ_FFUART, |
| 308 | .end = IRQ_FFUART, |
| 309 | .flags = IORESOURCE_IRQ, |
| 310 | } |
| 311 | }; |
| 312 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 313 | struct platform_device pxa_device_ffuart= { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | .name = "pxa2xx-uart", |
| 315 | .id = 0, |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 316 | .resource = pxa_resource_ffuart, |
| 317 | .num_resources = ARRAY_SIZE(pxa_resource_ffuart), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | }; |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 319 | |
| 320 | static struct resource pxa_resource_btuart[] = { |
| 321 | { |
| 322 | .start = __PREG(BTUART), |
| 323 | .end = __PREG(BTUART) + 35, |
| 324 | .flags = IORESOURCE_MEM, |
| 325 | }, { |
| 326 | .start = IRQ_BTUART, |
| 327 | .end = IRQ_BTUART, |
| 328 | .flags = IORESOURCE_IRQ, |
| 329 | } |
| 330 | }; |
| 331 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 332 | struct platform_device pxa_device_btuart = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | .name = "pxa2xx-uart", |
| 334 | .id = 1, |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 335 | .resource = pxa_resource_btuart, |
| 336 | .num_resources = ARRAY_SIZE(pxa_resource_btuart), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | }; |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 338 | |
| 339 | static struct resource pxa_resource_stuart[] = { |
| 340 | { |
| 341 | .start = __PREG(STUART), |
| 342 | .end = __PREG(STUART) + 35, |
| 343 | .flags = IORESOURCE_MEM, |
| 344 | }, { |
| 345 | .start = IRQ_STUART, |
| 346 | .end = IRQ_STUART, |
| 347 | .flags = IORESOURCE_IRQ, |
| 348 | } |
| 349 | }; |
| 350 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 351 | struct platform_device pxa_device_stuart = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | .name = "pxa2xx-uart", |
| 353 | .id = 2, |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 354 | .resource = pxa_resource_stuart, |
| 355 | .num_resources = ARRAY_SIZE(pxa_resource_stuart), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | }; |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 357 | |
| 358 | static struct resource pxa_resource_hwuart[] = { |
| 359 | { |
| 360 | .start = __PREG(HWUART), |
| 361 | .end = __PREG(HWUART) + 47, |
| 362 | .flags = IORESOURCE_MEM, |
| 363 | }, { |
| 364 | .start = IRQ_HWUART, |
| 365 | .end = IRQ_HWUART, |
| 366 | .flags = IORESOURCE_IRQ, |
| 367 | } |
| 368 | }; |
| 369 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 370 | struct platform_device pxa_device_hwuart = { |
Matt Reimer | d9e2964 | 2005-10-28 16:25:02 +0100 | [diff] [blame] | 371 | .name = "pxa2xx-uart", |
| 372 | .id = 3, |
Russell King | e259a3a | 2007-08-20 09:47:41 +0100 | [diff] [blame] | 373 | .resource = pxa_resource_hwuart, |
| 374 | .num_resources = ARRAY_SIZE(pxa_resource_hwuart), |
Matt Reimer | d9e2964 | 2005-10-28 16:25:02 +0100 | [diff] [blame] | 375 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | |
Russell King | 34f3231 | 2007-05-15 10:39:49 +0100 | [diff] [blame] | 377 | static struct resource pxai2c_resources[] = { |
Russell King | bb9bffc | 2005-04-30 13:26:06 +0100 | [diff] [blame] | 378 | { |
| 379 | .start = 0x40301680, |
| 380 | .end = 0x403016a3, |
| 381 | .flags = IORESOURCE_MEM, |
| 382 | }, { |
| 383 | .start = IRQ_I2C, |
| 384 | .end = IRQ_I2C, |
| 385 | .flags = IORESOURCE_IRQ, |
| 386 | }, |
| 387 | }; |
| 388 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 389 | struct platform_device pxa_device_i2c = { |
Russell King | bb9bffc | 2005-04-30 13:26:06 +0100 | [diff] [blame] | 390 | .name = "pxa2xx-i2c", |
| 391 | .id = 0, |
Russell King | 34f3231 | 2007-05-15 10:39:49 +0100 | [diff] [blame] | 392 | .resource = pxai2c_resources, |
| 393 | .num_resources = ARRAY_SIZE(pxai2c_resources), |
Russell King | bb9bffc | 2005-04-30 13:26:06 +0100 | [diff] [blame] | 394 | }; |
| 395 | |
| 396 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) |
| 397 | { |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 398 | pxa_device_i2c.dev.platform_data = info; |
Russell King | bb9bffc | 2005-04-30 13:26:06 +0100 | [diff] [blame] | 399 | } |
| 400 | |
Russell King | 34f3231 | 2007-05-15 10:39:49 +0100 | [diff] [blame] | 401 | static struct resource pxai2s_resources[] = { |
Matt Reimer | b2640b4 | 2005-10-20 23:21:18 +0100 | [diff] [blame] | 402 | { |
| 403 | .start = 0x40400000, |
| 404 | .end = 0x40400083, |
| 405 | .flags = IORESOURCE_MEM, |
| 406 | }, { |
| 407 | .start = IRQ_I2S, |
| 408 | .end = IRQ_I2S, |
| 409 | .flags = IORESOURCE_IRQ, |
| 410 | }, |
| 411 | }; |
| 412 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 413 | struct platform_device pxa_device_i2s = { |
Matt Reimer | b2640b4 | 2005-10-20 23:21:18 +0100 | [diff] [blame] | 414 | .name = "pxa2xx-i2s", |
| 415 | .id = -1, |
Russell King | 34f3231 | 2007-05-15 10:39:49 +0100 | [diff] [blame] | 416 | .resource = pxai2s_resources, |
| 417 | .num_resources = ARRAY_SIZE(pxai2s_resources), |
Matt Reimer | b2640b4 | 2005-10-20 23:21:18 +0100 | [diff] [blame] | 418 | }; |
| 419 | |
Nicolas Pitre | 6f475c0 | 2005-10-28 16:39:33 +0100 | [diff] [blame] | 420 | static u64 pxaficp_dmamask = ~(u32)0; |
| 421 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 422 | struct platform_device pxa_device_ficp = { |
Nicolas Pitre | 6f475c0 | 2005-10-28 16:39:33 +0100 | [diff] [blame] | 423 | .name = "pxa2xx-ir", |
| 424 | .id = -1, |
| 425 | .dev = { |
| 426 | .dma_mask = &pxaficp_dmamask, |
| 427 | .coherent_dma_mask = 0xffffffff, |
| 428 | }, |
| 429 | }; |
| 430 | |
| 431 | void __init pxa_set_ficp_info(struct pxaficp_platform_data *info) |
| 432 | { |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 433 | pxa_device_ficp.dev.platform_data = info; |
Nicolas Pitre | 6f475c0 | 2005-10-28 16:39:33 +0100 | [diff] [blame] | 434 | } |
| 435 | |
Eric Miao | e09d02e | 2007-07-17 10:45:58 +0100 | [diff] [blame] | 436 | struct platform_device pxa_device_rtc = { |
Richard Purdie | e842f1c | 2006-03-27 01:16:46 -0800 | [diff] [blame] | 437 | .name = "sa1100-rtc", |
| 438 | .id = -1, |
| 439 | }; |