2 * File: arch/blackfin/mach-bf533/ezkit.c
3 * Based on: Original Work
4 * Author: Aidan Williams <aidan@nicta.com.au>
9 * Modified: Robin Getz <rgetz@blackfin.uclinux.org> - Named the boards
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc.
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <linux/device.h>
32 #include <linux/platform_device.h>
33 #include <linux/mtd/mtd.h>
34 #include <linux/mtd/partitions.h>
35 #include <linux/spi/spi.h>
36 #include <linux/spi/flash.h>
37 #include <linux/usb_isp1362.h>
38 #include <linux/pata_platform.h>
39 #include <linux/irq.h>
41 #include <asm/bfin5xx_spi.h>
44 * Name the Board for the /proc/cpuinfo
46 char *bfin_board_name = "ADDS-BF533-EZKIT";
48 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
49 static struct platform_device rtc_device = {
55 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
56 static struct platform_device bfin_fb_adv7393_device = {
57 .name = "bfin-adv7393",
62 * USB-LAN EzExtender board
63 * Driver needs to know address, irq and flag pin.
65 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
66 static struct resource smc91x_resources[] = {
68 .name = "smc91x-regs",
70 .end = 0x20310300 + 16,
71 .flags = IORESOURCE_MEM,
75 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
78 static struct platform_device smc91x_device = {
81 .num_resources = ARRAY_SIZE(smc91x_resources),
82 .resource = smc91x_resources,
86 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
87 /* all SPI peripherals info goes here */
89 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
90 static struct mtd_partition bfin_spi_flash_partitions[] = {
95 .mask_flags = MTD_CAP_ROM
101 .name = "file system",
103 .offset = 0x00100000,
107 static struct flash_platform_data bfin_spi_flash_data = {
109 .parts = bfin_spi_flash_partitions,
110 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
114 /* SPI flash chip (m25p64) */
115 static struct bfin5xx_spi_chip spi_flash_chip_info = {
116 .enable_dma = 0, /* use dma transfer with this chip*/
121 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
123 static struct bfin5xx_spi_chip spi_adc_chip_info = {
124 .enable_dma = 1, /* use dma transfer with this chip*/
129 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
130 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
136 static struct spi_board_info bfin_spi_board_info[] __initdata = {
137 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
139 /* the modalias must be the same as spi device driver name */
140 .modalias = "m25p80", /* Name of spi_driver for this device */
141 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
142 .bus_num = 0, /* Framework bus number */
143 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
144 .platform_data = &bfin_spi_flash_data,
145 .controller_data = &spi_flash_chip_info,
150 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
152 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
153 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
154 .bus_num = 0, /* Framework bus number */
155 .chip_select = 1, /* Framework chip select. */
156 .platform_data = NULL, /* No spi_driver specific config */
157 .controller_data = &spi_adc_chip_info,
161 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
163 .modalias = "ad1836-spi",
164 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
166 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
167 .controller_data = &ad1836_spi_chip_info,
173 static struct resource bfin_spi0_resource[] = {
175 .start = SPI0_REGBASE,
176 .end = SPI0_REGBASE + 0xFF,
177 .flags = IORESOURCE_MEM,
182 .flags = IORESOURCE_IRQ,
186 /* SPI controller data */
187 static struct bfin5xx_spi_master bfin_spi0_info = {
189 .enable_dma = 1, /* master has the ability to do dma transfer */
192 static struct platform_device bfin_spi0_device = {
194 .id = 0, /* Bus number */
195 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
196 .resource = bfin_spi0_resource,
198 .platform_data = &bfin_spi0_info, /* Passed to driver */
201 #endif /* spi master and devices */
203 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
204 static struct resource bfin_uart_resources[] = {
208 .flags = IORESOURCE_MEM,
212 static struct platform_device bfin_uart_device = {
215 .num_resources = ARRAY_SIZE(bfin_uart_resources),
216 .resource = bfin_uart_resources,
220 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
223 static struct pata_platform_info bfin_pata_platform_data = {
225 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
228 static struct resource bfin_pata_resources[] = {
232 .flags = IORESOURCE_MEM,
237 .flags = IORESOURCE_MEM,
242 .flags = IORESOURCE_IRQ,
246 static struct platform_device bfin_pata_device = {
247 .name = "pata_platform",
249 .num_resources = ARRAY_SIZE(bfin_pata_resources),
250 .resource = bfin_pata_resources,
252 .platform_data = &bfin_pata_platform_data,
257 static struct platform_device *ezkit_devices[] __initdata = {
258 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
262 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
266 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
267 &bfin_fb_adv7393_device,
270 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
274 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
278 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
283 static int __init ezkit_init(void)
285 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
286 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
287 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
288 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
291 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
292 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
297 arch_initcall(ezkit_init);