2 * File: arch/blackfin/mach-bf533/boards/cm_bf533.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au> Copyright 2005
7 * Description: Board description file
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/mtd/mtd.h>
33 #include <linux/mtd/partitions.h>
34 #include <linux/spi/spi.h>
35 #include <linux/spi/flash.h>
36 #include <linux/usb_isp1362.h>
37 #include <linux/pata_platform.h>
38 #include <linux/irq.h>
40 #include <asm/bfin5xx_spi.h>
43 * Name the Board for the /proc/cpuinfo
45 const char bfin_board_name[] = "Bluetechnix CM BF533";
47 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
48 /* all SPI peripherals info goes here */
49 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
50 static struct mtd_partition bfin_spi_flash_partitions[] = {
55 .mask_flags = MTD_CAP_ROM
61 .name = "file system",
67 static struct flash_platform_data bfin_spi_flash_data = {
69 .parts = bfin_spi_flash_partitions,
70 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
74 /* SPI flash chip (m25p64) */
75 static struct bfin5xx_spi_chip spi_flash_chip_info = {
76 .enable_dma = 0, /* use dma transfer with this chip*/
82 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
83 static struct bfin5xx_spi_chip spi_adc_chip_info = {
84 .enable_dma = 1, /* use dma transfer with this chip*/
89 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
90 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
96 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
97 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
103 static struct spi_board_info bfin_spi_board_info[] __initdata = {
104 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
106 /* the modalias must be the same as spi device driver name */
107 .modalias = "m25p80", /* Name of spi_driver for this device */
108 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
109 .bus_num = 0, /* Framework bus number */
110 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
111 .platform_data = &bfin_spi_flash_data,
112 .controller_data = &spi_flash_chip_info,
117 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
119 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
120 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
121 .bus_num = 0, /* Framework bus number */
122 .chip_select = 2, /* Framework chip select. */
123 .platform_data = NULL, /* No spi_driver specific config */
124 .controller_data = &spi_adc_chip_info,
128 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
130 .modalias = "ad1836-spi",
131 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
133 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
134 .controller_data = &ad1836_spi_chip_info,
138 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
140 .modalias = "spi_mmc_dummy",
141 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
144 .platform_data = NULL,
145 .controller_data = &spi_mmc_chip_info,
149 .modalias = "spi_mmc",
150 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
152 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
153 .platform_data = NULL,
154 .controller_data = &spi_mmc_chip_info,
161 static struct resource bfin_spi0_resource[] = {
163 .start = SPI0_REGBASE,
164 .end = SPI0_REGBASE + 0xFF,
165 .flags = IORESOURCE_MEM,
170 .flags = IORESOURCE_IRQ,
174 /* SPI controller data */
175 static struct bfin5xx_spi_master bfin_spi0_info = {
177 .enable_dma = 1, /* master has the ability to do dma transfer */
180 static struct platform_device bfin_spi0_device = {
182 .id = 0, /* Bus number */
183 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
184 .resource = bfin_spi0_resource,
186 .platform_data = &bfin_spi0_info, /* Passed to driver */
189 #endif /* spi master and devices */
191 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
192 static struct platform_device rtc_device = {
198 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
199 static struct resource smc91x_resources[] = {
202 .end = 0x20200300 + 16,
203 .flags = IORESOURCE_MEM,
207 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
210 static struct platform_device smc91x_device = {
213 .num_resources = ARRAY_SIZE(smc91x_resources),
214 .resource = smc91x_resources,
218 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
219 static struct resource bfin_uart_resources[] = {
223 .flags = IORESOURCE_MEM,
227 static struct platform_device bfin_uart_device = {
230 .num_resources = ARRAY_SIZE(bfin_uart_resources),
231 .resource = bfin_uart_resources,
235 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
236 static struct platform_device bfin_sport0_uart_device = {
237 .name = "bfin-sport-uart",
241 static struct platform_device bfin_sport1_uart_device = {
242 .name = "bfin-sport-uart",
247 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
248 static struct resource isp1362_hcd_resources[] = {
252 .flags = IORESOURCE_MEM,
256 .flags = IORESOURCE_MEM,
260 .flags = IORESOURCE_IRQ,
264 static struct isp1362_platform_data isp1362_priv = {
269 .int_edge_triggered = 0,
270 .remote_wakeup_connected = 0,
271 .no_power_switching = 1,
272 .power_switching_mode = 0,
275 static struct platform_device isp1362_hcd_device = {
276 .name = "isp1362-hcd",
279 .platform_data = &isp1362_priv,
281 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
282 .resource = isp1362_hcd_resources,
286 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
289 static struct pata_platform_info bfin_pata_platform_data = {
291 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
294 static struct resource bfin_pata_resources[] = {
298 .flags = IORESOURCE_MEM,
303 .flags = IORESOURCE_MEM,
308 .flags = IORESOURCE_IRQ,
312 static struct platform_device bfin_pata_device = {
313 .name = "pata_platform",
315 .num_resources = ARRAY_SIZE(bfin_pata_resources),
316 .resource = bfin_pata_resources,
318 .platform_data = &bfin_pata_platform_data,
323 static struct platform_device *cm_bf533_devices[] __initdata = {
324 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
328 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
329 &bfin_sport0_uart_device,
330 &bfin_sport1_uart_device,
333 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
337 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
341 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
345 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
349 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
354 static int __init cm_bf533_init(void)
356 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
357 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices));
358 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
359 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
362 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
363 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
368 arch_initcall(cm_bf533_init);