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/mtd/physmap.h>
35 #include <linux/spi/spi.h>
36 #include <linux/spi/flash.h>
37 #include <linux/spi/mmc_spi.h>
38 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
39 #include <linux/usb/isp1362.h>
41 #include <linux/irq.h>
43 #include <asm/bfin5xx_spi.h>
44 #include <asm/portmux.h>
48 * Name the Board for the /proc/cpuinfo
50 const char bfin_board_name[] = "Bluetechnix CM BF533";
52 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
53 /* 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*/
87 #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_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
102 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
108 static struct spi_board_info bfin_spi_board_info[] __initdata = {
109 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
111 /* the modalias must be the same as spi device driver name */
112 .modalias = "m25p80", /* Name of spi_driver for this device */
113 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
114 .bus_num = 0, /* Framework bus number */
115 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
116 .platform_data = &bfin_spi_flash_data,
117 .controller_data = &spi_flash_chip_info,
122 #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
124 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
125 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
126 .bus_num = 0, /* Framework bus number */
127 .chip_select = 2, /* Framework chip select. */
128 .platform_data = NULL, /* No spi_driver specific config */
129 .controller_data = &spi_adc_chip_info,
133 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
135 .modalias = "ad1836",
136 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
138 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
139 .controller_data = &ad1836_spi_chip_info,
143 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
145 .modalias = "mmc_spi",
146 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
149 .controller_data = &mmc_spi_chip_info,
156 static struct resource bfin_spi0_resource[] = {
158 .start = SPI0_REGBASE,
159 .end = SPI0_REGBASE + 0xFF,
160 .flags = IORESOURCE_MEM,
165 .flags = IORESOURCE_DMA,
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 */
178 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
181 static struct platform_device bfin_spi0_device = {
183 .id = 0, /* Bus number */
184 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
185 .resource = bfin_spi0_resource,
187 .platform_data = &bfin_spi0_info, /* Passed to driver */
190 #endif /* spi master and devices */
192 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
193 static struct platform_device rtc_device = {
199 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
200 #include <linux/smc91x.h>
202 static struct smc91x_platdata smc91x_info = {
203 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
204 .leda = RPC_LED_100_10,
205 .ledb = RPC_LED_TX_RX,
208 static struct resource smc91x_resources[] = {
211 .end = 0x20200300 + 16,
212 .flags = IORESOURCE_MEM,
216 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
219 static struct platform_device smc91x_device = {
222 .num_resources = ARRAY_SIZE(smc91x_resources),
223 .resource = smc91x_resources,
225 .platform_data = &smc91x_info,
230 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
231 #include <linux/smsc911x.h>
233 static struct resource smsc911x_resources[] = {
235 .name = "smsc911x-memory",
237 .end = 0x20308000 + 0xFF,
238 .flags = IORESOURCE_MEM,
242 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
246 static struct smsc911x_platform_config smsc911x_config = {
247 .flags = SMSC911X_USE_16BIT,
248 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
249 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
250 .phy_interface = PHY_INTERFACE_MODE_MII,
253 static struct platform_device smsc911x_device = {
256 .num_resources = ARRAY_SIZE(smsc911x_resources),
257 .resource = smsc911x_resources,
259 .platform_data = &smsc911x_config,
264 static struct resource bfin_gpios_resources = {
266 .end = MAX_BLACKFIN_GPIOS - 1,
267 .flags = IORESOURCE_IRQ,
270 static struct platform_device bfin_gpios_device = {
271 .name = "simple-gpio",
274 .resource = &bfin_gpios_resources,
277 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
278 static struct resource bfin_uart_resources[] = {
282 .flags = IORESOURCE_MEM,
286 static struct platform_device bfin_uart_device = {
289 .num_resources = ARRAY_SIZE(bfin_uart_resources),
290 .resource = bfin_uart_resources,
294 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
295 #ifdef CONFIG_BFIN_SIR0
296 static struct resource bfin_sir0_resources[] = {
300 .flags = IORESOURCE_MEM,
303 .start = IRQ_UART0_RX,
304 .end = IRQ_UART0_RX+1,
305 .flags = IORESOURCE_IRQ,
308 .start = CH_UART0_RX,
309 .end = CH_UART0_RX+1,
310 .flags = IORESOURCE_DMA,
314 static struct platform_device bfin_sir0_device = {
317 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
318 .resource = bfin_sir0_resources,
323 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
324 static struct platform_device bfin_sport0_uart_device = {
325 .name = "bfin-sport-uart",
329 static struct platform_device bfin_sport1_uart_device = {
330 .name = "bfin-sport-uart",
335 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
336 static struct resource isp1362_hcd_resources[] = {
340 .flags = IORESOURCE_MEM,
344 .flags = IORESOURCE_MEM,
348 .flags = IORESOURCE_IRQ,
352 static struct isp1362_platform_data isp1362_priv = {
357 .int_edge_triggered = 0,
358 .remote_wakeup_connected = 0,
359 .no_power_switching = 1,
360 .power_switching_mode = 0,
363 static struct platform_device isp1362_hcd_device = {
364 .name = "isp1362-hcd",
367 .platform_data = &isp1362_priv,
369 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
370 .resource = isp1362_hcd_resources,
375 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
376 static struct resource net2272_bfin_resources[] = {
379 .end = 0x20300000 + 0x100,
380 .flags = IORESOURCE_MEM,
384 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
388 static struct platform_device net2272_bfin_device = {
391 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
392 .resource = net2272_bfin_resources,
398 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
399 static struct mtd_partition para_partitions[] = {
401 .name = "bootloader(nor)",
405 .name = "linux+rootfs(nor)",
406 .size = MTDPART_SIZ_FULL,
407 .offset = MTDPART_OFS_APPEND,
411 static struct physmap_flash_data para_flash_data = {
413 .parts = para_partitions,
414 .nr_parts = ARRAY_SIZE(para_partitions),
417 static struct resource para_flash_resource = {
420 .flags = IORESOURCE_MEM,
423 static struct platform_device para_flash_device = {
424 .name = "physmap-flash",
427 .platform_data = ¶_flash_data,
430 .resource = ¶_flash_resource,
436 static const unsigned int cclk_vlev_datasheet[] =
438 VRPAIR(VLEV_085, 250000000),
439 VRPAIR(VLEV_090, 376000000),
440 VRPAIR(VLEV_095, 426000000),
441 VRPAIR(VLEV_100, 426000000),
442 VRPAIR(VLEV_105, 476000000),
443 VRPAIR(VLEV_110, 476000000),
444 VRPAIR(VLEV_115, 476000000),
445 VRPAIR(VLEV_120, 600000000),
446 VRPAIR(VLEV_125, 600000000),
447 VRPAIR(VLEV_130, 600000000),
450 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
451 .tuple_tab = cclk_vlev_datasheet,
452 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
453 .vr_settling_time = 25 /* us */,
456 static struct platform_device bfin_dpmc = {
459 .platform_data = &bfin_dmpc_vreg_data,
463 static struct platform_device *cm_bf533_devices[] __initdata = {
467 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
471 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
472 #ifdef CONFIG_BFIN_SIR0
477 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
478 &bfin_sport0_uart_device,
479 &bfin_sport1_uart_device,
482 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
486 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
490 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
494 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
498 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
499 &net2272_bfin_device,
502 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
506 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
513 static int __init cm_bf533_init(void)
515 printk(KERN_INFO "%s(): registering device resources\n", __func__);
516 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices));
517 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
518 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
523 arch_initcall(cm_bf533_init);