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