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>
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_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[] = {
67 .end = 0x20300000 + 8,
68 .flags = IORESOURCE_MEM,
73 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
77 static struct platform_device dm9000_device = {
80 .resource = dm9000_resources,
81 .num_resources = ARRAY_SIZE(dm9000_resources),
85 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
86 static struct resource smc91x_resources[] = {
88 .name = "smc91x-regs",
90 .end = 0x20300300 + 16,
91 .flags = IORESOURCE_MEM,
93 .start = IRQ_PROG_INTB,
95 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
98 * denotes the flag pin and is used directly if
99 * CONFIG_IRQCHIP_DEMUX_GPIO is defined.
103 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
107 static struct platform_device smc91x_device = {
110 .num_resources = ARRAY_SIZE(smc91x_resources),
111 .resource = smc91x_resources,
115 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
116 static struct resource net2272_bfin_resources[] = {
119 .end = 0x20300000 + 0x100,
120 .flags = IORESOURCE_MEM,
124 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
128 static struct platform_device net2272_bfin_device = {
131 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
132 .resource = net2272_bfin_resources,
136 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
137 /* all SPI peripherals info goes here */
139 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
140 static struct mtd_partition bfin_spi_flash_partitions[] = {
142 .name = "bootloader",
145 .mask_flags = MTD_CAP_ROM
151 .name = "file system",
153 .offset = 0x00160000,
157 static struct flash_platform_data bfin_spi_flash_data = {
159 .parts = bfin_spi_flash_partitions,
160 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
164 /* SPI flash chip (m25p64) */
165 static struct bfin5xx_spi_chip spi_flash_chip_info = {
166 .enable_dma = 0, /* use dma transfer with this chip*/
171 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
173 static struct bfin5xx_spi_chip spi_adc_chip_info = {
175 .enable_dma = 1, /* use dma transfer with this chip*/
180 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
181 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
188 #if defined(CONFIG_PBX)
189 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
193 .cs_change_per_word = 1,
197 /* Notice: for blackfin, the speed_hz is the value of register
198 * SPI_BAUD, not the real baudrate */
199 static struct spi_board_info bfin_spi_board_info[] __initdata = {
200 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
202 /* the modalias must be the same as spi device driver name */
203 .modalias = "m25p80", /* Name of spi_driver for this device */
204 /* this value is the baudrate divisor */
205 .max_speed_hz = 50000000, /* actual baudrate is SCLK/(2xspeed_hz) */
206 .bus_num = 0, /* Framework bus number */
207 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
208 .platform_data = &bfin_spi_flash_data,
209 .controller_data = &spi_flash_chip_info,
214 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
216 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
217 .max_speed_hz = 4, /* actual baudrate is SCLK/(2xspeed_hz) */
218 .bus_num = 1, /* Framework bus number */
219 .chip_select = 1, /* Framework chip select. */
220 .platform_data = NULL, /* No spi_driver specific config */
221 .controller_data = &spi_adc_chip_info,
225 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
227 .modalias = "ad1836-spi",
230 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
231 .controller_data = &ad1836_spi_chip_info,
235 #if defined(CONFIG_PBX)
237 .modalias = "fxs-spi",
241 .controller_data = &spi_si3xxx_chip_info,
245 .modalias = "fxo-spi",
249 .controller_data = &spi_si3xxx_chip_info,
255 static struct resource bfin_spi0_resource[] = {
257 .start = SPI0_REGBASE,
258 .end = SPI0_REGBASE + 0xFF,
259 .flags = IORESOURCE_MEM,
264 .flags = IORESOURCE_IRQ,
269 /* SPI controller data */
270 static struct bfin5xx_spi_master bfin_spi0_info = {
272 .enable_dma = 1, /* master has the ability to do dma transfer */
273 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
276 static struct platform_device bfin_spi0_device = {
278 .id = 0, /* Bus number */
279 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
280 .resource = bfin_spi0_resource,
282 .platform_data = &bfin_spi0_info, /* Passed to driver */
285 #endif /* spi master and devices */
287 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
288 static struct platform_device bfin_fb_device = {
293 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
294 static struct resource bfin_uart_resources[] = {
298 .flags = IORESOURCE_MEM,
302 static struct platform_device bfin_uart_device = {
305 .num_resources = ARRAY_SIZE(bfin_uart_resources),
306 .resource = bfin_uart_resources,
310 static struct platform_device *stamp_devices[] __initdata = {
311 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
315 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
319 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
323 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
324 &net2272_bfin_device,
327 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
331 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
336 static int __init H8606_init(void)
338 printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n");
339 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
340 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
341 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
342 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
347 arch_initcall(H8606_init);