Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 2 | * Copyright 2004-2009 Analog Devices Inc. |
| 3 | * 2008-2009 Bluetechnix |
| 4 | * 2005 National ICT Australia (NICTA) |
| 5 | * Aidan Williams <aidan@nicta.com.au> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 6 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 7 | * Licensed under the GPL-2 or later. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <linux/device.h> |
Mike Frysinger | 43f73fe | 2007-12-24 19:35:35 +0800 | [diff] [blame] | 11 | #include <linux/etherdevice.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 12 | #include <linux/platform_device.h> |
| 13 | #include <linux/mtd/mtd.h> |
| 14 | #include <linux/mtd/partitions.h> |
Mike Frysinger | 8ea8949 | 2008-08-05 18:14:44 +0800 | [diff] [blame] | 15 | #include <linux/mtd/physmap.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 16 | #include <linux/spi/spi.h> |
| 17 | #include <linux/spi/flash.h> |
Mike Frysinger | b964c59 | 2008-05-10 00:06:10 +0800 | [diff] [blame] | 18 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
Mike Frysinger | f02bcec | 2007-11-15 21:29:15 +0800 | [diff] [blame] | 19 | #include <linux/usb/isp1362.h> |
Mike Frysinger | b964c59 | 2008-05-10 00:06:10 +0800 | [diff] [blame] | 20 | #endif |
Jeff Garzik | 0a87e3e | 2008-02-01 18:02:30 -0500 | [diff] [blame] | 21 | #include <linux/ata_platform.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 22 | #include <linux/irq.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 23 | #include <asm/dma.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 24 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 25 | #include <asm/portmux.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 26 | #include <asm/dpmc.h> |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 27 | #include <linux/spi/mmc_spi.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 28 | |
| 29 | /* |
| 30 | * Name the Board for the /proc/cpuinfo |
| 31 | */ |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 32 | const char bfin_board_name[] = "Bluetechnix CM BF537U"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 33 | |
| 34 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 35 | /* all SPI peripherals info goes here */ |
| 36 | |
| 37 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 38 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 39 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 40 | .name = "bootloader(spi)", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 41 | .size = 0x00020000, |
| 42 | .offset = 0, |
| 43 | .mask_flags = MTD_CAP_ROM |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 44 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 45 | .name = "linux kernel(spi)", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 46 | .size = 0xe0000, |
| 47 | .offset = 0x20000 |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 48 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 49 | .name = "file system(spi)", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 50 | .size = 0x700000, |
| 51 | .offset = 0x00100000, |
| 52 | } |
| 53 | }; |
| 54 | |
| 55 | static struct flash_platform_data bfin_spi_flash_data = { |
| 56 | .name = "m25p80", |
| 57 | .parts = bfin_spi_flash_partitions, |
| 58 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
| 59 | .type = "m25p64", |
| 60 | }; |
| 61 | |
| 62 | /* SPI flash chip (m25p64) */ |
| 63 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 64 | .enable_dma = 0, /* use dma transfer with this chip*/ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 65 | }; |
| 66 | #endif |
| 67 | |
Michael Hennerich | f3f704d | 2009-03-06 00:27:57 +0800 | [diff] [blame] | 68 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 69 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
| 70 | .enable_dma = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 71 | }; |
| 72 | #endif |
| 73 | |
| 74 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 75 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 76 | { |
| 77 | /* the modalias must be the same as spi device driver name */ |
| 78 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 79 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 80 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 81 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
| 82 | .platform_data = &bfin_spi_flash_data, |
| 83 | .controller_data = &spi_flash_chip_info, |
| 84 | .mode = SPI_MODE_3, |
| 85 | }, |
| 86 | #endif |
| 87 | |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 88 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 89 | { |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 90 | .modalias = "ad183x", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 91 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 92 | .bus_num = 0, |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 93 | .chip_select = 4, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 94 | }, |
| 95 | #endif |
| 96 | |
Michael Hennerich | f3f704d | 2009-03-06 00:27:57 +0800 | [diff] [blame] | 97 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 98 | { |
Michael Hennerich | f3f704d | 2009-03-06 00:27:57 +0800 | [diff] [blame] | 99 | .modalias = "mmc_spi", |
| 100 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 101 | .bus_num = 0, |
Michael Hennerich | f3f704d | 2009-03-06 00:27:57 +0800 | [diff] [blame] | 102 | .chip_select = 1, |
| 103 | .controller_data = &mmc_spi_chip_info, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 104 | .mode = SPI_MODE_3, |
| 105 | }, |
| 106 | #endif |
| 107 | }; |
| 108 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 109 | /* SPI (0) */ |
| 110 | static struct resource bfin_spi0_resource[] = { |
| 111 | [0] = { |
| 112 | .start = SPI0_REGBASE, |
| 113 | .end = SPI0_REGBASE + 0xFF, |
| 114 | .flags = IORESOURCE_MEM, |
| 115 | }, |
| 116 | [1] = { |
| 117 | .start = CH_SPI, |
| 118 | .end = CH_SPI, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 119 | .flags = IORESOURCE_DMA, |
| 120 | }, |
| 121 | [2] = { |
| 122 | .start = IRQ_SPI, |
| 123 | .end = IRQ_SPI, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 124 | .flags = IORESOURCE_IRQ, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 125 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 126 | }; |
| 127 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 128 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 129 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 130 | .num_chipselect = 8, |
| 131 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 132 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 133 | }; |
| 134 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 135 | static struct platform_device bfin_spi0_device = { |
| 136 | .name = "bfin-spi", |
| 137 | .id = 0, /* Bus number */ |
| 138 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 139 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 140 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 141 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 142 | }, |
| 143 | }; |
| 144 | #endif /* spi master and devices */ |
| 145 | |
| 146 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 147 | static struct platform_device rtc_device = { |
| 148 | .name = "rtc-bfin", |
| 149 | .id = -1, |
| 150 | }; |
| 151 | #endif |
| 152 | |
Michael Hennerich | 0d4a89b | 2008-01-27 19:58:46 +0800 | [diff] [blame] | 153 | #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) |
| 154 | static struct platform_device hitachi_fb_device = { |
| 155 | .name = "hitachi-tx09", |
| 156 | }; |
| 157 | #endif |
| 158 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 159 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 160 | #include <linux/smc91x.h> |
| 161 | |
| 162 | static struct smc91x_platdata smc91x_info = { |
| 163 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 164 | .leda = RPC_LED_100_10, |
| 165 | .ledb = RPC_LED_TX_RX, |
| 166 | }; |
| 167 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 168 | static struct resource smc91x_resources[] = { |
| 169 | { |
| 170 | .start = 0x20200300, |
| 171 | .end = 0x20200300 + 16, |
| 172 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 173 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 174 | .start = IRQ_PF14, |
| 175 | .end = IRQ_PF14, |
| 176 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 177 | }, |
| 178 | }; |
| 179 | |
| 180 | static struct platform_device smc91x_device = { |
| 181 | .name = "smc91x", |
| 182 | .id = 0, |
| 183 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 184 | .resource = smc91x_resources, |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 185 | .dev = { |
| 186 | .platform_data = &smc91x_info, |
| 187 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 188 | }; |
| 189 | #endif |
| 190 | |
| 191 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 192 | static struct resource isp1362_hcd_resources[] = { |
| 193 | { |
| 194 | .start = 0x20308000, |
| 195 | .end = 0x20308000, |
| 196 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 197 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 198 | .start = 0x20308004, |
| 199 | .end = 0x20308004, |
| 200 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 201 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 202 | .start = IRQ_PG15, |
| 203 | .end = IRQ_PG15, |
Michael Hennerich | 9e75894 | 2010-03-18 12:51:49 +0000 | [diff] [blame] | 204 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 205 | }, |
| 206 | }; |
| 207 | |
| 208 | static struct isp1362_platform_data isp1362_priv = { |
| 209 | .sel15Kres = 1, |
| 210 | .clknotstop = 0, |
| 211 | .oc_enable = 0, |
| 212 | .int_act_high = 0, |
| 213 | .int_edge_triggered = 0, |
| 214 | .remote_wakeup_connected = 0, |
| 215 | .no_power_switching = 1, |
| 216 | .power_switching_mode = 0, |
| 217 | }; |
| 218 | |
| 219 | static struct platform_device isp1362_hcd_device = { |
| 220 | .name = "isp1362-hcd", |
| 221 | .id = 0, |
| 222 | .dev = { |
| 223 | .platform_data = &isp1362_priv, |
| 224 | }, |
| 225 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), |
| 226 | .resource = isp1362_hcd_resources, |
| 227 | }; |
| 228 | #endif |
| 229 | |
| 230 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 231 | static struct resource net2272_bfin_resources[] = { |
| 232 | { |
| 233 | .start = 0x20200000, |
| 234 | .end = 0x20200000 + 0x100, |
| 235 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 236 | }, { |
Michael Hennerich | 8ecc736 | 2007-10-29 17:24:23 +0800 | [diff] [blame] | 237 | .start = IRQ_PH14, |
| 238 | .end = IRQ_PH14, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 239 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 240 | }, |
| 241 | }; |
| 242 | |
| 243 | static struct platform_device net2272_bfin_device = { |
| 244 | .name = "net2272", |
| 245 | .id = -1, |
| 246 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 247 | .resource = net2272_bfin_resources, |
| 248 | }; |
| 249 | #endif |
| 250 | |
Mike Frysinger | 8ea8949 | 2008-08-05 18:14:44 +0800 | [diff] [blame] | 251 | #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) |
| 252 | static struct mtd_partition cm_partitions[] = { |
| 253 | { |
| 254 | .name = "bootloader(nor)", |
| 255 | .size = 0x40000, |
| 256 | .offset = 0, |
| 257 | }, { |
| 258 | .name = "linux kernel(nor)", |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 259 | .size = 0x100000, |
Mike Frysinger | 8ea8949 | 2008-08-05 18:14:44 +0800 | [diff] [blame] | 260 | .offset = MTDPART_OFS_APPEND, |
| 261 | }, { |
| 262 | .name = "file system(nor)", |
| 263 | .size = MTDPART_SIZ_FULL, |
| 264 | .offset = MTDPART_OFS_APPEND, |
| 265 | } |
| 266 | }; |
| 267 | |
| 268 | static struct physmap_flash_data cm_flash_data = { |
| 269 | .width = 2, |
| 270 | .parts = cm_partitions, |
| 271 | .nr_parts = ARRAY_SIZE(cm_partitions), |
| 272 | }; |
| 273 | |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 274 | static unsigned cm_flash_gpios[] = { GPIO_PH0 }; |
Mike Frysinger | 8ea8949 | 2008-08-05 18:14:44 +0800 | [diff] [blame] | 275 | |
| 276 | static struct resource cm_flash_resource[] = { |
| 277 | { |
| 278 | .name = "cfi_probe", |
| 279 | .start = 0x20000000, |
| 280 | .end = 0x201fffff, |
| 281 | .flags = IORESOURCE_MEM, |
| 282 | }, { |
| 283 | .start = (unsigned long)cm_flash_gpios, |
| 284 | .end = ARRAY_SIZE(cm_flash_gpios), |
| 285 | .flags = IORESOURCE_IRQ, |
| 286 | } |
| 287 | }; |
| 288 | |
| 289 | static struct platform_device cm_flash_device = { |
| 290 | .name = "gpio-addr-flash", |
| 291 | .id = 0, |
| 292 | .dev = { |
| 293 | .platform_data = &cm_flash_data, |
| 294 | }, |
| 295 | .num_resources = ARRAY_SIZE(cm_flash_resource), |
| 296 | .resource = cm_flash_resource, |
| 297 | }; |
| 298 | #endif |
| 299 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 300 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 301 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 302 | static struct resource bfin_uart0_resources[] = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 303 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 304 | .start = UART0_THR, |
| 305 | .end = UART0_GCTL+2, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 306 | .flags = IORESOURCE_MEM, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 307 | }, |
| 308 | { |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame^] | 309 | .start = IRQ_UART0_TX, |
| 310 | .end = IRQ_UART0_TX, |
| 311 | .flags = IORESOURCE_IRQ, |
| 312 | }, |
| 313 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 314 | .start = IRQ_UART0_RX, |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame^] | 315 | .end = IRQ_UART0_RX, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 316 | .flags = IORESOURCE_IRQ, |
| 317 | }, |
| 318 | { |
| 319 | .start = IRQ_UART0_ERROR, |
| 320 | .end = IRQ_UART0_ERROR, |
| 321 | .flags = IORESOURCE_IRQ, |
| 322 | }, |
| 323 | { |
| 324 | .start = CH_UART0_TX, |
| 325 | .end = CH_UART0_TX, |
| 326 | .flags = IORESOURCE_DMA, |
| 327 | }, |
| 328 | { |
| 329 | .start = CH_UART0_RX, |
| 330 | .end = CH_UART0_RX, |
| 331 | .flags = IORESOURCE_DMA, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 332 | }, |
| 333 | }; |
| 334 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 335 | static unsigned short bfin_uart0_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 336 | P_UART0_TX, P_UART0_RX, 0 |
| 337 | }; |
| 338 | |
| 339 | static struct platform_device bfin_uart0_device = { |
| 340 | .name = "bfin-uart", |
| 341 | .id = 0, |
| 342 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
| 343 | .resource = bfin_uart0_resources, |
| 344 | .dev = { |
| 345 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ |
| 346 | }, |
| 347 | }; |
| 348 | #endif |
| 349 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 350 | static struct resource bfin_uart1_resources[] = { |
| 351 | { |
| 352 | .start = UART1_THR, |
| 353 | .end = UART1_GCTL+2, |
| 354 | .flags = IORESOURCE_MEM, |
| 355 | }, |
| 356 | { |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame^] | 357 | .start = IRQ_UART1_TX, |
| 358 | .end = IRQ_UART1_TX, |
| 359 | .flags = IORESOURCE_IRQ, |
| 360 | }, |
| 361 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 362 | .start = IRQ_UART1_RX, |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame^] | 363 | .end = IRQ_UART1_RX, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 364 | .flags = IORESOURCE_IRQ, |
| 365 | }, |
| 366 | { |
| 367 | .start = IRQ_UART1_ERROR, |
| 368 | .end = IRQ_UART1_ERROR, |
| 369 | .flags = IORESOURCE_IRQ, |
| 370 | }, |
| 371 | { |
| 372 | .start = CH_UART1_TX, |
| 373 | .end = CH_UART1_TX, |
| 374 | .flags = IORESOURCE_DMA, |
| 375 | }, |
| 376 | { |
| 377 | .start = CH_UART1_RX, |
| 378 | .end = CH_UART1_RX, |
| 379 | .flags = IORESOURCE_DMA, |
| 380 | }, |
| 381 | }; |
| 382 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 383 | static unsigned short bfin_uart1_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 384 | P_UART1_TX, P_UART1_RX, 0 |
| 385 | }; |
| 386 | |
| 387 | static struct platform_device bfin_uart1_device = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 388 | .name = "bfin-uart", |
| 389 | .id = 1, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 390 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
| 391 | .resource = bfin_uart1_resources, |
| 392 | .dev = { |
| 393 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ |
| 394 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 395 | }; |
| 396 | #endif |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 397 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 398 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 399 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 400 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 401 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 402 | { |
| 403 | .start = 0xFFC00400, |
| 404 | .end = 0xFFC004FF, |
| 405 | .flags = IORESOURCE_MEM, |
| 406 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 407 | { |
| 408 | .start = IRQ_UART0_RX, |
| 409 | .end = IRQ_UART0_RX+1, |
| 410 | .flags = IORESOURCE_IRQ, |
| 411 | }, |
| 412 | { |
| 413 | .start = CH_UART0_RX, |
| 414 | .end = CH_UART0_RX+1, |
| 415 | .flags = IORESOURCE_DMA, |
| 416 | }, |
| 417 | }; |
| 418 | static struct platform_device bfin_sir0_device = { |
| 419 | .name = "bfin_sir", |
| 420 | .id = 0, |
| 421 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 422 | .resource = bfin_sir0_resources, |
| 423 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 424 | #endif |
| 425 | #ifdef CONFIG_BFIN_SIR1 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 426 | static struct resource bfin_sir1_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 427 | { |
| 428 | .start = 0xFFC02000, |
| 429 | .end = 0xFFC020FF, |
| 430 | .flags = IORESOURCE_MEM, |
| 431 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 432 | { |
| 433 | .start = IRQ_UART1_RX, |
| 434 | .end = IRQ_UART1_RX+1, |
| 435 | .flags = IORESOURCE_IRQ, |
| 436 | }, |
| 437 | { |
| 438 | .start = CH_UART1_RX, |
| 439 | .end = CH_UART1_RX+1, |
| 440 | .flags = IORESOURCE_DMA, |
| 441 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 442 | }; |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 443 | static struct platform_device bfin_sir1_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 444 | .name = "bfin_sir", |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 445 | .id = 1, |
| 446 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), |
| 447 | .resource = bfin_sir1_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 448 | }; |
| 449 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 450 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 451 | |
Mike Frysinger | 56ce835 | 2008-03-26 06:00:18 +0800 | [diff] [blame] | 452 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 453 | static struct resource bfin_twi0_resource[] = { |
| 454 | [0] = { |
| 455 | .start = TWI0_REGBASE, |
| 456 | .end = TWI0_REGBASE, |
| 457 | .flags = IORESOURCE_MEM, |
| 458 | }, |
| 459 | [1] = { |
| 460 | .start = IRQ_TWI, |
| 461 | .end = IRQ_TWI, |
| 462 | .flags = IORESOURCE_IRQ, |
| 463 | }, |
| 464 | }; |
| 465 | |
| 466 | static struct platform_device i2c_bfin_twi_device = { |
| 467 | .name = "i2c-bfin-twi", |
| 468 | .id = 0, |
| 469 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 470 | .resource = bfin_twi0_resource, |
| 471 | }; |
| 472 | #endif |
| 473 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 474 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 475 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 476 | static struct resource bfin_sport0_uart_resources[] = { |
| 477 | { |
| 478 | .start = SPORT0_TCR1, |
| 479 | .end = SPORT0_MRCS3+4, |
| 480 | .flags = IORESOURCE_MEM, |
| 481 | }, |
| 482 | { |
| 483 | .start = IRQ_SPORT0_RX, |
| 484 | .end = IRQ_SPORT0_RX+1, |
| 485 | .flags = IORESOURCE_IRQ, |
| 486 | }, |
| 487 | { |
| 488 | .start = IRQ_SPORT0_ERROR, |
| 489 | .end = IRQ_SPORT0_ERROR, |
| 490 | .flags = IORESOURCE_IRQ, |
| 491 | }, |
| 492 | }; |
| 493 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 494 | static unsigned short bfin_sport0_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 495 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, |
Sonic Zhang | e54b673 | 2010-11-12 02:45:38 +0000 | [diff] [blame] | 496 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0 |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 497 | }; |
| 498 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 499 | static struct platform_device bfin_sport0_uart_device = { |
| 500 | .name = "bfin-sport-uart", |
| 501 | .id = 0, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 502 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), |
| 503 | .resource = bfin_sport0_uart_resources, |
| 504 | .dev = { |
| 505 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ |
| 506 | }, |
| 507 | }; |
| 508 | #endif |
| 509 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 510 | static struct resource bfin_sport1_uart_resources[] = { |
| 511 | { |
| 512 | .start = SPORT1_TCR1, |
| 513 | .end = SPORT1_MRCS3+4, |
| 514 | .flags = IORESOURCE_MEM, |
| 515 | }, |
| 516 | { |
| 517 | .start = IRQ_SPORT1_RX, |
| 518 | .end = IRQ_SPORT1_RX+1, |
| 519 | .flags = IORESOURCE_IRQ, |
| 520 | }, |
| 521 | { |
| 522 | .start = IRQ_SPORT1_ERROR, |
| 523 | .end = IRQ_SPORT1_ERROR, |
| 524 | .flags = IORESOURCE_IRQ, |
| 525 | }, |
| 526 | }; |
| 527 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 528 | static unsigned short bfin_sport1_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 529 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, |
Sonic Zhang | e54b673 | 2010-11-12 02:45:38 +0000 | [diff] [blame] | 530 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 531 | }; |
| 532 | |
| 533 | static struct platform_device bfin_sport1_uart_device = { |
| 534 | .name = "bfin-sport-uart", |
| 535 | .id = 1, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 536 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), |
| 537 | .resource = bfin_sport1_uart_resources, |
| 538 | .dev = { |
| 539 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ |
| 540 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 541 | }; |
| 542 | #endif |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 543 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 544 | |
| 545 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Sonic Zhang | 02460d0 | 2010-06-11 10:44:22 +0000 | [diff] [blame] | 546 | #include <linux/bfin_mac.h> |
Paul Gortmaker | 8dc7a9c | 2011-08-09 11:05:22 -0400 | [diff] [blame] | 547 | #include <linux/export.h> |
Sonic Zhang | 02460d0 | 2010-06-11 10:44:22 +0000 | [diff] [blame] | 548 | static const unsigned short bfin_mac_peripherals[] = P_MII0; |
| 549 | |
| 550 | static struct bfin_phydev_platform_data bfin_phydev_data[] = { |
| 551 | { |
| 552 | .addr = 1, |
| 553 | .irq = IRQ_MAC_PHYINT, |
| 554 | }, |
| 555 | }; |
| 556 | |
| 557 | static struct bfin_mii_bus_platform_data bfin_mii_bus_data = { |
| 558 | .phydev_number = 1, |
| 559 | .phydev_data = bfin_phydev_data, |
| 560 | .phy_mode = PHY_INTERFACE_MODE_MII, |
| 561 | .mac_peripherals = bfin_mac_peripherals, |
| 562 | }; |
| 563 | |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 564 | static struct platform_device bfin_mii_bus = { |
| 565 | .name = "bfin_mii_bus", |
Sonic Zhang | 02460d0 | 2010-06-11 10:44:22 +0000 | [diff] [blame] | 566 | .dev = { |
| 567 | .platform_data = &bfin_mii_bus_data, |
| 568 | } |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 569 | }; |
| 570 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 571 | static struct platform_device bfin_mac_device = { |
| 572 | .name = "bfin_mac", |
Sonic Zhang | 02460d0 | 2010-06-11 10:44:22 +0000 | [diff] [blame] | 573 | .dev = { |
| 574 | .platform_data = &bfin_mii_bus, |
| 575 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 576 | }; |
| 577 | #endif |
| 578 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 579 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
Mike Frysinger | fe5aeb9 | 2008-08-05 18:29:56 +0800 | [diff] [blame] | 580 | #define PATA_INT IRQ_PF14 |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 581 | |
| 582 | static struct pata_platform_info bfin_pata_platform_data = { |
| 583 | .ioport_shift = 2, |
Yong Zhang | 7832bb5 | 2011-09-07 16:10:03 +0800 | [diff] [blame] | 584 | .irq_type = IRQF_TRIGGER_HIGH, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 585 | }; |
| 586 | |
| 587 | static struct resource bfin_pata_resources[] = { |
| 588 | { |
| 589 | .start = 0x2030C000, |
| 590 | .end = 0x2030C01F, |
| 591 | .flags = IORESOURCE_MEM, |
| 592 | }, |
| 593 | { |
| 594 | .start = 0x2030D018, |
| 595 | .end = 0x2030D01B, |
| 596 | .flags = IORESOURCE_MEM, |
| 597 | }, |
| 598 | { |
| 599 | .start = PATA_INT, |
| 600 | .end = PATA_INT, |
| 601 | .flags = IORESOURCE_IRQ, |
| 602 | }, |
| 603 | }; |
| 604 | |
| 605 | static struct platform_device bfin_pata_device = { |
| 606 | .name = "pata_platform", |
| 607 | .id = -1, |
| 608 | .num_resources = ARRAY_SIZE(bfin_pata_resources), |
| 609 | .resource = bfin_pata_resources, |
| 610 | .dev = { |
| 611 | .platform_data = &bfin_pata_platform_data, |
| 612 | } |
| 613 | }; |
| 614 | #endif |
| 615 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 616 | static const unsigned int cclk_vlev_datasheet[] = |
| 617 | { |
| 618 | VRPAIR(VLEV_085, 250000000), |
| 619 | VRPAIR(VLEV_090, 376000000), |
| 620 | VRPAIR(VLEV_095, 426000000), |
| 621 | VRPAIR(VLEV_100, 426000000), |
| 622 | VRPAIR(VLEV_105, 476000000), |
| 623 | VRPAIR(VLEV_110, 476000000), |
| 624 | VRPAIR(VLEV_115, 476000000), |
| 625 | VRPAIR(VLEV_120, 500000000), |
| 626 | VRPAIR(VLEV_125, 533000000), |
| 627 | VRPAIR(VLEV_130, 600000000), |
| 628 | }; |
| 629 | |
| 630 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 631 | .tuple_tab = cclk_vlev_datasheet, |
| 632 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 633 | .vr_settling_time = 25 /* us */, |
| 634 | }; |
| 635 | |
| 636 | static struct platform_device bfin_dpmc = { |
| 637 | .name = "bfin dpmc", |
| 638 | .dev = { |
| 639 | .platform_data = &bfin_dmpc_vreg_data, |
| 640 | }, |
| 641 | }; |
| 642 | |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 643 | static struct platform_device *cm_bf537u_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 644 | |
| 645 | &bfin_dpmc, |
| 646 | |
Michael Hennerich | 0d4a89b | 2008-01-27 19:58:46 +0800 | [diff] [blame] | 647 | #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) |
| 648 | &hitachi_fb_device, |
| 649 | #endif |
| 650 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 651 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 652 | &rtc_device, |
| 653 | #endif |
| 654 | |
| 655 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 656 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 657 | &bfin_uart0_device, |
| 658 | #endif |
| 659 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 660 | &bfin_uart1_device, |
| 661 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 662 | #endif |
| 663 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 664 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 665 | #ifdef CONFIG_BFIN_SIR0 |
| 666 | &bfin_sir0_device, |
| 667 | #endif |
| 668 | #ifdef CONFIG_BFIN_SIR1 |
| 669 | &bfin_sir1_device, |
| 670 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 671 | #endif |
| 672 | |
Mike Frysinger | 56ce835 | 2008-03-26 06:00:18 +0800 | [diff] [blame] | 673 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 674 | &i2c_bfin_twi_device, |
| 675 | #endif |
| 676 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 677 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 678 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 679 | &bfin_sport0_uart_device, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 680 | #endif |
| 681 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 682 | &bfin_sport1_uart_device, |
| 683 | #endif |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 684 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 685 | |
| 686 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 687 | &isp1362_hcd_device, |
| 688 | #endif |
| 689 | |
| 690 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 691 | &smc91x_device, |
| 692 | #endif |
| 693 | |
| 694 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 695 | &bfin_mii_bus, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 696 | &bfin_mac_device, |
| 697 | #endif |
| 698 | |
| 699 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 700 | &net2272_bfin_device, |
| 701 | #endif |
| 702 | |
| 703 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 704 | &bfin_spi0_device, |
| 705 | #endif |
| 706 | |
| 707 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 708 | &bfin_pata_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 709 | #endif |
Mike Frysinger | 8ea8949 | 2008-08-05 18:14:44 +0800 | [diff] [blame] | 710 | |
| 711 | #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) |
| 712 | &cm_flash_device, |
| 713 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 714 | }; |
| 715 | |
Mike Frysinger | 9be8631 | 2011-05-04 11:20:15 -0400 | [diff] [blame] | 716 | static int __init net2272_init(void) |
| 717 | { |
| 718 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 719 | int ret; |
| 720 | |
| 721 | ret = gpio_request(GPIO_PH15, driver_name); |
| 722 | if (ret) |
| 723 | return ret; |
| 724 | |
| 725 | ret = gpio_request(GPIO_PH13, "net2272"); |
| 726 | if (ret) { |
| 727 | gpio_free(GPIO_PH15); |
| 728 | return ret; |
| 729 | } |
| 730 | |
| 731 | /* Set PH15 Low make /AMS2 work properly */ |
| 732 | gpio_direction_output(GPIO_PH15, 0); |
| 733 | |
| 734 | /* enable CLKBUF output */ |
| 735 | bfin_write_VR_CTL(bfin_read_VR_CTL() | CLKBUFOE); |
| 736 | |
| 737 | /* Reset the USB chip */ |
| 738 | gpio_direction_output(GPIO_PH13, 0); |
| 739 | mdelay(2); |
| 740 | gpio_set_value(GPIO_PH13, 1); |
| 741 | #endif |
| 742 | |
| 743 | return 0; |
| 744 | } |
| 745 | |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 746 | static int __init cm_bf537u_init(void) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 747 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 748 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 749 | platform_add_devices(cm_bf537u_devices, ARRAY_SIZE(cm_bf537u_devices)); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 750 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 751 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
| 752 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 753 | |
| 754 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
Thomas Gleixner | bc2f6bd | 2011-02-06 18:23:38 +0000 | [diff] [blame] | 755 | irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 756 | #endif |
Mike Frysinger | 9be8631 | 2011-05-04 11:20:15 -0400 | [diff] [blame] | 757 | |
| 758 | if (net2272_init()) |
| 759 | pr_warning("unable to configure net2272; it probably won't work\n"); |
| 760 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 761 | return 0; |
| 762 | } |
| 763 | |
Harald Krapfenbauer | 6058434 | 2009-09-10 15:12:08 +0000 | [diff] [blame] | 764 | arch_initcall(cm_bf537u_init); |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 765 | |
Sonic Zhang | c13ce9f | 2009-09-23 09:37:46 +0000 | [diff] [blame] | 766 | static struct platform_device *cm_bf537u_early_devices[] __initdata = { |
| 767 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) |
| 768 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 769 | &bfin_uart0_device, |
| 770 | #endif |
| 771 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 772 | &bfin_uart1_device, |
| 773 | #endif |
| 774 | #endif |
| 775 | |
| 776 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) |
| 777 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 778 | &bfin_sport0_uart_device, |
| 779 | #endif |
| 780 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 781 | &bfin_sport1_uart_device, |
| 782 | #endif |
| 783 | #endif |
| 784 | }; |
| 785 | |
| 786 | void __init native_machine_early_platform_add_devices(void) |
| 787 | { |
| 788 | printk(KERN_INFO "register early platform devices\n"); |
| 789 | early_platform_add_devices(cm_bf537u_early_devices, |
| 790 | ARRAY_SIZE(cm_bf537u_early_devices)); |
| 791 | } |
| 792 | |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 793 | void bfin_get_ether_addr(char *addr) |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 794 | { |
| 795 | random_ether_addr(addr); |
| 796 | printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__); |
| 797 | } |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 798 | EXPORT_SYMBOL(bfin_get_ether_addr); |