18f58de7cSeric miao #include <linux/module.h> 28f58de7cSeric miao #include <linux/kernel.h> 38f58de7cSeric miao #include <linux/init.h> 48f58de7cSeric miao #include <linux/platform_device.h> 58f58de7cSeric miao #include <linux/dma-mapping.h> 68f58de7cSeric miao 709a5358dSEric Miao #include <asm/pmu.h> 8a09e64fbSRussell King #include <mach/udc.h> 969f22be7SIgor Grinberg #include <mach/pxa3xx-u2d.h> 10a09e64fbSRussell King #include <mach/pxafb.h> 11a09e64fbSRussell King #include <mach/mmc.h> 12a09e64fbSRussell King #include <mach/irda.h> 13a09e64fbSRussell King #include <mach/ohci.h> 144a2490eaSMark F. Brown #include <plat/pxa27x_keypad.h> 15a09e64fbSRussell King #include <mach/pxa2xx_spi.h> 16a09e64fbSRussell King #include <mach/camera.h> 17a09e64fbSRussell King #include <mach/audio.h> 1875e874c6SEric Miao #include <mach/hardware.h> 1982b95ecbSHaojian Zhuang #include <plat/i2c.h> 2082b95ecbSHaojian Zhuang #include <plat/pxa3xx_nand.h> 218f58de7cSeric miao 228f58de7cSeric miao #include "devices.h" 23bc3a5959SPhilipp Zabel #include "generic.h" 248f58de7cSeric miao 258f58de7cSeric miao void __init pxa_register_device(struct platform_device *dev, void *data) 268f58de7cSeric miao { 278f58de7cSeric miao int ret; 288f58de7cSeric miao 298f58de7cSeric miao dev->dev.platform_data = data; 308f58de7cSeric miao 318f58de7cSeric miao ret = platform_device_register(dev); 328f58de7cSeric miao if (ret) 338f58de7cSeric miao dev_err(&dev->dev, "unable to register device: %d\n", ret); 348f58de7cSeric miao } 358f58de7cSeric miao 3609a5358dSEric Miao static struct resource pxa_resource_pmu = { 3709a5358dSEric Miao .start = IRQ_PMU, 3809a5358dSEric Miao .end = IRQ_PMU, 3909a5358dSEric Miao .flags = IORESOURCE_IRQ, 4009a5358dSEric Miao }; 4109a5358dSEric Miao 4209a5358dSEric Miao struct platform_device pxa_device_pmu = { 4309a5358dSEric Miao .name = "arm-pmu", 4409a5358dSEric Miao .id = ARM_PMU_DEVICE_CPU, 4509a5358dSEric Miao .resource = &pxa_resource_pmu, 4609a5358dSEric Miao .num_resources = 1, 4709a5358dSEric Miao }; 4809a5358dSEric Miao 498f58de7cSeric miao static struct resource pxamci_resources[] = { 508f58de7cSeric miao [0] = { 518f58de7cSeric miao .start = 0x41100000, 528f58de7cSeric miao .end = 0x41100fff, 538f58de7cSeric miao .flags = IORESOURCE_MEM, 548f58de7cSeric miao }, 558f58de7cSeric miao [1] = { 568f58de7cSeric miao .start = IRQ_MMC, 578f58de7cSeric miao .end = IRQ_MMC, 588f58de7cSeric miao .flags = IORESOURCE_IRQ, 598f58de7cSeric miao }, 608f58de7cSeric miao [2] = { 618f58de7cSeric miao .start = 21, 628f58de7cSeric miao .end = 21, 638f58de7cSeric miao .flags = IORESOURCE_DMA, 648f58de7cSeric miao }, 658f58de7cSeric miao [3] = { 668f58de7cSeric miao .start = 22, 678f58de7cSeric miao .end = 22, 688f58de7cSeric miao .flags = IORESOURCE_DMA, 698f58de7cSeric miao }, 708f58de7cSeric miao }; 718f58de7cSeric miao 728f58de7cSeric miao static u64 pxamci_dmamask = 0xffffffffUL; 738f58de7cSeric miao 748f58de7cSeric miao struct platform_device pxa_device_mci = { 758f58de7cSeric miao .name = "pxa2xx-mci", 76fafc9d3fSBridge Wu .id = 0, 778f58de7cSeric miao .dev = { 788f58de7cSeric miao .dma_mask = &pxamci_dmamask, 798f58de7cSeric miao .coherent_dma_mask = 0xffffffff, 808f58de7cSeric miao }, 818f58de7cSeric miao .num_resources = ARRAY_SIZE(pxamci_resources), 828f58de7cSeric miao .resource = pxamci_resources, 838f58de7cSeric miao }; 848f58de7cSeric miao 858f58de7cSeric miao void __init pxa_set_mci_info(struct pxamci_platform_data *info) 868f58de7cSeric miao { 878f58de7cSeric miao pxa_register_device(&pxa_device_mci, info); 888f58de7cSeric miao } 898f58de7cSeric miao 908f58de7cSeric miao 911257629bSPhilipp Zabel static struct pxa2xx_udc_mach_info pxa_udc_info = { 921257629bSPhilipp Zabel .gpio_pullup = -1, 931257629bSPhilipp Zabel .gpio_vbus = -1, 941257629bSPhilipp Zabel }; 958f58de7cSeric miao 968f58de7cSeric miao void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info) 978f58de7cSeric miao { 988f58de7cSeric miao memcpy(&pxa_udc_info, info, sizeof *info); 998f58de7cSeric miao } 1008f58de7cSeric miao 1018f58de7cSeric miao static struct resource pxa2xx_udc_resources[] = { 1028f58de7cSeric miao [0] = { 1038f58de7cSeric miao .start = 0x40600000, 1048f58de7cSeric miao .end = 0x4060ffff, 1058f58de7cSeric miao .flags = IORESOURCE_MEM, 1068f58de7cSeric miao }, 1078f58de7cSeric miao [1] = { 1088f58de7cSeric miao .start = IRQ_USB, 1098f58de7cSeric miao .end = IRQ_USB, 1108f58de7cSeric miao .flags = IORESOURCE_IRQ, 1118f58de7cSeric miao }, 1128f58de7cSeric miao }; 1138f58de7cSeric miao 1148f58de7cSeric miao static u64 udc_dma_mask = ~(u32)0; 1158f58de7cSeric miao 1167a857620SPhilipp Zabel struct platform_device pxa25x_device_udc = { 1177a857620SPhilipp Zabel .name = "pxa25x-udc", 1187a857620SPhilipp Zabel .id = -1, 1197a857620SPhilipp Zabel .resource = pxa2xx_udc_resources, 1207a857620SPhilipp Zabel .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), 1217a857620SPhilipp Zabel .dev = { 1227a857620SPhilipp Zabel .platform_data = &pxa_udc_info, 1237a857620SPhilipp Zabel .dma_mask = &udc_dma_mask, 1247a857620SPhilipp Zabel } 1257a857620SPhilipp Zabel }; 1267a857620SPhilipp Zabel 1277a857620SPhilipp Zabel struct platform_device pxa27x_device_udc = { 1287a857620SPhilipp Zabel .name = "pxa27x-udc", 1298f58de7cSeric miao .id = -1, 1308f58de7cSeric miao .resource = pxa2xx_udc_resources, 1318f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), 1328f58de7cSeric miao .dev = { 1338f58de7cSeric miao .platform_data = &pxa_udc_info, 1348f58de7cSeric miao .dma_mask = &udc_dma_mask, 1358f58de7cSeric miao } 1368f58de7cSeric miao }; 1378f58de7cSeric miao 13869f22be7SIgor Grinberg #ifdef CONFIG_PXA3xx 13969f22be7SIgor Grinberg static struct resource pxa3xx_u2d_resources[] = { 14069f22be7SIgor Grinberg [0] = { 14169f22be7SIgor Grinberg .start = 0x54100000, 14269f22be7SIgor Grinberg .end = 0x54100fff, 14369f22be7SIgor Grinberg .flags = IORESOURCE_MEM, 14469f22be7SIgor Grinberg }, 14569f22be7SIgor Grinberg [1] = { 14669f22be7SIgor Grinberg .start = IRQ_USB2, 14769f22be7SIgor Grinberg .end = IRQ_USB2, 14869f22be7SIgor Grinberg .flags = IORESOURCE_IRQ, 14969f22be7SIgor Grinberg }, 15069f22be7SIgor Grinberg }; 15169f22be7SIgor Grinberg 15269f22be7SIgor Grinberg struct platform_device pxa3xx_device_u2d = { 15369f22be7SIgor Grinberg .name = "pxa3xx-u2d", 15469f22be7SIgor Grinberg .id = -1, 15569f22be7SIgor Grinberg .resource = pxa3xx_u2d_resources, 15669f22be7SIgor Grinberg .num_resources = ARRAY_SIZE(pxa3xx_u2d_resources), 15769f22be7SIgor Grinberg }; 15869f22be7SIgor Grinberg 15969f22be7SIgor Grinberg void __init pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info) 16069f22be7SIgor Grinberg { 16169f22be7SIgor Grinberg pxa_register_device(&pxa3xx_device_u2d, info); 16269f22be7SIgor Grinberg } 16369f22be7SIgor Grinberg #endif /* CONFIG_PXA3xx */ 16469f22be7SIgor Grinberg 1658f58de7cSeric miao static struct resource pxafb_resources[] = { 1668f58de7cSeric miao [0] = { 1678f58de7cSeric miao .start = 0x44000000, 1688f58de7cSeric miao .end = 0x4400ffff, 1698f58de7cSeric miao .flags = IORESOURCE_MEM, 1708f58de7cSeric miao }, 1718f58de7cSeric miao [1] = { 1728f58de7cSeric miao .start = IRQ_LCD, 1738f58de7cSeric miao .end = IRQ_LCD, 1748f58de7cSeric miao .flags = IORESOURCE_IRQ, 1758f58de7cSeric miao }, 1768f58de7cSeric miao }; 1778f58de7cSeric miao 1788f58de7cSeric miao static u64 fb_dma_mask = ~(u64)0; 1798f58de7cSeric miao 1808f58de7cSeric miao struct platform_device pxa_device_fb = { 1818f58de7cSeric miao .name = "pxa2xx-fb", 1828f58de7cSeric miao .id = -1, 1838f58de7cSeric miao .dev = { 1848f58de7cSeric miao .dma_mask = &fb_dma_mask, 1858f58de7cSeric miao .coherent_dma_mask = 0xffffffff, 1868f58de7cSeric miao }, 1878f58de7cSeric miao .num_resources = ARRAY_SIZE(pxafb_resources), 1888f58de7cSeric miao .resource = pxafb_resources, 1898f58de7cSeric miao }; 1908f58de7cSeric miao 1918f58de7cSeric miao void __init set_pxa_fb_info(struct pxafb_mach_info *info) 1928f58de7cSeric miao { 1938f58de7cSeric miao pxa_register_device(&pxa_device_fb, info); 1948f58de7cSeric miao } 1958f58de7cSeric miao 1968f58de7cSeric miao void __init set_pxa_fb_parent(struct device *parent_dev) 1978f58de7cSeric miao { 1988f58de7cSeric miao pxa_device_fb.dev.parent = parent_dev; 1998f58de7cSeric miao } 2008f58de7cSeric miao 2018f58de7cSeric miao static struct resource pxa_resource_ffuart[] = { 2028f58de7cSeric miao { 20302f65262SEric Miao .start = 0x40100000, 20402f65262SEric Miao .end = 0x40100023, 2058f58de7cSeric miao .flags = IORESOURCE_MEM, 2068f58de7cSeric miao }, { 2078f58de7cSeric miao .start = IRQ_FFUART, 2088f58de7cSeric miao .end = IRQ_FFUART, 2098f58de7cSeric miao .flags = IORESOURCE_IRQ, 2108f58de7cSeric miao } 2118f58de7cSeric miao }; 2128f58de7cSeric miao 2138f58de7cSeric miao struct platform_device pxa_device_ffuart = { 2148f58de7cSeric miao .name = "pxa2xx-uart", 2158f58de7cSeric miao .id = 0, 2168f58de7cSeric miao .resource = pxa_resource_ffuart, 2178f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_ffuart), 2188f58de7cSeric miao }; 2198f58de7cSeric miao 220cc155c6fSRussell King void __init pxa_set_ffuart_info(void *info) 221cc155c6fSRussell King { 222cc155c6fSRussell King pxa_register_device(&pxa_device_ffuart, info); 223cc155c6fSRussell King } 224cc155c6fSRussell King 2258f58de7cSeric miao static struct resource pxa_resource_btuart[] = { 2268f58de7cSeric miao { 22702f65262SEric Miao .start = 0x40200000, 22802f65262SEric Miao .end = 0x40200023, 2298f58de7cSeric miao .flags = IORESOURCE_MEM, 2308f58de7cSeric miao }, { 2318f58de7cSeric miao .start = IRQ_BTUART, 2328f58de7cSeric miao .end = IRQ_BTUART, 2338f58de7cSeric miao .flags = IORESOURCE_IRQ, 2348f58de7cSeric miao } 2358f58de7cSeric miao }; 2368f58de7cSeric miao 2378f58de7cSeric miao struct platform_device pxa_device_btuart = { 2388f58de7cSeric miao .name = "pxa2xx-uart", 2398f58de7cSeric miao .id = 1, 2408f58de7cSeric miao .resource = pxa_resource_btuart, 2418f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_btuart), 2428f58de7cSeric miao }; 2438f58de7cSeric miao 244cc155c6fSRussell King void __init pxa_set_btuart_info(void *info) 245cc155c6fSRussell King { 246cc155c6fSRussell King pxa_register_device(&pxa_device_btuart, info); 247cc155c6fSRussell King } 248cc155c6fSRussell King 2498f58de7cSeric miao static struct resource pxa_resource_stuart[] = { 2508f58de7cSeric miao { 25102f65262SEric Miao .start = 0x40700000, 25202f65262SEric Miao .end = 0x40700023, 2538f58de7cSeric miao .flags = IORESOURCE_MEM, 2548f58de7cSeric miao }, { 2558f58de7cSeric miao .start = IRQ_STUART, 2568f58de7cSeric miao .end = IRQ_STUART, 2578f58de7cSeric miao .flags = IORESOURCE_IRQ, 2588f58de7cSeric miao } 2598f58de7cSeric miao }; 2608f58de7cSeric miao 2618f58de7cSeric miao struct platform_device pxa_device_stuart = { 2628f58de7cSeric miao .name = "pxa2xx-uart", 2638f58de7cSeric miao .id = 2, 2648f58de7cSeric miao .resource = pxa_resource_stuart, 2658f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_stuart), 2668f58de7cSeric miao }; 2678f58de7cSeric miao 268cc155c6fSRussell King void __init pxa_set_stuart_info(void *info) 269cc155c6fSRussell King { 270cc155c6fSRussell King pxa_register_device(&pxa_device_stuart, info); 271cc155c6fSRussell King } 272cc155c6fSRussell King 2738f58de7cSeric miao static struct resource pxa_resource_hwuart[] = { 2748f58de7cSeric miao { 27502f65262SEric Miao .start = 0x41600000, 27602f65262SEric Miao .end = 0x4160002F, 2778f58de7cSeric miao .flags = IORESOURCE_MEM, 2788f58de7cSeric miao }, { 2798f58de7cSeric miao .start = IRQ_HWUART, 2808f58de7cSeric miao .end = IRQ_HWUART, 2818f58de7cSeric miao .flags = IORESOURCE_IRQ, 2828f58de7cSeric miao } 2838f58de7cSeric miao }; 2848f58de7cSeric miao 2858f58de7cSeric miao struct platform_device pxa_device_hwuart = { 2868f58de7cSeric miao .name = "pxa2xx-uart", 2878f58de7cSeric miao .id = 3, 2888f58de7cSeric miao .resource = pxa_resource_hwuart, 2898f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_hwuart), 2908f58de7cSeric miao }; 2918f58de7cSeric miao 292cc155c6fSRussell King void __init pxa_set_hwuart_info(void *info) 293cc155c6fSRussell King { 294cc155c6fSRussell King if (cpu_is_pxa255()) 295cc155c6fSRussell King pxa_register_device(&pxa_device_hwuart, info); 296cc155c6fSRussell King else 297cc155c6fSRussell King pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware"); 298cc155c6fSRussell King } 299cc155c6fSRussell King 3008f58de7cSeric miao static struct resource pxai2c_resources[] = { 3018f58de7cSeric miao { 3028f58de7cSeric miao .start = 0x40301680, 3038f58de7cSeric miao .end = 0x403016a3, 3048f58de7cSeric miao .flags = IORESOURCE_MEM, 3058f58de7cSeric miao }, { 3068f58de7cSeric miao .start = IRQ_I2C, 3078f58de7cSeric miao .end = IRQ_I2C, 3088f58de7cSeric miao .flags = IORESOURCE_IRQ, 3098f58de7cSeric miao }, 3108f58de7cSeric miao }; 3118f58de7cSeric miao 3128f58de7cSeric miao struct platform_device pxa_device_i2c = { 3138f58de7cSeric miao .name = "pxa2xx-i2c", 3148f58de7cSeric miao .id = 0, 3158f58de7cSeric miao .resource = pxai2c_resources, 3168f58de7cSeric miao .num_resources = ARRAY_SIZE(pxai2c_resources), 3178f58de7cSeric miao }; 3188f58de7cSeric miao 3198f58de7cSeric miao void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) 3208f58de7cSeric miao { 3218f58de7cSeric miao pxa_register_device(&pxa_device_i2c, info); 3228f58de7cSeric miao } 3238f58de7cSeric miao 32499464293SEric Miao #ifdef CONFIG_PXA27x 32599464293SEric Miao static struct resource pxa27x_resources_i2c_power[] = { 32699464293SEric Miao { 32799464293SEric Miao .start = 0x40f00180, 32899464293SEric Miao .end = 0x40f001a3, 32999464293SEric Miao .flags = IORESOURCE_MEM, 33099464293SEric Miao }, { 33199464293SEric Miao .start = IRQ_PWRI2C, 33299464293SEric Miao .end = IRQ_PWRI2C, 33399464293SEric Miao .flags = IORESOURCE_IRQ, 33499464293SEric Miao }, 33599464293SEric Miao }; 33699464293SEric Miao 33799464293SEric Miao struct platform_device pxa27x_device_i2c_power = { 33899464293SEric Miao .name = "pxa2xx-i2c", 33999464293SEric Miao .id = 1, 34099464293SEric Miao .resource = pxa27x_resources_i2c_power, 34199464293SEric Miao .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power), 34299464293SEric Miao }; 34399464293SEric Miao #endif 34499464293SEric Miao 3458f58de7cSeric miao static struct resource pxai2s_resources[] = { 3468f58de7cSeric miao { 3478f58de7cSeric miao .start = 0x40400000, 3488f58de7cSeric miao .end = 0x40400083, 3498f58de7cSeric miao .flags = IORESOURCE_MEM, 3508f58de7cSeric miao }, { 3518f58de7cSeric miao .start = IRQ_I2S, 3528f58de7cSeric miao .end = IRQ_I2S, 3538f58de7cSeric miao .flags = IORESOURCE_IRQ, 3548f58de7cSeric miao }, 3558f58de7cSeric miao }; 3568f58de7cSeric miao 3578f58de7cSeric miao struct platform_device pxa_device_i2s = { 3588f58de7cSeric miao .name = "pxa2xx-i2s", 3598f58de7cSeric miao .id = -1, 3608f58de7cSeric miao .resource = pxai2s_resources, 3618f58de7cSeric miao .num_resources = ARRAY_SIZE(pxai2s_resources), 3628f58de7cSeric miao }; 3638f58de7cSeric miao 364f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp1 = { 365f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 366f0fba2adSLiam Girdwood .id = 0, 367f0fba2adSLiam Girdwood }; 368f0fba2adSLiam Girdwood 369f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp2= { 370f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 371f0fba2adSLiam Girdwood .id = 1, 372f0fba2adSLiam Girdwood }; 373f0fba2adSLiam Girdwood 374f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp3 = { 375f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 376f0fba2adSLiam Girdwood .id = 2, 377f0fba2adSLiam Girdwood }; 378f0fba2adSLiam Girdwood 379f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp4 = { 380f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 381f0fba2adSLiam Girdwood .id = 3, 382f0fba2adSLiam Girdwood }; 383f0fba2adSLiam Girdwood 384f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_platform = { 385f0fba2adSLiam Girdwood .name = "pxa-pcm-audio", 386f0fba2adSLiam Girdwood .id = -1, 387f0fba2adSLiam Girdwood }; 388f0fba2adSLiam Girdwood 3898f58de7cSeric miao static u64 pxaficp_dmamask = ~(u32)0; 3908f58de7cSeric miao 3918f58de7cSeric miao struct platform_device pxa_device_ficp = { 3928f58de7cSeric miao .name = "pxa2xx-ir", 3938f58de7cSeric miao .id = -1, 3948f58de7cSeric miao .dev = { 3958f58de7cSeric miao .dma_mask = &pxaficp_dmamask, 3968f58de7cSeric miao .coherent_dma_mask = 0xffffffff, 3978f58de7cSeric miao }, 3988f58de7cSeric miao }; 3998f58de7cSeric miao 4008f58de7cSeric miao void __init pxa_set_ficp_info(struct pxaficp_platform_data *info) 4018f58de7cSeric miao { 4028f58de7cSeric miao pxa_register_device(&pxa_device_ficp, info); 4038f58de7cSeric miao } 4048f58de7cSeric miao 40572493146SRobert Jarzmik static struct resource pxa_rtc_resources[] = { 40672493146SRobert Jarzmik [0] = { 40772493146SRobert Jarzmik .start = 0x40900000, 40872493146SRobert Jarzmik .end = 0x40900000 + 0x3b, 40972493146SRobert Jarzmik .flags = IORESOURCE_MEM, 41072493146SRobert Jarzmik }, 41172493146SRobert Jarzmik [1] = { 41272493146SRobert Jarzmik .start = IRQ_RTC1Hz, 41372493146SRobert Jarzmik .end = IRQ_RTC1Hz, 41472493146SRobert Jarzmik .flags = IORESOURCE_IRQ, 41572493146SRobert Jarzmik }, 41672493146SRobert Jarzmik [2] = { 41772493146SRobert Jarzmik .start = IRQ_RTCAlrm, 41872493146SRobert Jarzmik .end = IRQ_RTCAlrm, 41972493146SRobert Jarzmik .flags = IORESOURCE_IRQ, 42072493146SRobert Jarzmik }, 42172493146SRobert Jarzmik }; 42272493146SRobert Jarzmik 42372493146SRobert Jarzmik struct platform_device sa1100_device_rtc = { 4248f58de7cSeric miao .name = "sa1100-rtc", 4258f58de7cSeric miao .id = -1, 4268f58de7cSeric miao }; 4278f58de7cSeric miao 42872493146SRobert Jarzmik struct platform_device pxa_device_rtc = { 42972493146SRobert Jarzmik .name = "pxa-rtc", 43072493146SRobert Jarzmik .id = -1, 43172493146SRobert Jarzmik .num_resources = ARRAY_SIZE(pxa_rtc_resources), 43272493146SRobert Jarzmik .resource = pxa_rtc_resources, 43372493146SRobert Jarzmik }; 43472493146SRobert Jarzmik 4359f19d638SMark Brown static struct resource pxa_ac97_resources[] = { 4369f19d638SMark Brown [0] = { 4379f19d638SMark Brown .start = 0x40500000, 4389f19d638SMark Brown .end = 0x40500000 + 0xfff, 4399f19d638SMark Brown .flags = IORESOURCE_MEM, 4409f19d638SMark Brown }, 4419f19d638SMark Brown [1] = { 4429f19d638SMark Brown .start = IRQ_AC97, 4439f19d638SMark Brown .end = IRQ_AC97, 4449f19d638SMark Brown .flags = IORESOURCE_IRQ, 4459f19d638SMark Brown }, 4469f19d638SMark Brown }; 4479f19d638SMark Brown 4489f19d638SMark Brown static u64 pxa_ac97_dmamask = 0xffffffffUL; 4499f19d638SMark Brown 4509f19d638SMark Brown struct platform_device pxa_device_ac97 = { 4519f19d638SMark Brown .name = "pxa2xx-ac97", 4529f19d638SMark Brown .id = -1, 4539f19d638SMark Brown .dev = { 4549f19d638SMark Brown .dma_mask = &pxa_ac97_dmamask, 4559f19d638SMark Brown .coherent_dma_mask = 0xffffffff, 4569f19d638SMark Brown }, 4579f19d638SMark Brown .num_resources = ARRAY_SIZE(pxa_ac97_resources), 4589f19d638SMark Brown .resource = pxa_ac97_resources, 4599f19d638SMark Brown }; 4609f19d638SMark Brown 4619f19d638SMark Brown void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops) 4629f19d638SMark Brown { 4639f19d638SMark Brown pxa_register_device(&pxa_device_ac97, ops); 4649f19d638SMark Brown } 4659f19d638SMark Brown 4668f58de7cSeric miao #ifdef CONFIG_PXA25x 4678f58de7cSeric miao 46875540c1aSeric miao static struct resource pxa25x_resource_pwm0[] = { 46975540c1aSeric miao [0] = { 47075540c1aSeric miao .start = 0x40b00000, 47175540c1aSeric miao .end = 0x40b0000f, 47275540c1aSeric miao .flags = IORESOURCE_MEM, 47375540c1aSeric miao }, 47475540c1aSeric miao }; 47575540c1aSeric miao 47675540c1aSeric miao struct platform_device pxa25x_device_pwm0 = { 47775540c1aSeric miao .name = "pxa25x-pwm", 47875540c1aSeric miao .id = 0, 47975540c1aSeric miao .resource = pxa25x_resource_pwm0, 48075540c1aSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0), 48175540c1aSeric miao }; 48275540c1aSeric miao 48375540c1aSeric miao static struct resource pxa25x_resource_pwm1[] = { 48475540c1aSeric miao [0] = { 48575540c1aSeric miao .start = 0x40c00000, 48675540c1aSeric miao .end = 0x40c0000f, 48775540c1aSeric miao .flags = IORESOURCE_MEM, 48875540c1aSeric miao }, 48975540c1aSeric miao }; 49075540c1aSeric miao 49175540c1aSeric miao struct platform_device pxa25x_device_pwm1 = { 49275540c1aSeric miao .name = "pxa25x-pwm", 49375540c1aSeric miao .id = 1, 49475540c1aSeric miao .resource = pxa25x_resource_pwm1, 49575540c1aSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1), 49675540c1aSeric miao }; 49775540c1aSeric miao 4988f58de7cSeric miao static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32); 4998f58de7cSeric miao 5008f58de7cSeric miao static struct resource pxa25x_resource_ssp[] = { 5018f58de7cSeric miao [0] = { 5028f58de7cSeric miao .start = 0x41000000, 5038f58de7cSeric miao .end = 0x4100001f, 5048f58de7cSeric miao .flags = IORESOURCE_MEM, 5058f58de7cSeric miao }, 5068f58de7cSeric miao [1] = { 5078f58de7cSeric miao .start = IRQ_SSP, 5088f58de7cSeric miao .end = IRQ_SSP, 5098f58de7cSeric miao .flags = IORESOURCE_IRQ, 5108f58de7cSeric miao }, 5118f58de7cSeric miao [2] = { 5128f58de7cSeric miao /* DRCMR for RX */ 5138f58de7cSeric miao .start = 13, 5148f58de7cSeric miao .end = 13, 5158f58de7cSeric miao .flags = IORESOURCE_DMA, 5168f58de7cSeric miao }, 5178f58de7cSeric miao [3] = { 5188f58de7cSeric miao /* DRCMR for TX */ 5198f58de7cSeric miao .start = 14, 5208f58de7cSeric miao .end = 14, 5218f58de7cSeric miao .flags = IORESOURCE_DMA, 5228f58de7cSeric miao }, 5238f58de7cSeric miao }; 5248f58de7cSeric miao 5258f58de7cSeric miao struct platform_device pxa25x_device_ssp = { 5268f58de7cSeric miao .name = "pxa25x-ssp", 5278f58de7cSeric miao .id = 0, 5288f58de7cSeric miao .dev = { 5298f58de7cSeric miao .dma_mask = &pxa25x_ssp_dma_mask, 5308f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 5318f58de7cSeric miao }, 5328f58de7cSeric miao .resource = pxa25x_resource_ssp, 5338f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_ssp), 5348f58de7cSeric miao }; 5358f58de7cSeric miao 5368f58de7cSeric miao static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32); 5378f58de7cSeric miao 5388f58de7cSeric miao static struct resource pxa25x_resource_nssp[] = { 5398f58de7cSeric miao [0] = { 5408f58de7cSeric miao .start = 0x41400000, 5418f58de7cSeric miao .end = 0x4140002f, 5428f58de7cSeric miao .flags = IORESOURCE_MEM, 5438f58de7cSeric miao }, 5448f58de7cSeric miao [1] = { 5458f58de7cSeric miao .start = IRQ_NSSP, 5468f58de7cSeric miao .end = IRQ_NSSP, 5478f58de7cSeric miao .flags = IORESOURCE_IRQ, 5488f58de7cSeric miao }, 5498f58de7cSeric miao [2] = { 5508f58de7cSeric miao /* DRCMR for RX */ 5518f58de7cSeric miao .start = 15, 5528f58de7cSeric miao .end = 15, 5538f58de7cSeric miao .flags = IORESOURCE_DMA, 5548f58de7cSeric miao }, 5558f58de7cSeric miao [3] = { 5568f58de7cSeric miao /* DRCMR for TX */ 5578f58de7cSeric miao .start = 16, 5588f58de7cSeric miao .end = 16, 5598f58de7cSeric miao .flags = IORESOURCE_DMA, 5608f58de7cSeric miao }, 5618f58de7cSeric miao }; 5628f58de7cSeric miao 5638f58de7cSeric miao struct platform_device pxa25x_device_nssp = { 5648f58de7cSeric miao .name = "pxa25x-nssp", 5658f58de7cSeric miao .id = 1, 5668f58de7cSeric miao .dev = { 5678f58de7cSeric miao .dma_mask = &pxa25x_nssp_dma_mask, 5688f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 5698f58de7cSeric miao }, 5708f58de7cSeric miao .resource = pxa25x_resource_nssp, 5718f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_nssp), 5728f58de7cSeric miao }; 5738f58de7cSeric miao 5748f58de7cSeric miao static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32); 5758f58de7cSeric miao 5768f58de7cSeric miao static struct resource pxa25x_resource_assp[] = { 5778f58de7cSeric miao [0] = { 5788f58de7cSeric miao .start = 0x41500000, 5798f58de7cSeric miao .end = 0x4150002f, 5808f58de7cSeric miao .flags = IORESOURCE_MEM, 5818f58de7cSeric miao }, 5828f58de7cSeric miao [1] = { 5838f58de7cSeric miao .start = IRQ_ASSP, 5848f58de7cSeric miao .end = IRQ_ASSP, 5858f58de7cSeric miao .flags = IORESOURCE_IRQ, 5868f58de7cSeric miao }, 5878f58de7cSeric miao [2] = { 5888f58de7cSeric miao /* DRCMR for RX */ 5898f58de7cSeric miao .start = 23, 5908f58de7cSeric miao .end = 23, 5918f58de7cSeric miao .flags = IORESOURCE_DMA, 5928f58de7cSeric miao }, 5938f58de7cSeric miao [3] = { 5948f58de7cSeric miao /* DRCMR for TX */ 5958f58de7cSeric miao .start = 24, 5968f58de7cSeric miao .end = 24, 5978f58de7cSeric miao .flags = IORESOURCE_DMA, 5988f58de7cSeric miao }, 5998f58de7cSeric miao }; 6008f58de7cSeric miao 6018f58de7cSeric miao struct platform_device pxa25x_device_assp = { 6028f58de7cSeric miao /* ASSP is basically equivalent to NSSP */ 6038f58de7cSeric miao .name = "pxa25x-nssp", 6048f58de7cSeric miao .id = 2, 6058f58de7cSeric miao .dev = { 6068f58de7cSeric miao .dma_mask = &pxa25x_assp_dma_mask, 6078f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 6088f58de7cSeric miao }, 6098f58de7cSeric miao .resource = pxa25x_resource_assp, 6108f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_assp), 6118f58de7cSeric miao }; 6128f58de7cSeric miao #endif /* CONFIG_PXA25x */ 6138f58de7cSeric miao 6148f58de7cSeric miao #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 615*a4553358SHaojian Zhuang static struct resource pxa27x_resource_camera[] = { 61637320980Seric miao [0] = { 617*a4553358SHaojian Zhuang .start = 0x50000000, 618*a4553358SHaojian Zhuang .end = 0x50000fff, 61937320980Seric miao .flags = IORESOURCE_MEM, 62037320980Seric miao }, 62137320980Seric miao [1] = { 622*a4553358SHaojian Zhuang .start = IRQ_CAMERA, 623*a4553358SHaojian Zhuang .end = IRQ_CAMERA, 62437320980Seric miao .flags = IORESOURCE_IRQ, 62537320980Seric miao }, 62637320980Seric miao }; 62737320980Seric miao 628*a4553358SHaojian Zhuang static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32); 629*a4553358SHaojian Zhuang 630*a4553358SHaojian Zhuang static struct platform_device pxa27x_device_camera = { 631*a4553358SHaojian Zhuang .name = "pxa27x-camera", 632*a4553358SHaojian Zhuang .id = 0, /* This is used to put cameras on this interface */ 633*a4553358SHaojian Zhuang .dev = { 634*a4553358SHaojian Zhuang .dma_mask = &pxa27x_dma_mask_camera, 635*a4553358SHaojian Zhuang .coherent_dma_mask = 0xffffffff, 636*a4553358SHaojian Zhuang }, 637*a4553358SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa27x_resource_camera), 638*a4553358SHaojian Zhuang .resource = pxa27x_resource_camera, 63937320980Seric miao }; 64037320980Seric miao 641*a4553358SHaojian Zhuang void __init pxa_set_camera_info(struct pxacamera_platform_data *info) 64237320980Seric miao { 643*a4553358SHaojian Zhuang pxa_register_device(&pxa27x_device_camera, info); 64437320980Seric miao } 64537320980Seric miao 646ec68e45bSeric miao static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); 647ec68e45bSeric miao 648ec68e45bSeric miao static struct resource pxa27x_resource_ohci[] = { 649ec68e45bSeric miao [0] = { 650ec68e45bSeric miao .start = 0x4C000000, 651ec68e45bSeric miao .end = 0x4C00ff6f, 652ec68e45bSeric miao .flags = IORESOURCE_MEM, 653ec68e45bSeric miao }, 654ec68e45bSeric miao [1] = { 655ec68e45bSeric miao .start = IRQ_USBH1, 656ec68e45bSeric miao .end = IRQ_USBH1, 657ec68e45bSeric miao .flags = IORESOURCE_IRQ, 658ec68e45bSeric miao }, 659ec68e45bSeric miao }; 660ec68e45bSeric miao 661ec68e45bSeric miao struct platform_device pxa27x_device_ohci = { 662ec68e45bSeric miao .name = "pxa27x-ohci", 663ec68e45bSeric miao .id = -1, 664ec68e45bSeric miao .dev = { 665ec68e45bSeric miao .dma_mask = &pxa27x_ohci_dma_mask, 666ec68e45bSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 667ec68e45bSeric miao }, 668ec68e45bSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ohci), 669ec68e45bSeric miao .resource = pxa27x_resource_ohci, 670ec68e45bSeric miao }; 671ec68e45bSeric miao 672ec68e45bSeric miao void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) 673ec68e45bSeric miao { 674ec68e45bSeric miao pxa_register_device(&pxa27x_device_ohci, info); 675ec68e45bSeric miao } 676*a4553358SHaojian Zhuang #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 677*a4553358SHaojian Zhuang 678*a4553358SHaojian Zhuang #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) 679*a4553358SHaojian Zhuang static struct resource pxa27x_resource_keypad[] = { 680*a4553358SHaojian Zhuang [0] = { 681*a4553358SHaojian Zhuang .start = 0x41500000, 682*a4553358SHaojian Zhuang .end = 0x4150004c, 683*a4553358SHaojian Zhuang .flags = IORESOURCE_MEM, 684*a4553358SHaojian Zhuang }, 685*a4553358SHaojian Zhuang [1] = { 686*a4553358SHaojian Zhuang .start = IRQ_KEYPAD, 687*a4553358SHaojian Zhuang .end = IRQ_KEYPAD, 688*a4553358SHaojian Zhuang .flags = IORESOURCE_IRQ, 689*a4553358SHaojian Zhuang }, 690*a4553358SHaojian Zhuang }; 691*a4553358SHaojian Zhuang 692*a4553358SHaojian Zhuang struct platform_device pxa27x_device_keypad = { 693*a4553358SHaojian Zhuang .name = "pxa27x-keypad", 694*a4553358SHaojian Zhuang .id = -1, 695*a4553358SHaojian Zhuang .resource = pxa27x_resource_keypad, 696*a4553358SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), 697*a4553358SHaojian Zhuang }; 698*a4553358SHaojian Zhuang 699*a4553358SHaojian Zhuang void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) 700*a4553358SHaojian Zhuang { 701*a4553358SHaojian Zhuang pxa_register_device(&pxa27x_device_keypad, info); 702*a4553358SHaojian Zhuang } 703ec68e45bSeric miao 7048f58de7cSeric miao static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); 7058f58de7cSeric miao 7068f58de7cSeric miao static struct resource pxa27x_resource_ssp1[] = { 7078f58de7cSeric miao [0] = { 7088f58de7cSeric miao .start = 0x41000000, 7098f58de7cSeric miao .end = 0x4100003f, 7108f58de7cSeric miao .flags = IORESOURCE_MEM, 7118f58de7cSeric miao }, 7128f58de7cSeric miao [1] = { 7138f58de7cSeric miao .start = IRQ_SSP, 7148f58de7cSeric miao .end = IRQ_SSP, 7158f58de7cSeric miao .flags = IORESOURCE_IRQ, 7168f58de7cSeric miao }, 7178f58de7cSeric miao [2] = { 7188f58de7cSeric miao /* DRCMR for RX */ 7198f58de7cSeric miao .start = 13, 7208f58de7cSeric miao .end = 13, 7218f58de7cSeric miao .flags = IORESOURCE_DMA, 7228f58de7cSeric miao }, 7238f58de7cSeric miao [3] = { 7248f58de7cSeric miao /* DRCMR for TX */ 7258f58de7cSeric miao .start = 14, 7268f58de7cSeric miao .end = 14, 7278f58de7cSeric miao .flags = IORESOURCE_DMA, 7288f58de7cSeric miao }, 7298f58de7cSeric miao }; 7308f58de7cSeric miao 7318f58de7cSeric miao struct platform_device pxa27x_device_ssp1 = { 7328f58de7cSeric miao .name = "pxa27x-ssp", 7338f58de7cSeric miao .id = 0, 7348f58de7cSeric miao .dev = { 7358f58de7cSeric miao .dma_mask = &pxa27x_ssp1_dma_mask, 7368f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 7378f58de7cSeric miao }, 7388f58de7cSeric miao .resource = pxa27x_resource_ssp1, 7398f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1), 7408f58de7cSeric miao }; 7418f58de7cSeric miao 7428f58de7cSeric miao static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32); 7438f58de7cSeric miao 7448f58de7cSeric miao static struct resource pxa27x_resource_ssp2[] = { 7458f58de7cSeric miao [0] = { 7468f58de7cSeric miao .start = 0x41700000, 7478f58de7cSeric miao .end = 0x4170003f, 7488f58de7cSeric miao .flags = IORESOURCE_MEM, 7498f58de7cSeric miao }, 7508f58de7cSeric miao [1] = { 7518f58de7cSeric miao .start = IRQ_SSP2, 7528f58de7cSeric miao .end = IRQ_SSP2, 7538f58de7cSeric miao .flags = IORESOURCE_IRQ, 7548f58de7cSeric miao }, 7558f58de7cSeric miao [2] = { 7568f58de7cSeric miao /* DRCMR for RX */ 7578f58de7cSeric miao .start = 15, 7588f58de7cSeric miao .end = 15, 7598f58de7cSeric miao .flags = IORESOURCE_DMA, 7608f58de7cSeric miao }, 7618f58de7cSeric miao [3] = { 7628f58de7cSeric miao /* DRCMR for TX */ 7638f58de7cSeric miao .start = 16, 7648f58de7cSeric miao .end = 16, 7658f58de7cSeric miao .flags = IORESOURCE_DMA, 7668f58de7cSeric miao }, 7678f58de7cSeric miao }; 7688f58de7cSeric miao 7698f58de7cSeric miao struct platform_device pxa27x_device_ssp2 = { 7708f58de7cSeric miao .name = "pxa27x-ssp", 7718f58de7cSeric miao .id = 1, 7728f58de7cSeric miao .dev = { 7738f58de7cSeric miao .dma_mask = &pxa27x_ssp2_dma_mask, 7748f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 7758f58de7cSeric miao }, 7768f58de7cSeric miao .resource = pxa27x_resource_ssp2, 7778f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2), 7788f58de7cSeric miao }; 7798f58de7cSeric miao 7808f58de7cSeric miao static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32); 7818f58de7cSeric miao 7828f58de7cSeric miao static struct resource pxa27x_resource_ssp3[] = { 7838f58de7cSeric miao [0] = { 7848f58de7cSeric miao .start = 0x41900000, 7858f58de7cSeric miao .end = 0x4190003f, 7868f58de7cSeric miao .flags = IORESOURCE_MEM, 7878f58de7cSeric miao }, 7888f58de7cSeric miao [1] = { 7898f58de7cSeric miao .start = IRQ_SSP3, 7908f58de7cSeric miao .end = IRQ_SSP3, 7918f58de7cSeric miao .flags = IORESOURCE_IRQ, 7928f58de7cSeric miao }, 7938f58de7cSeric miao [2] = { 7948f58de7cSeric miao /* DRCMR for RX */ 7958f58de7cSeric miao .start = 66, 7968f58de7cSeric miao .end = 66, 7978f58de7cSeric miao .flags = IORESOURCE_DMA, 7988f58de7cSeric miao }, 7998f58de7cSeric miao [3] = { 8008f58de7cSeric miao /* DRCMR for TX */ 8018f58de7cSeric miao .start = 67, 8028f58de7cSeric miao .end = 67, 8038f58de7cSeric miao .flags = IORESOURCE_DMA, 8048f58de7cSeric miao }, 8058f58de7cSeric miao }; 8068f58de7cSeric miao 8078f58de7cSeric miao struct platform_device pxa27x_device_ssp3 = { 8088f58de7cSeric miao .name = "pxa27x-ssp", 8098f58de7cSeric miao .id = 2, 8108f58de7cSeric miao .dev = { 8118f58de7cSeric miao .dma_mask = &pxa27x_ssp3_dma_mask, 8128f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 8138f58de7cSeric miao }, 8148f58de7cSeric miao .resource = pxa27x_resource_ssp3, 8158f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3), 8168f58de7cSeric miao }; 8173f3acefbSGuennadi Liakhovetski 81875540c1aSeric miao static struct resource pxa27x_resource_pwm0[] = { 81975540c1aSeric miao [0] = { 82075540c1aSeric miao .start = 0x40b00000, 82175540c1aSeric miao .end = 0x40b0001f, 82275540c1aSeric miao .flags = IORESOURCE_MEM, 82375540c1aSeric miao }, 82475540c1aSeric miao }; 82575540c1aSeric miao 82675540c1aSeric miao struct platform_device pxa27x_device_pwm0 = { 82775540c1aSeric miao .name = "pxa27x-pwm", 82875540c1aSeric miao .id = 0, 82975540c1aSeric miao .resource = pxa27x_resource_pwm0, 83075540c1aSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0), 83175540c1aSeric miao }; 83275540c1aSeric miao 83375540c1aSeric miao static struct resource pxa27x_resource_pwm1[] = { 83475540c1aSeric miao [0] = { 83575540c1aSeric miao .start = 0x40c00000, 83675540c1aSeric miao .end = 0x40c0001f, 83775540c1aSeric miao .flags = IORESOURCE_MEM, 83875540c1aSeric miao }, 83975540c1aSeric miao }; 84075540c1aSeric miao 84175540c1aSeric miao struct platform_device pxa27x_device_pwm1 = { 84275540c1aSeric miao .name = "pxa27x-pwm", 84375540c1aSeric miao .id = 1, 84475540c1aSeric miao .resource = pxa27x_resource_pwm1, 84575540c1aSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), 84675540c1aSeric miao }; 847*a4553358SHaojian Zhuang #endif /* CONFIG_PXA27x || CONFIG_PXA3xx || CONFIG_PXA95x*/ 8488f58de7cSeric miao 8498f58de7cSeric miao #ifdef CONFIG_PXA3xx 8508d33b055SBridge Wu static struct resource pxa3xx_resources_mci2[] = { 8518d33b055SBridge Wu [0] = { 8528d33b055SBridge Wu .start = 0x42000000, 8538d33b055SBridge Wu .end = 0x42000fff, 8548d33b055SBridge Wu .flags = IORESOURCE_MEM, 8558d33b055SBridge Wu }, 8568d33b055SBridge Wu [1] = { 8578d33b055SBridge Wu .start = IRQ_MMC2, 8588d33b055SBridge Wu .end = IRQ_MMC2, 8598d33b055SBridge Wu .flags = IORESOURCE_IRQ, 8608d33b055SBridge Wu }, 8618d33b055SBridge Wu [2] = { 8628d33b055SBridge Wu .start = 93, 8638d33b055SBridge Wu .end = 93, 8648d33b055SBridge Wu .flags = IORESOURCE_DMA, 8658d33b055SBridge Wu }, 8668d33b055SBridge Wu [3] = { 8678d33b055SBridge Wu .start = 94, 8688d33b055SBridge Wu .end = 94, 8698d33b055SBridge Wu .flags = IORESOURCE_DMA, 8708d33b055SBridge Wu }, 8718d33b055SBridge Wu }; 8728d33b055SBridge Wu 8738d33b055SBridge Wu struct platform_device pxa3xx_device_mci2 = { 8748d33b055SBridge Wu .name = "pxa2xx-mci", 8758d33b055SBridge Wu .id = 1, 8768d33b055SBridge Wu .dev = { 8778d33b055SBridge Wu .dma_mask = &pxamci_dmamask, 8788d33b055SBridge Wu .coherent_dma_mask = 0xffffffff, 8798d33b055SBridge Wu }, 8808d33b055SBridge Wu .num_resources = ARRAY_SIZE(pxa3xx_resources_mci2), 8818d33b055SBridge Wu .resource = pxa3xx_resources_mci2, 8828d33b055SBridge Wu }; 8838d33b055SBridge Wu 8848d33b055SBridge Wu void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info) 8858d33b055SBridge Wu { 8868d33b055SBridge Wu pxa_register_device(&pxa3xx_device_mci2, info); 8878d33b055SBridge Wu } 8888d33b055SBridge Wu 8895a1f21b1SBridge Wu static struct resource pxa3xx_resources_mci3[] = { 8905a1f21b1SBridge Wu [0] = { 8915a1f21b1SBridge Wu .start = 0x42500000, 8925a1f21b1SBridge Wu .end = 0x42500fff, 8935a1f21b1SBridge Wu .flags = IORESOURCE_MEM, 8945a1f21b1SBridge Wu }, 8955a1f21b1SBridge Wu [1] = { 8965a1f21b1SBridge Wu .start = IRQ_MMC3, 8975a1f21b1SBridge Wu .end = IRQ_MMC3, 8985a1f21b1SBridge Wu .flags = IORESOURCE_IRQ, 8995a1f21b1SBridge Wu }, 9005a1f21b1SBridge Wu [2] = { 9015a1f21b1SBridge Wu .start = 100, 9025a1f21b1SBridge Wu .end = 100, 9035a1f21b1SBridge Wu .flags = IORESOURCE_DMA, 9045a1f21b1SBridge Wu }, 9055a1f21b1SBridge Wu [3] = { 9065a1f21b1SBridge Wu .start = 101, 9075a1f21b1SBridge Wu .end = 101, 9085a1f21b1SBridge Wu .flags = IORESOURCE_DMA, 9095a1f21b1SBridge Wu }, 9105a1f21b1SBridge Wu }; 9115a1f21b1SBridge Wu 9125a1f21b1SBridge Wu struct platform_device pxa3xx_device_mci3 = { 9135a1f21b1SBridge Wu .name = "pxa2xx-mci", 9145a1f21b1SBridge Wu .id = 2, 9155a1f21b1SBridge Wu .dev = { 9165a1f21b1SBridge Wu .dma_mask = &pxamci_dmamask, 9175a1f21b1SBridge Wu .coherent_dma_mask = 0xffffffff, 9185a1f21b1SBridge Wu }, 9195a1f21b1SBridge Wu .num_resources = ARRAY_SIZE(pxa3xx_resources_mci3), 9205a1f21b1SBridge Wu .resource = pxa3xx_resources_mci3, 9215a1f21b1SBridge Wu }; 9225a1f21b1SBridge Wu 9235a1f21b1SBridge Wu void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info) 9245a1f21b1SBridge Wu { 9255a1f21b1SBridge Wu pxa_register_device(&pxa3xx_device_mci3, info); 9265a1f21b1SBridge Wu } 9275a1f21b1SBridge Wu 928*a4553358SHaojian Zhuang static struct resource pxa3xx_resources_gcu[] = { 929*a4553358SHaojian Zhuang { 930*a4553358SHaojian Zhuang .start = 0x54000000, 931*a4553358SHaojian Zhuang .end = 0x54000fff, 932*a4553358SHaojian Zhuang .flags = IORESOURCE_MEM, 933*a4553358SHaojian Zhuang }, 934*a4553358SHaojian Zhuang { 935*a4553358SHaojian Zhuang .start = IRQ_GCU, 936*a4553358SHaojian Zhuang .end = IRQ_GCU, 937*a4553358SHaojian Zhuang .flags = IORESOURCE_IRQ, 938*a4553358SHaojian Zhuang }, 939*a4553358SHaojian Zhuang }; 940*a4553358SHaojian Zhuang 941*a4553358SHaojian Zhuang static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); 942*a4553358SHaojian Zhuang 943*a4553358SHaojian Zhuang struct platform_device pxa3xx_device_gcu = { 944*a4553358SHaojian Zhuang .name = "pxa3xx-gcu", 945*a4553358SHaojian Zhuang .id = -1, 946*a4553358SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu), 947*a4553358SHaojian Zhuang .resource = pxa3xx_resources_gcu, 948*a4553358SHaojian Zhuang .dev = { 949*a4553358SHaojian Zhuang .dma_mask = &pxa3xx_gcu_dmamask, 950*a4553358SHaojian Zhuang .coherent_dma_mask = 0xffffffff, 951*a4553358SHaojian Zhuang }, 952*a4553358SHaojian Zhuang }; 953*a4553358SHaojian Zhuang 954*a4553358SHaojian Zhuang #endif /* CONFIG_PXA3xx */ 955*a4553358SHaojian Zhuang 956*a4553358SHaojian Zhuang #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) 957*a4553358SHaojian Zhuang static struct resource pxa3xx_resources_i2c_power[] = { 958*a4553358SHaojian Zhuang { 959*a4553358SHaojian Zhuang .start = 0x40f500c0, 960*a4553358SHaojian Zhuang .end = 0x40f500d3, 961*a4553358SHaojian Zhuang .flags = IORESOURCE_MEM, 962*a4553358SHaojian Zhuang }, { 963*a4553358SHaojian Zhuang .start = IRQ_PWRI2C, 964*a4553358SHaojian Zhuang .end = IRQ_PWRI2C, 965*a4553358SHaojian Zhuang .flags = IORESOURCE_IRQ, 966*a4553358SHaojian Zhuang }, 967*a4553358SHaojian Zhuang }; 968*a4553358SHaojian Zhuang 969*a4553358SHaojian Zhuang struct platform_device pxa3xx_device_i2c_power = { 970*a4553358SHaojian Zhuang .name = "pxa3xx-pwri2c", 971*a4553358SHaojian Zhuang .id = 1, 972*a4553358SHaojian Zhuang .resource = pxa3xx_resources_i2c_power, 973*a4553358SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), 974*a4553358SHaojian Zhuang }; 975*a4553358SHaojian Zhuang 9769ae819a8SEric Miao static struct resource pxa3xx_resources_nand[] = { 9779ae819a8SEric Miao [0] = { 9789ae819a8SEric Miao .start = 0x43100000, 9799ae819a8SEric Miao .end = 0x43100053, 9809ae819a8SEric Miao .flags = IORESOURCE_MEM, 9819ae819a8SEric Miao }, 9829ae819a8SEric Miao [1] = { 9839ae819a8SEric Miao .start = IRQ_NAND, 9849ae819a8SEric Miao .end = IRQ_NAND, 9859ae819a8SEric Miao .flags = IORESOURCE_IRQ, 9869ae819a8SEric Miao }, 9879ae819a8SEric Miao [2] = { 9889ae819a8SEric Miao /* DRCMR for Data DMA */ 9899ae819a8SEric Miao .start = 97, 9909ae819a8SEric Miao .end = 97, 9919ae819a8SEric Miao .flags = IORESOURCE_DMA, 9929ae819a8SEric Miao }, 9939ae819a8SEric Miao [3] = { 9949ae819a8SEric Miao /* DRCMR for Command DMA */ 9959ae819a8SEric Miao .start = 99, 9969ae819a8SEric Miao .end = 99, 9979ae819a8SEric Miao .flags = IORESOURCE_DMA, 9989ae819a8SEric Miao }, 9999ae819a8SEric Miao }; 10009ae819a8SEric Miao 10019ae819a8SEric Miao static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32); 10029ae819a8SEric Miao 10039ae819a8SEric Miao struct platform_device pxa3xx_device_nand = { 10049ae819a8SEric Miao .name = "pxa3xx-nand", 10059ae819a8SEric Miao .id = -1, 10069ae819a8SEric Miao .dev = { 10079ae819a8SEric Miao .dma_mask = &pxa3xx_nand_dma_mask, 10089ae819a8SEric Miao .coherent_dma_mask = DMA_BIT_MASK(32), 10099ae819a8SEric Miao }, 10109ae819a8SEric Miao .num_resources = ARRAY_SIZE(pxa3xx_resources_nand), 10119ae819a8SEric Miao .resource = pxa3xx_resources_nand, 10129ae819a8SEric Miao }; 10139ae819a8SEric Miao 10149ae819a8SEric Miao void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info) 10159ae819a8SEric Miao { 10169ae819a8SEric Miao pxa_register_device(&pxa3xx_device_nand, info); 10179ae819a8SEric Miao } 10181ff2c33eSDaniel Mack 1019*a4553358SHaojian Zhuang static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32); 1020*a4553358SHaojian Zhuang 1021*a4553358SHaojian Zhuang static struct resource pxa3xx_resource_ssp4[] = { 1022*a4553358SHaojian Zhuang [0] = { 1023*a4553358SHaojian Zhuang .start = 0x41a00000, 1024*a4553358SHaojian Zhuang .end = 0x41a0003f, 10251ff2c33eSDaniel Mack .flags = IORESOURCE_MEM, 10261ff2c33eSDaniel Mack }, 1027*a4553358SHaojian Zhuang [1] = { 1028*a4553358SHaojian Zhuang .start = IRQ_SSP4, 1029*a4553358SHaojian Zhuang .end = IRQ_SSP4, 10301ff2c33eSDaniel Mack .flags = IORESOURCE_IRQ, 10311ff2c33eSDaniel Mack }, 1032*a4553358SHaojian Zhuang [2] = { 1033*a4553358SHaojian Zhuang /* DRCMR for RX */ 1034*a4553358SHaojian Zhuang .start = 2, 1035*a4553358SHaojian Zhuang .end = 2, 1036*a4553358SHaojian Zhuang .flags = IORESOURCE_DMA, 1037*a4553358SHaojian Zhuang }, 1038*a4553358SHaojian Zhuang [3] = { 1039*a4553358SHaojian Zhuang /* DRCMR for TX */ 1040*a4553358SHaojian Zhuang .start = 3, 1041*a4553358SHaojian Zhuang .end = 3, 1042*a4553358SHaojian Zhuang .flags = IORESOURCE_DMA, 10431ff2c33eSDaniel Mack }, 10441ff2c33eSDaniel Mack }; 10451ff2c33eSDaniel Mack 1046*a4553358SHaojian Zhuang struct platform_device pxa3xx_device_ssp4 = { 1047*a4553358SHaojian Zhuang /* PXA3xx SSP is basically equivalent to PXA27x */ 1048*a4553358SHaojian Zhuang .name = "pxa27x-ssp", 1049*a4553358SHaojian Zhuang .id = 3, 1050*a4553358SHaojian Zhuang .dev = { 1051*a4553358SHaojian Zhuang .dma_mask = &pxa3xx_ssp4_dma_mask, 1052*a4553358SHaojian Zhuang .coherent_dma_mask = DMA_BIT_MASK(32), 1053*a4553358SHaojian Zhuang }, 1054*a4553358SHaojian Zhuang .resource = pxa3xx_resource_ssp4, 1055*a4553358SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4), 1056*a4553358SHaojian Zhuang }; 1057*a4553358SHaojian Zhuang #endif /* CONFIG_PXA3xx || CONFIG_PXA95x */ 1058e172274cSGuennadi Liakhovetski 1059e172274cSGuennadi Liakhovetski /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. 1060e172274cSGuennadi Liakhovetski * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ 1061e172274cSGuennadi Liakhovetski void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info) 1062e172274cSGuennadi Liakhovetski { 1063e172274cSGuennadi Liakhovetski struct platform_device *pd; 1064e172274cSGuennadi Liakhovetski 1065e172274cSGuennadi Liakhovetski pd = platform_device_alloc("pxa2xx-spi", id); 1066e172274cSGuennadi Liakhovetski if (pd == NULL) { 1067e172274cSGuennadi Liakhovetski printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n", 1068e172274cSGuennadi Liakhovetski id); 1069e172274cSGuennadi Liakhovetski return; 1070e172274cSGuennadi Liakhovetski } 1071e172274cSGuennadi Liakhovetski 1072e172274cSGuennadi Liakhovetski pd->dev.platform_data = info; 1073e172274cSGuennadi Liakhovetski platform_device_add(pd); 1074e172274cSGuennadi Liakhovetski } 1075