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