2 * Freescale MPC52xx device descriptions
5 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
7 * Copyright (C) 2005 Sylvain Munaut <tnt@246tNt.com>
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
14 #include <linux/fsl_devices.h>
15 #include <linux/resource.h>
16 #include <linux/platform_device.h>
17 #include <asm/mpc52xx.h>
18 #include <asm/ppc_sys.h>
21 static u64 mpc52xx_dma_mask = 0xffffffffULL;
23 static struct fsl_i2c_platform_data mpc52xx_fsl_i2c_pdata = {
24 .device_flags = FSL_I2C_DEV_CLOCK_5200,
28 /* We use relative offsets for IORESOURCE_MEM to be independent from the
29 * MBAR location at compile time
32 /* TODO Add the BestComm initiator channel to the device definitions,
33 possibly using IORESOURCE_DMA. But that's when BestComm is ready ... */
35 struct platform_device ppc_sys_platform_devices[] = {
37 .name = "mpc52xx-mscan",
40 .resource = (struct resource[]) {
44 .flags = IORESOURCE_MEM,
47 .start = MPC52xx_MSCAN1_IRQ,
48 .end = MPC52xx_MSCAN1_IRQ,
49 .flags = IORESOURCE_IRQ,
54 .name = "mpc52xx-mscan",
57 .resource = (struct resource[]) {
61 .flags = IORESOURCE_MEM,
64 .start = MPC52xx_MSCAN2_IRQ,
65 .end = MPC52xx_MSCAN2_IRQ,
66 .flags = IORESOURCE_IRQ,
71 .name = "mpc52xx-spi",
74 .resource = (struct resource[]) {
78 .flags = IORESOURCE_MEM,
82 .start = MPC52xx_SPI_MODF_IRQ,
83 .end = MPC52xx_SPI_MODF_IRQ,
84 .flags = IORESOURCE_IRQ,
88 .start = MPC52xx_SPI_SPIF_IRQ,
89 .end = MPC52xx_SPI_SPIF_IRQ,
90 .flags = IORESOURCE_IRQ,
95 .name = "ppc-soc-ohci",
98 .dev.dma_mask = &mpc52xx_dma_mask,
99 .dev.coherent_dma_mask = 0xffffffffULL,
100 .resource = (struct resource[]) {
104 .flags = IORESOURCE_MEM,
107 .start = MPC52xx_USB_IRQ,
108 .end = MPC52xx_USB_IRQ,
109 .flags = IORESOURCE_IRQ,
114 .name = "mpc52xx-bdlc",
117 .resource = (struct resource[]) {
121 .flags = IORESOURCE_MEM,
124 .start = MPC52xx_BDLC_IRQ,
125 .end = MPC52xx_BDLC_IRQ,
126 .flags = IORESOURCE_IRQ,
131 .name = "mpc52xx-psc",
134 .resource = (struct resource[]) {
138 .flags = IORESOURCE_MEM,
141 .start = MPC52xx_PSC1_IRQ,
142 .end = MPC52xx_PSC1_IRQ,
143 .flags = IORESOURCE_IRQ,
148 .name = "mpc52xx-psc",
151 .resource = (struct resource[]) {
155 .flags = IORESOURCE_MEM,
158 .start = MPC52xx_PSC2_IRQ,
159 .end = MPC52xx_PSC2_IRQ,
160 .flags = IORESOURCE_IRQ,
165 .name = "mpc52xx-psc",
168 .resource = (struct resource[]) {
172 .flags = IORESOURCE_MEM,
175 .start = MPC52xx_PSC3_IRQ,
176 .end = MPC52xx_PSC3_IRQ,
177 .flags = IORESOURCE_IRQ,
182 .name = "mpc52xx-psc",
185 .resource = (struct resource[]) {
189 .flags = IORESOURCE_MEM,
192 .start = MPC52xx_PSC4_IRQ,
193 .end = MPC52xx_PSC4_IRQ,
194 .flags = IORESOURCE_IRQ,
199 .name = "mpc52xx-psc",
202 .resource = (struct resource[]) {
206 .flags = IORESOURCE_MEM,
209 .start = MPC52xx_PSC5_IRQ,
210 .end = MPC52xx_PSC5_IRQ,
211 .flags = IORESOURCE_IRQ,
216 .name = "mpc52xx-psc",
219 .resource = (struct resource[]) {
223 .flags = IORESOURCE_MEM,
226 .start = MPC52xx_PSC6_IRQ,
227 .end = MPC52xx_PSC6_IRQ,
228 .flags = IORESOURCE_IRQ,
233 .name = "mpc52xx-fec",
236 .resource = (struct resource[]) {
240 .flags = IORESOURCE_MEM,
243 .start = MPC52xx_FEC_IRQ,
244 .end = MPC52xx_FEC_IRQ,
245 .flags = IORESOURCE_IRQ,
250 .name = "mpc52xx-ata",
253 .resource = (struct resource[]) {
257 .flags = IORESOURCE_MEM,
260 .start = MPC52xx_ATA_IRQ,
261 .end = MPC52xx_ATA_IRQ,
262 .flags = IORESOURCE_IRQ,
269 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
271 .resource = (struct resource[]) {
275 .flags = IORESOURCE_MEM,
278 .start = MPC52xx_I2C1_IRQ,
279 .end = MPC52xx_I2C1_IRQ,
280 .flags = IORESOURCE_IRQ,
287 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
289 .resource = (struct resource[]) {
293 .flags = IORESOURCE_MEM,
296 .start = MPC52xx_I2C2_IRQ,
297 .end = MPC52xx_I2C2_IRQ,
298 .flags = IORESOURCE_IRQ,
305 static int __init mach_mpc52xx_fixup(struct platform_device *pdev)
307 ppc_sys_fixup_mem_resource(pdev, MPC52xx_MBAR);
311 static int __init mach_mpc52xx_init(void)
313 ppc_sys_device_fixup = mach_mpc52xx_fixup;
317 postcore_initcall(mach_mpc52xx_init);