Merge ../powerpc-merge
[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  = 2,
174                 .resource = (struct resource[]) {
175                         {
176                                 .name   = "regs",
177                                 .start  = 0xa82,
178                                 .end    = 0xa91,
179                                 .flags  = IORESOURCE_MEM,
180                         },
181                         {
182                                 .name   = "interrupt",
183                                 .start  = MPC8xx_INT_SMC1,
184                                 .end    = MPC8xx_INT_SMC1,
185                                 .flags  = IORESOURCE_IRQ,
186                         },
187                 },
188         },
189         [MPC8xx_CPM_SMC2] = {
190                 .name = "fsl-cpm-smc",
191                 .id     = 2,
192                 .num_resources  = 2,
193                 .resource = (struct resource[]) {
194                         {
195                                 .name   = "regs",
196                                 .start  = 0xa92,
197                                 .end    = 0xaa1,
198                                 .flags  = IORESOURCE_MEM,
199                         },
200                         {
201                                 .name   = "interrupt",
202                                 .start  = MPC8xx_INT_SMC2,
203                                 .end    = MPC8xx_INT_SMC2,
204                                 .flags  = IORESOURCE_IRQ,
205                         },
206                 },
207         },
208 };
209
210 static int __init mach_mpc8xx_fixup(struct platform_device *pdev)
211 {
212         ppc_sys_fixup_mem_resource (pdev, IMAP_ADDR);
213         return 0;
214 }
215
216 static int __init mach_mpc8xx_init(void)
217 {
218         ppc_sys_device_fixup = mach_mpc8xx_fixup;
219         return 0;
220 }
221
222 postcore_initcall(mach_mpc8xx_init);