2 * File: arch/blackfin/mach-bf533/H8606.c
3 * Based on: arch/blackfin/mach-bf533/stamp.c
4 * Author: Javier Herrero <jherrero@hvsistemas.es>
7 * Description: Board Info File for the HV Sistemas H8606 board
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc
12 * Copyright 2007 HV Sistemas S.L.
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, see the file COPYING, or write
28 * to the Free Software Foundation, Inc.,
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include <linux/device.h>
33 #include <linux/platform_device.h>
34 #include <linux/mtd/mtd.h>
35 #include <linux/mtd/partitions.h>
36 #include <linux/spi/spi.h>
37 #include <linux/spi/flash.h>
38 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
39 #include <linux/usb/isp1362.h>
41 #include <linux/ata_platform.h>
42 #include <linux/irq.h>
45 #include <asm/bfin5xx_spi.h>
46 #include <asm/reboot.h>
47 #include <asm/portmux.h>
50 * Name the Board for the /proc/cpuinfo
52 const char bfin_board_name[] = "HV Sistemas H8606";
54 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
55 static struct platform_device rtc_device = {
62 * Driver needs to know address, irq and flag pin.
64 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
65 static struct resource dm9000_resources[] = {
68 .end = 0x20300000 + 1,
69 .flags = IORESOURCE_MEM,
72 .start = 0x20300000 + 4,
73 .end = 0x20300000 + 5,
74 .flags = IORESOURCE_MEM,
79 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
83 static struct platform_device dm9000_device = {
86 .resource = dm9000_resources,
87 .num_resources = ARRAY_SIZE(dm9000_resources),
91 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
92 static struct resource smc91x_resources[] = {
94 .name = "smc91x-regs",
96 .end = 0x20300300 + 16,
97 .flags = IORESOURCE_MEM,
99 .start = IRQ_PROG_INTB,
100 .end = IRQ_PROG_INTB,
101 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
105 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
109 static struct platform_device smc91x_device = {
112 .num_resources = ARRAY_SIZE(smc91x_resources),
113 .resource = smc91x_resources,
117 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
118 static struct resource net2272_bfin_resources[] = {
121 .end = 0x20300000 + 0x100,
122 .flags = IORESOURCE_MEM,
126 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
130 static struct platform_device net2272_bfin_device = {
133 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
134 .resource = net2272_bfin_resources,
138 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
139 /* all SPI peripherals info goes here */
141 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
142 static struct mtd_partition bfin_spi_flash_partitions[] = {
144 .name = "bootloader",
147 .mask_flags = MTD_CAP_ROM
153 .name = "file system",
155 .offset = 0x00160000,
159 static struct flash_platform_data bfin_spi_flash_data = {
161 .parts = bfin_spi_flash_partitions,
162 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
166 /* SPI flash chip (m25p64) */
167 static struct bfin5xx_spi_chip spi_flash_chip_info = {
168 .enable_dma = 0, /* use dma transfer with this chip*/
173 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
175 static struct bfin5xx_spi_chip spi_adc_chip_info = {
177 .enable_dma = 1, /* use dma transfer with this chip*/
182 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
183 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
190 #if defined(CONFIG_PBX)
191 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
195 .cs_change_per_word = 1,
199 /* Notice: for blackfin, the speed_hz is the value of register
200 * SPI_BAUD, not the real baudrate */
201 static struct spi_board_info bfin_spi_board_info[] __initdata = {
202 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
204 /* the modalias must be the same as spi device driver name */
205 .modalias = "m25p80", /* Name of spi_driver for this device */
206 /* this value is the baudrate divisor */
207 .max_speed_hz = 50000000, /* actual baudrate is SCLK/(2xspeed_hz) */
208 .bus_num = 0, /* Framework bus number */
209 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
210 .platform_data = &bfin_spi_flash_data,
211 .controller_data = &spi_flash_chip_info,
216 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
218 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
219 .max_speed_hz = 4, /* actual baudrate is SCLK/(2xspeed_hz) */
220 .bus_num = 1, /* Framework bus number */
221 .chip_select = 1, /* Framework chip select. */
222 .platform_data = NULL, /* No spi_driver specific config */
223 .controller_data = &spi_adc_chip_info,
227 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
229 .modalias = "ad1836-spi",
232 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
233 .controller_data = &ad1836_spi_chip_info,
237 #if defined(CONFIG_PBX)
239 .modalias = "fxs-spi",
243 .controller_data = &spi_si3xxx_chip_info,
247 .modalias = "fxo-spi",
251 .controller_data = &spi_si3xxx_chip_info,
257 static struct resource bfin_spi0_resource[] = {
259 .start = SPI0_REGBASE,
260 .end = SPI0_REGBASE + 0xFF,
261 .flags = IORESOURCE_MEM,
266 .flags = IORESOURCE_IRQ,
271 /* SPI controller data */
272 static struct bfin5xx_spi_master bfin_spi0_info = {
274 .enable_dma = 1, /* master has the ability to do dma transfer */
275 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
278 static struct platform_device bfin_spi0_device = {
280 .id = 0, /* Bus number */
281 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
282 .resource = bfin_spi0_resource,
284 .platform_data = &bfin_spi0_info, /* Passed to driver */
287 #endif /* spi master and devices */
289 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
290 static struct platform_device bfin_fb_device = {
295 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
296 static struct resource bfin_uart_resources[] = {
300 .flags = IORESOURCE_MEM,
304 static struct platform_device bfin_uart_device = {
307 .num_resources = ARRAY_SIZE(bfin_uart_resources),
308 .resource = bfin_uart_resources,
312 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
313 static struct resource bfin_sir_resources[] = {
314 #ifdef CONFIG_BFIN_SIR0
318 .flags = IORESOURCE_MEM,
323 static struct platform_device bfin_sir_device = {
326 .num_resources = ARRAY_SIZE(bfin_sir_resources),
327 .resource = bfin_sir_resources,
331 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
333 #include <linux/serial_8250.h>
334 #include <linux/serial.h>
337 * Configuration for two 16550 UARTS in FPGA at addresses 0x20200000 and 0x202000010.
338 * running at half system clock, both with interrupt output or-ed to PF8. Change to
339 * suit different FPGA configuration, or to suit real 16550 UARTS connected to the bus
342 static struct plat_serial8250_port serial8250_platform_data [] = {
344 .membase = 0x20200000,
345 .mapbase = 0x20200000,
347 .flags = UPF_BOOT_AUTOCONF | UART_CONFIG_TYPE,
352 .membase = 0x20200010,
353 .mapbase = 0x20200010,
355 .flags = UPF_BOOT_AUTOCONF | UART_CONFIG_TYPE,
363 static struct platform_device serial8250_device = {
364 .id = PLAT8250_DEV_PLATFORM,
365 .name = "serial8250",
367 .platform_data = serial8250_platform_data,
373 #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
376 * Configuration for one OpenCores keyboard controller in FPGA at address 0x20200030,
377 * interrupt output wired to PF9. Change to suit different FPGA configuration
380 static struct resource opencores_kbd_resources[] = {
383 .end = 0x20300030 + 2,
384 .flags = IORESOURCE_MEM,
389 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
393 static struct platform_device opencores_kbd_device = {
395 .name = "opencores-kbd",
396 .resource = opencores_kbd_resources,
397 .num_resources = ARRAY_SIZE(opencores_kbd_resources),
401 static struct platform_device *h8606_devices[] __initdata = {
402 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
406 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
410 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
414 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
415 &net2272_bfin_device,
418 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
422 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
426 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
430 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
434 #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
435 &opencores_kbd_device,
439 static int __init H8606_init(void)
441 printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n");
442 printk(KERN_INFO "%s(): registering device resources\n", __func__);
443 platform_add_devices(h8606_devices, ARRAY_SIZE(h8606_devices));
444 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
445 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
450 arch_initcall(H8606_init);