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