Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * arch/ppc/platforms/83xx/mpc83xx_devices.c |
| 3 | * |
| 4 | * MPC83xx Device descriptions |
| 5 | * |
| 6 | * Maintainer: Kumar Gala <kumar.gala@freescale.com> |
| 7 | * |
| 8 | * Copyright 2005 Freescale Semiconductor Inc. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify it |
| 11 | * under the terms of the GNU General Public License as published by the |
| 12 | * Free Software Foundation; either version 2 of the License, or (at your |
| 13 | * option) any later version. |
| 14 | */ |
| 15 | |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/module.h> |
| 18 | #include <linux/device.h> |
| 19 | #include <linux/serial_8250.h> |
| 20 | #include <linux/fsl_devices.h> |
| 21 | #include <asm/mpc83xx.h> |
| 22 | #include <asm/irq.h> |
| 23 | #include <asm/ppc_sys.h> |
Paul Mackerras | fd582ec | 2005-10-11 22:08:12 +1000 | [diff] [blame] | 24 | #include <asm/machdep.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
| 26 | /* We use offsets for IORESOURCE_MEM since we do not know at compile time |
| 27 | * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup |
| 28 | */ |
| 29 | |
| 30 | static struct gianfar_platform_data mpc83xx_tsec1_pdata = { |
| 31 | .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | |
| 32 | FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | |
| 33 | FSL_GIANFAR_DEV_HAS_MULTI_INTR, |
| 34 | .phy_reg_addr = 0x24000, |
| 35 | }; |
| 36 | |
| 37 | static struct gianfar_platform_data mpc83xx_tsec2_pdata = { |
| 38 | .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | |
| 39 | FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | |
| 40 | FSL_GIANFAR_DEV_HAS_MULTI_INTR, |
| 41 | .phy_reg_addr = 0x24000, |
| 42 | }; |
| 43 | |
| 44 | static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = { |
| 45 | .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR, |
| 46 | }; |
| 47 | |
| 48 | static struct fsl_i2c_platform_data mpc83xx_fsl_i2c2_pdata = { |
| 49 | .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR, |
| 50 | }; |
| 51 | |
| 52 | static struct plat_serial8250_port serial_platform_data[] = { |
| 53 | [0] = { |
| 54 | .mapbase = 0x4500, |
| 55 | .irq = MPC83xx_IRQ_UART1, |
| 56 | .iotype = UPIO_MEM, |
| 57 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
| 58 | }, |
| 59 | [1] = { |
| 60 | .mapbase = 0x4600, |
| 61 | .irq = MPC83xx_IRQ_UART2, |
| 62 | .iotype = UPIO_MEM, |
| 63 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
| 64 | }, |
Kumar Gala | 7f8cd80 | 2005-05-20 13:59:13 -0700 | [diff] [blame] | 65 | { }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | struct platform_device ppc_sys_platform_devices[] = { |
| 69 | [MPC83xx_TSEC1] = { |
| 70 | .name = "fsl-gianfar", |
| 71 | .id = 1, |
| 72 | .dev.platform_data = &mpc83xx_tsec1_pdata, |
| 73 | .num_resources = 4, |
| 74 | .resource = (struct resource[]) { |
| 75 | { |
| 76 | .start = 0x24000, |
| 77 | .end = 0x24fff, |
| 78 | .flags = IORESOURCE_MEM, |
| 79 | }, |
| 80 | { |
| 81 | .name = "tx", |
| 82 | .start = MPC83xx_IRQ_TSEC1_TX, |
| 83 | .end = MPC83xx_IRQ_TSEC1_TX, |
| 84 | .flags = IORESOURCE_IRQ, |
| 85 | }, |
| 86 | { |
| 87 | .name = "rx", |
| 88 | .start = MPC83xx_IRQ_TSEC1_RX, |
| 89 | .end = MPC83xx_IRQ_TSEC1_RX, |
| 90 | .flags = IORESOURCE_IRQ, |
| 91 | }, |
| 92 | { |
| 93 | .name = "error", |
| 94 | .start = MPC83xx_IRQ_TSEC1_ERROR, |
| 95 | .end = MPC83xx_IRQ_TSEC1_ERROR, |
| 96 | .flags = IORESOURCE_IRQ, |
| 97 | }, |
| 98 | }, |
| 99 | }, |
| 100 | [MPC83xx_TSEC2] = { |
| 101 | .name = "fsl-gianfar", |
| 102 | .id = 2, |
| 103 | .dev.platform_data = &mpc83xx_tsec2_pdata, |
| 104 | .num_resources = 4, |
| 105 | .resource = (struct resource[]) { |
| 106 | { |
| 107 | .start = 0x25000, |
| 108 | .end = 0x25fff, |
| 109 | .flags = IORESOURCE_MEM, |
| 110 | }, |
| 111 | { |
| 112 | .name = "tx", |
| 113 | .start = MPC83xx_IRQ_TSEC2_TX, |
| 114 | .end = MPC83xx_IRQ_TSEC2_TX, |
| 115 | .flags = IORESOURCE_IRQ, |
| 116 | }, |
| 117 | { |
| 118 | .name = "rx", |
| 119 | .start = MPC83xx_IRQ_TSEC2_RX, |
| 120 | .end = MPC83xx_IRQ_TSEC2_RX, |
| 121 | .flags = IORESOURCE_IRQ, |
| 122 | }, |
| 123 | { |
| 124 | .name = "error", |
| 125 | .start = MPC83xx_IRQ_TSEC2_ERROR, |
| 126 | .end = MPC83xx_IRQ_TSEC2_ERROR, |
| 127 | .flags = IORESOURCE_IRQ, |
| 128 | }, |
| 129 | }, |
| 130 | }, |
| 131 | [MPC83xx_IIC1] = { |
| 132 | .name = "fsl-i2c", |
| 133 | .id = 1, |
| 134 | .dev.platform_data = &mpc83xx_fsl_i2c1_pdata, |
| 135 | .num_resources = 2, |
| 136 | .resource = (struct resource[]) { |
| 137 | { |
| 138 | .start = 0x3000, |
| 139 | .end = 0x30ff, |
| 140 | .flags = IORESOURCE_MEM, |
| 141 | }, |
| 142 | { |
| 143 | .start = MPC83xx_IRQ_IIC1, |
| 144 | .end = MPC83xx_IRQ_IIC1, |
| 145 | .flags = IORESOURCE_IRQ, |
| 146 | }, |
| 147 | }, |
| 148 | }, |
| 149 | [MPC83xx_IIC2] = { |
| 150 | .name = "fsl-i2c", |
| 151 | .id = 2, |
| 152 | .dev.platform_data = &mpc83xx_fsl_i2c2_pdata, |
| 153 | .num_resources = 2, |
| 154 | .resource = (struct resource[]) { |
| 155 | { |
| 156 | .start = 0x3100, |
| 157 | .end = 0x31ff, |
| 158 | .flags = IORESOURCE_MEM, |
| 159 | }, |
| 160 | { |
| 161 | .start = MPC83xx_IRQ_IIC2, |
| 162 | .end = MPC83xx_IRQ_IIC2, |
| 163 | .flags = IORESOURCE_IRQ, |
| 164 | }, |
| 165 | }, |
| 166 | }, |
| 167 | [MPC83xx_DUART] = { |
| 168 | .name = "serial8250", |
Russell King | 6df29de | 2005-09-08 16:04:41 +0100 | [diff] [blame] | 169 | .id = PLAT8250_DEV_PLATFORM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | .dev.platform_data = serial_platform_data, |
| 171 | }, |
| 172 | [MPC83xx_SEC2] = { |
| 173 | .name = "fsl-sec2", |
| 174 | .id = 1, |
| 175 | .num_resources = 2, |
| 176 | .resource = (struct resource[]) { |
| 177 | { |
| 178 | .start = 0x30000, |
| 179 | .end = 0x3ffff, |
| 180 | .flags = IORESOURCE_MEM, |
| 181 | }, |
| 182 | { |
| 183 | .start = MPC83xx_IRQ_SEC2, |
| 184 | .end = MPC83xx_IRQ_SEC2, |
| 185 | .flags = IORESOURCE_IRQ, |
| 186 | }, |
| 187 | }, |
| 188 | }, |
| 189 | [MPC83xx_USB2_DR] = { |
| 190 | .name = "fsl-usb2-dr", |
| 191 | .id = 1, |
| 192 | .num_resources = 2, |
| 193 | .resource = (struct resource[]) { |
| 194 | { |
Kumar Gala | 5e70848 | 2005-08-08 14:49:17 -0700 | [diff] [blame] | 195 | .start = 0x23000, |
| 196 | .end = 0x23fff, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | .flags = IORESOURCE_MEM, |
| 198 | }, |
| 199 | { |
| 200 | .start = MPC83xx_IRQ_USB2_DR, |
| 201 | .end = MPC83xx_IRQ_USB2_DR, |
| 202 | .flags = IORESOURCE_IRQ, |
| 203 | }, |
| 204 | }, |
| 205 | }, |
| 206 | [MPC83xx_USB2_MPH] = { |
| 207 | .name = "fsl-usb2-mph", |
| 208 | .id = 1, |
| 209 | .num_resources = 2, |
| 210 | .resource = (struct resource[]) { |
| 211 | { |
Kumar Gala | 5e70848 | 2005-08-08 14:49:17 -0700 | [diff] [blame] | 212 | .start = 0x22000, |
| 213 | .end = 0x22fff, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | .flags = IORESOURCE_MEM, |
| 215 | }, |
| 216 | { |
| 217 | .start = MPC83xx_IRQ_USB2_MPH, |
| 218 | .end = MPC83xx_IRQ_USB2_MPH, |
| 219 | .flags = IORESOURCE_IRQ, |
| 220 | }, |
| 221 | }, |
| 222 | }, |
| 223 | }; |
| 224 | |
| 225 | static int __init mach_mpc83xx_fixup(struct platform_device *pdev) |
| 226 | { |
| 227 | ppc_sys_fixup_mem_resource(pdev, immrbar); |
| 228 | return 0; |
| 229 | } |
| 230 | |
| 231 | static int __init mach_mpc83xx_init(void) |
| 232 | { |
| 233 | if (ppc_md.progress) |
| 234 | ppc_md.progress("mach_mpc83xx_init:enter", 0); |
| 235 | ppc_sys_device_fixup = mach_mpc83xx_fixup; |
| 236 | return 0; |
| 237 | } |
| 238 | |
| 239 | postcore_initcall(mach_mpc83xx_init); |