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>
38 #include <asm/portmux.h>
41 * Name the Board for the /proc/cpuinfo
43 const char bfin_board_name
[] = "ADDS-BF561-EZKIT";
45 #define ISP1761_BASE 0x2C0F0000
46 #define ISP1761_IRQ IRQ_PF10
48 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
49 static struct resource bfin_isp1761_resources
[] = {
51 .name
= "isp1761-regs",
52 .start
= ISP1761_BASE
+ 0x00000000,
53 .end
= ISP1761_BASE
+ 0x000fffff,
54 .flags
= IORESOURCE_MEM
,
59 .flags
= IORESOURCE_IRQ
,
63 static struct platform_device bfin_isp1761_device
= {
66 .num_resources
= ARRAY_SIZE(bfin_isp1761_resources
),
67 .resource
= bfin_isp1761_resources
,
70 static struct platform_device
*bfin_isp1761_devices
[] = {
74 int __init
bfin_isp1761_init(void)
76 unsigned int num_devices
= ARRAY_SIZE(bfin_isp1761_devices
);
78 printk(KERN_INFO
"%s(): registering device resources\n", __FUNCTION__
);
79 set_irq_type(ISP1761_IRQ
, IRQF_TRIGGER_FALLING
);
81 return platform_add_devices(bfin_isp1761_devices
, num_devices
);
84 void __exit
bfin_isp1761_exit(void)
86 platform_device_unregister(&bfin_isp1761_device
);
89 arch_initcall(bfin_isp1761_init
);
93 * USB-LAN EzExtender board
94 * Driver needs to know address, irq and flag pin.
96 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
97 static struct resource smc91x_resources
[] = {
99 .name
= "smc91x-regs",
101 .end
= 0x2C010300 + 16,
102 .flags
= IORESOURCE_MEM
,
107 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
111 static struct platform_device smc91x_device
= {
114 .num_resources
= ARRAY_SIZE(smc91x_resources
),
115 .resource
= smc91x_resources
,
119 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
120 static struct resource bfin_uart_resources
[] = {
124 .flags
= IORESOURCE_MEM
,
128 static struct platform_device bfin_uart_device
= {
131 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
132 .resource
= bfin_uart_resources
,
136 #ifdef CONFIG_SPI_BFIN
137 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
138 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
139 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
147 static struct resource bfin_spi0_resource
[] = {
149 .start
= SPI0_REGBASE
,
150 .end
= SPI0_REGBASE
+ 0xFF,
151 .flags
= IORESOURCE_MEM
,
156 .flags
= IORESOURCE_IRQ
,
160 /* SPI controller data */
161 static struct bfin5xx_spi_master bfin_spi0_info
= {
163 .enable_dma
= 1, /* master has the ability to do dma transfer */
164 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
167 static struct platform_device bfin_spi0_device
= {
169 .id
= 0, /* Bus number */
170 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
171 .resource
= bfin_spi0_resource
,
173 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
177 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
178 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
179 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
181 .modalias
= "ad1836-spi",
182 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
184 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
185 .controller_data
= &ad1836_spi_chip_info
,
190 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
193 static struct pata_platform_info bfin_pata_platform_data
= {
195 .irq_type
= IRQF_TRIGGER_HIGH
| IRQF_DISABLED
,
198 static struct resource bfin_pata_resources
[] = {
202 .flags
= IORESOURCE_MEM
,
207 .flags
= IORESOURCE_MEM
,
212 .flags
= IORESOURCE_IRQ
,
216 static struct platform_device bfin_pata_device
= {
217 .name
= "pata_platform",
219 .num_resources
= ARRAY_SIZE(bfin_pata_resources
),
220 .resource
= bfin_pata_resources
,
222 .platform_data
= &bfin_pata_platform_data
,
227 static struct platform_device
*ezkit_devices
[] __initdata
= {
228 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
231 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
234 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
237 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
242 static int __init
ezkit_init(void)
246 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
248 ret
= platform_add_devices(ezkit_devices
, ARRAY_SIZE(ezkit_devices
));
252 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
253 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
257 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
258 spi_register_board_info(bfin_spi_board_info
,
259 ARRAY_SIZE(bfin_spi_board_info
));
262 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
263 irq_desc
[PATA_INT
].status
|= IRQ_NOAUTOEN
;
268 arch_initcall(ezkit_init
);