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/pata_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 + 8,
69 .flags = IORESOURCE_MEM,
74 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
78 static struct platform_device dm9000_device = {
81 .resource = dm9000_resources,
82 .num_resources = ARRAY_SIZE(dm9000_resources),
86 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
87 static struct resource smc91x_resources[] = {
89 .name = "smc91x-regs",
91 .end = 0x20300300 + 16,
92 .flags = IORESOURCE_MEM,
94 .start = IRQ_PROG_INTB,
96 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
100 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
104 static struct platform_device smc91x_device = {
107 .num_resources = ARRAY_SIZE(smc91x_resources),
108 .resource = smc91x_resources,
112 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
113 static struct resource net2272_bfin_resources[] = {
116 .end = 0x20300000 + 0x100,
117 .flags = IORESOURCE_MEM,
121 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
125 static struct platform_device net2272_bfin_device = {
128 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
129 .resource = net2272_bfin_resources,
133 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
134 /* all SPI peripherals info goes here */
136 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
137 static struct mtd_partition bfin_spi_flash_partitions[] = {
139 .name = "bootloader",
142 .mask_flags = MTD_CAP_ROM
148 .name = "file system",
150 .offset = 0x00160000,
154 static struct flash_platform_data bfin_spi_flash_data = {
156 .parts = bfin_spi_flash_partitions,
157 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
161 /* SPI flash chip (m25p64) */
162 static struct bfin5xx_spi_chip spi_flash_chip_info = {
163 .enable_dma = 0, /* use dma transfer with this chip*/
168 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
170 static struct bfin5xx_spi_chip spi_adc_chip_info = {
172 .enable_dma = 1, /* use dma transfer with this chip*/
177 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
178 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
185 #if defined(CONFIG_PBX)
186 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
190 .cs_change_per_word = 1,
194 /* Notice: for blackfin, the speed_hz is the value of register
195 * SPI_BAUD, not the real baudrate */
196 static struct spi_board_info bfin_spi_board_info[] __initdata = {
197 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
199 /* the modalias must be the same as spi device driver name */
200 .modalias = "m25p80", /* Name of spi_driver for this device */
201 /* this value is the baudrate divisor */
202 .max_speed_hz = 50000000, /* actual baudrate is SCLK/(2xspeed_hz) */
203 .bus_num = 0, /* Framework bus number */
204 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
205 .platform_data = &bfin_spi_flash_data,
206 .controller_data = &spi_flash_chip_info,
211 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
213 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
214 .max_speed_hz = 4, /* actual baudrate is SCLK/(2xspeed_hz) */
215 .bus_num = 1, /* Framework bus number */
216 .chip_select = 1, /* Framework chip select. */
217 .platform_data = NULL, /* No spi_driver specific config */
218 .controller_data = &spi_adc_chip_info,
222 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
224 .modalias = "ad1836-spi",
227 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
228 .controller_data = &ad1836_spi_chip_info,
232 #if defined(CONFIG_PBX)
234 .modalias = "fxs-spi",
238 .controller_data = &spi_si3xxx_chip_info,
242 .modalias = "fxo-spi",
246 .controller_data = &spi_si3xxx_chip_info,
252 static struct resource bfin_spi0_resource[] = {
254 .start = SPI0_REGBASE,
255 .end = SPI0_REGBASE + 0xFF,
256 .flags = IORESOURCE_MEM,
261 .flags = IORESOURCE_IRQ,
266 /* SPI controller data */
267 static struct bfin5xx_spi_master bfin_spi0_info = {
269 .enable_dma = 1, /* master has the ability to do dma transfer */
270 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
273 static struct platform_device bfin_spi0_device = {
275 .id = 0, /* Bus number */
276 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
277 .resource = bfin_spi0_resource,
279 .platform_data = &bfin_spi0_info, /* Passed to driver */
282 #endif /* spi master and devices */
284 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
285 static struct platform_device bfin_fb_device = {
290 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
291 static struct resource bfin_uart_resources[] = {
295 .flags = IORESOURCE_MEM,
299 static struct platform_device bfin_uart_device = {
302 .num_resources = ARRAY_SIZE(bfin_uart_resources),
303 .resource = bfin_uart_resources,
307 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
309 #include <linux/serial_8250.h>
310 #include <linux/serial.h>
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
318 static struct plat_serial8250_port serial8250_platform_data [] = {
320 .membase = 0x20200000,
321 .mapbase = 0x20200000,
323 .flags = UPF_BOOT_AUTOCONF | UART_CONFIG_TYPE,
328 .membase = 0x20200010,
329 .mapbase = 0x20200010,
331 .flags = UPF_BOOT_AUTOCONF | UART_CONFIG_TYPE,
339 static struct platform_device serial8250_device = {
340 .id = PLAT8250_DEV_PLATFORM,
341 .name = "serial8250",
343 .platform_data = serial8250_platform_data,
349 #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
352 * Configuration for one OpenCores keyboard controller in FPGA at address 0x20200030,
353 * interrupt output wired to PF9. Change to suit different FPGA configuration
356 static struct resource opencores_kbd_resources[] = {
359 .end = 0x20300030 + 2,
360 .flags = IORESOURCE_MEM,
365 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
369 static struct platform_device opencores_kbd_device = {
371 .name = "opencores-kbd",
372 .resource = opencores_kbd_resources,
373 .num_resources = ARRAY_SIZE(opencores_kbd_resources),
377 static struct platform_device *h8606_devices[] __initdata = {
378 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
382 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
386 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
390 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
391 &net2272_bfin_device,
394 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
398 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
402 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
406 #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
407 &opencores_kbd_device,
411 static int __init H8606_init(void)
413 printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n");
414 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
415 platform_add_devices(h8606_devices, ARRAY_SIZE(h8606_devices));
416 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
417 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
422 arch_initcall(H8606_init);