diff options
Diffstat (limited to 'arch/arm/mach-pxa/devices.c')
| -rw-r--r-- | arch/arm/mach-pxa/devices.c | 177 |
1 files changed, 175 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index d6c05b6eab35..84489dc51d81 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
| @@ -10,11 +10,16 @@ | |||
| 10 | #include <asm/arch/mmc.h> | 10 | #include <asm/arch/mmc.h> |
| 11 | #include <asm/arch/irda.h> | 11 | #include <asm/arch/irda.h> |
| 12 | #include <asm/arch/i2c.h> | 12 | #include <asm/arch/i2c.h> |
| 13 | #include <asm/arch/mfp-pxa27x.h> | ||
| 13 | #include <asm/arch/ohci.h> | 14 | #include <asm/arch/ohci.h> |
| 14 | #include <asm/arch/pxa27x_keypad.h> | 15 | #include <asm/arch/pxa27x_keypad.h> |
| 16 | #include <asm/arch/pxa2xx_spi.h> | ||
| 15 | #include <asm/arch/camera.h> | 17 | #include <asm/arch/camera.h> |
| 18 | #include <asm/arch/audio.h> | ||
| 19 | #include <asm/arch/pxa3xx_nand.h> | ||
| 16 | 20 | ||
| 17 | #include "devices.h" | 21 | #include "devices.h" |
| 22 | #include "generic.h" | ||
| 18 | 23 | ||
| 19 | void __init pxa_register_device(struct platform_device *dev, void *data) | 24 | void __init pxa_register_device(struct platform_device *dev, void *data) |
| 20 | { | 25 | { |
| @@ -91,8 +96,19 @@ static struct resource pxa2xx_udc_resources[] = { | |||
| 91 | 96 | ||
| 92 | static u64 udc_dma_mask = ~(u32)0; | 97 | static u64 udc_dma_mask = ~(u32)0; |
| 93 | 98 | ||
| 94 | struct platform_device pxa_device_udc = { | 99 | struct platform_device pxa25x_device_udc = { |
| 95 | .name = "pxa2xx-udc", | 100 | .name = "pxa25x-udc", |
| 101 | .id = -1, | ||
| 102 | .resource = pxa2xx_udc_resources, | ||
| 103 | .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), | ||
| 104 | .dev = { | ||
| 105 | .platform_data = &pxa_udc_info, | ||
| 106 | .dma_mask = &udc_dma_mask, | ||
| 107 | } | ||
| 108 | }; | ||
| 109 | |||
| 110 | struct platform_device pxa27x_device_udc = { | ||
| 111 | .name = "pxa27x-udc", | ||
| 96 | .id = -1, | 112 | .id = -1, |
| 97 | .resource = pxa2xx_udc_resources, | 113 | .resource = pxa2xx_udc_resources, |
| 98 | .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), | 114 | .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), |
| @@ -233,8 +249,15 @@ struct platform_device pxa_device_i2c = { | |||
| 233 | .num_resources = ARRAY_SIZE(pxai2c_resources), | 249 | .num_resources = ARRAY_SIZE(pxai2c_resources), |
| 234 | }; | 250 | }; |
| 235 | 251 | ||
| 252 | static unsigned long pxa27x_i2c_mfp_cfg[] = { | ||
| 253 | GPIO117_I2C_SCL, | ||
| 254 | GPIO118_I2C_SDA, | ||
| 255 | }; | ||
| 256 | |||
| 236 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) | 257 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) |
| 237 | { | 258 | { |
| 259 | if (cpu_is_pxa27x()) | ||
| 260 | pxa2xx_mfp_config(ARRAY_AND_SIZE(pxa27x_i2c_mfp_cfg)); | ||
| 238 | pxa_register_device(&pxa_device_i2c, info); | 261 | pxa_register_device(&pxa_device_i2c, info); |
| 239 | } | 262 | } |
| 240 | 263 | ||
| @@ -278,8 +301,69 @@ struct platform_device pxa_device_rtc = { | |||
| 278 | .id = -1, | 301 | .id = -1, |
| 279 | }; | 302 | }; |
| 280 | 303 | ||
| 304 | static struct resource pxa_ac97_resources[] = { | ||
| 305 | [0] = { | ||
| 306 | .start = 0x40500000, | ||
| 307 | .end = 0x40500000 + 0xfff, | ||
| 308 | .flags = IORESOURCE_MEM, | ||
| 309 | }, | ||
| 310 | [1] = { | ||
| 311 | .start = IRQ_AC97, | ||
| 312 | .end = IRQ_AC97, | ||
| 313 | .flags = IORESOURCE_IRQ, | ||
| 314 | }, | ||
| 315 | }; | ||
| 316 | |||
| 317 | static u64 pxa_ac97_dmamask = 0xffffffffUL; | ||
| 318 | |||
| 319 | struct platform_device pxa_device_ac97 = { | ||
| 320 | .name = "pxa2xx-ac97", | ||
| 321 | .id = -1, | ||
| 322 | .dev = { | ||
| 323 | .dma_mask = &pxa_ac97_dmamask, | ||
| 324 | .coherent_dma_mask = 0xffffffff, | ||
| 325 | }, | ||
| 326 | .num_resources = ARRAY_SIZE(pxa_ac97_resources), | ||
| 327 | .resource = pxa_ac97_resources, | ||
| 328 | }; | ||
| 329 | |||
| 330 | void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops) | ||
| 331 | { | ||
| 332 | pxa_register_device(&pxa_device_ac97, ops); | ||
| 333 | } | ||
| 334 | |||
| 281 | #ifdef CONFIG_PXA25x | 335 | #ifdef CONFIG_PXA25x |
| 282 | 336 | ||
| 337 | static struct resource pxa25x_resource_pwm0[] = { | ||
| 338 | [0] = { | ||
| 339 | .start = 0x40b00000, | ||
| 340 | .end = 0x40b0000f, | ||
| 341 | .flags = IORESOURCE_MEM, | ||
| 342 | }, | ||
| 343 | }; | ||
| 344 | |||
| 345 | struct platform_device pxa25x_device_pwm0 = { | ||
| 346 | .name = "pxa25x-pwm", | ||
| 347 | .id = 0, | ||
| 348 | .resource = pxa25x_resource_pwm0, | ||
| 349 | .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0), | ||
| 350 | }; | ||
| 351 | |||
| 352 | static struct resource pxa25x_resource_pwm1[] = { | ||
| 353 | [0] = { | ||
| 354 | .start = 0x40c00000, | ||
| 355 | .end = 0x40c0000f, | ||
| 356 | .flags = IORESOURCE_MEM, | ||
| 357 | }, | ||
| 358 | }; | ||
| 359 | |||
| 360 | struct platform_device pxa25x_device_pwm1 = { | ||
| 361 | .name = "pxa25x-pwm", | ||
| 362 | .id = 1, | ||
| 363 | .resource = pxa25x_resource_pwm1, | ||
| 364 | .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1), | ||
| 365 | }; | ||
| 366 | |||
| 283 | static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32); | 367 | static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32); |
| 284 | 368 | ||
| 285 | static struct resource pxa25x_resource_ssp[] = { | 369 | static struct resource pxa25x_resource_ssp[] = { |
| @@ -568,6 +652,36 @@ struct platform_device pxa27x_device_ssp3 = { | |||
| 568 | .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3), | 652 | .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3), |
| 569 | }; | 653 | }; |
| 570 | 654 | ||
| 655 | static struct resource pxa27x_resource_pwm0[] = { | ||
| 656 | [0] = { | ||
| 657 | .start = 0x40b00000, | ||
| 658 | .end = 0x40b0001f, | ||
| 659 | .flags = IORESOURCE_MEM, | ||
| 660 | }, | ||
| 661 | }; | ||
| 662 | |||
| 663 | struct platform_device pxa27x_device_pwm0 = { | ||
| 664 | .name = "pxa27x-pwm", | ||
| 665 | .id = 0, | ||
| 666 | .resource = pxa27x_resource_pwm0, | ||
| 667 | .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0), | ||
| 668 | }; | ||
| 669 | |||
| 670 | static struct resource pxa27x_resource_pwm1[] = { | ||
| 671 | [0] = { | ||
| 672 | .start = 0x40c00000, | ||
| 673 | .end = 0x40c0001f, | ||
| 674 | .flags = IORESOURCE_MEM, | ||
| 675 | }, | ||
| 676 | }; | ||
| 677 | |||
| 678 | struct platform_device pxa27x_device_pwm1 = { | ||
| 679 | .name = "pxa27x-pwm", | ||
| 680 | .id = 1, | ||
| 681 | .resource = pxa27x_resource_pwm1, | ||
| 682 | .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), | ||
| 683 | }; | ||
| 684 | |||
| 571 | static struct resource pxa27x_resource_camera[] = { | 685 | static struct resource pxa27x_resource_camera[] = { |
| 572 | [0] = { | 686 | [0] = { |
| 573 | .start = 0x50000000, | 687 | .start = 0x50000000, |
| @@ -718,4 +832,63 @@ void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info) | |||
| 718 | pxa_register_device(&pxa3xx_device_mci3, info); | 832 | pxa_register_device(&pxa3xx_device_mci3, info); |
| 719 | } | 833 | } |
| 720 | 834 | ||
| 835 | static struct resource pxa3xx_resources_nand[] = { | ||
| 836 | [0] = { | ||
| 837 | .start = 0x43100000, | ||
| 838 | .end = 0x43100053, | ||
| 839 | .flags = IORESOURCE_MEM, | ||
| 840 | }, | ||
| 841 | [1] = { | ||
| 842 | .start = IRQ_NAND, | ||
| 843 | .end = IRQ_NAND, | ||
| 844 | .flags = IORESOURCE_IRQ, | ||
| 845 | }, | ||
| 846 | [2] = { | ||
| 847 | /* DRCMR for Data DMA */ | ||
| 848 | .start = 97, | ||
| 849 | .end = 97, | ||
| 850 | .flags = IORESOURCE_DMA, | ||
| 851 | }, | ||
| 852 | [3] = { | ||
| 853 | /* DRCMR for Command DMA */ | ||
| 854 | .start = 99, | ||
| 855 | .end = 99, | ||
| 856 | .flags = IORESOURCE_DMA, | ||
| 857 | }, | ||
| 858 | }; | ||
| 859 | |||
| 860 | static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32); | ||
| 861 | |||
| 862 | struct platform_device pxa3xx_device_nand = { | ||
| 863 | .name = "pxa3xx-nand", | ||
| 864 | .id = -1, | ||
| 865 | .dev = { | ||
| 866 | .dma_mask = &pxa3xx_nand_dma_mask, | ||
| 867 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 868 | }, | ||
| 869 | .num_resources = ARRAY_SIZE(pxa3xx_resources_nand), | ||
| 870 | .resource = pxa3xx_resources_nand, | ||
| 871 | }; | ||
| 872 | |||
| 873 | void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info) | ||
| 874 | { | ||
| 875 | pxa_register_device(&pxa3xx_device_nand, info); | ||
| 876 | } | ||
| 721 | #endif /* CONFIG_PXA3xx */ | 877 | #endif /* CONFIG_PXA3xx */ |
| 878 | |||
| 879 | /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. | ||
| 880 | * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ | ||
| 881 | void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info) | ||
| 882 | { | ||
| 883 | struct platform_device *pd; | ||
| 884 | |||
| 885 | pd = platform_device_alloc("pxa2xx-spi", id); | ||
| 886 | if (pd == NULL) { | ||
| 887 | printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n", | ||
| 888 | id); | ||
| 889 | return; | ||
| 890 | } | ||
| 891 | |||
| 892 | pd->dev.platform_data = info; | ||
| 893 | platform_device_add(pd); | ||
| 894 | } | ||
