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> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 38 | #include <asm/dma.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 39 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 40 | #include <asm/portmux.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 41 | #include <asm/dpmc.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 42 | |
| 43 | /* |
| 44 | * Name the Board for the /proc/cpuinfo |
| 45 | */ |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame^] | 46 | const char bfin_board_name[] = "ADI BF561-EZKIT"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 47 | |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 48 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 49 | #include <linux/usb/isp1760.h> |
| 50 | static struct resource bfin_isp1760_resources[] = { |
| 51 | [0] = { |
| 52 | .start = 0x2C0F0000, |
| 53 | .end = 0x203C0000 + 0xfffff, |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 54 | .flags = IORESOURCE_MEM, |
| 55 | }, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 56 | [1] = { |
| 57 | .start = IRQ_PF10, |
| 58 | .end = IRQ_PF10, |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 59 | .flags = IORESOURCE_IRQ, |
| 60 | }, |
| 61 | }; |
| 62 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 63 | static struct isp1760_platform_data isp1760_priv = { |
| 64 | .is_isp1761 = 0, |
| 65 | .port1_disable = 0, |
| 66 | .bus_width_16 = 1, |
| 67 | .port1_otg = 0, |
| 68 | .analog_oc = 0, |
| 69 | .dack_polarity_high = 0, |
| 70 | .dreq_polarity_high = 0, |
| 71 | }; |
| 72 | |
| 73 | static struct platform_device bfin_isp1760_device = { |
| 74 | .name = "isp1760-hcd", |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 75 | .id = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 76 | .dev = { |
| 77 | .platform_data = &isp1760_priv, |
| 78 | }, |
| 79 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), |
| 80 | .resource = bfin_isp1760_resources, |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 81 | }; |
Michael Hennerich | 140a9ae | 2007-05-21 18:09:13 +0800 | [diff] [blame] | 82 | #endif |
| 83 | |
Michael Hennerich | e9d76c2 | 2008-02-02 14:55:28 +0800 | [diff] [blame] | 84 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 85 | #include <linux/usb/isp1362.h> |
| 86 | |
| 87 | static struct resource isp1362_hcd_resources[] = { |
| 88 | { |
| 89 | .start = 0x2c060000, |
| 90 | .end = 0x2c060000, |
| 91 | .flags = IORESOURCE_MEM, |
| 92 | }, { |
| 93 | .start = 0x2c060004, |
| 94 | .end = 0x2c060004, |
| 95 | .flags = IORESOURCE_MEM, |
| 96 | }, { |
| 97 | .start = IRQ_PF8, |
| 98 | .end = IRQ_PF8, |
| 99 | .flags = IORESOURCE_IRQ, |
| 100 | }, |
| 101 | }; |
| 102 | |
| 103 | static struct isp1362_platform_data isp1362_priv = { |
| 104 | .sel15Kres = 1, |
| 105 | .clknotstop = 0, |
| 106 | .oc_enable = 0, |
| 107 | .int_act_high = 0, |
| 108 | .int_edge_triggered = 0, |
| 109 | .remote_wakeup_connected = 0, |
| 110 | .no_power_switching = 1, |
| 111 | .power_switching_mode = 0, |
| 112 | }; |
| 113 | |
| 114 | static struct platform_device isp1362_hcd_device = { |
| 115 | .name = "isp1362-hcd", |
| 116 | .id = 0, |
| 117 | .dev = { |
| 118 | .platform_data = &isp1362_priv, |
| 119 | }, |
| 120 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), |
| 121 | .resource = isp1362_hcd_resources, |
| 122 | }; |
| 123 | #endif |
| 124 | |
Michael Hennerich | 83d9cde | 2008-02-02 16:25:17 +0800 | [diff] [blame] | 125 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 126 | static struct resource net2272_bfin_resources[] = { |
| 127 | { |
| 128 | .start = 0x2C000000, |
| 129 | .end = 0x2C000000 + 0x7F, |
| 130 | .flags = IORESOURCE_MEM, |
| 131 | }, { |
| 132 | .start = IRQ_PF10, |
| 133 | .end = IRQ_PF10, |
| 134 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 135 | }, |
| 136 | }; |
| 137 | |
| 138 | static struct platform_device net2272_bfin_device = { |
| 139 | .name = "net2272", |
| 140 | .id = -1, |
| 141 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 142 | .resource = net2272_bfin_resources, |
| 143 | }; |
| 144 | #endif |
| 145 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 146 | /* |
| 147 | * USB-LAN EzExtender board |
| 148 | * Driver needs to know address, irq and flag pin. |
| 149 | */ |
| 150 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 151 | static struct resource smc91x_resources[] = { |
| 152 | { |
| 153 | .name = "smc91x-regs", |
| 154 | .start = 0x2C010300, |
| 155 | .end = 0x2C010300 + 16, |
| 156 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 157 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 158 | |
| 159 | .start = IRQ_PF9, |
| 160 | .end = IRQ_PF9, |
| 161 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 162 | }, |
| 163 | }; |
| 164 | |
| 165 | static struct platform_device smc91x_device = { |
| 166 | .name = "smc91x", |
| 167 | .id = 0, |
| 168 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 169 | .resource = smc91x_resources, |
| 170 | }; |
| 171 | #endif |
| 172 | |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 173 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 174 | static struct resource ax88180_resources[] = { |
| 175 | [0] = { |
| 176 | .start = 0x2c000000, |
| 177 | .end = 0x2c000000 + 0x8000, |
| 178 | .flags = IORESOURCE_MEM, |
| 179 | }, |
| 180 | [1] = { |
| 181 | .start = IRQ_PF10, |
| 182 | .end = IRQ_PF10, |
| 183 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL), |
| 184 | }, |
| 185 | }; |
| 186 | |
| 187 | static struct platform_device ax88180_device = { |
| 188 | .name = "ax88180", |
| 189 | .id = -1, |
| 190 | .num_resources = ARRAY_SIZE(ax88180_resources), |
| 191 | .resource = ax88180_resources, |
| 192 | }; |
| 193 | #endif |
| 194 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 195 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 196 | static struct resource bfin_uart_resources[] = { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 197 | { |
| 198 | .start = 0xFFC00400, |
| 199 | .end = 0xFFC004FF, |
| 200 | .flags = IORESOURCE_MEM, |
| 201 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 202 | }; |
| 203 | |
| 204 | static struct platform_device bfin_uart_device = { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 205 | .name = "bfin-uart", |
| 206 | .id = 1, |
| 207 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 208 | .resource = bfin_uart_resources, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 209 | }; |
| 210 | #endif |
| 211 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 212 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 213 | static struct resource bfin_sir_resources[] = { |
| 214 | #ifdef CONFIG_BFIN_SIR0 |
| 215 | { |
| 216 | .start = 0xFFC00400, |
| 217 | .end = 0xFFC004FF, |
| 218 | .flags = IORESOURCE_MEM, |
| 219 | }, |
| 220 | #endif |
| 221 | }; |
| 222 | |
| 223 | static struct platform_device bfin_sir_device = { |
| 224 | .name = "bfin_sir", |
| 225 | .id = 0, |
| 226 | .num_resources = ARRAY_SIZE(bfin_sir_resources), |
| 227 | .resource = bfin_sir_resources, |
| 228 | }; |
| 229 | #endif |
| 230 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 231 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 232 | static struct mtd_partition ezkit_partitions[] = { |
| 233 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 234 | .name = "bootloader(nor)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 235 | .size = 0x40000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 236 | .offset = 0, |
| 237 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 238 | .name = "linux kernel(nor)", |
Grace Pan | ac76d88 | 2008-04-24 06:33:56 +0800 | [diff] [blame] | 239 | .size = 0x1C0000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 240 | .offset = MTDPART_OFS_APPEND, |
| 241 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 242 | .name = "file system(nor)", |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 243 | .size = MTDPART_SIZ_FULL, |
| 244 | .offset = MTDPART_OFS_APPEND, |
| 245 | } |
| 246 | }; |
| 247 | |
| 248 | static struct physmap_flash_data ezkit_flash_data = { |
| 249 | .width = 2, |
| 250 | .parts = ezkit_partitions, |
| 251 | .nr_parts = ARRAY_SIZE(ezkit_partitions), |
| 252 | }; |
| 253 | |
| 254 | static struct resource ezkit_flash_resource = { |
| 255 | .start = 0x20000000, |
| 256 | .end = 0x207fffff, |
| 257 | .flags = IORESOURCE_MEM, |
| 258 | }; |
| 259 | |
| 260 | static struct platform_device ezkit_flash_device = { |
| 261 | .name = "physmap-flash", |
| 262 | .id = 0, |
| 263 | .dev = { |
| 264 | .platform_data = &ezkit_flash_data, |
| 265 | }, |
| 266 | .num_resources = 1, |
| 267 | .resource = &ezkit_flash_resource, |
| 268 | }; |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 269 | #endif |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 270 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 271 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 272 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 273 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 274 | .enable_dma = 0, |
| 275 | .bits_per_word = 16, |
| 276 | }; |
| 277 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 278 | |
| 279 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 280 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 281 | .enable_dma = 0, |
| 282 | .bits_per_word = 8, |
| 283 | }; |
| 284 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 285 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 286 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 287 | /* SPI (0) */ |
| 288 | static struct resource bfin_spi0_resource[] = { |
| 289 | [0] = { |
| 290 | .start = SPI0_REGBASE, |
| 291 | .end = SPI0_REGBASE + 0xFF, |
| 292 | .flags = IORESOURCE_MEM, |
| 293 | }, |
| 294 | [1] = { |
| 295 | .start = CH_SPI, |
| 296 | .end = CH_SPI, |
| 297 | .flags = IORESOURCE_IRQ, |
| 298 | } |
| 299 | }; |
| 300 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 301 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 302 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 303 | .num_chipselect = 8, |
| 304 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 305 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 306 | }; |
| 307 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 308 | static struct platform_device bfin_spi0_device = { |
| 309 | .name = "bfin-spi", |
| 310 | .id = 0, /* Bus number */ |
| 311 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 312 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 313 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 314 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 315 | }, |
| 316 | }; |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 317 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 318 | |
| 319 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 320 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 321 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 322 | { |
| 323 | .modalias = "ad1836-spi", |
| 324 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 325 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 326 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 327 | .controller_data = &ad1836_spi_chip_info, |
| 328 | }, |
| 329 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 330 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 331 | { |
| 332 | .modalias = "spidev", |
| 333 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 334 | .bus_num = 0, |
| 335 | .chip_select = 1, |
| 336 | .controller_data = &spidev_chip_info, |
| 337 | }, |
| 338 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 339 | }; |
| 340 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 341 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 342 | #include <linux/input.h> |
| 343 | #include <linux/gpio_keys.h> |
| 344 | |
| 345 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 346 | {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"}, |
| 347 | {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"}, |
| 348 | {BTN_2, GPIO_PF7, 1, "gpio-keys: BTN2"}, |
| 349 | {BTN_3, GPIO_PF8, 1, "gpio-keys: BTN3"}, |
| 350 | }; |
| 351 | |
| 352 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 353 | .buttons = bfin_gpio_keys_table, |
| 354 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 355 | }; |
| 356 | |
| 357 | static struct platform_device bfin_device_gpiokeys = { |
| 358 | .name = "gpio-keys", |
| 359 | .dev = { |
| 360 | .platform_data = &bfin_gpio_keys_data, |
| 361 | }, |
| 362 | }; |
| 363 | #endif |
| 364 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 365 | static struct resource bfin_gpios_resources = { |
| 366 | .start = 0, |
| 367 | .end = MAX_BLACKFIN_GPIOS - 1, |
| 368 | .flags = IORESOURCE_IRQ, |
| 369 | }; |
| 370 | |
| 371 | static struct platform_device bfin_gpios_device = { |
| 372 | .name = "simple-gpio", |
| 373 | .id = -1, |
| 374 | .num_resources = 1, |
| 375 | .resource = &bfin_gpios_resources, |
| 376 | }; |
| 377 | |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 378 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 379 | #include <linux/i2c-gpio.h> |
| 380 | |
| 381 | static struct i2c_gpio_platform_data i2c_gpio_data = { |
| 382 | .sda_pin = 1, |
| 383 | .scl_pin = 0, |
| 384 | .sda_is_open_drain = 0, |
| 385 | .scl_is_open_drain = 0, |
| 386 | .udelay = 40, |
| 387 | }; |
| 388 | |
| 389 | static struct platform_device i2c_gpio_device = { |
| 390 | .name = "i2c-gpio", |
| 391 | .id = 0, |
| 392 | .dev = { |
| 393 | .platform_data = &i2c_gpio_data, |
| 394 | }, |
| 395 | }; |
| 396 | #endif |
| 397 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 398 | static const unsigned int cclk_vlev_datasheet[] = |
| 399 | { |
| 400 | VRPAIR(VLEV_085, 250000000), |
| 401 | VRPAIR(VLEV_090, 300000000), |
| 402 | VRPAIR(VLEV_095, 313000000), |
| 403 | VRPAIR(VLEV_100, 350000000), |
| 404 | VRPAIR(VLEV_105, 400000000), |
| 405 | VRPAIR(VLEV_110, 444000000), |
| 406 | VRPAIR(VLEV_115, 450000000), |
| 407 | VRPAIR(VLEV_120, 475000000), |
| 408 | VRPAIR(VLEV_125, 500000000), |
| 409 | VRPAIR(VLEV_130, 600000000), |
| 410 | }; |
| 411 | |
| 412 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 413 | .tuple_tab = cclk_vlev_datasheet, |
| 414 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 415 | .vr_settling_time = 25 /* us */, |
| 416 | }; |
| 417 | |
| 418 | static struct platform_device bfin_dpmc = { |
| 419 | .name = "bfin dpmc", |
| 420 | .dev = { |
| 421 | .platform_data = &bfin_dmpc_vreg_data, |
| 422 | }, |
| 423 | }; |
| 424 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 425 | static struct platform_device *ezkit_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 426 | |
| 427 | &bfin_dpmc, |
| 428 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 429 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 430 | &smc91x_device, |
| 431 | #endif |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 432 | |
| 433 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 434 | &ax88180_device, |
| 435 | #endif |
| 436 | |
Michael Hennerich | 83d9cde | 2008-02-02 16:25:17 +0800 | [diff] [blame] | 437 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 438 | &net2272_bfin_device, |
| 439 | #endif |
| 440 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 441 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 442 | &bfin_isp1760_device, |
| 443 | #endif |
| 444 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 445 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 446 | &bfin_spi0_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 447 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 448 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 449 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 450 | &bfin_uart_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 451 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 452 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 453 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 454 | &bfin_sir_device, |
| 455 | #endif |
| 456 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 457 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 458 | &bfin_device_gpiokeys, |
| 459 | #endif |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 460 | |
| 461 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 462 | &i2c_gpio_device, |
| 463 | #endif |
Michael Hennerich | e9d76c2 | 2008-02-02 14:55:28 +0800 | [diff] [blame] | 464 | |
| 465 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 466 | &isp1362_hcd_device, |
| 467 | #endif |
| 468 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 469 | &bfin_gpios_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 470 | |
| 471 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 472 | &ezkit_flash_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 473 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 474 | }; |
| 475 | |
| 476 | static int __init ezkit_init(void) |
| 477 | { |
| 478 | int ret; |
| 479 | |
Mike Frysinger | c0fc525 | 2007-05-21 18:09:25 +0800 | [diff] [blame] | 480 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
| 481 | |
| 482 | ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 483 | if (ret < 0) |
| 484 | return ret; |
Mike Frysinger | c0fc525 | 2007-05-21 18:09:25 +0800 | [diff] [blame] | 485 | |
| 486 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 487 | bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12)); |
| 488 | SSYNC(); |
| 489 | #endif |
| 490 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 491 | 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] | 492 | return 0; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | arch_initcall(ezkit_init); |