2 * File: arch/blackfin/mach-bf533/boards/cm_bf561.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/ata_platform.h>
38 #include <linux/irq.h>
40 #include <asm/bfin5xx_spi.h>
41 #include <asm/portmux.h>
44 * Name the Board for the /proc/cpuinfo
46 const char bfin_board_name
[] = "Bluetechnix CM BF561";
48 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
49 /* all SPI peripherals info goes here */
51 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
52 static struct mtd_partition bfin_spi_flash_partitions
[] = {
57 .mask_flags
= MTD_CAP_ROM
63 .name
= "file system",
69 static struct flash_platform_data bfin_spi_flash_data
= {
71 .parts
= bfin_spi_flash_partitions
,
72 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
76 /* SPI flash chip (m25p64) */
77 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
78 .enable_dma
= 0, /* use dma transfer with this chip*/
83 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
85 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
86 .enable_dma
= 1, /* use dma transfer with this chip*/
91 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
92 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
98 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
99 static struct bfin5xx_spi_chip ad9960_spi_chip_info
= {
105 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
106 static struct bfin5xx_spi_chip spi_mmc_chip_info
= {
112 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
113 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
115 /* the modalias must be the same as spi device driver name */
116 .modalias
= "m25p80", /* Name of spi_driver for this device */
117 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
118 .bus_num
= 0, /* Framework bus number */
119 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
120 .platform_data
= &bfin_spi_flash_data
,
121 .controller_data
= &spi_flash_chip_info
,
126 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
128 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
129 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
130 .bus_num
= 0, /* Framework bus number */
131 .chip_select
= 1, /* Framework chip select. */
132 .platform_data
= NULL
, /* No spi_driver specific config */
133 .controller_data
= &spi_adc_chip_info
,
137 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
139 .modalias
= "ad1836-spi",
140 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
142 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
143 .controller_data
= &ad1836_spi_chip_info
,
146 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
148 .modalias
= "ad9960-spi",
149 .max_speed_hz
= 10000000, /* max spi clock (SCK) speed in HZ */
152 .controller_data
= &ad9960_spi_chip_info
,
155 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
157 .modalias
= "spi_mmc",
158 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
160 .chip_select
= CONFIG_SPI_MMC_CS_CHAN
,
161 .platform_data
= NULL
,
162 .controller_data
= &spi_mmc_chip_info
,
169 static struct resource bfin_spi0_resource
[] = {
171 .start
= SPI0_REGBASE
,
172 .end
= SPI0_REGBASE
+ 0xFF,
173 .flags
= IORESOURCE_MEM
,
178 .flags
= IORESOURCE_IRQ
,
182 /* SPI controller data */
183 static struct bfin5xx_spi_master bfin_spi0_info
= {
185 .enable_dma
= 1, /* master has the ability to do dma transfer */
186 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
189 static struct platform_device bfin_spi0_device
= {
191 .id
= 0, /* Bus number */
192 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
193 .resource
= bfin_spi0_resource
,
195 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
198 #endif /* spi master and devices */
201 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
202 static struct platform_device hitachi_fb_device
= {
203 .name
= "hitachi-tx09",
208 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
210 static struct resource smc91x_resources
[] = {
212 .name
= "smc91x-regs",
214 .end
= 0x28000300 + 16,
215 .flags
= IORESOURCE_MEM
,
219 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
222 static struct platform_device smc91x_device
= {
225 .num_resources
= ARRAY_SIZE(smc91x_resources
),
226 .resource
= smc91x_resources
,
230 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
231 static struct resource isp1362_hcd_resources
[] = {
235 .flags
= IORESOURCE_MEM
,
239 .flags
= IORESOURCE_MEM
,
243 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
247 static struct isp1362_platform_data isp1362_priv
= {
252 .int_edge_triggered
= 0,
253 .remote_wakeup_connected
= 0,
254 .no_power_switching
= 1,
255 .power_switching_mode
= 0,
258 static struct platform_device isp1362_hcd_device
= {
259 .name
= "isp1362-hcd",
262 .platform_data
= &isp1362_priv
,
264 .num_resources
= ARRAY_SIZE(isp1362_hcd_resources
),
265 .resource
= isp1362_hcd_resources
,
269 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
270 static struct resource bfin_uart_resources
[] = {
274 .flags
= IORESOURCE_MEM
,
278 static struct platform_device bfin_uart_device
= {
281 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
282 .resource
= bfin_uart_resources
,
286 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
287 static struct resource bfin_sir_resources
[] = {
288 #ifdef CONFIG_BFIN_SIR0
292 .flags
= IORESOURCE_MEM
,
297 static struct platform_device bfin_sir_device
= {
300 .num_resources
= ARRAY_SIZE(bfin_sir_resources
),
301 .resource
= bfin_sir_resources
,
305 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
308 static struct pata_platform_info bfin_pata_platform_data
= {
310 .irq_type
= IRQF_TRIGGER_HIGH
| IRQF_DISABLED
,
313 static struct resource bfin_pata_resources
[] = {
317 .flags
= IORESOURCE_MEM
,
322 .flags
= IORESOURCE_MEM
,
327 .flags
= IORESOURCE_IRQ
,
331 static struct platform_device bfin_pata_device
= {
332 .name
= "pata_platform",
334 .num_resources
= ARRAY_SIZE(bfin_pata_resources
),
335 .resource
= bfin_pata_resources
,
337 .platform_data
= &bfin_pata_platform_data
,
342 static struct platform_device
*cm_bf561_devices
[] __initdata
= {
344 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
348 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
352 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
356 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
360 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
364 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
368 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
373 static int __init
cm_bf561_init(void)
375 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
376 platform_add_devices(cm_bf561_devices
, ARRAY_SIZE(cm_bf561_devices
));
377 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
378 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
381 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
382 irq_desc
[PATA_INT
].status
|= IRQ_NOAUTOEN
;
387 arch_initcall(cm_bf561_init
);