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