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