Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [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> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 5 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 6 | * Licensed under the GPL-2 or later. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [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> |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 13 | #include <linux/mtd/physmap.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 14 | #include <linux/spi/spi.h> |
| 15 | #include <linux/spi/flash.h> |
Yi Li | 2120b68 | 2009-07-16 10:12:30 +0000 | [diff] [blame] | 16 | #include <linux/spi/mmc_spi.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 17 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
Mike Frysinger | f02bcec | 2007-11-15 21:29:15 +0800 | [diff] [blame] | 18 | #include <linux/usb/isp1362.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 19 | #endif |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 20 | #include <linux/irq.h> |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 21 | #include <linux/i2c.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 22 | #include <asm/dma.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 23 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 24 | #include <asm/reboot.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> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 27 | |
| 28 | /* |
| 29 | * Name the Board for the /proc/cpuinfo |
| 30 | */ |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 31 | const char bfin_board_name[] = "ADI BF533-STAMP"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 32 | |
| 33 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 34 | static struct platform_device rtc_device = { |
| 35 | .name = "rtc-bfin", |
| 36 | .id = -1, |
| 37 | }; |
| 38 | #endif |
| 39 | |
| 40 | /* |
| 41 | * Driver needs to know address, irq and flag pin. |
| 42 | */ |
| 43 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 44 | #include <linux/smc91x.h> |
| 45 | |
| 46 | static struct smc91x_platdata smc91x_info = { |
| 47 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 48 | .leda = RPC_LED_100_10, |
| 49 | .ledb = RPC_LED_TX_RX, |
| 50 | }; |
| 51 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 52 | static struct resource smc91x_resources[] = { |
| 53 | { |
| 54 | .name = "smc91x-regs", |
| 55 | .start = 0x20300300, |
| 56 | .end = 0x20300300 + 16, |
| 57 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 58 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 59 | .start = IRQ_PF7, |
| 60 | .end = IRQ_PF7, |
| 61 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 62 | }, |
| 63 | }; |
| 64 | |
| 65 | static struct platform_device smc91x_device = { |
| 66 | .name = "smc91x", |
| 67 | .id = 0, |
| 68 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 69 | .resource = smc91x_resources, |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 70 | .dev = { |
| 71 | .platform_data = &smc91x_info, |
| 72 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 73 | }; |
| 74 | #endif |
| 75 | |
| 76 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 77 | static struct resource net2272_bfin_resources[] = { |
| 78 | { |
| 79 | .start = 0x20300000, |
| 80 | .end = 0x20300000 + 0x100, |
| 81 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 82 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 83 | .start = IRQ_PF10, |
| 84 | .end = IRQ_PF10, |
| 85 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 86 | }, |
| 87 | }; |
| 88 | |
| 89 | static struct platform_device net2272_bfin_device = { |
| 90 | .name = "net2272", |
| 91 | .id = -1, |
| 92 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 93 | .resource = net2272_bfin_resources, |
| 94 | }; |
| 95 | #endif |
| 96 | |
Mike Frysinger | 9cd9c61 | 2008-05-13 12:31:32 +0800 | [diff] [blame] | 97 | #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 98 | static struct mtd_partition stamp_partitions[] = { |
| 99 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 100 | .name = "bootloader(nor)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 101 | .size = 0x40000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 102 | .offset = 0, |
| 103 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 104 | .name = "linux kernel(nor)", |
Grace Pan | 6ecb5b6 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 105 | .size = 0x180000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 106 | .offset = MTDPART_OFS_APPEND, |
| 107 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 108 | .name = "file system(nor)", |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 109 | .size = MTDPART_SIZ_FULL, |
| 110 | .offset = MTDPART_OFS_APPEND, |
| 111 | } |
| 112 | }; |
| 113 | |
| 114 | static struct physmap_flash_data stamp_flash_data = { |
| 115 | .width = 2, |
| 116 | .parts = stamp_partitions, |
| 117 | .nr_parts = ARRAY_SIZE(stamp_partitions), |
| 118 | }; |
| 119 | |
| 120 | static struct resource stamp_flash_resource[] = { |
| 121 | { |
| 122 | .name = "cfi_probe", |
| 123 | .start = 0x20000000, |
| 124 | .end = 0x203fffff, |
| 125 | .flags = IORESOURCE_MEM, |
| 126 | }, { |
Mike Frysinger | 9cd9c61 | 2008-05-13 12:31:32 +0800 | [diff] [blame] | 127 | .start = 0x7BB07BB0, /* AMBCTL0 setting when accessing flash */ |
| 128 | .end = 0x7BB07BB0, /* AMBCTL1 setting when accessing flash */ |
| 129 | .flags = IORESOURCE_MEM, |
| 130 | }, { |
| 131 | .start = GPIO_PF0, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 132 | .flags = IORESOURCE_IRQ, |
| 133 | } |
| 134 | }; |
| 135 | |
| 136 | static struct platform_device stamp_flash_device = { |
Mike Frysinger | 9cd9c61 | 2008-05-13 12:31:32 +0800 | [diff] [blame] | 137 | .name = "bfin-async-flash", |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 138 | .id = 0, |
| 139 | .dev = { |
| 140 | .platform_data = &stamp_flash_data, |
| 141 | }, |
| 142 | .num_resources = ARRAY_SIZE(stamp_flash_resource), |
| 143 | .resource = stamp_flash_resource, |
| 144 | }; |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 145 | #endif |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 146 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 147 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 148 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 149 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 150 | .name = "bootloader(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 151 | .size = 0x00040000, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 152 | .offset = 0, |
| 153 | .mask_flags = MTD_CAP_ROM |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 154 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 155 | .name = "linux kernel(spi)", |
Grace Pan | 6ecb5b6 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 156 | .size = 0x180000, |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 157 | .offset = MTDPART_OFS_APPEND, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 158 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 159 | .name = "file system(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 160 | .size = MTDPART_SIZ_FULL, |
| 161 | .offset = MTDPART_OFS_APPEND, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 162 | } |
| 163 | }; |
| 164 | |
| 165 | static struct flash_platform_data bfin_spi_flash_data = { |
| 166 | .name = "m25p80", |
| 167 | .parts = bfin_spi_flash_partitions, |
| 168 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
| 169 | .type = "m25p64", |
| 170 | }; |
| 171 | |
| 172 | /* SPI flash chip (m25p64) */ |
| 173 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 174 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 175 | .bits_per_word = 8, |
| 176 | }; |
| 177 | #endif |
| 178 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 179 | #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 180 | /* SPI ADC chip */ |
| 181 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
| 182 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 183 | .bits_per_word = 16, |
| 184 | }; |
| 185 | #endif |
| 186 | |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 187 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 188 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 189 | .enable_dma = 0, |
| 190 | .bits_per_word = 16, |
| 191 | }; |
| 192 | #endif |
| 193 | |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 194 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 195 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 196 | .enable_dma = 0, |
| 197 | .bits_per_word = 8, |
| 198 | }; |
| 199 | #endif |
| 200 | |
Yi Li | 2120b68 | 2009-07-16 10:12:30 +0000 | [diff] [blame] | 201 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 202 | #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 |
| 203 | static int bfin_mmc_spi_init(struct device *dev, |
| 204 | irqreturn_t (*detect_int)(int, void *), void *data) |
| 205 | { |
| 206 | return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int, |
| 207 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, |
| 208 | "mmc-spi-detect", data); |
| 209 | } |
| 210 | |
| 211 | static void bfin_mmc_spi_exit(struct device *dev, void *data) |
| 212 | { |
| 213 | free_irq(MMC_SPI_CARD_DETECT_INT, data); |
| 214 | } |
| 215 | |
| 216 | static struct mmc_spi_platform_data bfin_mmc_spi_pdata = { |
| 217 | .init = bfin_mmc_spi_init, |
| 218 | .exit = bfin_mmc_spi_exit, |
| 219 | .detect_delay = 100, /* msecs */ |
| 220 | }; |
| 221 | |
| 222 | static struct bfin5xx_spi_chip mmc_spi_chip_info = { |
| 223 | .enable_dma = 0, |
| 224 | .bits_per_word = 8, |
| 225 | .pio_interrupt = 0, |
| 226 | }; |
| 227 | #endif |
| 228 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 229 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 230 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 231 | { |
| 232 | /* the modalias must be the same as spi device driver name */ |
| 233 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 234 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 235 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 236 | .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ |
| 237 | .platform_data = &bfin_spi_flash_data, |
| 238 | .controller_data = &spi_flash_chip_info, |
| 239 | .mode = SPI_MODE_3, |
| 240 | }, |
| 241 | #endif |
| 242 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 243 | #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 244 | { |
| 245 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 246 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 247 | .bus_num = 0, /* Framework bus number */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 248 | .chip_select = 1, /* Framework chip select. */ |
| 249 | .platform_data = NULL, /* No spi_driver specific config */ |
| 250 | .controller_data = &spi_adc_chip_info, |
| 251 | }, |
| 252 | #endif |
| 253 | |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 254 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 255 | { |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 256 | .modalias = "ad183x", |
Cliff Cai | 858c5e9 | 2009-07-22 06:34:55 +0000 | [diff] [blame] | 257 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 258 | .bus_num = 0, |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 259 | .chip_select = 4, |
| 260 | .platform_data = "ad1836", /* only includes chip name for the moment */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 261 | .controller_data = &ad1836_spi_chip_info, |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 262 | .mode = SPI_MODE_3, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 263 | }, |
| 264 | #endif |
| 265 | |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 266 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 267 | { |
| 268 | .modalias = "spidev", |
| 269 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 270 | .bus_num = 0, |
| 271 | .chip_select = 1, |
| 272 | .controller_data = &spidev_chip_info, |
| 273 | }, |
| 274 | #endif |
Yi Li | 2120b68 | 2009-07-16 10:12:30 +0000 | [diff] [blame] | 275 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
| 276 | { |
| 277 | .modalias = "mmc_spi", |
| 278 | .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ |
| 279 | .bus_num = 0, |
| 280 | .chip_select = 4, |
| 281 | .platform_data = &bfin_mmc_spi_pdata, |
| 282 | .controller_data = &mmc_spi_chip_info, |
| 283 | .mode = SPI_MODE_3, |
| 284 | }, |
| 285 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 286 | }; |
| 287 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 288 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 289 | /* SPI (0) */ |
| 290 | static struct resource bfin_spi0_resource[] = { |
| 291 | [0] = { |
| 292 | .start = SPI0_REGBASE, |
| 293 | .end = SPI0_REGBASE + 0xFF, |
| 294 | .flags = IORESOURCE_MEM, |
| 295 | }, |
| 296 | [1] = { |
| 297 | .start = CH_SPI, |
| 298 | .end = CH_SPI, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 299 | .flags = IORESOURCE_DMA, |
| 300 | }, |
| 301 | [2] = { |
| 302 | .start = IRQ_SPI, |
| 303 | .end = IRQ_SPI, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 304 | .flags = IORESOURCE_IRQ, |
| 305 | } |
| 306 | }; |
| 307 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 308 | /* SPI controller data */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 309 | static struct bfin5xx_spi_master bfin_spi0_info = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 310 | .num_chipselect = 8, |
| 311 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 312 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 313 | }; |
| 314 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 315 | static struct platform_device bfin_spi0_device = { |
| 316 | .name = "bfin-spi", |
| 317 | .id = 0, /* Bus number */ |
| 318 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 319 | .resource = bfin_spi0_resource, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 320 | .dev = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 321 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 322 | }, |
| 323 | }; |
| 324 | #endif /* spi master and devices */ |
| 325 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 326 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 327 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 328 | static struct resource bfin_uart0_resources[] = { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 329 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 330 | .start = BFIN_UART_THR, |
| 331 | .end = BFIN_UART_GCTL+2, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 332 | .flags = IORESOURCE_MEM, |
| 333 | }, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 334 | { |
| 335 | .start = IRQ_UART0_RX, |
| 336 | .end = IRQ_UART0_RX + 1, |
| 337 | .flags = IORESOURCE_IRQ, |
| 338 | }, |
| 339 | { |
| 340 | .start = IRQ_UART0_ERROR, |
| 341 | .end = IRQ_UART0_ERROR, |
| 342 | .flags = IORESOURCE_IRQ, |
| 343 | }, |
| 344 | { |
| 345 | .start = CH_UART0_TX, |
| 346 | .end = CH_UART0_TX, |
| 347 | .flags = IORESOURCE_DMA, |
| 348 | }, |
| 349 | { |
| 350 | .start = CH_UART0_RX, |
| 351 | .end = CH_UART0_RX, |
| 352 | .flags = IORESOURCE_DMA, |
| 353 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 354 | }; |
| 355 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 356 | static unsigned short bfin_uart0_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 357 | P_UART0_TX, P_UART0_RX, 0 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 358 | }; |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 359 | |
| 360 | static struct platform_device bfin_uart0_device = { |
| 361 | .name = "bfin-uart", |
| 362 | .id = 0, |
| 363 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
| 364 | .resource = bfin_uart0_resources, |
| 365 | .dev = { |
| 366 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ |
| 367 | }, |
| 368 | }; |
| 369 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 370 | #endif |
| 371 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 372 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 373 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 374 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 375 | { |
| 376 | .start = 0xFFC00400, |
| 377 | .end = 0xFFC004FF, |
| 378 | .flags = IORESOURCE_MEM, |
| 379 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 380 | { |
| 381 | .start = IRQ_UART0_RX, |
| 382 | .end = IRQ_UART0_RX+1, |
| 383 | .flags = IORESOURCE_IRQ, |
| 384 | }, |
| 385 | { |
| 386 | .start = CH_UART0_RX, |
| 387 | .end = CH_UART0_RX+1, |
| 388 | .flags = IORESOURCE_DMA, |
| 389 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 390 | }; |
| 391 | |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 392 | static struct platform_device bfin_sir0_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 393 | .name = "bfin_sir", |
| 394 | .id = 0, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 395 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 396 | .resource = bfin_sir0_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 397 | }; |
| 398 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 399 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 400 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 401 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 402 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 403 | static struct resource bfin_sport0_uart_resources[] = { |
| 404 | { |
| 405 | .start = SPORT0_TCR1, |
| 406 | .end = SPORT0_MRCS3+4, |
| 407 | .flags = IORESOURCE_MEM, |
| 408 | }, |
| 409 | { |
| 410 | .start = IRQ_SPORT0_RX, |
| 411 | .end = IRQ_SPORT0_RX+1, |
| 412 | .flags = IORESOURCE_IRQ, |
| 413 | }, |
| 414 | { |
| 415 | .start = IRQ_SPORT0_ERROR, |
| 416 | .end = IRQ_SPORT0_ERROR, |
| 417 | .flags = IORESOURCE_IRQ, |
| 418 | }, |
| 419 | }; |
| 420 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 421 | static unsigned short bfin_sport0_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 422 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, |
Sonic Zhang | e54b673 | 2010-11-12 02:45:38 +0000 | [diff] [blame] | 423 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0 |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 424 | }; |
| 425 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 426 | static struct platform_device bfin_sport0_uart_device = { |
| 427 | .name = "bfin-sport-uart", |
| 428 | .id = 0, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 429 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), |
| 430 | .resource = bfin_sport0_uart_resources, |
| 431 | .dev = { |
| 432 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ |
| 433 | }, |
| 434 | }; |
| 435 | #endif |
| 436 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 437 | static struct resource bfin_sport1_uart_resources[] = { |
| 438 | { |
| 439 | .start = SPORT1_TCR1, |
| 440 | .end = SPORT1_MRCS3+4, |
| 441 | .flags = IORESOURCE_MEM, |
| 442 | }, |
| 443 | { |
| 444 | .start = IRQ_SPORT1_RX, |
| 445 | .end = IRQ_SPORT1_RX+1, |
| 446 | .flags = IORESOURCE_IRQ, |
| 447 | }, |
| 448 | { |
| 449 | .start = IRQ_SPORT1_ERROR, |
| 450 | .end = IRQ_SPORT1_ERROR, |
| 451 | .flags = IORESOURCE_IRQ, |
| 452 | }, |
| 453 | }; |
| 454 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 455 | static unsigned short bfin_sport1_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 456 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, |
Sonic Zhang | e54b673 | 2010-11-12 02:45:38 +0000 | [diff] [blame] | 457 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 458 | }; |
| 459 | |
| 460 | static struct platform_device bfin_sport1_uart_device = { |
| 461 | .name = "bfin-sport-uart", |
| 462 | .id = 1, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 463 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), |
| 464 | .resource = bfin_sport1_uart_resources, |
| 465 | .dev = { |
| 466 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ |
| 467 | }, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 468 | }; |
| 469 | #endif |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 470 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 471 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 472 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 473 | #include <linux/input.h> |
| 474 | #include <linux/gpio_keys.h> |
| 475 | |
| 476 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
Michael Hennerich | f1bceb4 | 2008-02-02 16:17:52 +0800 | [diff] [blame] | 477 | {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"}, |
| 478 | {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"}, |
| 479 | {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"}, |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 480 | }; |
| 481 | |
| 482 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 483 | .buttons = bfin_gpio_keys_table, |
| 484 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 485 | }; |
| 486 | |
| 487 | static struct platform_device bfin_device_gpiokeys = { |
| 488 | .name = "gpio-keys", |
| 489 | .dev = { |
| 490 | .platform_data = &bfin_gpio_keys_data, |
| 491 | }, |
| 492 | }; |
| 493 | #endif |
| 494 | |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 495 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 496 | #include <linux/i2c-gpio.h> |
| 497 | |
| 498 | static struct i2c_gpio_platform_data i2c_gpio_data = { |
Mike Frysinger | 3d7dc88 | 2010-07-02 21:02:50 +0000 | [diff] [blame] | 499 | .sda_pin = GPIO_PF2, |
| 500 | .scl_pin = GPIO_PF3, |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 501 | .sda_is_open_drain = 0, |
| 502 | .scl_is_open_drain = 0, |
| 503 | .udelay = 40, |
| 504 | }; |
| 505 | |
| 506 | static struct platform_device i2c_gpio_device = { |
| 507 | .name = "i2c-gpio", |
| 508 | .id = 0, |
| 509 | .dev = { |
| 510 | .platform_data = &i2c_gpio_data, |
| 511 | }, |
| 512 | }; |
| 513 | #endif |
| 514 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 515 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
| 516 | #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) |
| 517 | { |
| 518 | I2C_BOARD_INFO("ad7142_joystick", 0x2C), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 519 | .irq = 39, |
| 520 | }, |
| 521 | #endif |
Michael Hennerich | ebd5833 | 2009-07-02 11:00:38 +0000 | [diff] [blame] | 522 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 523 | { |
| 524 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 525 | }, |
| 526 | #endif |
Michael Hennerich | 204844e | 2009-06-30 14:57:22 +0000 | [diff] [blame] | 527 | #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 528 | { |
| 529 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 530 | .irq = 39, |
| 531 | }, |
| 532 | #endif |
Michael Hennerich | 50c4c08 | 2009-09-22 13:10:09 +0000 | [diff] [blame] | 533 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) |
| 534 | { |
| 535 | I2C_BOARD_INFO("bfin-adv7393", 0x2B), |
| 536 | }, |
| 537 | #endif |
steven miao | 39d3c1c | 2010-08-26 08:25:13 +0000 | [diff] [blame] | 538 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
| 539 | { |
| 540 | I2C_BOARD_INFO("ad5252", 0x2f), |
| 541 | }, |
| 542 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 543 | }; |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 544 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 545 | static const unsigned int cclk_vlev_datasheet[] = |
| 546 | { |
| 547 | VRPAIR(VLEV_085, 250000000), |
| 548 | VRPAIR(VLEV_090, 376000000), |
| 549 | VRPAIR(VLEV_095, 426000000), |
| 550 | VRPAIR(VLEV_100, 426000000), |
| 551 | VRPAIR(VLEV_105, 476000000), |
| 552 | VRPAIR(VLEV_110, 476000000), |
| 553 | VRPAIR(VLEV_115, 476000000), |
| 554 | VRPAIR(VLEV_120, 600000000), |
| 555 | VRPAIR(VLEV_125, 600000000), |
| 556 | VRPAIR(VLEV_130, 600000000), |
| 557 | }; |
| 558 | |
| 559 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 560 | .tuple_tab = cclk_vlev_datasheet, |
| 561 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 562 | .vr_settling_time = 25 /* us */, |
| 563 | }; |
| 564 | |
| 565 | static struct platform_device bfin_dpmc = { |
| 566 | .name = "bfin dpmc", |
| 567 | .dev = { |
| 568 | .platform_data = &bfin_dmpc_vreg_data, |
| 569 | }, |
| 570 | }; |
| 571 | |
Barry Song | 7e1082b | 2010-01-12 03:59:18 +0000 | [diff] [blame] | 572 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) |
| 573 | static struct platform_device bfin_i2s = { |
| 574 | .name = "bfin-i2s", |
| 575 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
| 576 | /* TODO: add platform data here */ |
| 577 | }; |
| 578 | #endif |
| 579 | |
| 580 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) |
| 581 | static struct platform_device bfin_tdm = { |
| 582 | .name = "bfin-tdm", |
| 583 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
| 584 | /* TODO: add platform data here */ |
| 585 | }; |
| 586 | #endif |
| 587 | |
| 588 | #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) |
| 589 | static struct platform_device bfin_ac97 = { |
| 590 | .name = "bfin-ac97", |
| 591 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
| 592 | /* TODO: add platform data here */ |
| 593 | }; |
| 594 | #endif |
| 595 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 596 | static struct platform_device *stamp_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 597 | |
| 598 | &bfin_dpmc, |
| 599 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 600 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 601 | &rtc_device, |
| 602 | #endif |
| 603 | |
| 604 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 605 | &smc91x_device, |
| 606 | #endif |
| 607 | |
| 608 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 609 | &net2272_bfin_device, |
| 610 | #endif |
| 611 | |
| 612 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 613 | &bfin_spi0_device, |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 614 | #endif |
| 615 | |
| 616 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 617 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 618 | &bfin_uart0_device, |
| 619 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 620 | #endif |
| 621 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 622 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 623 | #ifdef CONFIG_BFIN_SIR0 |
| 624 | &bfin_sir0_device, |
| 625 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 626 | #endif |
| 627 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 628 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 629 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 630 | &bfin_sport0_uart_device, |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 631 | #endif |
| 632 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 633 | &bfin_sport1_uart_device, |
| 634 | #endif |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 635 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 636 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 637 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 638 | &bfin_device_gpiokeys, |
| 639 | #endif |
Bryan Wu | e316395 | 2008-01-24 16:19:15 +0800 | [diff] [blame] | 640 | |
| 641 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 642 | &i2c_gpio_device, |
| 643 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 644 | |
Mike Frysinger | 9cd9c61 | 2008-05-13 12:31:32 +0800 | [diff] [blame] | 645 | #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 646 | &stamp_flash_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 647 | #endif |
Barry Song | 7e1082b | 2010-01-12 03:59:18 +0000 | [diff] [blame] | 648 | |
| 649 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) |
| 650 | &bfin_i2s, |
| 651 | #endif |
| 652 | |
| 653 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) |
| 654 | &bfin_tdm, |
| 655 | #endif |
| 656 | |
| 657 | #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) |
| 658 | &bfin_ac97, |
| 659 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 660 | }; |
| 661 | |
| 662 | static int __init stamp_init(void) |
| 663 | { |
Mike Frysinger | c0fc525 | 2007-05-21 18:09:25 +0800 | [diff] [blame] | 664 | int ret; |
| 665 | |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 666 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 667 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 668 | i2c_register_board_info(0, bfin_i2c_board_info, |
| 669 | ARRAY_SIZE(bfin_i2c_board_info)); |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 670 | |
Mike Frysinger | c0fc525 | 2007-05-21 18:09:25 +0800 | [diff] [blame] | 671 | ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
| 672 | if (ret < 0) |
| 673 | return ret; |
| 674 | |
| 675 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
Mike Frysinger | 30e9b95 | 2010-10-26 21:30:29 -0400 | [diff] [blame] | 676 | /* |
| 677 | * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC. |
| 678 | * the bfin-async-map driver takes care of flipping between |
| 679 | * flash and ethernet when necessary. |
| 680 | */ |
| 681 | ret = gpio_request(GPIO_PF0, "enet_cpld"); |
| 682 | if (!ret) { |
| 683 | gpio_direction_output(GPIO_PF0, 1); |
| 684 | gpio_free(GPIO_PF0); |
| 685 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 686 | #endif |
Mike Frysinger | c0fc525 | 2007-05-21 18:09:25 +0800 | [diff] [blame] | 687 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 688 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 689 | return 0; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 690 | } |
| 691 | |
| 692 | arch_initcall(stamp_init); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 693 | |
Sonic Zhang | c13ce9f | 2009-09-23 09:37:46 +0000 | [diff] [blame] | 694 | static struct platform_device *stamp_early_devices[] __initdata = { |
| 695 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) |
| 696 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 697 | &bfin_uart0_device, |
| 698 | #endif |
| 699 | #endif |
| 700 | |
| 701 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) |
| 702 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 703 | &bfin_sport0_uart_device, |
| 704 | #endif |
| 705 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 706 | &bfin_sport1_uart_device, |
| 707 | #endif |
| 708 | #endif |
| 709 | }; |
| 710 | |
| 711 | void __init native_machine_early_platform_add_devices(void) |
| 712 | { |
| 713 | printk(KERN_INFO "register early platform devices\n"); |
| 714 | early_platform_add_devices(stamp_early_devices, |
| 715 | ARRAY_SIZE(stamp_early_devices)); |
| 716 | } |
| 717 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 718 | void native_machine_restart(char *cmd) |
| 719 | { |
Mike Frysinger | 9cd9c61 | 2008-05-13 12:31:32 +0800 | [diff] [blame] | 720 | /* workaround pull up on cpld / flash pin not being strong enough */ |
Mike Frysinger | 30e9b95 | 2010-10-26 21:30:29 -0400 | [diff] [blame] | 721 | gpio_request(GPIO_PF0, "flash_cpld"); |
| 722 | gpio_direction_output(GPIO_PF0, 0); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 723 | } |