xref: /linux/arch/arm/mach-pxa/devices.c (revision 8d33b05581d1bc66e2356957bb2739e177a9cc36)
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 
78f58de7cSeric miao #include <asm/arch/gpio.h>
88f58de7cSeric miao #include <asm/arch/udc.h>
98f58de7cSeric miao #include <asm/arch/pxafb.h>
108f58de7cSeric miao #include <asm/arch/mmc.h>
118f58de7cSeric miao #include <asm/arch/irda.h>
128f58de7cSeric miao #include <asm/arch/i2c.h>
138f58de7cSeric miao 
148f58de7cSeric miao #include "devices.h"
158f58de7cSeric miao 
168f58de7cSeric miao void __init pxa_register_device(struct platform_device *dev, void *data)
178f58de7cSeric miao {
188f58de7cSeric miao 	int ret;
198f58de7cSeric miao 
208f58de7cSeric miao 	dev->dev.platform_data = data;
218f58de7cSeric miao 
228f58de7cSeric miao 	ret = platform_device_register(dev);
238f58de7cSeric miao 	if (ret)
248f58de7cSeric miao 		dev_err(&dev->dev, "unable to register device: %d\n", ret);
258f58de7cSeric miao }
268f58de7cSeric miao 
278f58de7cSeric miao static struct resource pxamci_resources[] = {
288f58de7cSeric miao 	[0] = {
298f58de7cSeric miao 		.start	= 0x41100000,
308f58de7cSeric miao 		.end	= 0x41100fff,
318f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
328f58de7cSeric miao 	},
338f58de7cSeric miao 	[1] = {
348f58de7cSeric miao 		.start	= IRQ_MMC,
358f58de7cSeric miao 		.end	= IRQ_MMC,
368f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
378f58de7cSeric miao 	},
388f58de7cSeric miao 	[2] = {
398f58de7cSeric miao 		.start	= 21,
408f58de7cSeric miao 		.end	= 21,
418f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
428f58de7cSeric miao 	},
438f58de7cSeric miao 	[3] = {
448f58de7cSeric miao 		.start	= 22,
458f58de7cSeric miao 		.end	= 22,
468f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
478f58de7cSeric miao 	},
488f58de7cSeric miao };
498f58de7cSeric miao 
508f58de7cSeric miao static u64 pxamci_dmamask = 0xffffffffUL;
518f58de7cSeric miao 
528f58de7cSeric miao struct platform_device pxa_device_mci = {
538f58de7cSeric miao 	.name		= "pxa2xx-mci",
54fafc9d3fSBridge Wu 	.id		= 0,
558f58de7cSeric miao 	.dev		= {
568f58de7cSeric miao 		.dma_mask = &pxamci_dmamask,
578f58de7cSeric miao 		.coherent_dma_mask = 0xffffffff,
588f58de7cSeric miao 	},
598f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxamci_resources),
608f58de7cSeric miao 	.resource	= pxamci_resources,
618f58de7cSeric miao };
628f58de7cSeric miao 
638f58de7cSeric miao void __init pxa_set_mci_info(struct pxamci_platform_data *info)
648f58de7cSeric miao {
658f58de7cSeric miao 	pxa_register_device(&pxa_device_mci, info);
668f58de7cSeric miao }
678f58de7cSeric miao 
688f58de7cSeric miao 
698f58de7cSeric miao static struct pxa2xx_udc_mach_info pxa_udc_info;
708f58de7cSeric miao 
718f58de7cSeric miao void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
728f58de7cSeric miao {
738f58de7cSeric miao 	memcpy(&pxa_udc_info, info, sizeof *info);
748f58de7cSeric miao }
758f58de7cSeric miao 
768f58de7cSeric miao static struct resource pxa2xx_udc_resources[] = {
778f58de7cSeric miao 	[0] = {
788f58de7cSeric miao 		.start	= 0x40600000,
798f58de7cSeric miao 		.end	= 0x4060ffff,
808f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
818f58de7cSeric miao 	},
828f58de7cSeric miao 	[1] = {
838f58de7cSeric miao 		.start	= IRQ_USB,
848f58de7cSeric miao 		.end	= IRQ_USB,
858f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
868f58de7cSeric miao 	},
878f58de7cSeric miao };
888f58de7cSeric miao 
898f58de7cSeric miao static u64 udc_dma_mask = ~(u32)0;
908f58de7cSeric miao 
918f58de7cSeric miao struct platform_device pxa_device_udc = {
928f58de7cSeric miao 	.name		= "pxa2xx-udc",
938f58de7cSeric miao 	.id		= -1,
948f58de7cSeric miao 	.resource	= pxa2xx_udc_resources,
958f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa2xx_udc_resources),
968f58de7cSeric miao 	.dev		=  {
978f58de7cSeric miao 		.platform_data	= &pxa_udc_info,
988f58de7cSeric miao 		.dma_mask	= &udc_dma_mask,
998f58de7cSeric miao 	}
1008f58de7cSeric miao };
1018f58de7cSeric miao 
1028f58de7cSeric miao static struct resource pxafb_resources[] = {
1038f58de7cSeric miao 	[0] = {
1048f58de7cSeric miao 		.start	= 0x44000000,
1058f58de7cSeric miao 		.end	= 0x4400ffff,
1068f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
1078f58de7cSeric miao 	},
1088f58de7cSeric miao 	[1] = {
1098f58de7cSeric miao 		.start	= IRQ_LCD,
1108f58de7cSeric miao 		.end	= IRQ_LCD,
1118f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
1128f58de7cSeric miao 	},
1138f58de7cSeric miao };
1148f58de7cSeric miao 
1158f58de7cSeric miao static u64 fb_dma_mask = ~(u64)0;
1168f58de7cSeric miao 
1178f58de7cSeric miao struct platform_device pxa_device_fb = {
1188f58de7cSeric miao 	.name		= "pxa2xx-fb",
1198f58de7cSeric miao 	.id		= -1,
1208f58de7cSeric miao 	.dev		= {
1218f58de7cSeric miao 		.dma_mask	= &fb_dma_mask,
1228f58de7cSeric miao 		.coherent_dma_mask = 0xffffffff,
1238f58de7cSeric miao 	},
1248f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxafb_resources),
1258f58de7cSeric miao 	.resource	= pxafb_resources,
1268f58de7cSeric miao };
1278f58de7cSeric miao 
1288f58de7cSeric miao void __init set_pxa_fb_info(struct pxafb_mach_info *info)
1298f58de7cSeric miao {
1308f58de7cSeric miao 	pxa_register_device(&pxa_device_fb, info);
1318f58de7cSeric miao }
1328f58de7cSeric miao 
1338f58de7cSeric miao void __init set_pxa_fb_parent(struct device *parent_dev)
1348f58de7cSeric miao {
1358f58de7cSeric miao 	pxa_device_fb.dev.parent = parent_dev;
1368f58de7cSeric miao }
1378f58de7cSeric miao 
1388f58de7cSeric miao static struct resource pxa_resource_ffuart[] = {
1398f58de7cSeric miao 	{
1408f58de7cSeric miao 		.start	= __PREG(FFUART),
1418f58de7cSeric miao 		.end	= __PREG(FFUART) + 35,
1428f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
1438f58de7cSeric miao 	}, {
1448f58de7cSeric miao 		.start	= IRQ_FFUART,
1458f58de7cSeric miao 		.end	= IRQ_FFUART,
1468f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
1478f58de7cSeric miao 	}
1488f58de7cSeric miao };
1498f58de7cSeric miao 
1508f58de7cSeric miao struct platform_device pxa_device_ffuart= {
1518f58de7cSeric miao 	.name		= "pxa2xx-uart",
1528f58de7cSeric miao 	.id		= 0,
1538f58de7cSeric miao 	.resource	= pxa_resource_ffuart,
1548f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_ffuart),
1558f58de7cSeric miao };
1568f58de7cSeric miao 
1578f58de7cSeric miao static struct resource pxa_resource_btuart[] = {
1588f58de7cSeric miao 	{
1598f58de7cSeric miao 		.start	= __PREG(BTUART),
1608f58de7cSeric miao 		.end	= __PREG(BTUART) + 35,
1618f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
1628f58de7cSeric miao 	}, {
1638f58de7cSeric miao 		.start	= IRQ_BTUART,
1648f58de7cSeric miao 		.end	= IRQ_BTUART,
1658f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
1668f58de7cSeric miao 	}
1678f58de7cSeric miao };
1688f58de7cSeric miao 
1698f58de7cSeric miao struct platform_device pxa_device_btuart = {
1708f58de7cSeric miao 	.name		= "pxa2xx-uart",
1718f58de7cSeric miao 	.id		= 1,
1728f58de7cSeric miao 	.resource	= pxa_resource_btuart,
1738f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_btuart),
1748f58de7cSeric miao };
1758f58de7cSeric miao 
1768f58de7cSeric miao static struct resource pxa_resource_stuart[] = {
1778f58de7cSeric miao 	{
1788f58de7cSeric miao 		.start	= __PREG(STUART),
1798f58de7cSeric miao 		.end	= __PREG(STUART) + 35,
1808f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
1818f58de7cSeric miao 	}, {
1828f58de7cSeric miao 		.start	= IRQ_STUART,
1838f58de7cSeric miao 		.end	= IRQ_STUART,
1848f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
1858f58de7cSeric miao 	}
1868f58de7cSeric miao };
1878f58de7cSeric miao 
1888f58de7cSeric miao struct platform_device pxa_device_stuart = {
1898f58de7cSeric miao 	.name		= "pxa2xx-uart",
1908f58de7cSeric miao 	.id		= 2,
1918f58de7cSeric miao 	.resource	= pxa_resource_stuart,
1928f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_stuart),
1938f58de7cSeric miao };
1948f58de7cSeric miao 
1958f58de7cSeric miao static struct resource pxa_resource_hwuart[] = {
1968f58de7cSeric miao 	{
1978f58de7cSeric miao 		.start	= __PREG(HWUART),
1988f58de7cSeric miao 		.end	= __PREG(HWUART) + 47,
1998f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
2008f58de7cSeric miao 	}, {
2018f58de7cSeric miao 		.start	= IRQ_HWUART,
2028f58de7cSeric miao 		.end	= IRQ_HWUART,
2038f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
2048f58de7cSeric miao 	}
2058f58de7cSeric miao };
2068f58de7cSeric miao 
2078f58de7cSeric miao struct platform_device pxa_device_hwuart = {
2088f58de7cSeric miao 	.name		= "pxa2xx-uart",
2098f58de7cSeric miao 	.id		= 3,
2108f58de7cSeric miao 	.resource	= pxa_resource_hwuart,
2118f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa_resource_hwuart),
2128f58de7cSeric miao };
2138f58de7cSeric miao 
2148f58de7cSeric miao static struct resource pxai2c_resources[] = {
2158f58de7cSeric miao 	{
2168f58de7cSeric miao 		.start	= 0x40301680,
2178f58de7cSeric miao 		.end	= 0x403016a3,
2188f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
2198f58de7cSeric miao 	}, {
2208f58de7cSeric miao 		.start	= IRQ_I2C,
2218f58de7cSeric miao 		.end	= IRQ_I2C,
2228f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
2238f58de7cSeric miao 	},
2248f58de7cSeric miao };
2258f58de7cSeric miao 
2268f58de7cSeric miao struct platform_device pxa_device_i2c = {
2278f58de7cSeric miao 	.name		= "pxa2xx-i2c",
2288f58de7cSeric miao 	.id		= 0,
2298f58de7cSeric miao 	.resource	= pxai2c_resources,
2308f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxai2c_resources),
2318f58de7cSeric miao };
2328f58de7cSeric miao 
2338f58de7cSeric miao void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
2348f58de7cSeric miao {
2358f58de7cSeric miao 	pxa_register_device(&pxa_device_i2c, info);
2368f58de7cSeric miao }
2378f58de7cSeric miao 
2388f58de7cSeric miao static struct resource pxai2s_resources[] = {
2398f58de7cSeric miao 	{
2408f58de7cSeric miao 		.start	= 0x40400000,
2418f58de7cSeric miao 		.end	= 0x40400083,
2428f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
2438f58de7cSeric miao 	}, {
2448f58de7cSeric miao 		.start	= IRQ_I2S,
2458f58de7cSeric miao 		.end	= IRQ_I2S,
2468f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
2478f58de7cSeric miao 	},
2488f58de7cSeric miao };
2498f58de7cSeric miao 
2508f58de7cSeric miao struct platform_device pxa_device_i2s = {
2518f58de7cSeric miao 	.name		= "pxa2xx-i2s",
2528f58de7cSeric miao 	.id		= -1,
2538f58de7cSeric miao 	.resource	= pxai2s_resources,
2548f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxai2s_resources),
2558f58de7cSeric miao };
2568f58de7cSeric miao 
2578f58de7cSeric miao static u64 pxaficp_dmamask = ~(u32)0;
2588f58de7cSeric miao 
2598f58de7cSeric miao struct platform_device pxa_device_ficp = {
2608f58de7cSeric miao 	.name		= "pxa2xx-ir",
2618f58de7cSeric miao 	.id		= -1,
2628f58de7cSeric miao 	.dev		= {
2638f58de7cSeric miao 		.dma_mask = &pxaficp_dmamask,
2648f58de7cSeric miao 		.coherent_dma_mask = 0xffffffff,
2658f58de7cSeric miao 	},
2668f58de7cSeric miao };
2678f58de7cSeric miao 
2688f58de7cSeric miao void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
2698f58de7cSeric miao {
2708f58de7cSeric miao 	pxa_register_device(&pxa_device_ficp, info);
2718f58de7cSeric miao }
2728f58de7cSeric miao 
2738f58de7cSeric miao struct platform_device pxa_device_rtc = {
2748f58de7cSeric miao 	.name		= "sa1100-rtc",
2758f58de7cSeric miao 	.id		= -1,
2768f58de7cSeric miao };
2778f58de7cSeric miao 
2788f58de7cSeric miao #ifdef CONFIG_PXA25x
2798f58de7cSeric miao 
2808f58de7cSeric miao static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
2818f58de7cSeric miao 
2828f58de7cSeric miao static struct resource pxa25x_resource_ssp[] = {
2838f58de7cSeric miao 	[0] = {
2848f58de7cSeric miao 		.start	= 0x41000000,
2858f58de7cSeric miao 		.end	= 0x4100001f,
2868f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
2878f58de7cSeric miao 	},
2888f58de7cSeric miao 	[1] = {
2898f58de7cSeric miao 		.start	= IRQ_SSP,
2908f58de7cSeric miao 		.end	= IRQ_SSP,
2918f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
2928f58de7cSeric miao 	},
2938f58de7cSeric miao 	[2] = {
2948f58de7cSeric miao 		/* DRCMR for RX */
2958f58de7cSeric miao 		.start	= 13,
2968f58de7cSeric miao 		.end	= 13,
2978f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
2988f58de7cSeric miao 	},
2998f58de7cSeric miao 	[3] = {
3008f58de7cSeric miao 		/* DRCMR for TX */
3018f58de7cSeric miao 		.start	= 14,
3028f58de7cSeric miao 		.end	= 14,
3038f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
3048f58de7cSeric miao 	},
3058f58de7cSeric miao };
3068f58de7cSeric miao 
3078f58de7cSeric miao struct platform_device pxa25x_device_ssp = {
3088f58de7cSeric miao 	.name		= "pxa25x-ssp",
3098f58de7cSeric miao 	.id		= 0,
3108f58de7cSeric miao 	.dev		= {
3118f58de7cSeric miao 		.dma_mask = &pxa25x_ssp_dma_mask,
3128f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
3138f58de7cSeric miao 	},
3148f58de7cSeric miao 	.resource	= pxa25x_resource_ssp,
3158f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_ssp),
3168f58de7cSeric miao };
3178f58de7cSeric miao 
3188f58de7cSeric miao static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
3198f58de7cSeric miao 
3208f58de7cSeric miao static struct resource pxa25x_resource_nssp[] = {
3218f58de7cSeric miao 	[0] = {
3228f58de7cSeric miao 		.start	= 0x41400000,
3238f58de7cSeric miao 		.end	= 0x4140002f,
3248f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
3258f58de7cSeric miao 	},
3268f58de7cSeric miao 	[1] = {
3278f58de7cSeric miao 		.start	= IRQ_NSSP,
3288f58de7cSeric miao 		.end	= IRQ_NSSP,
3298f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
3308f58de7cSeric miao 	},
3318f58de7cSeric miao 	[2] = {
3328f58de7cSeric miao 		/* DRCMR for RX */
3338f58de7cSeric miao 		.start	= 15,
3348f58de7cSeric miao 		.end	= 15,
3358f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
3368f58de7cSeric miao 	},
3378f58de7cSeric miao 	[3] = {
3388f58de7cSeric miao 		/* DRCMR for TX */
3398f58de7cSeric miao 		.start	= 16,
3408f58de7cSeric miao 		.end	= 16,
3418f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
3428f58de7cSeric miao 	},
3438f58de7cSeric miao };
3448f58de7cSeric miao 
3458f58de7cSeric miao struct platform_device pxa25x_device_nssp = {
3468f58de7cSeric miao 	.name		= "pxa25x-nssp",
3478f58de7cSeric miao 	.id		= 1,
3488f58de7cSeric miao 	.dev		= {
3498f58de7cSeric miao 		.dma_mask = &pxa25x_nssp_dma_mask,
3508f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
3518f58de7cSeric miao 	},
3528f58de7cSeric miao 	.resource	= pxa25x_resource_nssp,
3538f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_nssp),
3548f58de7cSeric miao };
3558f58de7cSeric miao 
3568f58de7cSeric miao static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
3578f58de7cSeric miao 
3588f58de7cSeric miao static struct resource pxa25x_resource_assp[] = {
3598f58de7cSeric miao 	[0] = {
3608f58de7cSeric miao 		.start	= 0x41500000,
3618f58de7cSeric miao 		.end	= 0x4150002f,
3628f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
3638f58de7cSeric miao 	},
3648f58de7cSeric miao 	[1] = {
3658f58de7cSeric miao 		.start	= IRQ_ASSP,
3668f58de7cSeric miao 		.end	= IRQ_ASSP,
3678f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
3688f58de7cSeric miao 	},
3698f58de7cSeric miao 	[2] = {
3708f58de7cSeric miao 		/* DRCMR for RX */
3718f58de7cSeric miao 		.start	= 23,
3728f58de7cSeric miao 		.end	= 23,
3738f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
3748f58de7cSeric miao 	},
3758f58de7cSeric miao 	[3] = {
3768f58de7cSeric miao 		/* DRCMR for TX */
3778f58de7cSeric miao 		.start	= 24,
3788f58de7cSeric miao 		.end	= 24,
3798f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
3808f58de7cSeric miao 	},
3818f58de7cSeric miao };
3828f58de7cSeric miao 
3838f58de7cSeric miao struct platform_device pxa25x_device_assp = {
3848f58de7cSeric miao 	/* ASSP is basically equivalent to NSSP */
3858f58de7cSeric miao 	.name		= "pxa25x-nssp",
3868f58de7cSeric miao 	.id		= 2,
3878f58de7cSeric miao 	.dev		= {
3888f58de7cSeric miao 		.dma_mask = &pxa25x_assp_dma_mask,
3898f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
3908f58de7cSeric miao 	},
3918f58de7cSeric miao 	.resource	= pxa25x_resource_assp,
3928f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa25x_resource_assp),
3938f58de7cSeric miao };
3948f58de7cSeric miao #endif /* CONFIG_PXA25x */
3958f58de7cSeric miao 
3968f58de7cSeric miao #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
3978f58de7cSeric miao 
3988f58de7cSeric miao static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
3998f58de7cSeric miao 
4008f58de7cSeric miao static struct resource pxa27x_resource_ssp1[] = {
4018f58de7cSeric miao 	[0] = {
4028f58de7cSeric miao 		.start	= 0x41000000,
4038f58de7cSeric miao 		.end	= 0x4100003f,
4048f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
4058f58de7cSeric miao 	},
4068f58de7cSeric miao 	[1] = {
4078f58de7cSeric miao 		.start	= IRQ_SSP,
4088f58de7cSeric miao 		.end	= IRQ_SSP,
4098f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
4108f58de7cSeric miao 	},
4118f58de7cSeric miao 	[2] = {
4128f58de7cSeric miao 		/* DRCMR for RX */
4138f58de7cSeric miao 		.start	= 13,
4148f58de7cSeric miao 		.end	= 13,
4158f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4168f58de7cSeric miao 	},
4178f58de7cSeric miao 	[3] = {
4188f58de7cSeric miao 		/* DRCMR for TX */
4198f58de7cSeric miao 		.start	= 14,
4208f58de7cSeric miao 		.end	= 14,
4218f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4228f58de7cSeric miao 	},
4238f58de7cSeric miao };
4248f58de7cSeric miao 
4258f58de7cSeric miao struct platform_device pxa27x_device_ssp1 = {
4268f58de7cSeric miao 	.name		= "pxa27x-ssp",
4278f58de7cSeric miao 	.id		= 0,
4288f58de7cSeric miao 	.dev		= {
4298f58de7cSeric miao 		.dma_mask = &pxa27x_ssp1_dma_mask,
4308f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
4318f58de7cSeric miao 	},
4328f58de7cSeric miao 	.resource	= pxa27x_resource_ssp1,
4338f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp1),
4348f58de7cSeric miao };
4358f58de7cSeric miao 
4368f58de7cSeric miao static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
4378f58de7cSeric miao 
4388f58de7cSeric miao static struct resource pxa27x_resource_ssp2[] = {
4398f58de7cSeric miao 	[0] = {
4408f58de7cSeric miao 		.start	= 0x41700000,
4418f58de7cSeric miao 		.end	= 0x4170003f,
4428f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
4438f58de7cSeric miao 	},
4448f58de7cSeric miao 	[1] = {
4458f58de7cSeric miao 		.start	= IRQ_SSP2,
4468f58de7cSeric miao 		.end	= IRQ_SSP2,
4478f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
4488f58de7cSeric miao 	},
4498f58de7cSeric miao 	[2] = {
4508f58de7cSeric miao 		/* DRCMR for RX */
4518f58de7cSeric miao 		.start	= 15,
4528f58de7cSeric miao 		.end	= 15,
4538f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4548f58de7cSeric miao 	},
4558f58de7cSeric miao 	[3] = {
4568f58de7cSeric miao 		/* DRCMR for TX */
4578f58de7cSeric miao 		.start	= 16,
4588f58de7cSeric miao 		.end	= 16,
4598f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4608f58de7cSeric miao 	},
4618f58de7cSeric miao };
4628f58de7cSeric miao 
4638f58de7cSeric miao struct platform_device pxa27x_device_ssp2 = {
4648f58de7cSeric miao 	.name		= "pxa27x-ssp",
4658f58de7cSeric miao 	.id		= 1,
4668f58de7cSeric miao 	.dev		= {
4678f58de7cSeric miao 		.dma_mask = &pxa27x_ssp2_dma_mask,
4688f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
4698f58de7cSeric miao 	},
4708f58de7cSeric miao 	.resource	= pxa27x_resource_ssp2,
4718f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp2),
4728f58de7cSeric miao };
4738f58de7cSeric miao 
4748f58de7cSeric miao static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
4758f58de7cSeric miao 
4768f58de7cSeric miao static struct resource pxa27x_resource_ssp3[] = {
4778f58de7cSeric miao 	[0] = {
4788f58de7cSeric miao 		.start	= 0x41900000,
4798f58de7cSeric miao 		.end	= 0x4190003f,
4808f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
4818f58de7cSeric miao 	},
4828f58de7cSeric miao 	[1] = {
4838f58de7cSeric miao 		.start	= IRQ_SSP3,
4848f58de7cSeric miao 		.end	= IRQ_SSP3,
4858f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
4868f58de7cSeric miao 	},
4878f58de7cSeric miao 	[2] = {
4888f58de7cSeric miao 		/* DRCMR for RX */
4898f58de7cSeric miao 		.start	= 66,
4908f58de7cSeric miao 		.end	= 66,
4918f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4928f58de7cSeric miao 	},
4938f58de7cSeric miao 	[3] = {
4948f58de7cSeric miao 		/* DRCMR for TX */
4958f58de7cSeric miao 		.start	= 67,
4968f58de7cSeric miao 		.end	= 67,
4978f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
4988f58de7cSeric miao 	},
4998f58de7cSeric miao };
5008f58de7cSeric miao 
5018f58de7cSeric miao struct platform_device pxa27x_device_ssp3 = {
5028f58de7cSeric miao 	.name		= "pxa27x-ssp",
5038f58de7cSeric miao 	.id		= 2,
5048f58de7cSeric miao 	.dev		= {
5058f58de7cSeric miao 		.dma_mask = &pxa27x_ssp3_dma_mask,
5068f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
5078f58de7cSeric miao 	},
5088f58de7cSeric miao 	.resource	= pxa27x_resource_ssp3,
5098f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa27x_resource_ssp3),
5108f58de7cSeric miao };
5118f58de7cSeric miao #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
5128f58de7cSeric miao 
5138f58de7cSeric miao #ifdef CONFIG_PXA3xx
5148f58de7cSeric miao static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
5158f58de7cSeric miao 
5168f58de7cSeric miao static struct resource pxa3xx_resource_ssp4[] = {
5178f58de7cSeric miao 	[0] = {
5188f58de7cSeric miao 		.start	= 0x41a00000,
5198f58de7cSeric miao 		.end	= 0x41a0003f,
5208f58de7cSeric miao 		.flags	= IORESOURCE_MEM,
5218f58de7cSeric miao 	},
5228f58de7cSeric miao 	[1] = {
5238f58de7cSeric miao 		.start	= IRQ_SSP4,
5248f58de7cSeric miao 		.end	= IRQ_SSP4,
5258f58de7cSeric miao 		.flags	= IORESOURCE_IRQ,
5268f58de7cSeric miao 	},
5278f58de7cSeric miao 	[2] = {
5288f58de7cSeric miao 		/* DRCMR for RX */
5298f58de7cSeric miao 		.start	= 2,
5308f58de7cSeric miao 		.end	= 2,
5318f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
5328f58de7cSeric miao 	},
5338f58de7cSeric miao 	[3] = {
5348f58de7cSeric miao 		/* DRCMR for TX */
5358f58de7cSeric miao 		.start	= 3,
5368f58de7cSeric miao 		.end	= 3,
5378f58de7cSeric miao 		.flags	= IORESOURCE_DMA,
5388f58de7cSeric miao 	},
5398f58de7cSeric miao };
5408f58de7cSeric miao 
5418f58de7cSeric miao struct platform_device pxa3xx_device_ssp4 = {
5428f58de7cSeric miao 	/* PXA3xx SSP is basically equivalent to PXA27x */
5438f58de7cSeric miao 	.name		= "pxa27x-ssp",
5448f58de7cSeric miao 	.id		= 3,
5458f58de7cSeric miao 	.dev		= {
5468f58de7cSeric miao 		.dma_mask = &pxa3xx_ssp4_dma_mask,
5478f58de7cSeric miao 		.coherent_dma_mask = DMA_BIT_MASK(32),
5488f58de7cSeric miao 	},
5498f58de7cSeric miao 	.resource	= pxa3xx_resource_ssp4,
5508f58de7cSeric miao 	.num_resources	= ARRAY_SIZE(pxa3xx_resource_ssp4),
5518f58de7cSeric miao };
552*8d33b055SBridge Wu 
553*8d33b055SBridge Wu static struct resource pxa3xx_resources_mci2[] = {
554*8d33b055SBridge Wu 	[0] = {
555*8d33b055SBridge Wu 		.start	= 0x42000000,
556*8d33b055SBridge Wu 		.end	= 0x42000fff,
557*8d33b055SBridge Wu 		.flags	= IORESOURCE_MEM,
558*8d33b055SBridge Wu 	},
559*8d33b055SBridge Wu 	[1] = {
560*8d33b055SBridge Wu 		.start	= IRQ_MMC2,
561*8d33b055SBridge Wu 		.end	= IRQ_MMC2,
562*8d33b055SBridge Wu 		.flags	= IORESOURCE_IRQ,
563*8d33b055SBridge Wu 	},
564*8d33b055SBridge Wu 	[2] = {
565*8d33b055SBridge Wu 		.start	= 93,
566*8d33b055SBridge Wu 		.end	= 93,
567*8d33b055SBridge Wu 		.flags	= IORESOURCE_DMA,
568*8d33b055SBridge Wu 	},
569*8d33b055SBridge Wu 	[3] = {
570*8d33b055SBridge Wu 		.start	= 94,
571*8d33b055SBridge Wu 		.end	= 94,
572*8d33b055SBridge Wu 		.flags	= IORESOURCE_DMA,
573*8d33b055SBridge Wu 	},
574*8d33b055SBridge Wu };
575*8d33b055SBridge Wu 
576*8d33b055SBridge Wu struct platform_device pxa3xx_device_mci2 = {
577*8d33b055SBridge Wu 	.name		= "pxa2xx-mci",
578*8d33b055SBridge Wu 	.id		= 1,
579*8d33b055SBridge Wu 	.dev		= {
580*8d33b055SBridge Wu 		.dma_mask = &pxamci_dmamask,
581*8d33b055SBridge Wu 		.coherent_dma_mask =	0xffffffff,
582*8d33b055SBridge Wu 	},
583*8d33b055SBridge Wu 	.num_resources	= ARRAY_SIZE(pxa3xx_resources_mci2),
584*8d33b055SBridge Wu 	.resource	= pxa3xx_resources_mci2,
585*8d33b055SBridge Wu };
586*8d33b055SBridge Wu 
587*8d33b055SBridge Wu void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info)
588*8d33b055SBridge Wu {
589*8d33b055SBridge Wu 	pxa_register_device(&pxa3xx_device_mci2, info);
590*8d33b055SBridge Wu }
591*8d33b055SBridge Wu 
5928f58de7cSeric miao #endif /* CONFIG_PXA3xx */
593