Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf533/ezkit.c |
Simon Arlott | d2d50aa | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 3 | * Based on: Original Work |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 4 | * Author: Aidan Williams <aidan@nicta.com.au> |
| 5 | * |
| 6 | * Created: 2005 |
| 7 | * Description: |
| 8 | * |
| 9 | * Modified: Robin Getz <rgetz@blackfin.uclinux.org> - Named the boards |
| 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> |
| 32 | #include <linux/platform_device.h> |
| 33 | #include <linux/mtd/mtd.h> |
| 34 | #include <linux/mtd/partitions.h> |
Mike Frysinger | 4d5e6fd | 2009-06-13 06:34:49 -0400 | [diff] [blame] | 35 | #include <linux/mtd/plat-ram.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 36 | #include <linux/spi/spi.h> |
| 37 | #include <linux/spi/flash.h> |
Mike Frysinger | 67f2d33 | 2008-02-09 01:49:23 +0800 | [diff] [blame] | 38 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
Mike Frysinger | f02bcec | 2007-11-15 21:29:15 +0800 | [diff] [blame] | 39 | #include <linux/usb/isp1362.h> |
Mike Frysinger | 67f2d33 | 2008-02-09 01:49:23 +0800 | [diff] [blame] | 40 | #endif |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 41 | #include <linux/irq.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 42 | #include <asm/dma.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 43 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 44 | #include <asm/portmux.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 45 | #include <asm/dpmc.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 46 | |
| 47 | /* |
| 48 | * Name the Board for the /proc/cpuinfo |
| 49 | */ |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 50 | const char bfin_board_name[] = "ADI BF533-EZKIT"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 51 | |
| 52 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 53 | static struct platform_device rtc_device = { |
| 54 | .name = "rtc-bfin", |
| 55 | .id = -1, |
| 56 | }; |
| 57 | #endif |
| 58 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 59 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 60 | static struct platform_device bfin_fb_adv7393_device = { |
| 61 | .name = "bfin-adv7393", |
| 62 | }; |
| 63 | #endif |
| 64 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 65 | /* |
| 66 | * USB-LAN EzExtender board |
| 67 | * Driver needs to know address, irq and flag pin. |
| 68 | */ |
| 69 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 70 | #include <linux/smc91x.h> |
| 71 | |
| 72 | static struct smc91x_platdata smc91x_info = { |
| 73 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 74 | .leda = RPC_LED_100_10, |
| 75 | .ledb = RPC_LED_TX_RX, |
| 76 | }; |
| 77 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 78 | static struct resource smc91x_resources[] = { |
| 79 | { |
| 80 | .name = "smc91x-regs", |
| 81 | .start = 0x20310300, |
| 82 | .end = 0x20310300 + 16, |
| 83 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 84 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 85 | .start = IRQ_PF9, |
| 86 | .end = IRQ_PF9, |
| 87 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 88 | }, |
| 89 | }; |
| 90 | static struct platform_device smc91x_device = { |
| 91 | .name = "smc91x", |
| 92 | .id = 0, |
| 93 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 94 | .resource = smc91x_resources, |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 95 | .dev = { |
| 96 | .platform_data = &smc91x_info, |
| 97 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 98 | }; |
| 99 | #endif |
| 100 | |
Mike Frysinger | 4d5e6fd | 2009-06-13 06:34:49 -0400 | [diff] [blame] | 101 | #if defined(CONFIG_MTD_PSD4256G) || defined(CONFIG_MTD_PSD4256G_MODULE) |
| 102 | static const char *map_probes[] = { |
| 103 | "stm_flash", |
| 104 | NULL, |
| 105 | }; |
| 106 | |
| 107 | static struct platdata_mtd_ram stm_pri_data_a = { |
| 108 | .mapname = "Flash A Primary", |
| 109 | .map_probes = map_probes, |
| 110 | .bankwidth = 2, |
| 111 | }; |
| 112 | |
| 113 | static struct resource stm_pri_resource_a = { |
| 114 | .start = 0x20000000, |
| 115 | .end = 0x200fffff, |
| 116 | .flags = IORESOURCE_MEM, |
| 117 | }; |
| 118 | |
| 119 | static struct platform_device stm_pri_device_a = { |
| 120 | .name = "mtd-ram", |
| 121 | .id = 0, |
| 122 | .dev = { |
| 123 | .platform_data = &stm_pri_data_a, |
| 124 | }, |
| 125 | .num_resources = 1, |
| 126 | .resource = &stm_pri_resource_a, |
| 127 | }; |
| 128 | |
| 129 | static struct platdata_mtd_ram stm_pri_data_b = { |
| 130 | .mapname = "Flash B Primary", |
| 131 | .map_probes = map_probes, |
| 132 | .bankwidth = 2, |
| 133 | }; |
| 134 | |
| 135 | static struct resource stm_pri_resource_b = { |
| 136 | .start = 0x20100000, |
| 137 | .end = 0x201fffff, |
| 138 | .flags = IORESOURCE_MEM, |
| 139 | }; |
| 140 | |
| 141 | static struct platform_device stm_pri_device_b = { |
| 142 | .name = "mtd-ram", |
| 143 | .id = 4, |
| 144 | .dev = { |
| 145 | .platform_data = &stm_pri_data_b, |
| 146 | }, |
| 147 | .num_resources = 1, |
| 148 | .resource = &stm_pri_resource_b, |
| 149 | }; |
| 150 | #endif |
| 151 | |
| 152 | #if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) |
| 153 | static struct platdata_mtd_ram sram_data_a = { |
| 154 | .mapname = "Flash A SRAM", |
| 155 | .bankwidth = 2, |
| 156 | }; |
| 157 | |
| 158 | static struct resource sram_resource_a = { |
| 159 | .start = 0x20240000, |
| 160 | .end = 0x2024ffff, |
| 161 | .flags = IORESOURCE_MEM, |
| 162 | }; |
| 163 | |
| 164 | static struct platform_device sram_device_a = { |
| 165 | .name = "mtd-ram", |
| 166 | .id = 8, |
| 167 | .dev = { |
| 168 | .platform_data = &sram_data_a, |
| 169 | }, |
| 170 | .num_resources = 1, |
| 171 | .resource = &sram_resource_a, |
| 172 | }; |
| 173 | |
| 174 | static struct platdata_mtd_ram sram_data_b = { |
| 175 | .mapname = "Flash B SRAM", |
| 176 | .bankwidth = 2, |
| 177 | }; |
| 178 | |
| 179 | static struct resource sram_resource_b = { |
| 180 | .start = 0x202c0000, |
| 181 | .end = 0x202cffff, |
| 182 | .flags = IORESOURCE_MEM, |
| 183 | }; |
| 184 | |
| 185 | static struct platform_device sram_device_b = { |
| 186 | .name = "mtd-ram", |
| 187 | .id = 9, |
| 188 | .dev = { |
| 189 | .platform_data = &sram_data_b, |
| 190 | }, |
| 191 | .num_resources = 1, |
| 192 | .resource = &sram_resource_b, |
| 193 | }; |
| 194 | #endif |
| 195 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 196 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 197 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 198 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 199 | .name = "bootloader(spi)", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 200 | .size = 0x00020000, |
| 201 | .offset = 0, |
| 202 | .mask_flags = MTD_CAP_ROM |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 203 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 204 | .name = "linux kernel(spi)", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 205 | .size = 0xe0000, |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 206 | .offset = MTDPART_OFS_APPEND, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 207 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 208 | .name = "file system(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 209 | .size = MTDPART_SIZ_FULL, |
| 210 | .offset = MTDPART_OFS_APPEND, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 211 | } |
| 212 | }; |
| 213 | |
| 214 | static struct flash_platform_data bfin_spi_flash_data = { |
| 215 | .name = "m25p80", |
| 216 | .parts = bfin_spi_flash_partitions, |
| 217 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
| 218 | .type = "m25p64", |
| 219 | }; |
| 220 | |
| 221 | /* SPI flash chip (m25p64) */ |
| 222 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 223 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 224 | .bits_per_word = 8, |
| 225 | }; |
| 226 | #endif |
| 227 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 228 | #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 229 | /* SPI ADC chip */ |
| 230 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
| 231 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 232 | .bits_per_word = 16, |
| 233 | }; |
| 234 | #endif |
| 235 | |
| 236 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 237 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 238 | .enable_dma = 0, |
| 239 | .bits_per_word = 16, |
| 240 | }; |
| 241 | #endif |
| 242 | |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 243 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 244 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 245 | .enable_dma = 0, |
| 246 | .bits_per_word = 8, |
| 247 | }; |
| 248 | #endif |
| 249 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 250 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 251 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 252 | { |
| 253 | /* the modalias must be the same as spi device driver name */ |
| 254 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 255 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 256 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 257 | .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ |
| 258 | .platform_data = &bfin_spi_flash_data, |
| 259 | .controller_data = &spi_flash_chip_info, |
| 260 | .mode = SPI_MODE_3, |
| 261 | }, |
| 262 | #endif |
| 263 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 264 | #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 265 | { |
| 266 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 267 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 268 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 269 | .chip_select = 1, /* Framework chip select. */ |
| 270 | .platform_data = NULL, /* No spi_driver specific config */ |
| 271 | .controller_data = &spi_adc_chip_info, |
| 272 | }, |
| 273 | #endif |
| 274 | |
| 275 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 276 | { |
Barry Song | dac9817 | 2009-08-13 21:07:37 +0000 | [diff] [blame^] | 277 | .modalias = "ad1836", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 278 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 279 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 280 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 281 | .controller_data = &ad1836_spi_chip_info, |
| 282 | }, |
| 283 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 284 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 285 | { |
| 286 | .modalias = "spidev", |
| 287 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 288 | .bus_num = 0, |
| 289 | .chip_select = 1, |
| 290 | .controller_data = &spidev_chip_info, |
| 291 | }, |
| 292 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 293 | }; |
| 294 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 295 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 296 | /* SPI (0) */ |
| 297 | static struct resource bfin_spi0_resource[] = { |
| 298 | [0] = { |
| 299 | .start = SPI0_REGBASE, |
| 300 | .end = SPI0_REGBASE + 0xFF, |
| 301 | .flags = IORESOURCE_MEM, |
| 302 | }, |
| 303 | [1] = { |
| 304 | .start = CH_SPI, |
| 305 | .end = CH_SPI, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 306 | .flags = IORESOURCE_DMA, |
| 307 | }, |
| 308 | [2] = { |
| 309 | .start = IRQ_SPI, |
| 310 | .end = IRQ_SPI, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 311 | .flags = IORESOURCE_IRQ, |
| 312 | } |
| 313 | }; |
| 314 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 315 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 316 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 317 | .num_chipselect = 8, |
| 318 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 319 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 320 | }; |
| 321 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 322 | static struct platform_device bfin_spi0_device = { |
| 323 | .name = "bfin-spi", |
| 324 | .id = 0, /* Bus number */ |
| 325 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 326 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 327 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 328 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 329 | }, |
| 330 | }; |
| 331 | #endif /* spi master and devices */ |
| 332 | |
| 333 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 334 | static struct resource bfin_uart_resources[] = { |
| 335 | { |
| 336 | .start = 0xFFC00400, |
| 337 | .end = 0xFFC004FF, |
| 338 | .flags = IORESOURCE_MEM, |
| 339 | }, |
| 340 | }; |
| 341 | |
| 342 | static struct platform_device bfin_uart_device = { |
| 343 | .name = "bfin-uart", |
| 344 | .id = 1, |
| 345 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 346 | .resource = bfin_uart_resources, |
| 347 | }; |
| 348 | #endif |
| 349 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 350 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 351 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 352 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 353 | { |
| 354 | .start = 0xFFC00400, |
| 355 | .end = 0xFFC004FF, |
| 356 | .flags = IORESOURCE_MEM, |
| 357 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 358 | { |
| 359 | .start = IRQ_UART0_RX, |
| 360 | .end = IRQ_UART0_RX+1, |
| 361 | .flags = IORESOURCE_IRQ, |
| 362 | }, |
| 363 | { |
| 364 | .start = CH_UART0_RX, |
| 365 | .end = CH_UART0_RX+1, |
| 366 | .flags = IORESOURCE_DMA, |
| 367 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 368 | }; |
| 369 | |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 370 | static struct platform_device bfin_sir0_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 371 | .name = "bfin_sir", |
| 372 | .id = 0, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 373 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 374 | .resource = bfin_sir0_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 375 | }; |
| 376 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 377 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 378 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 379 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 380 | #include <linux/input.h> |
| 381 | #include <linux/gpio_keys.h> |
| 382 | |
| 383 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 384 | {BTN_0, GPIO_PF7, 1, "gpio-keys: BTN0"}, |
| 385 | {BTN_1, GPIO_PF8, 1, "gpio-keys: BTN1"}, |
| 386 | {BTN_2, GPIO_PF9, 1, "gpio-keys: BTN2"}, |
| 387 | {BTN_3, GPIO_PF10, 1, "gpio-keys: BTN3"}, |
| 388 | }; |
| 389 | |
| 390 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 391 | .buttons = bfin_gpio_keys_table, |
| 392 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 393 | }; |
| 394 | |
| 395 | static struct platform_device bfin_device_gpiokeys = { |
| 396 | .name = "gpio-keys", |
| 397 | .dev = { |
| 398 | .platform_data = &bfin_gpio_keys_data, |
| 399 | }, |
| 400 | }; |
| 401 | #endif |
| 402 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 403 | static struct resource bfin_gpios_resources = { |
| 404 | .start = 0, |
| 405 | .end = MAX_BLACKFIN_GPIOS - 1, |
| 406 | .flags = IORESOURCE_IRQ, |
| 407 | }; |
| 408 | |
| 409 | static struct platform_device bfin_gpios_device = { |
| 410 | .name = "simple-gpio", |
| 411 | .id = -1, |
| 412 | .num_resources = 1, |
| 413 | .resource = &bfin_gpios_resources, |
| 414 | }; |
| 415 | |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 416 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 417 | #include <linux/i2c-gpio.h> |
| 418 | |
| 419 | static struct i2c_gpio_platform_data i2c_gpio_data = { |
| 420 | .sda_pin = 1, |
| 421 | .scl_pin = 0, |
| 422 | .sda_is_open_drain = 0, |
| 423 | .scl_is_open_drain = 0, |
| 424 | .udelay = 40, |
| 425 | }; |
| 426 | |
| 427 | static struct platform_device i2c_gpio_device = { |
| 428 | .name = "i2c-gpio", |
| 429 | .id = 0, |
| 430 | .dev = { |
| 431 | .platform_data = &i2c_gpio_data, |
| 432 | }, |
| 433 | }; |
| 434 | #endif |
| 435 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 436 | static const unsigned int cclk_vlev_datasheet[] = |
| 437 | { |
| 438 | VRPAIR(VLEV_085, 250000000), |
| 439 | VRPAIR(VLEV_090, 376000000), |
| 440 | VRPAIR(VLEV_095, 426000000), |
| 441 | VRPAIR(VLEV_100, 426000000), |
| 442 | VRPAIR(VLEV_105, 476000000), |
| 443 | VRPAIR(VLEV_110, 476000000), |
| 444 | VRPAIR(VLEV_115, 476000000), |
| 445 | VRPAIR(VLEV_120, 600000000), |
| 446 | VRPAIR(VLEV_125, 600000000), |
| 447 | VRPAIR(VLEV_130, 600000000), |
| 448 | }; |
| 449 | |
| 450 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 451 | .tuple_tab = cclk_vlev_datasheet, |
| 452 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 453 | .vr_settling_time = 25 /* us */, |
| 454 | }; |
| 455 | |
| 456 | static struct platform_device bfin_dpmc = { |
| 457 | .name = "bfin dpmc", |
| 458 | .dev = { |
| 459 | .platform_data = &bfin_dmpc_vreg_data, |
| 460 | }, |
| 461 | }; |
| 462 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 463 | static struct platform_device *ezkit_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 464 | |
| 465 | &bfin_dpmc, |
| 466 | |
Mike Frysinger | 4d5e6fd | 2009-06-13 06:34:49 -0400 | [diff] [blame] | 467 | #if defined(CONFIG_MTD_PSD4256G) || defined(CONFIG_MTD_PSD4256G_MODULE) |
| 468 | &stm_pri_device_a, |
| 469 | &stm_pri_device_b, |
| 470 | #endif |
| 471 | |
| 472 | #if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) |
| 473 | &sram_device_a, |
| 474 | &sram_device_b, |
| 475 | #endif |
| 476 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 477 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 478 | &smc91x_device, |
| 479 | #endif |
| 480 | |
| 481 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 482 | &bfin_spi0_device, |
| 483 | #endif |
| 484 | |
| 485 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 486 | &bfin_fb_adv7393_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 487 | #endif |
| 488 | |
| 489 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 490 | &rtc_device, |
| 491 | #endif |
| 492 | |
Sonic Zhang | e062cea | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 493 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 494 | &bfin_uart_device, |
| 495 | #endif |
| 496 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 497 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 498 | #ifdef CONFIG_BFIN_SIR0 |
| 499 | &bfin_sir0_device, |
| 500 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 501 | #endif |
| 502 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 503 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 504 | &bfin_device_gpiokeys, |
| 505 | #endif |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 506 | |
| 507 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 508 | &i2c_gpio_device, |
| 509 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 510 | |
| 511 | &bfin_gpios_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 512 | }; |
| 513 | |
| 514 | static int __init ezkit_init(void) |
| 515 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 516 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 517 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 518 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 519 | return 0; |
| 520 | } |
| 521 | |
| 522 | arch_initcall(ezkit_init); |