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