2 * arch/ppc/platforms/83xx/mpc83xx_devices.c
4 * MPC83xx Device descriptions
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
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 = {
34 static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
35 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
36 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
37 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
40 static struct gianfar_platform_data mpc83xx_tsec2_pdata = {
41 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
42 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
43 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
46 static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
47 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
50 static struct fsl_i2c_platform_data mpc83xx_fsl_i2c2_pdata = {
51 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
54 static struct plat_serial8250_port serial_platform_data[] = {
57 .irq = MPC83xx_IRQ_UART1,
59 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
63 .irq = MPC83xx_IRQ_UART2,
65 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
70 struct platform_device ppc_sys_platform_devices[] = {
72 .name = "fsl-gianfar",
74 .dev.platform_data = &mpc83xx_tsec1_pdata,
76 .resource = (struct resource[]) {
80 .flags = IORESOURCE_MEM,
84 .start = MPC83xx_IRQ_TSEC1_TX,
85 .end = MPC83xx_IRQ_TSEC1_TX,
86 .flags = IORESOURCE_IRQ,
90 .start = MPC83xx_IRQ_TSEC1_RX,
91 .end = MPC83xx_IRQ_TSEC1_RX,
92 .flags = IORESOURCE_IRQ,
96 .start = MPC83xx_IRQ_TSEC1_ERROR,
97 .end = MPC83xx_IRQ_TSEC1_ERROR,
98 .flags = IORESOURCE_IRQ,
103 .name = "fsl-gianfar",
105 .dev.platform_data = &mpc83xx_tsec2_pdata,
107 .resource = (struct resource[]) {
111 .flags = IORESOURCE_MEM,
115 .start = MPC83xx_IRQ_TSEC2_TX,
116 .end = MPC83xx_IRQ_TSEC2_TX,
117 .flags = IORESOURCE_IRQ,
121 .start = MPC83xx_IRQ_TSEC2_RX,
122 .end = MPC83xx_IRQ_TSEC2_RX,
123 .flags = IORESOURCE_IRQ,
127 .start = MPC83xx_IRQ_TSEC2_ERROR,
128 .end = MPC83xx_IRQ_TSEC2_ERROR,
129 .flags = IORESOURCE_IRQ,
136 .dev.platform_data = &mpc83xx_fsl_i2c1_pdata,
138 .resource = (struct resource[]) {
142 .flags = IORESOURCE_MEM,
145 .start = MPC83xx_IRQ_IIC1,
146 .end = MPC83xx_IRQ_IIC1,
147 .flags = IORESOURCE_IRQ,
154 .dev.platform_data = &mpc83xx_fsl_i2c2_pdata,
156 .resource = (struct resource[]) {
160 .flags = IORESOURCE_MEM,
163 .start = MPC83xx_IRQ_IIC2,
164 .end = MPC83xx_IRQ_IIC2,
165 .flags = IORESOURCE_IRQ,
170 .name = "serial8250",
171 .id = PLAT8250_DEV_PLATFORM,
172 .dev.platform_data = serial_platform_data,
178 .resource = (struct resource[]) {
182 .flags = IORESOURCE_MEM,
185 .start = MPC83xx_IRQ_SEC2,
186 .end = MPC83xx_IRQ_SEC2,
187 .flags = IORESOURCE_IRQ,
191 [MPC83xx_USB2_DR] = {
192 .name = "fsl-usb2-dr",
195 .resource = (struct resource[]) {
199 .flags = IORESOURCE_MEM,
202 .start = MPC83xx_IRQ_USB2_DR,
203 .end = MPC83xx_IRQ_USB2_DR,
204 .flags = IORESOURCE_IRQ,
208 [MPC83xx_USB2_MPH] = {
209 .name = "fsl-usb2-mph",
212 .resource = (struct resource[]) {
216 .flags = IORESOURCE_MEM,
219 .start = MPC83xx_IRQ_USB2_MPH,
220 .end = MPC83xx_IRQ_USB2_MPH,
221 .flags = IORESOURCE_IRQ,
226 .name = "fsl-gianfar_mdio",
228 .dev.platform_data = &mpc83xx_mdio_pdata,
233 static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
235 ppc_sys_fixup_mem_resource(pdev, immrbar);
239 static int __init mach_mpc83xx_init(void)
242 ppc_md.progress("mach_mpc83xx_init:enter", 0);
243 ppc_sys_device_fixup = mach_mpc83xx_fixup;
247 postcore_initcall(mach_mpc83xx_init);