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