Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf537/boards/cm_bf537.c |
| 3 | * Based on: arch/blackfin/mach-bf533/boards/ezkit.c |
| 4 | * Author: Aidan Williams <aidan@nicta.com.au> |
| 5 | * |
| 6 | * Created: 2005 |
| 7 | * Description: Board description file |
| 8 | * |
| 9 | * Modified: |
| 10 | * Copyright 2005 National ICT Australia (NICTA) |
| 11 | * Copyright 2004-2006 Analog Devices Inc. |
| 12 | * |
| 13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by |
| 17 | * the Free Software Foundation; either version 2 of the License, or |
| 18 | * (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, see the file COPYING, or write |
| 27 | * to the Free Software Foundation, Inc., |
| 28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 | */ |
| 30 | |
| 31 | #include <linux/device.h> |
Mike Frysinger | 43f73fe | 2007-12-24 19:35:35 +0800 | [diff] [blame] | 32 | #include <linux/etherdevice.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 33 | #include <linux/platform_device.h> |
| 34 | #include <linux/mtd/mtd.h> |
| 35 | #include <linux/mtd/partitions.h> |
| 36 | #include <linux/spi/spi.h> |
| 37 | #include <linux/spi/flash.h> |
Mike Frysinger | f02bcec | 2007-11-15 21:29:15 +0800 | [diff] [blame] | 38 | #include <linux/usb/isp1362.h> |
Jeff Garzik | 0a87e3e | 2008-02-01 18:02:30 -0500 | [diff] [blame] | 39 | #include <linux/ata_platform.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 40 | #include <linux/irq.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 41 | #include <asm/dma.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 42 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 43 | #include <asm/portmux.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 44 | |
| 45 | /* |
| 46 | * Name the Board for the /proc/cpuinfo |
| 47 | */ |
Mike Frysinger | 066954a | 2007-10-21 22:36:06 +0800 | [diff] [blame] | 48 | const char bfin_board_name[] = "Bluetechnix CM BF537"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 49 | |
| 50 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 51 | /* all SPI peripherals info goes here */ |
| 52 | |
| 53 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 54 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 55 | { |
| 56 | .name = "bootloader", |
| 57 | .size = 0x00020000, |
| 58 | .offset = 0, |
| 59 | .mask_flags = MTD_CAP_ROM |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 60 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 61 | .name = "kernel", |
| 62 | .size = 0xe0000, |
| 63 | .offset = 0x20000 |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 64 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 65 | .name = "file system", |
| 66 | .size = 0x700000, |
| 67 | .offset = 0x00100000, |
| 68 | } |
| 69 | }; |
| 70 | |
| 71 | static struct flash_platform_data bfin_spi_flash_data = { |
| 72 | .name = "m25p80", |
| 73 | .parts = bfin_spi_flash_partitions, |
| 74 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
| 75 | .type = "m25p64", |
| 76 | }; |
| 77 | |
| 78 | /* SPI flash chip (m25p64) */ |
| 79 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 80 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 81 | .bits_per_word = 8, |
| 82 | }; |
| 83 | #endif |
| 84 | |
| 85 | #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) |
| 86 | /* SPI ADC chip */ |
| 87 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
| 88 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 89 | .bits_per_word = 16, |
| 90 | }; |
| 91 | #endif |
| 92 | |
| 93 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 94 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 95 | .enable_dma = 0, |
| 96 | .bits_per_word = 16, |
| 97 | }; |
| 98 | #endif |
| 99 | |
| 100 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 101 | static struct bfin5xx_spi_chip ad9960_spi_chip_info = { |
| 102 | .enable_dma = 0, |
| 103 | .bits_per_word = 16, |
| 104 | }; |
| 105 | #endif |
| 106 | |
| 107 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) |
| 108 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { |
| 109 | .enable_dma = 1, |
| 110 | .bits_per_word = 8, |
| 111 | }; |
| 112 | #endif |
| 113 | |
| 114 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 115 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 116 | { |
| 117 | /* the modalias must be the same as spi device driver name */ |
| 118 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 119 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 120 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 121 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
| 122 | .platform_data = &bfin_spi_flash_data, |
| 123 | .controller_data = &spi_flash_chip_info, |
| 124 | .mode = SPI_MODE_3, |
| 125 | }, |
| 126 | #endif |
| 127 | |
| 128 | #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) |
| 129 | { |
| 130 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 131 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 132 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 133 | .chip_select = 1, /* Framework chip select. */ |
| 134 | .platform_data = NULL, /* No spi_driver specific config */ |
| 135 | .controller_data = &spi_adc_chip_info, |
| 136 | }, |
| 137 | #endif |
| 138 | |
| 139 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 140 | { |
| 141 | .modalias = "ad1836-spi", |
| 142 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 143 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 144 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 145 | .controller_data = &ad1836_spi_chip_info, |
| 146 | }, |
| 147 | #endif |
| 148 | |
| 149 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 150 | { |
| 151 | .modalias = "ad9960-spi", |
| 152 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 153 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 154 | .chip_select = 1, |
| 155 | .controller_data = &ad9960_spi_chip_info, |
| 156 | }, |
| 157 | #endif |
| 158 | |
| 159 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) |
| 160 | { |
| 161 | .modalias = "spi_mmc_dummy", |
| 162 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 163 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 164 | .chip_select = 7, |
| 165 | .platform_data = NULL, |
| 166 | .controller_data = &spi_mmc_chip_info, |
| 167 | .mode = SPI_MODE_3, |
| 168 | }, |
| 169 | { |
| 170 | .modalias = "spi_mmc", |
| 171 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 172 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 173 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, |
| 174 | .platform_data = NULL, |
| 175 | .controller_data = &spi_mmc_chip_info, |
| 176 | .mode = SPI_MODE_3, |
| 177 | }, |
| 178 | #endif |
| 179 | }; |
| 180 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 181 | /* SPI (0) */ |
| 182 | static struct resource bfin_spi0_resource[] = { |
| 183 | [0] = { |
| 184 | .start = SPI0_REGBASE, |
| 185 | .end = SPI0_REGBASE + 0xFF, |
| 186 | .flags = IORESOURCE_MEM, |
| 187 | }, |
| 188 | [1] = { |
| 189 | .start = CH_SPI, |
| 190 | .end = CH_SPI, |
| 191 | .flags = IORESOURCE_IRQ, |
| 192 | } |
| 193 | }; |
| 194 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 195 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 196 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 197 | .num_chipselect = 8, |
| 198 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 199 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 200 | }; |
| 201 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 202 | static struct platform_device bfin_spi0_device = { |
| 203 | .name = "bfin-spi", |
| 204 | .id = 0, /* Bus number */ |
| 205 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 206 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 207 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 208 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 209 | }, |
| 210 | }; |
| 211 | #endif /* spi master and devices */ |
| 212 | |
| 213 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 214 | static struct platform_device rtc_device = { |
| 215 | .name = "rtc-bfin", |
| 216 | .id = -1, |
| 217 | }; |
| 218 | #endif |
| 219 | |
Michael Hennerich | 0d4a89b | 2008-01-27 19:58:46 +0800 | [diff] [blame] | 220 | #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) |
| 221 | static struct platform_device hitachi_fb_device = { |
| 222 | .name = "hitachi-tx09", |
| 223 | }; |
| 224 | #endif |
| 225 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 226 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 227 | static struct resource smc91x_resources[] = { |
| 228 | { |
| 229 | .start = 0x20200300, |
| 230 | .end = 0x20200300 + 16, |
| 231 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 232 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 233 | .start = IRQ_PF14, |
| 234 | .end = IRQ_PF14, |
| 235 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 236 | }, |
| 237 | }; |
| 238 | |
| 239 | static struct platform_device smc91x_device = { |
| 240 | .name = "smc91x", |
| 241 | .id = 0, |
| 242 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 243 | .resource = smc91x_resources, |
| 244 | }; |
| 245 | #endif |
| 246 | |
| 247 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 248 | static struct resource isp1362_hcd_resources[] = { |
| 249 | { |
| 250 | .start = 0x20308000, |
| 251 | .end = 0x20308000, |
| 252 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 253 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 254 | .start = 0x20308004, |
| 255 | .end = 0x20308004, |
| 256 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 257 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 258 | .start = IRQ_PG15, |
| 259 | .end = IRQ_PG15, |
| 260 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 261 | }, |
| 262 | }; |
| 263 | |
| 264 | static struct isp1362_platform_data isp1362_priv = { |
| 265 | .sel15Kres = 1, |
| 266 | .clknotstop = 0, |
| 267 | .oc_enable = 0, |
| 268 | .int_act_high = 0, |
| 269 | .int_edge_triggered = 0, |
| 270 | .remote_wakeup_connected = 0, |
| 271 | .no_power_switching = 1, |
| 272 | .power_switching_mode = 0, |
| 273 | }; |
| 274 | |
| 275 | static struct platform_device isp1362_hcd_device = { |
| 276 | .name = "isp1362-hcd", |
| 277 | .id = 0, |
| 278 | .dev = { |
| 279 | .platform_data = &isp1362_priv, |
| 280 | }, |
| 281 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), |
| 282 | .resource = isp1362_hcd_resources, |
| 283 | }; |
| 284 | #endif |
| 285 | |
| 286 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 287 | static struct resource net2272_bfin_resources[] = { |
| 288 | { |
| 289 | .start = 0x20200000, |
| 290 | .end = 0x20200000 + 0x100, |
| 291 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 292 | }, { |
Michael Hennerich | 8ecc736 | 2007-10-29 17:24:23 +0800 | [diff] [blame] | 293 | .start = IRQ_PH14, |
| 294 | .end = IRQ_PH14, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 295 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 296 | }, |
| 297 | }; |
| 298 | |
| 299 | static struct platform_device net2272_bfin_device = { |
| 300 | .name = "net2272", |
| 301 | .id = -1, |
| 302 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 303 | .resource = net2272_bfin_resources, |
| 304 | }; |
| 305 | #endif |
| 306 | |
| 307 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 308 | static struct resource bfin_uart_resources[] = { |
| 309 | { |
| 310 | .start = 0xFFC00400, |
| 311 | .end = 0xFFC004FF, |
| 312 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 313 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 314 | .start = 0xFFC02000, |
| 315 | .end = 0xFFC020FF, |
| 316 | .flags = IORESOURCE_MEM, |
| 317 | }, |
| 318 | }; |
| 319 | |
| 320 | static struct platform_device bfin_uart_device = { |
| 321 | .name = "bfin-uart", |
| 322 | .id = 1, |
| 323 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 324 | .resource = bfin_uart_resources, |
| 325 | }; |
| 326 | #endif |
| 327 | |
Mike Frysinger | 56ce835 | 2008-03-26 06:00:18 +0800 | [diff] [blame] | 328 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 329 | static struct resource bfin_twi0_resource[] = { |
| 330 | [0] = { |
| 331 | .start = TWI0_REGBASE, |
| 332 | .end = TWI0_REGBASE, |
| 333 | .flags = IORESOURCE_MEM, |
| 334 | }, |
| 335 | [1] = { |
| 336 | .start = IRQ_TWI, |
| 337 | .end = IRQ_TWI, |
| 338 | .flags = IORESOURCE_IRQ, |
| 339 | }, |
| 340 | }; |
| 341 | |
| 342 | static struct platform_device i2c_bfin_twi_device = { |
| 343 | .name = "i2c-bfin-twi", |
| 344 | .id = 0, |
| 345 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 346 | .resource = bfin_twi0_resource, |
| 347 | }; |
| 348 | #endif |
| 349 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 350 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 351 | static struct platform_device bfin_sport0_uart_device = { |
| 352 | .name = "bfin-sport-uart", |
| 353 | .id = 0, |
| 354 | }; |
| 355 | |
| 356 | static struct platform_device bfin_sport1_uart_device = { |
| 357 | .name = "bfin-sport-uart", |
| 358 | .id = 1, |
| 359 | }; |
| 360 | #endif |
| 361 | |
| 362 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
| 363 | static struct platform_device bfin_mac_device = { |
| 364 | .name = "bfin_mac", |
| 365 | }; |
| 366 | #endif |
| 367 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 368 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 369 | #define PATA_INT 64 |
| 370 | |
| 371 | static struct pata_platform_info bfin_pata_platform_data = { |
| 372 | .ioport_shift = 2, |
| 373 | .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED, |
| 374 | }; |
| 375 | |
| 376 | static struct resource bfin_pata_resources[] = { |
| 377 | { |
| 378 | .start = 0x2030C000, |
| 379 | .end = 0x2030C01F, |
| 380 | .flags = IORESOURCE_MEM, |
| 381 | }, |
| 382 | { |
| 383 | .start = 0x2030D018, |
| 384 | .end = 0x2030D01B, |
| 385 | .flags = IORESOURCE_MEM, |
| 386 | }, |
| 387 | { |
| 388 | .start = PATA_INT, |
| 389 | .end = PATA_INT, |
| 390 | .flags = IORESOURCE_IRQ, |
| 391 | }, |
| 392 | }; |
| 393 | |
| 394 | static struct platform_device bfin_pata_device = { |
| 395 | .name = "pata_platform", |
| 396 | .id = -1, |
| 397 | .num_resources = ARRAY_SIZE(bfin_pata_resources), |
| 398 | .resource = bfin_pata_resources, |
| 399 | .dev = { |
| 400 | .platform_data = &bfin_pata_platform_data, |
| 401 | } |
| 402 | }; |
| 403 | #endif |
| 404 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 405 | static struct platform_device *cm_bf537_devices[] __initdata = { |
Michael Hennerich | 0d4a89b | 2008-01-27 19:58:46 +0800 | [diff] [blame] | 406 | #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) |
| 407 | &hitachi_fb_device, |
| 408 | #endif |
| 409 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 410 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 411 | &rtc_device, |
| 412 | #endif |
| 413 | |
| 414 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 415 | &bfin_uart_device, |
| 416 | #endif |
| 417 | |
Mike Frysinger | 56ce835 | 2008-03-26 06:00:18 +0800 | [diff] [blame] | 418 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 419 | &i2c_bfin_twi_device, |
| 420 | #endif |
| 421 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 422 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 423 | &bfin_sport0_uart_device, |
| 424 | &bfin_sport1_uart_device, |
| 425 | #endif |
| 426 | |
| 427 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 428 | &isp1362_hcd_device, |
| 429 | #endif |
| 430 | |
| 431 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 432 | &smc91x_device, |
| 433 | #endif |
| 434 | |
| 435 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
| 436 | &bfin_mac_device, |
| 437 | #endif |
| 438 | |
| 439 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 440 | &net2272_bfin_device, |
| 441 | #endif |
| 442 | |
| 443 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 444 | &bfin_spi0_device, |
| 445 | #endif |
| 446 | |
| 447 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 448 | &bfin_pata_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 449 | #endif |
| 450 | }; |
| 451 | |
| 452 | static int __init cm_bf537_init(void) |
| 453 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame^] | 454 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 455 | platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices)); |
| 456 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 457 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
| 458 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 459 | |
| 460 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 461 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; |
| 462 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 463 | return 0; |
| 464 | } |
| 465 | |
| 466 | arch_initcall(cm_bf537_init); |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 467 | |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 468 | void bfin_get_ether_addr(char *addr) |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 469 | { |
| 470 | random_ether_addr(addr); |
| 471 | printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__); |
| 472 | } |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 473 | EXPORT_SYMBOL(bfin_get_ether_addr); |