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