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>
45 * Name the Board for the /proc/cpuinfo
47 const char bfin_board_name[] = "Bluetechnix CM BF561";
49 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
50 /* all SPI peripherals info goes here */
52 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
53 static struct mtd_partition bfin_spi_flash_partitions[] = {
58 .mask_flags = MTD_CAP_ROM
64 .name = "file system",
70 static struct flash_platform_data bfin_spi_flash_data = {
72 .parts = bfin_spi_flash_partitions,
73 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
77 /* SPI flash chip (m25p64) */
78 static struct bfin5xx_spi_chip spi_flash_chip_info = {
79 .enable_dma = 0, /* use dma transfer with this chip*/
84 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
86 static struct bfin5xx_spi_chip spi_adc_chip_info = {
87 .enable_dma = 1, /* use dma transfer with this chip*/
92 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
93 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
99 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
100 static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
106 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
107 static struct bfin5xx_spi_chip spi_mmc_chip_info = {
113 static struct spi_board_info bfin_spi_board_info[] __initdata = {
114 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
116 /* the modalias must be the same as spi device driver name */
117 .modalias = "m25p80", /* Name of spi_driver for this device */
118 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
119 .bus_num = 0, /* Framework bus number */
120 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
121 .platform_data = &bfin_spi_flash_data,
122 .controller_data = &spi_flash_chip_info,
127 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
129 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
130 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
131 .bus_num = 0, /* Framework bus number */
132 .chip_select = 1, /* Framework chip select. */
133 .platform_data = NULL, /* No spi_driver specific config */
134 .controller_data = &spi_adc_chip_info,
138 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
140 .modalias = "ad1836-spi",
141 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
143 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
144 .controller_data = &ad1836_spi_chip_info,
147 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
149 .modalias = "ad9960-spi",
150 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
153 .controller_data = &ad9960_spi_chip_info,
156 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
158 .modalias = "spi_mmc",
159 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
161 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
162 .platform_data = NULL,
163 .controller_data = &spi_mmc_chip_info,
170 static struct resource bfin_spi0_resource[] = {
172 .start = SPI0_REGBASE,
173 .end = SPI0_REGBASE + 0xFF,
174 .flags = IORESOURCE_MEM,
179 .flags = IORESOURCE_IRQ,
183 /* SPI controller data */
184 static struct bfin5xx_spi_master bfin_spi0_info = {
186 .enable_dma = 1, /* master has the ability to do dma transfer */
187 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
190 static struct platform_device bfin_spi0_device = {
192 .id = 0, /* Bus number */
193 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
194 .resource = bfin_spi0_resource,
196 .platform_data = &bfin_spi0_info, /* Passed to driver */
199 #endif /* spi master and devices */
202 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
203 static struct platform_device hitachi_fb_device = {
204 .name = "hitachi-tx09",
209 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
211 static struct resource smc91x_resources[] = {
213 .name = "smc91x-regs",
215 .end = 0x28000300 + 16,
216 .flags = IORESOURCE_MEM,
220 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
223 static struct platform_device smc91x_device = {
226 .num_resources = ARRAY_SIZE(smc91x_resources),
227 .resource = smc91x_resources,
231 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
232 static struct resource isp1362_hcd_resources[] = {
236 .flags = IORESOURCE_MEM,
240 .flags = IORESOURCE_MEM,
244 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
248 static struct isp1362_platform_data isp1362_priv = {
253 .int_edge_triggered = 0,
254 .remote_wakeup_connected = 0,
255 .no_power_switching = 1,
256 .power_switching_mode = 0,
259 static struct platform_device isp1362_hcd_device = {
260 .name = "isp1362-hcd",
263 .platform_data = &isp1362_priv,
265 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
266 .resource = isp1362_hcd_resources,
270 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
271 static struct resource bfin_uart_resources[] = {
275 .flags = IORESOURCE_MEM,
279 static struct platform_device bfin_uart_device = {
282 .num_resources = ARRAY_SIZE(bfin_uart_resources),
283 .resource = bfin_uart_resources,
287 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
288 static struct resource bfin_sir_resources[] = {
289 #ifdef CONFIG_BFIN_SIR0
293 .flags = IORESOURCE_MEM,
298 static struct platform_device bfin_sir_device = {
301 .num_resources = ARRAY_SIZE(bfin_sir_resources),
302 .resource = bfin_sir_resources,
306 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
309 static struct pata_platform_info bfin_pata_platform_data = {
311 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
314 static struct resource bfin_pata_resources[] = {
318 .flags = IORESOURCE_MEM,
323 .flags = IORESOURCE_MEM,
328 .flags = IORESOURCE_IRQ,
332 static struct platform_device bfin_pata_device = {
333 .name = "pata_platform",
335 .num_resources = ARRAY_SIZE(bfin_pata_resources),
336 .resource = bfin_pata_resources,
338 .platform_data = &bfin_pata_platform_data,
343 static const unsigned int cclk_vlev_datasheet[] =
345 VRPAIR(VLEV_085, 250000000),
346 VRPAIR(VLEV_090, 300000000),
347 VRPAIR(VLEV_095, 313000000),
348 VRPAIR(VLEV_100, 350000000),
349 VRPAIR(VLEV_105, 400000000),
350 VRPAIR(VLEV_110, 444000000),
351 VRPAIR(VLEV_115, 450000000),
352 VRPAIR(VLEV_120, 475000000),
353 VRPAIR(VLEV_125, 500000000),
354 VRPAIR(VLEV_130, 600000000),
357 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
358 .tuple_tab = cclk_vlev_datasheet,
359 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
360 .vr_settling_time = 25 /* us */,
363 static struct platform_device bfin_dpmc = {
366 .platform_data = &bfin_dmpc_vreg_data,
370 static struct platform_device *cm_bf561_devices[] __initdata = {
374 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
378 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
382 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
386 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
390 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
394 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
398 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
403 static int __init cm_bf561_init(void)
405 printk(KERN_INFO "%s(): registering device resources\n", __func__);
406 platform_add_devices(cm_bf561_devices, ARRAY_SIZE(cm_bf561_devices));
407 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
408 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
411 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
412 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
417 arch_initcall(cm_bf561_init);