Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf537/boards/stamp.c |
| 3 | * Based on: arch/blackfin/mach-bf533/boards/ezkit.c |
| 4 | * Author: Aidan Williams <aidan@nicta.com.au> |
| 5 | * |
| 6 | * Created: |
| 7 | * Description: |
| 8 | * |
| 9 | * Modified: |
| 10 | * Copyright 2005 National ICT Australia (NICTA) |
| 11 | * Copyright 2004-2006 Analog Devices Inc. |
| 12 | * |
| 13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by |
| 17 | * the Free Software Foundation; either version 2 of the License, or |
| 18 | * (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, see the file COPYING, or write |
| 27 | * to the Free Software Foundation, Inc., |
| 28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 | */ |
| 30 | |
| 31 | #include <linux/device.h> |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 32 | #include <linux/kernel.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 33 | #include <linux/platform_device.h> |
| 34 | #include <linux/mtd/mtd.h> |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 35 | #include <linux/mtd/nand.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 36 | #include <linux/mtd/partitions.h> |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 37 | #include <linux/mtd/plat-ram.h> |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 38 | #include <linux/mtd/physmap.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 39 | #include <linux/spi/spi.h> |
| 40 | #include <linux/spi/flash.h> |
| 41 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
Mike Frysinger | f02bcec | 2007-11-15 21:29:15 +0800 | [diff] [blame] | 42 | #include <linux/usb/isp1362.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 43 | #endif |
Jeff Garzik | 0a87e3e | 2008-02-01 18:02:30 -0500 | [diff] [blame] | 44 | #include <linux/ata_platform.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 45 | #include <linux/irq.h> |
| 46 | #include <linux/interrupt.h> |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 47 | #include <linux/i2c.h> |
David Brownell | 27f5d75 | 2007-10-04 18:06:16 -0700 | [diff] [blame] | 48 | #include <linux/usb/sl811.h> |
Yi Li | f79ea4c | 2009-01-07 23:14:38 +0800 | [diff] [blame^] | 49 | #include <linux/spi/mmc_spi.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 50 | #include <asm/dma.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 51 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 52 | #include <asm/reboot.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 53 | #include <asm/portmux.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 54 | #include <asm/dpmc.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 55 | |
| 56 | /* |
| 57 | * Name the Board for the /proc/cpuinfo |
| 58 | */ |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 59 | const char bfin_board_name[] = "ADI BF537-STAMP"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 60 | |
| 61 | /* |
| 62 | * Driver needs to know address, irq and flag pin. |
| 63 | */ |
| 64 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 65 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 66 | #include <linux/usb/isp1760.h> |
| 67 | static struct resource bfin_isp1760_resources[] = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 68 | [0] = { |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 69 | .start = 0x203C0000, |
| 70 | .end = 0x203C0000 + 0x000fffff, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 71 | .flags = IORESOURCE_MEM, |
| 72 | }, |
| 73 | [1] = { |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 74 | .start = IRQ_PF7, |
| 75 | .end = IRQ_PF7, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 76 | .flags = IORESOURCE_IRQ, |
| 77 | }, |
| 78 | }; |
| 79 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 80 | static struct isp1760_platform_data isp1760_priv = { |
| 81 | .is_isp1761 = 0, |
| 82 | .port1_disable = 0, |
| 83 | .bus_width_16 = 1, |
| 84 | .port1_otg = 0, |
| 85 | .analog_oc = 0, |
| 86 | .dack_polarity_high = 0, |
| 87 | .dreq_polarity_high = 0, |
| 88 | }; |
| 89 | |
| 90 | static struct platform_device bfin_isp1760_device = { |
| 91 | .name = "isp1760-hcd", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 92 | .id = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 93 | .dev = { |
| 94 | .platform_data = &isp1760_priv, |
| 95 | }, |
| 96 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), |
| 97 | .resource = bfin_isp1760_resources, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 98 | }; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 99 | #endif |
| 100 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 101 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 102 | #include <linux/input.h> |
| 103 | #include <linux/gpio_keys.h> |
| 104 | |
| 105 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 106 | {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"}, |
| 107 | {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"}, |
| 108 | {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"}, |
| 109 | {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"}, |
| 110 | }; |
| 111 | |
| 112 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 113 | .buttons = bfin_gpio_keys_table, |
| 114 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 115 | }; |
| 116 | |
| 117 | static struct platform_device bfin_device_gpiokeys = { |
| 118 | .name = "gpio-keys", |
| 119 | .dev = { |
| 120 | .platform_data = &bfin_gpio_keys_data, |
| 121 | }, |
| 122 | }; |
| 123 | #endif |
| 124 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 125 | static struct resource bfin_gpios_resources = { |
| 126 | .start = 0, |
| 127 | .end = MAX_BLACKFIN_GPIOS - 1, |
| 128 | .flags = IORESOURCE_IRQ, |
| 129 | }; |
| 130 | |
| 131 | static struct platform_device bfin_gpios_device = { |
| 132 | .name = "simple-gpio", |
| 133 | .id = -1, |
| 134 | .num_resources = 1, |
| 135 | .resource = &bfin_gpios_resources, |
| 136 | }; |
| 137 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 138 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 139 | static struct resource bfin_pcmcia_cf_resources[] = { |
| 140 | { |
| 141 | .start = 0x20310000, /* IO PORT */ |
| 142 | .end = 0x20312000, |
| 143 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 144 | }, { |
Simon Arlott | d2d50aa | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 145 | .start = 0x20311000, /* Attribute Memory */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 146 | .end = 0x20311FFF, |
| 147 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 148 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 149 | .start = IRQ_PF4, |
| 150 | .end = IRQ_PF4, |
| 151 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 152 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 153 | .start = 6, /* Card Detect PF6 */ |
| 154 | .end = 6, |
| 155 | .flags = IORESOURCE_IRQ, |
| 156 | }, |
| 157 | }; |
| 158 | |
| 159 | static struct platform_device bfin_pcmcia_cf_device = { |
| 160 | .name = "bfin_cf_pcmcia", |
| 161 | .id = -1, |
| 162 | .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources), |
| 163 | .resource = bfin_pcmcia_cf_resources, |
| 164 | }; |
| 165 | #endif |
| 166 | |
| 167 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 168 | static struct platform_device rtc_device = { |
| 169 | .name = "rtc-bfin", |
| 170 | .id = -1, |
| 171 | }; |
| 172 | #endif |
| 173 | |
| 174 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 175 | static struct resource smc91x_resources[] = { |
| 176 | { |
| 177 | .name = "smc91x-regs", |
| 178 | .start = 0x20300300, |
| 179 | .end = 0x20300300 + 16, |
| 180 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 181 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 182 | |
| 183 | .start = IRQ_PF7, |
| 184 | .end = IRQ_PF7, |
| 185 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 186 | }, |
| 187 | }; |
| 188 | static struct platform_device smc91x_device = { |
| 189 | .name = "smc91x", |
| 190 | .id = 0, |
| 191 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 192 | .resource = smc91x_resources, |
| 193 | }; |
| 194 | #endif |
| 195 | |
Alex Landau | f40d24d | 2007-07-12 12:11:48 +0800 | [diff] [blame] | 196 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 197 | static struct resource dm9000_resources[] = { |
| 198 | [0] = { |
| 199 | .start = 0x203FB800, |
| 200 | .end = 0x203FB800 + 8, |
| 201 | .flags = IORESOURCE_MEM, |
| 202 | }, |
| 203 | [1] = { |
| 204 | .start = IRQ_PF9, |
| 205 | .end = IRQ_PF9, |
| 206 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), |
| 207 | }, |
| 208 | }; |
| 209 | |
| 210 | static struct platform_device dm9000_device = { |
| 211 | .name = "dm9000", |
| 212 | .id = -1, |
| 213 | .num_resources = ARRAY_SIZE(dm9000_resources), |
| 214 | .resource = dm9000_resources, |
| 215 | }; |
| 216 | #endif |
| 217 | |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 218 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 219 | static struct resource ax88180_resources[] = { |
| 220 | [0] = { |
| 221 | .start = 0x20300000, |
| 222 | .end = 0x20300000 + 0x8000, |
| 223 | .flags = IORESOURCE_MEM, |
| 224 | }, |
| 225 | [1] = { |
| 226 | .start = IRQ_PF7, |
| 227 | .end = IRQ_PF7, |
| 228 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL), |
| 229 | }, |
| 230 | }; |
| 231 | |
| 232 | static struct platform_device ax88180_device = { |
| 233 | .name = "ax88180", |
| 234 | .id = -1, |
| 235 | .num_resources = ARRAY_SIZE(ax88180_resources), |
| 236 | .resource = ax88180_resources, |
| 237 | }; |
| 238 | #endif |
| 239 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 240 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
| 241 | static struct resource sl811_hcd_resources[] = { |
| 242 | { |
| 243 | .start = 0x20340000, |
| 244 | .end = 0x20340000, |
| 245 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 246 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 247 | .start = 0x20340004, |
| 248 | .end = 0x20340004, |
| 249 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 250 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 251 | .start = CONFIG_USB_SL811_BFIN_IRQ, |
| 252 | .end = CONFIG_USB_SL811_BFIN_IRQ, |
| 253 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 254 | }, |
| 255 | }; |
| 256 | |
| 257 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
| 258 | void sl811_port_power(struct device *dev, int is_on) |
| 259 | { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 260 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
Michael Hennerich | acbcd26 | 2008-01-22 18:36:20 +0800 | [diff] [blame] | 261 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 262 | } |
| 263 | #endif |
| 264 | |
| 265 | static struct sl811_platform_data sl811_priv = { |
| 266 | .potpg = 10, |
| 267 | .power = 250, /* == 500mA */ |
| 268 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
| 269 | .port_power = &sl811_port_power, |
| 270 | #endif |
| 271 | }; |
| 272 | |
| 273 | static struct platform_device sl811_hcd_device = { |
| 274 | .name = "sl811-hcd", |
| 275 | .id = 0, |
| 276 | .dev = { |
| 277 | .platform_data = &sl811_priv, |
| 278 | }, |
| 279 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), |
| 280 | .resource = sl811_hcd_resources, |
| 281 | }; |
| 282 | #endif |
| 283 | |
| 284 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 285 | static struct resource isp1362_hcd_resources[] = { |
| 286 | { |
| 287 | .start = 0x20360000, |
| 288 | .end = 0x20360000, |
| 289 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 290 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 291 | .start = 0x20360004, |
| 292 | .end = 0x20360004, |
| 293 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 294 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 295 | .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
| 296 | .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
| 297 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 298 | }, |
| 299 | }; |
| 300 | |
| 301 | static struct isp1362_platform_data isp1362_priv = { |
| 302 | .sel15Kres = 1, |
| 303 | .clknotstop = 0, |
| 304 | .oc_enable = 0, |
| 305 | .int_act_high = 0, |
| 306 | .int_edge_triggered = 0, |
| 307 | .remote_wakeup_connected = 0, |
| 308 | .no_power_switching = 1, |
| 309 | .power_switching_mode = 0, |
| 310 | }; |
| 311 | |
| 312 | static struct platform_device isp1362_hcd_device = { |
| 313 | .name = "isp1362-hcd", |
| 314 | .id = 0, |
| 315 | .dev = { |
| 316 | .platform_data = &isp1362_priv, |
| 317 | }, |
| 318 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), |
| 319 | .resource = isp1362_hcd_resources, |
| 320 | }; |
| 321 | #endif |
| 322 | |
| 323 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
| 324 | static struct platform_device bfin_mac_device = { |
| 325 | .name = "bfin_mac", |
| 326 | }; |
| 327 | #endif |
| 328 | |
| 329 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 330 | static struct resource net2272_bfin_resources[] = { |
| 331 | { |
| 332 | .start = 0x20300000, |
| 333 | .end = 0x20300000 + 0x100, |
| 334 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 335 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 336 | .start = IRQ_PF7, |
| 337 | .end = IRQ_PF7, |
| 338 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 339 | }, |
| 340 | }; |
| 341 | |
| 342 | static struct platform_device net2272_bfin_device = { |
| 343 | .name = "net2272", |
| 344 | .id = -1, |
| 345 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 346 | .resource = net2272_bfin_resources, |
| 347 | }; |
| 348 | #endif |
| 349 | |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 350 | #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
| 351 | #ifdef CONFIG_MTD_PARTITIONS |
| 352 | const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; |
| 353 | |
| 354 | static struct mtd_partition bfin_plat_nand_partitions[] = { |
| 355 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 356 | .name = "linux kernel(nand)", |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 357 | .size = 0x400000, |
| 358 | .offset = 0, |
| 359 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 360 | .name = "file system(nand)", |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 361 | .size = MTDPART_SIZ_FULL, |
| 362 | .offset = MTDPART_OFS_APPEND, |
| 363 | }, |
| 364 | }; |
| 365 | #endif |
| 366 | |
| 367 | #define BFIN_NAND_PLAT_CLE 2 |
| 368 | #define BFIN_NAND_PLAT_ALE 1 |
| 369 | static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
| 370 | { |
| 371 | struct nand_chip *this = mtd->priv; |
| 372 | |
| 373 | if (cmd == NAND_CMD_NONE) |
| 374 | return; |
| 375 | |
| 376 | if (ctrl & NAND_CLE) |
| 377 | writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE)); |
| 378 | else |
| 379 | writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE)); |
| 380 | } |
| 381 | |
| 382 | #define BFIN_NAND_PLAT_READY GPIO_PF3 |
| 383 | static int bfin_plat_nand_dev_ready(struct mtd_info *mtd) |
| 384 | { |
| 385 | return gpio_get_value(BFIN_NAND_PLAT_READY); |
| 386 | } |
| 387 | |
| 388 | static struct platform_nand_data bfin_plat_nand_data = { |
| 389 | .chip = { |
| 390 | .chip_delay = 30, |
| 391 | #ifdef CONFIG_MTD_PARTITIONS |
| 392 | .part_probe_types = part_probes, |
| 393 | .partitions = bfin_plat_nand_partitions, |
| 394 | .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions), |
| 395 | #endif |
| 396 | }, |
| 397 | .ctrl = { |
| 398 | .cmd_ctrl = bfin_plat_nand_cmd_ctrl, |
| 399 | .dev_ready = bfin_plat_nand_dev_ready, |
| 400 | }, |
| 401 | }; |
| 402 | |
| 403 | #define MAX(x, y) (x > y ? x : y) |
| 404 | static struct resource bfin_plat_nand_resources = { |
| 405 | .start = 0x20212000, |
| 406 | .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)), |
| 407 | .flags = IORESOURCE_IO, |
| 408 | }; |
| 409 | |
| 410 | static struct platform_device bfin_async_nand_device = { |
| 411 | .name = "gen_nand", |
| 412 | .id = -1, |
| 413 | .num_resources = 1, |
| 414 | .resource = &bfin_plat_nand_resources, |
| 415 | .dev = { |
| 416 | .platform_data = &bfin_plat_nand_data, |
| 417 | }, |
| 418 | }; |
| 419 | |
| 420 | static void bfin_plat_nand_init(void) |
| 421 | { |
| 422 | gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat"); |
| 423 | } |
| 424 | #else |
| 425 | static void bfin_plat_nand_init(void) {} |
| 426 | #endif |
| 427 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 428 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 429 | static struct mtd_partition stamp_partitions[] = { |
| 430 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 431 | .name = "bootloader(nor)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 432 | .size = 0x40000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 433 | .offset = 0, |
| 434 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 435 | .name = "linux kernel(nor)", |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 436 | .size = 0xE0000, |
| 437 | .offset = MTDPART_OFS_APPEND, |
| 438 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 439 | .name = "file system(nor)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 440 | .size = 0x400000 - 0x40000 - 0xE0000 - 0x10000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 441 | .offset = MTDPART_OFS_APPEND, |
| 442 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 443 | .name = "MAC Address(nor)", |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 444 | .size = MTDPART_SIZ_FULL, |
| 445 | .offset = 0x3F0000, |
| 446 | .mask_flags = MTD_WRITEABLE, |
| 447 | } |
| 448 | }; |
| 449 | |
| 450 | static struct physmap_flash_data stamp_flash_data = { |
| 451 | .width = 2, |
| 452 | .parts = stamp_partitions, |
| 453 | .nr_parts = ARRAY_SIZE(stamp_partitions), |
| 454 | }; |
| 455 | |
| 456 | static struct resource stamp_flash_resource = { |
| 457 | .start = 0x20000000, |
| 458 | .end = 0x203fffff, |
| 459 | .flags = IORESOURCE_MEM, |
| 460 | }; |
| 461 | |
| 462 | static struct platform_device stamp_flash_device = { |
| 463 | .name = "physmap-flash", |
| 464 | .id = 0, |
| 465 | .dev = { |
| 466 | .platform_data = &stamp_flash_data, |
| 467 | }, |
| 468 | .num_resources = 1, |
| 469 | .resource = &stamp_flash_resource, |
| 470 | }; |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 471 | #endif |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 472 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 473 | #if defined(CONFIG_MTD_M25P80) \ |
| 474 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 475 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 476 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 477 | .name = "bootloader(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 478 | .size = 0x00040000, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 479 | .offset = 0, |
| 480 | .mask_flags = MTD_CAP_ROM |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 481 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 482 | .name = "linux kernel(spi)", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 483 | .size = 0xe0000, |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 484 | .offset = MTDPART_OFS_APPEND, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 485 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 486 | .name = "file system(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 487 | .size = MTDPART_SIZ_FULL, |
| 488 | .offset = MTDPART_OFS_APPEND, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 489 | } |
| 490 | }; |
| 491 | |
| 492 | static struct flash_platform_data bfin_spi_flash_data = { |
| 493 | .name = "m25p80", |
| 494 | .parts = bfin_spi_flash_partitions, |
| 495 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
Michael Hennerich | 88a8078b3 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 496 | /* .type = "m25p64", */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 497 | }; |
| 498 | |
| 499 | /* SPI flash chip (m25p64) */ |
| 500 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 501 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 502 | .bits_per_word = 8, |
| 503 | }; |
| 504 | #endif |
| 505 | |
| 506 | #if defined(CONFIG_SPI_ADC_BF533) \ |
| 507 | || defined(CONFIG_SPI_ADC_BF533_MODULE) |
| 508 | /* SPI ADC chip */ |
| 509 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
| 510 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 511 | .bits_per_word = 16, |
| 512 | }; |
| 513 | #endif |
| 514 | |
| 515 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 516 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 517 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 518 | .enable_dma = 0, |
| 519 | .bits_per_word = 16, |
| 520 | }; |
| 521 | #endif |
| 522 | |
| 523 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 524 | static struct bfin5xx_spi_chip ad9960_spi_chip_info = { |
| 525 | .enable_dma = 0, |
| 526 | .bits_per_word = 16, |
| 527 | }; |
| 528 | #endif |
| 529 | |
| 530 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) |
| 531 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { |
Yi Li | 4989dbc | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 532 | .enable_dma = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 533 | .bits_per_word = 8, |
| 534 | }; |
| 535 | #endif |
| 536 | |
Yi Li | f79ea4c | 2009-01-07 23:14:38 +0800 | [diff] [blame^] | 537 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 538 | #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 |
| 539 | |
| 540 | static int bfin_mmc_spi_init(struct device *dev, |
| 541 | irqreturn_t (*detect_int)(int, void *), void *data) |
| 542 | { |
| 543 | return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int, |
| 544 | IRQF_TRIGGER_FALLING, "mmc-spi-detect", data); |
| 545 | } |
| 546 | |
| 547 | static void bfin_mmc_spi_exit(struct device *dev, void *data) |
| 548 | { |
| 549 | free_irq(MMC_SPI_CARD_DETECT_INT, data); |
| 550 | } |
| 551 | |
| 552 | static struct mmc_spi_platform_data bfin_mmc_spi_pdata = { |
| 553 | .init = bfin_mmc_spi_init, |
| 554 | .exit = bfin_mmc_spi_exit, |
| 555 | .detect_delay = 100, /* msecs */ |
| 556 | }; |
| 557 | |
| 558 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
| 559 | .enable_dma = 0, |
| 560 | .bits_per_word = 8, |
| 561 | }; |
| 562 | #endif |
| 563 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 564 | #if defined(CONFIG_PBX) |
| 565 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { |
| 566 | .ctl_reg = 0x4, /* send zero */ |
| 567 | .enable_dma = 0, |
| 568 | .bits_per_word = 8, |
| 569 | .cs_change_per_word = 1, |
| 570 | }; |
| 571 | #endif |
| 572 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 573 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 574 | #include <linux/spi/ad7877.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 575 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 576 | .enable_dma = 0, |
| 577 | .bits_per_word = 16, |
| 578 | }; |
| 579 | |
| 580 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { |
| 581 | .model = 7877, |
| 582 | .vref_delay_usecs = 50, /* internal, no capacitor */ |
| 583 | .x_plate_ohms = 419, |
| 584 | .y_plate_ohms = 486, |
| 585 | .pressure_max = 1000, |
| 586 | .pressure_min = 0, |
| 587 | .stopacq_polarity = 1, |
| 588 | .first_conversion_delay = 3, |
| 589 | .acquisition_time = 1, |
| 590 | .averaging = 1, |
| 591 | .pen_down_acc_interval = 1, |
| 592 | }; |
| 593 | #endif |
| 594 | |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 595 | #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) |
| 596 | #include <linux/spi/ad7879.h> |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 597 | static const struct ad7879_platform_data bfin_ad7879_ts_info = { |
| 598 | .model = 7879, /* Model = AD7879 */ |
| 599 | .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */ |
| 600 | .pressure_max = 10000, |
| 601 | .pressure_min = 0, |
| 602 | .first_conversion_delay = 3, /* wait 512us before do a first conversion */ |
| 603 | .acquisition_time = 1, /* 4us acquisition time per sample */ |
| 604 | .median = 2, /* do 8 measurements */ |
| 605 | .averaging = 1, /* take the average of 4 middle samples */ |
| 606 | .pen_down_acc_interval = 255, /* 9.4 ms */ |
| 607 | .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */ |
| 608 | .gpio_default = 1, /* During initialization set GPIO = HIGH */ |
| 609 | }; |
| 610 | #endif |
| 611 | |
Michael Hennerich | f515015 | 2008-10-16 23:23:18 +0800 | [diff] [blame] | 612 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
| 613 | static struct bfin5xx_spi_chip spi_ad7879_chip_info = { |
| 614 | .enable_dma = 0, |
| 615 | .bits_per_word = 16, |
| 616 | }; |
| 617 | #endif |
| 618 | |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 619 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 620 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 621 | .enable_dma = 0, |
| 622 | .bits_per_word = 8, |
| 623 | }; |
| 624 | #endif |
| 625 | |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 626 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 627 | static struct bfin5xx_spi_chip lq035q1_spi_chip_info = { |
| 628 | .enable_dma = 0, |
| 629 | .bits_per_word = 8, |
| 630 | }; |
| 631 | #endif |
| 632 | |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 633 | #if defined(CONFIG_MTD_DATAFLASH) \ |
| 634 | || defined(CONFIG_MTD_DATAFLASH_MODULE) |
Michael Hennerich | ceac265 | 2008-08-25 17:39:11 +0800 | [diff] [blame] | 635 | |
| 636 | static struct mtd_partition bfin_spi_dataflash_partitions[] = { |
| 637 | { |
| 638 | .name = "bootloader(spi)", |
| 639 | .size = 0x00040000, |
| 640 | .offset = 0, |
| 641 | .mask_flags = MTD_CAP_ROM |
| 642 | }, { |
| 643 | .name = "linux kernel(spi)", |
| 644 | .size = 0xe0000, |
| 645 | .offset = MTDPART_OFS_APPEND, |
| 646 | }, { |
| 647 | .name = "file system(spi)", |
| 648 | .size = MTDPART_SIZ_FULL, |
| 649 | .offset = MTDPART_OFS_APPEND, |
| 650 | } |
| 651 | }; |
| 652 | |
| 653 | static struct flash_platform_data bfin_spi_dataflash_data = { |
| 654 | .name = "SPI Dataflash", |
| 655 | .parts = bfin_spi_dataflash_partitions, |
| 656 | .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions), |
| 657 | }; |
| 658 | |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 659 | /* DataFlash chip */ |
| 660 | static struct bfin5xx_spi_chip data_flash_chip_info = { |
| 661 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 662 | .bits_per_word = 8, |
| 663 | }; |
| 664 | #endif |
| 665 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 666 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 667 | #if defined(CONFIG_MTD_M25P80) \ |
| 668 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 669 | { |
| 670 | /* the modalias must be the same as spi device driver name */ |
| 671 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 672 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 673 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 674 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
| 675 | .platform_data = &bfin_spi_flash_data, |
| 676 | .controller_data = &spi_flash_chip_info, |
| 677 | .mode = SPI_MODE_3, |
| 678 | }, |
| 679 | #endif |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 680 | #if defined(CONFIG_MTD_DATAFLASH) \ |
| 681 | || defined(CONFIG_MTD_DATAFLASH_MODULE) |
| 682 | { /* DataFlash chip */ |
| 683 | .modalias = "mtd_dataflash", |
Michael Hennerich | ceac265 | 2008-08-25 17:39:11 +0800 | [diff] [blame] | 684 | .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */ |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 685 | .bus_num = 0, /* Framework bus number */ |
| 686 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
Michael Hennerich | ceac265 | 2008-08-25 17:39:11 +0800 | [diff] [blame] | 687 | .platform_data = &bfin_spi_dataflash_data, |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 688 | .controller_data = &data_flash_chip_info, |
| 689 | .mode = SPI_MODE_3, |
| 690 | }, |
| 691 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 692 | #if defined(CONFIG_SPI_ADC_BF533) \ |
| 693 | || defined(CONFIG_SPI_ADC_BF533_MODULE) |
| 694 | { |
| 695 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 696 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 697 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 698 | .chip_select = 1, /* Framework chip select. */ |
| 699 | .platform_data = NULL, /* No spi_driver specific config */ |
| 700 | .controller_data = &spi_adc_chip_info, |
| 701 | }, |
| 702 | #endif |
| 703 | |
| 704 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 705 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 706 | { |
| 707 | .modalias = "ad1836-spi", |
| 708 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 709 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 710 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 711 | .controller_data = &ad1836_spi_chip_info, |
| 712 | }, |
| 713 | #endif |
| 714 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 715 | { |
| 716 | .modalias = "ad9960-spi", |
| 717 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 718 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 719 | .chip_select = 1, |
| 720 | .controller_data = &ad9960_spi_chip_info, |
| 721 | }, |
| 722 | #endif |
| 723 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) |
| 724 | { |
| 725 | .modalias = "spi_mmc_dummy", |
Sonic Zhang | 111cf97 | 2007-10-30 11:48:42 +0800 | [diff] [blame] | 726 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 727 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 728 | .chip_select = 0, |
| 729 | .platform_data = NULL, |
| 730 | .controller_data = &spi_mmc_chip_info, |
| 731 | .mode = SPI_MODE_3, |
| 732 | }, |
| 733 | { |
| 734 | .modalias = "spi_mmc", |
Sonic Zhang | 111cf97 | 2007-10-30 11:48:42 +0800 | [diff] [blame] | 735 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 736 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 737 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, |
| 738 | .platform_data = NULL, |
| 739 | .controller_data = &spi_mmc_chip_info, |
| 740 | .mode = SPI_MODE_3, |
| 741 | }, |
| 742 | #endif |
Yi Li | f79ea4c | 2009-01-07 23:14:38 +0800 | [diff] [blame^] | 743 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 744 | { |
| 745 | .modalias = "mmc_spi", |
| 746 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 747 | .bus_num = 0, |
| 748 | .chip_select = 4, |
| 749 | .platform_data = &bfin_mmc_spi_pdata, |
| 750 | .controller_data = &mmc_spi_chip_info, |
| 751 | .mode = SPI_MODE_3, |
| 752 | }, |
| 753 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 754 | #if defined(CONFIG_PBX) |
| 755 | { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 756 | .modalias = "fxs-spi", |
| 757 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 758 | .bus_num = 0, |
| 759 | .chip_select = 8 - CONFIG_J11_JUMPER, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 760 | .controller_data = &spi_si3xxx_chip_info, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 761 | .mode = SPI_MODE_3, |
| 762 | }, |
| 763 | { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 764 | .modalias = "fxo-spi", |
| 765 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 766 | .bus_num = 0, |
| 767 | .chip_select = 8 - CONFIG_J19_JUMPER, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 768 | .controller_data = &spi_si3xxx_chip_info, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 769 | .mode = SPI_MODE_3, |
| 770 | }, |
| 771 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 772 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
| 773 | { |
| 774 | .modalias = "ad7877", |
| 775 | .platform_data = &bfin_ad7877_ts_info, |
| 776 | .irq = IRQ_PF6, |
| 777 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Michael Hennerich | c7d4896 | 2007-11-15 21:33:31 +0800 | [diff] [blame] | 778 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 779 | .chip_select = 1, |
| 780 | .controller_data = &spi_ad7877_chip_info, |
| 781 | }, |
| 782 | #endif |
Michael Hennerich | f515015 | 2008-10-16 23:23:18 +0800 | [diff] [blame] | 783 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 784 | { |
| 785 | .modalias = "ad7879", |
| 786 | .platform_data = &bfin_ad7879_ts_info, |
| 787 | .irq = IRQ_PF7, |
| 788 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ |
| 789 | .bus_num = 0, |
| 790 | .chip_select = 1, |
| 791 | .controller_data = &spi_ad7879_chip_info, |
| 792 | .mode = SPI_CPHA | SPI_CPOL, |
| 793 | }, |
| 794 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 795 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 796 | { |
| 797 | .modalias = "spidev", |
| 798 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 799 | .bus_num = 0, |
| 800 | .chip_select = 1, |
| 801 | .controller_data = &spidev_chip_info, |
| 802 | }, |
| 803 | #endif |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 804 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 805 | { |
| 806 | .modalias = "bfin-lq035q1-spi", |
| 807 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 808 | .bus_num = 0, |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 809 | .chip_select = 2, |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 810 | .controller_data = &lq035q1_spi_chip_info, |
| 811 | .mode = SPI_CPHA | SPI_CPOL, |
| 812 | }, |
| 813 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 814 | }; |
| 815 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 816 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 817 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 818 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 819 | .num_chipselect = 8, |
| 820 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 821 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 822 | }; |
| 823 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 824 | /* SPI (0) */ |
| 825 | static struct resource bfin_spi0_resource[] = { |
| 826 | [0] = { |
| 827 | .start = SPI0_REGBASE, |
| 828 | .end = SPI0_REGBASE + 0xFF, |
| 829 | .flags = IORESOURCE_MEM, |
| 830 | }, |
| 831 | [1] = { |
| 832 | .start = CH_SPI, |
| 833 | .end = CH_SPI, |
| 834 | .flags = IORESOURCE_IRQ, |
| 835 | }, |
| 836 | }; |
| 837 | |
| 838 | static struct platform_device bfin_spi0_device = { |
| 839 | .name = "bfin-spi", |
| 840 | .id = 0, /* Bus number */ |
| 841 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 842 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 843 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 844 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 845 | }, |
| 846 | }; |
| 847 | #endif /* spi master and devices */ |
| 848 | |
| 849 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
| 850 | static struct platform_device bfin_fb_device = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 851 | .name = "bf537-lq035", |
| 852 | }; |
| 853 | #endif |
| 854 | |
| 855 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 856 | static struct platform_device bfin_fb_adv7393_device = { |
| 857 | .name = "bfin-adv7393", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 858 | }; |
| 859 | #endif |
| 860 | |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 861 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 862 | #include <asm/bfin-lq035q1.h> |
| 863 | |
| 864 | static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { |
| 865 | .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB, |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 866 | .use_bl = 0, /* let something else control the LCD Blacklight */ |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 867 | .gpio_bl = GPIO_PF7, |
| 868 | }; |
| 869 | |
| 870 | static struct resource bfin_lq035q1_resources[] = { |
| 871 | { |
| 872 | .start = IRQ_PPI_ERROR, |
| 873 | .end = IRQ_PPI_ERROR, |
| 874 | .flags = IORESOURCE_IRQ, |
| 875 | }, |
| 876 | }; |
| 877 | |
| 878 | static struct platform_device bfin_lq035q1_device = { |
| 879 | .name = "bfin-lq035q1", |
| 880 | .id = -1, |
| 881 | .num_resources = ARRAY_SIZE(bfin_lq035q1_resources), |
| 882 | .resource = bfin_lq035q1_resources, |
| 883 | .dev = { |
| 884 | .platform_data = &bfin_lq035q1_data, |
| 885 | }, |
| 886 | }; |
| 887 | #endif |
| 888 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 889 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 890 | static struct resource bfin_uart_resources[] = { |
Sonic Zhang | 233b28a | 2007-11-21 17:04:41 +0800 | [diff] [blame] | 891 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 892 | { |
| 893 | .start = 0xFFC00400, |
| 894 | .end = 0xFFC004FF, |
| 895 | .flags = IORESOURCE_MEM, |
Sonic Zhang | 233b28a | 2007-11-21 17:04:41 +0800 | [diff] [blame] | 896 | }, |
| 897 | #endif |
| 898 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 899 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 900 | .start = 0xFFC02000, |
| 901 | .end = 0xFFC020FF, |
| 902 | .flags = IORESOURCE_MEM, |
| 903 | }, |
Sonic Zhang | 233b28a | 2007-11-21 17:04:41 +0800 | [diff] [blame] | 904 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 905 | }; |
| 906 | |
| 907 | static struct platform_device bfin_uart_device = { |
| 908 | .name = "bfin-uart", |
| 909 | .id = 1, |
| 910 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 911 | .resource = bfin_uart_resources, |
| 912 | }; |
| 913 | #endif |
| 914 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 915 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 916 | static struct resource bfin_sir_resources[] = { |
| 917 | #ifdef CONFIG_BFIN_SIR0 |
| 918 | { |
| 919 | .start = 0xFFC00400, |
| 920 | .end = 0xFFC004FF, |
| 921 | .flags = IORESOURCE_MEM, |
| 922 | }, |
| 923 | #endif |
| 924 | #ifdef CONFIG_BFIN_SIR1 |
| 925 | { |
| 926 | .start = 0xFFC02000, |
| 927 | .end = 0xFFC020FF, |
| 928 | .flags = IORESOURCE_MEM, |
| 929 | }, |
| 930 | #endif |
| 931 | }; |
| 932 | |
| 933 | static struct platform_device bfin_sir_device = { |
| 934 | .name = "bfin_sir", |
| 935 | .id = 0, |
| 936 | .num_resources = ARRAY_SIZE(bfin_sir_resources), |
| 937 | .resource = bfin_sir_resources, |
| 938 | }; |
| 939 | #endif |
| 940 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 941 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 942 | static struct resource bfin_twi0_resource[] = { |
| 943 | [0] = { |
| 944 | .start = TWI0_REGBASE, |
| 945 | .end = TWI0_REGBASE, |
| 946 | .flags = IORESOURCE_MEM, |
| 947 | }, |
| 948 | [1] = { |
| 949 | .start = IRQ_TWI, |
| 950 | .end = IRQ_TWI, |
| 951 | .flags = IORESOURCE_IRQ, |
| 952 | }, |
| 953 | }; |
| 954 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 955 | static struct platform_device i2c_bfin_twi_device = { |
| 956 | .name = "i2c-bfin-twi", |
| 957 | .id = 0, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 958 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 959 | .resource = bfin_twi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 960 | }; |
| 961 | #endif |
| 962 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 963 | #ifdef CONFIG_I2C_BOARDINFO |
| 964 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
| 965 | #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) |
| 966 | { |
| 967 | I2C_BOARD_INFO("ad7142_joystick", 0x2C), |
Michael Hennerich | f515015 | 2008-10-16 23:23:18 +0800 | [diff] [blame] | 968 | .irq = IRQ_PF5, |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 969 | }, |
| 970 | #endif |
| 971 | #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) |
| 972 | { |
| 973 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 974 | }, |
| 975 | #endif |
| 976 | #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) |
| 977 | { |
| 978 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), |
Michael Hennerich | f515015 | 2008-10-16 23:23:18 +0800 | [diff] [blame] | 979 | .irq = IRQ_PG6, |
| 980 | }, |
| 981 | #endif |
| 982 | #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE) |
| 983 | { |
| 984 | I2C_BOARD_INFO("ad7879", 0x2F), |
| 985 | .irq = IRQ_PG5, |
| 986 | .platform_data = (void *)&bfin_ad7879_ts_info, |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 987 | }, |
| 988 | #endif |
| 989 | }; |
| 990 | #endif |
| 991 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 992 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 993 | static struct platform_device bfin_sport0_uart_device = { |
| 994 | .name = "bfin-sport-uart", |
| 995 | .id = 0, |
| 996 | }; |
| 997 | |
| 998 | static struct platform_device bfin_sport1_uart_device = { |
| 999 | .name = "bfin-sport-uart", |
| 1000 | .id = 1, |
| 1001 | }; |
| 1002 | #endif |
| 1003 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1004 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
Mike Frysinger | 96b86e9 | 2008-07-14 16:39:43 +0800 | [diff] [blame] | 1005 | #define PATA_INT IRQ_PF5 |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1006 | |
| 1007 | static struct pata_platform_info bfin_pata_platform_data = { |
| 1008 | .ioport_shift = 1, |
Mike Frysinger | 64e5c51 | 2007-10-30 11:56:13 +0800 | [diff] [blame] | 1009 | .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1010 | }; |
| 1011 | |
| 1012 | static struct resource bfin_pata_resources[] = { |
| 1013 | { |
| 1014 | .start = 0x20314020, |
| 1015 | .end = 0x2031403F, |
| 1016 | .flags = IORESOURCE_MEM, |
| 1017 | }, |
| 1018 | { |
| 1019 | .start = 0x2031401C, |
| 1020 | .end = 0x2031401F, |
| 1021 | .flags = IORESOURCE_MEM, |
| 1022 | }, |
| 1023 | { |
| 1024 | .start = PATA_INT, |
| 1025 | .end = PATA_INT, |
| 1026 | .flags = IORESOURCE_IRQ, |
| 1027 | }, |
| 1028 | }; |
| 1029 | |
| 1030 | static struct platform_device bfin_pata_device = { |
| 1031 | .name = "pata_platform", |
| 1032 | .id = -1, |
| 1033 | .num_resources = ARRAY_SIZE(bfin_pata_resources), |
| 1034 | .resource = bfin_pata_resources, |
| 1035 | .dev = { |
| 1036 | .platform_data = &bfin_pata_platform_data, |
| 1037 | } |
| 1038 | }; |
| 1039 | #endif |
| 1040 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1041 | static const unsigned int cclk_vlev_datasheet[] = |
| 1042 | { |
| 1043 | VRPAIR(VLEV_085, 250000000), |
| 1044 | VRPAIR(VLEV_090, 376000000), |
| 1045 | VRPAIR(VLEV_095, 426000000), |
| 1046 | VRPAIR(VLEV_100, 426000000), |
| 1047 | VRPAIR(VLEV_105, 476000000), |
| 1048 | VRPAIR(VLEV_110, 476000000), |
| 1049 | VRPAIR(VLEV_115, 476000000), |
| 1050 | VRPAIR(VLEV_120, 500000000), |
| 1051 | VRPAIR(VLEV_125, 533000000), |
| 1052 | VRPAIR(VLEV_130, 600000000), |
| 1053 | }; |
| 1054 | |
| 1055 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 1056 | .tuple_tab = cclk_vlev_datasheet, |
| 1057 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 1058 | .vr_settling_time = 25 /* us */, |
| 1059 | }; |
| 1060 | |
| 1061 | static struct platform_device bfin_dpmc = { |
| 1062 | .name = "bfin dpmc", |
| 1063 | .dev = { |
| 1064 | .platform_data = &bfin_dmpc_vreg_data, |
| 1065 | }, |
| 1066 | }; |
| 1067 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1068 | static struct platform_device *stamp_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1069 | |
| 1070 | &bfin_dpmc, |
| 1071 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1072 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 1073 | &bfin_pcmcia_cf_device, |
| 1074 | #endif |
| 1075 | |
| 1076 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 1077 | &rtc_device, |
| 1078 | #endif |
| 1079 | |
| 1080 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
| 1081 | &sl811_hcd_device, |
| 1082 | #endif |
| 1083 | |
| 1084 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 1085 | &isp1362_hcd_device, |
| 1086 | #endif |
| 1087 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 1088 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 1089 | &bfin_isp1760_device, |
| 1090 | #endif |
| 1091 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1092 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 1093 | &smc91x_device, |
| 1094 | #endif |
| 1095 | |
Alex Landau | f40d24d | 2007-07-12 12:11:48 +0800 | [diff] [blame] | 1096 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 1097 | &dm9000_device, |
| 1098 | #endif |
| 1099 | |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 1100 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 1101 | &ax88180_device, |
| 1102 | #endif |
| 1103 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1104 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
| 1105 | &bfin_mac_device, |
| 1106 | #endif |
| 1107 | |
| 1108 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 1109 | &net2272_bfin_device, |
| 1110 | #endif |
| 1111 | |
| 1112 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1113 | &bfin_spi0_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1114 | #endif |
| 1115 | |
| 1116 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
| 1117 | &bfin_fb_device, |
| 1118 | #endif |
| 1119 | |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 1120 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 1121 | &bfin_lq035q1_device, |
| 1122 | #endif |
| 1123 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1124 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 1125 | &bfin_fb_adv7393_device, |
| 1126 | #endif |
| 1127 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1128 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 1129 | &bfin_uart_device, |
| 1130 | #endif |
| 1131 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1132 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 1133 | &bfin_sir_device, |
| 1134 | #endif |
| 1135 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1136 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 1137 | &i2c_bfin_twi_device, |
| 1138 | #endif |
| 1139 | |
| 1140 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 1141 | &bfin_sport0_uart_device, |
| 1142 | &bfin_sport1_uart_device, |
| 1143 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1144 | |
| 1145 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 1146 | &bfin_pata_device, |
| 1147 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 1148 | |
| 1149 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 1150 | &bfin_device_gpiokeys, |
| 1151 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 1152 | |
| 1153 | &bfin_gpios_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1154 | |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 1155 | #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
| 1156 | &bfin_async_nand_device, |
| 1157 | #endif |
| 1158 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1159 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 1160 | &stamp_flash_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1161 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1162 | }; |
| 1163 | |
| 1164 | static int __init stamp_init(void) |
| 1165 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 1166 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1167 | |
| 1168 | #ifdef CONFIG_I2C_BOARDINFO |
| 1169 | i2c_register_board_info(0, bfin_i2c_board_info, |
| 1170 | ARRAY_SIZE(bfin_i2c_board_info)); |
| 1171 | #endif |
| 1172 | |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 1173 | bfin_plat_nand_init(); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1174 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1175 | 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] | 1176 | |
| 1177 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 1178 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; |
| 1179 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1180 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1181 | return 0; |
| 1182 | } |
| 1183 | |
| 1184 | arch_initcall(stamp_init); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1185 | |
| 1186 | void native_machine_restart(char *cmd) |
| 1187 | { |
| 1188 | /* workaround reboot hang when booting from SPI */ |
| 1189 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
| 1190 | bfin_gpio_reset_spi0_ssel1(); |
| 1191 | } |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1192 | |
| 1193 | /* |
| 1194 | * Currently the MAC address is saved in Flash by U-Boot |
| 1195 | */ |
| 1196 | #define FLASH_MAC 0x203f0000 |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1197 | void bfin_get_ether_addr(char *addr) |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1198 | { |
| 1199 | *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); |
| 1200 | *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); |
| 1201 | } |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1202 | EXPORT_SYMBOL(bfin_get_ether_addr); |