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 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
37 #include <linux/usb/isp1362.h>
39 #include <linux/ata_platform.h>
40 #include <linux/irq.h>
42 #include <asm/bfin5xx_spi.h>
43 #include <asm/portmux.h>
47 * Name the Board for the /proc/cpuinfo
49 const char bfin_board_name
[] = "Bluetechnix CM BF561";
51 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
52 /* all SPI peripherals info goes here */
54 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
55 static struct mtd_partition bfin_spi_flash_partitions
[] = {
57 .name
= "bootloader(spi)",
60 .mask_flags
= MTD_CAP_ROM
62 .name
= "linux kernel(spi)",
66 .name
= "file system(spi)",
72 static struct flash_platform_data bfin_spi_flash_data
= {
74 .parts
= bfin_spi_flash_partitions
,
75 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
79 /* SPI flash chip (m25p64) */
80 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
81 .enable_dma
= 0, /* use dma transfer with this chip*/
86 #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
88 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
89 .enable_dma
= 1, /* use dma transfer with this chip*/
94 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
95 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
101 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
102 static struct bfin5xx_spi_chip ad9960_spi_chip_info
= {
108 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
109 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
115 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
116 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
118 /* the modalias must be the same as spi device driver name */
119 .modalias
= "m25p80", /* Name of spi_driver for this device */
120 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
121 .bus_num
= 0, /* Framework bus number */
122 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
123 .platform_data
= &bfin_spi_flash_data
,
124 .controller_data
= &spi_flash_chip_info
,
129 #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
131 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
132 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
133 .bus_num
= 0, /* Framework bus number */
134 .chip_select
= 1, /* Framework chip select. */
135 .platform_data
= NULL
, /* No spi_driver specific config */
136 .controller_data
= &spi_adc_chip_info
,
140 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
142 .modalias
= "ad1836-spi",
143 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
145 .chip_select
= CONFIG_SND_BLACKFIN_SPI_PFBIT
,
146 .controller_data
= &ad1836_spi_chip_info
,
149 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
151 .modalias
= "ad9960-spi",
152 .max_speed_hz
= 10000000, /* max spi clock (SCK) speed in HZ */
155 .controller_data
= &ad9960_spi_chip_info
,
158 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
160 .modalias
= "mmc_spi",
161 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
164 .controller_data
= &mmc_spi_chip_info
,
171 static struct resource bfin_spi0_resource
[] = {
173 .start
= SPI0_REGBASE
,
174 .end
= SPI0_REGBASE
+ 0xFF,
175 .flags
= IORESOURCE_MEM
,
180 .flags
= IORESOURCE_DMA
,
185 .flags
= IORESOURCE_IRQ
,
189 /* SPI controller data */
190 static struct bfin5xx_spi_master bfin_spi0_info
= {
192 .enable_dma
= 1, /* master has the ability to do dma transfer */
193 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
196 static struct platform_device bfin_spi0_device
= {
198 .id
= 0, /* Bus number */
199 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
200 .resource
= bfin_spi0_resource
,
202 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
205 #endif /* spi master and devices */
208 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
209 static struct platform_device hitachi_fb_device
= {
210 .name
= "hitachi-tx09",
215 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
216 #include <linux/smc91x.h>
218 static struct smc91x_platdata smc91x_info
= {
219 .flags
= SMC91X_USE_32BIT
| SMC91X_NOWAIT
,
220 .leda
= RPC_LED_100_10
,
221 .ledb
= RPC_LED_TX_RX
,
224 static struct resource smc91x_resources
[] = {
226 .name
= "smc91x-regs",
228 .end
= 0x28000300 + 16,
229 .flags
= IORESOURCE_MEM
,
233 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
236 static struct platform_device smc91x_device
= {
239 .num_resources
= ARRAY_SIZE(smc91x_resources
),
240 .resource
= smc91x_resources
,
242 .platform_data
= &smc91x_info
,
247 static struct resource bfin_gpios_resources
= {
249 .end
= MAX_BLACKFIN_GPIOS
- 1,
250 .flags
= IORESOURCE_IRQ
,
253 static struct platform_device bfin_gpios_device
= {
254 .name
= "simple-gpio",
257 .resource
= &bfin_gpios_resources
,
260 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
261 static struct resource isp1362_hcd_resources
[] = {
265 .flags
= IORESOURCE_MEM
,
269 .flags
= IORESOURCE_MEM
,
273 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
277 static struct isp1362_platform_data isp1362_priv
= {
282 .int_edge_triggered
= 0,
283 .remote_wakeup_connected
= 0,
284 .no_power_switching
= 1,
285 .power_switching_mode
= 0,
288 static struct platform_device isp1362_hcd_device
= {
289 .name
= "isp1362-hcd",
292 .platform_data
= &isp1362_priv
,
294 .num_resources
= ARRAY_SIZE(isp1362_hcd_resources
),
295 .resource
= isp1362_hcd_resources
,
299 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
300 static struct resource bfin_uart_resources
[] = {
304 .flags
= IORESOURCE_MEM
,
308 static struct platform_device bfin_uart_device
= {
311 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
312 .resource
= bfin_uart_resources
,
316 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
317 #ifdef CONFIG_BFIN_SIR0
318 static struct resource bfin_sir0_resources
[] = {
322 .flags
= IORESOURCE_MEM
,
325 .start
= IRQ_UART0_RX
,
326 .end
= IRQ_UART0_RX
+1,
327 .flags
= IORESOURCE_IRQ
,
330 .start
= CH_UART0_RX
,
331 .end
= CH_UART0_RX
+1,
332 .flags
= IORESOURCE_DMA
,
336 static struct platform_device bfin_sir0_device
= {
339 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
340 .resource
= bfin_sir0_resources
,
345 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
346 #define PATA_INT IRQ_PF46
348 static struct pata_platform_info bfin_pata_platform_data
= {
350 .irq_type
= IRQF_TRIGGER_HIGH
| IRQF_DISABLED
,
353 static struct resource bfin_pata_resources
[] = {
357 .flags
= IORESOURCE_MEM
,
362 .flags
= IORESOURCE_MEM
,
367 .flags
= IORESOURCE_IRQ
,
371 static struct platform_device bfin_pata_device
= {
372 .name
= "pata_platform",
374 .num_resources
= ARRAY_SIZE(bfin_pata_resources
),
375 .resource
= bfin_pata_resources
,
377 .platform_data
= &bfin_pata_platform_data
,
382 static const unsigned int cclk_vlev_datasheet
[] =
384 VRPAIR(VLEV_085
, 250000000),
385 VRPAIR(VLEV_090
, 300000000),
386 VRPAIR(VLEV_095
, 313000000),
387 VRPAIR(VLEV_100
, 350000000),
388 VRPAIR(VLEV_105
, 400000000),
389 VRPAIR(VLEV_110
, 444000000),
390 VRPAIR(VLEV_115
, 450000000),
391 VRPAIR(VLEV_120
, 475000000),
392 VRPAIR(VLEV_125
, 500000000),
393 VRPAIR(VLEV_130
, 600000000),
396 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
397 .tuple_tab
= cclk_vlev_datasheet
,
398 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
399 .vr_settling_time
= 25 /* us */,
402 static struct platform_device bfin_dpmc
= {
405 .platform_data
= &bfin_dmpc_vreg_data
,
409 static struct platform_device
*cm_bf561_devices
[] __initdata
= {
413 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
417 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
421 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
422 #ifdef CONFIG_BFIN_SIR0
427 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
431 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
435 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
439 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
446 static int __init
cm_bf561_init(void)
448 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
449 platform_add_devices(cm_bf561_devices
, ARRAY_SIZE(cm_bf561_devices
));
450 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
451 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
454 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
455 irq_desc
[PATA_INT
].status
|= IRQ_NOAUTOEN
;
460 arch_initcall(cm_bf561_init
);