2 * arch/ppc/syslib/mpc52xx_devices.c
4 * Freescale MPC52xx device descriptions
7 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
9 * Copyright (C) 2005 Sylvain Munaut <tnt@246tNt.com>
11 * This file is licensed under the terms of the GNU General Public License
12 * version 2. This program is licensed "as is" without any warranty of any
13 * kind, whether express or implied.
16 #include <linux/fsl_devices.h>
17 #include <linux/resource.h>
18 #include <linux/platform_device.h>
19 #include <asm/mpc52xx.h>
20 #include <asm/ppc_sys.h>
23 static u64 mpc52xx_dma_mask = 0xffffffffULL;
25 static struct fsl_i2c_platform_data mpc52xx_fsl_i2c_pdata = {
26 .device_flags = FSL_I2C_DEV_CLOCK_5200,
30 /* We use relative offsets for IORESOURCE_MEM to be independent from the
31 * MBAR location at compile time
34 /* TODO Add the BestComm initiator channel to the device definitions,
35 possibly using IORESOURCE_DMA. But that's when BestComm is ready ... */
37 struct platform_device ppc_sys_platform_devices[] = {
39 .name = "mpc52xx-mscan",
42 .resource = (struct resource[]) {
46 .flags = IORESOURCE_MEM,
49 .start = MPC52xx_MSCAN1_IRQ,
50 .end = MPC52xx_MSCAN1_IRQ,
51 .flags = IORESOURCE_IRQ,
56 .name = "mpc52xx-mscan",
59 .resource = (struct resource[]) {
63 .flags = IORESOURCE_MEM,
66 .start = MPC52xx_MSCAN2_IRQ,
67 .end = MPC52xx_MSCAN2_IRQ,
68 .flags = IORESOURCE_IRQ,
73 .name = "mpc52xx-spi",
76 .resource = (struct resource[]) {
80 .flags = IORESOURCE_MEM,
84 .start = MPC52xx_SPI_MODF_IRQ,
85 .end = MPC52xx_SPI_MODF_IRQ,
86 .flags = IORESOURCE_IRQ,
90 .start = MPC52xx_SPI_SPIF_IRQ,
91 .end = MPC52xx_SPI_SPIF_IRQ,
92 .flags = IORESOURCE_IRQ,
97 .name = "ppc-soc-ohci",
100 .dev.dma_mask = &mpc52xx_dma_mask,
101 .dev.coherent_dma_mask = 0xffffffffULL,
102 .resource = (struct resource[]) {
106 .flags = IORESOURCE_MEM,
109 .start = MPC52xx_USB_IRQ,
110 .end = MPC52xx_USB_IRQ,
111 .flags = IORESOURCE_IRQ,
116 .name = "mpc52xx-bdlc",
119 .resource = (struct resource[]) {
123 .flags = IORESOURCE_MEM,
126 .start = MPC52xx_BDLC_IRQ,
127 .end = MPC52xx_BDLC_IRQ,
128 .flags = IORESOURCE_IRQ,
133 .name = "mpc52xx-psc",
136 .resource = (struct resource[]) {
140 .flags = IORESOURCE_MEM,
143 .start = MPC52xx_PSC1_IRQ,
144 .end = MPC52xx_PSC1_IRQ,
145 .flags = IORESOURCE_IRQ,
150 .name = "mpc52xx-psc",
153 .resource = (struct resource[]) {
157 .flags = IORESOURCE_MEM,
160 .start = MPC52xx_PSC2_IRQ,
161 .end = MPC52xx_PSC2_IRQ,
162 .flags = IORESOURCE_IRQ,
167 .name = "mpc52xx-psc",
170 .resource = (struct resource[]) {
174 .flags = IORESOURCE_MEM,
177 .start = MPC52xx_PSC3_IRQ,
178 .end = MPC52xx_PSC3_IRQ,
179 .flags = IORESOURCE_IRQ,
184 .name = "mpc52xx-psc",
187 .resource = (struct resource[]) {
191 .flags = IORESOURCE_MEM,
194 .start = MPC52xx_PSC4_IRQ,
195 .end = MPC52xx_PSC4_IRQ,
196 .flags = IORESOURCE_IRQ,
201 .name = "mpc52xx-psc",
204 .resource = (struct resource[]) {
208 .flags = IORESOURCE_MEM,
211 .start = MPC52xx_PSC5_IRQ,
212 .end = MPC52xx_PSC5_IRQ,
213 .flags = IORESOURCE_IRQ,
218 .name = "mpc52xx-psc",
221 .resource = (struct resource[]) {
225 .flags = IORESOURCE_MEM,
228 .start = MPC52xx_PSC6_IRQ,
229 .end = MPC52xx_PSC6_IRQ,
230 .flags = IORESOURCE_IRQ,
235 .name = "mpc52xx-fec",
238 .resource = (struct resource[]) {
242 .flags = IORESOURCE_MEM,
245 .start = MPC52xx_FEC_IRQ,
246 .end = MPC52xx_FEC_IRQ,
247 .flags = IORESOURCE_IRQ,
252 .name = "mpc52xx-ata",
255 .resource = (struct resource[]) {
259 .flags = IORESOURCE_MEM,
262 .start = MPC52xx_ATA_IRQ,
263 .end = MPC52xx_ATA_IRQ,
264 .flags = IORESOURCE_IRQ,
271 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
273 .resource = (struct resource[]) {
277 .flags = IORESOURCE_MEM,
280 .start = MPC52xx_I2C1_IRQ,
281 .end = MPC52xx_I2C1_IRQ,
282 .flags = IORESOURCE_IRQ,
289 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
291 .resource = (struct resource[]) {
295 .flags = IORESOURCE_MEM,
298 .start = MPC52xx_I2C2_IRQ,
299 .end = MPC52xx_I2C2_IRQ,
300 .flags = IORESOURCE_IRQ,
307 static int __init mach_mpc52xx_fixup(struct platform_device *pdev)
309 ppc_sys_fixup_mem_resource(pdev, MPC52xx_MBAR);
313 static int __init mach_mpc52xx_init(void)
315 ppc_sys_device_fixup = mach_mpc52xx_fixup;
319 postcore_initcall(mach_mpc52xx_init);