blob: f9b95de70e230260a6f4e3b7d9cf0655719b90a8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/ppc/platforms/83xx/mpc83xx_devices.c
3 *
4 * MPC83xx Device descriptions
5 *
Kumar Gala4c8d3d92005-11-13 16:06:30 -08006 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 *
8 * Copyright 2005 Freescale Semiconductor Inc.
9 *
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.
14 */
15
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>
22#include <asm/irq.h>
23#include <asm/ppc_sys.h>
Paul Mackerrasfd582ec2005-10-11 22:08:12 +100024#include <asm/machdep.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
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
28 */
29
Kumar Gala78b33122005-11-08 21:34:37 -080030struct gianfar_mdio_data mpc83xx_mdio_pdata = {
Kumar Gala78b33122005-11-08 21:34:37 -080031};
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033static 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,
Linus Torvalds1da177e2005-04-16 15:20:36 -070037};
38
39static 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,
Linus Torvalds1da177e2005-04-16 15:20:36 -070043};
44
45static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
46 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
47};
48
49static struct fsl_i2c_platform_data mpc83xx_fsl_i2c2_pdata = {
50 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
51};
52
53static struct plat_serial8250_port serial_platform_data[] = {
54 [0] = {
55 .mapbase = 0x4500,
56 .irq = MPC83xx_IRQ_UART1,
57 .iotype = UPIO_MEM,
58 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
59 },
60 [1] = {
61 .mapbase = 0x4600,
62 .irq = MPC83xx_IRQ_UART2,
63 .iotype = UPIO_MEM,
64 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
65 },
Kumar Gala7f8cd802005-05-20 13:59:13 -070066 { },
Linus Torvalds1da177e2005-04-16 15:20:36 -070067};
68
69struct platform_device ppc_sys_platform_devices[] = {
70 [MPC83xx_TSEC1] = {
71 .name = "fsl-gianfar",
72 .id = 1,
73 .dev.platform_data = &mpc83xx_tsec1_pdata,
74 .num_resources = 4,
75 .resource = (struct resource[]) {
76 {
77 .start = 0x24000,
78 .end = 0x24fff,
79 .flags = IORESOURCE_MEM,
80 },
81 {
82 .name = "tx",
83 .start = MPC83xx_IRQ_TSEC1_TX,
84 .end = MPC83xx_IRQ_TSEC1_TX,
85 .flags = IORESOURCE_IRQ,
86 },
87 {
88 .name = "rx",
89 .start = MPC83xx_IRQ_TSEC1_RX,
90 .end = MPC83xx_IRQ_TSEC1_RX,
91 .flags = IORESOURCE_IRQ,
92 },
93 {
94 .name = "error",
95 .start = MPC83xx_IRQ_TSEC1_ERROR,
96 .end = MPC83xx_IRQ_TSEC1_ERROR,
97 .flags = IORESOURCE_IRQ,
98 },
99 },
100 },
101 [MPC83xx_TSEC2] = {
102 .name = "fsl-gianfar",
103 .id = 2,
104 .dev.platform_data = &mpc83xx_tsec2_pdata,
105 .num_resources = 4,
106 .resource = (struct resource[]) {
107 {
108 .start = 0x25000,
109 .end = 0x25fff,
110 .flags = IORESOURCE_MEM,
111 },
112 {
113 .name = "tx",
114 .start = MPC83xx_IRQ_TSEC2_TX,
115 .end = MPC83xx_IRQ_TSEC2_TX,
116 .flags = IORESOURCE_IRQ,
117 },
118 {
119 .name = "rx",
120 .start = MPC83xx_IRQ_TSEC2_RX,
121 .end = MPC83xx_IRQ_TSEC2_RX,
122 .flags = IORESOURCE_IRQ,
123 },
124 {
125 .name = "error",
126 .start = MPC83xx_IRQ_TSEC2_ERROR,
127 .end = MPC83xx_IRQ_TSEC2_ERROR,
128 .flags = IORESOURCE_IRQ,
129 },
130 },
131 },
132 [MPC83xx_IIC1] = {
133 .name = "fsl-i2c",
134 .id = 1,
135 .dev.platform_data = &mpc83xx_fsl_i2c1_pdata,
136 .num_resources = 2,
137 .resource = (struct resource[]) {
138 {
139 .start = 0x3000,
140 .end = 0x30ff,
141 .flags = IORESOURCE_MEM,
142 },
143 {
144 .start = MPC83xx_IRQ_IIC1,
145 .end = MPC83xx_IRQ_IIC1,
146 .flags = IORESOURCE_IRQ,
147 },
148 },
149 },
150 [MPC83xx_IIC2] = {
151 .name = "fsl-i2c",
152 .id = 2,
153 .dev.platform_data = &mpc83xx_fsl_i2c2_pdata,
154 .num_resources = 2,
155 .resource = (struct resource[]) {
156 {
157 .start = 0x3100,
158 .end = 0x31ff,
159 .flags = IORESOURCE_MEM,
160 },
161 {
162 .start = MPC83xx_IRQ_IIC2,
163 .end = MPC83xx_IRQ_IIC2,
164 .flags = IORESOURCE_IRQ,
165 },
166 },
167 },
168 [MPC83xx_DUART] = {
169 .name = "serial8250",
Russell King6df29de2005-09-08 16:04:41 +0100170 .id = PLAT8250_DEV_PLATFORM,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171 .dev.platform_data = serial_platform_data,
172 },
173 [MPC83xx_SEC2] = {
174 .name = "fsl-sec2",
175 .id = 1,
176 .num_resources = 2,
177 .resource = (struct resource[]) {
178 {
179 .start = 0x30000,
180 .end = 0x3ffff,
181 .flags = IORESOURCE_MEM,
182 },
183 {
184 .start = MPC83xx_IRQ_SEC2,
185 .end = MPC83xx_IRQ_SEC2,
186 .flags = IORESOURCE_IRQ,
187 },
188 },
189 },
190 [MPC83xx_USB2_DR] = {
191 .name = "fsl-usb2-dr",
192 .id = 1,
193 .num_resources = 2,
194 .resource = (struct resource[]) {
195 {
Kumar Gala5e708482005-08-08 14:49:17 -0700196 .start = 0x23000,
197 .end = 0x23fff,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 .flags = IORESOURCE_MEM,
199 },
200 {
201 .start = MPC83xx_IRQ_USB2_DR,
202 .end = MPC83xx_IRQ_USB2_DR,
203 .flags = IORESOURCE_IRQ,
204 },
205 },
206 },
207 [MPC83xx_USB2_MPH] = {
208 .name = "fsl-usb2-mph",
209 .id = 1,
210 .num_resources = 2,
211 .resource = (struct resource[]) {
212 {
Kumar Gala5e708482005-08-08 14:49:17 -0700213 .start = 0x22000,
214 .end = 0x22fff,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 .flags = IORESOURCE_MEM,
216 },
217 {
218 .start = MPC83xx_IRQ_USB2_MPH,
219 .end = MPC83xx_IRQ_USB2_MPH,
220 .flags = IORESOURCE_IRQ,
221 },
222 },
223 },
Kumar Gala78b33122005-11-08 21:34:37 -0800224 [MPC83xx_MDIO] = {
225 .name = "fsl-gianfar_mdio",
226 .id = 0,
227 .dev.platform_data = &mpc83xx_mdio_pdata,
Kumar Gala7e78e5e2006-01-12 21:04:23 -0600228 .num_resources = 1,
229 .resource = (struct resource[]) {
230 {
231 .start = 0x24520,
232 .end = 0x2453f,
233 .flags = IORESOURCE_MEM,
234 },
235 },
Kumar Gala78b33122005-11-08 21:34:37 -0800236 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237};
238
239static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
240{
241 ppc_sys_fixup_mem_resource(pdev, immrbar);
242 return 0;
243}
244
245static int __init mach_mpc83xx_init(void)
246{
247 if (ppc_md.progress)
248 ppc_md.progress("mach_mpc83xx_init:enter", 0);
249 ppc_sys_device_fixup = mach_mpc83xx_fixup;
250 return 0;
251}
252
253postcore_initcall(mach_mpc83xx_init);