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, |
Michael Hennerich | 6a6be3d | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 76 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 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, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 82 | .bus_width_16 = 1, |
| 83 | .port1_otg = 0, |
| 84 | .analog_oc = 0, |
| 85 | .dack_polarity_high = 0, |
| 86 | .dreq_polarity_high = 0, |
| 87 | }; |
| 88 | |
| 89 | static struct platform_device bfin_isp1760_device = { |
| 90 | .name = "isp1760-hcd", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 91 | .id = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 92 | .dev = { |
| 93 | .platform_data = &isp1760_priv, |
| 94 | }, |
| 95 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), |
| 96 | .resource = bfin_isp1760_resources, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 97 | }; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 98 | #endif |
| 99 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 100 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 101 | #include <linux/input.h> |
| 102 | #include <linux/gpio_keys.h> |
| 103 | |
| 104 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 105 | {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"}, |
| 106 | {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"}, |
| 107 | {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"}, |
| 108 | {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"}, |
| 109 | }; |
| 110 | |
| 111 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 112 | .buttons = bfin_gpio_keys_table, |
| 113 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 114 | }; |
| 115 | |
| 116 | static struct platform_device bfin_device_gpiokeys = { |
| 117 | .name = "gpio-keys", |
| 118 | .dev = { |
| 119 | .platform_data = &bfin_gpio_keys_data, |
| 120 | }, |
| 121 | }; |
| 122 | #endif |
| 123 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 124 | static struct resource bfin_gpios_resources = { |
| 125 | .start = 0, |
| 126 | .end = MAX_BLACKFIN_GPIOS - 1, |
| 127 | .flags = IORESOURCE_IRQ, |
| 128 | }; |
| 129 | |
| 130 | static struct platform_device bfin_gpios_device = { |
| 131 | .name = "simple-gpio", |
| 132 | .id = -1, |
| 133 | .num_resources = 1, |
| 134 | .resource = &bfin_gpios_resources, |
| 135 | }; |
| 136 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 137 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 138 | static struct resource bfin_pcmcia_cf_resources[] = { |
| 139 | { |
| 140 | .start = 0x20310000, /* IO PORT */ |
| 141 | .end = 0x20312000, |
| 142 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 143 | }, { |
Simon Arlott | d2d50aa | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 144 | .start = 0x20311000, /* Attribute Memory */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 145 | .end = 0x20311FFF, |
| 146 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 147 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 148 | .start = IRQ_PF4, |
| 149 | .end = IRQ_PF4, |
| 150 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 151 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 152 | .start = 6, /* Card Detect PF6 */ |
| 153 | .end = 6, |
| 154 | .flags = IORESOURCE_IRQ, |
| 155 | }, |
| 156 | }; |
| 157 | |
| 158 | static struct platform_device bfin_pcmcia_cf_device = { |
| 159 | .name = "bfin_cf_pcmcia", |
| 160 | .id = -1, |
| 161 | .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources), |
| 162 | .resource = bfin_pcmcia_cf_resources, |
| 163 | }; |
| 164 | #endif |
| 165 | |
| 166 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 167 | static struct platform_device rtc_device = { |
| 168 | .name = "rtc-bfin", |
| 169 | .id = -1, |
| 170 | }; |
| 171 | #endif |
| 172 | |
| 173 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame^] | 174 | #include <linux/smc91x.h> |
| 175 | |
| 176 | static struct smc91x_platdata smc91x_info = { |
| 177 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 178 | .leda = RPC_LED_100_10, |
| 179 | .ledb = RPC_LED_TX_RX, |
| 180 | }; |
| 181 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 182 | static struct resource smc91x_resources[] = { |
| 183 | { |
| 184 | .name = "smc91x-regs", |
| 185 | .start = 0x20300300, |
| 186 | .end = 0x20300300 + 16, |
| 187 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 188 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 189 | |
| 190 | .start = IRQ_PF7, |
| 191 | .end = IRQ_PF7, |
| 192 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 193 | }, |
| 194 | }; |
| 195 | static struct platform_device smc91x_device = { |
| 196 | .name = "smc91x", |
| 197 | .id = 0, |
| 198 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 199 | .resource = smc91x_resources, |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame^] | 200 | .dev = { |
| 201 | .platform_data = &smc91x_info, |
| 202 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 203 | }; |
| 204 | #endif |
| 205 | |
Alex Landau | f40d24d | 2007-07-12 12:11:48 +0800 | [diff] [blame] | 206 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 207 | static struct resource dm9000_resources[] = { |
| 208 | [0] = { |
| 209 | .start = 0x203FB800, |
| 210 | .end = 0x203FB800 + 8, |
| 211 | .flags = IORESOURCE_MEM, |
| 212 | }, |
| 213 | [1] = { |
| 214 | .start = IRQ_PF9, |
| 215 | .end = IRQ_PF9, |
| 216 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), |
| 217 | }, |
| 218 | }; |
| 219 | |
| 220 | static struct platform_device dm9000_device = { |
| 221 | .name = "dm9000", |
| 222 | .id = -1, |
| 223 | .num_resources = ARRAY_SIZE(dm9000_resources), |
| 224 | .resource = dm9000_resources, |
| 225 | }; |
| 226 | #endif |
| 227 | |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 228 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 229 | static struct resource ax88180_resources[] = { |
| 230 | [0] = { |
| 231 | .start = 0x20300000, |
| 232 | .end = 0x20300000 + 0x8000, |
| 233 | .flags = IORESOURCE_MEM, |
| 234 | }, |
| 235 | [1] = { |
| 236 | .start = IRQ_PF7, |
| 237 | .end = IRQ_PF7, |
| 238 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL), |
| 239 | }, |
| 240 | }; |
| 241 | |
| 242 | static struct platform_device ax88180_device = { |
| 243 | .name = "ax88180", |
| 244 | .id = -1, |
| 245 | .num_resources = ARRAY_SIZE(ax88180_resources), |
| 246 | .resource = ax88180_resources, |
| 247 | }; |
| 248 | #endif |
| 249 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 250 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
| 251 | static struct resource sl811_hcd_resources[] = { |
| 252 | { |
| 253 | .start = 0x20340000, |
| 254 | .end = 0x20340000, |
| 255 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 256 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 257 | .start = 0x20340004, |
| 258 | .end = 0x20340004, |
| 259 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 260 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 261 | .start = CONFIG_USB_SL811_BFIN_IRQ, |
| 262 | .end = CONFIG_USB_SL811_BFIN_IRQ, |
| 263 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 264 | }, |
| 265 | }; |
| 266 | |
| 267 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
| 268 | void sl811_port_power(struct device *dev, int is_on) |
| 269 | { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 270 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
Michael Hennerich | acbcd26 | 2008-01-22 18:36:20 +0800 | [diff] [blame] | 271 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 272 | } |
| 273 | #endif |
| 274 | |
| 275 | static struct sl811_platform_data sl811_priv = { |
| 276 | .potpg = 10, |
| 277 | .power = 250, /* == 500mA */ |
| 278 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
| 279 | .port_power = &sl811_port_power, |
| 280 | #endif |
| 281 | }; |
| 282 | |
| 283 | static struct platform_device sl811_hcd_device = { |
| 284 | .name = "sl811-hcd", |
| 285 | .id = 0, |
| 286 | .dev = { |
| 287 | .platform_data = &sl811_priv, |
| 288 | }, |
| 289 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), |
| 290 | .resource = sl811_hcd_resources, |
| 291 | }; |
| 292 | #endif |
| 293 | |
| 294 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 295 | static struct resource isp1362_hcd_resources[] = { |
| 296 | { |
| 297 | .start = 0x20360000, |
| 298 | .end = 0x20360000, |
| 299 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 300 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 301 | .start = 0x20360004, |
| 302 | .end = 0x20360004, |
| 303 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 304 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 305 | .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
| 306 | .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
| 307 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 308 | }, |
| 309 | }; |
| 310 | |
| 311 | static struct isp1362_platform_data isp1362_priv = { |
| 312 | .sel15Kres = 1, |
| 313 | .clknotstop = 0, |
| 314 | .oc_enable = 0, |
| 315 | .int_act_high = 0, |
| 316 | .int_edge_triggered = 0, |
| 317 | .remote_wakeup_connected = 0, |
| 318 | .no_power_switching = 1, |
| 319 | .power_switching_mode = 0, |
| 320 | }; |
| 321 | |
| 322 | static struct platform_device isp1362_hcd_device = { |
| 323 | .name = "isp1362-hcd", |
| 324 | .id = 0, |
| 325 | .dev = { |
| 326 | .platform_data = &isp1362_priv, |
| 327 | }, |
| 328 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), |
| 329 | .resource = isp1362_hcd_resources, |
| 330 | }; |
| 331 | #endif |
| 332 | |
| 333 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 334 | static struct platform_device bfin_mii_bus = { |
| 335 | .name = "bfin_mii_bus", |
| 336 | }; |
| 337 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 338 | static struct platform_device bfin_mac_device = { |
| 339 | .name = "bfin_mac", |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 340 | .dev.platform_data = &bfin_mii_bus, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 341 | }; |
| 342 | #endif |
| 343 | |
| 344 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 345 | static struct resource net2272_bfin_resources[] = { |
| 346 | { |
| 347 | .start = 0x20300000, |
| 348 | .end = 0x20300000 + 0x100, |
| 349 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 350 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 351 | .start = IRQ_PF7, |
| 352 | .end = IRQ_PF7, |
| 353 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 354 | }, |
| 355 | }; |
| 356 | |
| 357 | static struct platform_device net2272_bfin_device = { |
| 358 | .name = "net2272", |
| 359 | .id = -1, |
| 360 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 361 | .resource = net2272_bfin_resources, |
| 362 | }; |
| 363 | #endif |
| 364 | |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 365 | #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
| 366 | #ifdef CONFIG_MTD_PARTITIONS |
| 367 | const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; |
| 368 | |
| 369 | static struct mtd_partition bfin_plat_nand_partitions[] = { |
| 370 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 371 | .name = "linux kernel(nand)", |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 372 | .size = 0x400000, |
| 373 | .offset = 0, |
| 374 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 375 | .name = "file system(nand)", |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 376 | .size = MTDPART_SIZ_FULL, |
| 377 | .offset = MTDPART_OFS_APPEND, |
| 378 | }, |
| 379 | }; |
| 380 | #endif |
| 381 | |
| 382 | #define BFIN_NAND_PLAT_CLE 2 |
| 383 | #define BFIN_NAND_PLAT_ALE 1 |
| 384 | static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
| 385 | { |
| 386 | struct nand_chip *this = mtd->priv; |
| 387 | |
| 388 | if (cmd == NAND_CMD_NONE) |
| 389 | return; |
| 390 | |
| 391 | if (ctrl & NAND_CLE) |
| 392 | writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE)); |
| 393 | else |
| 394 | writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE)); |
| 395 | } |
| 396 | |
| 397 | #define BFIN_NAND_PLAT_READY GPIO_PF3 |
| 398 | static int bfin_plat_nand_dev_ready(struct mtd_info *mtd) |
| 399 | { |
| 400 | return gpio_get_value(BFIN_NAND_PLAT_READY); |
| 401 | } |
| 402 | |
| 403 | static struct platform_nand_data bfin_plat_nand_data = { |
| 404 | .chip = { |
| 405 | .chip_delay = 30, |
| 406 | #ifdef CONFIG_MTD_PARTITIONS |
| 407 | .part_probe_types = part_probes, |
| 408 | .partitions = bfin_plat_nand_partitions, |
| 409 | .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions), |
| 410 | #endif |
| 411 | }, |
| 412 | .ctrl = { |
| 413 | .cmd_ctrl = bfin_plat_nand_cmd_ctrl, |
| 414 | .dev_ready = bfin_plat_nand_dev_ready, |
| 415 | }, |
| 416 | }; |
| 417 | |
| 418 | #define MAX(x, y) (x > y ? x : y) |
| 419 | static struct resource bfin_plat_nand_resources = { |
| 420 | .start = 0x20212000, |
| 421 | .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)), |
| 422 | .flags = IORESOURCE_IO, |
| 423 | }; |
| 424 | |
| 425 | static struct platform_device bfin_async_nand_device = { |
| 426 | .name = "gen_nand", |
| 427 | .id = -1, |
| 428 | .num_resources = 1, |
| 429 | .resource = &bfin_plat_nand_resources, |
| 430 | .dev = { |
| 431 | .platform_data = &bfin_plat_nand_data, |
| 432 | }, |
| 433 | }; |
| 434 | |
| 435 | static void bfin_plat_nand_init(void) |
| 436 | { |
| 437 | gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat"); |
| 438 | } |
| 439 | #else |
| 440 | static void bfin_plat_nand_init(void) {} |
| 441 | #endif |
| 442 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 443 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 444 | static struct mtd_partition stamp_partitions[] = { |
| 445 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 446 | .name = "bootloader(nor)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 447 | .size = 0x40000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 448 | .offset = 0, |
| 449 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 450 | .name = "linux kernel(nor)", |
Grace Pan | 6ecb5b6 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 451 | .size = 0x180000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 452 | .offset = MTDPART_OFS_APPEND, |
| 453 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 454 | .name = "file system(nor)", |
Grace Pan | 6ecb5b6 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 455 | .size = 0x400000 - 0x40000 - 0x180000 - 0x10000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 456 | .offset = MTDPART_OFS_APPEND, |
| 457 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 458 | .name = "MAC Address(nor)", |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 459 | .size = MTDPART_SIZ_FULL, |
| 460 | .offset = 0x3F0000, |
| 461 | .mask_flags = MTD_WRITEABLE, |
| 462 | } |
| 463 | }; |
| 464 | |
| 465 | static struct physmap_flash_data stamp_flash_data = { |
| 466 | .width = 2, |
| 467 | .parts = stamp_partitions, |
| 468 | .nr_parts = ARRAY_SIZE(stamp_partitions), |
| 469 | }; |
| 470 | |
| 471 | static struct resource stamp_flash_resource = { |
| 472 | .start = 0x20000000, |
| 473 | .end = 0x203fffff, |
| 474 | .flags = IORESOURCE_MEM, |
| 475 | }; |
| 476 | |
| 477 | static struct platform_device stamp_flash_device = { |
| 478 | .name = "physmap-flash", |
| 479 | .id = 0, |
| 480 | .dev = { |
| 481 | .platform_data = &stamp_flash_data, |
| 482 | }, |
| 483 | .num_resources = 1, |
| 484 | .resource = &stamp_flash_resource, |
| 485 | }; |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 486 | #endif |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 487 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 488 | #if defined(CONFIG_MTD_M25P80) \ |
| 489 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 490 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 491 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 492 | .name = "bootloader(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 493 | .size = 0x00040000, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 494 | .offset = 0, |
| 495 | .mask_flags = MTD_CAP_ROM |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 496 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 497 | .name = "linux kernel(spi)", |
Grace Pan | 6ecb5b6 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 498 | .size = 0x180000, |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 499 | .offset = MTDPART_OFS_APPEND, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 500 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 501 | .name = "file system(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 502 | .size = MTDPART_SIZ_FULL, |
| 503 | .offset = MTDPART_OFS_APPEND, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 504 | } |
| 505 | }; |
| 506 | |
| 507 | static struct flash_platform_data bfin_spi_flash_data = { |
| 508 | .name = "m25p80", |
| 509 | .parts = bfin_spi_flash_partitions, |
| 510 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
Michael Hennerich | 88a8078b3 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 511 | /* .type = "m25p64", */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 512 | }; |
| 513 | |
| 514 | /* SPI flash chip (m25p64) */ |
| 515 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 516 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 517 | .bits_per_word = 8, |
| 518 | }; |
| 519 | #endif |
| 520 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 521 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
| 522 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 523 | /* SPI ADC chip */ |
| 524 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
| 525 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 526 | .bits_per_word = 16, |
| 527 | }; |
| 528 | #endif |
| 529 | |
| 530 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 531 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 532 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 533 | .enable_dma = 0, |
| 534 | .bits_per_word = 16, |
| 535 | }; |
| 536 | #endif |
| 537 | |
Barry Song | d4b834c | 2009-06-04 10:14:17 +0000 | [diff] [blame] | 538 | #if defined(CONFIG_SND_BF5XX_SOC_AD1938) \ |
| 539 | || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE) |
| 540 | static struct bfin5xx_spi_chip ad1938_spi_chip_info = { |
| 541 | .enable_dma = 0, |
| 542 | .bits_per_word = 8, |
| 543 | .cs_gpio = GPIO_PF5, |
| 544 | }; |
| 545 | #endif |
| 546 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 547 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 548 | static struct bfin5xx_spi_chip ad9960_spi_chip_info = { |
| 549 | .enable_dma = 0, |
| 550 | .bits_per_word = 16, |
| 551 | }; |
| 552 | #endif |
| 553 | |
Barry Song | 427f277 | 2009-07-17 07:04:55 +0000 | [diff] [blame] | 554 | #if defined(CONFIG_INPUT_EVAL_AD7147EBZ) |
| 555 | #include <linux/input.h> |
| 556 | #include <linux/input/ad714x.h> |
| 557 | static struct bfin5xx_spi_chip ad7147_spi_chip_info = { |
| 558 | .enable_dma = 0, |
| 559 | .bits_per_word = 16, |
| 560 | }; |
| 561 | |
| 562 | static struct ad714x_slider_plat slider_plat[] = { |
| 563 | { |
| 564 | .start_stage = 0, |
| 565 | .end_stage = 7, |
| 566 | .max_coord = 128, |
| 567 | }, |
| 568 | }; |
| 569 | |
| 570 | static struct ad714x_button_plat button_plat[] = { |
| 571 | { |
| 572 | .keycode = BTN_FORWARD, |
| 573 | .l_mask = 0, |
| 574 | .h_mask = 0x600, |
| 575 | }, |
| 576 | { |
| 577 | .keycode = BTN_LEFT, |
| 578 | .l_mask = 0, |
| 579 | .h_mask = 0x500, |
| 580 | }, |
| 581 | { |
| 582 | .keycode = BTN_MIDDLE, |
| 583 | .l_mask = 0, |
| 584 | .h_mask = 0x800, |
| 585 | }, |
| 586 | { |
| 587 | .keycode = BTN_RIGHT, |
| 588 | .l_mask = 0x100, |
| 589 | .h_mask = 0x400, |
| 590 | }, |
| 591 | { |
| 592 | .keycode = BTN_BACK, |
| 593 | .l_mask = 0x200, |
| 594 | .h_mask = 0x400, |
| 595 | }, |
| 596 | }; |
| 597 | static struct ad714x_platform_data ad7147_platfrom_data = { |
| 598 | .slider_num = 1, |
| 599 | .button_num = 5, |
| 600 | .slider = slider_plat, |
| 601 | .button = button_plat, |
| 602 | .stage_cfg_reg = { |
| 603 | {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600}, |
| 604 | {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650}, |
| 605 | {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650}, |
| 606 | {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650}, |
| 607 | {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650}, |
| 608 | {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650}, |
| 609 | {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650}, |
| 610 | {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600}, |
| 611 | {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150}, |
| 612 | {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150}, |
| 613 | {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300}, |
| 614 | {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150}, |
| 615 | }, |
| 616 | .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0}, |
| 617 | }; |
| 618 | #endif |
| 619 | |
| 620 | #if defined(CONFIG_INPUT_EVAL_AD7142EB) |
| 621 | #include <linux/input.h> |
| 622 | #include <linux/input/ad714x.h> |
| 623 | static struct ad714x_button_plat button_plat[] = { |
| 624 | { |
| 625 | .keycode = BTN_1, |
| 626 | .l_mask = 0, |
| 627 | .h_mask = 0x1, |
| 628 | }, |
| 629 | { |
| 630 | .keycode = BTN_2, |
| 631 | .l_mask = 0, |
| 632 | .h_mask = 0x2, |
| 633 | }, |
| 634 | { |
| 635 | .keycode = BTN_3, |
| 636 | .l_mask = 0, |
| 637 | .h_mask = 0x4, |
| 638 | }, |
| 639 | { |
| 640 | .keycode = BTN_4, |
| 641 | .l_mask = 0x0, |
| 642 | .h_mask = 0x8, |
| 643 | }, |
| 644 | }; |
| 645 | static struct ad714x_platform_data ad7142_platfrom_data = { |
| 646 | .button_num = 4, |
| 647 | .button = button_plat, |
| 648 | .stage_cfg_reg = { |
| 649 | /* fixme: figure out right setting for all comoponent according |
| 650 | * to hardware feature of EVAL-AD7142EB board */ |
| 651 | {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, |
| 652 | {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, |
| 653 | {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, |
| 654 | {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, |
| 655 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 656 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 657 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 658 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 659 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 660 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 661 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 662 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, |
| 663 | }, |
| 664 | .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0}, |
| 665 | }; |
| 666 | #endif |
| 667 | |
Yi Li | f79ea4c | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 668 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 669 | #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 |
| 670 | |
| 671 | static int bfin_mmc_spi_init(struct device *dev, |
| 672 | irqreturn_t (*detect_int)(int, void *), void *data) |
| 673 | { |
| 674 | return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int, |
| 675 | IRQF_TRIGGER_FALLING, "mmc-spi-detect", data); |
| 676 | } |
| 677 | |
| 678 | static void bfin_mmc_spi_exit(struct device *dev, void *data) |
| 679 | { |
| 680 | free_irq(MMC_SPI_CARD_DETECT_INT, data); |
| 681 | } |
| 682 | |
| 683 | static struct mmc_spi_platform_data bfin_mmc_spi_pdata = { |
| 684 | .init = bfin_mmc_spi_init, |
| 685 | .exit = bfin_mmc_spi_exit, |
| 686 | .detect_delay = 100, /* msecs */ |
| 687 | }; |
| 688 | |
| 689 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
| 690 | .enable_dma = 0, |
| 691 | .bits_per_word = 8, |
Yi Li | e68d1eb | 2009-06-03 09:46:22 +0000 | [diff] [blame] | 692 | .pio_interrupt = 0, |
Yi Li | f79ea4c | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 693 | }; |
| 694 | #endif |
| 695 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 696 | #if defined(CONFIG_PBX) |
| 697 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { |
| 698 | .ctl_reg = 0x4, /* send zero */ |
| 699 | .enable_dma = 0, |
| 700 | .bits_per_word = 8, |
| 701 | .cs_change_per_word = 1, |
| 702 | }; |
| 703 | #endif |
| 704 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 705 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 706 | #include <linux/spi/ad7877.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 707 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 708 | .enable_dma = 0, |
| 709 | .bits_per_word = 16, |
| 710 | }; |
| 711 | |
| 712 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { |
| 713 | .model = 7877, |
| 714 | .vref_delay_usecs = 50, /* internal, no capacitor */ |
| 715 | .x_plate_ohms = 419, |
| 716 | .y_plate_ohms = 486, |
| 717 | .pressure_max = 1000, |
| 718 | .pressure_min = 0, |
| 719 | .stopacq_polarity = 1, |
| 720 | .first_conversion_delay = 3, |
| 721 | .acquisition_time = 1, |
| 722 | .averaging = 1, |
| 723 | .pen_down_acc_interval = 1, |
| 724 | }; |
| 725 | #endif |
| 726 | |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 727 | #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) |
| 728 | #include <linux/spi/ad7879.h> |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 729 | static const struct ad7879_platform_data bfin_ad7879_ts_info = { |
| 730 | .model = 7879, /* Model = AD7879 */ |
| 731 | .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */ |
| 732 | .pressure_max = 10000, |
| 733 | .pressure_min = 0, |
| 734 | .first_conversion_delay = 3, /* wait 512us before do a first conversion */ |
| 735 | .acquisition_time = 1, /* 4us acquisition time per sample */ |
| 736 | .median = 2, /* do 8 measurements */ |
| 737 | .averaging = 1, /* take the average of 4 middle samples */ |
| 738 | .pen_down_acc_interval = 255, /* 9.4 ms */ |
| 739 | .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */ |
| 740 | .gpio_default = 1, /* During initialization set GPIO = HIGH */ |
| 741 | }; |
| 742 | #endif |
| 743 | |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 744 | #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) |
| 745 | #include <linux/input.h> |
| 746 | #include <linux/spi/adxl34x.h> |
| 747 | static const struct adxl34x_platform_data adxl34x_info = { |
| 748 | .x_axis_offset = 0, |
| 749 | .y_axis_offset = 0, |
| 750 | .z_axis_offset = 0, |
| 751 | .tap_threshold = 0x31, |
| 752 | .tap_duration = 0x10, |
| 753 | .tap_latency = 0x60, |
| 754 | .tap_window = 0xF0, |
| 755 | .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN, |
| 756 | .act_axis_control = 0xFF, |
| 757 | .activity_threshold = 5, |
| 758 | .inactivity_threshold = 3, |
| 759 | .inactivity_time = 4, |
| 760 | .free_fall_threshold = 0x7, |
| 761 | .free_fall_time = 0x20, |
| 762 | .data_rate = 0x8, |
| 763 | .data_range = ADXL_FULL_RES, |
| 764 | |
| 765 | .ev_type = EV_ABS, |
| 766 | .ev_code_x = ABS_X, /* EV_REL */ |
| 767 | .ev_code_y = ABS_Y, /* EV_REL */ |
| 768 | .ev_code_z = ABS_Z, /* EV_REL */ |
| 769 | |
| 770 | .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */ |
| 771 | .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */ |
| 772 | .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */ |
| 773 | |
| 774 | /* .ev_code_ff = KEY_F,*/ /* EV_KEY */ |
| 775 | /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */ |
| 776 | .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK, |
| 777 | .fifo_mode = ADXL_FIFO_STREAM, |
| 778 | }; |
| 779 | #endif |
| 780 | |
Michael Hennerich | f515015 | 2008-10-16 23:23:18 +0800 | [diff] [blame] | 781 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
| 782 | static struct bfin5xx_spi_chip spi_ad7879_chip_info = { |
| 783 | .enable_dma = 0, |
| 784 | .bits_per_word = 16, |
| 785 | }; |
| 786 | #endif |
| 787 | |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 788 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 789 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 790 | .enable_dma = 0, |
| 791 | .bits_per_word = 8, |
| 792 | }; |
| 793 | #endif |
| 794 | |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 795 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 796 | static struct bfin5xx_spi_chip lq035q1_spi_chip_info = { |
| 797 | .enable_dma = 0, |
| 798 | .bits_per_word = 8, |
| 799 | }; |
| 800 | #endif |
| 801 | |
Michael Hennerich | 85a192e | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 802 | #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) |
| 803 | static struct bfin5xx_spi_chip enc28j60_spi_chip_info = { |
| 804 | .enable_dma = 1, |
| 805 | .bits_per_word = 8, |
| 806 | .cs_gpio = GPIO_PF10, |
| 807 | }; |
| 808 | #endif |
| 809 | |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 810 | #if defined(CONFIG_MTD_DATAFLASH) \ |
| 811 | || defined(CONFIG_MTD_DATAFLASH_MODULE) |
Michael Hennerich | ceac265 | 2008-08-25 17:39:11 +0800 | [diff] [blame] | 812 | |
| 813 | static struct mtd_partition bfin_spi_dataflash_partitions[] = { |
| 814 | { |
| 815 | .name = "bootloader(spi)", |
| 816 | .size = 0x00040000, |
| 817 | .offset = 0, |
| 818 | .mask_flags = MTD_CAP_ROM |
| 819 | }, { |
| 820 | .name = "linux kernel(spi)", |
Grace Pan | 6ecb5b6 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 821 | .size = 0x180000, |
Michael Hennerich | ceac265 | 2008-08-25 17:39:11 +0800 | [diff] [blame] | 822 | .offset = MTDPART_OFS_APPEND, |
| 823 | }, { |
| 824 | .name = "file system(spi)", |
| 825 | .size = MTDPART_SIZ_FULL, |
| 826 | .offset = MTDPART_OFS_APPEND, |
| 827 | } |
| 828 | }; |
| 829 | |
| 830 | static struct flash_platform_data bfin_spi_dataflash_data = { |
| 831 | .name = "SPI Dataflash", |
| 832 | .parts = bfin_spi_dataflash_partitions, |
| 833 | .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions), |
| 834 | }; |
| 835 | |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 836 | /* DataFlash chip */ |
| 837 | static struct bfin5xx_spi_chip data_flash_chip_info = { |
| 838 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 839 | .bits_per_word = 8, |
| 840 | }; |
| 841 | #endif |
| 842 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 843 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 844 | #if defined(CONFIG_MTD_M25P80) \ |
| 845 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 846 | { |
| 847 | /* the modalias must be the same as spi device driver name */ |
| 848 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 849 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 850 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 851 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
| 852 | .platform_data = &bfin_spi_flash_data, |
| 853 | .controller_data = &spi_flash_chip_info, |
| 854 | .mode = SPI_MODE_3, |
| 855 | }, |
| 856 | #endif |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 857 | #if defined(CONFIG_MTD_DATAFLASH) \ |
| 858 | || defined(CONFIG_MTD_DATAFLASH_MODULE) |
| 859 | { /* DataFlash chip */ |
| 860 | .modalias = "mtd_dataflash", |
Michael Hennerich | ceac265 | 2008-08-25 17:39:11 +0800 | [diff] [blame] | 861 | .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */ |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 862 | .bus_num = 0, /* Framework bus number */ |
| 863 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
Michael Hennerich | ceac265 | 2008-08-25 17:39:11 +0800 | [diff] [blame] | 864 | .platform_data = &bfin_spi_dataflash_data, |
Michael Hennerich | 8e9d5c7 | 2008-04-24 08:46:19 +0800 | [diff] [blame] | 865 | .controller_data = &data_flash_chip_info, |
| 866 | .mode = SPI_MODE_3, |
| 867 | }, |
| 868 | #endif |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 869 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
| 870 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 871 | { |
| 872 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 873 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 874 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 875 | .chip_select = 1, /* Framework chip select. */ |
| 876 | .platform_data = NULL, /* No spi_driver specific config */ |
| 877 | .controller_data = &spi_adc_chip_info, |
| 878 | }, |
| 879 | #endif |
| 880 | |
| 881 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 882 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 883 | { |
| 884 | .modalias = "ad1836-spi", |
| 885 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 886 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 887 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 888 | .controller_data = &ad1836_spi_chip_info, |
| 889 | }, |
| 890 | #endif |
Barry Song | d4b834c | 2009-06-04 10:14:17 +0000 | [diff] [blame] | 891 | |
| 892 | #if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE) |
| 893 | { |
| 894 | .modalias = "ad1938-spi", |
| 895 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 896 | .bus_num = 0, |
| 897 | .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */ |
| 898 | .controller_data = &ad1938_spi_chip_info, |
| 899 | .mode = SPI_MODE_3, |
| 900 | }, |
| 901 | #endif |
| 902 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 903 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 904 | { |
| 905 | .modalias = "ad9960-spi", |
| 906 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 907 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 908 | .chip_select = 1, |
| 909 | .controller_data = &ad9960_spi_chip_info, |
| 910 | }, |
| 911 | #endif |
Barry Song | 427f277 | 2009-07-17 07:04:55 +0000 | [diff] [blame] | 912 | |
| 913 | #if defined(CONFIG_INPUT_EVAL_AD7147EBZ) |
| 914 | { |
| 915 | .modalias = "ad714x_captouch", |
| 916 | .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ |
| 917 | .irq = IRQ_PF4, |
| 918 | .bus_num = 0, |
| 919 | .chip_select = 5, |
| 920 | .mode = SPI_MODE_3, |
| 921 | .platform_data = &ad7147_platfrom_data, |
| 922 | .controller_data = &ad7147_spi_chip_info, |
| 923 | }, |
| 924 | #endif |
| 925 | |
Yi Li | f79ea4c | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 926 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 927 | { |
| 928 | .modalias = "mmc_spi", |
| 929 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 930 | .bus_num = 0, |
| 931 | .chip_select = 4, |
| 932 | .platform_data = &bfin_mmc_spi_pdata, |
| 933 | .controller_data = &mmc_spi_chip_info, |
| 934 | .mode = SPI_MODE_3, |
| 935 | }, |
| 936 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 937 | #if defined(CONFIG_PBX) |
| 938 | { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 939 | .modalias = "fxs-spi", |
| 940 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 941 | .bus_num = 0, |
| 942 | .chip_select = 8 - CONFIG_J11_JUMPER, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 943 | .controller_data = &spi_si3xxx_chip_info, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 944 | .mode = SPI_MODE_3, |
| 945 | }, |
| 946 | { |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 947 | .modalias = "fxo-spi", |
| 948 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 949 | .bus_num = 0, |
| 950 | .chip_select = 8 - CONFIG_J19_JUMPER, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 951 | .controller_data = &spi_si3xxx_chip_info, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 952 | .mode = SPI_MODE_3, |
| 953 | }, |
| 954 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 955 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
| 956 | { |
| 957 | .modalias = "ad7877", |
| 958 | .platform_data = &bfin_ad7877_ts_info, |
| 959 | .irq = IRQ_PF6, |
| 960 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Michael Hennerich | c7d4896 | 2007-11-15 21:33:31 +0800 | [diff] [blame] | 961 | .bus_num = 0, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 962 | .chip_select = 1, |
| 963 | .controller_data = &spi_ad7877_chip_info, |
| 964 | }, |
| 965 | #endif |
Michael Hennerich | f515015 | 2008-10-16 23:23:18 +0800 | [diff] [blame] | 966 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 967 | { |
| 968 | .modalias = "ad7879", |
| 969 | .platform_data = &bfin_ad7879_ts_info, |
| 970 | .irq = IRQ_PF7, |
| 971 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ |
| 972 | .bus_num = 0, |
| 973 | .chip_select = 1, |
| 974 | .controller_data = &spi_ad7879_chip_info, |
| 975 | .mode = SPI_CPHA | SPI_CPOL, |
| 976 | }, |
| 977 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 978 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 979 | { |
| 980 | .modalias = "spidev", |
| 981 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 982 | .bus_num = 0, |
| 983 | .chip_select = 1, |
| 984 | .controller_data = &spidev_chip_info, |
| 985 | }, |
| 986 | #endif |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 987 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 988 | { |
| 989 | .modalias = "bfin-lq035q1-spi", |
| 990 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 991 | .bus_num = 0, |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 992 | .chip_select = 2, |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 993 | .controller_data = &lq035q1_spi_chip_info, |
| 994 | .mode = SPI_CPHA | SPI_CPOL, |
| 995 | }, |
| 996 | #endif |
Michael Hennerich | 85a192e | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 997 | #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) |
| 998 | { |
| 999 | .modalias = "enc28j60", |
| 1000 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 1001 | .irq = IRQ_PF6, |
| 1002 | .bus_num = 0, |
| 1003 | .chip_select = 0, /* GPIO controlled SSEL */ |
| 1004 | .controller_data = &enc28j60_spi_chip_info, |
| 1005 | .mode = SPI_MODE_0, |
| 1006 | }, |
| 1007 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1008 | }; |
| 1009 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1010 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1011 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1012 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1013 | .num_chipselect = 8, |
| 1014 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 1015 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1016 | }; |
| 1017 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1018 | /* SPI (0) */ |
| 1019 | static struct resource bfin_spi0_resource[] = { |
| 1020 | [0] = { |
| 1021 | .start = SPI0_REGBASE, |
| 1022 | .end = SPI0_REGBASE + 0xFF, |
| 1023 | .flags = IORESOURCE_MEM, |
| 1024 | }, |
| 1025 | [1] = { |
| 1026 | .start = CH_SPI, |
| 1027 | .end = CH_SPI, |
Yi Li | e68d1eb | 2009-06-03 09:46:22 +0000 | [diff] [blame] | 1028 | .flags = IORESOURCE_DMA, |
| 1029 | }, |
| 1030 | [2] = { |
| 1031 | .start = IRQ_SPI, |
| 1032 | .end = IRQ_SPI, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1033 | .flags = IORESOURCE_IRQ, |
| 1034 | }, |
| 1035 | }; |
| 1036 | |
| 1037 | static struct platform_device bfin_spi0_device = { |
| 1038 | .name = "bfin-spi", |
| 1039 | .id = 0, /* Bus number */ |
| 1040 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 1041 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1042 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1043 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1044 | }, |
| 1045 | }; |
| 1046 | #endif /* spi master and devices */ |
| 1047 | |
Cliff Cai | 1e9aa95 | 2009-03-28 23:28:51 +0800 | [diff] [blame] | 1048 | #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) |
| 1049 | |
| 1050 | /* SPORT SPI controller data */ |
| 1051 | static struct bfin5xx_spi_master bfin_sport_spi0_info = { |
| 1052 | .num_chipselect = 1, /* master only supports one device */ |
| 1053 | .enable_dma = 0, /* master don't support DMA */ |
| 1054 | .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI, |
| 1055 | P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0}, |
| 1056 | }; |
| 1057 | |
| 1058 | static struct resource bfin_sport_spi0_resource[] = { |
| 1059 | [0] = { |
| 1060 | .start = SPORT0_TCR1, |
| 1061 | .end = SPORT0_TCR1 + 0xFF, |
| 1062 | .flags = IORESOURCE_MEM, |
| 1063 | }, |
| 1064 | [1] = { |
| 1065 | .start = IRQ_SPORT0_ERROR, |
| 1066 | .end = IRQ_SPORT0_ERROR, |
| 1067 | .flags = IORESOURCE_IRQ, |
| 1068 | }, |
| 1069 | }; |
| 1070 | |
| 1071 | static struct platform_device bfin_sport_spi0_device = { |
| 1072 | .name = "bfin-sport-spi", |
| 1073 | .id = 1, /* Bus number */ |
| 1074 | .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource), |
| 1075 | .resource = bfin_sport_spi0_resource, |
| 1076 | .dev = { |
| 1077 | .platform_data = &bfin_sport_spi0_info, /* Passed to driver */ |
| 1078 | }, |
| 1079 | }; |
| 1080 | |
| 1081 | static struct bfin5xx_spi_master bfin_sport_spi1_info = { |
| 1082 | .num_chipselect = 1, /* master only supports one device */ |
| 1083 | .enable_dma = 0, /* master don't support DMA */ |
| 1084 | .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI, |
| 1085 | P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0}, |
| 1086 | }; |
| 1087 | |
| 1088 | static struct resource bfin_sport_spi1_resource[] = { |
| 1089 | [0] = { |
| 1090 | .start = SPORT1_TCR1, |
| 1091 | .end = SPORT1_TCR1 + 0xFF, |
| 1092 | .flags = IORESOURCE_MEM, |
| 1093 | }, |
| 1094 | [1] = { |
| 1095 | .start = IRQ_SPORT1_ERROR, |
| 1096 | .end = IRQ_SPORT1_ERROR, |
| 1097 | .flags = IORESOURCE_IRQ, |
| 1098 | }, |
| 1099 | }; |
| 1100 | |
| 1101 | static struct platform_device bfin_sport_spi1_device = { |
| 1102 | .name = "bfin-sport-spi", |
| 1103 | .id = 2, /* Bus number */ |
| 1104 | .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource), |
| 1105 | .resource = bfin_sport_spi1_resource, |
| 1106 | .dev = { |
| 1107 | .platform_data = &bfin_sport_spi1_info, /* Passed to driver */ |
| 1108 | }, |
| 1109 | }; |
| 1110 | |
| 1111 | #endif /* sport spi master and devices */ |
| 1112 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1113 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
| 1114 | static struct platform_device bfin_fb_device = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1115 | .name = "bf537-lq035", |
| 1116 | }; |
| 1117 | #endif |
| 1118 | |
| 1119 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 1120 | static struct platform_device bfin_fb_adv7393_device = { |
| 1121 | .name = "bfin-adv7393", |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1122 | }; |
| 1123 | #endif |
| 1124 | |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 1125 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 1126 | #include <asm/bfin-lq035q1.h> |
| 1127 | |
| 1128 | static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { |
| 1129 | .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB, |
Michael Hennerich | 46aa04f | 2008-10-13 11:30:17 +0800 | [diff] [blame] | 1130 | .use_bl = 0, /* let something else control the LCD Blacklight */ |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 1131 | .gpio_bl = GPIO_PF7, |
| 1132 | }; |
| 1133 | |
| 1134 | static struct resource bfin_lq035q1_resources[] = { |
| 1135 | { |
| 1136 | .start = IRQ_PPI_ERROR, |
| 1137 | .end = IRQ_PPI_ERROR, |
| 1138 | .flags = IORESOURCE_IRQ, |
| 1139 | }, |
| 1140 | }; |
| 1141 | |
| 1142 | static struct platform_device bfin_lq035q1_device = { |
| 1143 | .name = "bfin-lq035q1", |
| 1144 | .id = -1, |
| 1145 | .num_resources = ARRAY_SIZE(bfin_lq035q1_resources), |
| 1146 | .resource = bfin_lq035q1_resources, |
| 1147 | .dev = { |
| 1148 | .platform_data = &bfin_lq035q1_data, |
| 1149 | }, |
| 1150 | }; |
| 1151 | #endif |
| 1152 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1153 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 1154 | static struct resource bfin_uart_resources[] = { |
Sonic Zhang | 233b28a | 2007-11-21 17:04:41 +0800 | [diff] [blame] | 1155 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1156 | { |
| 1157 | .start = 0xFFC00400, |
| 1158 | .end = 0xFFC004FF, |
| 1159 | .flags = IORESOURCE_MEM, |
Sonic Zhang | 233b28a | 2007-11-21 17:04:41 +0800 | [diff] [blame] | 1160 | }, |
| 1161 | #endif |
| 1162 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 1163 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1164 | .start = 0xFFC02000, |
| 1165 | .end = 0xFFC020FF, |
| 1166 | .flags = IORESOURCE_MEM, |
| 1167 | }, |
Sonic Zhang | 233b28a | 2007-11-21 17:04:41 +0800 | [diff] [blame] | 1168 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1169 | }; |
| 1170 | |
| 1171 | static struct platform_device bfin_uart_device = { |
| 1172 | .name = "bfin-uart", |
| 1173 | .id = 1, |
| 1174 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 1175 | .resource = bfin_uart_resources, |
| 1176 | }; |
| 1177 | #endif |
| 1178 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1179 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1180 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1181 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1182 | { |
| 1183 | .start = 0xFFC00400, |
| 1184 | .end = 0xFFC004FF, |
| 1185 | .flags = IORESOURCE_MEM, |
| 1186 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1187 | { |
| 1188 | .start = IRQ_UART0_RX, |
| 1189 | .end = IRQ_UART0_RX+1, |
| 1190 | .flags = IORESOURCE_IRQ, |
| 1191 | }, |
| 1192 | { |
| 1193 | .start = CH_UART0_RX, |
| 1194 | .end = CH_UART0_RX+1, |
| 1195 | .flags = IORESOURCE_DMA, |
| 1196 | }, |
| 1197 | }; |
| 1198 | |
| 1199 | static struct platform_device bfin_sir0_device = { |
| 1200 | .name = "bfin_sir", |
| 1201 | .id = 0, |
| 1202 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 1203 | .resource = bfin_sir0_resources, |
| 1204 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1205 | #endif |
| 1206 | #ifdef CONFIG_BFIN_SIR1 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1207 | static struct resource bfin_sir1_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1208 | { |
| 1209 | .start = 0xFFC02000, |
| 1210 | .end = 0xFFC020FF, |
| 1211 | .flags = IORESOURCE_MEM, |
| 1212 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1213 | { |
| 1214 | .start = IRQ_UART1_RX, |
| 1215 | .end = IRQ_UART1_RX+1, |
| 1216 | .flags = IORESOURCE_IRQ, |
| 1217 | }, |
| 1218 | { |
| 1219 | .start = CH_UART1_RX, |
| 1220 | .end = CH_UART1_RX+1, |
| 1221 | .flags = IORESOURCE_DMA, |
| 1222 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1223 | }; |
| 1224 | |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1225 | static struct platform_device bfin_sir1_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1226 | .name = "bfin_sir", |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1227 | .id = 1, |
| 1228 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), |
| 1229 | .resource = bfin_sir1_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1230 | }; |
| 1231 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1232 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1233 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1234 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1235 | static struct resource bfin_twi0_resource[] = { |
| 1236 | [0] = { |
| 1237 | .start = TWI0_REGBASE, |
| 1238 | .end = TWI0_REGBASE, |
| 1239 | .flags = IORESOURCE_MEM, |
| 1240 | }, |
| 1241 | [1] = { |
| 1242 | .start = IRQ_TWI, |
| 1243 | .end = IRQ_TWI, |
| 1244 | .flags = IORESOURCE_IRQ, |
| 1245 | }, |
| 1246 | }; |
| 1247 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1248 | static struct platform_device i2c_bfin_twi_device = { |
| 1249 | .name = "i2c-bfin-twi", |
| 1250 | .id = 0, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1251 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 1252 | .resource = bfin_twi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1253 | }; |
| 1254 | #endif |
| 1255 | |
Michael Hennerich | 51ed9ad | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 1256 | #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) |
| 1257 | #include <linux/input.h> |
Michael Hennerich | f39d56e | 2008-12-02 14:08:58 +0000 | [diff] [blame] | 1258 | #include <linux/i2c/adp5588.h> |
Michael Hennerich | 51ed9ad | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 1259 | static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = { |
| 1260 | [0] = KEY_GRAVE, |
| 1261 | [1] = KEY_1, |
| 1262 | [2] = KEY_2, |
| 1263 | [3] = KEY_3, |
| 1264 | [4] = KEY_4, |
| 1265 | [5] = KEY_5, |
| 1266 | [6] = KEY_6, |
| 1267 | [7] = KEY_7, |
| 1268 | [8] = KEY_8, |
| 1269 | [9] = KEY_9, |
| 1270 | [10] = KEY_0, |
| 1271 | [11] = KEY_MINUS, |
| 1272 | [12] = KEY_EQUAL, |
| 1273 | [13] = KEY_BACKSLASH, |
| 1274 | [15] = KEY_KP0, |
| 1275 | [16] = KEY_Q, |
| 1276 | [17] = KEY_W, |
| 1277 | [18] = KEY_E, |
| 1278 | [19] = KEY_R, |
| 1279 | [20] = KEY_T, |
| 1280 | [21] = KEY_Y, |
| 1281 | [22] = KEY_U, |
| 1282 | [23] = KEY_I, |
| 1283 | [24] = KEY_O, |
| 1284 | [25] = KEY_P, |
| 1285 | [26] = KEY_LEFTBRACE, |
| 1286 | [27] = KEY_RIGHTBRACE, |
| 1287 | [29] = KEY_KP1, |
| 1288 | [30] = KEY_KP2, |
| 1289 | [31] = KEY_KP3, |
| 1290 | [32] = KEY_A, |
| 1291 | [33] = KEY_S, |
| 1292 | [34] = KEY_D, |
| 1293 | [35] = KEY_F, |
| 1294 | [36] = KEY_G, |
| 1295 | [37] = KEY_H, |
| 1296 | [38] = KEY_J, |
| 1297 | [39] = KEY_K, |
| 1298 | [40] = KEY_L, |
| 1299 | [41] = KEY_SEMICOLON, |
| 1300 | [42] = KEY_APOSTROPHE, |
| 1301 | [43] = KEY_BACKSLASH, |
| 1302 | [45] = KEY_KP4, |
| 1303 | [46] = KEY_KP5, |
| 1304 | [47] = KEY_KP6, |
| 1305 | [48] = KEY_102ND, |
| 1306 | [49] = KEY_Z, |
| 1307 | [50] = KEY_X, |
| 1308 | [51] = KEY_C, |
| 1309 | [52] = KEY_V, |
| 1310 | [53] = KEY_B, |
| 1311 | [54] = KEY_N, |
| 1312 | [55] = KEY_M, |
| 1313 | [56] = KEY_COMMA, |
| 1314 | [57] = KEY_DOT, |
| 1315 | [58] = KEY_SLASH, |
| 1316 | [60] = KEY_KPDOT, |
| 1317 | [61] = KEY_KP7, |
| 1318 | [62] = KEY_KP8, |
| 1319 | [63] = KEY_KP9, |
| 1320 | [64] = KEY_SPACE, |
| 1321 | [65] = KEY_BACKSPACE, |
| 1322 | [66] = KEY_TAB, |
| 1323 | [67] = KEY_KPENTER, |
| 1324 | [68] = KEY_ENTER, |
| 1325 | [69] = KEY_ESC, |
| 1326 | [70] = KEY_DELETE, |
| 1327 | [74] = KEY_KPMINUS, |
| 1328 | [76] = KEY_UP, |
| 1329 | [77] = KEY_DOWN, |
| 1330 | [78] = KEY_RIGHT, |
| 1331 | [79] = KEY_LEFT, |
| 1332 | }; |
| 1333 | |
| 1334 | static struct adp5588_kpad_platform_data adp5588_kpad_data = { |
| 1335 | .rows = 8, |
| 1336 | .cols = 10, |
| 1337 | .keymap = adp5588_keymap, |
| 1338 | .keymapsize = ARRAY_SIZE(adp5588_keymap), |
| 1339 | .repeat = 0, |
| 1340 | }; |
| 1341 | #endif |
| 1342 | |
Michael Hennerich | 3ea5721 | 2009-03-28 22:15:07 +0800 | [diff] [blame] | 1343 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) |
| 1344 | #include <linux/mfd/adp5520.h> |
| 1345 | |
| 1346 | /* |
| 1347 | * ADP5520/5501 Backlight Data |
| 1348 | */ |
| 1349 | |
| 1350 | static struct adp5520_backlight_platfrom_data adp5520_backlight_data = { |
| 1351 | .fade_in = FADE_T_1200ms, |
| 1352 | .fade_out = FADE_T_1200ms, |
| 1353 | .fade_led_law = BL_LAW_LINEAR, |
| 1354 | .en_ambl_sens = 1, |
| 1355 | .abml_filt = BL_AMBL_FILT_640ms, |
| 1356 | .l1_daylight_max = BL_CUR_mA(15), |
| 1357 | .l1_daylight_dim = BL_CUR_mA(0), |
| 1358 | .l2_office_max = BL_CUR_mA(7), |
| 1359 | .l2_office_dim = BL_CUR_mA(0), |
| 1360 | .l3_dark_max = BL_CUR_mA(3), |
| 1361 | .l3_dark_dim = BL_CUR_mA(0), |
| 1362 | .l2_trip = L2_COMP_CURR_uA(700), |
| 1363 | .l2_hyst = L2_COMP_CURR_uA(50), |
| 1364 | .l3_trip = L3_COMP_CURR_uA(80), |
| 1365 | .l3_hyst = L3_COMP_CURR_uA(20), |
| 1366 | }; |
| 1367 | |
| 1368 | /* |
| 1369 | * ADP5520/5501 LEDs Data |
| 1370 | */ |
| 1371 | |
| 1372 | #include <linux/leds.h> |
| 1373 | |
| 1374 | static struct led_info adp5520_leds[] = { |
| 1375 | { |
| 1376 | .name = "adp5520-led1", |
| 1377 | .default_trigger = "none", |
| 1378 | .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | LED_OFFT_600ms, |
| 1379 | }, |
| 1380 | #ifdef ADP5520_EN_ALL_LEDS |
| 1381 | { |
| 1382 | .name = "adp5520-led2", |
| 1383 | .default_trigger = "none", |
| 1384 | .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1, |
| 1385 | }, |
| 1386 | { |
| 1387 | .name = "adp5520-led3", |
| 1388 | .default_trigger = "none", |
| 1389 | .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2, |
| 1390 | }, |
| 1391 | #endif |
| 1392 | }; |
| 1393 | |
| 1394 | static struct adp5520_leds_platfrom_data adp5520_leds_data = { |
| 1395 | .num_leds = ARRAY_SIZE(adp5520_leds), |
| 1396 | .leds = adp5520_leds, |
| 1397 | .fade_in = FADE_T_600ms, |
| 1398 | .fade_out = FADE_T_600ms, |
| 1399 | .led_on_time = LED_ONT_600ms, |
| 1400 | }; |
| 1401 | |
| 1402 | /* |
| 1403 | * ADP5520 GPIO Data |
| 1404 | */ |
| 1405 | |
| 1406 | static struct adp5520_gpio_platfrom_data adp5520_gpio_data = { |
| 1407 | .gpio_start = 50, |
| 1408 | .gpio_en_mask = GPIO_C1 | GPIO_C2 | GPIO_R2, |
| 1409 | .gpio_pullup_mask = GPIO_C1 | GPIO_C2 | GPIO_R2, |
| 1410 | }; |
| 1411 | |
| 1412 | /* |
| 1413 | * ADP5520 Keypad Data |
| 1414 | */ |
| 1415 | |
| 1416 | #include <linux/input.h> |
| 1417 | static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = { |
| 1418 | [KEY(0, 0)] = KEY_GRAVE, |
| 1419 | [KEY(0, 1)] = KEY_1, |
| 1420 | [KEY(0, 2)] = KEY_2, |
| 1421 | [KEY(0, 3)] = KEY_3, |
| 1422 | [KEY(1, 0)] = KEY_4, |
| 1423 | [KEY(1, 1)] = KEY_5, |
| 1424 | [KEY(1, 2)] = KEY_6, |
| 1425 | [KEY(1, 3)] = KEY_7, |
| 1426 | [KEY(2, 0)] = KEY_8, |
| 1427 | [KEY(2, 1)] = KEY_9, |
| 1428 | [KEY(2, 2)] = KEY_0, |
| 1429 | [KEY(2, 3)] = KEY_MINUS, |
| 1430 | [KEY(3, 0)] = KEY_EQUAL, |
| 1431 | [KEY(3, 1)] = KEY_BACKSLASH, |
| 1432 | [KEY(3, 2)] = KEY_BACKSPACE, |
| 1433 | [KEY(3, 3)] = KEY_ENTER, |
| 1434 | }; |
| 1435 | |
| 1436 | static struct adp5520_keys_platfrom_data adp5520_keys_data = { |
| 1437 | .rows_en_mask = ROW_R3 | ROW_R2 | ROW_R1 | ROW_R0, |
| 1438 | .cols_en_mask = COL_C3 | COL_C2 | COL_C1 | COL_C0, |
| 1439 | .keymap = adp5520_keymap, |
| 1440 | .keymapsize = ARRAY_SIZE(adp5520_keymap), |
| 1441 | .repeat = 0, |
| 1442 | }; |
| 1443 | |
| 1444 | /* |
| 1445 | * ADP5520/5501 Multifuction Device Init Data |
| 1446 | */ |
| 1447 | |
| 1448 | static struct adp5520_subdev_info adp5520_subdevs[] = { |
| 1449 | { |
| 1450 | .name = "adp5520-backlight", |
| 1451 | .id = ID_ADP5520, |
| 1452 | .platform_data = &adp5520_backlight_data, |
| 1453 | }, |
| 1454 | { |
| 1455 | .name = "adp5520-led", |
| 1456 | .id = ID_ADP5520, |
| 1457 | .platform_data = &adp5520_leds_data, |
| 1458 | }, |
| 1459 | { |
| 1460 | .name = "adp5520-gpio", |
| 1461 | .id = ID_ADP5520, |
| 1462 | .platform_data = &adp5520_gpio_data, |
| 1463 | }, |
| 1464 | { |
| 1465 | .name = "adp5520-keys", |
| 1466 | .id = ID_ADP5520, |
| 1467 | .platform_data = &adp5520_keys_data, |
| 1468 | }, |
| 1469 | }; |
| 1470 | |
| 1471 | static struct adp5520_platform_data adp5520_pdev_data = { |
| 1472 | .num_subdevs = ARRAY_SIZE(adp5520_subdevs), |
| 1473 | .subdevs = adp5520_subdevs, |
| 1474 | }; |
| 1475 | |
| 1476 | #endif |
| 1477 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1478 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
Barry Song | 427f277 | 2009-07-17 07:04:55 +0000 | [diff] [blame] | 1479 | #if defined(CONFIG_INPUT_EVAL_AD7142EB) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1480 | { |
Barry Song | 427f277 | 2009-07-17 07:04:55 +0000 | [diff] [blame] | 1481 | I2C_BOARD_INFO("ad7142_captouch", 0x2C), |
Barry Song | 4c94c3e | 2009-07-07 07:41:50 +0000 | [diff] [blame] | 1482 | .irq = IRQ_PG5, |
Barry Song | 427f277 | 2009-07-17 07:04:55 +0000 | [diff] [blame] | 1483 | .platform_data = (void *)&ad7142_platfrom_data, |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1484 | }, |
| 1485 | #endif |
Michael Hennerich | ebd5833 | 2009-07-02 11:00:38 +0000 | [diff] [blame] | 1486 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1487 | { |
| 1488 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1489 | }, |
| 1490 | #endif |
Michael Hennerich | 204844e | 2009-06-30 14:57:22 +0000 | [diff] [blame] | 1491 | #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1492 | { |
| 1493 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), |
Michael Hennerich | f515015 | 2008-10-16 23:23:18 +0800 | [diff] [blame] | 1494 | .irq = IRQ_PG6, |
| 1495 | }, |
| 1496 | #endif |
| 1497 | #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE) |
| 1498 | { |
| 1499 | I2C_BOARD_INFO("ad7879", 0x2F), |
| 1500 | .irq = IRQ_PG5, |
| 1501 | .platform_data = (void *)&bfin_ad7879_ts_info, |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1502 | }, |
| 1503 | #endif |
Michael Hennerich | 51ed9ad | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 1504 | #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) |
| 1505 | { |
| 1506 | I2C_BOARD_INFO("adp5588-keys", 0x34), |
| 1507 | .irq = IRQ_PG0, |
| 1508 | .platform_data = (void *)&adp5588_kpad_data, |
| 1509 | }, |
| 1510 | #endif |
Michael Hennerich | 3ea5721 | 2009-03-28 22:15:07 +0800 | [diff] [blame] | 1511 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) |
| 1512 | { |
| 1513 | I2C_BOARD_INFO("pmic-adp5520", 0x32), |
Mike Frysinger | 4f84b6e | 2009-06-10 20:45:48 -0400 | [diff] [blame] | 1514 | .irq = IRQ_PG0, |
Michael Hennerich | 3ea5721 | 2009-03-28 22:15:07 +0800 | [diff] [blame] | 1515 | .platform_data = (void *)&adp5520_pdev_data, |
| 1516 | }, |
| 1517 | #endif |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 1518 | #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) |
| 1519 | { |
| 1520 | I2C_BOARD_INFO("adxl34x", 0x53), |
| 1521 | .irq = IRQ_PG3, |
| 1522 | .platform_data = (void *)&adxl34x_info, |
| 1523 | }, |
| 1524 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1525 | }; |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1526 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1527 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 1528 | static struct platform_device bfin_sport0_uart_device = { |
| 1529 | .name = "bfin-sport-uart", |
| 1530 | .id = 0, |
| 1531 | }; |
| 1532 | |
| 1533 | static struct platform_device bfin_sport1_uart_device = { |
| 1534 | .name = "bfin-sport-uart", |
| 1535 | .id = 1, |
| 1536 | }; |
| 1537 | #endif |
| 1538 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1539 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
Michael Hennerich | 2c8beb2 | 2009-03-28 22:13:43 +0800 | [diff] [blame] | 1540 | #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE |
| 1541 | /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1542 | |
Michael Hennerich | 2c8beb2 | 2009-03-28 22:13:43 +0800 | [diff] [blame] | 1543 | #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE |
| 1544 | #define PATA_INT IRQ_PF5 |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1545 | static struct pata_platform_info bfin_pata_platform_data = { |
| 1546 | .ioport_shift = 1, |
Mike Frysinger | 64e5c51 | 2007-10-30 11:56:13 +0800 | [diff] [blame] | 1547 | .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1548 | }; |
| 1549 | |
| 1550 | static struct resource bfin_pata_resources[] = { |
| 1551 | { |
| 1552 | .start = 0x20314020, |
| 1553 | .end = 0x2031403F, |
| 1554 | .flags = IORESOURCE_MEM, |
| 1555 | }, |
| 1556 | { |
| 1557 | .start = 0x2031401C, |
| 1558 | .end = 0x2031401F, |
| 1559 | .flags = IORESOURCE_MEM, |
| 1560 | }, |
| 1561 | { |
| 1562 | .start = PATA_INT, |
| 1563 | .end = PATA_INT, |
| 1564 | .flags = IORESOURCE_IRQ, |
| 1565 | }, |
| 1566 | }; |
Michael Hennerich | 2c8beb2 | 2009-03-28 22:13:43 +0800 | [diff] [blame] | 1567 | #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE) |
| 1568 | static struct pata_platform_info bfin_pata_platform_data = { |
| 1569 | .ioport_shift = 0, |
| 1570 | }; |
Michael Hennerich | 648882d | 2009-04-21 12:05:50 +0000 | [diff] [blame] | 1571 | /* CompactFlash Storage Card Memory Mapped Adressing |
| 1572 | * /REG = A11 = 1 |
| 1573 | */ |
Michael Hennerich | 2c8beb2 | 2009-03-28 22:13:43 +0800 | [diff] [blame] | 1574 | static struct resource bfin_pata_resources[] = { |
| 1575 | { |
Michael Hennerich | 648882d | 2009-04-21 12:05:50 +0000 | [diff] [blame] | 1576 | .start = 0x20211800, |
| 1577 | .end = 0x20211807, |
Michael Hennerich | 2c8beb2 | 2009-03-28 22:13:43 +0800 | [diff] [blame] | 1578 | .flags = IORESOURCE_MEM, |
| 1579 | }, |
| 1580 | { |
Michael Hennerich | 648882d | 2009-04-21 12:05:50 +0000 | [diff] [blame] | 1581 | .start = 0x2021180E, /* Device Ctl */ |
| 1582 | .end = 0x2021180E, |
Michael Hennerich | 2c8beb2 | 2009-03-28 22:13:43 +0800 | [diff] [blame] | 1583 | .flags = IORESOURCE_MEM, |
| 1584 | }, |
| 1585 | }; |
| 1586 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1587 | |
| 1588 | static struct platform_device bfin_pata_device = { |
| 1589 | .name = "pata_platform", |
| 1590 | .id = -1, |
| 1591 | .num_resources = ARRAY_SIZE(bfin_pata_resources), |
| 1592 | .resource = bfin_pata_resources, |
| 1593 | .dev = { |
| 1594 | .platform_data = &bfin_pata_platform_data, |
| 1595 | } |
| 1596 | }; |
| 1597 | #endif |
| 1598 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1599 | static const unsigned int cclk_vlev_datasheet[] = |
| 1600 | { |
| 1601 | VRPAIR(VLEV_085, 250000000), |
| 1602 | VRPAIR(VLEV_090, 376000000), |
| 1603 | VRPAIR(VLEV_095, 426000000), |
| 1604 | VRPAIR(VLEV_100, 426000000), |
| 1605 | VRPAIR(VLEV_105, 476000000), |
| 1606 | VRPAIR(VLEV_110, 476000000), |
| 1607 | VRPAIR(VLEV_115, 476000000), |
| 1608 | VRPAIR(VLEV_120, 500000000), |
| 1609 | VRPAIR(VLEV_125, 533000000), |
| 1610 | VRPAIR(VLEV_130, 600000000), |
| 1611 | }; |
| 1612 | |
| 1613 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 1614 | .tuple_tab = cclk_vlev_datasheet, |
| 1615 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 1616 | .vr_settling_time = 25 /* us */, |
| 1617 | }; |
| 1618 | |
| 1619 | static struct platform_device bfin_dpmc = { |
| 1620 | .name = "bfin dpmc", |
| 1621 | .dev = { |
| 1622 | .platform_data = &bfin_dmpc_vreg_data, |
| 1623 | }, |
| 1624 | }; |
| 1625 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1626 | static struct platform_device *stamp_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1627 | |
| 1628 | &bfin_dpmc, |
| 1629 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1630 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 1631 | &bfin_pcmcia_cf_device, |
| 1632 | #endif |
| 1633 | |
| 1634 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 1635 | &rtc_device, |
| 1636 | #endif |
| 1637 | |
| 1638 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
| 1639 | &sl811_hcd_device, |
| 1640 | #endif |
| 1641 | |
| 1642 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 1643 | &isp1362_hcd_device, |
| 1644 | #endif |
| 1645 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 1646 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 1647 | &bfin_isp1760_device, |
| 1648 | #endif |
| 1649 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1650 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 1651 | &smc91x_device, |
| 1652 | #endif |
| 1653 | |
Alex Landau | f40d24d | 2007-07-12 12:11:48 +0800 | [diff] [blame] | 1654 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 1655 | &dm9000_device, |
| 1656 | #endif |
| 1657 | |
Michael Hennerich | 561cc18 | 2007-11-17 23:56:08 +0800 | [diff] [blame] | 1658 | #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE) |
| 1659 | &ax88180_device, |
| 1660 | #endif |
| 1661 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1662 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1663 | &bfin_mii_bus, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1664 | &bfin_mac_device, |
| 1665 | #endif |
| 1666 | |
| 1667 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 1668 | &net2272_bfin_device, |
| 1669 | #endif |
| 1670 | |
| 1671 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1672 | &bfin_spi0_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1673 | #endif |
| 1674 | |
Cliff Cai | 1e9aa95 | 2009-03-28 23:28:51 +0800 | [diff] [blame] | 1675 | #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) |
| 1676 | &bfin_sport_spi0_device, |
| 1677 | &bfin_sport_spi1_device, |
| 1678 | #endif |
| 1679 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1680 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
| 1681 | &bfin_fb_device, |
| 1682 | #endif |
| 1683 | |
Michael Hennerich | 2043f3f | 2008-10-13 14:46:30 +0800 | [diff] [blame] | 1684 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 1685 | &bfin_lq035q1_device, |
| 1686 | #endif |
| 1687 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1688 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 1689 | &bfin_fb_adv7393_device, |
| 1690 | #endif |
| 1691 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1692 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 1693 | &bfin_uart_device, |
| 1694 | #endif |
| 1695 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1696 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1697 | #ifdef CONFIG_BFIN_SIR0 |
| 1698 | &bfin_sir0_device, |
| 1699 | #endif |
| 1700 | #ifdef CONFIG_BFIN_SIR1 |
| 1701 | &bfin_sir1_device, |
| 1702 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1703 | #endif |
| 1704 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1705 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 1706 | &i2c_bfin_twi_device, |
| 1707 | #endif |
| 1708 | |
| 1709 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 1710 | &bfin_sport0_uart_device, |
| 1711 | &bfin_sport1_uart_device, |
| 1712 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1713 | |
| 1714 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
| 1715 | &bfin_pata_device, |
| 1716 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 1717 | |
| 1718 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 1719 | &bfin_device_gpiokeys, |
| 1720 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 1721 | |
| 1722 | &bfin_gpios_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1723 | |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 1724 | #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
| 1725 | &bfin_async_nand_device, |
| 1726 | #endif |
| 1727 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1728 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 1729 | &stamp_flash_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1730 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1731 | }; |
| 1732 | |
| 1733 | static int __init stamp_init(void) |
| 1734 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 1735 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1736 | i2c_register_board_info(0, bfin_i2c_board_info, |
| 1737 | ARRAY_SIZE(bfin_i2c_board_info)); |
Mike Frysinger | fc68911 | 2008-06-25 11:41:42 +0800 | [diff] [blame] | 1738 | bfin_plat_nand_init(); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1739 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1740 | 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] | 1741 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1742 | return 0; |
| 1743 | } |
| 1744 | |
| 1745 | arch_initcall(stamp_init); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1746 | |
| 1747 | void native_machine_restart(char *cmd) |
| 1748 | { |
| 1749 | /* workaround reboot hang when booting from SPI */ |
| 1750 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
Sonic Zhang | b52dae3 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1751 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1752 | } |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1753 | |
| 1754 | /* |
| 1755 | * Currently the MAC address is saved in Flash by U-Boot |
| 1756 | */ |
| 1757 | #define FLASH_MAC 0x203f0000 |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1758 | void bfin_get_ether_addr(char *addr) |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1759 | { |
| 1760 | *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); |
| 1761 | *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); |
| 1762 | } |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1763 | EXPORT_SYMBOL(bfin_get_ether_addr); |