Merge branch 'srp' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[linux-2.6] / arch / ppc / syslib / mpc8xx_devices.c
1 /*
2  * arch/ppc/syslib/mpc8xx_devices.c
3  *
4  * MPC8xx Device descriptions
5  *
6  * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7  *
8  * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug<vbordug@ru.mvista.com>
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/mii.h>
21 #include <asm/commproc.h>
22 #include <asm/mpc8xx.h>
23 #include <asm/irq.h>
24 #include <asm/ppc_sys.h>
25
26 /* We use offsets for IORESOURCE_MEM to do not set dependences at compile time.
27  * They will get fixed up by mach_mpc8xx_fixup
28  */
29
30 struct platform_device ppc_sys_platform_devices[] = {
31         [MPC8xx_CPM_FEC1] =     {
32                 .name = "fsl-cpm-fec",
33                 .id     = 1,
34                 .num_resources = 2,
35                 .resource = (struct resource[]) {
36                         {
37                                 .name   = "regs",
38                                 .start  = 0xe00,
39                                 .end    = 0xe88,
40                                 .flags  = IORESOURCE_MEM,
41                         },
42                         {
43                                 .name   = "interrupt",
44                                 .start  = MPC8xx_INT_FEC1,
45                                 .end    = MPC8xx_INT_FEC1,
46                                 .flags  = IORESOURCE_IRQ,
47                         },
48                 },
49         },
50         [MPC8xx_CPM_FEC2] =     {
51                 .name = "fsl-cpm-fec",
52                 .id     = 2,
53                 .num_resources = 2,
54                 .resource = (struct resource[]) {
55                         {
56                                 .name   = "regs",
57                                 .start  = 0x1e00,
58                                 .end    = 0x1e88,
59                                 .flags  = IORESOURCE_MEM,
60                         },
61                         {
62                                 .name   = "interrupt",
63                                 .start  = MPC8xx_INT_FEC2,
64                                 .end    = MPC8xx_INT_FEC2,
65                                 .flags  = IORESOURCE_IRQ,
66                         },
67                 },
68         },
69         [MPC8xx_CPM_SCC1] = {
70                 .name = "fsl-cpm-scc",
71                 .id     = 1,
72                 .num_resources = 3,
73                 .resource = (struct resource[]) {
74                         {
75                                 .name   = "regs",
76                                 .start  = 0xa00,
77                                 .end    = 0xa18,
78                                 .flags  = IORESOURCE_MEM,
79                         },
80                         {
81                                 .name   = "pram",
82                                 .start  = 0x3c00,
83                                 .end    = 0x3c80,
84                                 .flags  = IORESOURCE_MEM,
85                         },
86                         {
87                                 .name   = "interrupt",
88                                 .start  = MPC8xx_INT_SCC1,
89                                 .end    = MPC8xx_INT_SCC1,
90                                 .flags  = IORESOURCE_IRQ,
91                         },
92                 },
93         },
94         [MPC8xx_CPM_SCC2] = {
95                 .name = "fsl-cpm-scc",
96                 .id     = 2,
97                 .num_resources  = 3,
98                 .resource = (struct resource[]) {
99                         {
100                                 .name   = "regs",
101                                 .start  = 0xa20,
102                                 .end    = 0xa38,
103                                 .flags  = IORESOURCE_MEM,
104                         },
105                         {
106                                 .name   = "pram",
107                                 .start  = 0x3d00,
108                                 .end    = 0x3d80,
109                                 .flags  = IORESOURCE_MEM,
110                         },
111
112                         {
113                                 .name   = "interrupt",
114                                 .start  = MPC8xx_INT_SCC2,
115                                 .end    = MPC8xx_INT_SCC2,
116                                 .flags  = IORESOURCE_IRQ,
117                         },
118                 },
119         },
120         [MPC8xx_CPM_SCC3] = {
121                 .name = "fsl-cpm-scc",
122                 .id     = 3,
123                 .num_resources  = 3,
124                 .resource = (struct resource[]) {
125                         {
126                                 .name   = "regs",
127                                 .start  = 0xa40,
128                                 .end    = 0xa58,
129                                 .flags  = IORESOURCE_MEM,
130                         },
131                         {
132                                 .name   = "pram",
133                                 .start  = 0x3e00,
134                                 .end    = 0x3e80,
135                                 .flags  = IORESOURCE_MEM,
136                         },
137
138                         {
139                                 .name   = "interrupt",
140                                 .start  = MPC8xx_INT_SCC3,
141                                 .end    = MPC8xx_INT_SCC3,
142                                 .flags  = IORESOURCE_IRQ,
143                         },
144                 },
145         },
146         [MPC8xx_CPM_SCC4] = {
147                 .name = "fsl-cpm-scc",
148                 .id     = 4,
149                 .num_resources  = 3,
150                 .resource = (struct resource[]) {
151                         {
152                                 .name   = "regs",
153                                 .start  = 0xa60,
154                                 .end    = 0xa78,
155                                 .flags  = IORESOURCE_MEM,
156                         },
157                         {
158                                 .name   = "pram",
159                                 .start  = 0x3f00,
160                                 .end    = 0x3f80,
161                                 .flags  = IORESOURCE_MEM,
162                         },
163
164                         {
165                                 .name   = "interrupt",
166                                 .start  = MPC8xx_INT_SCC4,
167                                 .end    = MPC8xx_INT_SCC4,
168                                 .flags  = IORESOURCE_IRQ,
169                         },
170                 },
171         },
172         [MPC8xx_CPM_SMC1] = {
173                 .name = "fsl-cpm-smc",
174                 .id     = 1,
175                 .num_resources  = 2,
176                 .resource = (struct resource[]) {
177                         {
178                                 .name   = "regs",
179                                 .start  = 0xa82,
180                                 .end    = 0xa91,
181                                 .flags  = IORESOURCE_MEM,
182                         },
183                         {
184                                 .name   = "interrupt",
185                                 .start  = MPC8xx_INT_SMC1,
186                                 .end    = MPC8xx_INT_SMC1,
187                                 .flags  = IORESOURCE_IRQ,
188                         },
189                 },
190         },
191         [MPC8xx_CPM_SMC2] = {
192                 .name = "fsl-cpm-smc",
193                 .id     = 2,
194                 .num_resources  = 2,
195                 .resource = (struct resource[]) {
196                         {
197                                 .name   = "regs",
198                                 .start  = 0xa92,
199                                 .end    = 0xaa1,
200                                 .flags  = IORESOURCE_MEM,
201                         },
202                         {
203                                 .name   = "interrupt",
204                                 .start  = MPC8xx_INT_SMC2,
205                                 .end    = MPC8xx_INT_SMC2,
206                                 .flags  = IORESOURCE_IRQ,
207                         },
208                 },
209         },
210 };
211
212 static int __init mach_mpc8xx_fixup(struct platform_device *pdev)
213 {
214         ppc_sys_fixup_mem_resource (pdev, IMAP_ADDR);
215         return 0;
216 }
217
218 static int __init mach_mpc8xx_init(void)
219 {
220         ppc_sys_device_fixup = mach_mpc8xx_fixup;
221         return 0;
222 }
223
224 postcore_initcall(mach_mpc8xx_init);