aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf533
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 12:33:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 12:33:34 -0400
commit346ad4b7fe392571f19314f153db9151dbc1d82b (patch)
tree2d4085338c9044bca2f6472893da60387db3c96f /arch/blackfin/mach-bf533
parent845199f194306dbd69ca42d3b40a5125cdb50b89 (diff)
parent2dc63a84b2db23b9680646aff93917211613bf1a (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (85 commits) Blackfin char driver for Blackfin on-chip OTP memory (v3) Blackfin Serial Driver: fix bug - use mod_timer to replace only add_timer. Blackfin Serial Driver: the uart break anomaly has been given its own number, so switch to it Blackfin Serial Driver: use BFIN_UART_NR_PORTS to help SIR driver in uart port. Blackfin Serial Driver: Fix bug - kernel hangs when accessing uart 0 on bf537 when booting u-boot and linux on uart 1 Blackfin Serial Driver: punt unused lsr variable Blackfin Serial Driver: Enable IR function when user application (irattach /dev/ttyBFx -s) call TIOCSETD ioctl with line discipline N_IRDA [Blackfin] arch: add include/boot .gitignore files [Blackfin] arch: Functional power management support: Add support for cpu frequency scaling [Blackfin] arch: Functional power management support: Remove broken cpu frequency scaling drivers [Blackfin] arch: Equalize include files: Add PLL_DIV Masks [Blackfin] arch: Add a warning about the value of CLKIN. [Blackfin] arch: take DDR DEVWD into consideration as well for BF548 [Blackfin] arch: Remove the circular buffering mechanism for exceptions [Blackfin] arch: lose unnecessary dependency on CONFIG_BFIN_ICACHE for MPU [Blackfin] arch: fix bug - before assign new channel to the map register, need clear the bits first. [Blackfin] arch: add Blackfin on-chip SIR IrDA driver support [Blackfin] arch: BF54x memsizes are in mbits, not mbytes [Blackfin] arch: try to remove condition that causes double fault, by checking current before it gets dereferenced [Blackfin] arch: Update anomaly list. ...
Diffstat (limited to 'arch/blackfin/mach-bf533')
-rw-r--r--arch/blackfin/mach-bf533/Makefile2
-rw-r--r--arch/blackfin/mach-bf533/boards/H8606.c25
-rw-r--r--arch/blackfin/mach-bf533/boards/Kconfig6
-rw-r--r--arch/blackfin/mach-bf533/boards/Makefile1
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c25
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c25
-rw-r--r--arch/blackfin/mach-bf533/boards/generic_board.c2
-rw-r--r--arch/blackfin/mach-bf533/boards/ip0x.c303
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c62
-rw-r--r--arch/blackfin/mach-bf533/cpu.c158
-rw-r--r--arch/blackfin/mach-bf533/dma.c5
-rw-r--r--arch/blackfin/mach-bf533/head.S34
12 files changed, 456 insertions, 192 deletions
diff --git a/arch/blackfin/mach-bf533/Makefile b/arch/blackfin/mach-bf533/Makefile
index 8cce1736360d..aa9f2647ee0c 100644
--- a/arch/blackfin/mach-bf533/Makefile
+++ b/arch/blackfin/mach-bf533/Makefile
@@ -5,5 +5,3 @@
5extra-y := head.o 5extra-y := head.o
6 6
7obj-y := ints-priority.o dma.o 7obj-y := ints-priority.o dma.o
8
9obj-$(CONFIG_CPU_FREQ) += cpu.o
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
index 97378b0a9753..7cc4864f6aaf 100644
--- a/arch/blackfin/mach-bf533/boards/H8606.c
+++ b/arch/blackfin/mach-bf533/boards/H8606.c
@@ -304,6 +304,25 @@ static struct platform_device bfin_uart_device = {
304}; 304};
305#endif 305#endif
306 306
307#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
308static struct resource bfin_sir_resources[] = {
309#ifdef CONFIG_BFIN_SIR0
310 {
311 .start = 0xFFC00400,
312 .end = 0xFFC004FF,
313 .flags = IORESOURCE_MEM,
314 },
315#endif
316};
317
318static struct platform_device bfin_sir_device = {
319 .name = "bfin_sir",
320 .id = 0,
321 .num_resources = ARRAY_SIZE(bfin_sir_resources),
322 .resource = bfin_sir_resources,
323};
324#endif
325
307#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 326#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
308 327
309#include <linux/serial_8250.h> 328#include <linux/serial_8250.h>
@@ -403,6 +422,10 @@ static struct platform_device *h8606_devices[] __initdata = {
403 &serial8250_device, 422 &serial8250_device,
404#endif 423#endif
405 424
425#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
426 &bfin_sir_device,
427#endif
428
406#if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE) 429#if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
407 &opencores_kbd_device, 430 &opencores_kbd_device,
408#endif 431#endif
@@ -411,7 +434,7 @@ static struct platform_device *h8606_devices[] __initdata = {
411static int __init H8606_init(void) 434static int __init H8606_init(void)
412{ 435{
413 printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n"); 436 printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n");
414 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 437 printk(KERN_INFO "%s(): registering device resources\n", __func__);
415 platform_add_devices(h8606_devices, ARRAY_SIZE(h8606_devices)); 438 platform_add_devices(h8606_devices, ARRAY_SIZE(h8606_devices));
416#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 439#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
417 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 440 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
diff --git a/arch/blackfin/mach-bf533/boards/Kconfig b/arch/blackfin/mach-bf533/boards/Kconfig
index 751de5110afc..840059241fbe 100644
--- a/arch/blackfin/mach-bf533/boards/Kconfig
+++ b/arch/blackfin/mach-bf533/boards/Kconfig
@@ -26,6 +26,12 @@ config H8606_HVSISTEMAS
26 help 26 help
27 HV Sistemas H8606 board support. 27 HV Sistemas H8606 board support.
28 28
29config BFIN532_IP0X
30 bool "IP04/IP08 IP-PBX"
31 depends on (BF532)
32 help
33 Core support for IP04/IP04 open hardware IP-PBX.
34
29config GENERIC_BF533_BOARD 35config GENERIC_BF533_BOARD
30 bool "Generic" 36 bool "Generic"
31 help 37 help
diff --git a/arch/blackfin/mach-bf533/boards/Makefile b/arch/blackfin/mach-bf533/boards/Makefile
index 54f57fb9791e..b7a1a1d79bda 100644
--- a/arch/blackfin/mach-bf533/boards/Makefile
+++ b/arch/blackfin/mach-bf533/boards/Makefile
@@ -4,6 +4,7 @@
4 4
5obj-$(CONFIG_GENERIC_BF533_BOARD) += generic_board.o 5obj-$(CONFIG_GENERIC_BF533_BOARD) += generic_board.o
6obj-$(CONFIG_BFIN533_STAMP) += stamp.o 6obj-$(CONFIG_BFIN533_STAMP) += stamp.o
7obj-$(CONFIG_BFIN532_IP0X) += ip0x.o
7obj-$(CONFIG_BFIN533_EZKIT) += ezkit.o 8obj-$(CONFIG_BFIN533_EZKIT) += ezkit.o
8obj-$(CONFIG_BFIN533_BLUETECHNIX_CM) += cm_bf533.o 9obj-$(CONFIG_BFIN533_BLUETECHNIX_CM) += cm_bf533.o
9obj-$(CONFIG_H8606_HVSISTEMAS) += H8606.o 10obj-$(CONFIG_H8606_HVSISTEMAS) += H8606.o
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index 886f260d9359..a03149c72681 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -234,6 +234,25 @@ static struct platform_device bfin_uart_device = {
234}; 234};
235#endif 235#endif
236 236
237#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
238static struct resource bfin_sir_resources[] = {
239#ifdef CONFIG_BFIN_SIR0
240 {
241 .start = 0xFFC00400,
242 .end = 0xFFC004FF,
243 .flags = IORESOURCE_MEM,
244 },
245#endif
246};
247
248static struct platform_device bfin_sir_device = {
249 .name = "bfin_sir",
250 .id = 0,
251 .num_resources = ARRAY_SIZE(bfin_sir_resources),
252 .resource = bfin_sir_resources,
253};
254#endif
255
237#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 256#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
238static struct platform_device bfin_sport0_uart_device = { 257static struct platform_device bfin_sport0_uart_device = {
239 .name = "bfin-sport-uart", 258 .name = "bfin-sport-uart",
@@ -327,6 +346,10 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
327 &bfin_uart_device, 346 &bfin_uart_device,
328#endif 347#endif
329 348
349#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
350 &bfin_sir_device,
351#endif
352
330#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 353#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
331 &bfin_sport0_uart_device, 354 &bfin_sport0_uart_device,
332 &bfin_sport1_uart_device, 355 &bfin_sport1_uart_device,
@@ -355,7 +378,7 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
355 378
356static int __init cm_bf533_init(void) 379static int __init cm_bf533_init(void)
357{ 380{
358 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 381 printk(KERN_INFO "%s(): registering device resources\n", __func__);
359 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices)); 382 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices));
360#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 383#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
361 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 384 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 241b5a20a36a..08a7943949ae 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -237,6 +237,25 @@ static struct platform_device bfin_uart_device = {
237}; 237};
238#endif 238#endif
239 239
240#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
241static struct resource bfin_sir_resources[] = {
242#ifdef CONFIG_BFIN_SIR0
243 {
244 .start = 0xFFC00400,
245 .end = 0xFFC004FF,
246 .flags = IORESOURCE_MEM,
247 },
248#endif
249};
250
251static struct platform_device bfin_sir_device = {
252 .name = "bfin_sir",
253 .id = 0,
254 .num_resources = ARRAY_SIZE(bfin_sir_resources),
255 .resource = bfin_sir_resources,
256};
257#endif
258
240#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 259#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
241#define PATA_INT 55 260#define PATA_INT 55
242 261
@@ -352,6 +371,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
352 &bfin_uart_device, 371 &bfin_uart_device,
353#endif 372#endif
354 373
374#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
375 &bfin_sir_device,
376#endif
377
355#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 378#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
356 &bfin_pata_device, 379 &bfin_pata_device,
357#endif 380#endif
@@ -369,7 +392,7 @@ static struct platform_device *ezkit_devices[] __initdata = {
369 392
370static int __init ezkit_init(void) 393static int __init ezkit_init(void)
371{ 394{
372 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 395 printk(KERN_INFO "%s(): registering device resources\n", __func__);
373 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); 396 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
374#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 397#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
375 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 398 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
diff --git a/arch/blackfin/mach-bf533/boards/generic_board.c b/arch/blackfin/mach-bf533/boards/generic_board.c
index e359a0d6467f..82b1f6a60e3f 100644
--- a/arch/blackfin/mach-bf533/boards/generic_board.c
+++ b/arch/blackfin/mach-bf533/boards/generic_board.c
@@ -84,7 +84,7 @@ static struct platform_device *generic_board_devices[] __initdata = {
84 84
85static int __init generic_board_init(void) 85static int __init generic_board_init(void)
86{ 86{
87 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 87 printk(KERN_INFO "%s(): registering device resources\n", __func__);
88 return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices)); 88 return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices));
89} 89}
90 90
diff --git a/arch/blackfin/mach-bf533/boards/ip0x.c b/arch/blackfin/mach-bf533/boards/ip0x.c
new file mode 100644
index 000000000000..5864892de314
--- /dev/null
+++ b/arch/blackfin/mach-bf533/boards/ip0x.c
@@ -0,0 +1,303 @@
1/*
2 * File: arch/blackfin/mach-bf533/ip0x.c
3 * Based on: arch/blackfin/mach-bf533/bf1.c
4 * Based on: arch/blackfin/mach-bf533/stamp.c
5 * Author: Ivan Danov <idanov@gmail.com>
6 * Modified for IP0X David Rowe
7 *
8 * Created: 2007
9 * Description: Board info file for the IP04/IP08 boards, which
10 * are derived from the BlackfinOne V2.0 boards.
11 *
12 * Modified:
13 * COpyright 2007 David Rowe
14 * Copyright 2006 Intratrade Ltd.
15 * Copyright 2005 National ICT Australia (NICTA)
16 * Copyright 2004-2006 Analog Devices Inc.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, see the file COPYING, or write
30 * to the Free Software Foundation, Inc.,
31 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 */
33
34#include <linux/device.h>
35#include <linux/platform_device.h>
36#include <linux/mtd/mtd.h>
37#include <linux/mtd/partitions.h>
38#include <linux/spi/spi.h>
39#include <linux/spi/flash.h>
40#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
41#include <linux/usb/isp1362.h>
42#endif
43#include <asm/irq.h>
44#include <asm/bfin5xx_spi.h>
45
46/*
47 * Name the Board for the /proc/cpuinfo
48 */
49const char bfin_board_name[] = "IP04/IP08";
50
51/*
52 * Driver needs to know address, irq and flag pin.
53 */
54#if defined(CONFIG_BFIN532_IP0X)
55#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
56
57#include <linux/dm9000.h>
58
59static struct resource dm9000_resource1[] = {
60 {
61 .start = 0x20100000,
62 .end = 0x20100000 + 1,
63 .flags = IORESOURCE_MEM
64 },{
65 .start = 0x20100000 + 2,
66 .end = 0x20100000 + 3,
67 .flags = IORESOURCE_MEM
68 },{
69 .start = IRQ_PF15,
70 .end = IRQ_PF15,
71 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
72 }
73};
74
75static struct resource dm9000_resource2[] = {
76 {
77 .start = 0x20200000,
78 .end = 0x20200000 + 1,
79 .flags = IORESOURCE_MEM
80 },{
81 .start = 0x20200000 + 2,
82 .end = 0x20200000 + 3,
83 .flags = IORESOURCE_MEM
84 },{
85 .start = IRQ_PF14,
86 .end = IRQ_PF14,
87 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
88 }
89};
90
91/*
92* for the moment we limit ourselves to 16bit IO until some
93* better IO routines can be written and tested
94*/
95static struct dm9000_plat_data dm9000_platdata1 = {
96 .flags = DM9000_PLATF_16BITONLY,
97};
98
99static struct platform_device dm9000_device1 = {
100 .name = "dm9000",
101 .id = 0,
102 .num_resources = ARRAY_SIZE(dm9000_resource1),
103 .resource = dm9000_resource1,
104 .dev = {
105 .platform_data = &dm9000_platdata1,
106 }
107};
108
109static struct dm9000_plat_data dm9000_platdata2 = {
110 .flags = DM9000_PLATF_16BITONLY,
111};
112
113static struct platform_device dm9000_device2 = {
114 .name = "dm9000",
115 .id = 1,
116 .num_resources = ARRAY_SIZE(dm9000_resource2),
117 .resource = dm9000_resource2,
118 .dev = {
119 .platform_data = &dm9000_platdata2,
120 }
121};
122
123#endif
124#endif
125
126
127#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
128/* all SPI peripherals info goes here */
129
130#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
131static struct bfin5xx_spi_chip spi_mmc_chip_info = {
132/*
133 * CPOL (Clock Polarity)
134 * 0 - Active high SCK
135 * 1 - Active low SCK
136 * CPHA (Clock Phase) Selects transfer format and operation mode
137 * 0 - SCLK toggles from middle of the first data bit, slave select
138 * pins controlled by hardware.
139 * 1 - SCLK toggles from beginning of first data bit, slave select
140 * pins controller by user software.
141 * .ctl_reg = 0x1c00, * CPOL=1,CPHA=1,Sandisk 1G work
142 * NO NO .ctl_reg = 0x1800, * CPOL=1,CPHA=0
143 * NO NO .ctl_reg = 0x1400, * CPOL=0,CPHA=1
144 */
145 .ctl_reg = 0x1000, /* CPOL=0,CPHA=0,Sandisk 1G work */
146 .enable_dma = 0, /* if 1 - block!!! */
147 .bits_per_word = 8,
148 .cs_change_per_word = 0,
149};
150#endif
151
152/* Notice: for blackfin, the speed_hz is the value of register
153 * SPI_BAUD, not the real baudrate */
154static struct spi_board_info bfin_spi_board_info[] __initdata = {
155#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
156 {
157 .modalias = "spi_mmc",
158 .max_speed_hz = 2,
159 .bus_num = 1,
160 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
161 .platform_data = NULL,
162 .controller_data = &spi_mmc_chip_info,
163 },
164#endif
165};
166
167/* SPI controller data */
168static struct bfin5xx_spi_master spi_bfin_master_info = {
169 .num_chipselect = 8,
170 .enable_dma = 1, /* master has the ability to do dma transfer */
171};
172
173static struct platform_device spi_bfin_master_device = {
174 .name = "bfin-spi-master",
175 .id = 1, /* Bus number */
176 .dev = {
177 .platform_data = &spi_bfin_master_info, /* Passed to driver */
178 },
179};
180#endif /* spi master and devices */
181
182#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
183static struct resource bfin_uart_resources[] = {
184 {
185 .start = 0xFFC00400,
186 .end = 0xFFC004FF,
187 .flags = IORESOURCE_MEM,
188 },
189};
190
191static struct platform_device bfin_uart_device = {
192 .name = "bfin-uart",
193 .id = 1,
194 .num_resources = ARRAY_SIZE(bfin_uart_resources),
195 .resource = bfin_uart_resources,
196};
197#endif
198
199#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
200static struct resource bfin_sir_resources[] = {
201#ifdef CONFIG_BFIN_SIR0
202 {
203 .start = 0xFFC00400,
204 .end = 0xFFC004FF,
205 .flags = IORESOURCE_MEM,
206 },
207#endif
208};
209
210static struct platform_device bfin_sir_device = {
211 .name = "bfin_sir",
212 .id = 0,
213 .num_resources = ARRAY_SIZE(bfin_sir_resources),
214 .resource = bfin_sir_resources,
215};
216#endif
217
218#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
219static struct resource isp1362_hcd_resources[] = {
220 {
221 .start = 0x20300000,
222 .end = 0x20300000 + 1,
223 .flags = IORESOURCE_MEM,
224 },{
225 .start = 0x20300000 + 2,
226 .end = 0x20300000 + 3,
227 .flags = IORESOURCE_MEM,
228 },{
229 .start = IRQ_PF11,
230 .end = IRQ_PF11,
231 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
232 },
233};
234
235static struct isp1362_platform_data isp1362_priv = {
236 .sel15Kres = 1,
237 .clknotstop = 0,
238 .oc_enable = 0, /* external OC */
239 .int_act_high = 0,
240 .int_edge_triggered = 0,
241 .remote_wakeup_connected = 0,
242 .no_power_switching = 1,
243 .power_switching_mode = 0,
244};
245
246static struct platform_device isp1362_hcd_device = {
247 .name = "isp1362-hcd",
248 .id = 0,
249 .dev = {
250 .platform_data = &isp1362_priv,
251 },
252 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
253 .resource = isp1362_hcd_resources,
254};
255#endif
256
257
258static struct platform_device *ip0x_devices[] __initdata = {
259#if defined(CONFIG_BFIN532_IP0X)
260#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
261 &dm9000_device1,
262 &dm9000_device2,
263#endif
264#endif
265
266#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
267 &spi_bfin_master_device,
268#endif
269
270#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
271 &bfin_uart_device,
272#endif
273
274#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
275 &bfin_sir_device,
276#endif
277
278#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
279 &isp1362_hcd_device,
280#endif
281};
282
283static int __init ip0x_init(void)
284{
285 int i;
286
287 printk(KERN_INFO "%s(): registering device resources\n", __func__);
288 platform_add_devices(ip0x_devices, ARRAY_SIZE(ip0x_devices));
289
290#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
291 for (i = 0; i < ARRAY_SIZE(bfin_spi_board_info); ++i) {
292 int j = 1 << bfin_spi_board_info[i].chip_select;
293 /* set spi cs to 1 */
294 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | j);
295 bfin_write_FIO_FLAG_S(j);
296 }
297 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
298#endif
299
300 return 0;
301}
302
303arch_initcall(ip0x_init);
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index b2ac4816ae62..fddce32901a2 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -40,6 +40,7 @@
40#endif 40#endif
41#include <linux/ata_platform.h> 41#include <linux/ata_platform.h>
42#include <linux/irq.h> 42#include <linux/irq.h>
43#include <linux/i2c.h>
43#include <asm/dma.h> 44#include <asm/dma.h>
44#include <asm/bfin5xx_spi.h> 45#include <asm/bfin5xx_spi.h>
45#include <asm/reboot.h> 46#include <asm/reboot.h>
@@ -109,6 +110,7 @@ static struct platform_device net2272_bfin_device = {
109}; 110};
110#endif 111#endif
111 112
113#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
112static struct mtd_partition stamp_partitions[] = { 114static struct mtd_partition stamp_partitions[] = {
113 { 115 {
114 .name = "Bootloader", 116 .name = "Bootloader",
@@ -152,6 +154,7 @@ static struct platform_device stamp_flash_device = {
152 .num_resources = ARRAY_SIZE(stamp_flash_resource), 154 .num_resources = ARRAY_SIZE(stamp_flash_resource),
153 .resource = stamp_flash_resource, 155 .resource = stamp_flash_resource,
154}; 156};
157#endif
155 158
156#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 159#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
157/* all SPI peripherals info goes here */ 160/* all SPI peripherals info goes here */
@@ -367,6 +370,25 @@ static struct platform_device bfin_uart_device = {
367}; 370};
368#endif 371#endif
369 372
373#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
374static struct resource bfin_sir_resources[] = {
375#ifdef CONFIG_BFIN_SIR0
376 {
377 .start = 0xFFC00400,
378 .end = 0xFFC004FF,
379 .flags = IORESOURCE_MEM,
380 },
381#endif
382};
383
384static struct platform_device bfin_sir_device = {
385 .name = "bfin_sir",
386 .id = 0,
387 .num_resources = ARRAY_SIZE(bfin_sir_resources),
388 .resource = bfin_sir_resources,
389};
390#endif
391
370#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 392#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
371static struct platform_device bfin_sport0_uart_device = { 393static struct platform_device bfin_sport0_uart_device = {
372 .name = "bfin-sport-uart", 394 .name = "bfin-sport-uart",
@@ -472,6 +494,31 @@ static struct platform_device i2c_gpio_device = {
472}; 494};
473#endif 495#endif
474 496
497#ifdef CONFIG_I2C_BOARDINFO
498static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
499#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
500 {
501 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
502 .type = "ad7142_joystick",
503 .irq = 39,
504 },
505#endif
506#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
507 {
508 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
509 .type = "pcf8574_lcd",
510 },
511#endif
512#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
513 {
514 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
515 .type = "pcf8574_keypad",
516 .irq = 39,
517 },
518#endif
519};
520#endif
521
475static struct platform_device *stamp_devices[] __initdata = { 522static struct platform_device *stamp_devices[] __initdata = {
476#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 523#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
477 &rtc_device, 524 &rtc_device,
@@ -497,6 +544,10 @@ static struct platform_device *stamp_devices[] __initdata = {
497 &bfin_uart_device, 544 &bfin_uart_device,
498#endif 545#endif
499 546
547#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
548 &bfin_sir_device,
549#endif
550
500#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 551#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
501 &bfin_sport0_uart_device, 552 &bfin_sport0_uart_device,
502 &bfin_sport1_uart_device, 553 &bfin_sport1_uart_device,
@@ -515,14 +566,23 @@ static struct platform_device *stamp_devices[] __initdata = {
515#endif 566#endif
516 567
517 &bfin_gpios_device, 568 &bfin_gpios_device,
569
570#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
518 &stamp_flash_device, 571 &stamp_flash_device,
572#endif
519}; 573};
520 574
521static int __init stamp_init(void) 575static int __init stamp_init(void)
522{ 576{
523 int ret; 577 int ret;
524 578
525 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 579 printk(KERN_INFO "%s(): registering device resources\n", __func__);
580
581#ifdef CONFIG_I2C_BOARDINFO
582 i2c_register_board_info(0, bfin_i2c_board_info,
583 ARRAY_SIZE(bfin_i2c_board_info));
584#endif
585
526 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 586 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
527 if (ret < 0) 587 if (ret < 0)
528 return ret; 588 return ret;
diff --git a/arch/blackfin/mach-bf533/cpu.c b/arch/blackfin/mach-bf533/cpu.c
deleted file mode 100644
index b7a0e0fbd9af..000000000000
--- a/arch/blackfin/mach-bf533/cpu.c
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * File: arch/blackfin/mach-bf533/cpu.c
3 * Based on:
4 * Author: michael.kang@analog.com
5 *
6 * Created:
7 * Description: clock scaling for the bf533
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/kernel.h>
31#include <linux/types.h>
32#include <linux/init.h>
33#include <linux/cpufreq.h>
34#include <asm/dpmc.h>
35#include <linux/fs.h>
36#include <asm/bfin-global.h>
37
38/* CONFIG_CLKIN_HZ=11059200 */
39#define VCO5 (CONFIG_CLKIN_HZ*45) /*497664000 */
40#define VCO4 (CONFIG_CLKIN_HZ*36) /*398131200 */
41#define VCO3 (CONFIG_CLKIN_HZ*27) /*298598400 */
42#define VCO2 (CONFIG_CLKIN_HZ*18) /*199065600 */
43#define VCO1 (CONFIG_CLKIN_HZ*9) /*99532800 */
44#define VCO(x) VCO##x
45
46#define FREQ(x) {VCO(x),VCO(x)/4},{VCO(x),VCO(x)/2},{VCO(x),VCO(x)}
47/* frequency */
48static struct cpufreq_frequency_table bf533_freq_table[] = {
49 FREQ(1),
50 FREQ(3),
51 {VCO4, VCO4 / 2}, {VCO4, VCO4},
52 FREQ(5),
53 {0, CPUFREQ_TABLE_END},
54};
55
56/*
57 * dpmc_fops->ioctl()
58 * static int dpmc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
59 */
60static int bf533_getfreq(unsigned int cpu)
61{
62 unsigned long cclk_mhz, vco_mhz;
63
64 /* The driver only support single cpu */
65 if (cpu == 0)
66 dpmc_fops.ioctl(NULL, NULL, IOCTL_GET_CORECLOCK, &cclk_mhz);
67 else
68 cclk_mhz = -1;
69 return cclk_mhz;
70}
71
72static int bf533_target(struct cpufreq_policy *policy,
73 unsigned int target_freq, unsigned int relation)
74{
75 unsigned long cclk_mhz;
76 unsigned long vco_mhz;
77 unsigned long flags;
78 unsigned int index, vco_index;
79 int i;
80
81 struct cpufreq_freqs freqs;
82 if (cpufreq_frequency_table_target(policy, bf533_freq_table, target_freq, relation, &index))
83 return -EINVAL;
84 cclk_mhz = bf533_freq_table[index].frequency;
85 vco_mhz = bf533_freq_table[index].index;
86
87 dpmc_fops.ioctl(NULL, NULL, IOCTL_CHANGE_FREQUENCY, &vco_mhz);
88 freqs.old = bf533_getfreq(0);
89 freqs.new = cclk_mhz;
90 freqs.cpu = 0;
91
92 pr_debug("cclk begin change to cclk %d,vco=%d,index=%d,target=%d,oldfreq=%d\n",
93 cclk_mhz, vco_mhz, index, target_freq, freqs.old);
94
95 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
96 local_irq_save(flags);
97 dpmc_fops.ioctl(NULL, NULL, IOCTL_SET_CCLK, &cclk_mhz);
98 local_irq_restore(flags);
99 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
100
101 vco_mhz = get_vco();
102 cclk_mhz = get_cclk();
103 return 0;
104}
105
106/* make sure that only the "userspace" governor is run -- anything else wouldn't make sense on
107 * this platform, anyway.
108 */
109static int bf533_verify_speed(struct cpufreq_policy *policy)
110{
111 return cpufreq_frequency_table_verify(policy, &bf533_freq_table);
112}
113
114static int __init __bf533_cpu_init(struct cpufreq_policy *policy)
115{
116 int result;
117
118 if (policy->cpu != 0)
119 return -EINVAL;
120
121 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
122 /*Now ,only support one cpu */
123 policy->cur = bf533_getfreq(0);
124 cpufreq_frequency_table_get_attr(bf533_freq_table, policy->cpu);
125 return cpufreq_frequency_table_cpuinfo(policy, bf533_freq_table);
126}
127
128static struct freq_attr *bf533_freq_attr[] = {
129 &cpufreq_freq_attr_scaling_available_freqs,
130 NULL,
131};
132
133static struct cpufreq_driver bf533_driver = {
134 .verify = bf533_verify_speed,
135 .target = bf533_target,
136 .get = bf533_getfreq,
137 .init = __bf533_cpu_init,
138 .name = "bf533",
139 .owner = THIS_MODULE,
140 .attr = bf533_freq_attr,
141};
142
143static int __init bf533_cpu_init(void)
144{
145 return cpufreq_register_driver(&bf533_driver);
146}
147
148static void __exit bf533_cpu_exit(void)
149{
150 cpufreq_unregister_driver(&bf533_driver);
151}
152
153MODULE_AUTHOR("Mickael Kang");
154MODULE_DESCRIPTION("cpufreq driver for BF533 CPU");
155MODULE_LICENSE("GPL");
156
157module_init(bf533_cpu_init);
158module_exit(bf533_cpu_exit);
diff --git a/arch/blackfin/mach-bf533/dma.c b/arch/blackfin/mach-bf533/dma.c
index 6c909cf4f7bf..28655c1cb7dc 100644
--- a/arch/blackfin/mach-bf533/dma.c
+++ b/arch/blackfin/mach-bf533/dma.c
@@ -26,10 +26,12 @@
26 * to the Free Software Foundation, Inc., 26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 28 */
29#include <linux/module.h>
30
29#include <asm/blackfin.h> 31#include <asm/blackfin.h>
30#include <asm/dma.h> 32#include <asm/dma.h>
31 33
32struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { 34struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL] = {
33 (struct dma_register *) DMA0_NEXT_DESC_PTR, 35 (struct dma_register *) DMA0_NEXT_DESC_PTR,
34 (struct dma_register *) DMA1_NEXT_DESC_PTR, 36 (struct dma_register *) DMA1_NEXT_DESC_PTR,
35 (struct dma_register *) DMA2_NEXT_DESC_PTR, 37 (struct dma_register *) DMA2_NEXT_DESC_PTR,
@@ -43,6 +45,7 @@ struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = {
43 (struct dma_register *) MDMA_D1_NEXT_DESC_PTR, 45 (struct dma_register *) MDMA_D1_NEXT_DESC_PTR,
44 (struct dma_register *) MDMA_S1_NEXT_DESC_PTR, 46 (struct dma_register *) MDMA_S1_NEXT_DESC_PTR,
45}; 47};
48EXPORT_SYMBOL(dma_io_base_addr);
46 49
47int channel2irq(unsigned int channel) 50int channel2irq(unsigned int channel)
48{ 51{
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S
index 1ded945a6fa0..1295deac00a4 100644
--- a/arch/blackfin/mach-bf533/head.S
+++ b/arch/blackfin/mach-bf533/head.S
@@ -36,9 +36,6 @@
36#include <asm/mach/mem_init.h> 36#include <asm/mach/mem_init.h>
37#endif 37#endif
38 38
39.global __rambase
40.global __ramstart
41.global __ramend
42.extern ___bss_stop 39.extern ___bss_stop
43.extern ___bss_start 40.extern ___bss_start
44.extern _bf53x_relocate_l1_mem 41.extern _bf53x_relocate_l1_mem
@@ -151,26 +148,26 @@ ENTRY(__start)
151 148
152 /* Initialise UART - when booting from u-boot, the UART is not disabled 149 /* Initialise UART - when booting from u-boot, the UART is not disabled
153 * so if we dont initalize here, our serial console gets hosed */ 150 * so if we dont initalize here, our serial console gets hosed */
154 p0.h = hi(UART_LCR); 151 p0.h = hi(BFIN_UART_LCR);
155 p0.l = lo(UART_LCR); 152 p0.l = lo(BFIN_UART_LCR);
156 r0 = 0x0(Z); 153 r0 = 0x0(Z);
157 w[p0] = r0.L; /* To enable DLL writes */ 154 w[p0] = r0.L; /* To enable DLL writes */
158 ssync; 155 ssync;
159 156
160 p0.h = hi(UART_DLL); 157 p0.h = hi(BFIN_UART_DLL);
161 p0.l = lo(UART_DLL); 158 p0.l = lo(BFIN_UART_DLL);
162 r0 = 0x0(Z); 159 r0 = 0x0(Z);
163 w[p0] = r0.L; 160 w[p0] = r0.L;
164 ssync; 161 ssync;
165 162
166 p0.h = hi(UART_DLH); 163 p0.h = hi(BFIN_UART_DLH);
167 p0.l = lo(UART_DLH); 164 p0.l = lo(BFIN_UART_DLH);
168 r0 = 0x00(Z); 165 r0 = 0x00(Z);
169 w[p0] = r0.L; 166 w[p0] = r0.L;
170 ssync; 167 ssync;
171 168
172 p0.h = hi(UART_GCTL); 169 p0.h = hi(BFIN_UART_GCTL);
173 p0.l = lo(UART_GCTL); 170 p0.l = lo(BFIN_UART_GCTL);
174 r0 = 0x0(Z); 171 r0 = 0x0(Z);
175 w[p0] = r0.L; /* To enable UART clock */ 172 w[p0] = r0.L; /* To enable UART clock */
176 ssync; 173 ssync;
@@ -431,18 +428,3 @@ ENTRY(_start_dma_code)
431 RTS; 428 RTS;
432ENDPROC(_start_dma_code) 429ENDPROC(_start_dma_code)
433#endif /* CONFIG_BFIN_KERNEL_CLOCK */ 430#endif /* CONFIG_BFIN_KERNEL_CLOCK */
434
435.data
436
437/*
438 * Set up the usable of RAM stuff. Size of RAM is determined then
439 * an initial stack set up at the end.
440 */
441
442.align 4
443__rambase:
444.long 0
445__ramstart:
446.long 0
447__ramend:
448.long 0