Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 1 | /* |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 2 | * Copyright 2004-2009 Analog Devices Inc. |
| 3 | * 2007-2008 HV Sistemas S.L. |
| 4 | * Javier Herrero <jherrero@hvsistemas.es> |
| 5 | * 2005 National ICT Australia (NICTA) |
| 6 | * Aidan Williams <aidan@nicta.com.au> |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 7 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 8 | * Licensed under the GPL-2 or later. |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <linux/device.h> |
| 12 | #include <linux/platform_device.h> |
| 13 | #include <linux/mtd/mtd.h> |
| 14 | #include <linux/mtd/partitions.h> |
| 15 | #include <linux/spi/spi.h> |
| 16 | #include <linux/spi/flash.h> |
| 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> |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 19 | #endif |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 20 | #include <linux/irq.h> |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 21 | |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 22 | #include <asm/dma.h> |
| 23 | #include <asm/bfin5xx_spi.h> |
| 24 | #include <asm/reboot.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 25 | #include <asm/portmux.h> |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 26 | |
| 27 | /* |
| 28 | * Name the Board for the /proc/cpuinfo |
| 29 | */ |
| 30 | const char bfin_board_name[] = "HV Sistemas H8606"; |
| 31 | |
Robert P. J. Day | 09db948 | 2007-11-17 22:57:03 +0800 | [diff] [blame] | 32 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 33 | static struct platform_device rtc_device = { |
| 34 | .name = "rtc-bfin", |
| 35 | .id = -1, |
| 36 | }; |
| 37 | #endif |
| 38 | |
| 39 | /* |
| 40 | * Driver needs to know address, irq and flag pin. |
| 41 | */ |
| 42 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 43 | static struct resource dm9000_resources[] = { |
| 44 | [0] = { |
| 45 | .start = 0x20300000, |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 46 | .end = 0x20300002, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 47 | .flags = IORESOURCE_MEM, |
| 48 | }, |
| 49 | [1] = { |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 50 | .start = 0x20300004, |
| 51 | .end = 0x20300006, |
Laurent Pinchart | da3854f | 2008-06-24 22:15:58 +0100 | [diff] [blame] | 52 | .flags = IORESOURCE_MEM, |
| 53 | }, |
| 54 | [2] = { |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 55 | .start = IRQ_PF10, |
| 56 | .end = IRQ_PF10, |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 57 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IRQF_SHARED | IRQF_TRIGGER_HIGH), |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 58 | }, |
| 59 | }; |
| 60 | |
| 61 | static struct platform_device dm9000_device = { |
| 62 | .id = 0, |
| 63 | .name = "dm9000", |
| 64 | .resource = dm9000_resources, |
| 65 | .num_resources = ARRAY_SIZE(dm9000_resources), |
| 66 | }; |
| 67 | #endif |
| 68 | |
| 69 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 70 | #include <linux/smc91x.h> |
| 71 | |
| 72 | static struct smc91x_platdata smc91x_info = { |
| 73 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 74 | .leda = RPC_LED_100_10, |
| 75 | .ledb = RPC_LED_TX_RX, |
| 76 | }; |
| 77 | |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 78 | static struct resource smc91x_resources[] = { |
| 79 | { |
| 80 | .name = "smc91x-regs", |
| 81 | .start = 0x20300300, |
| 82 | .end = 0x20300300 + 16, |
| 83 | .flags = IORESOURCE_MEM, |
| 84 | }, { |
| 85 | .start = IRQ_PROG_INTB, |
| 86 | .end = IRQ_PROG_INTB, |
| 87 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 88 | }, { |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 89 | .start = IRQ_PF7, |
| 90 | .end = IRQ_PF7, |
| 91 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 92 | }, |
| 93 | }; |
| 94 | |
| 95 | static struct platform_device smc91x_device = { |
| 96 | .name = "smc91x", |
| 97 | .id = 0, |
| 98 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 99 | .resource = smc91x_resources, |
Michael Hennerich | 61f09b5 | 2009-07-24 08:48:31 +0000 | [diff] [blame] | 100 | .dev = { |
| 101 | .platform_data = &smc91x_info, |
| 102 | }, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 103 | }; |
| 104 | #endif |
| 105 | |
| 106 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 107 | static struct resource net2272_bfin_resources[] = { |
| 108 | { |
| 109 | .start = 0x20300000, |
| 110 | .end = 0x20300000 + 0x100, |
| 111 | .flags = IORESOURCE_MEM, |
| 112 | }, { |
| 113 | .start = IRQ_PF10, |
| 114 | .end = IRQ_PF10, |
| 115 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 116 | }, |
| 117 | }; |
| 118 | |
| 119 | static struct platform_device net2272_bfin_device = { |
| 120 | .name = "net2272", |
| 121 | .id = -1, |
| 122 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), |
| 123 | .resource = net2272_bfin_resources, |
| 124 | }; |
| 125 | #endif |
| 126 | |
| 127 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 128 | /* all SPI peripherals info goes here */ |
| 129 | |
| 130 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 131 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 132 | { |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 133 | .name = "bootloader (spi)", |
| 134 | .size = 0x40000, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 135 | .offset = 0, |
| 136 | .mask_flags = MTD_CAP_ROM |
| 137 | }, { |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 138 | .name = "fpga (spi)", |
| 139 | .size = 0x30000, |
| 140 | .offset = 0x40000 |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 141 | }, { |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 142 | .name = "linux kernel (spi)", |
| 143 | .size = 0x150000, |
| 144 | .offset = 0x70000 |
| 145 | }, { |
| 146 | .name = "jffs2 root file system (spi)", |
| 147 | .size = 0x640000, |
| 148 | .offset = 0x1c0000, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 149 | } |
| 150 | }; |
| 151 | |
| 152 | static struct flash_platform_data bfin_spi_flash_data = { |
| 153 | .name = "m25p80", |
| 154 | .parts = bfin_spi_flash_partitions, |
| 155 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
| 156 | .type = "m25p64", |
| 157 | }; |
| 158 | |
| 159 | /* SPI flash chip (m25p64) */ |
| 160 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 161 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 162 | .bits_per_word = 8, |
| 163 | }; |
| 164 | #endif |
| 165 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 166 | #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 167 | /* SPI ADC chip */ |
| 168 | static struct bfin5xx_spi_chip spi_adc_chip_info = { |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 169 | .enable_dma = 1, /* use dma transfer with this chip*/ |
| 170 | .bits_per_word = 16, |
| 171 | }; |
| 172 | #endif |
| 173 | |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 174 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 175 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 176 | .enable_dma = 0, |
| 177 | .bits_per_word = 16, |
| 178 | }; |
| 179 | #endif |
| 180 | |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 181 | /* Notice: for blackfin, the speed_hz is the value of register |
| 182 | * SPI_BAUD, not the real baudrate */ |
| 183 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
| 184 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) |
| 185 | { |
| 186 | /* the modalias must be the same as spi device driver name */ |
| 187 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 188 | /* this value is the baudrate divisor */ |
| 189 | .max_speed_hz = 50000000, /* actual baudrate is SCLK/(2xspeed_hz) */ |
| 190 | .bus_num = 0, /* Framework bus number */ |
| 191 | .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ |
| 192 | .platform_data = &bfin_spi_flash_data, |
| 193 | .controller_data = &spi_flash_chip_info, |
| 194 | .mode = SPI_MODE_3, |
| 195 | }, |
| 196 | #endif |
| 197 | |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 198 | #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE) |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 199 | { |
| 200 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
| 201 | .max_speed_hz = 4, /* actual baudrate is SCLK/(2xspeed_hz) */ |
| 202 | .bus_num = 1, /* Framework bus number */ |
| 203 | .chip_select = 1, /* Framework chip select. */ |
| 204 | .platform_data = NULL, /* No spi_driver specific config */ |
| 205 | .controller_data = &spi_adc_chip_info, |
| 206 | }, |
| 207 | #endif |
| 208 | |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 209 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 210 | { |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 211 | .modalias = "ad183x", |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 212 | .max_speed_hz = 16, |
| 213 | .bus_num = 1, |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 214 | .chip_select = 4, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 215 | .controller_data = &ad1836_spi_chip_info, |
| 216 | }, |
| 217 | #endif |
| 218 | |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 219 | }; |
| 220 | |
| 221 | /* SPI (0) */ |
| 222 | static struct resource bfin_spi0_resource[] = { |
| 223 | [0] = { |
| 224 | .start = SPI0_REGBASE, |
| 225 | .end = SPI0_REGBASE + 0xFF, |
| 226 | .flags = IORESOURCE_MEM, |
| 227 | }, |
| 228 | [1] = { |
| 229 | .start = CH_SPI, |
| 230 | .end = CH_SPI, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 231 | .flags = IORESOURCE_DMA, |
| 232 | }, |
| 233 | [2] = { |
| 234 | .start = IRQ_SPI, |
| 235 | .end = IRQ_SPI, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 236 | .flags = IORESOURCE_IRQ, |
| 237 | } |
| 238 | }; |
| 239 | |
| 240 | |
| 241 | /* SPI controller data */ |
| 242 | static struct bfin5xx_spi_master bfin_spi0_info = { |
| 243 | .num_chipselect = 8, |
| 244 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 245 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 246 | }; |
| 247 | |
| 248 | static struct platform_device bfin_spi0_device = { |
| 249 | .name = "bfin-spi", |
| 250 | .id = 0, /* Bus number */ |
| 251 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 252 | .resource = bfin_spi0_resource, |
| 253 | .dev = { |
| 254 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
| 255 | }, |
| 256 | }; |
| 257 | #endif /* spi master and devices */ |
| 258 | |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 259 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 260 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 261 | static struct resource bfin_uart0_resources[] = { |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 262 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 263 | .start = BFIN_UART_THR, |
| 264 | .end = BFIN_UART_GCTL+2, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 265 | .flags = IORESOURCE_MEM, |
| 266 | }, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 267 | { |
| 268 | .start = IRQ_UART0_RX, |
| 269 | .end = IRQ_UART0_RX + 1, |
| 270 | .flags = IORESOURCE_IRQ, |
| 271 | }, |
| 272 | { |
| 273 | .start = IRQ_UART0_ERROR, |
| 274 | .end = IRQ_UART0_ERROR, |
| 275 | .flags = IORESOURCE_IRQ, |
| 276 | }, |
| 277 | { |
| 278 | .start = CH_UART0_TX, |
| 279 | .end = CH_UART0_TX, |
| 280 | .flags = IORESOURCE_DMA, |
| 281 | }, |
| 282 | { |
| 283 | .start = CH_UART0_RX, |
| 284 | .end = CH_UART0_RX, |
| 285 | .flags = IORESOURCE_DMA, |
| 286 | }, |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 287 | }; |
| 288 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame^] | 289 | static unsigned short bfin_uart0_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 290 | P_UART0_TX, P_UART0_RX, 0 |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 291 | }; |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 292 | |
| 293 | static struct platform_device bfin_uart0_device = { |
| 294 | .name = "bfin-uart", |
| 295 | .id = 0, |
| 296 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
| 297 | .resource = bfin_uart0_resources, |
| 298 | .dev = { |
| 299 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ |
| 300 | }, |
| 301 | }; |
| 302 | #endif |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 303 | #endif |
| 304 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 305 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 306 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 307 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 308 | { |
| 309 | .start = 0xFFC00400, |
| 310 | .end = 0xFFC004FF, |
| 311 | .flags = IORESOURCE_MEM, |
| 312 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 313 | { |
| 314 | .start = IRQ_UART0_RX, |
| 315 | .end = IRQ_UART0_RX+1, |
| 316 | .flags = IORESOURCE_IRQ, |
| 317 | }, |
| 318 | { |
| 319 | .start = CH_UART0_RX, |
| 320 | .end = CH_UART0_RX+1, |
| 321 | .flags = IORESOURCE_DMA, |
| 322 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 323 | }; |
| 324 | |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 325 | static struct platform_device bfin_sir0_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 326 | .name = "bfin_sir", |
| 327 | .id = 0, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 328 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 329 | .resource = bfin_sir0_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 330 | }; |
| 331 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 332 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 333 | |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 334 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) |
| 335 | |
| 336 | #include <linux/serial_8250.h> |
| 337 | #include <linux/serial.h> |
| 338 | |
| 339 | /* |
| 340 | * Configuration for two 16550 UARTS in FPGA at addresses 0x20200000 and 0x202000010. |
| 341 | * running at half system clock, both with interrupt output or-ed to PF8. Change to |
| 342 | * suit different FPGA configuration, or to suit real 16550 UARTS connected to the bus |
| 343 | */ |
| 344 | |
| 345 | static struct plat_serial8250_port serial8250_platform_data [] = { |
| 346 | { |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 347 | .membase = (void *)0x20200000, |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 348 | .mapbase = 0x20200000, |
| 349 | .irq = IRQ_PF8, |
Mike Frysinger | 49e00ed | 2010-10-17 04:59:16 -0400 | [diff] [blame] | 350 | .irqflags = IRQF_TRIGGER_HIGH, |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 351 | .flags = UPF_BOOT_AUTOCONF | UART_CONFIG_TYPE, |
| 352 | .iotype = UPIO_MEM, |
| 353 | .regshift = 1, |
| 354 | .uartclk = 66666667, |
| 355 | }, { |
Javier Herrero | 4513843 | 2008-10-09 18:06:47 +0800 | [diff] [blame] | 356 | .membase = (void *)0x20200010, |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 357 | .mapbase = 0x20200010, |
| 358 | .irq = IRQ_PF8, |
Mike Frysinger | 49e00ed | 2010-10-17 04:59:16 -0400 | [diff] [blame] | 359 | .irqflags = IRQF_TRIGGER_HIGH, |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 360 | .flags = UPF_BOOT_AUTOCONF | UART_CONFIG_TYPE, |
| 361 | .iotype = UPIO_MEM, |
| 362 | .regshift = 1, |
| 363 | .uartclk = 66666667, |
| 364 | }, { |
| 365 | } |
| 366 | }; |
| 367 | |
| 368 | static struct platform_device serial8250_device = { |
| 369 | .id = PLAT8250_DEV_PLATFORM, |
| 370 | .name = "serial8250", |
| 371 | .dev = { |
| 372 | .platform_data = serial8250_platform_data, |
| 373 | }, |
| 374 | }; |
| 375 | |
| 376 | #endif |
| 377 | |
Javier Herrero | 7a5f819 | 2008-01-27 19:53:08 +0800 | [diff] [blame] | 378 | #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE) |
| 379 | |
| 380 | /* |
| 381 | * Configuration for one OpenCores keyboard controller in FPGA at address 0x20200030, |
| 382 | * interrupt output wired to PF9. Change to suit different FPGA configuration |
| 383 | */ |
| 384 | |
| 385 | static struct resource opencores_kbd_resources[] = { |
| 386 | [0] = { |
| 387 | .start = 0x20200030, |
| 388 | .end = 0x20300030 + 2, |
| 389 | .flags = IORESOURCE_MEM, |
| 390 | }, |
| 391 | [1] = { |
| 392 | .start = IRQ_PF9, |
| 393 | .end = IRQ_PF9, |
| 394 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
| 395 | }, |
| 396 | }; |
| 397 | |
| 398 | static struct platform_device opencores_kbd_device = { |
| 399 | .id = -1, |
| 400 | .name = "opencores-kbd", |
| 401 | .resource = opencores_kbd_resources, |
| 402 | .num_resources = ARRAY_SIZE(opencores_kbd_resources), |
| 403 | }; |
| 404 | #endif |
| 405 | |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 406 | static struct platform_device *h8606_devices[] __initdata = { |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 407 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 408 | &rtc_device, |
| 409 | #endif |
| 410 | |
| 411 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
| 412 | &dm9000_device, |
| 413 | #endif |
| 414 | |
| 415 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 416 | &smc91x_device, |
| 417 | #endif |
| 418 | |
| 419 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) |
| 420 | &net2272_bfin_device, |
| 421 | #endif |
| 422 | |
| 423 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 424 | &bfin_spi0_device, |
| 425 | #endif |
| 426 | |
| 427 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 428 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 429 | &bfin_uart0_device, |
| 430 | #endif |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 431 | #endif |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 432 | |
| 433 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) |
| 434 | &serial8250_device, |
| 435 | #endif |
Javier Herrero | 7a5f819 | 2008-01-27 19:53:08 +0800 | [diff] [blame] | 436 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 437 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 438 | #ifdef CONFIG_BFIN_SIR0 |
| 439 | &bfin_sir0_device, |
| 440 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 441 | #endif |
| 442 | |
Javier Herrero | 7a5f819 | 2008-01-27 19:53:08 +0800 | [diff] [blame] | 443 | #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE) |
| 444 | &opencores_kbd_device, |
| 445 | #endif |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 446 | }; |
| 447 | |
| 448 | static int __init H8606_init(void) |
| 449 | { |
| 450 | printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n"); |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 451 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Javier Herrero | fb96c56 | 2007-12-21 18:26:44 +0800 | [diff] [blame] | 452 | platform_add_devices(h8606_devices, ARRAY_SIZE(h8606_devices)); |
Javier Herrero | ab472a0 | 2007-10-29 16:14:44 +0800 | [diff] [blame] | 453 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 454 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
| 455 | #endif |
| 456 | return 0; |
| 457 | } |
| 458 | |
Mike Frysinger | 0feea17 | 2007-11-15 21:10:42 +0800 | [diff] [blame] | 459 | arch_initcall(H8606_init); |
Sonic Zhang | c13ce9f | 2009-09-23 09:37:46 +0000 | [diff] [blame] | 460 | |
| 461 | static struct platform_device *H8606_early_devices[] __initdata = { |
| 462 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) |
| 463 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 464 | &bfin_uart0_device, |
| 465 | #endif |
| 466 | #endif |
| 467 | }; |
| 468 | |
| 469 | void __init native_machine_early_platform_add_devices(void) |
| 470 | { |
| 471 | printk(KERN_INFO "register early platform devices\n"); |
| 472 | early_platform_add_devices(H8606_early_devices, |
| 473 | ARRAY_SIZE(H8606_early_devices)); |
| 474 | } |