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