2 * File: arch/blackfin/mach-bf533/stamp.c
3 * Based on: arch/blackfin/mach-bf533/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
7 * Description: Board Info File for the BF533-STAMP
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 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
38 #include <linux/usb_isp1362.h>
41 #include <asm/bfin5xx_spi.h>
44 * Name the Board for the /proc/cpuinfo
46 char *bfin_board_name = "ADDS-BF533-STAMP";
48 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
49 static struct platform_device rtc_device = {
56 * Driver needs to know address, irq and flag pin.
58 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
59 static struct resource smc91x_resources[] = {
61 .name = "smc91x-regs",
63 .end = 0x20300300 + 16,
64 .flags = IORESOURCE_MEM,
68 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
72 static struct platform_device smc91x_device = {
75 .num_resources = ARRAY_SIZE(smc91x_resources),
76 .resource = smc91x_resources,
80 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
81 static struct resource net2272_bfin_resources[] = {
84 .end = 0x20300000 + 0x100,
85 .flags = IORESOURCE_MEM,
89 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
93 static struct platform_device net2272_bfin_device = {
96 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
97 .resource = net2272_bfin_resources,
101 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
102 /* all SPI peripherals info goes here */
104 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
105 static struct mtd_partition bfin_spi_flash_partitions[] = {
107 .name = "bootloader",
110 .mask_flags = MTD_CAP_ROM
116 .name = "file system",
118 .offset = 0x00100000,
122 static struct flash_platform_data bfin_spi_flash_data = {
124 .parts = bfin_spi_flash_partitions,
125 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
129 /* SPI flash chip (m25p64) */
130 static struct bfin5xx_spi_chip spi_flash_chip_info = {
131 .enable_dma = 0, /* use dma transfer with this chip*/
136 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
138 static struct bfin5xx_spi_chip spi_adc_chip_info = {
139 .enable_dma = 1, /* use dma transfer with this chip*/
144 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
145 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
151 #if defined(CONFIG_PBX)
152 static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
153 .ctl_reg = 0x4, /* send zero */
156 .cs_change_per_word = 1,
160 #if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
161 static struct bfin5xx_spi_chip ad5304_chip_info = {
167 static struct spi_board_info bfin_spi_board_info[] __initdata = {
168 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
170 /* the modalias must be the same as spi device driver name */
171 .modalias = "m25p80", /* Name of spi_driver for this device */
172 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
173 .bus_num = 1, /* Framework bus number */
174 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
175 .platform_data = &bfin_spi_flash_data,
176 .controller_data = &spi_flash_chip_info,
181 #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
183 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
184 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
185 .bus_num = 1, /* Framework bus number */
186 .chip_select = 1, /* Framework chip select. */
187 .platform_data = NULL, /* No spi_driver specific config */
188 .controller_data = &spi_adc_chip_info,
192 #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
194 .modalias = "ad1836-spi",
195 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
197 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
198 .controller_data = &ad1836_spi_chip_info,
202 #if defined(CONFIG_PBX)
204 .modalias = "fxs-spi",
205 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
208 .controller_data= &spi_si3xxx_chip_info,
212 .modalias = "fxo-spi",
213 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
216 .controller_data= &spi_si3xxx_chip_info,
221 #if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
223 .modalias = "ad5304_spi",
224 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
227 .platform_data = NULL,
228 .controller_data = &ad5304_chip_info,
234 /* SPI controller data */
235 static struct bfin5xx_spi_master spi_bfin_master_info = {
237 .enable_dma = 1, /* master has the ability to do dma transfer */
240 static struct platform_device spi_bfin_master_device = {
241 .name = "bfin-spi-master",
242 .id = 1, /* Bus number */
244 .platform_data = &spi_bfin_master_info, /* Passed to driver */
247 #endif /* spi master and devices */
249 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
250 static struct platform_device bfin_fb_device = {
255 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
256 static struct resource bfin_uart_resources[] = {
260 .flags = IORESOURCE_MEM,
264 static struct platform_device bfin_uart_device = {
267 .num_resources = ARRAY_SIZE(bfin_uart_resources),
268 .resource = bfin_uart_resources,
272 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
273 static struct platform_device bfin_sport0_uart_device = {
274 .name = "bfin-sport-uart",
278 static struct platform_device bfin_sport1_uart_device = {
279 .name = "bfin-sport-uart",
284 static struct platform_device *stamp_devices[] __initdata = {
285 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
289 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
293 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
294 &net2272_bfin_device,
297 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
298 &spi_bfin_master_device,
301 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
305 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
306 &bfin_sport0_uart_device,
307 &bfin_sport1_uart_device,
311 static int __init stamp_init(void)
313 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
314 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
315 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
316 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
321 arch_initcall(stamp_init);