Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [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> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 5 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 6 | * Licensed under the GPL-2 or later. |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <linux/device.h> |
| 10 | #include <linux/platform_device.h> |
| 11 | #include <linux/mtd/mtd.h> |
| 12 | #include <linux/mtd/partitions.h> |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 13 | #include <linux/mtd/physmap.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 14 | #include <linux/spi/spi.h> |
| 15 | #include <linux/spi/flash.h> |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 16 | #include <linux/i2c.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 17 | #include <linux/irq.h> |
| 18 | #include <linux/interrupt.h> |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 19 | #include <linux/usb/musb.h> |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 20 | #include <linux/leds.h> |
| 21 | #include <linux/input.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 22 | #include <asm/dma.h> |
| 23 | #include <asm/bfin5xx_spi.h> |
| 24 | #include <asm/reboot.h> |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 25 | #include <asm/nand.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 26 | #include <asm/portmux.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 27 | #include <asm/dpmc.h> |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 28 | #include <linux/spi/ad7877.h> |
| 29 | |
| 30 | /* |
| 31 | * Name the Board for the /proc/cpuinfo |
| 32 | */ |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 33 | #ifdef CONFIG_BFIN527_EZKIT_V2 |
| 34 | const char bfin_board_name[] = "ADI BF527-EZKIT V2"; |
| 35 | #else |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 36 | const char bfin_board_name[] = "ADI BF527-EZKIT"; |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 37 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 38 | |
| 39 | /* |
| 40 | * Driver needs to know address, irq and flag pin. |
| 41 | */ |
| 42 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 43 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 44 | #include <linux/usb/isp1760.h> |
| 45 | static struct resource bfin_isp1760_resources[] = { |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 46 | [0] = { |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 47 | .start = 0x203C0000, |
| 48 | .end = 0x203C0000 + 0x000fffff, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 49 | .flags = IORESOURCE_MEM, |
| 50 | }, |
| 51 | [1] = { |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 52 | .start = IRQ_PF7, |
| 53 | .end = IRQ_PF7, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 54 | .flags = IORESOURCE_IRQ, |
| 55 | }, |
| 56 | }; |
| 57 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 58 | static struct isp1760_platform_data isp1760_priv = { |
| 59 | .is_isp1761 = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 60 | .bus_width_16 = 1, |
| 61 | .port1_otg = 0, |
| 62 | .analog_oc = 0, |
| 63 | .dack_polarity_high = 0, |
| 64 | .dreq_polarity_high = 0, |
| 65 | }; |
| 66 | |
| 67 | static struct platform_device bfin_isp1760_device = { |
Michael Hennerich | c6feb768 | 2009-10-15 10:37:33 +0000 | [diff] [blame] | 68 | .name = "isp1760", |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 69 | .id = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 70 | .dev = { |
| 71 | .platform_data = &isp1760_priv, |
| 72 | }, |
| 73 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), |
| 74 | .resource = bfin_isp1760_resources, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 75 | }; |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 76 | #endif |
| 77 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 78 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 79 | static struct resource musb_resources[] = { |
| 80 | [0] = { |
| 81 | .start = 0xffc03800, |
| 82 | .end = 0xffc03cff, |
| 83 | .flags = IORESOURCE_MEM, |
| 84 | }, |
| 85 | [1] = { /* general IRQ */ |
| 86 | .start = IRQ_USB_INT0, |
| 87 | .end = IRQ_USB_INT0, |
| 88 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 89 | }, |
| 90 | [2] = { /* DMA IRQ */ |
| 91 | .start = IRQ_USB_DMA, |
| 92 | .end = IRQ_USB_DMA, |
| 93 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 94 | }, |
| 95 | }; |
| 96 | |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 97 | static struct musb_hdrc_config musb_config = { |
| 98 | .multipoint = 0, |
| 99 | .dyn_fifo = 0, |
| 100 | .soft_con = 1, |
| 101 | .dma = 1, |
Bryan Wu | fea05da | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 102 | .num_eps = 8, |
| 103 | .dma_channels = 8, |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 104 | .gpio_vrsel = GPIO_PG13, |
Cliff Cai | 85eb0e4 | 2010-01-22 04:02:46 +0000 | [diff] [blame] | 105 | /* Some custom boards need to be active low, just set it to "0" |
| 106 | * if it is the case. |
| 107 | */ |
| 108 | .gpio_vrsel_active = 1, |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 109 | }; |
| 110 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 111 | static struct musb_hdrc_platform_data musb_plat = { |
| 112 | #if defined(CONFIG_USB_MUSB_OTG) |
| 113 | .mode = MUSB_OTG, |
| 114 | #elif defined(CONFIG_USB_MUSB_HDRC_HCD) |
| 115 | .mode = MUSB_HOST, |
| 116 | #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) |
| 117 | .mode = MUSB_PERIPHERAL, |
| 118 | #endif |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 119 | .config = &musb_config, |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 120 | }; |
| 121 | |
| 122 | static u64 musb_dmamask = ~(u32)0; |
| 123 | |
| 124 | static struct platform_device musb_device = { |
| 125 | .name = "musb_hdrc", |
| 126 | .id = 0, |
| 127 | .dev = { |
| 128 | .dma_mask = &musb_dmamask, |
| 129 | .coherent_dma_mask = 0xffffffff, |
| 130 | .platform_data = &musb_plat, |
| 131 | }, |
| 132 | .num_resources = ARRAY_SIZE(musb_resources), |
| 133 | .resource = musb_resources, |
| 134 | }; |
| 135 | #endif |
| 136 | |
| 137 | #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE) |
| 138 | |
| 139 | static struct resource bf52x_t350mcqb_resources[] = { |
| 140 | { |
| 141 | .start = IRQ_PPI_ERROR, |
| 142 | .end = IRQ_PPI_ERROR, |
| 143 | .flags = IORESOURCE_IRQ, |
| 144 | }, |
| 145 | }; |
| 146 | |
| 147 | static struct platform_device bf52x_t350mcqb_device = { |
| 148 | .name = "bfin-t350mcqb", |
| 149 | .id = -1, |
| 150 | .num_resources = ARRAY_SIZE(bf52x_t350mcqb_resources), |
| 151 | .resource = bf52x_t350mcqb_resources, |
| 152 | }; |
| 153 | #endif |
| 154 | |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 155 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 156 | #include <asm/bfin-lq035q1.h> |
| 157 | |
| 158 | static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { |
| 159 | .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB, |
Michael Hennerich | d94a1aa | 2009-12-08 11:45:55 +0000 | [diff] [blame] | 160 | .ppi_mode = USE_RGB565_8_BIT_PPI, |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | static struct resource bfin_lq035q1_resources[] = { |
| 164 | { |
| 165 | .start = IRQ_PPI_ERROR, |
| 166 | .end = IRQ_PPI_ERROR, |
| 167 | .flags = IORESOURCE_IRQ, |
| 168 | }, |
| 169 | }; |
| 170 | |
| 171 | static struct platform_device bfin_lq035q1_device = { |
| 172 | .name = "bfin-lq035q1", |
| 173 | .id = -1, |
| 174 | .num_resources = ARRAY_SIZE(bfin_lq035q1_resources), |
| 175 | .resource = bfin_lq035q1_resources, |
| 176 | .dev = { |
| 177 | .platform_data = &bfin_lq035q1_data, |
| 178 | }, |
| 179 | }; |
| 180 | #endif |
| 181 | |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 182 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
| 183 | static struct mtd_partition ezkit_partitions[] = { |
| 184 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 185 | .name = "bootloader(nor)", |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 186 | .size = 0x40000, |
| 187 | .offset = 0, |
| 188 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 189 | .name = "linux kernel(nor)", |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 190 | .size = 0x1C0000, |
| 191 | .offset = MTDPART_OFS_APPEND, |
| 192 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 193 | .name = "file system(nor)", |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 194 | .size = MTDPART_SIZ_FULL, |
| 195 | .offset = MTDPART_OFS_APPEND, |
| 196 | } |
| 197 | }; |
| 198 | |
| 199 | static struct physmap_flash_data ezkit_flash_data = { |
| 200 | .width = 2, |
| 201 | .parts = ezkit_partitions, |
| 202 | .nr_parts = ARRAY_SIZE(ezkit_partitions), |
| 203 | }; |
| 204 | |
| 205 | static struct resource ezkit_flash_resource = { |
| 206 | .start = 0x20000000, |
| 207 | .end = 0x203fffff, |
| 208 | .flags = IORESOURCE_MEM, |
| 209 | }; |
| 210 | |
| 211 | static struct platform_device ezkit_flash_device = { |
| 212 | .name = "physmap-flash", |
| 213 | .id = 0, |
| 214 | .dev = { |
| 215 | .platform_data = &ezkit_flash_data, |
| 216 | }, |
| 217 | .num_resources = 1, |
| 218 | .resource = &ezkit_flash_resource, |
| 219 | }; |
| 220 | #endif |
| 221 | |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 222 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 223 | static struct mtd_partition partition_info[] = { |
| 224 | { |
Mike Frysinger | 5cc1c56 | 2010-09-22 02:46:44 +0000 | [diff] [blame] | 225 | .name = "bootloader(nand)", |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 226 | .offset = 0, |
Mike Frysinger | 5cc1c56 | 2010-09-22 02:46:44 +0000 | [diff] [blame] | 227 | .size = 0x40000, |
| 228 | }, { |
| 229 | .name = "linux kernel(nand)", |
| 230 | .offset = MTDPART_OFS_APPEND, |
Mike Frysinger | f4585a0 | 2008-10-13 14:45:21 +0800 | [diff] [blame] | 231 | .size = 4 * 1024 * 1024, |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 232 | }, |
| 233 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 234 | .name = "file system(nand)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 235 | .offset = MTDPART_OFS_APPEND, |
| 236 | .size = MTDPART_SIZ_FULL, |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 237 | }, |
| 238 | }; |
| 239 | |
| 240 | static struct bf5xx_nand_platform bf5xx_nand_platform = { |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 241 | .data_width = NFC_NWIDTH_8, |
| 242 | .partitions = partition_info, |
| 243 | .nr_partitions = ARRAY_SIZE(partition_info), |
| 244 | .rd_dly = 3, |
| 245 | .wr_dly = 3, |
| 246 | }; |
| 247 | |
| 248 | static struct resource bf5xx_nand_resources[] = { |
| 249 | { |
| 250 | .start = NFC_CTL, |
| 251 | .end = NFC_DATA_RD + 2, |
| 252 | .flags = IORESOURCE_MEM, |
| 253 | }, |
| 254 | { |
| 255 | .start = CH_NFC, |
| 256 | .end = CH_NFC, |
| 257 | .flags = IORESOURCE_IRQ, |
| 258 | }, |
| 259 | }; |
| 260 | |
| 261 | static struct platform_device bf5xx_nand_device = { |
| 262 | .name = "bf5xx-nand", |
| 263 | .id = 0, |
| 264 | .num_resources = ARRAY_SIZE(bf5xx_nand_resources), |
| 265 | .resource = bf5xx_nand_resources, |
| 266 | .dev = { |
| 267 | .platform_data = &bf5xx_nand_platform, |
| 268 | }, |
| 269 | }; |
| 270 | #endif |
| 271 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 272 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 273 | static struct resource bfin_pcmcia_cf_resources[] = { |
| 274 | { |
| 275 | .start = 0x20310000, /* IO PORT */ |
| 276 | .end = 0x20312000, |
| 277 | .flags = IORESOURCE_MEM, |
| 278 | }, { |
| 279 | .start = 0x20311000, /* Attribute Memory */ |
| 280 | .end = 0x20311FFF, |
| 281 | .flags = IORESOURCE_MEM, |
| 282 | }, { |
| 283 | .start = IRQ_PF4, |
| 284 | .end = IRQ_PF4, |
| 285 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 286 | }, { |
| 287 | .start = 6, /* Card Detect PF6 */ |
| 288 | .end = 6, |
| 289 | .flags = IORESOURCE_IRQ, |
| 290 | }, |
| 291 | }; |
| 292 | |
| 293 | static struct platform_device bfin_pcmcia_cf_device = { |
| 294 | .name = "bfin_cf_pcmcia", |
| 295 | .id = -1, |
| 296 | .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources), |
| 297 | .resource = bfin_pcmcia_cf_resources, |
| 298 | }; |
| 299 | #endif |
| 300 | |
| 301 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 302 | static struct platform_device rtc_device = { |
| 303 | .name = "rtc-bfin", |
| 304 | .id = -1, |
| 305 | }; |
| 306 | #endif |
| 307 | |
| 308 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 309 | #include <linux/smc91x.h> |
| 310 | |
| 311 | static struct smc91x_platdata smc91x_info = { |
| 312 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 313 | .leda = RPC_LED_100_10, |
| 314 | .ledb = RPC_LED_TX_RX, |
| 315 | }; |
| 316 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 317 | static struct resource smc91x_resources[] = { |
| 318 | { |
| 319 | .name = "smc91x-regs", |
| 320 | .start = 0x20300300, |
| 321 | .end = 0x20300300 + 16, |
| 322 | .flags = IORESOURCE_MEM, |
| 323 | }, { |
| 324 | |
| 325 | .start = IRQ_PF7, |
| 326 | .end = IRQ_PF7, |
| 327 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 328 | }, |
| 329 | }; |
| 330 | static struct platform_device smc91x_device = { |
| 331 | .name = "smc91x", |
| 332 | .id = 0, |
| 333 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 334 | .resource = smc91x_resources, |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 335 | .dev = { |
| 336 | .platform_data = &smc91x_info, |
| 337 | }, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 338 | }; |
| 339 | #endif |
| 340 | |
| 341 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 342 | static struct resource dm9000_resources[] = { |
| 343 | [0] = { |
| 344 | .start = 0x203FB800, |
Laurent Pinchart | da3854f | 2008-06-24 22:15:58 +0100 | [diff] [blame] | 345 | .end = 0x203FB800 + 1, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 346 | .flags = IORESOURCE_MEM, |
| 347 | }, |
| 348 | [1] = { |
Laurent Pinchart | da3854f | 2008-06-24 22:15:58 +0100 | [diff] [blame] | 349 | .start = 0x203FB800 + 4, |
| 350 | .end = 0x203FB800 + 5, |
| 351 | .flags = IORESOURCE_MEM, |
| 352 | }, |
| 353 | [2] = { |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 354 | .start = IRQ_PF9, |
| 355 | .end = IRQ_PF9, |
| 356 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), |
| 357 | }, |
| 358 | }; |
| 359 | |
| 360 | static struct platform_device dm9000_device = { |
| 361 | .name = "dm9000", |
| 362 | .id = -1, |
| 363 | .num_resources = ARRAY_SIZE(dm9000_resources), |
| 364 | .resource = dm9000_resources, |
| 365 | }; |
| 366 | #endif |
| 367 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 368 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Sonic Zhang | 02460d0 | 2010-06-11 10:44:22 +0000 | [diff] [blame] | 369 | #include <linux/bfin_mac.h> |
| 370 | static const unsigned short bfin_mac_peripherals[] = P_RMII0; |
| 371 | |
| 372 | static struct bfin_phydev_platform_data bfin_phydev_data[] = { |
| 373 | { |
| 374 | .addr = 1, |
| 375 | .irq = IRQ_MAC_PHYINT, |
| 376 | }, |
| 377 | }; |
| 378 | |
| 379 | static struct bfin_mii_bus_platform_data bfin_mii_bus_data = { |
| 380 | .phydev_number = 1, |
| 381 | .phydev_data = bfin_phydev_data, |
| 382 | .phy_mode = PHY_INTERFACE_MODE_RMII, |
| 383 | .mac_peripherals = bfin_mac_peripherals, |
| 384 | }; |
| 385 | |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 386 | static struct platform_device bfin_mii_bus = { |
| 387 | .name = "bfin_mii_bus", |
Sonic Zhang | 02460d0 | 2010-06-11 10:44:22 +0000 | [diff] [blame] | 388 | .dev = { |
| 389 | .platform_data = &bfin_mii_bus_data, |
| 390 | } |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 391 | }; |
| 392 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 393 | static struct platform_device bfin_mac_device = { |
| 394 | .name = "bfin_mac", |
Sonic Zhang | 02460d0 | 2010-06-11 10:44:22 +0000 | [diff] [blame] | 395 | .dev = { |
| 396 | .platform_data = &bfin_mii_bus, |
| 397 | } |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 398 | }; |
| 399 | #endif |
| 400 | |
| 401 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 402 | static struct resource net2272_bfin_resources[] = { |
| 403 | { |
| 404 | .start = 0x20300000, |
| 405 | .end = 0x20300000 + 0x100, |
| 406 | .flags = IORESOURCE_MEM, |
| 407 | }, { |
| 408 | .start = IRQ_PF7, |
| 409 | .end = IRQ_PF7, |
| 410 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 411 | }, |
| 412 | }; |
| 413 | |
| 414 | static struct platform_device net2272_bfin_device = { |
| 415 | .name = "net2272", |
| 416 | .id = -1, |
| 417 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 418 | .resource = net2272_bfin_resources, |
| 419 | }; |
| 420 | #endif |
| 421 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 422 | #if defined(CONFIG_MTD_M25P80) \ |
| 423 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 424 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 425 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 426 | .name = "bootloader(spi)", |
Grace Pan | ac76d88 | 2008-04-24 06:33:56 +0800 | [diff] [blame] | 427 | .size = 0x00040000, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 428 | .offset = 0, |
| 429 | .mask_flags = MTD_CAP_ROM |
| 430 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 431 | .name = "linux kernel(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 432 | .size = MTDPART_SIZ_FULL, |
| 433 | .offset = MTDPART_OFS_APPEND, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 434 | } |
| 435 | }; |
| 436 | |
| 437 | static struct flash_platform_data bfin_spi_flash_data = { |
| 438 | .name = "m25p80", |
| 439 | .parts = bfin_spi_flash_partitions, |
| 440 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
Michael Hennerich | b9c9e78 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 441 | .type = "m25p16", |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 442 | }; |
| 443 | |
| 444 | /* SPI flash chip (m25p64) */ |
| 445 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 446 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 447 | .bits_per_word = 8, |
| 448 | }; |
| 449 | #endif |
| 450 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 451 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
| 452 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 453 | /* SPI ADC chip */ |
| 454 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
| 455 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 456 | .bits_per_word = 16, |
| 457 | }; |
| 458 | #endif |
| 459 | |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 460 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ |
| 461 | || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 462 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 463 | .enable_dma = 0, |
| 464 | .bits_per_word = 16, |
| 465 | }; |
| 466 | #endif |
| 467 | |
Yi Li | ffdf3ec | 2009-03-31 10:36:51 +0000 | [diff] [blame] | 468 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 469 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
| 470 | .enable_dma = 0, |
| 471 | .bits_per_word = 8, |
| 472 | }; |
| 473 | #endif |
| 474 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 475 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
| 476 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { |
| 477 | .enable_dma = 0, |
| 478 | .bits_per_word = 16, |
| 479 | }; |
| 480 | |
| 481 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { |
| 482 | .model = 7877, |
| 483 | .vref_delay_usecs = 50, /* internal, no capacitor */ |
| 484 | .x_plate_ohms = 419, |
| 485 | .y_plate_ohms = 486, |
| 486 | .pressure_max = 1000, |
| 487 | .pressure_min = 0, |
| 488 | .stopacq_polarity = 1, |
| 489 | .first_conversion_delay = 3, |
| 490 | .acquisition_time = 1, |
| 491 | .averaging = 1, |
| 492 | .pen_down_acc_interval = 1, |
| 493 | }; |
| 494 | #endif |
| 495 | |
Michael Hennerich | 5105432 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 496 | #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) |
| 497 | #include <linux/spi/ad7879.h> |
| 498 | static const struct ad7879_platform_data bfin_ad7879_ts_info = { |
| 499 | .model = 7879, /* Model = AD7879 */ |
| 500 | .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */ |
| 501 | .pressure_max = 10000, |
| 502 | .pressure_min = 0, |
| 503 | .first_conversion_delay = 3, /* wait 512us before do a first conversion */ |
| 504 | .acquisition_time = 1, /* 4us acquisition time per sample */ |
| 505 | .median = 2, /* do 8 measurements */ |
| 506 | .averaging = 1, /* take the average of 4 middle samples */ |
| 507 | .pen_down_acc_interval = 255, /* 9.4 ms */ |
Michael Hennerich | 244d342 | 2009-12-18 09:29:39 +0000 | [diff] [blame] | 508 | .gpio_export = 0, /* Export GPIO to gpiolib */ |
Michael Hennerich | 5105432 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 509 | }; |
| 510 | #endif |
| 511 | |
| 512 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
| 513 | static struct bfin5xx_spi_chip spi_ad7879_chip_info = { |
| 514 | .enable_dma = 0, |
| 515 | .bits_per_word = 16, |
| 516 | }; |
| 517 | #endif |
| 518 | |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 519 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 520 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 521 | .enable_dma = 0, |
| 522 | .bits_per_word = 8, |
| 523 | }; |
| 524 | #endif |
| 525 | |
Barry Song | 336746e | 2009-10-13 09:19:18 +0000 | [diff] [blame] | 526 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) |
| 527 | static struct platform_device bfin_i2s = { |
| 528 | .name = "bfin-i2s", |
| 529 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
| 530 | /* TODO: add platform data here */ |
| 531 | }; |
| 532 | #endif |
| 533 | |
| 534 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) |
| 535 | static struct platform_device bfin_tdm = { |
| 536 | .name = "bfin-tdm", |
| 537 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
| 538 | /* TODO: add platform data here */ |
| 539 | }; |
| 540 | #endif |
| 541 | |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 542 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 543 | static struct bfin5xx_spi_chip lq035q1_spi_chip_info = { |
| 544 | .enable_dma = 0, |
| 545 | .bits_per_word = 8, |
| 546 | }; |
| 547 | #endif |
| 548 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 549 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 550 | #if defined(CONFIG_MTD_M25P80) \ |
| 551 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 552 | { |
| 553 | /* the modalias must be the same as spi device driver name */ |
| 554 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 555 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
| 556 | .bus_num = 0, /* Framework bus number */ |
| 557 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
| 558 | .platform_data = &bfin_spi_flash_data, |
| 559 | .controller_data = &spi_flash_chip_info, |
| 560 | .mode = SPI_MODE_3, |
| 561 | }, |
| 562 | #endif |
| 563 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 564 | #if defined(CONFIG_BFIN_SPI_ADC) \ |
| 565 | || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 566 | { |
| 567 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 568 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
| 569 | .bus_num = 0, /* Framework bus number */ |
| 570 | .chip_select = 1, /* Framework chip select. */ |
| 571 | .platform_data = NULL, /* No spi_driver specific config */ |
| 572 | .controller_data = &spi_adc_chip_info, |
| 573 | }, |
| 574 | #endif |
| 575 | |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 576 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ |
| 577 | || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 578 | { |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 579 | .modalias = "ad183x", |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 580 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 581 | .bus_num = 0, |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 582 | .chip_select = 4, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 583 | .controller_data = &ad1836_spi_chip_info, |
| 584 | }, |
| 585 | #endif |
Yi Li | ffdf3ec | 2009-03-31 10:36:51 +0000 | [diff] [blame] | 586 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 587 | { |
| 588 | .modalias = "mmc_spi", |
| 589 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 590 | .bus_num = 0, |
| 591 | .chip_select = 3, |
| 592 | .controller_data = &mmc_spi_chip_info, |
| 593 | .mode = SPI_MODE_0, |
| 594 | }, |
| 595 | #endif |
| 596 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 597 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
| 598 | { |
| 599 | .modalias = "ad7877", |
| 600 | .platform_data = &bfin_ad7877_ts_info, |
Bryan Wu | 2eb74ae | 2008-05-31 15:17:25 +0800 | [diff] [blame] | 601 | .irq = IRQ_PF8, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 602 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
Michael Hennerich | 0954f70 | 2007-11-13 00:16:19 +0800 | [diff] [blame] | 603 | .bus_num = 0, |
Bryan Wu | 2eb74ae | 2008-05-31 15:17:25 +0800 | [diff] [blame] | 604 | .chip_select = 2, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 605 | .controller_data = &spi_ad7877_chip_info, |
| 606 | }, |
| 607 | #endif |
Michael Hennerich | 5105432 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 608 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
| 609 | { |
| 610 | .modalias = "ad7879", |
| 611 | .platform_data = &bfin_ad7879_ts_info, |
| 612 | .irq = IRQ_PF8, |
| 613 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ |
| 614 | .bus_num = 0, |
| 615 | .chip_select = 3, |
| 616 | .controller_data = &spi_ad7879_chip_info, |
| 617 | .mode = SPI_CPHA | SPI_CPOL, |
| 618 | }, |
| 619 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 620 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 621 | { |
| 622 | .modalias = "spidev", |
| 623 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 624 | .bus_num = 0, |
| 625 | .chip_select = 1, |
| 626 | .controller_data = &spidev_chip_info, |
| 627 | }, |
| 628 | #endif |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 629 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 630 | { |
| 631 | .modalias = "bfin-lq035q1-spi", |
| 632 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 633 | .bus_num = 0, |
| 634 | .chip_select = 7, |
| 635 | .controller_data = &lq035q1_spi_chip_info, |
| 636 | .mode = SPI_CPHA | SPI_CPOL, |
| 637 | }, |
| 638 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 639 | }; |
| 640 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 641 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 642 | /* SPI controller data */ |
| 643 | static struct bfin5xx_spi_master bfin_spi0_info = { |
| 644 | .num_chipselect = 8, |
| 645 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 646 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 647 | }; |
| 648 | |
| 649 | /* SPI (0) */ |
| 650 | static struct resource bfin_spi0_resource[] = { |
| 651 | [0] = { |
| 652 | .start = SPI0_REGBASE, |
| 653 | .end = SPI0_REGBASE + 0xFF, |
| 654 | .flags = IORESOURCE_MEM, |
| 655 | }, |
| 656 | [1] = { |
| 657 | .start = CH_SPI, |
| 658 | .end = CH_SPI, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 659 | .flags = IORESOURCE_DMA, |
| 660 | }, |
| 661 | [2] = { |
| 662 | .start = IRQ_SPI, |
| 663 | .end = IRQ_SPI, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 664 | .flags = IORESOURCE_IRQ, |
| 665 | }, |
| 666 | }; |
| 667 | |
| 668 | static struct platform_device bfin_spi0_device = { |
| 669 | .name = "bfin-spi", |
| 670 | .id = 0, /* Bus number */ |
| 671 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 672 | .resource = bfin_spi0_resource, |
| 673 | .dev = { |
| 674 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
| 675 | }, |
| 676 | }; |
| 677 | #endif /* spi master and devices */ |
| 678 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 679 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 680 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 681 | static struct resource bfin_uart0_resources[] = { |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 682 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 683 | .start = UART0_THR, |
| 684 | .end = UART0_GCTL+2, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 685 | .flags = IORESOURCE_MEM, |
| 686 | }, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 687 | { |
| 688 | .start = IRQ_UART0_RX, |
| 689 | .end = IRQ_UART0_RX+1, |
| 690 | .flags = IORESOURCE_IRQ, |
| 691 | }, |
| 692 | { |
| 693 | .start = IRQ_UART0_ERROR, |
| 694 | .end = IRQ_UART0_ERROR, |
| 695 | .flags = IORESOURCE_IRQ, |
| 696 | }, |
| 697 | { |
| 698 | .start = CH_UART0_TX, |
| 699 | .end = CH_UART0_TX, |
| 700 | .flags = IORESOURCE_DMA, |
| 701 | }, |
| 702 | { |
| 703 | .start = CH_UART0_RX, |
| 704 | .end = CH_UART0_RX, |
| 705 | .flags = IORESOURCE_DMA, |
| 706 | }, |
| 707 | }; |
| 708 | |
| 709 | unsigned short bfin_uart0_peripherals[] = { |
| 710 | P_UART0_TX, P_UART0_RX, 0 |
| 711 | }; |
| 712 | |
| 713 | static struct platform_device bfin_uart0_device = { |
| 714 | .name = "bfin-uart", |
| 715 | .id = 0, |
| 716 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
| 717 | .resource = bfin_uart0_resources, |
| 718 | .dev = { |
| 719 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ |
| 720 | }, |
| 721 | }; |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 722 | #endif |
| 723 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 724 | static struct resource bfin_uart1_resources[] = { |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 725 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 726 | .start = UART1_THR, |
| 727 | .end = UART1_GCTL+2, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 728 | .flags = IORESOURCE_MEM, |
| 729 | }, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 730 | { |
| 731 | .start = IRQ_UART1_RX, |
| 732 | .end = IRQ_UART1_RX+1, |
| 733 | .flags = IORESOURCE_IRQ, |
| 734 | }, |
| 735 | { |
| 736 | .start = IRQ_UART1_ERROR, |
| 737 | .end = IRQ_UART1_ERROR, |
| 738 | .flags = IORESOURCE_IRQ, |
| 739 | }, |
| 740 | { |
| 741 | .start = CH_UART1_TX, |
| 742 | .end = CH_UART1_TX, |
| 743 | .flags = IORESOURCE_DMA, |
| 744 | }, |
| 745 | { |
| 746 | .start = CH_UART1_RX, |
| 747 | .end = CH_UART1_RX, |
| 748 | .flags = IORESOURCE_DMA, |
| 749 | }, |
| 750 | #ifdef CONFIG_BFIN_UART1_CTSRTS |
| 751 | { /* CTS pin */ |
| 752 | .start = GPIO_PF9, |
| 753 | .end = GPIO_PF9, |
| 754 | .flags = IORESOURCE_IO, |
| 755 | }, |
| 756 | { /* RTS pin */ |
| 757 | .start = GPIO_PF10, |
| 758 | .end = GPIO_PF10, |
| 759 | .flags = IORESOURCE_IO, |
| 760 | }, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 761 | #endif |
| 762 | }; |
| 763 | |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 764 | unsigned short bfin_uart1_peripherals[] = { |
| 765 | P_UART1_TX, P_UART1_RX, 0 |
| 766 | }; |
| 767 | |
| 768 | static struct platform_device bfin_uart1_device = { |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 769 | .name = "bfin-uart", |
| 770 | .id = 1, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 771 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
| 772 | .resource = bfin_uart1_resources, |
| 773 | .dev = { |
| 774 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ |
| 775 | }, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 776 | }; |
| 777 | #endif |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 778 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 779 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 780 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 781 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 782 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 783 | { |
| 784 | .start = 0xFFC00400, |
| 785 | .end = 0xFFC004FF, |
| 786 | .flags = IORESOURCE_MEM, |
| 787 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 788 | { |
| 789 | .start = IRQ_UART0_RX, |
| 790 | .end = IRQ_UART0_RX+1, |
| 791 | .flags = IORESOURCE_IRQ, |
| 792 | }, |
| 793 | { |
| 794 | .start = CH_UART0_RX, |
| 795 | .end = CH_UART0_RX+1, |
| 796 | .flags = IORESOURCE_DMA, |
| 797 | }, |
| 798 | }; |
| 799 | |
| 800 | static struct platform_device bfin_sir0_device = { |
| 801 | .name = "bfin_sir", |
| 802 | .id = 0, |
| 803 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 804 | .resource = bfin_sir0_resources, |
| 805 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 806 | #endif |
| 807 | #ifdef CONFIG_BFIN_SIR1 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 808 | static struct resource bfin_sir1_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 809 | { |
| 810 | .start = 0xFFC02000, |
| 811 | .end = 0xFFC020FF, |
| 812 | .flags = IORESOURCE_MEM, |
| 813 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 814 | { |
| 815 | .start = IRQ_UART1_RX, |
| 816 | .end = IRQ_UART1_RX+1, |
| 817 | .flags = IORESOURCE_IRQ, |
| 818 | }, |
| 819 | { |
| 820 | .start = CH_UART1_RX, |
| 821 | .end = CH_UART1_RX+1, |
| 822 | .flags = IORESOURCE_DMA, |
| 823 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 824 | }; |
| 825 | |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 826 | static struct platform_device bfin_sir1_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 827 | .name = "bfin_sir", |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 828 | .id = 1, |
| 829 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), |
| 830 | .resource = bfin_sir1_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 831 | }; |
| 832 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 833 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 834 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 835 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 836 | static struct resource bfin_twi0_resource[] = { |
| 837 | [0] = { |
| 838 | .start = TWI0_REGBASE, |
| 839 | .end = TWI0_REGBASE, |
| 840 | .flags = IORESOURCE_MEM, |
| 841 | }, |
| 842 | [1] = { |
| 843 | .start = IRQ_TWI, |
| 844 | .end = IRQ_TWI, |
| 845 | .flags = IORESOURCE_IRQ, |
| 846 | }, |
| 847 | }; |
| 848 | |
| 849 | static struct platform_device i2c_bfin_twi_device = { |
| 850 | .name = "i2c-bfin-twi", |
| 851 | .id = 0, |
| 852 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 853 | .resource = bfin_twi0_resource, |
| 854 | }; |
| 855 | #endif |
| 856 | |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 857 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) |
| 858 | #include <linux/mfd/adp5520.h> |
| 859 | |
| 860 | /* |
| 861 | * ADP5520/5501 LEDs Data |
| 862 | */ |
| 863 | |
| 864 | static struct led_info adp5520_leds[] = { |
| 865 | { |
| 866 | .name = "adp5520-led1", |
| 867 | .default_trigger = "none", |
| 868 | .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms, |
| 869 | }, |
| 870 | }; |
| 871 | |
| 872 | static struct adp5520_leds_platform_data adp5520_leds_data = { |
| 873 | .num_leds = ARRAY_SIZE(adp5520_leds), |
| 874 | .leds = adp5520_leds, |
| 875 | .fade_in = ADP5520_FADE_T_600ms, |
| 876 | .fade_out = ADP5520_FADE_T_600ms, |
| 877 | .led_on_time = ADP5520_LED_ONT_600ms, |
| 878 | }; |
| 879 | |
| 880 | /* |
| 881 | * ADP5520 Keypad Data |
| 882 | */ |
| 883 | |
| 884 | static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = { |
| 885 | [ADP5520_KEY(3, 3)] = KEY_1, |
| 886 | [ADP5520_KEY(2, 3)] = KEY_2, |
| 887 | [ADP5520_KEY(1, 3)] = KEY_3, |
| 888 | [ADP5520_KEY(0, 3)] = KEY_UP, |
| 889 | [ADP5520_KEY(3, 2)] = KEY_4, |
| 890 | [ADP5520_KEY(2, 2)] = KEY_5, |
| 891 | [ADP5520_KEY(1, 2)] = KEY_6, |
| 892 | [ADP5520_KEY(0, 2)] = KEY_DOWN, |
| 893 | [ADP5520_KEY(3, 1)] = KEY_7, |
| 894 | [ADP5520_KEY(2, 1)] = KEY_8, |
| 895 | [ADP5520_KEY(1, 1)] = KEY_9, |
| 896 | [ADP5520_KEY(0, 1)] = KEY_DOT, |
| 897 | [ADP5520_KEY(3, 0)] = KEY_BACKSPACE, |
| 898 | [ADP5520_KEY(2, 0)] = KEY_0, |
| 899 | [ADP5520_KEY(1, 0)] = KEY_HELP, |
| 900 | [ADP5520_KEY(0, 0)] = KEY_ENTER, |
| 901 | }; |
| 902 | |
| 903 | static struct adp5520_keys_platform_data adp5520_keys_data = { |
| 904 | .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0, |
| 905 | .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0, |
| 906 | .keymap = adp5520_keymap, |
| 907 | .keymapsize = ARRAY_SIZE(adp5520_keymap), |
| 908 | .repeat = 0, |
| 909 | }; |
| 910 | |
| 911 | /* |
Stefan Weil | eef35c2 | 2010-08-06 21:11:15 +0200 | [diff] [blame] | 912 | * ADP5520/5501 Multifunction Device Init Data |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 913 | */ |
| 914 | |
| 915 | static struct adp5520_platform_data adp5520_pdev_data = { |
| 916 | .leds = &adp5520_leds_data, |
| 917 | .keys = &adp5520_keys_data, |
| 918 | }; |
| 919 | |
| 920 | #endif |
| 921 | |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 922 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
Michael Hennerich | ebd5833 | 2009-07-02 11:00:38 +0000 | [diff] [blame] | 923 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 924 | { |
| 925 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 926 | }, |
| 927 | #endif |
Michael Hennerich | 204844e | 2009-06-30 14:57:22 +0000 | [diff] [blame] | 928 | #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 929 | { |
| 930 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 931 | .irq = IRQ_PF8, |
| 932 | }, |
| 933 | #endif |
Michael Hennerich | 50c4c08 | 2009-09-22 13:10:09 +0000 | [diff] [blame] | 934 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 935 | { |
| 936 | I2C_BOARD_INFO("bfin-adv7393", 0x2B), |
| 937 | }, |
| 938 | #endif |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 939 | #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE) |
| 940 | { |
| 941 | I2C_BOARD_INFO("ad7879", 0x2C), |
| 942 | .irq = IRQ_PF8, |
| 943 | .platform_data = (void *)&bfin_ad7879_ts_info, |
| 944 | }, |
| 945 | #endif |
| 946 | #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) |
| 947 | { |
| 948 | I2C_BOARD_INFO("pmic-adp5520", 0x32), |
| 949 | .irq = IRQ_PF9, |
| 950 | .platform_data = (void *)&adp5520_pdev_data, |
| 951 | }, |
| 952 | #endif |
Cliff Cai | 29bb3bc | 2010-01-14 08:28:38 +0000 | [diff] [blame] | 953 | #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) |
| 954 | { |
| 955 | I2C_BOARD_INFO("ssm2602", 0x1b), |
| 956 | }, |
| 957 | #endif |
steven miao | 39d3c1c | 2010-08-26 08:25:13 +0000 | [diff] [blame] | 958 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
| 959 | { |
| 960 | I2C_BOARD_INFO("ad5252", 0x2f), |
| 961 | }, |
| 962 | #endif |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 963 | }; |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 964 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 965 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 966 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 967 | static struct resource bfin_sport0_uart_resources[] = { |
| 968 | { |
| 969 | .start = SPORT0_TCR1, |
| 970 | .end = SPORT0_MRCS3+4, |
| 971 | .flags = IORESOURCE_MEM, |
| 972 | }, |
| 973 | { |
| 974 | .start = IRQ_SPORT0_RX, |
| 975 | .end = IRQ_SPORT0_RX+1, |
| 976 | .flags = IORESOURCE_IRQ, |
| 977 | }, |
| 978 | { |
| 979 | .start = IRQ_SPORT0_ERROR, |
| 980 | .end = IRQ_SPORT0_ERROR, |
| 981 | .flags = IORESOURCE_IRQ, |
| 982 | }, |
| 983 | }; |
| 984 | |
| 985 | unsigned short bfin_sport0_peripherals[] = { |
| 986 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, |
| 987 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 |
| 988 | }; |
| 989 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 990 | static struct platform_device bfin_sport0_uart_device = { |
| 991 | .name = "bfin-sport-uart", |
| 992 | .id = 0, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 993 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), |
| 994 | .resource = bfin_sport0_uart_resources, |
| 995 | .dev = { |
| 996 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ |
| 997 | }, |
| 998 | }; |
| 999 | #endif |
| 1000 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 1001 | static struct resource bfin_sport1_uart_resources[] = { |
| 1002 | { |
| 1003 | .start = SPORT1_TCR1, |
| 1004 | .end = SPORT1_MRCS3+4, |
| 1005 | .flags = IORESOURCE_MEM, |
| 1006 | }, |
| 1007 | { |
| 1008 | .start = IRQ_SPORT1_RX, |
| 1009 | .end = IRQ_SPORT1_RX+1, |
| 1010 | .flags = IORESOURCE_IRQ, |
| 1011 | }, |
| 1012 | { |
| 1013 | .start = IRQ_SPORT1_ERROR, |
| 1014 | .end = IRQ_SPORT1_ERROR, |
| 1015 | .flags = IORESOURCE_IRQ, |
| 1016 | }, |
| 1017 | }; |
| 1018 | |
| 1019 | unsigned short bfin_sport1_peripherals[] = { |
| 1020 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, |
| 1021 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1022 | }; |
| 1023 | |
| 1024 | static struct platform_device bfin_sport1_uart_device = { |
| 1025 | .name = "bfin-sport-uart", |
| 1026 | .id = 1, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 1027 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), |
| 1028 | .resource = bfin_sport1_uart_resources, |
| 1029 | .dev = { |
| 1030 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ |
| 1031 | }, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1032 | }; |
| 1033 | #endif |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 1034 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1035 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 1036 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 1037 | #include <linux/gpio_keys.h> |
| 1038 | |
| 1039 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 1040 | {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"}, |
| 1041 | {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"}, |
| 1042 | }; |
| 1043 | |
| 1044 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 1045 | .buttons = bfin_gpio_keys_table, |
| 1046 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 1047 | }; |
| 1048 | |
| 1049 | static struct platform_device bfin_device_gpiokeys = { |
| 1050 | .name = "gpio-keys", |
| 1051 | .dev = { |
| 1052 | .platform_data = &bfin_gpio_keys_data, |
| 1053 | }, |
| 1054 | }; |
| 1055 | #endif |
| 1056 | |
Michael Hennerich | adfc046 | 2009-10-09 07:37:03 +0000 | [diff] [blame] | 1057 | #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 1058 | #include <asm/bfin_rotary.h> |
| 1059 | |
| 1060 | static struct bfin_rotary_platform_data bfin_rotary_data = { |
| 1061 | /*.rotary_up_key = KEY_UP,*/ |
| 1062 | /*.rotary_down_key = KEY_DOWN,*/ |
| 1063 | .rotary_rel_code = REL_WHEEL, |
| 1064 | .rotary_button_key = KEY_ENTER, |
| 1065 | .debounce = 10, /* 0..17 */ |
| 1066 | .mode = ROT_QUAD_ENC | ROT_DEBE, |
| 1067 | }; |
| 1068 | |
| 1069 | static struct resource bfin_rotary_resources[] = { |
| 1070 | { |
| 1071 | .start = IRQ_CNT, |
| 1072 | .end = IRQ_CNT, |
| 1073 | .flags = IORESOURCE_IRQ, |
| 1074 | }, |
| 1075 | }; |
| 1076 | |
| 1077 | static struct platform_device bfin_rotary_device = { |
| 1078 | .name = "bfin-rotary", |
| 1079 | .id = -1, |
| 1080 | .num_resources = ARRAY_SIZE(bfin_rotary_resources), |
| 1081 | .resource = bfin_rotary_resources, |
| 1082 | .dev = { |
| 1083 | .platform_data = &bfin_rotary_data, |
| 1084 | }, |
| 1085 | }; |
| 1086 | #endif |
| 1087 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1088 | static const unsigned int cclk_vlev_datasheet[] = |
| 1089 | { |
| 1090 | VRPAIR(VLEV_100, 400000000), |
| 1091 | VRPAIR(VLEV_105, 426000000), |
| 1092 | VRPAIR(VLEV_110, 500000000), |
| 1093 | VRPAIR(VLEV_115, 533000000), |
| 1094 | VRPAIR(VLEV_120, 600000000), |
| 1095 | }; |
| 1096 | |
| 1097 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 1098 | .tuple_tab = cclk_vlev_datasheet, |
| 1099 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 1100 | .vr_settling_time = 25 /* us */, |
| 1101 | }; |
| 1102 | |
| 1103 | static struct platform_device bfin_dpmc = { |
| 1104 | .name = "bfin dpmc", |
| 1105 | .dev = { |
| 1106 | .platform_data = &bfin_dmpc_vreg_data, |
| 1107 | }, |
| 1108 | }; |
| 1109 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1110 | static struct platform_device *stamp_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1111 | |
| 1112 | &bfin_dpmc, |
| 1113 | |
Michael Hennerich | 64307f7 | 2007-10-29 16:55:18 +0800 | [diff] [blame] | 1114 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 1115 | &bf5xx_nand_device, |
| 1116 | #endif |
| 1117 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1118 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
| 1119 | &bfin_pcmcia_cf_device, |
| 1120 | #endif |
| 1121 | |
| 1122 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 1123 | &rtc_device, |
| 1124 | #endif |
| 1125 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 1126 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 1127 | &bfin_isp1760_device, |
| 1128 | #endif |
| 1129 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 1130 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 1131 | &musb_device, |
| 1132 | #endif |
| 1133 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1134 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 1135 | &smc91x_device, |
| 1136 | #endif |
| 1137 | |
| 1138 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 1139 | &dm9000_device, |
| 1140 | #endif |
| 1141 | |
| 1142 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
Graf Yang | 6531962 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1143 | &bfin_mii_bus, |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1144 | &bfin_mac_device, |
| 1145 | #endif |
| 1146 | |
| 1147 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 1148 | &net2272_bfin_device, |
| 1149 | #endif |
| 1150 | |
| 1151 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 1152 | &bfin_spi0_device, |
| 1153 | #endif |
| 1154 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 1155 | #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE) |
| 1156 | &bf52x_t350mcqb_device, |
| 1157 | #endif |
| 1158 | |
Michael Hennerich | 6924dfb | 2009-12-07 13:41:28 +0000 | [diff] [blame] | 1159 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 1160 | &bfin_lq035q1_device, |
| 1161 | #endif |
| 1162 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1163 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 1164 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 1165 | &bfin_uart0_device, |
| 1166 | #endif |
| 1167 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 1168 | &bfin_uart1_device, |
| 1169 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1170 | #endif |
| 1171 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1172 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1173 | #ifdef CONFIG_BFIN_SIR0 |
| 1174 | &bfin_sir0_device, |
| 1175 | #endif |
| 1176 | #ifdef CONFIG_BFIN_SIR1 |
| 1177 | &bfin_sir1_device, |
| 1178 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1179 | #endif |
| 1180 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1181 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 1182 | &i2c_bfin_twi_device, |
| 1183 | #endif |
| 1184 | |
| 1185 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 1186 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1187 | &bfin_sport0_uart_device, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 1188 | #endif |
| 1189 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1190 | &bfin_sport1_uart_device, |
| 1191 | #endif |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 1192 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1193 | |
Michael Hennerich | 1089e22 | 2007-12-24 11:49:29 +0800 | [diff] [blame] | 1194 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 1195 | &bfin_device_gpiokeys, |
| 1196 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 1197 | |
Michael Hennerich | adfc046 | 2009-10-09 07:37:03 +0000 | [diff] [blame] | 1198 | #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 1199 | &bfin_rotary_device, |
| 1200 | #endif |
| 1201 | |
Michael Hennerich | d7e5dd4 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1202 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
| 1203 | &ezkit_flash_device, |
| 1204 | #endif |
Barry Song | 336746e | 2009-10-13 09:19:18 +0000 | [diff] [blame] | 1205 | |
| 1206 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) |
| 1207 | &bfin_i2s, |
| 1208 | #endif |
| 1209 | |
| 1210 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) |
| 1211 | &bfin_tdm, |
| 1212 | #endif |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1213 | }; |
| 1214 | |
Mike Frysinger | 7f6678c | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1215 | static int __init ezkit_init(void) |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1216 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 1217 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 7226868 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1218 | i2c_register_board_info(0, bfin_i2c_board_info, |
| 1219 | ARRAY_SIZE(bfin_i2c_board_info)); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1220 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1221 | 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] | 1222 | return 0; |
| 1223 | } |
| 1224 | |
Mike Frysinger | 7f6678c | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1225 | arch_initcall(ezkit_init); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1226 | |
Sonic Zhang | c13ce9f | 2009-09-23 09:37:46 +0000 | [diff] [blame] | 1227 | static struct platform_device *ezkit_early_devices[] __initdata = { |
| 1228 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) |
| 1229 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 1230 | &bfin_uart0_device, |
| 1231 | #endif |
| 1232 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 1233 | &bfin_uart1_device, |
| 1234 | #endif |
| 1235 | #endif |
| 1236 | |
| 1237 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) |
| 1238 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 1239 | &bfin_sport0_uart_device, |
| 1240 | #endif |
| 1241 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 1242 | &bfin_sport1_uart_device, |
| 1243 | #endif |
| 1244 | #endif |
| 1245 | }; |
| 1246 | |
| 1247 | void __init native_machine_early_platform_add_devices(void) |
| 1248 | { |
| 1249 | printk(KERN_INFO "register early platform devices\n"); |
| 1250 | early_platform_add_devices(ezkit_early_devices, |
| 1251 | ARRAY_SIZE(ezkit_early_devices)); |
| 1252 | } |
| 1253 | |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1254 | void native_machine_restart(char *cmd) |
| 1255 | { |
| 1256 | /* workaround reboot hang when booting from SPI */ |
| 1257 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
Sonic Zhang | b52dae3 | 2009-02-04 16:49:45 +0800 | [diff] [blame] | 1258 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
Michael Hennerich | 5900314 | 2007-10-21 16:54:27 +0800 | [diff] [blame] | 1259 | } |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1260 | |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1261 | void bfin_get_ether_addr(char *addr) |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1262 | { |
Mike Frysinger | 181afa9 | 2008-02-25 11:42:17 +0800 | [diff] [blame] | 1263 | /* the MAC is stored in OTP memory page 0xDF */ |
| 1264 | u32 ret; |
| 1265 | u64 otp_mac; |
| 1266 | u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A; |
| 1267 | |
| 1268 | ret = otp_read(0xDF, 0x00, &otp_mac); |
| 1269 | if (!(ret & 0x1)) { |
| 1270 | char *otp_mac_p = (char *)&otp_mac; |
| 1271 | for (ret = 0; ret < 6; ++ret) |
| 1272 | addr[ret] = otp_mac_p[5 - ret]; |
| 1273 | } |
Mike Frysinger | 137b152 | 2007-11-22 16:07:03 +0800 | [diff] [blame] | 1274 | } |
Mike Frysinger | 9862cc5 | 2007-11-15 21:21:20 +0800 | [diff] [blame] | 1275 | EXPORT_SYMBOL(bfin_get_ether_addr); |