Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf561/ezkit.c |
| 3 | * Based on: |
| 4 | * Author: |
| 5 | * |
| 6 | * Created: |
| 7 | * Description: |
| 8 | * |
| 9 | * Modified: |
| 10 | * Copyright 2004-2006 Analog Devices Inc. |
| 11 | * |
| 12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License as published by |
| 16 | * the Free Software Foundation; either version 2 of the License, or |
| 17 | * (at your option) any later version. |
| 18 | * |
| 19 | * This program is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, see the file COPYING, or write |
| 26 | * to the Free Software Foundation, Inc., |
| 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 28 | */ |
| 29 | |
| 30 | #include <linux/device.h> |
| 31 | #include <linux/platform_device.h> |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 32 | #include <linux/mtd/mtd.h> |
| 33 | #include <linux/mtd/partitions.h> |
| 34 | #include <linux/mtd/physmap.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 35 | #include <linux/spi/spi.h> |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 36 | #include <linux/irq.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 37 | #include <linux/interrupt.h> |
Jeff Garzik | 0a87e3e | 2008-02-01 18:02:30 -0500 | [diff] [blame] | 38 | #include <linux/ata_platform.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 39 | #include <asm/dma.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 40 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 41 | #include <asm/portmux.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 42 | #include <asm/dpmc.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 43 | |
| 44 | /* |
| 45 | * Name the Board for the /proc/cpuinfo |
| 46 | */ |
Mike Frysinger | 066954a | 2007-10-21 22:36:06 +0800 | [diff] [blame] | 47 | const char bfin_board_name[] = "ADDS-BF561-EZKIT"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 48 | |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 49 | #define ISP1761_BASE 0x2C0F0000 |
| 50 | #define ISP1761_IRQ IRQ_PF10 |
| 51 | |
| 52 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 53 | static struct resource bfin_isp1761_resources[] = { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 54 | { |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 55 | .name = "isp1761-regs", |
| 56 | .start = ISP1761_BASE + 0x00000000, |
| 57 | .end = ISP1761_BASE + 0x000fffff, |
| 58 | .flags = IORESOURCE_MEM, |
| 59 | }, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 60 | { |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 61 | .start = ISP1761_IRQ, |
| 62 | .end = ISP1761_IRQ, |
| 63 | .flags = IORESOURCE_IRQ, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static struct platform_device bfin_isp1761_device = { |
| 68 | .name = "isp1761", |
| 69 | .id = 0, |
| 70 | .num_resources = ARRAY_SIZE(bfin_isp1761_resources), |
| 71 | .resource = bfin_isp1761_resources, |
| 72 | }; |
| 73 | |
| 74 | static struct platform_device *bfin_isp1761_devices[] = { |
| 75 | &bfin_isp1761_device, |
| 76 | }; |
| 77 | |
| 78 | int __init bfin_isp1761_init(void) |
| 79 | { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 80 | unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices); |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 81 | |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 82 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 83 | set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING); |
| 84 | |
| 85 | return platform_add_devices(bfin_isp1761_devices, num_devices); |
| 86 | } |
| 87 | |
| 88 | void __exit bfin_isp1761_exit(void) |
| 89 | { |
| 90 | platform_device_unregister(&bfin_isp1761_device); |
| 91 | } |
| 92 | |
| 93 | arch_initcall(bfin_isp1761_init); |
| 94 | #endif |
| 95 | |
Michael Hennerich | e9d76c2 | 2008-02-02 14:55:28 +0800 | [diff] [blame] | 96 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 97 | #include <linux/usb/isp1362.h> |
| 98 | |
| 99 | static struct resource isp1362_hcd_resources[] = { |
| 100 | { |
| 101 | .start = 0x2c060000, |
| 102 | .end = 0x2c060000, |
| 103 | .flags = IORESOURCE_MEM, |
| 104 | }, { |
| 105 | .start = 0x2c060004, |
| 106 | .end = 0x2c060004, |
| 107 | .flags = IORESOURCE_MEM, |
| 108 | }, { |
| 109 | .start = IRQ_PF8, |
| 110 | .end = IRQ_PF8, |
| 111 | .flags = IORESOURCE_IRQ, |
| 112 | }, |
| 113 | }; |
| 114 | |
| 115 | static struct isp1362_platform_data isp1362_priv = { |
| 116 | .sel15Kres = 1, |
| 117 | .clknotstop = 0, |
| 118 | .oc_enable = 0, |
| 119 | .int_act_high = 0, |
| 120 | .int_edge_triggered = 0, |
| 121 | .remote_wakeup_connected = 0, |
| 122 | .no_power_switching = 1, |
| 123 | .power_switching_mode = 0, |
| 124 | }; |
| 125 | |
| 126 | static struct platform_device isp1362_hcd_device = { |
| 127 | .name = "isp1362-hcd", |
| 128 | .id = 0, |
| 129 | .dev = { |
| 130 | .platform_data = &isp1362_priv, |
| 131 | }, |
| 132 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), |
| 133 | .resource = isp1362_hcd_resources, |
| 134 | }; |
| 135 | #endif |
| 136 | |
Michael Hennerich | 83d9cde | 2008-02-02 16:25:17 +0800 | [diff] [blame] | 137 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 138 | static struct resource net2272_bfin_resources[] = { |
| 139 | { |
| 140 | .start = 0x2C000000, |
| 141 | .end = 0x2C000000 + 0x7F, |
| 142 | .flags = IORESOURCE_MEM, |
| 143 | }, { |
| 144 | .start = IRQ_PF10, |
| 145 | .end = IRQ_PF10, |
| 146 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 147 | }, |
| 148 | }; |
| 149 | |
| 150 | static struct platform_device net2272_bfin_device = { |
| 151 | .name = "net2272", |
| 152 | .id = -1, |
| 153 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 154 | .resource = net2272_bfin_resources, |
| 155 | }; |
| 156 | #endif |
| 157 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 158 | /* |
| 159 | * USB-LAN EzExtender board |
| 160 | * Driver needs to know address, irq and flag pin. |
| 161 | */ |
| 162 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 163 | static struct resource smc91x_resources[] = { |
| 164 | { |
| 165 | .name = "smc91x-regs", |
| 166 | .start = 0x2C010300, |
| 167 | .end = 0x2C010300 + 16, |
| 168 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 169 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 170 | |
| 171 | .start = IRQ_PF9, |
| 172 | .end = IRQ_PF9, |
| 173 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 174 | }, |
| 175 | }; |
| 176 | |
| 177 | static struct platform_device smc91x_device = { |
| 178 | .name = "smc91x", |
| 179 | .id = 0, |
| 180 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 181 | .resource = smc91x_resources, |
| 182 | }; |
| 183 | #endif |
| 184 | |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 185 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 186 | static struct resource ax88180_resources[] = { |
| 187 | [0] = { |
| 188 | .start = 0x2c000000, |
| 189 | .end = 0x2c000000 + 0x8000, |
| 190 | .flags = IORESOURCE_MEM, |
| 191 | }, |
| 192 | [1] = { |
| 193 | .start = IRQ_PF10, |
| 194 | .end = IRQ_PF10, |
| 195 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL), |
| 196 | }, |
| 197 | }; |
| 198 | |
| 199 | static struct platform_device ax88180_device = { |
| 200 | .name = "ax88180", |
| 201 | .id = -1, |
| 202 | .num_resources = ARRAY_SIZE(ax88180_resources), |
| 203 | .resource = ax88180_resources, |
| 204 | }; |
| 205 | #endif |
| 206 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 207 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 208 | static struct resource bfin_uart_resources[] = { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 209 | { |
| 210 | .start = 0xFFC00400, |
| 211 | .end = 0xFFC004FF, |
| 212 | .flags = IORESOURCE_MEM, |
| 213 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 214 | }; |
| 215 | |
| 216 | static struct platform_device bfin_uart_device = { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 217 | .name = "bfin-uart", |
| 218 | .id = 1, |
| 219 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 220 | .resource = bfin_uart_resources, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 221 | }; |
| 222 | #endif |
| 223 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 224 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 225 | static struct resource bfin_sir_resources[] = { |
| 226 | #ifdef CONFIG_BFIN_SIR0 |
| 227 | { |
| 228 | .start = 0xFFC00400, |
| 229 | .end = 0xFFC004FF, |
| 230 | .flags = IORESOURCE_MEM, |
| 231 | }, |
| 232 | #endif |
| 233 | }; |
| 234 | |
| 235 | static struct platform_device bfin_sir_device = { |
| 236 | .name = "bfin_sir", |
| 237 | .id = 0, |
| 238 | .num_resources = ARRAY_SIZE(bfin_sir_resources), |
| 239 | .resource = bfin_sir_resources, |
| 240 | }; |
| 241 | #endif |
| 242 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 243 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 244 | static struct mtd_partition ezkit_partitions[] = { |
| 245 | { |
| 246 | .name = "Bootloader", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 247 | .size = 0x40000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 248 | .offset = 0, |
| 249 | }, { |
| 250 | .name = "Kernel", |
Grace Pan | ac76d88 | 2008-04-24 06:33:56 +0800 | [diff] [blame] | 251 | .size = 0x1C0000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 252 | .offset = MTDPART_OFS_APPEND, |
| 253 | }, { |
| 254 | .name = "RootFS", |
| 255 | .size = MTDPART_SIZ_FULL, |
| 256 | .offset = MTDPART_OFS_APPEND, |
| 257 | } |
| 258 | }; |
| 259 | |
| 260 | static struct physmap_flash_data ezkit_flash_data = { |
| 261 | .width = 2, |
| 262 | .parts = ezkit_partitions, |
| 263 | .nr_parts = ARRAY_SIZE(ezkit_partitions), |
| 264 | }; |
| 265 | |
| 266 | static struct resource ezkit_flash_resource = { |
| 267 | .start = 0x20000000, |
| 268 | .end = 0x207fffff, |
| 269 | .flags = IORESOURCE_MEM, |
| 270 | }; |
| 271 | |
| 272 | static struct platform_device ezkit_flash_device = { |
| 273 | .name = "physmap-flash", |
| 274 | .id = 0, |
| 275 | .dev = { |
| 276 | .platform_data = &ezkit_flash_data, |
| 277 | }, |
| 278 | .num_resources = 1, |
| 279 | .resource = &ezkit_flash_resource, |
| 280 | }; |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 281 | #endif |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 282 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 283 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 284 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 285 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 286 | .enable_dma = 0, |
| 287 | .bits_per_word = 16, |
| 288 | }; |
| 289 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 290 | |
| 291 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 292 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 293 | .enable_dma = 0, |
| 294 | .bits_per_word = 8, |
| 295 | }; |
| 296 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 297 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 298 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 299 | /* SPI (0) */ |
| 300 | static struct resource bfin_spi0_resource[] = { |
| 301 | [0] = { |
| 302 | .start = SPI0_REGBASE, |
| 303 | .end = SPI0_REGBASE + 0xFF, |
| 304 | .flags = IORESOURCE_MEM, |
| 305 | }, |
| 306 | [1] = { |
| 307 | .start = CH_SPI, |
| 308 | .end = CH_SPI, |
| 309 | .flags = IORESOURCE_IRQ, |
| 310 | } |
| 311 | }; |
| 312 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 313 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 314 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 315 | .num_chipselect = 8, |
| 316 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 317 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 318 | }; |
| 319 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 320 | static struct platform_device bfin_spi0_device = { |
| 321 | .name = "bfin-spi", |
| 322 | .id = 0, /* Bus number */ |
| 323 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 324 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 325 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 326 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 327 | }, |
| 328 | }; |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 329 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 330 | |
| 331 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 332 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 333 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 334 | { |
| 335 | .modalias = "ad1836-spi", |
| 336 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 337 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 338 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 339 | .controller_data = &ad1836_spi_chip_info, |
| 340 | }, |
| 341 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 342 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 343 | { |
| 344 | .modalias = "spidev", |
| 345 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 346 | .bus_num = 0, |
| 347 | .chip_select = 1, |
| 348 | .controller_data = &spidev_chip_info, |
| 349 | }, |
| 350 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 351 | }; |
| 352 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 353 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 354 | #define PATA_INT 55 |
| 355 | |
| 356 | static struct pata_platform_info bfin_pata_platform_data = { |
| 357 | .ioport_shift = 1, |
| 358 | .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED, |
| 359 | }; |
| 360 | |
| 361 | static struct resource bfin_pata_resources[] = { |
| 362 | { |
| 363 | .start = 0x20314020, |
| 364 | .end = 0x2031403F, |
| 365 | .flags = IORESOURCE_MEM, |
| 366 | }, |
| 367 | { |
| 368 | .start = 0x2031401C, |
| 369 | .end = 0x2031401F, |
| 370 | .flags = IORESOURCE_MEM, |
| 371 | }, |
| 372 | { |
| 373 | .start = PATA_INT, |
| 374 | .end = PATA_INT, |
| 375 | .flags = IORESOURCE_IRQ, |
| 376 | }, |
| 377 | }; |
| 378 | |
| 379 | static struct platform_device bfin_pata_device = { |
| 380 | .name = "pata_platform", |
| 381 | .id = -1, |
| 382 | .num_resources = ARRAY_SIZE(bfin_pata_resources), |
| 383 | .resource = bfin_pata_resources, |
| 384 | .dev = { |
| 385 | .platform_data = &bfin_pata_platform_data, |
| 386 | } |
| 387 | }; |
| 388 | #endif |
| 389 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 390 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 391 | #include <linux/input.h> |
| 392 | #include <linux/gpio_keys.h> |
| 393 | |
| 394 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 395 | {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"}, |
| 396 | {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"}, |
| 397 | {BTN_2, GPIO_PF7, 1, "gpio-keys: BTN2"}, |
| 398 | {BTN_3, GPIO_PF8, 1, "gpio-keys: BTN3"}, |
| 399 | }; |
| 400 | |
| 401 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 402 | .buttons = bfin_gpio_keys_table, |
| 403 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 404 | }; |
| 405 | |
| 406 | static struct platform_device bfin_device_gpiokeys = { |
| 407 | .name = "gpio-keys", |
| 408 | .dev = { |
| 409 | .platform_data = &bfin_gpio_keys_data, |
| 410 | }, |
| 411 | }; |
| 412 | #endif |
| 413 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 414 | static struct resource bfin_gpios_resources = { |
| 415 | .start = 0, |
| 416 | .end = MAX_BLACKFIN_GPIOS - 1, |
| 417 | .flags = IORESOURCE_IRQ, |
| 418 | }; |
| 419 | |
| 420 | static struct platform_device bfin_gpios_device = { |
| 421 | .name = "simple-gpio", |
| 422 | .id = -1, |
| 423 | .num_resources = 1, |
| 424 | .resource = &bfin_gpios_resources, |
| 425 | }; |
| 426 | |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 427 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 428 | #include <linux/i2c-gpio.h> |
| 429 | |
| 430 | static struct i2c_gpio_platform_data i2c_gpio_data = { |
| 431 | .sda_pin = 1, |
| 432 | .scl_pin = 0, |
| 433 | .sda_is_open_drain = 0, |
| 434 | .scl_is_open_drain = 0, |
| 435 | .udelay = 40, |
| 436 | }; |
| 437 | |
| 438 | static struct platform_device i2c_gpio_device = { |
| 439 | .name = "i2c-gpio", |
| 440 | .id = 0, |
| 441 | .dev = { |
| 442 | .platform_data = &i2c_gpio_data, |
| 443 | }, |
| 444 | }; |
| 445 | #endif |
| 446 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 447 | static const unsigned int cclk_vlev_datasheet[] = |
| 448 | { |
| 449 | VRPAIR(VLEV_085, 250000000), |
| 450 | VRPAIR(VLEV_090, 300000000), |
| 451 | VRPAIR(VLEV_095, 313000000), |
| 452 | VRPAIR(VLEV_100, 350000000), |
| 453 | VRPAIR(VLEV_105, 400000000), |
| 454 | VRPAIR(VLEV_110, 444000000), |
| 455 | VRPAIR(VLEV_115, 450000000), |
| 456 | VRPAIR(VLEV_120, 475000000), |
| 457 | VRPAIR(VLEV_125, 500000000), |
| 458 | VRPAIR(VLEV_130, 600000000), |
| 459 | }; |
| 460 | |
| 461 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 462 | .tuple_tab = cclk_vlev_datasheet, |
| 463 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 464 | .vr_settling_time = 25 /* us */, |
| 465 | }; |
| 466 | |
| 467 | static struct platform_device bfin_dpmc = { |
| 468 | .name = "bfin dpmc", |
| 469 | .dev = { |
| 470 | .platform_data = &bfin_dmpc_vreg_data, |
| 471 | }, |
| 472 | }; |
| 473 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 474 | static struct platform_device *ezkit_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 475 | |
| 476 | &bfin_dpmc, |
| 477 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 478 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 479 | &smc91x_device, |
| 480 | #endif |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 481 | |
| 482 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 483 | &ax88180_device, |
| 484 | #endif |
| 485 | |
Michael Hennerich | 83d9cde | 2008-02-02 16:25:17 +0800 | [diff] [blame] | 486 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 487 | &net2272_bfin_device, |
| 488 | #endif |
| 489 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 490 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 491 | &bfin_spi0_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 492 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 493 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 494 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 495 | &bfin_uart_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 496 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 497 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 498 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 499 | &bfin_sir_device, |
| 500 | #endif |
| 501 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 502 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 503 | &bfin_pata_device, |
| 504 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 505 | |
| 506 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 507 | &bfin_device_gpiokeys, |
| 508 | #endif |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 509 | |
| 510 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 511 | &i2c_gpio_device, |
| 512 | #endif |
Michael Hennerich | e9d76c2 | 2008-02-02 14:55:28 +0800 | [diff] [blame] | 513 | |
| 514 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 515 | &isp1362_hcd_device, |
| 516 | #endif |
| 517 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 518 | &bfin_gpios_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 519 | |
| 520 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 521 | &ezkit_flash_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 522 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 523 | }; |
| 524 | |
| 525 | static int __init ezkit_init(void) |
| 526 | { |
| 527 | int ret; |
| 528 | |
Mike Frysinger | c0fc525 | 2007-05-21 18:09:25 +0800 | [diff] [blame] | 529 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
| 530 | |
| 531 | ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 532 | if (ret < 0) |
| 533 | return ret; |
Mike Frysinger | c0fc525 | 2007-05-21 18:09:25 +0800 | [diff] [blame] | 534 | |
| 535 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 536 | bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12)); |
| 537 | SSYNC(); |
| 538 | #endif |
| 539 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 540 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 541 | |
| 542 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 543 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; |
| 544 | #endif |
| 545 | return 0; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 546 | } |
| 547 | |
| 548 | arch_initcall(ezkit_init); |