2 * File: arch/blackfin/mach-bf537/boards/cm_bf537.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
7 * Description: Board description file
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc.
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <linux/device.h>
32 #include <linux/platform_device.h>
33 #include <linux/mtd/mtd.h>
34 #include <linux/mtd/partitions.h>
35 #include <linux/spi/spi.h>
36 #include <linux/spi/flash.h>
37 #include <linux/usb/isp1362.h>
38 #include <linux/pata_platform.h>
39 #include <linux/irq.h>
41 #include <asm/bfin5xx_spi.h>
42 #include <asm/portmux.h>
45 * Name the Board for the /proc/cpuinfo
47 const char bfin_board_name[] = "Bluetechnix CM BF537";
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,
148 #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
150 .modalias = "ad9960-spi",
151 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
154 .controller_data = &ad9960_spi_chip_info,
158 #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
160 .modalias = "spi_mmc_dummy",
161 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
164 .platform_data = NULL,
165 .controller_data = &spi_mmc_chip_info,
169 .modalias = "spi_mmc",
170 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
172 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
173 .platform_data = NULL,
174 .controller_data = &spi_mmc_chip_info,
181 static struct resource bfin_spi0_resource[] = {
183 .start = SPI0_REGBASE,
184 .end = SPI0_REGBASE + 0xFF,
185 .flags = IORESOURCE_MEM,
190 .flags = IORESOURCE_IRQ,
194 /* SPI controller data */
195 static struct bfin5xx_spi_master bfin_spi0_info = {
197 .enable_dma = 1, /* master has the ability to do dma transfer */
198 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
201 static struct platform_device bfin_spi0_device = {
203 .id = 0, /* Bus number */
204 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
205 .resource = bfin_spi0_resource,
207 .platform_data = &bfin_spi0_info, /* Passed to driver */
210 #endif /* spi master and devices */
212 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
213 static struct platform_device rtc_device = {
219 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
220 static struct platform_device hitachi_fb_device = {
221 .name = "hitachi-tx09",
225 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
226 static struct resource smc91x_resources[] = {
229 .end = 0x20200300 + 16,
230 .flags = IORESOURCE_MEM,
234 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
238 static struct platform_device smc91x_device = {
241 .num_resources = ARRAY_SIZE(smc91x_resources),
242 .resource = smc91x_resources,
246 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
247 static struct resource isp1362_hcd_resources[] = {
251 .flags = IORESOURCE_MEM,
255 .flags = IORESOURCE_MEM,
259 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
263 static struct isp1362_platform_data isp1362_priv = {
268 .int_edge_triggered = 0,
269 .remote_wakeup_connected = 0,
270 .no_power_switching = 1,
271 .power_switching_mode = 0,
274 static struct platform_device isp1362_hcd_device = {
275 .name = "isp1362-hcd",
278 .platform_data = &isp1362_priv,
280 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
281 .resource = isp1362_hcd_resources,
285 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
286 static struct resource net2272_bfin_resources[] = {
289 .end = 0x20200000 + 0x100,
290 .flags = IORESOURCE_MEM,
294 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
298 static struct platform_device net2272_bfin_device = {
301 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
302 .resource = net2272_bfin_resources,
306 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
307 static struct resource bfin_uart_resources[] = {
311 .flags = IORESOURCE_MEM,
315 .flags = IORESOURCE_MEM,
319 static struct platform_device bfin_uart_device = {
322 .num_resources = ARRAY_SIZE(bfin_uart_resources),
323 .resource = bfin_uart_resources,
327 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
328 static struct platform_device bfin_sport0_uart_device = {
329 .name = "bfin-sport-uart",
333 static struct platform_device bfin_sport1_uart_device = {
334 .name = "bfin-sport-uart",
339 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
340 static struct platform_device bfin_mac_device = {
345 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
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 struct platform_device *cm_bf537_devices[] __initdata = {
383 #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
387 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
391 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
395 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
396 &bfin_sport0_uart_device,
397 &bfin_sport1_uart_device,
400 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
404 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
408 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
412 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
413 &net2272_bfin_device,
416 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
420 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
425 static int __init cm_bf537_init(void)
427 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
428 platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
429 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
430 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
433 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
434 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
439 arch_initcall(cm_bf537_init);
441 void bfin_get_ether_addr(char *addr)
443 random_ether_addr(addr);
444 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
446 EXPORT_SYMBOL(bfin_get_ether_addr);