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