xref: /linux/arch/arm/mach-pxa/devices.c (revision 1257629b0712a0a68a24c532a05a4cd23e3f7565)
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 
7a09e64fbSRussell King #include <mach/udc.h>
8a09e64fbSRussell King #include <mach/pxafb.h>
9a09e64fbSRussell King #include <mach/mmc.h>
10a09e64fbSRussell King #include <mach/irda.h>
11a09e64fbSRussell King #include <mach/i2c.h>
12a09e64fbSRussell King #include <mach/ohci.h>
13a09e64fbSRussell King #include <mach/pxa27x_keypad.h>
14a09e64fbSRussell King #include <mach/pxa2xx_spi.h>
15a09e64fbSRussell King #include <mach/camera.h>
16a09e64fbSRussell King #include <mach/audio.h>
17a09e64fbSRussell King #include <mach/pxa3xx_nand.h>
188f58de7cSeric miao 
198f58de7cSeric miao #include "devices.h"
20bc3a5959SPhilipp Zabel #include "generic.h"
218f58de7cSeric miao 
228f58de7cSeric miao void __init pxa_register_device(struct platform_device *dev, void *data)
238f58de7cSeric miao {
248f58de7cSeric miao 	int ret;
258f58de7cSeric miao 
268f58de7cSeric miao 	dev->dev.platform_data = data;
278f58de7cSeric miao 
288f58de7cSeric miao 	ret = platform_device_register(dev);
298f58de7cSeric miao 	if (ret)
308f58de7cSeric miao 		dev_err(&dev->dev, "unable to register device: %d\n", ret);
318f58de7cSeric miao }
328f58de7cSeric miao 
338f58de7cSeric miao static struct resource pxamci_resources[] = {
348f58de7cSeric miao 	[0] = {
358f58de7cSeric miao 		.start	= 0x41100000,
368f58de7cSeric miao 		.end	= 0x41100fff,
378f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
388f58de7cSeric miao 	},
398f58de7cSeric miao 	[1] = {
408f58de7cSeric miao 		.start	= IRQ_MMC,
418f58de7cSeric miao 		.end	= IRQ_MMC,
428f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
438f58de7cSeric miao 	},
448f58de7cSeric miao 	[2] = {
458f58de7cSeric miao 		.start	= 21,
468f58de7cSeric miao 		.end	= 21,
478f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
488f58de7cSeric miao 	},
498f58de7cSeric miao 	[3] = {
508f58de7cSeric miao 		.start	= 22,
518f58de7cSeric miao 		.end	= 22,
528f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
538f58de7cSeric miao 	},
548f58de7cSeric miao };
558f58de7cSeric miao 
568f58de7cSeric miao static u64 pxamci_dmamask = 0xffffffffUL;
578f58de7cSeric miao 
588f58de7cSeric miao struct platform_device pxa_device_mci = {
598f58de7cSeric miao 	.name		= "pxa2xx-mci",
60fafc9d3fSBridge Wu 	.id		= 0,
618f58de7cSeric miao 	.dev		= {
628f58de7cSeric miao 		.dma_mask = &pxamci_dmamask,
638f58de7cSeric miao 		.coherent_dma_mask = 0xffffffff,
648f58de7cSeric miao 	},
658f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxamci_resources),
668f58de7cSeric miao 	.resource	= pxamci_resources,
678f58de7cSeric miao };
688f58de7cSeric miao 
698f58de7cSeric miao void __init pxa_set_mci_info(struct pxamci_platform_data *info)
708f58de7cSeric miao {
718f58de7cSeric miao 	pxa_register_device(&pxa_device_mci, info);
728f58de7cSeric miao }
738f58de7cSeric miao 
748f58de7cSeric miao 
75*1257629bSPhilipp Zabel static struct pxa2xx_udc_mach_info pxa_udc_info = {
76*1257629bSPhilipp Zabel 	.gpio_pullup = -1,
77*1257629bSPhilipp Zabel 	.gpio_vbus   = -1,
78*1257629bSPhilipp Zabel };
798f58de7cSeric miao 
808f58de7cSeric miao void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
818f58de7cSeric miao {
828f58de7cSeric miao 	memcpy(&pxa_udc_info, info, sizeof *info);
838f58de7cSeric miao }
848f58de7cSeric miao 
858f58de7cSeric miao static struct resource pxa2xx_udc_resources[] = {
868f58de7cSeric miao 	[0] = {
878f58de7cSeric miao 		.start	= 0x40600000,
888f58de7cSeric miao 		.end	= 0x4060ffff,
898f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
908f58de7cSeric miao 	},
918f58de7cSeric miao 	[1] = {
928f58de7cSeric miao 		.start	= IRQ_USB,
938f58de7cSeric miao 		.end	= IRQ_USB,
948f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
958f58de7cSeric miao 	},
968f58de7cSeric miao };
978f58de7cSeric miao 
988f58de7cSeric miao static u64 udc_dma_mask = ~(u32)0;
998f58de7cSeric miao 
1007a857620SPhilipp Zabel struct platform_device pxa25x_device_udc = {
1017a857620SPhilipp Zabel 	.name		= "pxa25x-udc",
1027a857620SPhilipp Zabel 	.id		= -1,
1037a857620SPhilipp Zabel 	.resource	= pxa2xx_udc_resources,
1047a857620SPhilipp Zabel 	.num_resources	= ARRAY_SIZE(pxa2xx_udc_resources),
1057a857620SPhilipp Zabel 	.dev		=  {
1067a857620SPhilipp Zabel 		.platform_data	= &pxa_udc_info,
1077a857620SPhilipp Zabel 		.dma_mask	= &udc_dma_mask,
1087a857620SPhilipp Zabel 	}
1097a857620SPhilipp Zabel };
1107a857620SPhilipp Zabel 
1117a857620SPhilipp Zabel struct platform_device pxa27x_device_udc = {
1127a857620SPhilipp Zabel 	.name		= "pxa27x-udc",
1138f58de7cSeric miao 	.id		= -1,
1148f58de7cSeric miao 	.resource	= pxa2xx_udc_resources,
1158f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa2xx_udc_resources),
1168f58de7cSeric miao 	.dev		=  {
1178f58de7cSeric miao 		.platform_data	= &pxa_udc_info,
1188f58de7cSeric miao 		.dma_mask	= &udc_dma_mask,
1198f58de7cSeric miao 	}
1208f58de7cSeric miao };
1218f58de7cSeric miao 
1228f58de7cSeric miao static struct resource pxafb_resources[] = {
1238f58de7cSeric miao 	[0] = {
1248f58de7cSeric miao 		.start	= 0x44000000,
1258f58de7cSeric miao 		.end	= 0x4400ffff,
1268f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
1278f58de7cSeric miao 	},
1288f58de7cSeric miao 	[1] = {
1298f58de7cSeric miao 		.start	= IRQ_LCD,
1308f58de7cSeric miao 		.end	= IRQ_LCD,
1318f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
1328f58de7cSeric miao 	},
1338f58de7cSeric miao };
1348f58de7cSeric miao 
1358f58de7cSeric miao static u64 fb_dma_mask = ~(u64)0;
1368f58de7cSeric miao 
1378f58de7cSeric miao struct platform_device pxa_device_fb = {
1388f58de7cSeric miao 	.name		= "pxa2xx-fb",
1398f58de7cSeric miao 	.id		= -1,
1408f58de7cSeric miao 	.dev		= {
1418f58de7cSeric miao 		.dma_mask	= &fb_dma_mask,
1428f58de7cSeric miao 		.coherent_dma_mask = 0xffffffff,
1438f58de7cSeric miao 	},
1448f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxafb_resources),
1458f58de7cSeric miao 	.resource	= pxafb_resources,
1468f58de7cSeric miao };
1478f58de7cSeric miao 
1488f58de7cSeric miao void __init set_pxa_fb_info(struct pxafb_mach_info *info)
1498f58de7cSeric miao {
1508f58de7cSeric miao 	pxa_register_device(&pxa_device_fb, info);
1518f58de7cSeric miao }
1528f58de7cSeric miao 
1538f58de7cSeric miao void __init set_pxa_fb_parent(struct device *parent_dev)
1548f58de7cSeric miao {
1558f58de7cSeric miao 	pxa_device_fb.dev.parent = parent_dev;
1568f58de7cSeric miao }
1578f58de7cSeric miao 
1588f58de7cSeric miao static struct resource pxa_resource_ffuart[] = {
1598f58de7cSeric miao 	{
16002f65262SEric Miao 		.start	= 0x40100000,
16102f65262SEric Miao 		.end	= 0x40100023,
1628f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
1638f58de7cSeric miao 	}, {
1648f58de7cSeric miao 		.start	= IRQ_FFUART,
1658f58de7cSeric miao 		.end	= IRQ_FFUART,
1668f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
1678f58de7cSeric miao 	}
1688f58de7cSeric miao };
1698f58de7cSeric miao 
1708f58de7cSeric miao struct platform_device pxa_device_ffuart= {
1718f58de7cSeric miao 	.name		= "pxa2xx-uart",
1728f58de7cSeric miao 	.id		= 0,
1738f58de7cSeric miao 	.resource	= pxa_resource_ffuart,
1748f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_ffuart),
1758f58de7cSeric miao };
1768f58de7cSeric miao 
1778f58de7cSeric miao static struct resource pxa_resource_btuart[] = {
1788f58de7cSeric miao 	{
17902f65262SEric Miao 		.start	= 0x40200000,
18002f65262SEric Miao 		.end	= 0x40200023,
1818f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
1828f58de7cSeric miao 	}, {
1838f58de7cSeric miao 		.start	= IRQ_BTUART,
1848f58de7cSeric miao 		.end	= IRQ_BTUART,
1858f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
1868f58de7cSeric miao 	}
1878f58de7cSeric miao };
1888f58de7cSeric miao 
1898f58de7cSeric miao struct platform_device pxa_device_btuart = {
1908f58de7cSeric miao 	.name		= "pxa2xx-uart",
1918f58de7cSeric miao 	.id		= 1,
1928f58de7cSeric miao 	.resource	= pxa_resource_btuart,
1938f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_btuart),
1948f58de7cSeric miao };
1958f58de7cSeric miao 
1968f58de7cSeric miao static struct resource pxa_resource_stuart[] = {
1978f58de7cSeric miao 	{
19802f65262SEric Miao 		.start	= 0x40700000,
19902f65262SEric Miao 		.end	= 0x40700023,
2008f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
2018f58de7cSeric miao 	}, {
2028f58de7cSeric miao 		.start	= IRQ_STUART,
2038f58de7cSeric miao 		.end	= IRQ_STUART,
2048f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
2058f58de7cSeric miao 	}
2068f58de7cSeric miao };
2078f58de7cSeric miao 
2088f58de7cSeric miao struct platform_device pxa_device_stuart = {
2098f58de7cSeric miao 	.name		= "pxa2xx-uart",
2108f58de7cSeric miao 	.id		= 2,
2118f58de7cSeric miao 	.resource	= pxa_resource_stuart,
2128f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_stuart),
2138f58de7cSeric miao };
2148f58de7cSeric miao 
2158f58de7cSeric miao static struct resource pxa_resource_hwuart[] = {
2168f58de7cSeric miao 	{
21702f65262SEric Miao 		.start	= 0x41600000,
21802f65262SEric Miao 		.end	= 0x4160002F,
2198f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
2208f58de7cSeric miao 	}, {
2218f58de7cSeric miao 		.start	= IRQ_HWUART,
2228f58de7cSeric miao 		.end	= IRQ_HWUART,
2238f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
2248f58de7cSeric miao 	}
2258f58de7cSeric miao };
2268f58de7cSeric miao 
2278f58de7cSeric miao struct platform_device pxa_device_hwuart = {
2288f58de7cSeric miao 	.name		= "pxa2xx-uart",
2298f58de7cSeric miao 	.id		= 3,
2308f58de7cSeric miao 	.resource	= pxa_resource_hwuart,
2318f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_hwuart),
2328f58de7cSeric miao };
2338f58de7cSeric miao 
2348f58de7cSeric miao static struct resource pxai2c_resources[] = {
2358f58de7cSeric miao 	{
2368f58de7cSeric miao 		.start	= 0x40301680,
2378f58de7cSeric miao 		.end	= 0x403016a3,
2388f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
2398f58de7cSeric miao 	}, {
2408f58de7cSeric miao 		.start	= IRQ_I2C,
2418f58de7cSeric miao 		.end	= IRQ_I2C,
2428f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
2438f58de7cSeric miao 	},
2448f58de7cSeric miao };
2458f58de7cSeric miao 
2468f58de7cSeric miao struct platform_device pxa_device_i2c = {
2478f58de7cSeric miao 	.name		= "pxa2xx-i2c",
2488f58de7cSeric miao 	.id		= 0,
2498f58de7cSeric miao 	.resource	= pxai2c_resources,
2508f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxai2c_resources),
2518f58de7cSeric miao };
2528f58de7cSeric miao 
2538f58de7cSeric miao void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
2548f58de7cSeric miao {
2558f58de7cSeric miao 	pxa_register_device(&pxa_device_i2c, info);
2568f58de7cSeric miao }
2578f58de7cSeric miao 
25899464293SEric Miao #ifdef CONFIG_PXA27x
25999464293SEric Miao static struct resource pxa27x_resources_i2c_power[] = {
26099464293SEric Miao 	{
26199464293SEric Miao 		.start	= 0x40f00180,
26299464293SEric Miao 		.end	= 0x40f001a3,
26399464293SEric Miao 		.flags	= IORESOURCE_MEM,
26499464293SEric Miao 	}, {
26599464293SEric Miao 		.start	= IRQ_PWRI2C,
26699464293SEric Miao 		.end	= IRQ_PWRI2C,
26799464293SEric Miao 		.flags	= IORESOURCE_IRQ,
26899464293SEric Miao 	},
26999464293SEric Miao };
27099464293SEric Miao 
27199464293SEric Miao struct platform_device pxa27x_device_i2c_power = {
27299464293SEric Miao 	.name		= "pxa2xx-i2c",
27399464293SEric Miao 	.id		= 1,
27499464293SEric Miao 	.resource	= pxa27x_resources_i2c_power,
27599464293SEric Miao 	.num_resources	= ARRAY_SIZE(pxa27x_resources_i2c_power),
27699464293SEric Miao };
27799464293SEric Miao #endif
27899464293SEric Miao 
27999464293SEric Miao #ifdef CONFIG_PXA3xx
28099464293SEric Miao static struct resource pxa3xx_resources_i2c_power[] = {
28199464293SEric Miao 	{
28299464293SEric Miao 		.start  = 0x40f500c0,
28399464293SEric Miao 		.end    = 0x40f500d3,
28499464293SEric Miao 		.flags	= IORESOURCE_MEM,
28599464293SEric Miao 	}, {
28699464293SEric Miao 		.start	= IRQ_PWRI2C,
28799464293SEric Miao 		.end	= IRQ_PWRI2C,
28899464293SEric Miao 		.flags	= IORESOURCE_IRQ,
28999464293SEric Miao 	},
29099464293SEric Miao };
29199464293SEric Miao 
29299464293SEric Miao struct platform_device pxa3xx_device_i2c_power = {
29399464293SEric Miao 	.name		= "pxa2xx-i2c",
29499464293SEric Miao 	.id		= 1,
29599464293SEric Miao 	.resource	= pxa3xx_resources_i2c_power,
29699464293SEric Miao 	.num_resources	= ARRAY_SIZE(pxa3xx_resources_i2c_power),
29799464293SEric Miao };
29899464293SEric Miao #endif
29999464293SEric Miao 
3008f58de7cSeric miao static struct resource pxai2s_resources[] = {
3018f58de7cSeric miao 	{
3028f58de7cSeric miao 		.start	= 0x40400000,
3038f58de7cSeric miao 		.end	= 0x40400083,
3048f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
3058f58de7cSeric miao 	}, {
3068f58de7cSeric miao 		.start	= IRQ_I2S,
3078f58de7cSeric miao 		.end	= IRQ_I2S,
3088f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
3098f58de7cSeric miao 	},
3108f58de7cSeric miao };
3118f58de7cSeric miao 
3128f58de7cSeric miao struct platform_device pxa_device_i2s = {
3138f58de7cSeric miao 	.name		= "pxa2xx-i2s",
3148f58de7cSeric miao 	.id		= -1,
3158f58de7cSeric miao 	.resource	= pxai2s_resources,
3168f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxai2s_resources),
3178f58de7cSeric miao };
3188f58de7cSeric miao 
3198f58de7cSeric miao static u64 pxaficp_dmamask = ~(u32)0;
3208f58de7cSeric miao 
3218f58de7cSeric miao struct platform_device pxa_device_ficp = {
3228f58de7cSeric miao 	.name		= "pxa2xx-ir",
3238f58de7cSeric miao 	.id		= -1,
3248f58de7cSeric miao 	.dev		= {
3258f58de7cSeric miao 		.dma_mask = &pxaficp_dmamask,
3268f58de7cSeric miao 		.coherent_dma_mask = 0xffffffff,
3278f58de7cSeric miao 	},
3288f58de7cSeric miao };
3298f58de7cSeric miao 
3308f58de7cSeric miao void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
3318f58de7cSeric miao {
3328f58de7cSeric miao 	pxa_register_device(&pxa_device_ficp, info);
3338f58de7cSeric miao }
3348f58de7cSeric miao 
33572493146SRobert Jarzmik static struct resource pxa_rtc_resources[] = {
33672493146SRobert Jarzmik 	[0] = {
33772493146SRobert Jarzmik 		.start  = 0x40900000,
33872493146SRobert Jarzmik 		.end	= 0x40900000 + 0x3b,
33972493146SRobert Jarzmik 		.flags  = IORESOURCE_MEM,
34072493146SRobert Jarzmik 	},
34172493146SRobert Jarzmik 	[1] = {
34272493146SRobert Jarzmik 		.start  = IRQ_RTC1Hz,
34372493146SRobert Jarzmik 		.end    = IRQ_RTC1Hz,
34472493146SRobert Jarzmik 		.flags  = IORESOURCE_IRQ,
34572493146SRobert Jarzmik 	},
34672493146SRobert Jarzmik 	[2] = {
34772493146SRobert Jarzmik 		.start  = IRQ_RTCAlrm,
34872493146SRobert Jarzmik 		.end    = IRQ_RTCAlrm,
34972493146SRobert Jarzmik 		.flags  = IORESOURCE_IRQ,
35072493146SRobert Jarzmik 	},
35172493146SRobert Jarzmik };
35272493146SRobert Jarzmik 
35372493146SRobert Jarzmik struct platform_device sa1100_device_rtc = {
3548f58de7cSeric miao 	.name		= "sa1100-rtc",
3558f58de7cSeric miao 	.id		= -1,
3568f58de7cSeric miao };
3578f58de7cSeric miao 
35872493146SRobert Jarzmik struct platform_device pxa_device_rtc = {
35972493146SRobert Jarzmik 	.name		= "pxa-rtc",
36072493146SRobert Jarzmik 	.id		= -1,
36172493146SRobert Jarzmik 	.num_resources  = ARRAY_SIZE(pxa_rtc_resources),
36272493146SRobert Jarzmik 	.resource       = pxa_rtc_resources,
36372493146SRobert Jarzmik };
36472493146SRobert Jarzmik 
3659f19d638SMark Brown static struct resource pxa_ac97_resources[] = {
3669f19d638SMark Brown 	[0] = {
3679f19d638SMark Brown 		.start  = 0x40500000,
3689f19d638SMark Brown 		.end	= 0x40500000 + 0xfff,
3699f19d638SMark Brown 		.flags  = IORESOURCE_MEM,
3709f19d638SMark Brown 	},
3719f19d638SMark Brown 	[1] = {
3729f19d638SMark Brown 		.start  = IRQ_AC97,
3739f19d638SMark Brown 		.end    = IRQ_AC97,
3749f19d638SMark Brown 		.flags  = IORESOURCE_IRQ,
3759f19d638SMark Brown 	},
3769f19d638SMark Brown };
3779f19d638SMark Brown 
3789f19d638SMark Brown static u64 pxa_ac97_dmamask = 0xffffffffUL;
3799f19d638SMark Brown 
3809f19d638SMark Brown struct platform_device pxa_device_ac97 = {
3819f19d638SMark Brown 	.name           = "pxa2xx-ac97",
3829f19d638SMark Brown 	.id             = -1,
3839f19d638SMark Brown 	.dev            = {
3849f19d638SMark Brown 		.dma_mask = &pxa_ac97_dmamask,
3859f19d638SMark Brown 		.coherent_dma_mask = 0xffffffff,
3869f19d638SMark Brown 	},
3879f19d638SMark Brown 	.num_resources  = ARRAY_SIZE(pxa_ac97_resources),
3889f19d638SMark Brown 	.resource       = pxa_ac97_resources,
3899f19d638SMark Brown };
3909f19d638SMark Brown 
3919f19d638SMark Brown void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops)
3929f19d638SMark Brown {
3939f19d638SMark Brown 	pxa_register_device(&pxa_device_ac97, ops);
3949f19d638SMark Brown }
3959f19d638SMark Brown 
3968f58de7cSeric miao #ifdef CONFIG_PXA25x
3978f58de7cSeric miao 
39875540c1aSeric miao static struct resource pxa25x_resource_pwm0[] = {
39975540c1aSeric miao 	[0] = {
40075540c1aSeric miao 		.start	= 0x40b00000,
40175540c1aSeric miao 		.end	= 0x40b0000f,
40275540c1aSeric miao 		.flags	= IORESOURCE_MEM,
40375540c1aSeric miao 	},
40475540c1aSeric miao };
40575540c1aSeric miao 
40675540c1aSeric miao struct platform_device pxa25x_device_pwm0 = {
40775540c1aSeric miao 	.name		= "pxa25x-pwm",
40875540c1aSeric miao 	.id		= 0,
40975540c1aSeric miao 	.resource	= pxa25x_resource_pwm0,
41075540c1aSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_pwm0),
41175540c1aSeric miao };
41275540c1aSeric miao 
41375540c1aSeric miao static struct resource pxa25x_resource_pwm1[] = {
41475540c1aSeric miao 	[0] = {
41575540c1aSeric miao 		.start	= 0x40c00000,
41675540c1aSeric miao 		.end	= 0x40c0000f,
41775540c1aSeric miao 		.flags	= IORESOURCE_MEM,
41875540c1aSeric miao 	},
41975540c1aSeric miao };
42075540c1aSeric miao 
42175540c1aSeric miao struct platform_device pxa25x_device_pwm1 = {
42275540c1aSeric miao 	.name		= "pxa25x-pwm",
42375540c1aSeric miao 	.id		= 1,
42475540c1aSeric miao 	.resource	= pxa25x_resource_pwm1,
42575540c1aSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_pwm1),
42675540c1aSeric miao };
42775540c1aSeric miao 
4288f58de7cSeric miao static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
4298f58de7cSeric miao 
4308f58de7cSeric miao static struct resource pxa25x_resource_ssp[] = {
4318f58de7cSeric miao 	[0] = {
4328f58de7cSeric miao 		.start	= 0x41000000,
4338f58de7cSeric miao 		.end	= 0x4100001f,
4348f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
4358f58de7cSeric miao 	},
4368f58de7cSeric miao 	[1] = {
4378f58de7cSeric miao 		.start	= IRQ_SSP,
4388f58de7cSeric miao 		.end	= IRQ_SSP,
4398f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
4408f58de7cSeric miao 	},
4418f58de7cSeric miao 	[2] = {
4428f58de7cSeric miao 		/* DRCMR for RX */
4438f58de7cSeric miao 		.start	= 13,
4448f58de7cSeric miao 		.end	= 13,
4458f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4468f58de7cSeric miao 	},
4478f58de7cSeric miao 	[3] = {
4488f58de7cSeric miao 		/* DRCMR for TX */
4498f58de7cSeric miao 		.start	= 14,
4508f58de7cSeric miao 		.end	= 14,
4518f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4528f58de7cSeric miao 	},
4538f58de7cSeric miao };
4548f58de7cSeric miao 
4558f58de7cSeric miao struct platform_device pxa25x_device_ssp = {
4568f58de7cSeric miao 	.name		= "pxa25x-ssp",
4578f58de7cSeric miao 	.id		= 0,
4588f58de7cSeric miao 	.dev		= {
4598f58de7cSeric miao 		.dma_mask = &pxa25x_ssp_dma_mask,
4608f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
4618f58de7cSeric miao 	},
4628f58de7cSeric miao 	.resource	= pxa25x_resource_ssp,
4638f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_ssp),
4648f58de7cSeric miao };
4658f58de7cSeric miao 
4668f58de7cSeric miao static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
4678f58de7cSeric miao 
4688f58de7cSeric miao static struct resource pxa25x_resource_nssp[] = {
4698f58de7cSeric miao 	[0] = {
4708f58de7cSeric miao 		.start	= 0x41400000,
4718f58de7cSeric miao 		.end	= 0x4140002f,
4728f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
4738f58de7cSeric miao 	},
4748f58de7cSeric miao 	[1] = {
4758f58de7cSeric miao 		.start	= IRQ_NSSP,
4768f58de7cSeric miao 		.end	= IRQ_NSSP,
4778f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
4788f58de7cSeric miao 	},
4798f58de7cSeric miao 	[2] = {
4808f58de7cSeric miao 		/* DRCMR for RX */
4818f58de7cSeric miao 		.start	= 15,
4828f58de7cSeric miao 		.end	= 15,
4838f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4848f58de7cSeric miao 	},
4858f58de7cSeric miao 	[3] = {
4868f58de7cSeric miao 		/* DRCMR for TX */
4878f58de7cSeric miao 		.start	= 16,
4888f58de7cSeric miao 		.end	= 16,
4898f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4908f58de7cSeric miao 	},
4918f58de7cSeric miao };
4928f58de7cSeric miao 
4938f58de7cSeric miao struct platform_device pxa25x_device_nssp = {
4948f58de7cSeric miao 	.name		= "pxa25x-nssp",
4958f58de7cSeric miao 	.id		= 1,
4968f58de7cSeric miao 	.dev		= {
4978f58de7cSeric miao 		.dma_mask = &pxa25x_nssp_dma_mask,
4988f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
4998f58de7cSeric miao 	},
5008f58de7cSeric miao 	.resource	= pxa25x_resource_nssp,
5018f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_nssp),
5028f58de7cSeric miao };
5038f58de7cSeric miao 
5048f58de7cSeric miao static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
5058f58de7cSeric miao 
5068f58de7cSeric miao static struct resource pxa25x_resource_assp[] = {
5078f58de7cSeric miao 	[0] = {
5088f58de7cSeric miao 		.start	= 0x41500000,
5098f58de7cSeric miao 		.end	= 0x4150002f,
5108f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
5118f58de7cSeric miao 	},
5128f58de7cSeric miao 	[1] = {
5138f58de7cSeric miao 		.start	= IRQ_ASSP,
5148f58de7cSeric miao 		.end	= IRQ_ASSP,
5158f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
5168f58de7cSeric miao 	},
5178f58de7cSeric miao 	[2] = {
5188f58de7cSeric miao 		/* DRCMR for RX */
5198f58de7cSeric miao 		.start	= 23,
5208f58de7cSeric miao 		.end	= 23,
5218f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
5228f58de7cSeric miao 	},
5238f58de7cSeric miao 	[3] = {
5248f58de7cSeric miao 		/* DRCMR for TX */
5258f58de7cSeric miao 		.start	= 24,
5268f58de7cSeric miao 		.end	= 24,
5278f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
5288f58de7cSeric miao 	},
5298f58de7cSeric miao };
5308f58de7cSeric miao 
5318f58de7cSeric miao struct platform_device pxa25x_device_assp = {
5328f58de7cSeric miao 	/* ASSP is basically equivalent to NSSP */
5338f58de7cSeric miao 	.name		= "pxa25x-nssp",
5348f58de7cSeric miao 	.id		= 2,
5358f58de7cSeric miao 	.dev		= {
5368f58de7cSeric miao 		.dma_mask = &pxa25x_assp_dma_mask,
5378f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
5388f58de7cSeric miao 	},
5398f58de7cSeric miao 	.resource	= pxa25x_resource_assp,
5408f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_assp),
5418f58de7cSeric miao };
5428f58de7cSeric miao #endif /* CONFIG_PXA25x */
5438f58de7cSeric miao 
5448f58de7cSeric miao #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
5458f58de7cSeric miao 
54637320980Seric miao static struct resource pxa27x_resource_keypad[] = {
54737320980Seric miao 	[0] = {
54837320980Seric miao 		.start	= 0x41500000,
54937320980Seric miao 		.end	= 0x4150004c,
55037320980Seric miao 		.flags	= IORESOURCE_MEM,
55137320980Seric miao 	},
55237320980Seric miao 	[1] = {
55337320980Seric miao 		.start	= IRQ_KEYPAD,
55437320980Seric miao 		.end	= IRQ_KEYPAD,
55537320980Seric miao 		.flags	= IORESOURCE_IRQ,
55637320980Seric miao 	},
55737320980Seric miao };
55837320980Seric miao 
55937320980Seric miao struct platform_device pxa27x_device_keypad = {
56037320980Seric miao 	.name		= "pxa27x-keypad",
56137320980Seric miao 	.id		= -1,
56237320980Seric miao 	.resource	= pxa27x_resource_keypad,
56337320980Seric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_keypad),
56437320980Seric miao };
56537320980Seric miao 
56637320980Seric miao void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
56737320980Seric miao {
56837320980Seric miao 	pxa_register_device(&pxa27x_device_keypad, info);
56937320980Seric miao }
57037320980Seric miao 
571ec68e45bSeric miao static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
572ec68e45bSeric miao 
573ec68e45bSeric miao static struct resource pxa27x_resource_ohci[] = {
574ec68e45bSeric miao 	[0] = {
575ec68e45bSeric miao 		.start  = 0x4C000000,
576ec68e45bSeric miao 		.end    = 0x4C00ff6f,
577ec68e45bSeric miao 		.flags  = IORESOURCE_MEM,
578ec68e45bSeric miao 	},
579ec68e45bSeric miao 	[1] = {
580ec68e45bSeric miao 		.start  = IRQ_USBH1,
581ec68e45bSeric miao 		.end    = IRQ_USBH1,
582ec68e45bSeric miao 		.flags  = IORESOURCE_IRQ,
583ec68e45bSeric miao 	},
584ec68e45bSeric miao };
585ec68e45bSeric miao 
586ec68e45bSeric miao struct platform_device pxa27x_device_ohci = {
587ec68e45bSeric miao 	.name		= "pxa27x-ohci",
588ec68e45bSeric miao 	.id		= -1,
589ec68e45bSeric miao 	.dev		= {
590ec68e45bSeric miao 		.dma_mask = &pxa27x_ohci_dma_mask,
591ec68e45bSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
592ec68e45bSeric miao 	},
593ec68e45bSeric miao 	.num_resources  = ARRAY_SIZE(pxa27x_resource_ohci),
594ec68e45bSeric miao 	.resource       = pxa27x_resource_ohci,
595ec68e45bSeric miao };
596ec68e45bSeric miao 
597ec68e45bSeric miao void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
598ec68e45bSeric miao {
599ec68e45bSeric miao 	pxa_register_device(&pxa27x_device_ohci, info);
600ec68e45bSeric miao }
601ec68e45bSeric miao 
6028f58de7cSeric miao static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
6038f58de7cSeric miao 
6048f58de7cSeric miao static struct resource pxa27x_resource_ssp1[] = {
6058f58de7cSeric miao 	[0] = {
6068f58de7cSeric miao 		.start	= 0x41000000,
6078f58de7cSeric miao 		.end	= 0x4100003f,
6088f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
6098f58de7cSeric miao 	},
6108f58de7cSeric miao 	[1] = {
6118f58de7cSeric miao 		.start	= IRQ_SSP,
6128f58de7cSeric miao 		.end	= IRQ_SSP,
6138f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
6148f58de7cSeric miao 	},
6158f58de7cSeric miao 	[2] = {
6168f58de7cSeric miao 		/* DRCMR for RX */
6178f58de7cSeric miao 		.start	= 13,
6188f58de7cSeric miao 		.end	= 13,
6198f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
6208f58de7cSeric miao 	},
6218f58de7cSeric miao 	[3] = {
6228f58de7cSeric miao 		/* DRCMR for TX */
6238f58de7cSeric miao 		.start	= 14,
6248f58de7cSeric miao 		.end	= 14,
6258f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
6268f58de7cSeric miao 	},
6278f58de7cSeric miao };
6288f58de7cSeric miao 
6298f58de7cSeric miao struct platform_device pxa27x_device_ssp1 = {
6308f58de7cSeric miao 	.name		= "pxa27x-ssp",
6318f58de7cSeric miao 	.id		= 0,
6328f58de7cSeric miao 	.dev		= {
6338f58de7cSeric miao 		.dma_mask = &pxa27x_ssp1_dma_mask,
6348f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
6358f58de7cSeric miao 	},
6368f58de7cSeric miao 	.resource	= pxa27x_resource_ssp1,
6378f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp1),
6388f58de7cSeric miao };
6398f58de7cSeric miao 
6408f58de7cSeric miao static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
6418f58de7cSeric miao 
6428f58de7cSeric miao static struct resource pxa27x_resource_ssp2[] = {
6438f58de7cSeric miao 	[0] = {
6448f58de7cSeric miao 		.start	= 0x41700000,
6458f58de7cSeric miao 		.end	= 0x4170003f,
6468f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
6478f58de7cSeric miao 	},
6488f58de7cSeric miao 	[1] = {
6498f58de7cSeric miao 		.start	= IRQ_SSP2,
6508f58de7cSeric miao 		.end	= IRQ_SSP2,
6518f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
6528f58de7cSeric miao 	},
6538f58de7cSeric miao 	[2] = {
6548f58de7cSeric miao 		/* DRCMR for RX */
6558f58de7cSeric miao 		.start	= 15,
6568f58de7cSeric miao 		.end	= 15,
6578f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
6588f58de7cSeric miao 	},
6598f58de7cSeric miao 	[3] = {
6608f58de7cSeric miao 		/* DRCMR for TX */
6618f58de7cSeric miao 		.start	= 16,
6628f58de7cSeric miao 		.end	= 16,
6638f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
6648f58de7cSeric miao 	},
6658f58de7cSeric miao };
6668f58de7cSeric miao 
6678f58de7cSeric miao struct platform_device pxa27x_device_ssp2 = {
6688f58de7cSeric miao 	.name		= "pxa27x-ssp",
6698f58de7cSeric miao 	.id		= 1,
6708f58de7cSeric miao 	.dev		= {
6718f58de7cSeric miao 		.dma_mask = &pxa27x_ssp2_dma_mask,
6728f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
6738f58de7cSeric miao 	},
6748f58de7cSeric miao 	.resource	= pxa27x_resource_ssp2,
6758f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp2),
6768f58de7cSeric miao };
6778f58de7cSeric miao 
6788f58de7cSeric miao static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
6798f58de7cSeric miao 
6808f58de7cSeric miao static struct resource pxa27x_resource_ssp3[] = {
6818f58de7cSeric miao 	[0] = {
6828f58de7cSeric miao 		.start	= 0x41900000,
6838f58de7cSeric miao 		.end	= 0x4190003f,
6848f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
6858f58de7cSeric miao 	},
6868f58de7cSeric miao 	[1] = {
6878f58de7cSeric miao 		.start	= IRQ_SSP3,
6888f58de7cSeric miao 		.end	= IRQ_SSP3,
6898f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
6908f58de7cSeric miao 	},
6918f58de7cSeric miao 	[2] = {
6928f58de7cSeric miao 		/* DRCMR for RX */
6938f58de7cSeric miao 		.start	= 66,
6948f58de7cSeric miao 		.end	= 66,
6958f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
6968f58de7cSeric miao 	},
6978f58de7cSeric miao 	[3] = {
6988f58de7cSeric miao 		/* DRCMR for TX */
6998f58de7cSeric miao 		.start	= 67,
7008f58de7cSeric miao 		.end	= 67,
7018f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
7028f58de7cSeric miao 	},
7038f58de7cSeric miao };
7048f58de7cSeric miao 
7058f58de7cSeric miao struct platform_device pxa27x_device_ssp3 = {
7068f58de7cSeric miao 	.name		= "pxa27x-ssp",
7078f58de7cSeric miao 	.id		= 2,
7088f58de7cSeric miao 	.dev		= {
7098f58de7cSeric miao 		.dma_mask = &pxa27x_ssp3_dma_mask,
7108f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
7118f58de7cSeric miao 	},
7128f58de7cSeric miao 	.resource	= pxa27x_resource_ssp3,
7138f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp3),
7148f58de7cSeric miao };
7153f3acefbSGuennadi Liakhovetski 
71675540c1aSeric miao static struct resource pxa27x_resource_pwm0[] = {
71775540c1aSeric miao 	[0] = {
71875540c1aSeric miao 		.start	= 0x40b00000,
71975540c1aSeric miao 		.end	= 0x40b0001f,
72075540c1aSeric miao 		.flags	= IORESOURCE_MEM,
72175540c1aSeric miao 	},
72275540c1aSeric miao };
72375540c1aSeric miao 
72475540c1aSeric miao struct platform_device pxa27x_device_pwm0 = {
72575540c1aSeric miao 	.name		= "pxa27x-pwm",
72675540c1aSeric miao 	.id		= 0,
72775540c1aSeric miao 	.resource	= pxa27x_resource_pwm0,
72875540c1aSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_pwm0),
72975540c1aSeric miao };
73075540c1aSeric miao 
73175540c1aSeric miao static struct resource pxa27x_resource_pwm1[] = {
73275540c1aSeric miao 	[0] = {
73375540c1aSeric miao 		.start	= 0x40c00000,
73475540c1aSeric miao 		.end	= 0x40c0001f,
73575540c1aSeric miao 		.flags	= IORESOURCE_MEM,
73675540c1aSeric miao 	},
73775540c1aSeric miao };
73875540c1aSeric miao 
73975540c1aSeric miao struct platform_device pxa27x_device_pwm1 = {
74075540c1aSeric miao 	.name		= "pxa27x-pwm",
74175540c1aSeric miao 	.id		= 1,
74275540c1aSeric miao 	.resource	= pxa27x_resource_pwm1,
74375540c1aSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_pwm1),
74475540c1aSeric miao };
74575540c1aSeric miao 
7463f3acefbSGuennadi Liakhovetski static struct resource pxa27x_resource_camera[] = {
7473f3acefbSGuennadi Liakhovetski 	[0] = {
7483f3acefbSGuennadi Liakhovetski 		.start	= 0x50000000,
7493f3acefbSGuennadi Liakhovetski 		.end	= 0x50000fff,
7503f3acefbSGuennadi Liakhovetski 		.flags	= IORESOURCE_MEM,
7513f3acefbSGuennadi Liakhovetski 	},
7523f3acefbSGuennadi Liakhovetski 	[1] = {
7533f3acefbSGuennadi Liakhovetski 		.start	= IRQ_CAMERA,
7543f3acefbSGuennadi Liakhovetski 		.end	= IRQ_CAMERA,
7553f3acefbSGuennadi Liakhovetski 		.flags	= IORESOURCE_IRQ,
7563f3acefbSGuennadi Liakhovetski 	},
7573f3acefbSGuennadi Liakhovetski };
7583f3acefbSGuennadi Liakhovetski 
7593f3acefbSGuennadi Liakhovetski static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
7603f3acefbSGuennadi Liakhovetski 
7613f3acefbSGuennadi Liakhovetski static struct platform_device pxa27x_device_camera = {
7623f3acefbSGuennadi Liakhovetski 	.name		= "pxa27x-camera",
7633f3acefbSGuennadi Liakhovetski 	.id		= 0, /* This is used to put cameras on this interface */
7643f3acefbSGuennadi Liakhovetski 	.dev		= {
7653f3acefbSGuennadi Liakhovetski 		.dma_mask      		= &pxa27x_dma_mask_camera,
7663f3acefbSGuennadi Liakhovetski 		.coherent_dma_mask	= 0xffffffff,
7673f3acefbSGuennadi Liakhovetski 	},
7683f3acefbSGuennadi Liakhovetski 	.num_resources	= ARRAY_SIZE(pxa27x_resource_camera),
7693f3acefbSGuennadi Liakhovetski 	.resource	= pxa27x_resource_camera,
7703f3acefbSGuennadi Liakhovetski };
7713f3acefbSGuennadi Liakhovetski 
7723f3acefbSGuennadi Liakhovetski void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
7733f3acefbSGuennadi Liakhovetski {
7743f3acefbSGuennadi Liakhovetski 	pxa_register_device(&pxa27x_device_camera, info);
7753f3acefbSGuennadi Liakhovetski }
7768f58de7cSeric miao #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
7778f58de7cSeric miao 
7788f58de7cSeric miao #ifdef CONFIG_PXA3xx
7798f58de7cSeric miao static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
7808f58de7cSeric miao 
7818f58de7cSeric miao static struct resource pxa3xx_resource_ssp4[] = {
7828f58de7cSeric miao 	[0] = {
7838f58de7cSeric miao 		.start	= 0x41a00000,
7848f58de7cSeric miao 		.end	= 0x41a0003f,
7858f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
7868f58de7cSeric miao 	},
7878f58de7cSeric miao 	[1] = {
7888f58de7cSeric miao 		.start	= IRQ_SSP4,
7898f58de7cSeric miao 		.end	= IRQ_SSP4,
7908f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
7918f58de7cSeric miao 	},
7928f58de7cSeric miao 	[2] = {
7938f58de7cSeric miao 		/* DRCMR for RX */
7948f58de7cSeric miao 		.start	= 2,
7958f58de7cSeric miao 		.end	= 2,
7968f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
7978f58de7cSeric miao 	},
7988f58de7cSeric miao 	[3] = {
7998f58de7cSeric miao 		/* DRCMR for TX */
8008f58de7cSeric miao 		.start	= 3,
8018f58de7cSeric miao 		.end	= 3,
8028f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
8038f58de7cSeric miao 	},
8048f58de7cSeric miao };
8058f58de7cSeric miao 
8068f58de7cSeric miao struct platform_device pxa3xx_device_ssp4 = {
8078f58de7cSeric miao 	/* PXA3xx SSP is basically equivalent to PXA27x */
8088f58de7cSeric miao 	.name		= "pxa27x-ssp",
8098f58de7cSeric miao 	.id		= 3,
8108f58de7cSeric miao 	.dev		= {
8118f58de7cSeric miao 		.dma_mask = &pxa3xx_ssp4_dma_mask,
8128f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
8138f58de7cSeric miao 	},
8148f58de7cSeric miao 	.resource	= pxa3xx_resource_ssp4,
8158f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa3xx_resource_ssp4),
8168f58de7cSeric miao };
8178d33b055SBridge Wu 
8188d33b055SBridge Wu static struct resource pxa3xx_resources_mci2[] = {
8198d33b055SBridge Wu 	[0] = {
8208d33b055SBridge Wu 		.start	= 0x42000000,
8218d33b055SBridge Wu 		.end	= 0x42000fff,
8228d33b055SBridge Wu 		.flags	= IORESOURCE_MEM,
8238d33b055SBridge Wu 	},
8248d33b055SBridge Wu 	[1] = {
8258d33b055SBridge Wu 		.start	= IRQ_MMC2,
8268d33b055SBridge Wu 		.end	= IRQ_MMC2,
8278d33b055SBridge Wu 		.flags	= IORESOURCE_IRQ,
8288d33b055SBridge Wu 	},
8298d33b055SBridge Wu 	[2] = {
8308d33b055SBridge Wu 		.start	= 93,
8318d33b055SBridge Wu 		.end	= 93,
8328d33b055SBridge Wu 		.flags	= IORESOURCE_DMA,
8338d33b055SBridge Wu 	},
8348d33b055SBridge Wu 	[3] = {
8358d33b055SBridge Wu 		.start	= 94,
8368d33b055SBridge Wu 		.end	= 94,
8378d33b055SBridge Wu 		.flags	= IORESOURCE_DMA,
8388d33b055SBridge Wu 	},
8398d33b055SBridge Wu };
8408d33b055SBridge Wu 
8418d33b055SBridge Wu struct platform_device pxa3xx_device_mci2 = {
8428d33b055SBridge Wu 	.name		= "pxa2xx-mci",
8438d33b055SBridge Wu 	.id		= 1,
8448d33b055SBridge Wu 	.dev		= {
8458d33b055SBridge Wu 		.dma_mask = &pxamci_dmamask,
8468d33b055SBridge Wu 		.coherent_dma_mask =	0xffffffff,
8478d33b055SBridge Wu 	},
8488d33b055SBridge Wu 	.num_resources	= ARRAY_SIZE(pxa3xx_resources_mci2),
8498d33b055SBridge Wu 	.resource	= pxa3xx_resources_mci2,
8508d33b055SBridge Wu };
8518d33b055SBridge Wu 
8528d33b055SBridge Wu void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info)
8538d33b055SBridge Wu {
8548d33b055SBridge Wu 	pxa_register_device(&pxa3xx_device_mci2, info);
8558d33b055SBridge Wu }
8568d33b055SBridge Wu 
8575a1f21b1SBridge Wu static struct resource pxa3xx_resources_mci3[] = {
8585a1f21b1SBridge Wu 	[0] = {
8595a1f21b1SBridge Wu 		.start	= 0x42500000,
8605a1f21b1SBridge Wu 		.end	= 0x42500fff,
8615a1f21b1SBridge Wu 		.flags	= IORESOURCE_MEM,
8625a1f21b1SBridge Wu 	},
8635a1f21b1SBridge Wu 	[1] = {
8645a1f21b1SBridge Wu 		.start	= IRQ_MMC3,
8655a1f21b1SBridge Wu 		.end	= IRQ_MMC3,
8665a1f21b1SBridge Wu 		.flags	= IORESOURCE_IRQ,
8675a1f21b1SBridge Wu 	},
8685a1f21b1SBridge Wu 	[2] = {
8695a1f21b1SBridge Wu 		.start	= 100,
8705a1f21b1SBridge Wu 		.end	= 100,
8715a1f21b1SBridge Wu 		.flags	= IORESOURCE_DMA,
8725a1f21b1SBridge Wu 	},
8735a1f21b1SBridge Wu 	[3] = {
8745a1f21b1SBridge Wu 		.start	= 101,
8755a1f21b1SBridge Wu 		.end	= 101,
8765a1f21b1SBridge Wu 		.flags	= IORESOURCE_DMA,
8775a1f21b1SBridge Wu 	},
8785a1f21b1SBridge Wu };
8795a1f21b1SBridge Wu 
8805a1f21b1SBridge Wu struct platform_device pxa3xx_device_mci3 = {
8815a1f21b1SBridge Wu 	.name		= "pxa2xx-mci",
8825a1f21b1SBridge Wu 	.id		= 2,
8835a1f21b1SBridge Wu 	.dev		= {
8845a1f21b1SBridge Wu 		.dma_mask = &pxamci_dmamask,
8855a1f21b1SBridge Wu 		.coherent_dma_mask = 0xffffffff,
8865a1f21b1SBridge Wu 	},
8875a1f21b1SBridge Wu 	.num_resources	= ARRAY_SIZE(pxa3xx_resources_mci3),
8885a1f21b1SBridge Wu 	.resource	= pxa3xx_resources_mci3,
8895a1f21b1SBridge Wu };
8905a1f21b1SBridge Wu 
8915a1f21b1SBridge Wu void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
8925a1f21b1SBridge Wu {
8935a1f21b1SBridge Wu 	pxa_register_device(&pxa3xx_device_mci3, info);
8945a1f21b1SBridge Wu }
8955a1f21b1SBridge Wu 
8969ae819a8SEric Miao static struct resource pxa3xx_resources_nand[] = {
8979ae819a8SEric Miao 	[0] = {
8989ae819a8SEric Miao 		.start	= 0x43100000,
8999ae819a8SEric Miao 		.end	= 0x43100053,
9009ae819a8SEric Miao 		.flags	= IORESOURCE_MEM,
9019ae819a8SEric Miao 	},
9029ae819a8SEric Miao 	[1] = {
9039ae819a8SEric Miao 		.start	= IRQ_NAND,
9049ae819a8SEric Miao 		.end	= IRQ_NAND,
9059ae819a8SEric Miao 		.flags	= IORESOURCE_IRQ,
9069ae819a8SEric Miao 	},
9079ae819a8SEric Miao 	[2] = {
9089ae819a8SEric Miao 		/* DRCMR for Data DMA */
9099ae819a8SEric Miao 		.start	= 97,
9109ae819a8SEric Miao 		.end	= 97,
9119ae819a8SEric Miao 		.flags	= IORESOURCE_DMA,
9129ae819a8SEric Miao 	},
9139ae819a8SEric Miao 	[3] = {
9149ae819a8SEric Miao 		/* DRCMR for Command DMA */
9159ae819a8SEric Miao 		.start	= 99,
9169ae819a8SEric Miao 		.end	= 99,
9179ae819a8SEric Miao 		.flags	= IORESOURCE_DMA,
9189ae819a8SEric Miao 	},
9199ae819a8SEric Miao };
9209ae819a8SEric Miao 
9219ae819a8SEric Miao static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
9229ae819a8SEric Miao 
9239ae819a8SEric Miao struct platform_device pxa3xx_device_nand = {
9249ae819a8SEric Miao 	.name		= "pxa3xx-nand",
9259ae819a8SEric Miao 	.id		= -1,
9269ae819a8SEric Miao 	.dev		= {
9279ae819a8SEric Miao 		.dma_mask = &pxa3xx_nand_dma_mask,
9289ae819a8SEric Miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
9299ae819a8SEric Miao 	},
9309ae819a8SEric Miao 	.num_resources	= ARRAY_SIZE(pxa3xx_resources_nand),
9319ae819a8SEric Miao 	.resource	= pxa3xx_resources_nand,
9329ae819a8SEric Miao };
9339ae819a8SEric Miao 
9349ae819a8SEric Miao void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
9359ae819a8SEric Miao {
9369ae819a8SEric Miao 	pxa_register_device(&pxa3xx_device_nand, info);
9379ae819a8SEric Miao }
9388f58de7cSeric miao #endif /* CONFIG_PXA3xx */
939e172274cSGuennadi Liakhovetski 
940e172274cSGuennadi Liakhovetski /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
941e172274cSGuennadi Liakhovetski  * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
942e172274cSGuennadi Liakhovetski void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
943e172274cSGuennadi Liakhovetski {
944e172274cSGuennadi Liakhovetski 	struct platform_device *pd;
945e172274cSGuennadi Liakhovetski 
946e172274cSGuennadi Liakhovetski 	pd = platform_device_alloc("pxa2xx-spi", id);
947e172274cSGuennadi Liakhovetski 	if (pd == NULL) {
948e172274cSGuennadi Liakhovetski 		printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n",
949e172274cSGuennadi Liakhovetski 		       id);
950e172274cSGuennadi Liakhovetski 		return;
951e172274cSGuennadi Liakhovetski 	}
952e172274cSGuennadi Liakhovetski 
953e172274cSGuennadi Liakhovetski 	pd->dev.platform_data = info;
954e172274cSGuennadi Liakhovetski 	platform_device_add(pd);
955e172274cSGuennadi Liakhovetski }
956