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,2008 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/irq.h>
44 #include <asm/bfin5xx_spi.h>
45 #include <asm/reboot.h>
46 #include <asm/portmux.h>
49 * Name the Board for the /proc/cpuinfo
51 const char bfin_board_name
[] = "HV Sistemas H8606";
53 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
54 static struct platform_device rtc_device
= {
61 * Driver needs to know address, irq and flag pin.
63 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
64 static struct resource dm9000_resources
[] = {
68 .flags
= IORESOURCE_MEM
,
73 .flags
= IORESOURCE_MEM
,
78 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
| IRQF_SHARED
| IRQF_TRIGGER_HIGH
),
82 static struct platform_device dm9000_device
= {
85 .resource
= dm9000_resources
,
86 .num_resources
= ARRAY_SIZE(dm9000_resources
),
90 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
91 static struct resource smc91x_resources
[] = {
93 .name
= "smc91x-regs",
95 .end
= 0x20300300 + 16,
96 .flags
= IORESOURCE_MEM
,
98 .start
= IRQ_PROG_INTB
,
100 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
104 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
108 static struct platform_device smc91x_device
= {
111 .num_resources
= ARRAY_SIZE(smc91x_resources
),
112 .resource
= smc91x_resources
,
116 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
117 static struct resource net2272_bfin_resources
[] = {
120 .end
= 0x20300000 + 0x100,
121 .flags
= IORESOURCE_MEM
,
125 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
129 static struct platform_device net2272_bfin_device
= {
132 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
133 .resource
= net2272_bfin_resources
,
137 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
138 /* all SPI peripherals info goes here */
140 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
141 static struct mtd_partition bfin_spi_flash_partitions
[] = {
143 .name
= "bootloader (spi)",
146 .mask_flags
= MTD_CAP_ROM
148 .name
= "fpga (spi)",
152 .name
= "linux kernel (spi)",
156 .name
= "jffs2 root file system (spi)",
162 static struct flash_platform_data bfin_spi_flash_data
= {
164 .parts
= bfin_spi_flash_partitions
,
165 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
169 /* SPI flash chip (m25p64) */
170 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
171 .enable_dma
= 0, /* use dma transfer with this chip*/
176 #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
178 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
180 .enable_dma
= 1, /* use dma transfer with this chip*/
185 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
186 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
193 #if defined(CONFIG_PBX)
194 static struct bfin5xx_spi_chip spi_si3xxx_chip_info
= {
198 .cs_change_per_word
= 1,
202 /* Notice: for blackfin, the speed_hz is the value of register
203 * SPI_BAUD, not the real baudrate */
204 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
205 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
207 /* the modalias must be the same as spi device driver name */
208 .modalias
= "m25p80", /* Name of spi_driver for this device */
209 /* this value is the baudrate divisor */
210 .max_speed_hz
= 50000000, /* actual baudrate is SCLK/(2xspeed_hz) */
211 .bus_num
= 0, /* Framework bus number */
212 .chip_select
= 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
213 .platform_data
= &bfin_spi_flash_data
,
214 .controller_data
= &spi_flash_chip_info
,
219 #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
221 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
222 .max_speed_hz
= 4, /* actual baudrate is SCLK/(2xspeed_hz) */
223 .bus_num
= 1, /* Framework bus number */
224 .chip_select
= 1, /* Framework chip select. */
225 .platform_data
= NULL
, /* No spi_driver specific config */
226 .controller_data
= &spi_adc_chip_info
,
230 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
232 .modalias
= "ad1836-spi",
235 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
236 .controller_data
= &ad1836_spi_chip_info
,
240 #if defined(CONFIG_PBX)
242 .modalias
= "fxs-spi",
246 .controller_data
= &spi_si3xxx_chip_info
,
250 .modalias
= "fxo-spi",
254 .controller_data
= &spi_si3xxx_chip_info
,
260 static struct resource bfin_spi0_resource
[] = {
262 .start
= SPI0_REGBASE
,
263 .end
= SPI0_REGBASE
+ 0xFF,
264 .flags
= IORESOURCE_MEM
,
269 .flags
= IORESOURCE_IRQ
,
274 /* SPI controller data */
275 static struct bfin5xx_spi_master bfin_spi0_info
= {
277 .enable_dma
= 1, /* master has the ability to do dma transfer */
278 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
281 static struct platform_device bfin_spi0_device
= {
283 .id
= 0, /* Bus number */
284 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
285 .resource
= bfin_spi0_resource
,
287 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
290 #endif /* spi master and devices */
292 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
293 static struct platform_device bfin_fb_device
= {
298 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
299 static struct resource bfin_uart_resources
[] = {
303 .flags
= IORESOURCE_MEM
,
307 static struct platform_device bfin_uart_device
= {
310 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
311 .resource
= bfin_uart_resources
,
315 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
316 #ifdef CONFIG_BFIN_SIR0
317 static struct resource bfin_sir0_resources
[] = {
321 .flags
= IORESOURCE_MEM
,
324 .start
= IRQ_UART0_RX
,
325 .end
= IRQ_UART0_RX
+1,
326 .flags
= IORESOURCE_IRQ
,
329 .start
= CH_UART0_RX
,
330 .end
= CH_UART0_RX
+1,
331 .flags
= IORESOURCE_DMA
,
335 static struct platform_device bfin_sir0_device
= {
338 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
339 .resource
= bfin_sir0_resources
,
344 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
346 #include <linux/serial_8250.h>
347 #include <linux/serial.h>
350 * Configuration for two 16550 UARTS in FPGA at addresses 0x20200000 and 0x202000010.
351 * running at half system clock, both with interrupt output or-ed to PF8. Change to
352 * suit different FPGA configuration, or to suit real 16550 UARTS connected to the bus
355 static struct plat_serial8250_port serial8250_platform_data
[] = {
357 .membase
= (void *)0x20200000,
358 .mapbase
= 0x20200000,
360 .flags
= UPF_BOOT_AUTOCONF
| UART_CONFIG_TYPE
,
365 .membase
= (void *)0x20200010,
366 .mapbase
= 0x20200010,
368 .flags
= UPF_BOOT_AUTOCONF
| UART_CONFIG_TYPE
,
376 static struct platform_device serial8250_device
= {
377 .id
= PLAT8250_DEV_PLATFORM
,
378 .name
= "serial8250",
380 .platform_data
= serial8250_platform_data
,
386 #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
389 * Configuration for one OpenCores keyboard controller in FPGA at address 0x20200030,
390 * interrupt output wired to PF9. Change to suit different FPGA configuration
393 static struct resource opencores_kbd_resources
[] = {
396 .end
= 0x20300030 + 2,
397 .flags
= IORESOURCE_MEM
,
402 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
,
406 static struct platform_device opencores_kbd_device
= {
408 .name
= "opencores-kbd",
409 .resource
= opencores_kbd_resources
,
410 .num_resources
= ARRAY_SIZE(opencores_kbd_resources
),
414 static struct platform_device
*h8606_devices
[] __initdata
= {
415 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
419 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
423 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
427 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
428 &net2272_bfin_device
,
431 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
435 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
439 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
443 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
444 #ifdef CONFIG_BFIN_SIR0
449 #if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
450 &opencores_kbd_device
,
454 static int __init
H8606_init(void)
456 printk(KERN_INFO
"HV Sistemas H8606 board support by http://www.hvsistemas.com\n");
457 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
458 platform_add_devices(h8606_devices
, ARRAY_SIZE(h8606_devices
));
459 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
460 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
465 arch_initcall(H8606_init
);