Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 1 | /* |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 2 | * PQ2 Device descriptions |
| 3 | * |
Kumar Gala | 4c8d3d9 | 2005-11-13 16:06:30 -0800 | [diff] [blame] | 4 | * Maintainer: Kumar Gala <galak@kernel.crashing.org> |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 5 | * |
| 6 | * This file is licensed under the terms of the GNU General Public License |
| 7 | * version 2. This program is licensed "as is" without any warranty of any |
| 8 | * kind, whether express or implied. |
| 9 | */ |
| 10 | |
| 11 | |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/module.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 14 | #include <linux/platform_device.h> |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 15 | #include <linux/ioport.h> |
| 16 | #include <asm/cpm2.h> |
| 17 | #include <asm/irq.h> |
| 18 | #include <asm/ppc_sys.h> |
Paul Mackerras | fd582ec | 2005-10-11 22:08:12 +1000 | [diff] [blame] | 19 | #include <asm/machdep.h> |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 20 | |
| 21 | struct platform_device ppc_sys_platform_devices[] = { |
| 22 | [MPC82xx_CPM_FCC1] = { |
| 23 | .name = "fsl-cpm-fcc", |
| 24 | .id = 1, |
| 25 | .num_resources = 3, |
| 26 | .resource = (struct resource[]) { |
| 27 | { |
| 28 | .name = "fcc_regs", |
| 29 | .start = 0x11300, |
| 30 | .end = 0x1131f, |
| 31 | .flags = IORESOURCE_MEM, |
| 32 | }, |
| 33 | { |
| 34 | .name = "fcc_pram", |
| 35 | .start = 0x8400, |
| 36 | .end = 0x84ff, |
| 37 | .flags = IORESOURCE_MEM, |
| 38 | }, |
| 39 | { |
| 40 | .start = SIU_INT_FCC1, |
| 41 | .end = SIU_INT_FCC1, |
| 42 | .flags = IORESOURCE_IRQ, |
| 43 | }, |
| 44 | }, |
| 45 | }, |
| 46 | [MPC82xx_CPM_FCC2] = { |
| 47 | .name = "fsl-cpm-fcc", |
| 48 | .id = 2, |
| 49 | .num_resources = 3, |
| 50 | .resource = (struct resource[]) { |
| 51 | { |
| 52 | .name = "fcc_regs", |
| 53 | .start = 0x11320, |
| 54 | .end = 0x1133f, |
| 55 | .flags = IORESOURCE_MEM, |
| 56 | }, |
| 57 | { |
| 58 | .name = "fcc_pram", |
| 59 | .start = 0x8500, |
| 60 | .end = 0x85ff, |
| 61 | .flags = IORESOURCE_MEM, |
| 62 | }, |
| 63 | { |
| 64 | .start = SIU_INT_FCC2, |
| 65 | .end = SIU_INT_FCC2, |
| 66 | .flags = IORESOURCE_IRQ, |
| 67 | }, |
| 68 | }, |
| 69 | }, |
| 70 | [MPC82xx_CPM_FCC3] = { |
| 71 | .name = "fsl-cpm-fcc", |
| 72 | .id = 3, |
| 73 | .num_resources = 3, |
| 74 | .resource = (struct resource[]) { |
| 75 | { |
| 76 | .name = "fcc_regs", |
| 77 | .start = 0x11340, |
| 78 | .end = 0x1135f, |
| 79 | .flags = IORESOURCE_MEM, |
| 80 | }, |
| 81 | { |
| 82 | .name = "fcc_pram", |
| 83 | .start = 0x8600, |
| 84 | .end = 0x86ff, |
| 85 | .flags = IORESOURCE_MEM, |
| 86 | }, |
| 87 | { |
| 88 | .start = SIU_INT_FCC3, |
| 89 | .end = SIU_INT_FCC3, |
| 90 | .flags = IORESOURCE_IRQ, |
| 91 | }, |
| 92 | }, |
| 93 | }, |
| 94 | [MPC82xx_CPM_I2C] = { |
| 95 | .name = "fsl-cpm-i2c", |
| 96 | .id = 1, |
| 97 | .num_resources = 3, |
| 98 | .resource = (struct resource[]) { |
| 99 | { |
| 100 | .name = "i2c_mem", |
| 101 | .start = 0x11860, |
| 102 | .end = 0x118BF, |
| 103 | .flags = IORESOURCE_MEM, |
| 104 | }, |
| 105 | { |
| 106 | .name = "i2c_pram", |
| 107 | .start = 0x8afc, |
| 108 | .end = 0x8afd, |
| 109 | .flags = IORESOURCE_MEM, |
| 110 | }, |
| 111 | { |
| 112 | .start = SIU_INT_I2C, |
| 113 | .end = SIU_INT_I2C, |
| 114 | .flags = IORESOURCE_IRQ, |
| 115 | }, |
| 116 | }, |
| 117 | }, |
| 118 | [MPC82xx_CPM_SCC1] = { |
| 119 | .name = "fsl-cpm-scc", |
| 120 | .id = 1, |
| 121 | .num_resources = 3, |
| 122 | .resource = (struct resource[]) { |
| 123 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 124 | .name = "regs", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 125 | .start = 0x11A00, |
| 126 | .end = 0x11A1F, |
| 127 | .flags = IORESOURCE_MEM, |
| 128 | }, |
| 129 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 130 | .name = "pram", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 131 | .start = 0x8000, |
| 132 | .end = 0x80ff, |
| 133 | .flags = IORESOURCE_MEM, |
| 134 | }, |
| 135 | { |
| 136 | .start = SIU_INT_SCC1, |
| 137 | .end = SIU_INT_SCC1, |
| 138 | .flags = IORESOURCE_IRQ, |
| 139 | }, |
| 140 | }, |
| 141 | }, |
| 142 | [MPC82xx_CPM_SCC2] = { |
| 143 | .name = "fsl-cpm-scc", |
| 144 | .id = 2, |
| 145 | .num_resources = 3, |
| 146 | .resource = (struct resource[]) { |
| 147 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 148 | .name = "regs", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 149 | .start = 0x11A20, |
| 150 | .end = 0x11A3F, |
| 151 | .flags = IORESOURCE_MEM, |
| 152 | }, |
| 153 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 154 | .name = "pram", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 155 | .start = 0x8100, |
| 156 | .end = 0x81ff, |
| 157 | .flags = IORESOURCE_MEM, |
| 158 | }, |
| 159 | { |
| 160 | .start = SIU_INT_SCC2, |
| 161 | .end = SIU_INT_SCC2, |
| 162 | .flags = IORESOURCE_IRQ, |
| 163 | }, |
| 164 | }, |
| 165 | }, |
| 166 | [MPC82xx_CPM_SCC3] = { |
| 167 | .name = "fsl-cpm-scc", |
| 168 | .id = 3, |
| 169 | .num_resources = 3, |
| 170 | .resource = (struct resource[]) { |
| 171 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 172 | .name = "regs", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 173 | .start = 0x11A40, |
| 174 | .end = 0x11A5F, |
| 175 | .flags = IORESOURCE_MEM, |
| 176 | }, |
| 177 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 178 | .name = "pram", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 179 | .start = 0x8200, |
| 180 | .end = 0x82ff, |
| 181 | .flags = IORESOURCE_MEM, |
| 182 | }, |
| 183 | { |
| 184 | .start = SIU_INT_SCC3, |
| 185 | .end = SIU_INT_SCC3, |
| 186 | .flags = IORESOURCE_IRQ, |
| 187 | }, |
| 188 | }, |
| 189 | }, |
| 190 | [MPC82xx_CPM_SCC4] = { |
| 191 | .name = "fsl-cpm-scc", |
| 192 | .id = 4, |
| 193 | .num_resources = 3, |
| 194 | .resource = (struct resource[]) { |
| 195 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 196 | .name = "regs", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 197 | .start = 0x11A60, |
| 198 | .end = 0x11A7F, |
| 199 | .flags = IORESOURCE_MEM, |
| 200 | }, |
| 201 | { |
Vitaly Bordug | 8e30a9a | 2006-05-24 21:40:18 +0400 | [diff] [blame] | 202 | .name = "pram", |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 203 | .start = 0x8300, |
| 204 | .end = 0x83ff, |
| 205 | .flags = IORESOURCE_MEM, |
| 206 | }, |
| 207 | { |
| 208 | .start = SIU_INT_SCC4, |
| 209 | .end = SIU_INT_SCC4, |
| 210 | .flags = IORESOURCE_IRQ, |
| 211 | }, |
| 212 | }, |
| 213 | }, |
| 214 | [MPC82xx_CPM_SPI] = { |
| 215 | .name = "fsl-cpm-spi", |
| 216 | .id = 1, |
| 217 | .num_resources = 3, |
| 218 | .resource = (struct resource[]) { |
| 219 | { |
| 220 | .name = "spi_mem", |
| 221 | .start = 0x11AA0, |
| 222 | .end = 0x11AFF, |
| 223 | .flags = IORESOURCE_MEM, |
| 224 | }, |
| 225 | { |
| 226 | .name = "spi_pram", |
| 227 | .start = 0x89fc, |
| 228 | .end = 0x89fd, |
| 229 | .flags = IORESOURCE_MEM, |
| 230 | }, |
| 231 | { |
| 232 | .start = SIU_INT_SPI, |
| 233 | .end = SIU_INT_SPI, |
| 234 | .flags = IORESOURCE_IRQ, |
| 235 | }, |
| 236 | }, |
| 237 | }, |
| 238 | [MPC82xx_CPM_MCC1] = { |
| 239 | .name = "fsl-cpm-mcc", |
| 240 | .id = 1, |
| 241 | .num_resources = 3, |
| 242 | .resource = (struct resource[]) { |
| 243 | { |
| 244 | .name = "mcc_mem", |
| 245 | .start = 0x11B30, |
| 246 | .end = 0x11B3F, |
| 247 | .flags = IORESOURCE_MEM, |
| 248 | }, |
| 249 | { |
| 250 | .name = "mcc_pram", |
| 251 | .start = 0x8700, |
| 252 | .end = 0x877f, |
| 253 | .flags = IORESOURCE_MEM, |
| 254 | }, |
| 255 | { |
| 256 | .start = SIU_INT_MCC1, |
| 257 | .end = SIU_INT_MCC1, |
| 258 | .flags = IORESOURCE_IRQ, |
| 259 | }, |
| 260 | }, |
| 261 | }, |
| 262 | [MPC82xx_CPM_MCC2] = { |
| 263 | .name = "fsl-cpm-mcc", |
| 264 | .id = 2, |
| 265 | .num_resources = 3, |
| 266 | .resource = (struct resource[]) { |
| 267 | { |
| 268 | .name = "mcc_mem", |
| 269 | .start = 0x11B50, |
| 270 | .end = 0x11B5F, |
| 271 | .flags = IORESOURCE_MEM, |
| 272 | }, |
| 273 | { |
| 274 | .name = "mcc_pram", |
| 275 | .start = 0x8800, |
| 276 | .end = 0x887f, |
| 277 | .flags = IORESOURCE_MEM, |
| 278 | }, |
| 279 | { |
| 280 | .start = SIU_INT_MCC2, |
| 281 | .end = SIU_INT_MCC2, |
| 282 | .flags = IORESOURCE_IRQ, |
| 283 | }, |
| 284 | }, |
| 285 | }, |
| 286 | [MPC82xx_CPM_SMC1] = { |
| 287 | .name = "fsl-cpm-smc", |
| 288 | .id = 1, |
| 289 | .num_resources = 3, |
| 290 | .resource = (struct resource[]) { |
| 291 | { |
| 292 | .name = "smc_mem", |
| 293 | .start = 0x11A80, |
| 294 | .end = 0x11A8F, |
| 295 | .flags = IORESOURCE_MEM, |
| 296 | }, |
| 297 | { |
| 298 | .name = "smc_pram", |
| 299 | .start = 0x87fc, |
| 300 | .end = 0x87fd, |
| 301 | .flags = IORESOURCE_MEM, |
| 302 | }, |
| 303 | { |
| 304 | .start = SIU_INT_SMC1, |
| 305 | .end = SIU_INT_SMC1, |
| 306 | .flags = IORESOURCE_IRQ, |
| 307 | }, |
| 308 | }, |
| 309 | }, |
| 310 | [MPC82xx_CPM_SMC2] = { |
| 311 | .name = "fsl-cpm-smc", |
| 312 | .id = 2, |
| 313 | .num_resources = 3, |
| 314 | .resource = (struct resource[]) { |
| 315 | { |
| 316 | .name = "smc_mem", |
| 317 | .start = 0x11A90, |
| 318 | .end = 0x11A9F, |
| 319 | .flags = IORESOURCE_MEM, |
| 320 | }, |
| 321 | { |
| 322 | .name = "smc_pram", |
| 323 | .start = 0x88fc, |
| 324 | .end = 0x88fd, |
| 325 | .flags = IORESOURCE_MEM, |
| 326 | }, |
| 327 | { |
| 328 | .start = SIU_INT_SMC2, |
| 329 | .end = SIU_INT_SMC2, |
| 330 | .flags = IORESOURCE_IRQ, |
| 331 | }, |
| 332 | }, |
| 333 | }, |
| 334 | [MPC82xx_CPM_USB] = { |
| 335 | .name = "fsl-cpm-usb", |
| 336 | .id = 1, |
| 337 | .num_resources = 3, |
| 338 | .resource = (struct resource[]) { |
| 339 | { |
| 340 | .name = "usb_mem", |
| 341 | .start = 0x11b60, |
| 342 | .end = 0x11b78, |
| 343 | .flags = IORESOURCE_MEM, |
| 344 | }, |
| 345 | { |
| 346 | .name = "usb_pram", |
| 347 | .start = 0x8b00, |
| 348 | .end = 0x8bff, |
| 349 | .flags = IORESOURCE_MEM, |
| 350 | }, |
| 351 | { |
| 352 | .start = SIU_INT_USB, |
| 353 | .end = SIU_INT_USB, |
| 354 | .flags = IORESOURCE_IRQ, |
| 355 | }, |
| 356 | |
| 357 | }, |
| 358 | }, |
| 359 | [MPC82xx_SEC1] = { |
| 360 | .name = "fsl-sec", |
| 361 | .id = 1, |
| 362 | .num_resources = 1, |
| 363 | .resource = (struct resource[]) { |
| 364 | { |
| 365 | .name = "sec_mem", |
| 366 | .start = 0x40000, |
| 367 | .end = 0x52fff, |
| 368 | .flags = IORESOURCE_MEM, |
| 369 | }, |
| 370 | }, |
| 371 | }, |
Vitaly Bordug | 2ca2d5e | 2006-08-14 23:00:31 -0700 | [diff] [blame] | 372 | [MPC82xx_MDIO_BB] = { |
| 373 | .name = "fsl-bb-mdio", |
| 374 | .id = 0, |
| 375 | .num_resources = 0, |
| 376 | }, |
Kumar Gala | 8e8fff09 | 2005-09-03 15:55:34 -0700 | [diff] [blame] | 377 | }; |
| 378 | |
| 379 | static int __init mach_mpc82xx_fixup(struct platform_device *pdev) |
| 380 | { |
| 381 | ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR); |
| 382 | return 0; |
| 383 | } |
| 384 | |
| 385 | static int __init mach_mpc82xx_init(void) |
| 386 | { |
| 387 | if (ppc_md.progress) |
| 388 | ppc_md.progress("mach_mpc82xx_init:enter", 0); |
| 389 | ppc_sys_device_fixup = mach_mpc82xx_fixup; |
| 390 | return 0; |
| 391 | } |
| 392 | |
| 393 | postcore_initcall(mach_mpc82xx_init); |