aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf533/boards/ezkit.c
diff options
context:
space:
mode:
authorBryan Wu <bryan.wu@analog.com>2007-05-06 17:50:22 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:58 -0400
commit1394f03221790a988afc3e4b3cb79f2e477246a9 (patch)
tree2c1963c9a4f2d84a5e021307fde240c5d567cf70 /arch/blackfin/mach-bf533/boards/ezkit.c
parent73243284463a761e04d69d22c7516b2be7de096c (diff)
blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561 (Dual Core) devices, with a variety of development platforms including those avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP, BF561-EZKIT), and Bluetechnix! Tinyboards. The Blackfin architecture was jointly developed by Intel and Analog Devices Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in December of 2000. Since then ADI has put this core into its Blackfin processor family of devices. The Blackfin core has the advantages of a clean, orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC (Multiply/Accumulate), state-of-the-art signal processing engine and single-instruction, multiple-data (SIMD) multimedia capabilities into a single instruction-set architecture. The Blackfin architecture, including the instruction set, is described by the ADSP-BF53x/BF56x Blackfin Processor Programming Reference http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf The Blackfin processor is already supported by major releases of gcc, and there are binary and source rpms/tarballs for many architectures at: http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete documentation, including "getting started" guides available at: http://docs.blackfin.uclinux.org/ which provides links to the sources and patches you will need in order to set up a cross-compiling environment for bfin-linux-uclibc This patch, as well as the other patches (toolchain, distribution, uClibc) are actively supported by Analog Devices Inc, at: http://blackfin.uclinux.org/ We have tested this on LTP, and our test plan (including pass/fails) can be found at: http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel [m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files] Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Aubrey Li <aubrey.li@analog.com> Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/ezkit.c')
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c224
1 files changed, 224 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
new file mode 100644
index 000000000000..747298ea907b
--- /dev/null
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -0,0 +1,224 @@
1/*
2 * File: arch/blackfin/mach-bf533/ezkit.c
3 * Based on: Orginal Work
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created: 2005
7 * Description:
8 *
9 * Modified: Robin Getz <rgetz@blackfin.uclinux.org> - Named the boards
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
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.
19 *
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.
24 *
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
29 */
30
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 <asm/irq.h>
39#include <asm/bfin5xx_spi.h>
40
41/*
42 * Name the Board for the /proc/cpuinfo
43 */
44char *bfin_board_name = "ADDS-BF533-EZKIT";
45
46#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
47static struct platform_device rtc_device = {
48 .name = "rtc-bfin",
49 .id = -1,
50};
51#endif
52
53/*
54 * USB-LAN EzExtender board
55 * Driver needs to know address, irq and flag pin.
56 */
57#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
58static struct resource smc91x_resources[] = {
59 {
60 .name = "smc91x-regs",
61 .start = 0x20310300,
62 .end = 0x20310300 + 16,
63 .flags = IORESOURCE_MEM,
64 },{
65 .start = IRQ_PF9,
66 .end = IRQ_PF9,
67 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
68 },
69};
70static struct platform_device smc91x_device = {
71 .name = "smc91x",
72 .id = 0,
73 .num_resources = ARRAY_SIZE(smc91x_resources),
74 .resource = smc91x_resources,
75};
76#endif
77
78#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
79/* all SPI peripherals info goes here */
80
81#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
82static struct mtd_partition bfin_spi_flash_partitions[] = {
83 {
84 .name = "bootloader",
85 .size = 0x00020000,
86 .offset = 0,
87 .mask_flags = MTD_CAP_ROM
88 },{
89 .name = "kernel",
90 .size = 0xe0000,
91 .offset = 0x20000
92 },{
93 .name = "file system",
94 .size = 0x700000,
95 .offset = 0x00100000,
96 }
97};
98
99static struct flash_platform_data bfin_spi_flash_data = {
100 .name = "m25p80",
101 .parts = bfin_spi_flash_partitions,
102 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
103 .type = "m25p64",
104};
105
106/* SPI flash chip (m25p64) */
107static struct bfin5xx_spi_chip spi_flash_chip_info = {
108 .enable_dma = 0, /* use dma transfer with this chip*/
109 .bits_per_word = 8,
110};
111#endif
112
113#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
114/* SPI ADC chip */
115static struct bfin5xx_spi_chip spi_adc_chip_info = {
116 .enable_dma = 1, /* use dma transfer with this chip*/
117 .bits_per_word = 16,
118};
119#endif
120
121#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
122static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
123 .enable_dma = 0,
124 .bits_per_word = 16,
125};
126#endif
127
128static struct spi_board_info bfin_spi_board_info[] __initdata = {
129#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
130 {
131 /* the modalias must be the same as spi device driver name */
132 .modalias = "m25p80", /* Name of spi_driver for this device */
133 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
134 .bus_num = 1, /* Framework bus number */
135 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
136 .platform_data = &bfin_spi_flash_data,
137 .controller_data = &spi_flash_chip_info,
138 .mode = SPI_MODE_3,
139 },
140#endif
141
142#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
143 {
144 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
145 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
146 .bus_num = 1, /* Framework bus number */
147 .chip_select = 1, /* Framework chip select. */
148 .platform_data = NULL, /* No spi_driver specific config */
149 .controller_data = &spi_adc_chip_info,
150 },
151#endif
152
153#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
154 {
155 .modalias = "ad1836-spi",
156 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
157 .bus_num = 1,
158 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
159 .controller_data = &ad1836_spi_chip_info,
160 },
161#endif
162};
163
164/* SPI controller data */
165static struct bfin5xx_spi_master spi_bfin_master_info = {
166 .num_chipselect = 8,
167 .enable_dma = 1, /* master has the ability to do dma transfer */
168};
169
170static struct platform_device spi_bfin_master_device = {
171 .name = "bfin-spi-master",
172 .id = 1, /* Bus number */
173 .dev = {
174 .platform_data = &spi_bfin_master_info, /* Passed to driver */
175 },
176};
177#endif /* spi master and devices */
178
179#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
180static struct resource bfin_uart_resources[] = {
181 {
182 .start = 0xFFC00400,
183 .end = 0xFFC004FF,
184 .flags = IORESOURCE_MEM,
185 },
186};
187
188static struct platform_device bfin_uart_device = {
189 .name = "bfin-uart",
190 .id = 1,
191 .num_resources = ARRAY_SIZE(bfin_uart_resources),
192 .resource = bfin_uart_resources,
193};
194#endif
195
196static struct platform_device *ezkit_devices[] __initdata = {
197#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
198 &smc91x_device,
199#endif
200
201#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
202 &spi_bfin_master_device,
203#endif
204
205#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
206 &rtc_device,
207#endif
208
209#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
210 &bfin_uart_device,
211#endif
212};
213
214static int __init ezkit_init(void)
215{
216 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
217 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
218#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
219 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
220#endif
221 return 0;
222}
223
224arch_initcall(ezkit_init);