2 * File: arch/blackfin/mach-bf561/ezkit.c
10 * Copyright 2004-2006 Analog Devices Inc.
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #include <linux/device.h>
31 #include <linux/platform_device.h>
32 #include <linux/spi/spi.h>
33 #include <linux/irq.h>
34 #include <linux/interrupt.h>
35 #include <linux/pata_platform.h>
37 #include <asm/bfin5xx_spi.h>
40 * Name the Board for the /proc/cpuinfo
42 char *bfin_board_name = "ADDS-BF561-EZKIT";
44 #define ISP1761_BASE 0x2C0F0000
45 #define ISP1761_IRQ IRQ_PF10
47 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
48 static struct resource bfin_isp1761_resources[] = {
50 .name = "isp1761-regs",
51 .start = ISP1761_BASE + 0x00000000,
52 .end = ISP1761_BASE + 0x000fffff,
53 .flags = IORESOURCE_MEM,
58 .flags = IORESOURCE_IRQ,
62 static struct platform_device bfin_isp1761_device = {
65 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
66 .resource = bfin_isp1761_resources,
69 static struct platform_device *bfin_isp1761_devices[] = {
73 int __init bfin_isp1761_init(void)
75 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
77 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
78 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
80 return platform_add_devices(bfin_isp1761_devices, num_devices);
83 void __exit bfin_isp1761_exit(void)
85 platform_device_unregister(&bfin_isp1761_device);
88 arch_initcall(bfin_isp1761_init);
92 * USB-LAN EzExtender board
93 * Driver needs to know address, irq and flag pin.
95 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
96 static struct resource smc91x_resources[] = {
98 .name = "smc91x-regs",
100 .end = 0x2C010300 + 16,
101 .flags = IORESOURCE_MEM,
106 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
110 static struct platform_device smc91x_device = {
113 .num_resources = ARRAY_SIZE(smc91x_resources),
114 .resource = smc91x_resources,
118 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
119 static struct resource bfin_uart_resources[] = {
123 .flags = IORESOURCE_MEM,
127 static struct platform_device bfin_uart_device = {
130 .num_resources = ARRAY_SIZE(bfin_uart_resources),
131 .resource = bfin_uart_resources,
135 #ifdef CONFIG_SPI_BFIN
136 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
137 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
138 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
146 static struct resource bfin_spi0_resource[] = {
148 .start = SPI0_REGBASE,
149 .end = SPI0_REGBASE + 0xFF,
150 .flags = IORESOURCE_MEM,
155 .flags = IORESOURCE_IRQ,
159 /* SPI controller data */
160 static struct bfin5xx_spi_master bfin_spi0_info = {
162 .enable_dma = 1, /* master has the ability to do dma transfer */
165 static struct platform_device bfin_spi0_device = {
167 .id = 0, /* Bus number */
168 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
169 .resource = bfin_spi0_resource,
171 .platform_data = &bfin_spi0_info, /* Passed to driver */
175 static struct spi_board_info bfin_spi_board_info[] __initdata = {
176 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
177 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
179 .modalias = "ad1836-spi",
180 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
182 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
183 .controller_data = &ad1836_spi_chip_info,
188 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
191 static struct pata_platform_info bfin_pata_platform_data = {
193 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
196 static struct resource bfin_pata_resources[] = {
200 .flags = IORESOURCE_MEM,
205 .flags = IORESOURCE_MEM,
210 .flags = IORESOURCE_IRQ,
214 static struct platform_device bfin_pata_device = {
215 .name = "pata_platform",
217 .num_resources = ARRAY_SIZE(bfin_pata_resources),
218 .resource = bfin_pata_resources,
220 .platform_data = &bfin_pata_platform_data,
225 static struct platform_device *ezkit_devices[] __initdata = {
226 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
229 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
232 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
235 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
240 static int __init ezkit_init(void)
244 printk(KERN_INFO "%s(): registering device resources\n", __func__);
246 ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
250 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
251 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
255 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
256 spi_register_board_info(bfin_spi_board_info,
257 ARRAY_SIZE(bfin_spi_board_info));
260 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
261 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
266 arch_initcall(ezkit_init);