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