Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf527/boards/ezkit.c |
| 3 | * Based on: arch/blackfin/mach-bf537/boards/stamp.c |
| 4 | * Author: Aidan Williams <aidan@nicta.com.au> |
| 5 | * |
| 6 | * Created: |
| 7 | * Description: |
| 8 | * |
| 9 | * Modified: |
| 10 | * Copyright 2005 National ICT Australia (NICTA) |
Michael Hennerich | a628a8b | 2008-01-22 17:29:16 +0800 | [diff] [blame] | 11 | * Copyright 2004-2008 Analog Devices Inc. |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 12 | * |
| 13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by |
| 17 | * the Free Software Foundation; either version 2 of the License, or |
| 18 | * (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, see the file COPYING, or write |
| 27 | * to the Free Software Foundation, Inc., |
| 28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 | */ |
| 30 | |
| 31 | #include <linux/device.h> |
| 32 | #include <linux/platform_device.h> |
| 33 | #include <linux/mtd/mtd.h> |
| 34 | #include <linux/mtd/partitions.h> |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 35 | #include <linux/mtd/physmap.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 36 | #include <linux/spi/spi.h> |
| 37 | #include <linux/spi/flash.h> |
| 38 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
Mike Frysinger | f02bcec | 2007-11-15 21:29:15 +0800 | [diff] [blame] | 39 | #include <linux/usb/isp1362.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 40 | #endif |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 41 | #include <linux/i2c.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 42 | #include <linux/irq.h> |
| 43 | #include <linux/interrupt.h> |
Mike Frysinger | 632f658 | 2007-11-15 21:25:47 +0800 | [diff] [blame] | 44 | #include <linux/usb/sl811.h> |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 45 | #include <linux/usb/musb.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 46 | #include <asm/dma.h> |
| 47 | #include <asm/bfin5xx_spi.h> |
| 48 | #include <asm/reboot.h> |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 49 | #include <asm/nand.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 50 | #include <asm/portmux.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 51 | #include <asm/dpmc.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 52 | #include <linux/spi/ad7877.h> |
| 53 | |
| 54 | /* |
| 55 | * Name the Board for the /proc/cpuinfo |
| 56 | */ |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 57 | const char bfin_board_name[] = "ADI BF527-EZKIT"; |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 58 | |
| 59 | /* |
| 60 | * Driver needs to know address, irq and flag pin. |
| 61 | */ |
| 62 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 63 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 64 | #include <linux/usb/isp1760.h> |
| 65 | static struct resource bfin_isp1760_resources[] = { |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 66 | [0] = { |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 67 | .start = 0x203C0000, |
| 68 | .end = 0x203C0000 + 0x000fffff, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 69 | .flags = IORESOURCE_MEM, |
| 70 | }, |
| 71 | [1] = { |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 72 | .start = IRQ_PF7, |
| 73 | .end = IRQ_PF7, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 74 | .flags = IORESOURCE_IRQ, |
| 75 | }, |
| 76 | }; |
| 77 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 78 | static struct isp1760_platform_data isp1760_priv = { |
| 79 | .is_isp1761 = 0, |
| 80 | .port1_disable = 0, |
| 81 | .bus_width_16 = 1, |
| 82 | .port1_otg = 0, |
| 83 | .analog_oc = 0, |
| 84 | .dack_polarity_high = 0, |
| 85 | .dreq_polarity_high = 0, |
| 86 | }; |
| 87 | |
| 88 | static struct platform_device bfin_isp1760_device = { |
| 89 | .name = "isp1760-hcd", |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 90 | .id = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 91 | .dev = { |
| 92 | .platform_data = &isp1760_priv, |
| 93 | }, |
| 94 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), |
| 95 | .resource = bfin_isp1760_resources, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 96 | }; |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 97 | #endif |
| 98 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 99 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 100 | static struct resource musb_resources[] = { |
| 101 | [0] = { |
| 102 | .start = 0xffc03800, |
| 103 | .end = 0xffc03cff, |
| 104 | .flags = IORESOURCE_MEM, |
| 105 | }, |
| 106 | [1] = { /* general IRQ */ |
| 107 | .start = IRQ_USB_INT0, |
| 108 | .end = IRQ_USB_INT0, |
| 109 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 110 | }, |
| 111 | [2] = { /* DMA IRQ */ |
| 112 | .start = IRQ_USB_DMA, |
| 113 | .end = IRQ_USB_DMA, |
| 114 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 115 | }, |
| 116 | }; |
| 117 | |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 118 | static struct musb_hdrc_config musb_config = { |
| 119 | .multipoint = 0, |
| 120 | .dyn_fifo = 0, |
| 121 | .soft_con = 1, |
| 122 | .dma = 1, |
Bryan Wu | fea05da | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 123 | .num_eps = 8, |
| 124 | .dma_channels = 8, |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 125 | .gpio_vrsel = GPIO_PG13, |
| 126 | }; |
| 127 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 128 | static struct musb_hdrc_platform_data musb_plat = { |
| 129 | #if defined(CONFIG_USB_MUSB_OTG) |
| 130 | .mode = MUSB_OTG, |
| 131 | #elif defined(CONFIG_USB_MUSB_HDRC_HCD) |
| 132 | .mode = MUSB_HOST, |
| 133 | #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) |
| 134 | .mode = MUSB_PERIPHERAL, |
| 135 | #endif |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 136 | .config = &musb_config, |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 137 | }; |
| 138 | |
| 139 | static u64 musb_dmamask = ~(u32)0; |
| 140 | |
| 141 | static struct platform_device musb_device = { |
| 142 | .name = "musb_hdrc", |
| 143 | .id = 0, |
| 144 | .dev = { |
| 145 | .dma_mask = &musb_dmamask, |
| 146 | .coherent_dma_mask = 0xffffffff, |
| 147 | .platform_data = &musb_plat, |
| 148 | }, |
| 149 | .num_resources = ARRAY_SIZE(musb_resources), |
| 150 | .resource = musb_resources, |
| 151 | }; |
| 152 | #endif |
| 153 | |
| 154 | #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE) |
| 155 | |
| 156 | static struct resource bf52x_t350mcqb_resources[] = { |
| 157 | { |
| 158 | .start = IRQ_PPI_ERROR, |
| 159 | .end = IRQ_PPI_ERROR, |
| 160 | .flags = IORESOURCE_IRQ, |
| 161 | }, |
| 162 | }; |
| 163 | |
| 164 | static struct platform_device bf52x_t350mcqb_device = { |
| 165 | .name = "bfin-t350mcqb", |
| 166 | .id = -1, |
| 167 | .num_resources = ARRAY_SIZE(bf52x_t350mcqb_resources), |
| 168 | .resource = bf52x_t350mcqb_resources, |
| 169 | }; |
| 170 | #endif |
| 171 | |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 172 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
| 173 | static struct mtd_partition ezkit_partitions[] = { |
| 174 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 175 | .name = "bootloader(nor)", |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 176 | .size = 0x40000, |
| 177 | .offset = 0, |
| 178 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 179 | .name = "linux kernel(nor)", |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 180 | .size = 0x1C0000, |
| 181 | .offset = MTDPART_OFS_APPEND, |
| 182 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 183 | .name = "file system(nor)", |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 184 | .size = MTDPART_SIZ_FULL, |
| 185 | .offset = MTDPART_OFS_APPEND, |
| 186 | } |
| 187 | }; |
| 188 | |
| 189 | static struct physmap_flash_data ezkit_flash_data = { |
| 190 | .width = 2, |
| 191 | .parts = ezkit_partitions, |
| 192 | .nr_parts = ARRAY_SIZE(ezkit_partitions), |
| 193 | }; |
| 194 | |
| 195 | static struct resource ezkit_flash_resource = { |
| 196 | .start = 0x20000000, |
| 197 | .end = 0x203fffff, |
| 198 | .flags = IORESOURCE_MEM, |
| 199 | }; |
| 200 | |
| 201 | static struct platform_device ezkit_flash_device = { |
| 202 | .name = "physmap-flash", |
| 203 | .id = 0, |
| 204 | .dev = { |
| 205 | .platform_data = &ezkit_flash_data, |
| 206 | }, |
| 207 | .num_resources = 1, |
| 208 | .resource = &ezkit_flash_resource, |
| 209 | }; |
| 210 | #endif |
| 211 | |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 212 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 213 | static struct mtd_partition partition_info[] = { |
| 214 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 215 | .name = "linux kernel(nand)", |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 216 | .offset = 0, |
Mike Frysinger | f4585a0 | 2008-10-13 14:45:21 +0800 | [diff] [blame] | 217 | .size = 4 * 1024 * 1024, |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 218 | }, |
| 219 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 220 | .name = "file system(nand)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 221 | .offset = MTDPART_OFS_APPEND, |
| 222 | .size = MTDPART_SIZ_FULL, |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 223 | }, |
| 224 | }; |
| 225 | |
| 226 | static struct bf5xx_nand_platform bf5xx_nand_platform = { |
| 227 | .page_size = NFC_PG_SIZE_256, |
| 228 | .data_width = NFC_NWIDTH_8, |
| 229 | .partitions = partition_info, |
| 230 | .nr_partitions = ARRAY_SIZE(partition_info), |
| 231 | .rd_dly = 3, |
| 232 | .wr_dly = 3, |
| 233 | }; |
| 234 | |
| 235 | static struct resource bf5xx_nand_resources[] = { |
| 236 | { |
| 237 | .start = NFC_CTL, |
| 238 | .end = NFC_DATA_RD + 2, |
| 239 | .flags = IORESOURCE_MEM, |
| 240 | }, |
| 241 | { |
| 242 | .start = CH_NFC, |
| 243 | .end = CH_NFC, |
| 244 | .flags = IORESOURCE_IRQ, |
| 245 | }, |
| 246 | }; |
| 247 | |
| 248 | static struct platform_device bf5xx_nand_device = { |
| 249 | .name = "bf5xx-nand", |
| 250 | .id = 0, |
| 251 | .num_resources = ARRAY_SIZE(bf5xx_nand_resources), |
| 252 | .resource = bf5xx_nand_resources, |
| 253 | .dev = { |
| 254 | .platform_data = &bf5xx_nand_platform, |
| 255 | }, |
| 256 | }; |
| 257 | #endif |
| 258 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 259 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 260 | static struct resource bfin_pcmcia_cf_resources[] = { |
| 261 | { |
| 262 | .start = 0x20310000, /* IO PORT */ |
| 263 | .end = 0x20312000, |
| 264 | .flags = IORESOURCE_MEM, |
| 265 | }, { |
| 266 | .start = 0x20311000, /* Attribute Memory */ |
| 267 | .end = 0x20311FFF, |
| 268 | .flags = IORESOURCE_MEM, |
| 269 | }, { |
| 270 | .start = IRQ_PF4, |
| 271 | .end = IRQ_PF4, |
| 272 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 273 | }, { |
| 274 | .start = 6, /* Card Detect PF6 */ |
| 275 | .end = 6, |
| 276 | .flags = IORESOURCE_IRQ, |
| 277 | }, |
| 278 | }; |
| 279 | |
| 280 | static struct platform_device bfin_pcmcia_cf_device = { |
| 281 | .name = "bfin_cf_pcmcia", |
| 282 | .id = -1, |
| 283 | .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources), |
| 284 | .resource = bfin_pcmcia_cf_resources, |
| 285 | }; |
| 286 | #endif |
| 287 | |
| 288 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 289 | static struct platform_device rtc_device = { |
| 290 | .name = "rtc-bfin", |
| 291 | .id = -1, |
| 292 | }; |
| 293 | #endif |
| 294 | |
| 295 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 296 | static struct resource smc91x_resources[] = { |
| 297 | { |
| 298 | .name = "smc91x-regs", |
| 299 | .start = 0x20300300, |
| 300 | .end = 0x20300300 + 16, |
| 301 | .flags = IORESOURCE_MEM, |
| 302 | }, { |
| 303 | |
| 304 | .start = IRQ_PF7, |
| 305 | .end = IRQ_PF7, |
| 306 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 307 | }, |
| 308 | }; |
| 309 | static struct platform_device smc91x_device = { |
| 310 | .name = "smc91x", |
| 311 | .id = 0, |
| 312 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 313 | .resource = smc91x_resources, |
| 314 | }; |
| 315 | #endif |
| 316 | |
| 317 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 318 | static struct resource dm9000_resources[] = { |
| 319 | [0] = { |
| 320 | .start = 0x203FB800, |
Laurent Pinchart | da3854f | 2008-06-24 22:15:58 +0100 | [diff] [blame] | 321 | .end = 0x203FB800 + 1, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 322 | .flags = IORESOURCE_MEM, |
| 323 | }, |
| 324 | [1] = { |
Laurent Pinchart | da3854f | 2008-06-24 22:15:58 +0100 | [diff] [blame] | 325 | .start = 0x203FB800 + 4, |
| 326 | .end = 0x203FB800 + 5, |
| 327 | .flags = IORESOURCE_MEM, |
| 328 | }, |
| 329 | [2] = { |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 330 | .start = IRQ_PF9, |
| 331 | .end = IRQ_PF9, |
| 332 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), |
| 333 | }, |
| 334 | }; |
| 335 | |
| 336 | static struct platform_device dm9000_device = { |
| 337 | .name = "dm9000", |
| 338 | .id = -1, |
| 339 | .num_resources = ARRAY_SIZE(dm9000_resources), |
| 340 | .resource = dm9000_resources, |
| 341 | }; |
| 342 | #endif |
| 343 | |
| 344 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
| 345 | static struct resource sl811_hcd_resources[] = { |
| 346 | { |
| 347 | .start = 0x20340000, |
| 348 | .end = 0x20340000, |
| 349 | .flags = IORESOURCE_MEM, |
| 350 | }, { |
| 351 | .start = 0x20340004, |
| 352 | .end = 0x20340004, |
| 353 | .flags = IORESOURCE_MEM, |
| 354 | }, { |
| 355 | .start = CONFIG_USB_SL811_BFIN_IRQ, |
| 356 | .end = CONFIG_USB_SL811_BFIN_IRQ, |
| 357 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 358 | }, |
| 359 | }; |
| 360 | |
| 361 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
| 362 | void sl811_port_power(struct device *dev, int is_on) |
| 363 | { |
| 364 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
Michael Hennerich | acbcd26 | 2008-01-22 18:36:20 +0800 | [diff] [blame] | 365 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 366 | } |
| 367 | #endif |
| 368 | |
| 369 | static struct sl811_platform_data sl811_priv = { |
| 370 | .potpg = 10, |
| 371 | .power = 250, /* == 500mA */ |
| 372 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
| 373 | .port_power = &sl811_port_power, |
| 374 | #endif |
| 375 | }; |
| 376 | |
| 377 | static struct platform_device sl811_hcd_device = { |
| 378 | .name = "sl811-hcd", |
| 379 | .id = 0, |
| 380 | .dev = { |
| 381 | .platform_data = &sl811_priv, |
| 382 | }, |
| 383 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), |
| 384 | .resource = sl811_hcd_resources, |
| 385 | }; |
| 386 | #endif |
| 387 | |
| 388 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 389 | static struct resource isp1362_hcd_resources[] = { |
| 390 | { |
| 391 | .start = 0x20360000, |
| 392 | .end = 0x20360000, |
| 393 | .flags = IORESOURCE_MEM, |
| 394 | }, { |
| 395 | .start = 0x20360004, |
| 396 | .end = 0x20360004, |
| 397 | .flags = IORESOURCE_MEM, |
| 398 | }, { |
| 399 | .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
| 400 | .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
| 401 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 402 | }, |
| 403 | }; |
| 404 | |
| 405 | static struct isp1362_platform_data isp1362_priv = { |
| 406 | .sel15Kres = 1, |
| 407 | .clknotstop = 0, |
| 408 | .oc_enable = 0, |
| 409 | .int_act_high = 0, |
| 410 | .int_edge_triggered = 0, |
| 411 | .remote_wakeup_connected = 0, |
| 412 | .no_power_switching = 1, |
| 413 | .power_switching_mode = 0, |
| 414 | }; |
| 415 | |
| 416 | static struct platform_device isp1362_hcd_device = { |
| 417 | .name = "isp1362-hcd", |
| 418 | .id = 0, |
| 419 | .dev = { |
| 420 | .platform_data = &isp1362_priv, |
| 421 | }, |
| 422 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), |
| 423 | .resource = isp1362_hcd_resources, |
| 424 | }; |
| 425 | #endif |
| 426 | |
| 427 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 428 | static struct platform_device bfin_mii_bus = { |
| 429 | .name = "bfin_mii_bus", |
| 430 | }; |
| 431 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 432 | static struct platform_device bfin_mac_device = { |
| 433 | .name = "bfin_mac", |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 434 | .dev.platform_data = &bfin_mii_bus, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 435 | }; |
| 436 | #endif |
| 437 | |
| 438 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 439 | static struct resource net2272_bfin_resources[] = { |
| 440 | { |
| 441 | .start = 0x20300000, |
| 442 | .end = 0x20300000 + 0x100, |
| 443 | .flags = IORESOURCE_MEM, |
| 444 | }, { |
| 445 | .start = IRQ_PF7, |
| 446 | .end = IRQ_PF7, |
| 447 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 448 | }, |
| 449 | }; |
| 450 | |
| 451 | static struct platform_device net2272_bfin_device = { |
| 452 | .name = "net2272", |
| 453 | .id = -1, |
| 454 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 455 | .resource = net2272_bfin_resources, |
| 456 | }; |
| 457 | #endif |
| 458 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [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)", |
Grace Pan | ac76d88 | 2008-04-24 06:33:56 +0800 | [diff] [blame] | 464 | .size = 0x00040000, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 465 | .offset = 0, |
| 466 | .mask_flags = MTD_CAP_ROM |
| 467 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 468 | .name = "linux kernel(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 469 | .size = MTDPART_SIZ_FULL, |
| 470 | .offset = MTDPART_OFS_APPEND, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 471 | } |
| 472 | }; |
| 473 | |
| 474 | static struct flash_platform_data bfin_spi_flash_data = { |
| 475 | .name = "m25p80", |
| 476 | .parts = bfin_spi_flash_partitions, |
| 477 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
Michael Hennerich | b9c9e78 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 478 | .type = "m25p16", |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 479 | }; |
| 480 | |
| 481 | /* SPI flash chip (m25p64) */ |
| 482 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 483 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 484 | .bits_per_word = 8, |
| 485 | }; |
| 486 | #endif |
| 487 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 488 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
| 489 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 490 | /* SPI ADC chip */ |
| 491 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
| 492 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 493 | .bits_per_word = 16, |
| 494 | }; |
| 495 | #endif |
| 496 | |
| 497 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 498 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 499 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 500 | .enable_dma = 0, |
| 501 | .bits_per_word = 16, |
| 502 | }; |
| 503 | #endif |
| 504 | |
| 505 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 506 | static struct bfin5xx_spi_chip ad9960_spi_chip_info = { |
| 507 | .enable_dma = 0, |
| 508 | .bits_per_word = 16, |
| 509 | }; |
| 510 | #endif |
| 511 | |
Yi Li | ffdf3ec | 2009-03-31 10:36:51 +0000 | [diff] [blame] | 512 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 513 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
| 514 | .enable_dma = 0, |
| 515 | .bits_per_word = 8, |
| 516 | }; |
| 517 | #endif |
| 518 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 519 | #if defined(CONFIG_PBX) |
| 520 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { |
| 521 | .ctl_reg = 0x4, /* send zero */ |
| 522 | .enable_dma = 0, |
| 523 | .bits_per_word = 8, |
| 524 | .cs_change_per_word = 1, |
| 525 | }; |
| 526 | #endif |
| 527 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 528 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
| 529 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { |
| 530 | .enable_dma = 0, |
| 531 | .bits_per_word = 16, |
| 532 | }; |
| 533 | |
| 534 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { |
| 535 | .model = 7877, |
| 536 | .vref_delay_usecs = 50, /* internal, no capacitor */ |
| 537 | .x_plate_ohms = 419, |
| 538 | .y_plate_ohms = 486, |
| 539 | .pressure_max = 1000, |
| 540 | .pressure_min = 0, |
| 541 | .stopacq_polarity = 1, |
| 542 | .first_conversion_delay = 3, |
| 543 | .acquisition_time = 1, |
| 544 | .averaging = 1, |
| 545 | .pen_down_acc_interval = 1, |
| 546 | }; |
| 547 | #endif |
| 548 | |
Michael Hennerich | 5105432 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 549 | #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) |
| 550 | #include <linux/spi/ad7879.h> |
| 551 | static const struct ad7879_platform_data bfin_ad7879_ts_info = { |
| 552 | .model = 7879, /* Model = AD7879 */ |
| 553 | .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */ |
| 554 | .pressure_max = 10000, |
| 555 | .pressure_min = 0, |
| 556 | .first_conversion_delay = 3, /* wait 512us before do a first conversion */ |
| 557 | .acquisition_time = 1, /* 4us acquisition time per sample */ |
| 558 | .median = 2, /* do 8 measurements */ |
| 559 | .averaging = 1, /* take the average of 4 middle samples */ |
| 560 | .pen_down_acc_interval = 255, /* 9.4 ms */ |
| 561 | .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */ |
| 562 | .gpio_default = 1, /* During initialization set GPIO = HIGH */ |
| 563 | }; |
| 564 | #endif |
| 565 | |
| 566 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
| 567 | static struct bfin5xx_spi_chip spi_ad7879_chip_info = { |
| 568 | .enable_dma = 0, |
| 569 | .bits_per_word = 16, |
| 570 | }; |
| 571 | #endif |
| 572 | |
Michael Hennerich | c7d4896 | 2007-11-15 21:33:31 +0800 | [diff] [blame] | 573 | #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ |
Michael Hennerich | 0954f70 | 2007-11-13 00:16:19 +0800 | [diff] [blame] | 574 | && defined(CONFIG_SND_SOC_WM8731_SPI) |
| 575 | static struct bfin5xx_spi_chip spi_wm8731_chip_info = { |
| 576 | .enable_dma = 0, |
| 577 | .bits_per_word = 16, |
| 578 | }; |
| 579 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 580 | |
| 581 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 582 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 583 | .enable_dma = 0, |
| 584 | .bits_per_word = 8, |
| 585 | }; |
| 586 | #endif |
| 587 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 588 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 589 | #if defined(CONFIG_MTD_M25P80) \ |
| 590 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 591 | { |
| 592 | /* the modalias must be the same as spi device driver name */ |
| 593 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 594 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
| 595 | .bus_num = 0, /* Framework bus number */ |
| 596 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
| 597 | .platform_data = &bfin_spi_flash_data, |
| 598 | .controller_data = &spi_flash_chip_info, |
| 599 | .mode = SPI_MODE_3, |
| 600 | }, |
| 601 | #endif |
| 602 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 603 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
| 604 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 605 | { |
| 606 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 607 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
| 608 | .bus_num = 0, /* Framework bus number */ |
| 609 | .chip_select = 1, /* Framework chip select. */ |
| 610 | .platform_data = NULL, /* No spi_driver specific config */ |
| 611 | .controller_data = &spi_adc_chip_info, |
| 612 | }, |
| 613 | #endif |
| 614 | |
| 615 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 616 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 617 | { |
| 618 | .modalias = "ad1836-spi", |
| 619 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 620 | .bus_num = 0, |
| 621 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 622 | .controller_data = &ad1836_spi_chip_info, |
| 623 | }, |
| 624 | #endif |
| 625 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
| 626 | { |
| 627 | .modalias = "ad9960-spi", |
| 628 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
| 629 | .bus_num = 0, |
| 630 | .chip_select = 1, |
| 631 | .controller_data = &ad9960_spi_chip_info, |
| 632 | }, |
| 633 | #endif |
Yi Li | ffdf3ec | 2009-03-31 10:36:51 +0000 | [diff] [blame] | 634 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 635 | { |
| 636 | .modalias = "mmc_spi", |
| 637 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 638 | .bus_num = 0, |
| 639 | .chip_select = 3, |
| 640 | .controller_data = &mmc_spi_chip_info, |
| 641 | .mode = SPI_MODE_0, |
| 642 | }, |
| 643 | #endif |
| 644 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 645 | #if defined(CONFIG_PBX) |
| 646 | { |
| 647 | .modalias = "fxs-spi", |
| 648 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
| 649 | .bus_num = 0, |
| 650 | .chip_select = 8 - CONFIG_J11_JUMPER, |
| 651 | .controller_data = &spi_si3xxx_chip_info, |
| 652 | .mode = SPI_MODE_3, |
| 653 | }, |
| 654 | { |
| 655 | .modalias = "fxo-spi", |
| 656 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
| 657 | .bus_num = 0, |
| 658 | .chip_select = 8 - CONFIG_J19_JUMPER, |
| 659 | .controller_data = &spi_si3xxx_chip_info, |
| 660 | .mode = SPI_MODE_3, |
| 661 | }, |
| 662 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 663 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
| 664 | { |
| 665 | .modalias = "ad7877", |
| 666 | .platform_data = &bfin_ad7877_ts_info, |
Bryan Wu | 2eb74ae | 2008-05-31 15:17:25 +0800 | [diff] [blame] | 667 | .irq = IRQ_PF8, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 668 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Michael Hennerich | 0954f70 | 2007-11-13 00:16:19 +0800 | [diff] [blame] | 669 | .bus_num = 0, |
Bryan Wu | 2eb74ae | 2008-05-31 15:17:25 +0800 | [diff] [blame] | 670 | .chip_select = 2, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 671 | .controller_data = &spi_ad7877_chip_info, |
| 672 | }, |
| 673 | #endif |
Michael Hennerich | 5105432 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 674 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
| 675 | { |
| 676 | .modalias = "ad7879", |
| 677 | .platform_data = &bfin_ad7879_ts_info, |
| 678 | .irq = IRQ_PF8, |
| 679 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ |
| 680 | .bus_num = 0, |
| 681 | .chip_select = 3, |
| 682 | .controller_data = &spi_ad7879_chip_info, |
| 683 | .mode = SPI_CPHA | SPI_CPOL, |
| 684 | }, |
| 685 | #endif |
Michael Hennerich | c7d4896 | 2007-11-15 21:33:31 +0800 | [diff] [blame] | 686 | #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ |
Michael Hennerich | 0954f70 | 2007-11-13 00:16:19 +0800 | [diff] [blame] | 687 | && defined(CONFIG_SND_SOC_WM8731_SPI) |
| 688 | { |
| 689 | .modalias = "wm8731", |
| 690 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 691 | .bus_num = 0, |
| 692 | .chip_select = 5, |
| 693 | .controller_data = &spi_wm8731_chip_info, |
| 694 | .mode = SPI_MODE_0, |
| 695 | }, |
| 696 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 697 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 698 | { |
| 699 | .modalias = "spidev", |
| 700 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 701 | .bus_num = 0, |
| 702 | .chip_select = 1, |
| 703 | .controller_data = &spidev_chip_info, |
| 704 | }, |
| 705 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 706 | }; |
| 707 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 708 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 709 | /* SPI controller data */ |
| 710 | static struct bfin5xx_spi_master bfin_spi0_info = { |
| 711 | .num_chipselect = 8, |
| 712 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 713 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 714 | }; |
| 715 | |
| 716 | /* SPI (0) */ |
| 717 | static struct resource bfin_spi0_resource[] = { |
| 718 | [0] = { |
| 719 | .start = SPI0_REGBASE, |
| 720 | .end = SPI0_REGBASE + 0xFF, |
| 721 | .flags = IORESOURCE_MEM, |
| 722 | }, |
| 723 | [1] = { |
| 724 | .start = CH_SPI, |
| 725 | .end = CH_SPI, |
| 726 | .flags = IORESOURCE_IRQ, |
| 727 | }, |
| 728 | }; |
| 729 | |
| 730 | static struct platform_device bfin_spi0_device = { |
| 731 | .name = "bfin-spi", |
| 732 | .id = 0, /* Bus number */ |
| 733 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 734 | .resource = bfin_spi0_resource, |
| 735 | .dev = { |
| 736 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
| 737 | }, |
| 738 | }; |
| 739 | #endif /* spi master and devices */ |
| 740 | |
| 741 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
| 742 | static struct platform_device bfin_fb_device = { |
| 743 | .name = "bf537-lq035", |
| 744 | }; |
| 745 | #endif |
| 746 | |
| 747 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 748 | static struct platform_device bfin_fb_adv7393_device = { |
| 749 | .name = "bfin-adv7393", |
| 750 | }; |
| 751 | #endif |
| 752 | |
| 753 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 754 | static struct resource bfin_uart_resources[] = { |
| 755 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 756 | { |
| 757 | .start = 0xFFC00400, |
| 758 | .end = 0xFFC004FF, |
| 759 | .flags = IORESOURCE_MEM, |
| 760 | }, |
| 761 | #endif |
| 762 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 763 | { |
| 764 | .start = 0xFFC02000, |
| 765 | .end = 0xFFC020FF, |
| 766 | .flags = IORESOURCE_MEM, |
| 767 | }, |
| 768 | #endif |
| 769 | }; |
| 770 | |
| 771 | static struct platform_device bfin_uart_device = { |
| 772 | .name = "bfin-uart", |
| 773 | .id = 1, |
| 774 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 775 | .resource = bfin_uart_resources, |
| 776 | }; |
| 777 | #endif |
| 778 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 779 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 780 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 781 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 782 | { |
| 783 | .start = 0xFFC00400, |
| 784 | .end = 0xFFC004FF, |
| 785 | .flags = IORESOURCE_MEM, |
| 786 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 787 | { |
| 788 | .start = IRQ_UART0_RX, |
| 789 | .end = IRQ_UART0_RX+1, |
| 790 | .flags = IORESOURCE_IRQ, |
| 791 | }, |
| 792 | { |
| 793 | .start = CH_UART0_RX, |
| 794 | .end = CH_UART0_RX+1, |
| 795 | .flags = IORESOURCE_DMA, |
| 796 | }, |
| 797 | }; |
| 798 | |
| 799 | static struct platform_device bfin_sir0_device = { |
| 800 | .name = "bfin_sir", |
| 801 | .id = 0, |
| 802 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 803 | .resource = bfin_sir0_resources, |
| 804 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 805 | #endif |
| 806 | #ifdef CONFIG_BFIN_SIR1 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 807 | static struct resource bfin_sir1_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 808 | { |
| 809 | .start = 0xFFC02000, |
| 810 | .end = 0xFFC020FF, |
| 811 | .flags = IORESOURCE_MEM, |
| 812 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 813 | { |
| 814 | .start = IRQ_UART1_RX, |
| 815 | .end = IRQ_UART1_RX+1, |
| 816 | .flags = IORESOURCE_IRQ, |
| 817 | }, |
| 818 | { |
| 819 | .start = CH_UART1_RX, |
| 820 | .end = CH_UART1_RX+1, |
| 821 | .flags = IORESOURCE_DMA, |
| 822 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 823 | }; |
| 824 | |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 825 | static struct platform_device bfin_sir1_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 826 | .name = "bfin_sir", |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 827 | .id = 1, |
| 828 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), |
| 829 | .resource = bfin_sir1_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 830 | }; |
| 831 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 832 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 833 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 834 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 835 | static struct resource bfin_twi0_resource[] = { |
| 836 | [0] = { |
| 837 | .start = TWI0_REGBASE, |
| 838 | .end = TWI0_REGBASE, |
| 839 | .flags = IORESOURCE_MEM, |
| 840 | }, |
| 841 | [1] = { |
| 842 | .start = IRQ_TWI, |
| 843 | .end = IRQ_TWI, |
| 844 | .flags = IORESOURCE_IRQ, |
| 845 | }, |
| 846 | }; |
| 847 | |
| 848 | static struct platform_device i2c_bfin_twi_device = { |
| 849 | .name = "i2c-bfin-twi", |
| 850 | .id = 0, |
| 851 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 852 | .resource = bfin_twi0_resource, |
| 853 | }; |
| 854 | #endif |
| 855 | |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 856 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 857 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 858 | { |
| 859 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 860 | }, |
| 861 | #endif |
| 862 | #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) |
| 863 | { |
| 864 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 865 | .irq = IRQ_PF8, |
| 866 | }, |
| 867 | #endif |
| 868 | }; |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 869 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 870 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 871 | static struct platform_device bfin_sport0_uart_device = { |
| 872 | .name = "bfin-sport-uart", |
| 873 | .id = 0, |
| 874 | }; |
| 875 | |
| 876 | static struct platform_device bfin_sport1_uart_device = { |
| 877 | .name = "bfin-sport-uart", |
| 878 | .id = 1, |
| 879 | }; |
| 880 | #endif |
| 881 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 882 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 883 | #include <linux/input.h> |
| 884 | #include <linux/gpio_keys.h> |
| 885 | |
| 886 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 887 | {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"}, |
| 888 | {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"}, |
| 889 | }; |
| 890 | |
| 891 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 892 | .buttons = bfin_gpio_keys_table, |
| 893 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 894 | }; |
| 895 | |
| 896 | static struct platform_device bfin_device_gpiokeys = { |
| 897 | .name = "gpio-keys", |
| 898 | .dev = { |
| 899 | .platform_data = &bfin_gpio_keys_data, |
| 900 | }, |
| 901 | }; |
| 902 | #endif |
| 903 | |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 904 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) |
| 905 | #include <linux/input.h> |
| 906 | #include <asm/bfin_rotary.h> |
| 907 | |
| 908 | static struct bfin_rotary_platform_data bfin_rotary_data = { |
| 909 | /*.rotary_up_key = KEY_UP,*/ |
| 910 | /*.rotary_down_key = KEY_DOWN,*/ |
| 911 | .rotary_rel_code = REL_WHEEL, |
| 912 | .rotary_button_key = KEY_ENTER, |
| 913 | .debounce = 10, /* 0..17 */ |
| 914 | .mode = ROT_QUAD_ENC | ROT_DEBE, |
| 915 | }; |
| 916 | |
| 917 | static struct resource bfin_rotary_resources[] = { |
| 918 | { |
| 919 | .start = IRQ_CNT, |
| 920 | .end = IRQ_CNT, |
| 921 | .flags = IORESOURCE_IRQ, |
| 922 | }, |
| 923 | }; |
| 924 | |
| 925 | static struct platform_device bfin_rotary_device = { |
| 926 | .name = "bfin-rotary", |
| 927 | .id = -1, |
| 928 | .num_resources = ARRAY_SIZE(bfin_rotary_resources), |
| 929 | .resource = bfin_rotary_resources, |
| 930 | .dev = { |
| 931 | .platform_data = &bfin_rotary_data, |
| 932 | }, |
| 933 | }; |
| 934 | #endif |
| 935 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 936 | static struct resource bfin_gpios_resources = { |
| 937 | .start = 0, |
| 938 | .end = MAX_BLACKFIN_GPIOS - 1, |
| 939 | .flags = IORESOURCE_IRQ, |
| 940 | }; |
| 941 | |
| 942 | static struct platform_device bfin_gpios_device = { |
| 943 | .name = "simple-gpio", |
| 944 | .id = -1, |
| 945 | .num_resources = 1, |
| 946 | .resource = &bfin_gpios_resources, |
| 947 | }; |
| 948 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 949 | static const unsigned int cclk_vlev_datasheet[] = |
| 950 | { |
| 951 | VRPAIR(VLEV_100, 400000000), |
| 952 | VRPAIR(VLEV_105, 426000000), |
| 953 | VRPAIR(VLEV_110, 500000000), |
| 954 | VRPAIR(VLEV_115, 533000000), |
| 955 | VRPAIR(VLEV_120, 600000000), |
| 956 | }; |
| 957 | |
| 958 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 959 | .tuple_tab = cclk_vlev_datasheet, |
| 960 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 961 | .vr_settling_time = 25 /* us */, |
| 962 | }; |
| 963 | |
| 964 | static struct platform_device bfin_dpmc = { |
| 965 | .name = "bfin dpmc", |
| 966 | .dev = { |
| 967 | .platform_data = &bfin_dmpc_vreg_data, |
| 968 | }, |
| 969 | }; |
| 970 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 971 | static struct platform_device *stamp_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 972 | |
| 973 | &bfin_dpmc, |
| 974 | |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 975 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 976 | &bf5xx_nand_device, |
| 977 | #endif |
| 978 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 979 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 980 | &bfin_pcmcia_cf_device, |
| 981 | #endif |
| 982 | |
| 983 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 984 | &rtc_device, |
| 985 | #endif |
| 986 | |
| 987 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
| 988 | &sl811_hcd_device, |
| 989 | #endif |
| 990 | |
| 991 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| 992 | &isp1362_hcd_device, |
| 993 | #endif |
| 994 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 995 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 996 | &bfin_isp1760_device, |
| 997 | #endif |
| 998 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 999 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 1000 | &musb_device, |
| 1001 | #endif |
| 1002 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1003 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 1004 | &smc91x_device, |
| 1005 | #endif |
| 1006 | |
| 1007 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 1008 | &dm9000_device, |
| 1009 | #endif |
| 1010 | |
| 1011 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1012 | &bfin_mii_bus, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1013 | &bfin_mac_device, |
| 1014 | #endif |
| 1015 | |
| 1016 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 1017 | &net2272_bfin_device, |
| 1018 | #endif |
| 1019 | |
| 1020 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 1021 | &bfin_spi0_device, |
| 1022 | #endif |
| 1023 | |
| 1024 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
| 1025 | &bfin_fb_device, |
| 1026 | #endif |
| 1027 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 1028 | #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE) |
| 1029 | &bf52x_t350mcqb_device, |
| 1030 | #endif |
| 1031 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1032 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 1033 | &bfin_fb_adv7393_device, |
| 1034 | #endif |
| 1035 | |
| 1036 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 1037 | &bfin_uart_device, |
| 1038 | #endif |
| 1039 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1040 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1041 | #ifdef CONFIG_BFIN_SIR0 |
| 1042 | &bfin_sir0_device, |
| 1043 | #endif |
| 1044 | #ifdef CONFIG_BFIN_SIR1 |
| 1045 | &bfin_sir1_device, |
| 1046 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1047 | #endif |
| 1048 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1049 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 1050 | &i2c_bfin_twi_device, |
| 1051 | #endif |
| 1052 | |
| 1053 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 1054 | &bfin_sport0_uart_device, |
| 1055 | &bfin_sport1_uart_device, |
| 1056 | #endif |
| 1057 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 1058 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 1059 | &bfin_device_gpiokeys, |
| 1060 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 1061 | |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 1062 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) |
| 1063 | &bfin_rotary_device, |
| 1064 | #endif |
| 1065 | |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1066 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
| 1067 | &ezkit_flash_device, |
| 1068 | #endif |
| 1069 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 1070 | &bfin_gpios_device, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1071 | }; |
| 1072 | |
Mike Frysinger | 7f6678c | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1073 | static int __init ezkit_init(void) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1074 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 1075 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1076 | i2c_register_board_info(0, bfin_i2c_board_info, |
| 1077 | ARRAY_SIZE(bfin_i2c_board_info)); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1078 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1079 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1080 | return 0; |
| 1081 | } |
| 1082 | |
Mike Frysinger | 7f6678c | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1083 | arch_initcall(ezkit_init); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1084 | |
| 1085 | void native_machine_restart(char *cmd) |
| 1086 | { |
| 1087 | /* workaround reboot hang when booting from SPI */ |
| 1088 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
Sonic Zhang | b52dae3 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1089 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1090 | } |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1091 | |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1092 | void bfin_get_ether_addr(char *addr) |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1093 | { |
Mike Frysinger | 181afa94 | 2008-02-25 11:42:17 +0800 | [diff] [blame] | 1094 | /* the MAC is stored in OTP memory page 0xDF */ |
| 1095 | u32 ret; |
| 1096 | u64 otp_mac; |
| 1097 | u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A; |
| 1098 | |
| 1099 | ret = otp_read(0xDF, 0x00, &otp_mac); |
| 1100 | if (!(ret & 0x1)) { |
| 1101 | char *otp_mac_p = (char *)&otp_mac; |
| 1102 | for (ret = 0; ret < 6; ++ret) |
| 1103 | addr[ret] = otp_mac_p[5 - ret]; |
| 1104 | } |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1105 | } |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1106 | EXPORT_SYMBOL(bfin_get_ether_addr); |