Merge branch 'master' of /home/aia21/ntfs-2.6/
[linux-2.6] / arch / ppc / syslib / mpc52xx_devices.c
1 /*
2  * Freescale MPC52xx device descriptions
3  *
4  *
5  * Maintainer : Sylvain Munaut <tnt@246tNt.com>
6  *
7  * Copyright (C) 2005 Sylvain Munaut <tnt@246tNt.com>
8  *
9  * This file is licensed under the terms of the GNU General Public License
10  * version 2. This program is licensed "as is" without any warranty of any
11  * kind, whether express or implied.
12  */
13
14 #include <linux/fsl_devices.h>
15 #include <linux/resource.h>
16 #include <linux/platform_device.h>
17 #include <asm/mpc52xx.h>
18 #include <asm/ppc_sys.h>
19
20
21 static u64 mpc52xx_dma_mask = 0xffffffffULL;
22
23 static struct fsl_i2c_platform_data mpc52xx_fsl_i2c_pdata = {
24         .device_flags = FSL_I2C_DEV_CLOCK_5200,
25 };
26
27
28 /* We use relative offsets for IORESOURCE_MEM to be independent from the
29  * MBAR location at compile time
30  */
31
32 /* TODO Add the BestComm initiator channel to the device definitions,
33    possibly using IORESOURCE_DMA. But that's when BestComm is ready ... */
34
35 struct platform_device ppc_sys_platform_devices[] = {
36         [MPC52xx_MSCAN1] = {
37                 .name           = "mpc52xx-mscan",
38                 .id             = 0,
39                 .num_resources  = 2,
40                 .resource = (struct resource[]) {
41                         {
42                                 .start  = 0x0900,
43                                 .end    = 0x097f,
44                                 .flags  = IORESOURCE_MEM,
45                         },
46                         {
47                                 .start  = MPC52xx_MSCAN1_IRQ,
48                                 .end    = MPC52xx_MSCAN1_IRQ,
49                                 .flags  = IORESOURCE_IRQ,
50                         },
51                 },
52         },
53         [MPC52xx_MSCAN2] = {
54                 .name           = "mpc52xx-mscan",
55                 .id             = 1,
56                 .num_resources  = 2,
57                 .resource = (struct resource[]) {
58                         {
59                                 .start  = 0x0980,
60                                 .end    = 0x09ff,
61                                 .flags  = IORESOURCE_MEM,
62                         },
63                         {
64                                 .start  = MPC52xx_MSCAN2_IRQ,
65                                 .end    = MPC52xx_MSCAN2_IRQ,
66                                 .flags  = IORESOURCE_IRQ,
67                         },
68                 },
69         },
70         [MPC52xx_SPI] = {
71                 .name           = "mpc52xx-spi",
72                 .id             = -1,
73                 .num_resources  = 3,
74                 .resource       = (struct resource[]) {
75                         {
76                                 .start  = 0x0f00,
77                                 .end    = 0x0f1f,
78                                 .flags  = IORESOURCE_MEM,
79                         },
80                         {
81                                 .name   = "modf",
82                                 .start  = MPC52xx_SPI_MODF_IRQ,
83                                 .end    = MPC52xx_SPI_MODF_IRQ,
84                                 .flags  = IORESOURCE_IRQ,
85                         },
86                         {
87                                 .name   = "spif",
88                                 .start  = MPC52xx_SPI_SPIF_IRQ,
89                                 .end    = MPC52xx_SPI_SPIF_IRQ,
90                                 .flags  = IORESOURCE_IRQ,
91                         },
92                 },
93         },
94         [MPC52xx_USB] = {
95                 .name           = "ppc-soc-ohci",
96                 .id             = -1,
97                 .num_resources  = 2,
98                 .dev.dma_mask   = &mpc52xx_dma_mask,
99                 .dev.coherent_dma_mask = 0xffffffffULL,
100                 .resource       = (struct resource[]) {
101                         {
102                                 .start  = 0x1000,
103                                 .end    = 0x10ff,
104                                 .flags  = IORESOURCE_MEM,
105                         },
106                         {
107                                 .start  = MPC52xx_USB_IRQ,
108                                 .end    = MPC52xx_USB_IRQ,
109                                 .flags  = IORESOURCE_IRQ,
110                         },
111                 },
112         },
113         [MPC52xx_BDLC] = {
114                 .name           = "mpc52xx-bdlc",
115                 .id             = -1,
116                 .num_resources  = 2,
117                 .resource       = (struct resource[]) {
118                         {
119                                 .start  = 0x1300,
120                                 .end    = 0x130f,
121                                 .flags  = IORESOURCE_MEM,
122                         },
123                         {
124                                 .start  = MPC52xx_BDLC_IRQ,
125                                 .end    = MPC52xx_BDLC_IRQ,
126                                 .flags  = IORESOURCE_IRQ,
127                         },
128                 },
129         },
130         [MPC52xx_PSC1] = {
131                 .name           = "mpc52xx-psc",
132                 .id             = 0,
133                 .num_resources  = 2,
134                 .resource       = (struct resource[]) {
135                         {
136                                 .start  = 0x2000,
137                                 .end    = 0x209f,
138                                 .flags  = IORESOURCE_MEM,
139                         },
140                         {
141                                 .start  = MPC52xx_PSC1_IRQ,
142                                 .end    = MPC52xx_PSC1_IRQ,
143                                 .flags  = IORESOURCE_IRQ,
144                         },
145                 },
146         },
147         [MPC52xx_PSC2] = {
148                 .name           = "mpc52xx-psc",
149                 .id             = 1,
150                 .num_resources  = 2,
151                 .resource       = (struct resource[]) {
152                         {
153                                 .start  = 0x2200,
154                                 .end    = 0x229f,
155                                 .flags  = IORESOURCE_MEM,
156                         },
157                         {
158                                 .start  = MPC52xx_PSC2_IRQ,
159                                 .end    = MPC52xx_PSC2_IRQ,
160                                 .flags  = IORESOURCE_IRQ,
161                         },
162                 },
163         },
164         [MPC52xx_PSC3] = {
165                 .name           = "mpc52xx-psc",
166                 .id             = 2,
167                 .num_resources  = 2,
168                 .resource       = (struct resource[]) {
169                         {
170                                 .start  = 0x2400,
171                                 .end    = 0x249f,
172                                 .flags  = IORESOURCE_MEM,
173                         },
174                         {
175                                 .start  = MPC52xx_PSC3_IRQ,
176                                 .end    = MPC52xx_PSC3_IRQ,
177                                 .flags  = IORESOURCE_IRQ,
178                         },
179                 },
180         },
181         [MPC52xx_PSC4] = {
182                 .name           = "mpc52xx-psc",
183                 .id             = 3,
184                 .num_resources  = 2,
185                 .resource       = (struct resource[]) {
186                         {
187                                 .start  = 0x2600,
188                                 .end    = 0x269f,
189                                 .flags  = IORESOURCE_MEM,
190                         },
191                         {
192                                 .start  = MPC52xx_PSC4_IRQ,
193                                 .end    = MPC52xx_PSC4_IRQ,
194                                 .flags  = IORESOURCE_IRQ,
195                         },
196                 },
197         },
198         [MPC52xx_PSC5] = {
199                 .name           = "mpc52xx-psc",
200                 .id             = 4,
201                 .num_resources  = 2,
202                 .resource       = (struct resource[]) {
203                         {
204                                 .start  = 0x2800,
205                                 .end    = 0x289f,
206                                 .flags  = IORESOURCE_MEM,
207                         },
208                         {
209                                 .start  = MPC52xx_PSC5_IRQ,
210                                 .end    = MPC52xx_PSC5_IRQ,
211                                 .flags  = IORESOURCE_IRQ,
212                         },
213                 },
214         },
215         [MPC52xx_PSC6] = {
216                 .name           = "mpc52xx-psc",
217                 .id             = 5,
218                 .num_resources  = 2,
219                 .resource       = (struct resource[]) {
220                         {
221                                 .start  = 0x2c00,
222                                 .end    = 0x2c9f,
223                                 .flags  = IORESOURCE_MEM,
224                         },
225                         {
226                                 .start  = MPC52xx_PSC6_IRQ,
227                                 .end    = MPC52xx_PSC6_IRQ,
228                                 .flags  = IORESOURCE_IRQ,
229                         },
230                 },
231         },
232         [MPC52xx_FEC] = {
233                 .name           = "mpc52xx-fec",
234                 .id             = -1,
235                 .num_resources  = 2,
236                 .resource       = (struct resource[]) {
237                         {
238                                 .start  = 0x3000,
239                                 .end    = 0x33ff,
240                                 .flags  = IORESOURCE_MEM,
241                         },
242                         {
243                                 .start  = MPC52xx_FEC_IRQ,
244                                 .end    = MPC52xx_FEC_IRQ,
245                                 .flags  = IORESOURCE_IRQ,
246                         },
247                 },
248         },
249         [MPC52xx_ATA] = {
250                 .name           = "mpc52xx-ata",
251                 .id             = -1,
252                 .num_resources  = 2,
253                 .resource       = (struct resource[]) {
254                         {
255                                 .start  = 0x3a00,
256                                 .end    = 0x3aff,
257                                 .flags  = IORESOURCE_MEM,
258                         },
259                         {
260                                 .start  = MPC52xx_ATA_IRQ,
261                                 .end    = MPC52xx_ATA_IRQ,
262                                 .flags  = IORESOURCE_IRQ,
263                         },
264                 },
265         },
266         [MPC52xx_I2C1] = {
267                 .name           = "fsl-i2c",
268                 .id             = 0,
269                 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
270                 .num_resources  = 2,
271                 .resource       = (struct resource[]) {
272                         {
273                                 .start  = 0x3d00,
274                                 .end    = 0x3d1f,
275                                 .flags  = IORESOURCE_MEM,
276                         },
277                         {
278                                 .start  = MPC52xx_I2C1_IRQ,
279                                 .end    = MPC52xx_I2C1_IRQ,
280                                 .flags  = IORESOURCE_IRQ,
281                         },
282                 },
283         },
284         [MPC52xx_I2C2] = {
285                 .name           = "fsl-i2c",
286                 .id             = 1,
287                 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
288                 .num_resources  = 2,
289                 .resource       = (struct resource[]) {
290                         {
291                                 .start  = 0x3d40,
292                                 .end    = 0x3d5f,
293                                 .flags  = IORESOURCE_MEM,
294                         },
295                         {
296                                 .start  = MPC52xx_I2C2_IRQ,
297                                 .end    = MPC52xx_I2C2_IRQ,
298                                 .flags  = IORESOURCE_IRQ,
299                         },
300                 },
301         },
302 };
303
304
305 static int __init mach_mpc52xx_fixup(struct platform_device *pdev)
306 {
307         ppc_sys_fixup_mem_resource(pdev, MPC52xx_MBAR);
308         return 0;
309 }
310
311 static int __init mach_mpc52xx_init(void)
312 {
313         ppc_sys_device_fixup = mach_mpc52xx_fixup;
314         return 0;
315 }
316
317 postcore_initcall(mach_mpc52xx_init);