2 * arch/ppc/platforms/83xx/mpc83xx_devices.c
4 * MPC83xx Device descriptions
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
8 * Copyright 2005 Freescale Semiconductor Inc.
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
16 #include <linux/init.h>
17 #include <linux/module.h>
18 #include <linux/device.h>
19 #include <linux/serial_8250.h>
20 #include <linux/fsl_devices.h>
21 #include <asm/mpc83xx.h>
23 #include <asm/ppc_sys.h>
24 #include <asm/machdep.h>
26 /* We use offsets for IORESOURCE_MEM since we do not know at compile time
27 * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
30 struct gianfar_mdio_data mpc83xx_mdio_pdata = {
33 static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
34 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
35 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
36 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
39 static struct gianfar_platform_data mpc83xx_tsec2_pdata = {
40 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
41 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
42 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
45 static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
46 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
49 static struct fsl_i2c_platform_data mpc83xx_fsl_i2c2_pdata = {
50 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
53 static struct plat_serial8250_port serial_platform_data[] = {
56 .irq = MPC83xx_IRQ_UART1,
58 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
62 .irq = MPC83xx_IRQ_UART2,
64 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
69 struct platform_device ppc_sys_platform_devices[] = {
71 .name = "fsl-gianfar",
73 .dev.platform_data = &mpc83xx_tsec1_pdata,
75 .resource = (struct resource[]) {
79 .flags = IORESOURCE_MEM,
83 .start = MPC83xx_IRQ_TSEC1_TX,
84 .end = MPC83xx_IRQ_TSEC1_TX,
85 .flags = IORESOURCE_IRQ,
89 .start = MPC83xx_IRQ_TSEC1_RX,
90 .end = MPC83xx_IRQ_TSEC1_RX,
91 .flags = IORESOURCE_IRQ,
95 .start = MPC83xx_IRQ_TSEC1_ERROR,
96 .end = MPC83xx_IRQ_TSEC1_ERROR,
97 .flags = IORESOURCE_IRQ,
102 .name = "fsl-gianfar",
104 .dev.platform_data = &mpc83xx_tsec2_pdata,
106 .resource = (struct resource[]) {
110 .flags = IORESOURCE_MEM,
114 .start = MPC83xx_IRQ_TSEC2_TX,
115 .end = MPC83xx_IRQ_TSEC2_TX,
116 .flags = IORESOURCE_IRQ,
120 .start = MPC83xx_IRQ_TSEC2_RX,
121 .end = MPC83xx_IRQ_TSEC2_RX,
122 .flags = IORESOURCE_IRQ,
126 .start = MPC83xx_IRQ_TSEC2_ERROR,
127 .end = MPC83xx_IRQ_TSEC2_ERROR,
128 .flags = IORESOURCE_IRQ,
135 .dev.platform_data = &mpc83xx_fsl_i2c1_pdata,
137 .resource = (struct resource[]) {
141 .flags = IORESOURCE_MEM,
144 .start = MPC83xx_IRQ_IIC1,
145 .end = MPC83xx_IRQ_IIC1,
146 .flags = IORESOURCE_IRQ,
153 .dev.platform_data = &mpc83xx_fsl_i2c2_pdata,
155 .resource = (struct resource[]) {
159 .flags = IORESOURCE_MEM,
162 .start = MPC83xx_IRQ_IIC2,
163 .end = MPC83xx_IRQ_IIC2,
164 .flags = IORESOURCE_IRQ,
169 .name = "serial8250",
170 .id = PLAT8250_DEV_PLATFORM,
171 .dev.platform_data = serial_platform_data,
177 .resource = (struct resource[]) {
181 .flags = IORESOURCE_MEM,
184 .start = MPC83xx_IRQ_SEC2,
185 .end = MPC83xx_IRQ_SEC2,
186 .flags = IORESOURCE_IRQ,
190 [MPC83xx_USB2_DR] = {
191 .name = "fsl-usb2-dr",
194 .resource = (struct resource[]) {
198 .flags = IORESOURCE_MEM,
201 .start = MPC83xx_IRQ_USB2_DR,
202 .end = MPC83xx_IRQ_USB2_DR,
203 .flags = IORESOURCE_IRQ,
207 [MPC83xx_USB2_MPH] = {
208 .name = "fsl-usb2-mph",
211 .resource = (struct resource[]) {
215 .flags = IORESOURCE_MEM,
218 .start = MPC83xx_IRQ_USB2_MPH,
219 .end = MPC83xx_IRQ_USB2_MPH,
220 .flags = IORESOURCE_IRQ,
225 .name = "fsl-gianfar_mdio",
227 .dev.platform_data = &mpc83xx_mdio_pdata,
229 .resource = (struct resource[]) {
233 .flags = IORESOURCE_MEM,
239 static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
241 ppc_sys_fixup_mem_resource(pdev, immrbar);
245 static int __init mach_mpc83xx_init(void)
248 ppc_md.progress("mach_mpc83xx_init:enter", 0);
249 ppc_sys_device_fixup = mach_mpc83xx_fixup;
253 postcore_initcall(mach_mpc83xx_init);