aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf533/boards
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
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')
-rw-r--r--arch/blackfin/mach-bf533/boards/Makefile8
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c267
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c224
-rw-r--r--arch/blackfin/mach-bf533/boards/generic_board.c95
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c321
5 files changed, 915 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf533/boards/Makefile b/arch/blackfin/mach-bf533/boards/Makefile
new file mode 100644
index 000000000000..12a631ab389d
--- /dev/null
+++ b/arch/blackfin/mach-bf533/boards/Makefile
@@ -0,0 +1,8 @@
1#
2# arch/blackfin/mach-bf533/boards/Makefile
3#
4
5obj-$(CONFIG_GENERIC_BOARD) += generic_board.o
6obj-$(CONFIG_BFIN533_STAMP) += stamp.o
7obj-$(CONFIG_BFIN533_EZKIT) += ezkit.o
8obj-$(CONFIG_BFIN533_BLUETECHNIX_CM) += cm_bf533.o
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
new file mode 100644
index 000000000000..23a7f607df3f
--- /dev/null
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -0,0 +1,267 @@
1/*
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> Copright 2005
5 *
6 * Created: 2005
7 * Description: Board description file
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
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.
18 *
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.
23 *
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
28 */
29
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 <asm/irq.h>
38#include <asm/bfin5xx_spi.h>
39
40/*
41 * Name the Board for the /proc/cpuinfo
42 */
43char *bfin_board_name = "Bluetechnix CM BF533";
44
45#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
46/* all SPI peripherals info goes here */
47
48static struct mtd_partition bfin_spi_flash_partitions[] = {
49 {
50 .name = "bootloader",
51 .size = 0x00020000,
52 .offset = 0,
53 .mask_flags = MTD_CAP_ROM
54 },{
55 .name = "kernel",
56 .size = 0xe0000,
57 .offset = 0x20000
58 },{
59 .name = "file system",
60 .size = 0x700000,
61 .offset = 0x00100000,
62 }
63};
64
65static struct flash_platform_data bfin_spi_flash_data = {
66 .name = "m25p80",
67 .parts = bfin_spi_flash_partitions,
68 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
69 .type = "m25p64",
70};
71
72/* SPI flash chip (m25p64) */
73static struct bfin5xx_spi_chip spi_flash_chip_info = {
74 .enable_dma = 0, /* use dma transfer with this chip*/
75 .bits_per_word = 8,
76};
77
78/* SPI ADC chip */
79static struct bfin5xx_spi_chip spi_adc_chip_info = {
80 .enable_dma = 1, /* use dma transfer with this chip*/
81 .bits_per_word = 16,
82};
83
84#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
85static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
86 .enable_dma = 0,
87 .bits_per_word = 16,
88};
89#endif
90
91static struct spi_board_info bfin_spi_board_info[] __initdata = {
92 {
93 /* the modalias must be the same as spi device driver name */
94 .modalias = "m25p80", /* Name of spi_driver for this device */
95 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
96 .bus_num = 1, /* Framework bus number */
97 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
98 .platform_data = &bfin_spi_flash_data,
99 .controller_data = &spi_flash_chip_info,
100 .mode = SPI_MODE_3,
101 },{
102 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
103 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
104 .bus_num = 1, /* Framework bus number */
105 .chip_select = 2, /* Framework chip select. */
106 .platform_data = NULL, /* No spi_driver specific config */
107 .controller_data = &spi_adc_chip_info,
108 },
109#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
110 {
111 .modalias = "ad1836-spi",
112 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
113 .bus_num = 1,
114 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
115 .controller_data = &ad1836_spi_chip_info,
116 },
117#endif
118};
119
120/* SPI controller data */
121static struct bfin5xx_spi_master spi_bfin_master_info = {
122 .num_chipselect = 8,
123 .enable_dma = 1, /* master has the ability to do dma transfer */
124};
125
126static struct platform_device spi_bfin_master_device = {
127 .name = "bfin-spi-master",
128 .id = 1, /* Bus number */
129 .dev = {
130 .platform_data = &spi_bfin_master_info, /* Passed to driver */
131 },
132};
133#endif /* spi master and devices */
134
135#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
136static struct platform_device rtc_device = {
137 .name = "rtc-bfin",
138 .id = -1,
139};
140#endif
141
142#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
143static struct resource smc91x_resources[] = {
144 {
145 .start = 0x20200300,
146 .end = 0x20200300 + 16,
147 .flags = IORESOURCE_MEM,
148 },{
149 .start = IRQ_PF0,
150 .end = IRQ_PF0,
151 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
152 },
153};
154static struct platform_device smc91x_device = {
155 .name = "smc91x",
156 .id = 0,
157 .num_resources = ARRAY_SIZE(smc91x_resources),
158 .resource = smc91x_resources,
159};
160#endif
161
162#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
163static struct resource bfin_uart_resources[] = {
164 {
165 .start = 0xFFC00400,
166 .end = 0xFFC004FF,
167 .flags = IORESOURCE_MEM,
168 },
169};
170
171static struct platform_device bfin_uart_device = {
172 .name = "bfin-uart",
173 .id = 1,
174 .num_resources = ARRAY_SIZE(bfin_uart_resources),
175 .resource = bfin_uart_resources,
176};
177#endif
178
179#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
180static struct platform_device bfin_sport0_uart_device = {
181 .name = "bfin-sport-uart",
182 .id = 0,
183};
184
185static struct platform_device bfin_sport1_uart_device = {
186 .name = "bfin-sport-uart",
187 .id = 1,
188};
189#endif
190
191#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
192static struct resource isp1362_hcd_resources[] = {
193 {
194 .start = 0x20308000,
195 .end = 0x20308000,
196 .flags = IORESOURCE_MEM,
197 },{
198 .start = 0x20308004,
199 .end = 0x20308004,
200 .flags = IORESOURCE_MEM,
201 },{
202 .start = IRQ_PF4,
203 .end = IRQ_PF4,
204 .flags = IORESOURCE_IRQ,
205 },
206};
207
208static struct isp1362_platform_data isp1362_priv = {
209 .sel15Kres = 1,
210 .clknotstop = 0,
211 .oc_enable = 0,
212 .int_act_high = 0,
213 .int_edge_triggered = 0,
214 .remote_wakeup_connected = 0,
215 .no_power_switching = 1,
216 .power_switching_mode = 0,
217};
218
219static struct platform_device isp1362_hcd_device = {
220 .name = "isp1362-hcd",
221 .id = 0,
222 .dev = {
223 .platform_data = &isp1362_priv,
224 },
225 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
226 .resource = isp1362_hcd_resources,
227};
228#endif
229
230static struct platform_device *cm_bf533_devices[] __initdata = {
231#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
232 &bfin_uart_device,
233#endif
234
235#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
236 &bfin_sport0_uart_device,
237 &bfin_sport1_uart_device,
238#endif
239
240#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
241 &rtc_device,
242#endif
243
244#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
245 &isp1362_hcd_device,
246#endif
247
248#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
249 &smc91x_device,
250#endif
251
252#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
253 &spi_bfin_master_device,
254#endif
255};
256
257static int __init cm_bf533_init(void)
258{
259 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
260 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices));
261#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
262 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
263#endif
264 return 0;
265}
266
267arch_initcall(cm_bf533_init);
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);
diff --git a/arch/blackfin/mach-bf533/boards/generic_board.c b/arch/blackfin/mach-bf533/boards/generic_board.c
new file mode 100644
index 000000000000..c0f43ccfbfb5
--- /dev/null
+++ b/arch/blackfin/mach-bf533/boards/generic_board.c
@@ -0,0 +1,95 @@
1/*
2 * File: arch/blackfin/mach-bf533/generic_board.c
3 * Based on: arch/blackfin/mach-bf533/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created: 2005
7 * Description:
8 *
9 * Modified:
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 <asm/irq.h>
34
35/*
36 * Name the Board for the /proc/cpuinfo
37 */
38char *bfin_board_name = "UNKNOWN BOARD";
39
40#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
41static struct platform_device rtc_device = {
42 .name = "rtc-bfin",
43 .id = -1,
44};
45#endif
46
47/*
48 * Driver needs to know address, irq and flag pin.
49 */
50#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
51static struct resource smc91x_resources[] = {
52 {
53 .start = 0x20300300,
54 .end = 0x20300300 + 16,
55 .flags = IORESOURCE_MEM,
56 },{
57 .start = IRQ_PROG_INTB,
58 .end = IRQ_PROG_INTB,
59 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
60 },{
61 /*
62 * denotes the flag pin and is used directly if
63 * CONFIG_IRQCHIP_DEMUX_GPIO is defined.
64 */
65 .start = IRQ_PF7,
66 .end = IRQ_PF7,
67 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
68 },
69};
70
71static struct platform_device smc91x_device = {
72 .name = "smc91x",
73 .id = 0,
74 .num_resources = ARRAY_SIZE(smc91x_resources),
75 .resource = smc91x_resources,
76};
77#endif
78
79static struct platform_device *generic_board_devices[] __initdata = {
80#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
81 &rtc_device,
82#endif
83
84#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
85 &smc91x_device,
86#endif
87};
88
89static int __init generic_board_init(void)
90{
91 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
92 return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices));
93}
94
95arch_initcall(generic_board_init);
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
new file mode 100644
index 000000000000..d7b3a5d74e8c
--- /dev/null
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -0,0 +1,321 @@
1/*
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>
5 *
6 * Created: 2005
7 * Description: Board Info File for the BF533-STAMP
8 *
9 * Modified:
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#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
38#include <linux/usb_isp1362.h>
39#endif
40#include <asm/irq.h>
41#include <asm/bfin5xx_spi.h>
42
43/*
44 * Name the Board for the /proc/cpuinfo
45 */
46char *bfin_board_name = "ADDS-BF533-STAMP";
47
48#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
49static struct platform_device rtc_device = {
50 .name = "rtc-bfin",
51 .id = -1,
52};
53#endif
54
55/*
56 * Driver needs to know address, irq and flag pin.
57 */
58#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
59static struct resource smc91x_resources[] = {
60 {
61 .name = "smc91x-regs",
62 .start = 0x20300300,
63 .end = 0x20300300 + 16,
64 .flags = IORESOURCE_MEM,
65 },{
66 .start = IRQ_PF7,
67 .end = IRQ_PF7,
68 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
69 },
70};
71
72static struct platform_device smc91x_device = {
73 .name = "smc91x",
74 .id = 0,
75 .num_resources = ARRAY_SIZE(smc91x_resources),
76 .resource = smc91x_resources,
77};
78#endif
79
80#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
81static struct resource net2272_bfin_resources[] = {
82 {
83 .start = 0x20300000,
84 .end = 0x20300000 + 0x100,
85 .flags = IORESOURCE_MEM,
86 },{
87 .start = IRQ_PF10,
88 .end = IRQ_PF10,
89 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
90 },
91};
92
93static struct platform_device net2272_bfin_device = {
94 .name = "net2272",
95 .id = -1,
96 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
97 .resource = net2272_bfin_resources,
98};
99#endif
100
101#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
102/* all SPI peripherals info goes here */
103
104#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
105static struct mtd_partition bfin_spi_flash_partitions[] = {
106 {
107 .name = "bootloader",
108 .size = 0x00020000,
109 .offset = 0,
110 .mask_flags = MTD_CAP_ROM
111 },{
112 .name = "kernel",
113 .size = 0xe0000,
114 .offset = 0x20000
115 },{
116 .name = "file system",
117 .size = 0x700000,
118 .offset = 0x00100000,
119 }
120};
121
122static struct flash_platform_data bfin_spi_flash_data = {
123 .name = "m25p80",
124 .parts = bfin_spi_flash_partitions,
125 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
126 .type = "m25p64",
127};
128
129/* SPI flash chip (m25p64) */
130static struct bfin5xx_spi_chip spi_flash_chip_info = {
131 .enable_dma = 0, /* use dma transfer with this chip*/
132 .bits_per_word = 8,
133};
134#endif
135
136#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
137/* SPI ADC chip */
138static struct bfin5xx_spi_chip spi_adc_chip_info = {
139 .enable_dma = 1, /* use dma transfer with this chip*/
140 .bits_per_word = 16,
141};
142#endif
143
144#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
145static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
146 .enable_dma = 0,
147 .bits_per_word = 16,
148};
149#endif
150
151#if defined(CONFIG_PBX)
152static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
153 .ctl_reg = 0x4, /* send zero */
154 .enable_dma = 0,
155 .bits_per_word = 8,
156 .cs_change_per_word = 1,
157};
158#endif
159
160#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
161static struct bfin5xx_spi_chip ad5304_chip_info = {
162 .enable_dma = 0,
163 .bits_per_word = 16,
164};
165#endif
166
167static struct spi_board_info bfin_spi_board_info[] __initdata = {
168#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
169 {
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,
177 .mode = SPI_MODE_3,
178 },
179#endif
180
181#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
182 {
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,
189 },
190#endif
191
192#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
193 {
194 .modalias = "ad1836-spi",
195 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
196 .bus_num = 1,
197 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
198 .controller_data = &ad1836_spi_chip_info,
199 },
200#endif
201
202#if defined(CONFIG_PBX)
203 {
204 .modalias = "fxs-spi",
205 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
206 .bus_num = 1,
207 .chip_select = 3,
208 .controller_data= &spi_si3xxx_chip_info,
209 .mode = SPI_MODE_3,
210 },
211 {
212 .modalias = "fxo-spi",
213 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
214 .bus_num = 1,
215 .chip_select = 2,
216 .controller_data= &spi_si3xxx_chip_info,
217 .mode = SPI_MODE_3,
218 },
219#endif
220
221#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
222 {
223 .modalias = "ad5304_spi",
224 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
225 .bus_num = 1,
226 .chip_select = 2,
227 .platform_data = NULL,
228 .controller_data = &ad5304_chip_info,
229 .mode = SPI_MODE_2,
230 },
231#endif
232};
233
234/* SPI controller data */
235static struct bfin5xx_spi_master spi_bfin_master_info = {
236 .num_chipselect = 8,
237 .enable_dma = 1, /* master has the ability to do dma transfer */
238};
239
240static struct platform_device spi_bfin_master_device = {
241 .name = "bfin-spi-master",
242 .id = 1, /* Bus number */
243 .dev = {
244 .platform_data = &spi_bfin_master_info, /* Passed to driver */
245 },
246};
247#endif /* spi master and devices */
248
249#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
250static struct platform_device bfin_fb_device = {
251 .name = "bf537-fb",
252};
253#endif
254
255#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
256static struct resource bfin_uart_resources[] = {
257 {
258 .start = 0xFFC00400,
259 .end = 0xFFC004FF,
260 .flags = IORESOURCE_MEM,
261 },
262};
263
264static struct platform_device bfin_uart_device = {
265 .name = "bfin-uart",
266 .id = 1,
267 .num_resources = ARRAY_SIZE(bfin_uart_resources),
268 .resource = bfin_uart_resources,
269};
270#endif
271
272#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
273static struct platform_device bfin_sport0_uart_device = {
274 .name = "bfin-sport-uart",
275 .id = 0,
276};
277
278static struct platform_device bfin_sport1_uart_device = {
279 .name = "bfin-sport-uart",
280 .id = 1,
281};
282#endif
283
284static struct platform_device *stamp_devices[] __initdata = {
285#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
286 &rtc_device,
287#endif
288
289#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
290 &smc91x_device,
291#endif
292
293#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
294 &net2272_bfin_device,
295#endif
296
297#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
298 &spi_bfin_master_device,
299#endif
300
301#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
302 &bfin_uart_device,
303#endif
304
305#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
306 &bfin_sport0_uart_device,
307 &bfin_sport1_uart_device,
308#endif
309};
310
311static int __init stamp_init(void)
312{
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));
317#endif
318 return 0;
319}
320
321arch_initcall(stamp_init);