aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/Kconfig61
-rw-r--r--arch/blackfin/Makefile23
-rw-r--r--arch/blackfin/boot/Makefile3
-rw-r--r--arch/blackfin/boot/install.sh57
-rw-r--r--arch/blackfin/configs/BF527-EZKIT_defconfig1241
-rw-r--r--arch/blackfin/configs/BF548-EZKIT_defconfig9
-rw-r--r--arch/blackfin/kernel/Makefile1
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c26
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c35
-rw-r--r--arch/blackfin/kernel/gptimers.c250
-rw-r--r--arch/blackfin/kernel/reboot.c2
-rw-r--r--arch/blackfin/kernel/setup.c116
-rw-r--r--arch/blackfin/kernel/traps.c2
-rw-r--r--arch/blackfin/lib/Makefile2
-rw-r--r--arch/blackfin/lib/udivdi3.S375
-rw-r--r--arch/blackfin/mach-bf527/Kconfig251
-rw-r--r--arch/blackfin/mach-bf527/Makefile9
-rw-r--r--arch/blackfin/mach-bf527/boards/Makefile7
-rw-r--r--arch/blackfin/mach-bf527/boards/eth_mac.c50
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c737
-rw-r--r--arch/blackfin/mach-bf527/cpu.c161
-rw-r--r--arch/blackfin/mach-bf527/dma.c115
-rw-r--r--arch/blackfin/mach-bf527/head.S456
-rw-r--r--arch/blackfin/mach-bf527/ints-priority.c100
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c2
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf533/boards/generic_board.c2
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c2
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537.c2
-rw-r--r--arch/blackfin/mach-bf537/boards/generic_board.c2
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c2
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c2
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c4
-rw-r--r--arch/blackfin/mach-bf548/dma.c1
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c2
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf561/boards/generic_board.c2
-rw-r--r--arch/blackfin/mach-bf561/boards/tepla.c2
-rw-r--r--arch/blackfin/mach-common/ints-priority-dc.c8
-rw-r--r--arch/blackfin/mach-common/ints-priority-sc.c55
40 files changed, 4098 insertions, 83 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index ad28dc76fc97..7888551ed939 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -71,7 +71,7 @@ config GENERIC_CALIBRATE_DELAY
71 71
72config IRQCHIP_DEMUX_GPIO 72config IRQCHIP_DEMUX_GPIO
73 bool 73 bool
74 depends on (BF53x || BF561 || BF54x) 74 depends on (BF52x || BF53x || BF561 || BF54x)
75 default y 75 default y
76 76
77source "init/Kconfig" 77source "init/Kconfig"
@@ -85,6 +85,21 @@ choice
85 prompt "CPU" 85 prompt "CPU"
86 default BF533 86 default BF533
87 87
88config BF522
89 bool "BF522"
90 help
91 BF522 Processor Support.
92
93config BF525
94 bool "BF525"
95 help
96 BF525 Processor Support.
97
98config BF527
99 bool "BF527"
100 help
101 BF527 Processor Support.
102
88config BF531 103config BF531
89 bool "BF531" 104 bool "BF531"
90 help 105 help
@@ -144,13 +159,18 @@ endchoice
144 159
145choice 160choice
146 prompt "Silicon Rev" 161 prompt "Silicon Rev"
162 default BF_REV_0_1 if BF527
147 default BF_REV_0_2 if BF537 163 default BF_REV_0_2 if BF537
148 default BF_REV_0_3 if BF533 164 default BF_REV_0_3 if BF533
149 default BF_REV_0_0 if BF549 165 default BF_REV_0_0 if BF549
150 166
151config BF_REV_0_0 167config BF_REV_0_0
152 bool "0.0" 168 bool "0.0"
153 depends on (BF549) 169 depends on (BF549 || BF527)
170
171config BF_REV_0_1
172 bool "0.2"
173 depends on (BF549 || BF527)
154 174
155config BF_REV_0_2 175config BF_REV_0_2
156 bool "0.2" 176 bool "0.2"
@@ -176,6 +196,11 @@ config BF_REV_NONE
176 196
177endchoice 197endchoice
178 198
199config BF52x
200 bool
201 depends on (BF522 || BF525 || BF527)
202 default y
203
179config BF53x 204config BF53x
180 bool 205 bool
181 depends on (BF531 || BF532 || BF533 || BF534 || BF536 || BF537) 206 depends on (BF531 || BF532 || BF533 || BF534 || BF536 || BF537)
@@ -204,6 +229,12 @@ choice
204 configuration to ensure that all the other settings are 229 configuration to ensure that all the other settings are
205 correct. 230 correct.
206 231
232config BFIN527_EZKIT
233 bool "BF527-EZKIT"
234 depends on (BF522 || BF525 || BF527)
235 help
236 BF533-EZKIT-LITE board Support.
237
207config BFIN533_EZKIT 238config BFIN533_EZKIT
208 bool "BF533-EZKIT" 239 bool "BF533-EZKIT"
209 depends on (BF533 || BF532 || BF531) 240 depends on (BF533 || BF532 || BF531)
@@ -299,11 +330,17 @@ config MEM_MT48LC8M32B2B5_7
299 depends on (BFIN561_BLUETECHNIX_CM) 330 depends on (BFIN561_BLUETECHNIX_CM)
300 default y 331 default y
301 332
333config MEM_MT48LC32M16A2TG_75
334 bool
335 depends on (BFIN527_EZKIT)
336 default y
337
302config BFIN_SHARED_FLASH_ENET 338config BFIN_SHARED_FLASH_ENET
303 bool 339 bool
304 depends on (BFIN533_STAMP) 340 depends on (BFIN533_STAMP)
305 default y 341 default y
306 342
343source "arch/blackfin/mach-bf527/Kconfig"
307source "arch/blackfin/mach-bf533/Kconfig" 344source "arch/blackfin/mach-bf533/Kconfig"
308source "arch/blackfin/mach-bf561/Kconfig" 345source "arch/blackfin/mach-bf561/Kconfig"
309source "arch/blackfin/mach-bf537/Kconfig" 346source "arch/blackfin/mach-bf537/Kconfig"
@@ -329,7 +366,7 @@ config CLKIN_HZ
329 int "Crystal Frequency in Hz" 366 int "Crystal Frequency in Hz"
330 default "11059200" if BFIN533_STAMP 367 default "11059200" if BFIN533_STAMP
331 default "27000000" if BFIN533_EZKIT 368 default "27000000" if BFIN533_EZKIT
332 default "25000000" if BFIN537_STAMP 369 default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT)
333 default "30000000" if BFIN561_EZKIT 370 default "30000000" if BFIN561_EZKIT
334 default "24576000" if PNAV10 371 default "24576000" if PNAV10
335 help 372 help
@@ -362,7 +399,7 @@ config VCO_MULT
362 range 1 64 399 range 1 64
363 default "22" if BFIN533_EZKIT 400 default "22" if BFIN533_EZKIT
364 default "45" if BFIN533_STAMP 401 default "45" if BFIN533_STAMP
365 default "20" if BFIN537_STAMP 402 default "20" if (BFIN537_STAMP || BFIN527_EZKIT)
366 default "22" if BFIN533_BLUETECHNIX_CM 403 default "22" if BFIN533_BLUETECHNIX_CM
367 default "20" if BFIN537_BLUETECHNIX_CM 404 default "20" if BFIN537_BLUETECHNIX_CM
368 default "20" if BFIN561_BLUETECHNIX_CM 405 default "20" if BFIN561_BLUETECHNIX_CM
@@ -398,7 +435,7 @@ config SCLK_DIV
398 range 1 15 435 range 1 15
399 default 5 if BFIN533_EZKIT 436 default 5 if BFIN533_EZKIT
400 default 5 if BFIN533_STAMP 437 default 5 if BFIN533_STAMP
401 default 4 if BFIN537_STAMP 438 default 4 if (BFIN537_STAMP || BFIN527_EZKIT)
402 default 5 if BFIN533_BLUETECHNIX_CM 439 default 5 if BFIN533_BLUETECHNIX_CM
403 default 4 if BFIN537_BLUETECHNIX_CM 440 default 4 if BFIN537_BLUETECHNIX_CM
404 default 4 if BFIN561_BLUETECHNIX_CM 441 default 4 if BFIN561_BLUETECHNIX_CM
@@ -450,6 +487,7 @@ comment "Memory Setup"
450config MEM_SIZE 487config MEM_SIZE
451 int "SDRAM Memory Size in MBytes" 488 int "SDRAM Memory Size in MBytes"
452 default 32 if BFIN533_EZKIT 489 default 32 if BFIN533_EZKIT
490 default 64 if BFIN527_EZKIT
453 default 64 if BFIN537_STAMP 491 default 64 if BFIN537_STAMP
454 default 64 if BFIN561_EZKIT 492 default 64 if BFIN561_EZKIT
455 default 128 if BFIN533_STAMP 493 default 128 if BFIN533_STAMP
@@ -459,6 +497,7 @@ config MEM_ADD_WIDTH
459 int "SDRAM Memory Address Width" 497 int "SDRAM Memory Address Width"
460 default 9 if BFIN533_EZKIT 498 default 9 if BFIN533_EZKIT
461 default 9 if BFIN561_EZKIT 499 default 9 if BFIN561_EZKIT
500 default 10 if BFIN527_EZKIT
462 default 10 if BFIN537_STAMP 501 default 10 if BFIN537_STAMP
463 default 11 if BFIN533_STAMP 502 default 11 if BFIN533_STAMP
464 default 10 if PNAV10 503 default 10 if PNAV10
@@ -749,9 +788,19 @@ config LARGE_ALLOCS
749 a lot of RAM, and you need to able to allocate very large 788 a lot of RAM, and you need to able to allocate very large
750 contiguous chunks. If unsure, say N. 789 contiguous chunks. If unsure, say N.
751 790
791config BFIN_GPTIMERS
792 tristate "Enable Blackfin General Purpose Timers API"
793 default n
794 help
795 Enable support for the General Purpose Timers API. If you
796 are unsure, say N.
797
798 To compile this driver as a module, choose M here: the module
799 will be called gptimers.ko.
800
752config BFIN_DMA_5XX 801config BFIN_DMA_5XX
753 bool "Enable DMA Support" 802 bool "Enable DMA Support"
754 depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561 || BF54x) 803 depends on (BF52x || BF53x || BF561 || BF54x)
755 default y 804 default y
756 help 805 help
757 DMA driver for BF5xx. 806 DMA driver for BF5xx.
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 368933760d28..3c87291bcdab 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -12,12 +12,17 @@ LDFLAGS_vmlinux := -X
12OBJCOPYFLAGS := -O binary -R .note -R .comment -S 12OBJCOPYFLAGS := -O binary -R .note -R .comment -S
13GZFLAGS := -9 13GZFLAGS := -9
14 14
15CFLAGS += $(call cc-option,-mno-fdpic)
16AFLAGS += $(call cc-option,-mno-fdpic)
15CFLAGS_MODULE += -mlong-calls 17CFLAGS_MODULE += -mlong-calls
16KALLSYMS += --symbol-prefix=_ 18KALLSYMS += --symbol-prefix=_
17 19
18KBUILD_DEFCONFIG := BF537-STAMP_defconfig 20KBUILD_DEFCONFIG := BF537-STAMP_defconfig
19 21
20# setup the machine name and the machine dependent settings 22# setup the machine name and the machine dependent settings
23machine-$(CONFIG_BF522) := bf527
24machine-$(CONFIG_BF525) := bf527
25machine-$(CONFIG_BF527) := bf527
21machine-$(CONFIG_BF531) := bf533 26machine-$(CONFIG_BF531) := bf533
22machine-$(CONFIG_BF532) := bf533 27machine-$(CONFIG_BF532) := bf533
23machine-$(CONFIG_BF533) := bf533 28machine-$(CONFIG_BF533) := bf533
@@ -32,6 +37,9 @@ machine-$(CONFIG_BF561) := bf561
32MACHINE := $(machine-y) 37MACHINE := $(machine-y)
33export MACHINE 38export MACHINE
34 39
40cpu-$(CONFIG_BF522) := bf522
41cpu-$(CONFIG_BF525) := bf525
42cpu-$(CONFIG_BF527) := bf527
35cpu-$(CONFIG_BF531) := bf531 43cpu-$(CONFIG_BF531) := bf531
36cpu-$(CONFIG_BF532) := bf532 44cpu-$(CONFIG_BF532) := bf532
37cpu-$(CONFIG_BF533) := bf533 45cpu-$(CONFIG_BF533) := bf533
@@ -97,12 +105,23 @@ archclean:
97 $(Q)$(MAKE) $(clean)=$(boot) 105 $(Q)$(MAKE) $(clean)=$(boot)
98 106
99 107
100all: vmImage
101boot := arch/$(ARCH)/boot 108boot := arch/$(ARCH)/boot
102BOOT_TARGETS = vmImage 109BOOT_TARGETS = vmImage
103.PHONY: $(BOOT_TARGETS) 110PHONY += $(BOOT_TARGETS) install
111KBUILD_IMAGE := $(boot)/vmImage
112
113all: vmImage
114
104$(BOOT_TARGETS): vmlinux 115$(BOOT_TARGETS): vmlinux
105 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 116 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
117
118install:
119 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
120
106define archhelp 121define archhelp
107 echo '* vmImage - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)' 122 echo '* vmImage - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)'
123 echo ' install - Install kernel using'
124 echo ' (your) ~/bin/$(CROSS_COMPILE)installkernel or'
125 echo ' (distribution) PATH: $(CROSS_COMPILE)installkernel or'
126 echo ' install to $$(INSTALL_PATH)'
108endef 127endef
diff --git a/arch/blackfin/boot/Makefile b/arch/blackfin/boot/Makefile
index 8cd33560e817..522f3c124060 100644
--- a/arch/blackfin/boot/Makefile
+++ b/arch/blackfin/boot/Makefile
@@ -26,3 +26,6 @@ $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
26$(obj)/vmImage: $(obj)/vmlinux.gz 26$(obj)/vmImage: $(obj)/vmlinux.gz
27 $(call if_changed,uimage) 27 $(call if_changed,uimage)
28 @echo 'Kernel: $@ is ready' 28 @echo 'Kernel: $@ is ready'
29
30install:
31 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
diff --git a/arch/blackfin/boot/install.sh b/arch/blackfin/boot/install.sh
new file mode 100644
index 000000000000..9560a6b29100
--- /dev/null
+++ b/arch/blackfin/boot/install.sh
@@ -0,0 +1,57 @@
1#!/bin/sh
2#
3# arch/blackfin/boot/install.sh
4#
5# This file is subject to the terms and conditions of the GNU General Public
6# License. See the file "COPYING" in the main directory of this archive
7# for more details.
8#
9# Copyright (C) 1995 by Linus Torvalds
10#
11# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
12# Adapted from code in arch/i386/boot/install.sh by Mike Frysinger
13#
14# "make install" script for Blackfin architecture
15#
16# Arguments:
17# $1 - kernel version
18# $2 - kernel image file
19# $3 - kernel map file
20# $4 - default install path (blank if root directory)
21#
22
23verify () {
24 if [ ! -f "$1" ]; then
25 echo "" 1>&2
26 echo " *** Missing file: $1" 1>&2
27 echo ' *** You need to run "make" before "make install".' 1>&2
28 echo "" 1>&2
29 exit 1
30 fi
31}
32
33# Make sure the files actually exist
34verify "$2"
35verify "$3"
36
37# User may have a custom install script
38
39if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
40if which ${CROSS_COMPILE}installkernel >/dev/null 2>&1; then
41 exec ${CROSS_COMPILE}installkernel "$@"
42fi
43
44# Default install - same as make zlilo
45
46back_it_up() {
47 local file=$1
48 [ -f ${file} ] || return 0
49 local stamp=$(stat -c %Y ${file} 2>/dev/null)
50 mv ${file} ${file}.${stamp:-old}
51}
52
53back_it_up $4/uImage
54back_it_up $4/System.map
55
56cat $2 > $4/uImage
57cp $3 $4/System.map
diff --git a/arch/blackfin/configs/BF527-EZKIT_defconfig b/arch/blackfin/configs/BF527-EZKIT_defconfig
new file mode 100644
index 000000000000..df974e785ee2
--- /dev/null
+++ b/arch/blackfin/configs/BF527-EZKIT_defconfig
@@ -0,0 +1,1241 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.22.9
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y
11CONFIG_BFIN=y
12CONFIG_SEMAPHORE_SLEEPERS=y
13CONFIG_GENERIC_FIND_NEXT_BIT=y
14CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y
16CONFIG_GENERIC_IRQ_PROBE=y
17# CONFIG_GENERIC_TIME is not set
18CONFIG_GENERIC_GPIO=y
19CONFIG_FORCE_MAX_ZONEORDER=14
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_IRQCHIP_DEMUX_GPIO=y
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23
24#
25# Code maturity level options
26#
27CONFIG_EXPERIMENTAL=y
28CONFIG_BROKEN_ON_SMP=y
29CONFIG_INIT_ENV_ARG_LIMIT=32
30
31#
32# General setup
33#
34CONFIG_LOCALVERSION=""
35CONFIG_LOCALVERSION_AUTO=y
36CONFIG_SYSVIPC=y
37# CONFIG_IPC_NS is not set
38CONFIG_SYSVIPC_SYSCTL=y
39# CONFIG_POSIX_MQUEUE is not set
40# CONFIG_BSD_PROCESS_ACCT is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_UTS_NS is not set
43# CONFIG_AUDIT is not set
44CONFIG_IKCONFIG=y
45CONFIG_IKCONFIG_PROC=y
46CONFIG_LOG_BUF_SHIFT=14
47CONFIG_SYSFS_DEPRECATED=y
48# CONFIG_RELAY is not set
49CONFIG_BLK_DEV_INITRD=y
50CONFIG_INITRAMFS_SOURCE=""
51# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52CONFIG_SYSCTL=y
53CONFIG_EMBEDDED=y
54CONFIG_UID16=y
55CONFIG_SYSCTL_SYSCALL=y
56CONFIG_KALLSYMS=y
57# CONFIG_KALLSYMS_EXTRA_PASS is not set
58CONFIG_HOTPLUG=y
59CONFIG_PRINTK=y
60CONFIG_BUG=y
61CONFIG_ELF_CORE=y
62CONFIG_BASE_FULL=y
63CONFIG_FUTEX=y
64CONFIG_ANON_INODES=y
65CONFIG_EPOLL=y
66CONFIG_SIGNALFD=y
67CONFIG_EVENTFD=y
68CONFIG_VM_EVENT_COUNTERS=y
69CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
70# CONFIG_NP2 is not set
71CONFIG_SLAB=y
72# CONFIG_SLUB is not set
73# CONFIG_SLOB is not set
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0
77
78#
79# Loadable module support
80#
81CONFIG_MODULES=y
82CONFIG_MODULE_UNLOAD=y
83# CONFIG_MODULE_FORCE_UNLOAD is not set
84# CONFIG_MODVERSIONS is not set
85# CONFIG_MODULE_SRCVERSION_ALL is not set
86CONFIG_KMOD=y
87
88#
89# Block layer
90#
91CONFIG_BLOCK=y
92# CONFIG_LBD is not set
93# CONFIG_BLK_DEV_IO_TRACE is not set
94# CONFIG_LSF is not set
95
96#
97# IO Schedulers
98#
99CONFIG_IOSCHED_NOOP=y
100CONFIG_IOSCHED_AS=y
101# CONFIG_IOSCHED_DEADLINE is not set
102CONFIG_IOSCHED_CFQ=y
103CONFIG_DEFAULT_AS=y
104# CONFIG_DEFAULT_DEADLINE is not set
105# CONFIG_DEFAULT_CFQ is not set
106# CONFIG_DEFAULT_NOOP is not set
107CONFIG_DEFAULT_IOSCHED="anticipatory"
108# CONFIG_PREEMPT_NONE is not set
109CONFIG_PREEMPT_VOLUNTARY=y
110# CONFIG_PREEMPT is not set
111
112#
113# Blackfin Processor Options
114#
115
116#
117# Processor and Board Settings
118#
119# CONFIG_BF522 is not set
120# CONFIG_BF525 is not set
121CONFIG_BF527=y
122# CONFIG_BF531 is not set
123# CONFIG_BF532 is not set
124# CONFIG_BF533 is not set
125# CONFIG_BF534 is not set
126# CONFIG_BF536 is not set
127# CONFIG_BF537 is not set
128# CONFIG_BF542 is not set
129# CONFIG_BF544 is not set
130# CONFIG_BF548 is not set
131# CONFIG_BF549 is not set
132# CONFIG_BF561 is not set
133CONFIG_BF_REV_0_0=y
134# CONFIG_BF_REV_0_1 is not set
135# CONFIG_BF_REV_0_2 is not set
136# CONFIG_BF_REV_0_3 is not set
137# CONFIG_BF_REV_0_4 is not set
138# CONFIG_BF_REV_0_5 is not set
139# CONFIG_BF_REV_ANY is not set
140# CONFIG_BF_REV_NONE is not set
141CONFIG_BF52x=y
142CONFIG_BFIN_SINGLE_CORE=y
143CONFIG_BFIN527_EZKIT=y
144# CONFIG_BFIN533_EZKIT is not set
145# CONFIG_BFIN533_STAMP is not set
146# CONFIG_BFIN537_STAMP is not set
147# CONFIG_BFIN533_BLUETECHNIX_CM is not set
148# CONFIG_BFIN537_BLUETECHNIX_CM is not set
149# CONFIG_BFIN548_EZKIT is not set
150# CONFIG_BFIN561_BLUETECHNIX_CM is not set
151# CONFIG_BFIN561_EZKIT is not set
152# CONFIG_BFIN561_TEPLA is not set
153# CONFIG_PNAV10 is not set
154# CONFIG_GENERIC_BOARD is not set
155CONFIG_MEM_MT48LC32M16A2TG_75=y
156
157#
158# BF527 Specific Configuration
159#
160
161#
162# Alternative Multiplexing Scheme
163#
164# CONFIG_BF527_SPORT0_PORTF is not set
165CONFIG_BF527_SPORT0_PORTG=y
166CONFIG_BF527_SPORT0_TSCLK_PG10=y
167# CONFIG_BF527_SPORT0_TSCLK_PG14 is not set
168# CONFIG_BF527_UART1_PORTF is not set
169CONFIG_BF527_UART1_PORTG=y
170# CONFIG_BF527_NAND_D_PORTF is not set
171CONFIG_BF527_NAND_D_PORTH=y
172
173#
174# Interrupt Priority Assignment
175#
176
177#
178# Priority
179#
180CONFIG_IRQ_PLL_WAKEUP=7
181CONFIG_IRQ_DMA0_ERROR=7
182CONFIG_IRQ_DMAR0_BLK=7
183CONFIG_IRQ_DMAR1_BLK=7
184CONFIG_IRQ_DMAR0_OVR=7
185CONFIG_IRQ_DMAR1_OVR=7
186CONFIG_IRQ_PPI_ERROR=7
187CONFIG_IRQ_MAC_ERROR=7
188CONFIG_IRQ_SPORT0_ERROR=7
189CONFIG_IRQ_SPORT1_ERROR=7
190CONFIG_IRQ_UART0_ERROR=7
191CONFIG_IRQ_UART1_ERROR=7
192CONFIG_IRQ_RTC=8
193CONFIG_IRQ_PPI=8
194CONFIG_IRQ_SPORT0_RX=9
195CONFIG_IRQ_SPORT0_TX=9
196CONFIG_IRQ_SPORT1_RX=9
197CONFIG_IRQ_SPORT1_TX=9
198CONFIG_IRQ_TWI=10
199CONFIG_IRQ_SPI=10
200CONFIG_IRQ_UART0_RX=10
201CONFIG_IRQ_UART0_TX=10
202CONFIG_IRQ_UART1_RX=10
203CONFIG_IRQ_UART1_TX=10
204CONFIG_IRQ_OPTSEC=11
205CONFIG_IRQ_CNT=11
206CONFIG_IRQ_MAC_RX=11
207CONFIG_IRQ_PORTH_INTA=11
208CONFIG_IRQ_MAC_TX=11
209CONFIG_IRQ_PORTH_INTB=11
210CONFIG_IRQ_TMR0=12
211CONFIG_IRQ_TMR1=12
212CONFIG_IRQ_TMR2=12
213CONFIG_IRQ_TMR3=12
214CONFIG_IRQ_TMR4=12
215CONFIG_IRQ_TMR5=12
216CONFIG_IRQ_TMR6=12
217CONFIG_IRQ_TMR7=12
218CONFIG_IRQ_PORTG_INTA=12
219CONFIG_IRQ_PORTG_INTB=12
220CONFIG_IRQ_MEM_DMA0=13
221CONFIG_IRQ_MEM_DMA1=13
222CONFIG_IRQ_WATCH=13
223CONFIG_IRQ_PORTF_INTA=13
224CONFIG_IRQ_PORTF_INTB=13
225CONFIG_IRQ_SPI_ERROR=7
226CONFIG_IRQ_NFC_ERROR=7
227CONFIG_IRQ_HDMA_ERROR=7
228CONFIG_IRQ_HDMA=7
229CONFIG_IRQ_USB_EINT=10
230CONFIG_IRQ_USB_INT0=11
231CONFIG_IRQ_USB_INT1=11
232CONFIG_IRQ_USB_INT2=11
233CONFIG_IRQ_USB_DMA=11
234
235#
236# Board customizations
237#
238# CONFIG_CMDLINE_BOOL is not set
239
240#
241# Clock/PLL Setup
242#
243CONFIG_CLKIN_HZ=25000000
244# CONFIG_BFIN_KERNEL_CLOCK is not set
245CONFIG_MAX_VCO_HZ=600000000
246CONFIG_MIN_VCO_HZ=50000000
247CONFIG_MAX_SCLK_HZ=133000000
248CONFIG_MIN_SCLK_HZ=27000000
249
250#
251# Kernel Timer/Scheduler
252#
253# CONFIG_HZ_100 is not set
254CONFIG_HZ_250=y
255# CONFIG_HZ_300 is not set
256# CONFIG_HZ_1000 is not set
257CONFIG_HZ=250
258
259#
260# Memory Setup
261#
262CONFIG_MEM_SIZE=64
263CONFIG_MEM_ADD_WIDTH=10
264CONFIG_BOOT_LOAD=0x1000
265CONFIG_BFIN_SCRATCH_REG_RETN=y
266# CONFIG_BFIN_SCRATCH_REG_RETE is not set
267# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
268
269#
270# Blackfin Kernel Optimizations
271#
272
273#
274# Memory Optimizations
275#
276CONFIG_I_ENTRY_L1=y
277CONFIG_EXCPT_IRQ_SYSC_L1=y
278CONFIG_DO_IRQ_L1=y
279CONFIG_CORE_TIMER_IRQ_L1=y
280CONFIG_IDLE_L1=y
281# CONFIG_SCHEDULE_L1 is not set
282CONFIG_ARITHMETIC_OPS_L1=y
283CONFIG_ACCESS_OK_L1=y
284# CONFIG_MEMSET_L1 is not set
285# CONFIG_MEMCPY_L1 is not set
286# CONFIG_SYS_BFIN_SPINLOCK_L1 is not set
287# CONFIG_IP_CHECKSUM_L1 is not set
288CONFIG_CACHELINE_ALIGNED_L1=y
289# CONFIG_SYSCALL_TAB_L1 is not set
290# CONFIG_CPLB_SWITCH_TAB_L1 is not set
291CONFIG_RAMKERNEL=y
292# CONFIG_ROMKERNEL is not set
293CONFIG_SELECT_MEMORY_MODEL=y
294CONFIG_FLATMEM_MANUAL=y
295# CONFIG_DISCONTIGMEM_MANUAL is not set
296# CONFIG_SPARSEMEM_MANUAL is not set
297CONFIG_FLATMEM=y
298CONFIG_FLAT_NODE_MEM_MAP=y
299# CONFIG_SPARSEMEM_STATIC is not set
300CONFIG_SPLIT_PTLOCK_CPUS=4
301# CONFIG_RESOURCES_64BIT is not set
302CONFIG_ZONE_DMA_FLAG=1
303CONFIG_LARGE_ALLOCS=y
304CONFIG_BFIN_DMA_5XX=y
305# CONFIG_DMA_UNCACHED_2M is not set
306CONFIG_DMA_UNCACHED_1M=y
307# CONFIG_DMA_UNCACHED_NONE is not set
308
309#
310# Cache Support
311#
312CONFIG_BFIN_ICACHE=y
313CONFIG_BFIN_DCACHE=y
314# CONFIG_BFIN_DCACHE_BANKA is not set
315# CONFIG_BFIN_ICACHE_LOCK is not set
316# CONFIG_BFIN_WB is not set
317CONFIG_BFIN_WT=y
318CONFIG_L1_MAX_PIECE=16
319
320#
321# Asynchonous Memory Configuration
322#
323
324#
325# EBIU_AMBCTL Global Control
326#
327CONFIG_C_AMCKEN=y
328CONFIG_C_CDPRIO=y
329# CONFIG_C_AMBEN is not set
330# CONFIG_C_AMBEN_B0 is not set
331# CONFIG_C_AMBEN_B0_B1 is not set
332# CONFIG_C_AMBEN_B0_B1_B2 is not set
333CONFIG_C_AMBEN_ALL=y
334
335#
336# EBIU_AMBCTL Control
337#
338CONFIG_BANK_0=0x7BB0
339CONFIG_BANK_1=0x5554
340CONFIG_BANK_2=0x7BB0
341CONFIG_BANK_3=0xFFC0
342
343#
344# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
345#
346# CONFIG_PCI is not set
347# CONFIG_ARCH_SUPPORTS_MSI is not set
348
349#
350# PCCARD (PCMCIA/CardBus) support
351#
352# CONFIG_PCCARD is not set
353
354#
355# Executable file formats
356#
357CONFIG_BINFMT_ELF_FDPIC=y
358CONFIG_BINFMT_FLAT=y
359CONFIG_BINFMT_ZFLAT=y
360# CONFIG_BINFMT_SHARED_FLAT is not set
361# CONFIG_BINFMT_MISC is not set
362
363#
364# Power management options
365#
366# CONFIG_PM is not set
367
368#
369# Networking
370#
371CONFIG_NET=y
372
373#
374# Networking options
375#
376CONFIG_PACKET=y
377# CONFIG_PACKET_MMAP is not set
378CONFIG_UNIX=y
379CONFIG_XFRM=y
380# CONFIG_XFRM_USER is not set
381# CONFIG_XFRM_SUB_POLICY is not set
382# CONFIG_XFRM_MIGRATE is not set
383# CONFIG_NET_KEY is not set
384CONFIG_INET=y
385# CONFIG_IP_MULTICAST is not set
386# CONFIG_IP_ADVANCED_ROUTER is not set
387CONFIG_IP_FIB_HASH=y
388CONFIG_IP_PNP=y
389# CONFIG_IP_PNP_DHCP is not set
390# CONFIG_IP_PNP_BOOTP is not set
391# CONFIG_IP_PNP_RARP is not set
392# CONFIG_NET_IPIP is not set
393# CONFIG_NET_IPGRE is not set
394# CONFIG_ARPD is not set
395CONFIG_SYN_COOKIES=y
396# CONFIG_INET_AH is not set
397# CONFIG_INET_ESP is not set
398# CONFIG_INET_IPCOMP is not set
399# CONFIG_INET_XFRM_TUNNEL is not set
400# CONFIG_INET_TUNNEL is not set
401CONFIG_INET_XFRM_MODE_TRANSPORT=y
402CONFIG_INET_XFRM_MODE_TUNNEL=y
403CONFIG_INET_XFRM_MODE_BEET=y
404CONFIG_INET_DIAG=y
405CONFIG_INET_TCP_DIAG=y
406# CONFIG_TCP_CONG_ADVANCED is not set
407CONFIG_TCP_CONG_CUBIC=y
408CONFIG_DEFAULT_TCP_CONG="cubic"
409# CONFIG_TCP_MD5SIG is not set
410# CONFIG_IPV6 is not set
411# CONFIG_INET6_XFRM_TUNNEL is not set
412# CONFIG_INET6_TUNNEL is not set
413# CONFIG_NETLABEL is not set
414# CONFIG_NETWORK_SECMARK is not set
415# CONFIG_NETFILTER is not set
416# CONFIG_IP_DCCP is not set
417# CONFIG_IP_SCTP is not set
418# CONFIG_TIPC is not set
419# CONFIG_ATM is not set
420# CONFIG_BRIDGE is not set
421# CONFIG_VLAN_8021Q is not set
422# CONFIG_DECNET is not set
423# CONFIG_LLC2 is not set
424# CONFIG_IPX is not set
425# CONFIG_ATALK is not set
426# CONFIG_X25 is not set
427# CONFIG_LAPB is not set
428# CONFIG_ECONET is not set
429# CONFIG_WAN_ROUTER is not set
430
431#
432# QoS and/or fair queueing
433#
434# CONFIG_NET_SCHED is not set
435
436#
437# Network testing
438#
439# CONFIG_NET_PKTGEN is not set
440# CONFIG_HAMRADIO is not set
441# CONFIG_IRDA is not set
442# CONFIG_BT is not set
443# CONFIG_AF_RXRPC is not set
444
445#
446# Wireless
447#
448# CONFIG_CFG80211 is not set
449# CONFIG_WIRELESS_EXT is not set
450# CONFIG_MAC80211 is not set
451# CONFIG_IEEE80211 is not set
452# CONFIG_RFKILL is not set
453
454#
455# Device Drivers
456#
457
458#
459# Generic Driver Options
460#
461CONFIG_STANDALONE=y
462CONFIG_PREVENT_FIRMWARE_BUILD=y
463# CONFIG_FW_LOADER is not set
464# CONFIG_SYS_HYPERVISOR is not set
465
466#
467# Connector - unified userspace <-> kernelspace linker
468#
469# CONFIG_CONNECTOR is not set
470CONFIG_MTD=y
471# CONFIG_MTD_DEBUG is not set
472# CONFIG_MTD_CONCAT is not set
473CONFIG_MTD_PARTITIONS=y
474# CONFIG_MTD_REDBOOT_PARTS is not set
475# CONFIG_MTD_CMDLINE_PARTS is not set
476
477#
478# User Modules And Translation Layers
479#
480CONFIG_MTD_CHAR=m
481CONFIG_MTD_BLKDEVS=y
482CONFIG_MTD_BLOCK=y
483# CONFIG_FTL is not set
484# CONFIG_NFTL is not set
485# CONFIG_INFTL is not set
486# CONFIG_RFD_FTL is not set
487# CONFIG_SSFDC is not set
488
489#
490# RAM/ROM/Flash chip drivers
491#
492# CONFIG_MTD_CFI is not set
493CONFIG_MTD_JEDECPROBE=m
494CONFIG_MTD_GEN_PROBE=m
495# CONFIG_MTD_CFI_ADV_OPTIONS is not set
496CONFIG_MTD_MAP_BANK_WIDTH_1=y
497CONFIG_MTD_MAP_BANK_WIDTH_2=y
498CONFIG_MTD_MAP_BANK_WIDTH_4=y
499# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
500# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
501# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
502CONFIG_MTD_CFI_I1=y
503CONFIG_MTD_CFI_I2=y
504# CONFIG_MTD_CFI_I4 is not set
505# CONFIG_MTD_CFI_I8 is not set
506# CONFIG_MTD_CFI_INTELEXT is not set
507# CONFIG_MTD_CFI_AMDSTD is not set
508# CONFIG_MTD_CFI_STAA is not set
509CONFIG_MTD_MW320D=m
510CONFIG_MTD_RAM=y
511CONFIG_MTD_ROM=m
512# CONFIG_MTD_ABSENT is not set
513
514#
515# Mapping drivers for chip access
516#
517CONFIG_MTD_COMPLEX_MAPPINGS=y
518# CONFIG_MTD_PHYSMAP is not set
519CONFIG_MTD_BF5xx=m
520CONFIG_BFIN_FLASH_SIZE=0x400000
521CONFIG_EBIU_FLASH_BASE=0x20000000
522# CONFIG_MTD_UCLINUX is not set
523# CONFIG_MTD_PLATRAM is not set
524
525#
526# Self-contained MTD device drivers
527#
528# CONFIG_MTD_DATAFLASH is not set
529# CONFIG_MTD_M25P80 is not set
530# CONFIG_MTD_SLRAM is not set
531# CONFIG_MTD_PHRAM is not set
532# CONFIG_MTD_MTDRAM is not set
533# CONFIG_MTD_BLOCK2MTD is not set
534
535#
536# Disk-On-Chip Device Drivers
537#
538# CONFIG_MTD_DOC2000 is not set
539# CONFIG_MTD_DOC2001 is not set
540# CONFIG_MTD_DOC2001PLUS is not set
541CONFIG_MTD_NAND=m
542# CONFIG_MTD_NAND_VERIFY_WRITE is not set
543# CONFIG_MTD_NAND_ECC_SMC is not set
544# CONFIG_MTD_NAND_MUSEUM_IDS is not set
545CONFIG_MTD_NAND_BFIN=m
546CONFIG_BFIN_NAND_BASE=0x20212000
547CONFIG_BFIN_NAND_CLE=2
548CONFIG_BFIN_NAND_ALE=1
549CONFIG_BFIN_NAND_READY=3
550CONFIG_MTD_NAND_IDS=m
551# CONFIG_MTD_NAND_DISKONCHIP is not set
552# CONFIG_MTD_NAND_NANDSIM is not set
553# CONFIG_MTD_NAND_PLATFORM is not set
554# CONFIG_MTD_ONENAND is not set
555
556#
557# UBI - Unsorted block images
558#
559# CONFIG_MTD_UBI is not set
560
561#
562# Parallel port support
563#
564# CONFIG_PARPORT is not set
565
566#
567# Plug and Play support
568#
569# CONFIG_PNPACPI is not set
570
571#
572# Block devices
573#
574# CONFIG_BLK_DEV_COW_COMMON is not set
575# CONFIG_BLK_DEV_LOOP is not set
576# CONFIG_BLK_DEV_NBD is not set
577CONFIG_BLK_DEV_RAM=y
578CONFIG_BLK_DEV_RAM_COUNT=16
579CONFIG_BLK_DEV_RAM_SIZE=4096
580CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
581# CONFIG_CDROM_PKTCDVD is not set
582# CONFIG_ATA_OVER_ETH is not set
583
584#
585# Misc devices
586#
587# CONFIG_IDE is not set
588
589#
590# SCSI device support
591#
592# CONFIG_RAID_ATTRS is not set
593# CONFIG_SCSI is not set
594# CONFIG_SCSI_NETLINK is not set
595# CONFIG_ATA is not set
596
597#
598# Multi-device support (RAID and LVM)
599#
600# CONFIG_MD is not set
601
602#
603# Network device support
604#
605CONFIG_NETDEVICES=y
606# CONFIG_DUMMY is not set
607# CONFIG_BONDING is not set
608# CONFIG_EQUALIZER is not set
609# CONFIG_TUN is not set
610CONFIG_PHYLIB=y
611
612#
613# MII PHY device drivers
614#
615# CONFIG_MARVELL_PHY is not set
616# CONFIG_DAVICOM_PHY is not set
617# CONFIG_QSEMI_PHY is not set
618# CONFIG_LXT_PHY is not set
619# CONFIG_CICADA_PHY is not set
620# CONFIG_VITESSE_PHY is not set
621# CONFIG_SMSC_PHY is not set
622# CONFIG_BROADCOM_PHY is not set
623# CONFIG_FIXED_PHY is not set
624
625#
626# Ethernet (10 or 100Mbit)
627#
628CONFIG_NET_ETHERNET=y
629CONFIG_MII=y
630# CONFIG_SMC91X is not set
631CONFIG_BFIN_MAC=y
632CONFIG_BFIN_MAC_USE_L1=y
633CONFIG_BFIN_TX_DESC_NUM=10
634CONFIG_BFIN_RX_DESC_NUM=20
635CONFIG_BFIN_MAC_RMII=y
636# CONFIG_SMSC911X is not set
637# CONFIG_DM9000 is not set
638CONFIG_NETDEV_1000=y
639CONFIG_NETDEV_10000=y
640
641#
642# Wireless LAN
643#
644# CONFIG_WLAN_PRE80211 is not set
645# CONFIG_WLAN_80211 is not set
646# CONFIG_WAN is not set
647# CONFIG_PPP is not set
648# CONFIG_SLIP is not set
649# CONFIG_SHAPER is not set
650# CONFIG_NETCONSOLE is not set
651# CONFIG_NETPOLL is not set
652# CONFIG_NET_POLL_CONTROLLER is not set
653
654#
655# ISDN subsystem
656#
657# CONFIG_ISDN is not set
658
659#
660# Telephony Support
661#
662# CONFIG_PHONE is not set
663
664#
665# Input device support
666#
667CONFIG_INPUT=y
668# CONFIG_INPUT_FF_MEMLESS is not set
669# CONFIG_INPUT_POLLDEV is not set
670
671#
672# Userland interfaces
673#
674# CONFIG_INPUT_MOUSEDEV is not set
675# CONFIG_INPUT_JOYDEV is not set
676# CONFIG_INPUT_TSDEV is not set
677# CONFIG_INPUT_EVDEV is not set
678# CONFIG_INPUT_EVBUG is not set
679
680#
681# Input Device Drivers
682#
683# CONFIG_INPUT_KEYBOARD is not set
684# CONFIG_INPUT_MOUSE is not set
685# CONFIG_INPUT_JOYSTICK is not set
686# CONFIG_INPUT_TABLET is not set
687# CONFIG_INPUT_TOUCHSCREEN is not set
688CONFIG_INPUT_MISC=y
689# CONFIG_INPUT_ATI_REMOTE is not set
690# CONFIG_INPUT_ATI_REMOTE2 is not set
691# CONFIG_INPUT_KEYSPAN_REMOTE is not set
692# CONFIG_INPUT_POWERMATE is not set
693# CONFIG_INPUT_YEALINK is not set
694# CONFIG_INPUT_UINPUT is not set
695# CONFIG_BF53X_PFBUTTONS is not set
696# CONFIG_TWI_KEYPAD is not set
697
698#
699# Hardware I/O ports
700#
701# CONFIG_SERIO is not set
702# CONFIG_GAMEPORT is not set
703
704#
705# Character devices
706#
707# CONFIG_AD9960 is not set
708# CONFIG_SPI_ADC_BF533 is not set
709# CONFIG_BF5xx_PFLAGS is not set
710# CONFIG_BF5xx_PPIFCD is not set
711# CONFIG_BF5xx_TIMERS is not set
712# CONFIG_BF5xx_PPI is not set
713# CONFIG_BFIN_SPORT is not set
714# CONFIG_BFIN_TIMER_LATENCY is not set
715# CONFIG_TWI_LCD is not set
716# CONFIG_AD5304 is not set
717# CONFIG_BF5xx_TEA5764 is not set
718# CONFIG_BF5xx_FBDMA is not set
719# CONFIG_VT is not set
720# CONFIG_SERIAL_NONSTANDARD is not set
721
722#
723# Serial drivers
724#
725# CONFIG_SERIAL_8250 is not set
726
727#
728# Non-8250 serial port support
729#
730CONFIG_SERIAL_BFIN=y
731CONFIG_SERIAL_BFIN_CONSOLE=y
732# CONFIG_SERIAL_BFIN_DMA is not set
733CONFIG_SERIAL_BFIN_PIO=y
734# CONFIG_SERIAL_BFIN_UART0 is not set
735CONFIG_SERIAL_BFIN_UART1=y
736# CONFIG_BFIN_UART1_CTSRTS is not set
737CONFIG_SERIAL_CORE=y
738CONFIG_SERIAL_CORE_CONSOLE=y
739# CONFIG_SERIAL_BFIN_SPORT is not set
740CONFIG_UNIX98_PTYS=y
741# CONFIG_LEGACY_PTYS is not set
742
743#
744# CAN, the car bus and industrial fieldbus
745#
746# CONFIG_CAN4LINUX is not set
747
748#
749# IPMI
750#
751# CONFIG_IPMI_HANDLER is not set
752CONFIG_WATCHDOG=y
753# CONFIG_WATCHDOG_NOWAYOUT is not set
754
755#
756# Watchdog Device Drivers
757#
758# CONFIG_SOFT_WATCHDOG is not set
759CONFIG_BFIN_WDT=y
760CONFIG_HW_RANDOM=y
761# CONFIG_GEN_RTC is not set
762# CONFIG_R3964 is not set
763# CONFIG_RAW_DRIVER is not set
764
765#
766# TPM devices
767#
768# CONFIG_TCG_TPM is not set
769CONFIG_I2C=y
770CONFIG_I2C_BOARDINFO=y
771CONFIG_I2C_CHARDEV=m
772
773#
774# I2C Algorithms
775#
776# CONFIG_I2C_ALGOBIT is not set
777# CONFIG_I2C_ALGOPCF is not set
778# CONFIG_I2C_ALGOPCA is not set
779
780#
781# I2C Hardware Bus support
782#
783# CONFIG_I2C_BLACKFIN_GPIO is not set
784CONFIG_I2C_BLACKFIN_TWI=m
785CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
786# CONFIG_I2C_GPIO is not set
787# CONFIG_I2C_OCORES is not set
788# CONFIG_I2C_PARPORT_LIGHT is not set
789# CONFIG_I2C_SIMTEC is not set
790# CONFIG_I2C_STUB is not set
791
792#
793# Miscellaneous I2C Chip support
794#
795# CONFIG_SENSORS_DS1337 is not set
796# CONFIG_SENSORS_DS1374 is not set
797# CONFIG_SENSORS_AD5252 is not set
798# CONFIG_SENSORS_EEPROM is not set
799# CONFIG_SENSORS_PCF8574 is not set
800# CONFIG_SENSORS_PCF8575 is not set
801# CONFIG_SENSORS_PCA9543 is not set
802# CONFIG_SENSORS_PCA9539 is not set
803# CONFIG_SENSORS_PCF8591 is not set
804# CONFIG_SENSORS_MAX6875 is not set
805# CONFIG_I2C_DEBUG_CORE is not set
806# CONFIG_I2C_DEBUG_ALGO is not set
807# CONFIG_I2C_DEBUG_BUS is not set
808# CONFIG_I2C_DEBUG_CHIP is not set
809
810#
811# SPI support
812#
813CONFIG_SPI=y
814CONFIG_SPI_MASTER=y
815
816#
817# SPI Master Controller Drivers
818#
819CONFIG_SPI_BFIN=y
820# CONFIG_SPI_BITBANG is not set
821
822#
823# SPI Protocol Masters
824#
825# CONFIG_SPI_AT25 is not set
826# CONFIG_SPI_SPIDEV is not set
827
828#
829# Dallas's 1-wire bus
830#
831# CONFIG_W1 is not set
832CONFIG_HWMON=y
833# CONFIG_HWMON_VID is not set
834# CONFIG_SENSORS_ABITUGURU is not set
835# CONFIG_SENSORS_AD7418 is not set
836# CONFIG_SENSORS_ADM1021 is not set
837# CONFIG_SENSORS_ADM1025 is not set
838# CONFIG_SENSORS_ADM1026 is not set
839# CONFIG_SENSORS_ADM1029 is not set
840# CONFIG_SENSORS_ADM1031 is not set
841# CONFIG_SENSORS_ADM9240 is not set
842# CONFIG_SENSORS_ASB100 is not set
843# CONFIG_SENSORS_ATXP1 is not set
844# CONFIG_SENSORS_DS1621 is not set
845# CONFIG_SENSORS_F71805F is not set
846# CONFIG_SENSORS_FSCHER is not set
847# CONFIG_SENSORS_FSCPOS is not set
848# CONFIG_SENSORS_GL518SM is not set
849# CONFIG_SENSORS_GL520SM is not set
850# CONFIG_SENSORS_IT87 is not set
851# CONFIG_SENSORS_LM63 is not set
852# CONFIG_SENSORS_LM70 is not set
853# CONFIG_SENSORS_LM75 is not set
854# CONFIG_SENSORS_LM77 is not set
855# CONFIG_SENSORS_LM78 is not set
856# CONFIG_SENSORS_LM80 is not set
857# CONFIG_SENSORS_LM83 is not set
858# CONFIG_SENSORS_LM85 is not set
859# CONFIG_SENSORS_LM87 is not set
860# CONFIG_SENSORS_LM90 is not set
861# CONFIG_SENSORS_LM92 is not set
862# CONFIG_SENSORS_MAX1619 is not set
863# CONFIG_SENSORS_MAX6650 is not set
864# CONFIG_SENSORS_PC87360 is not set
865# CONFIG_SENSORS_PC87427 is not set
866# CONFIG_SENSORS_SMSC47M1 is not set
867# CONFIG_SENSORS_SMSC47M192 is not set
868# CONFIG_SENSORS_SMSC47B397 is not set
869# CONFIG_SENSORS_VT1211 is not set
870# CONFIG_SENSORS_W83781D is not set
871# CONFIG_SENSORS_W83791D is not set
872# CONFIG_SENSORS_W83792D is not set
873# CONFIG_SENSORS_W83793 is not set
874# CONFIG_SENSORS_W83L785TS is not set
875# CONFIG_SENSORS_W83627HF is not set
876# CONFIG_SENSORS_W83627EHF is not set
877# CONFIG_HWMON_DEBUG_CHIP is not set
878
879#
880# Multifunction device drivers
881#
882# CONFIG_MFD_SM501 is not set
883
884#
885# Multimedia devices
886#
887# CONFIG_VIDEO_DEV is not set
888# CONFIG_DVB_CORE is not set
889# CONFIG_DAB is not set
890
891#
892# Graphics support
893#
894# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
895
896#
897# Display device support
898#
899# CONFIG_DISPLAY_SUPPORT is not set
900# CONFIG_VGASTATE is not set
901# CONFIG_FB is not set
902
903#
904# Sound
905#
906# CONFIG_SOUND is not set
907
908#
909# HID Devices
910#
911CONFIG_HID=y
912# CONFIG_HID_DEBUG is not set
913
914#
915# USB support
916#
917CONFIG_USB_ARCH_HAS_HCD=y
918# CONFIG_USB_ARCH_HAS_OHCI is not set
919# CONFIG_USB_ARCH_HAS_EHCI is not set
920# CONFIG_USB is not set
921
922#
923# Enable Host or Gadget support to see Inventra options
924#
925
926#
927# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
928#
929
930#
931# USB Gadget Support
932#
933# CONFIG_USB_GADGET is not set
934# CONFIG_MMC is not set
935
936#
937# LED devices
938#
939# CONFIG_NEW_LEDS is not set
940
941#
942# LED drivers
943#
944
945#
946# LED Triggers
947#
948
949#
950# InfiniBand support
951#
952
953#
954# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
955#
956
957#
958# Real Time Clock
959#
960CONFIG_RTC_LIB=y
961CONFIG_RTC_CLASS=y
962CONFIG_RTC_HCTOSYS=y
963CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
964# CONFIG_RTC_DEBUG is not set
965
966#
967# RTC interfaces
968#
969CONFIG_RTC_INTF_SYSFS=y
970CONFIG_RTC_INTF_PROC=y
971CONFIG_RTC_INTF_DEV=y
972# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
973# CONFIG_RTC_DRV_TEST is not set
974
975#
976# I2C RTC drivers
977#
978# CONFIG_RTC_DRV_DS1307 is not set
979# CONFIG_RTC_DRV_DS1672 is not set
980# CONFIG_RTC_DRV_MAX6900 is not set
981# CONFIG_RTC_DRV_RS5C372 is not set
982# CONFIG_RTC_DRV_ISL1208 is not set
983# CONFIG_RTC_DRV_X1205 is not set
984# CONFIG_RTC_DRV_PCF8563 is not set
985# CONFIG_RTC_DRV_PCF8583 is not set
986
987#
988# SPI RTC drivers
989#
990# CONFIG_RTC_DRV_RS5C348 is not set
991# CONFIG_RTC_DRV_MAX6902 is not set
992
993#
994# Platform RTC drivers
995#
996# CONFIG_RTC_DRV_DS1553 is not set
997# CONFIG_RTC_DRV_DS1742 is not set
998# CONFIG_RTC_DRV_M48T86 is not set
999# CONFIG_RTC_DRV_V3020 is not set
1000
1001#
1002# on-CPU RTC drivers
1003#
1004CONFIG_RTC_DRV_BFIN=y
1005
1006#
1007# DMA Engine support
1008#
1009# CONFIG_DMA_ENGINE is not set
1010
1011#
1012# DMA Clients
1013#
1014
1015#
1016# DMA Devices
1017#
1018
1019#
1020# PBX support
1021#
1022# CONFIG_PBX is not set
1023
1024#
1025# File systems
1026#
1027# CONFIG_EXT2_FS is not set
1028# CONFIG_EXT3_FS is not set
1029# CONFIG_EXT4DEV_FS is not set
1030# CONFIG_REISERFS_FS is not set
1031# CONFIG_JFS_FS is not set
1032# CONFIG_FS_POSIX_ACL is not set
1033# CONFIG_XFS_FS is not set
1034# CONFIG_GFS2_FS is not set
1035# CONFIG_OCFS2_FS is not set
1036# CONFIG_MINIX_FS is not set
1037# CONFIG_ROMFS_FS is not set
1038CONFIG_INOTIFY=y
1039CONFIG_INOTIFY_USER=y
1040# CONFIG_QUOTA is not set
1041# CONFIG_DNOTIFY is not set
1042# CONFIG_AUTOFS_FS is not set
1043# CONFIG_AUTOFS4_FS is not set
1044# CONFIG_FUSE_FS is not set
1045
1046#
1047# CD-ROM/DVD Filesystems
1048#
1049# CONFIG_ISO9660_FS is not set
1050# CONFIG_UDF_FS is not set
1051
1052#
1053# DOS/FAT/NT Filesystems
1054#
1055# CONFIG_MSDOS_FS is not set
1056# CONFIG_VFAT_FS is not set
1057# CONFIG_NTFS_FS is not set
1058
1059#
1060# Pseudo filesystems
1061#
1062CONFIG_PROC_FS=y
1063CONFIG_PROC_SYSCTL=y
1064CONFIG_SYSFS=y
1065# CONFIG_TMPFS is not set
1066# CONFIG_HUGETLB_PAGE is not set
1067CONFIG_RAMFS=y
1068# CONFIG_CONFIGFS_FS is not set
1069
1070#
1071# Miscellaneous filesystems
1072#
1073# CONFIG_ADFS_FS is not set
1074# CONFIG_AFFS_FS is not set
1075# CONFIG_HFS_FS is not set
1076# CONFIG_HFSPLUS_FS is not set
1077# CONFIG_BEFS_FS is not set
1078# CONFIG_BFS_FS is not set
1079# CONFIG_EFS_FS is not set
1080CONFIG_YAFFS_FS=m
1081CONFIG_YAFFS_YAFFS1=y
1082# CONFIG_YAFFS_DOES_ECC is not set
1083CONFIG_YAFFS_YAFFS2=y
1084CONFIG_YAFFS_AUTO_YAFFS2=y
1085# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1086CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1087# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1088# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1089CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1090CONFIG_JFFS2_FS=m
1091CONFIG_JFFS2_FS_DEBUG=0
1092CONFIG_JFFS2_FS_WRITEBUFFER=y
1093# CONFIG_JFFS2_SUMMARY is not set
1094# CONFIG_JFFS2_FS_XATTR is not set
1095# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1096CONFIG_JFFS2_ZLIB=y
1097CONFIG_JFFS2_RTIME=y
1098# CONFIG_JFFS2_RUBIN is not set
1099# CONFIG_CRAMFS is not set
1100# CONFIG_VXFS_FS is not set
1101# CONFIG_HPFS_FS is not set
1102# CONFIG_QNX4FS_FS is not set
1103# CONFIG_SYSV_FS is not set
1104# CONFIG_UFS_FS is not set
1105
1106#
1107# Network File Systems
1108#
1109CONFIG_NFS_FS=m
1110CONFIG_NFS_V3=y
1111# CONFIG_NFS_V3_ACL is not set
1112# CONFIG_NFS_V4 is not set
1113# CONFIG_NFS_DIRECTIO is not set
1114# CONFIG_NFSD is not set
1115CONFIG_LOCKD=m
1116CONFIG_LOCKD_V4=y
1117CONFIG_NFS_COMMON=y
1118CONFIG_SUNRPC=m
1119# CONFIG_SUNRPC_BIND34 is not set
1120# CONFIG_RPCSEC_GSS_KRB5 is not set
1121# CONFIG_RPCSEC_GSS_SPKM3 is not set
1122CONFIG_SMB_FS=m
1123# CONFIG_SMB_NLS_DEFAULT is not set
1124# CONFIG_CIFS is not set
1125# CONFIG_NCP_FS is not set
1126# CONFIG_CODA_FS is not set
1127# CONFIG_AFS_FS is not set
1128# CONFIG_9P_FS is not set
1129
1130#
1131# Partition Types
1132#
1133# CONFIG_PARTITION_ADVANCED is not set
1134CONFIG_MSDOS_PARTITION=y
1135
1136#
1137# Native Language Support
1138#
1139CONFIG_NLS=m
1140CONFIG_NLS_DEFAULT="iso8859-1"
1141# CONFIG_NLS_CODEPAGE_437 is not set
1142# CONFIG_NLS_CODEPAGE_737 is not set
1143# CONFIG_NLS_CODEPAGE_775 is not set
1144# CONFIG_NLS_CODEPAGE_850 is not set
1145# CONFIG_NLS_CODEPAGE_852 is not set
1146# CONFIG_NLS_CODEPAGE_855 is not set
1147# CONFIG_NLS_CODEPAGE_857 is not set
1148# CONFIG_NLS_CODEPAGE_860 is not set
1149# CONFIG_NLS_CODEPAGE_861 is not set
1150# CONFIG_NLS_CODEPAGE_862 is not set
1151# CONFIG_NLS_CODEPAGE_863 is not set
1152# CONFIG_NLS_CODEPAGE_864 is not set
1153# CONFIG_NLS_CODEPAGE_865 is not set
1154# CONFIG_NLS_CODEPAGE_866 is not set
1155# CONFIG_NLS_CODEPAGE_869 is not set
1156# CONFIG_NLS_CODEPAGE_936 is not set
1157# CONFIG_NLS_CODEPAGE_950 is not set
1158# CONFIG_NLS_CODEPAGE_932 is not set
1159# CONFIG_NLS_CODEPAGE_949 is not set
1160# CONFIG_NLS_CODEPAGE_874 is not set
1161# CONFIG_NLS_ISO8859_8 is not set
1162# CONFIG_NLS_CODEPAGE_1250 is not set
1163# CONFIG_NLS_CODEPAGE_1251 is not set
1164# CONFIG_NLS_ASCII is not set
1165# CONFIG_NLS_ISO8859_1 is not set
1166# CONFIG_NLS_ISO8859_2 is not set
1167# CONFIG_NLS_ISO8859_3 is not set
1168# CONFIG_NLS_ISO8859_4 is not set
1169# CONFIG_NLS_ISO8859_5 is not set
1170# CONFIG_NLS_ISO8859_6 is not set
1171# CONFIG_NLS_ISO8859_7 is not set
1172# CONFIG_NLS_ISO8859_9 is not set
1173# CONFIG_NLS_ISO8859_13 is not set
1174# CONFIG_NLS_ISO8859_14 is not set
1175# CONFIG_NLS_ISO8859_15 is not set
1176# CONFIG_NLS_KOI8_R is not set
1177# CONFIG_NLS_KOI8_U is not set
1178# CONFIG_NLS_UTF8 is not set
1179
1180#
1181# Distributed Lock Manager
1182#
1183# CONFIG_DLM is not set
1184
1185#
1186# Profiling support
1187#
1188# CONFIG_PROFILING is not set
1189
1190#
1191# Kernel hacking
1192#
1193# CONFIG_PRINTK_TIME is not set
1194CONFIG_ENABLE_MUST_CHECK=y
1195CONFIG_MAGIC_SYSRQ=y
1196# CONFIG_UNUSED_SYMBOLS is not set
1197CONFIG_DEBUG_FS=y
1198# CONFIG_HEADERS_CHECK is not set
1199# CONFIG_DEBUG_KERNEL is not set
1200# CONFIG_DEBUG_BUGVERBOSE is not set
1201CONFIG_DEBUG_MMRS=y
1202CONFIG_DEBUG_HUNT_FOR_ZERO=y
1203CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1204CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1205# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1206# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1207CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1208# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1209# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1210CONFIG_EARLY_PRINTK=y
1211CONFIG_CPLB_INFO=y
1212CONFIG_ACCESS_CHECK=y
1213
1214#
1215# Security options
1216#
1217# CONFIG_KEYS is not set
1218CONFIG_SECURITY=y
1219# CONFIG_SECURITY_NETWORK is not set
1220CONFIG_SECURITY_CAPABILITIES=y
1221
1222#
1223# Cryptographic options
1224#
1225# CONFIG_CRYPTO is not set
1226
1227#
1228# Library routines
1229#
1230CONFIG_BITREVERSE=y
1231# CONFIG_CRC_CCITT is not set
1232# CONFIG_CRC16 is not set
1233# CONFIG_CRC_ITU_T is not set
1234CONFIG_CRC32=y
1235# CONFIG_LIBCRC32C is not set
1236CONFIG_ZLIB_INFLATE=y
1237CONFIG_ZLIB_DEFLATE=m
1238CONFIG_PLIST=y
1239CONFIG_HAS_IOMEM=y
1240CONFIG_HAS_IOPORT=y
1241CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig b/arch/blackfin/configs/BF548-EZKIT_defconfig
index e80f3d59c283..d8569888a1c8 100644
--- a/arch/blackfin/configs/BF548-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF548-EZKIT_defconfig
@@ -809,7 +809,14 @@ CONFIG_UNIX98_PTYS=y
809# IPMI 809# IPMI
810# 810#
811# CONFIG_IPMI_HANDLER is not set 811# CONFIG_IPMI_HANDLER is not set
812# CONFIG_WATCHDOG is not set 812CONFIG_WATCHDOG=y
813# CONFIG_WATCHDOG_NOWAYOUT is not set
814
815#
816# Watchdog Device Drivers
817#
818# CONFIG_SOFT_WATCHDOG is not set
819CONFIG_BFIN_WDT=y
813CONFIG_HW_RANDOM=y 820CONFIG_HW_RANDOM=y
814# CONFIG_GEN_RTC is not set 821# CONFIG_GEN_RTC is not set
815# CONFIG_R3964 is not set 822# CONFIG_R3964 is not set
diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile
index 8aeb6066b19b..8a4cfb293b27 100644
--- a/arch/blackfin/kernel/Makefile
+++ b/arch/blackfin/kernel/Makefile
@@ -9,6 +9,7 @@ obj-y := \
9 sys_bfin.o time.o traps.o irqchip.o dma-mapping.o flat.o \ 9 sys_bfin.o time.o traps.o irqchip.o dma-mapping.o flat.o \
10 fixed_code.o cplbinit.o cacheinit.o reboot.o bfin_gpio.o 10 fixed_code.o cplbinit.o cacheinit.o reboot.o bfin_gpio.o
11 11
12obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o
12obj-$(CONFIG_MODULES) += module.o 13obj-$(CONFIG_MODULES) += module.o
13obj-$(CONFIG_BFIN_DMA_5XX) += bfin_dma_5xx.o 14obj-$(CONFIG_BFIN_DMA_5XX) += bfin_dma_5xx.o
14obj-$(CONFIG_DUAL_CORE_TEST_MODULE) += dualcore_test.o 15obj-$(CONFIG_DUAL_CORE_TEST_MODULE) += dualcore_test.o
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index e19164fb4cd1..503eef4c7fec 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -420,6 +420,32 @@ unsigned short get_dma_curr_ycount(unsigned int channel)
420} 420}
421EXPORT_SYMBOL(get_dma_curr_ycount); 421EXPORT_SYMBOL(get_dma_curr_ycount);
422 422
423unsigned long get_dma_next_desc_ptr(unsigned int channel)
424{
425 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
426 && channel < MAX_BLACKFIN_DMA_CHANNEL));
427
428 return dma_ch[channel].regs->next_desc_ptr;
429}
430EXPORT_SYMBOL(get_dma_next_desc_ptr);
431
432unsigned long get_dma_curr_desc_ptr(unsigned int channel)
433{
434 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
435 && channel < MAX_BLACKFIN_DMA_CHANNEL));
436
437 return dma_ch[channel].regs->curr_desc_ptr;
438}
439
440unsigned long get_dma_curr_addr(unsigned int channel)
441{
442 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
443 && channel < MAX_BLACKFIN_DMA_CHANNEL));
444
445 return dma_ch[channel].regs->curr_addr_ptr;
446}
447EXPORT_SYMBOL(get_dma_curr_addr);
448
423static void *__dma_memcpy(void *dest, const void *src, size_t size) 449static void *__dma_memcpy(void *dest, const void *src, size_t size)
424{ 450{
425 int direction; /* 1 - address decrease, 0 - address increase */ 451 int direction; /* 1 - address decrease, 0 - address increase */
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 3fe0cd49e8db..ce85d4bf34ca 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -124,7 +124,7 @@ static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
124}; 124};
125#endif 125#endif
126 126
127#ifdef BF537_FAMILY 127#if defined(BF527_FAMILY) || defined(BF537_FAMILY)
128static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 128static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
129 (struct gpio_port_t *) PORTFIO, 129 (struct gpio_port_t *) PORTFIO,
130 (struct gpio_port_t *) PORTGIO, 130 (struct gpio_port_t *) PORTGIO,
@@ -139,6 +139,21 @@ static unsigned short *port_fer[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
139 139
140#endif 140#endif
141 141
142#ifdef BF527_FAMILY
143static unsigned short *port_mux[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
144 (unsigned short *) PORTF_MUX,
145 (unsigned short *) PORTG_MUX,
146 (unsigned short *) PORTH_MUX,
147};
148
149static const
150u8 pmux_offset[][16] =
151 {{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */
152 { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */
153 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */
154 };
155#endif
156
142#ifdef BF561_FAMILY 157#ifdef BF561_FAMILY
143static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 158static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
144 (struct gpio_port_t *) FIO0_FLAG_D, 159 (struct gpio_port_t *) FIO0_FLAG_D,
@@ -186,6 +201,10 @@ static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG_INTB
186static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX}; 201static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX};
187#endif 202#endif
188 203
204#ifdef BF527_FAMILY
205static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB};
206#endif
207
189#ifdef BF561_FAMILY 208#ifdef BF561_FAMILY
190static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB}; 209static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB};
191#endif 210#endif
@@ -238,7 +257,7 @@ static int cmp_label(unsigned short ident, const char *label)
238 return -EINVAL; 257 return -EINVAL;
239} 258}
240 259
241#ifdef BF537_FAMILY 260#if defined(BF527_FAMILY) || defined(BF537_FAMILY)
242static void port_setup(unsigned short gpio, unsigned short usage) 261static void port_setup(unsigned short gpio, unsigned short usage)
243{ 262{
244 if (!check_gpio(gpio)) { 263 if (!check_gpio(gpio)) {
@@ -354,6 +373,18 @@ inline u16 get_portmux(unsigned short portno)
354 373
355 return (pmux >> (2 * gpio_sub_n(portno)) & 0x3); 374 return (pmux >> (2 * gpio_sub_n(portno)) & 0x3);
356} 375}
376#elif defined(BF527_FAMILY)
377inline void portmux_setup(unsigned short portno, unsigned short function)
378{
379 u16 pmux, ident = P_IDENT(portno);
380 u8 offset = pmux_offset[gpio_bank(ident)][gpio_sub_n(ident)];
381
382 pmux = *port_mux[gpio_bank(ident)];
383 pmux &= ~(3 << offset);
384 pmux |= (function & 3) << offset;
385 *port_mux[gpio_bank(ident)] = pmux;
386 SSYNC();
387}
357#else 388#else
358# define portmux_setup(...) do { } while (0) 389# define portmux_setup(...) do { } while (0)
359#endif 390#endif
diff --git a/arch/blackfin/kernel/gptimers.c b/arch/blackfin/kernel/gptimers.c
new file mode 100644
index 000000000000..cb7ba9bfc79c
--- /dev/null
+++ b/arch/blackfin/kernel/gptimers.c
@@ -0,0 +1,250 @@
1/*
2 * bfin_gptimers.c - derived from bf53x_timers.c
3 * Driver for General Purpose Timer functions on the Blackfin processor
4 *
5 * Copyright (C) 2005 John DeHority
6 * Copyright (C) 2006 Hella Aglaia GmbH (awe@aglaia-gmbh.de)
7 *
8 * Licensed under the GPLv2.
9 */
10
11#include <linux/kernel.h>
12#include <linux/module.h>
13
14#include <asm/io.h>
15#include <asm/blackfin.h>
16#include <asm/gptimers.h>
17
18#ifdef DEBUG
19# define tassert(expr)
20#else
21# define tassert(expr) \
22 if (!(expr)) \
23 printk(KERN_DEBUG "%s:%s:%i: Assertion failed: " #expr "\n", \
24 __FILE__, __func__, __LINE__);
25#endif
26
27#define BFIN_TIMER_NUM_GROUP (BFIN_TIMER_OCTET(MAX_BLACKFIN_GPTIMERS - 1) + 1)
28
29typedef struct {
30 uint16_t config;
31 uint16_t __pad;
32 uint32_t counter;
33 uint32_t period;
34 uint32_t width;
35} GPTIMER_timer_regs;
36
37typedef struct {
38 uint16_t enable;
39 uint16_t __pad0;
40 uint16_t disable;
41 uint16_t __pad1;
42 uint32_t status;
43} GPTIMER_group_regs;
44
45static volatile GPTIMER_timer_regs *const timer_regs[MAX_BLACKFIN_GPTIMERS] =
46{
47 (GPTIMER_timer_regs *)TIMER0_CONFIG,
48 (GPTIMER_timer_regs *)TIMER1_CONFIG,
49 (GPTIMER_timer_regs *)TIMER2_CONFIG,
50#if (MAX_BLACKFIN_GPTIMERS > 3)
51 (GPTIMER_timer_regs *)TIMER3_CONFIG,
52 (GPTIMER_timer_regs *)TIMER4_CONFIG,
53 (GPTIMER_timer_regs *)TIMER5_CONFIG,
54 (GPTIMER_timer_regs *)TIMER6_CONFIG,
55 (GPTIMER_timer_regs *)TIMER7_CONFIG,
56#endif
57#if (MAX_BLACKFIN_GPTIMERS > 8)
58 (GPTIMER_timer_regs *)TIMER8_CONFIG,
59 (GPTIMER_timer_regs *)TIMER9_CONFIG,
60 (GPTIMER_timer_regs *)TIMER10_CONFIG,
61 (GPTIMER_timer_regs *)TIMER11_CONFIG,
62#endif
63};
64
65static volatile GPTIMER_group_regs *const group_regs[BFIN_TIMER_NUM_GROUP] =
66{
67 (GPTIMER_group_regs *)TIMER0_GROUP_REG,
68#if (MAX_BLACKFIN_GPTIMERS > 8)
69 (GPTIMER_group_regs *)TIMER8_GROUP_REG,
70#endif
71};
72
73static uint32_t const dis_mask[MAX_BLACKFIN_GPTIMERS] =
74{
75 TIMER_STATUS_TRUN0,
76 TIMER_STATUS_TRUN1,
77 TIMER_STATUS_TRUN2,
78#if (MAX_BLACKFIN_GPTIMERS > 3)
79 TIMER_STATUS_TRUN3,
80 TIMER_STATUS_TRUN4,
81 TIMER_STATUS_TRUN5,
82 TIMER_STATUS_TRUN6,
83 TIMER_STATUS_TRUN7,
84#endif
85#if (MAX_BLACKFIN_GPTIMERS > 8)
86 TIMER_STATUS_TRUN8,
87 TIMER_STATUS_TRUN9,
88 TIMER_STATUS_TRUN10,
89 TIMER_STATUS_TRUN11,
90#endif
91};
92
93static uint32_t const irq_mask[MAX_BLACKFIN_GPTIMERS] =
94{
95 TIMER_STATUS_TIMIL0,
96 TIMER_STATUS_TIMIL1,
97 TIMER_STATUS_TIMIL2,
98#if (MAX_BLACKFIN_GPTIMERS > 3)
99 TIMER_STATUS_TIMIL3,
100 TIMER_STATUS_TIMIL4,
101 TIMER_STATUS_TIMIL5,
102 TIMER_STATUS_TIMIL6,
103 TIMER_STATUS_TIMIL7,
104#endif
105#if (MAX_BLACKFIN_GPTIMERS > 8)
106 TIMER_STATUS_TIMIL8,
107 TIMER_STATUS_TIMIL9,
108 TIMER_STATUS_TIMIL10,
109 TIMER_STATUS_TIMIL11,
110#endif
111};
112
113void set_gptimer_pwidth(int timer_id, uint32_t value)
114{
115 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
116 timer_regs[timer_id]->width = value;
117 SSYNC();
118}
119EXPORT_SYMBOL(set_gptimer_pwidth);
120
121uint32_t get_gptimer_pwidth(int timer_id)
122{
123 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
124 return timer_regs[timer_id]->width;
125}
126EXPORT_SYMBOL(get_gptimer_pwidth);
127
128void set_gptimer_period(int timer_id, uint32_t period)
129{
130 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
131 timer_regs[timer_id]->period = period;
132 SSYNC();
133}
134EXPORT_SYMBOL(set_gptimer_period);
135
136uint32_t get_gptimer_period(int timer_id)
137{
138 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
139 return timer_regs[timer_id]->period;
140}
141EXPORT_SYMBOL(get_gptimer_period);
142
143uint32_t get_gptimer_count(int timer_id)
144{
145 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
146 return timer_regs[timer_id]->counter;
147}
148EXPORT_SYMBOL(get_gptimer_count);
149
150uint32_t get_gptimer_status(int group)
151{
152 tassert(group < BFIN_TIMER_NUM_GROUP);
153 return group_regs[group]->status;
154}
155EXPORT_SYMBOL(get_gptimer_status);
156
157void set_gptimer_status(int group, uint32_t value)
158{
159 tassert(group < BFIN_TIMER_NUM_GROUP);
160 group_regs[group]->status = value;
161 SSYNC();
162}
163EXPORT_SYMBOL(set_gptimer_status);
164
165uint16_t get_gptimer_intr(int timer_id)
166{
167 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
168 return (group_regs[BFIN_TIMER_OCTET(timer_id)]->status & irq_mask[timer_id]) ? 1 : 0;
169}
170EXPORT_SYMBOL(get_gptimer_intr);
171
172void clear_gptimer_intr(int timer_id)
173{
174 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
175 group_regs[BFIN_TIMER_OCTET(timer_id)]->status = irq_mask[timer_id];
176}
177EXPORT_SYMBOL(clear_gptimer_intr);
178
179void set_gptimer_config(int timer_id, uint16_t config)
180{
181 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
182 timer_regs[timer_id]->config = config;
183 SSYNC();
184}
185EXPORT_SYMBOL(set_gptimer_config);
186
187uint16_t get_gptimer_config(int timer_id)
188{
189 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
190 return timer_regs[timer_id]->config;
191}
192EXPORT_SYMBOL(get_gptimer_config);
193
194void enable_gptimers(uint16_t mask)
195{
196 int i;
197 tassert((mask & ~BLACKFIN_GPTIMER_IDMASK) == 0);
198 for (i = 0; i < BFIN_TIMER_NUM_GROUP; ++i) {
199 group_regs[i]->enable = mask & 0xFF;
200 mask >>= 8;
201 }
202 SSYNC();
203}
204EXPORT_SYMBOL(enable_gptimers);
205
206void disable_gptimers(uint16_t mask)
207{
208 int i;
209 uint16_t m = mask;
210 tassert((mask & ~BLACKFIN_GPTIMER_IDMASK) == 0);
211 for (i = 0; i < BFIN_TIMER_NUM_GROUP; ++i) {
212 group_regs[i]->disable = m & 0xFF;
213 m >>= 8;
214 }
215 for (i = 0; i < MAX_BLACKFIN_GPTIMERS; ++i)
216 if (mask & (1 << i))
217 group_regs[BFIN_TIMER_OCTET(i)]->status |= dis_mask[i];
218 SSYNC();
219}
220EXPORT_SYMBOL(disable_gptimers);
221
222void set_gptimer_pulse_hi(int timer_id)
223{
224 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
225 timer_regs[timer_id]->config |= TIMER_PULSE_HI;
226 SSYNC();
227}
228EXPORT_SYMBOL(set_gptimer_pulse_hi);
229
230void clear_gptimer_pulse_hi(int timer_id)
231{
232 tassert(timer_id < MAX_BLACKFIN_GPTIMERS);
233 timer_regs[timer_id]->config &= ~TIMER_PULSE_HI;
234 SSYNC();
235}
236EXPORT_SYMBOL(clear_gptimer_pulse_hi);
237
238uint16_t get_enabled_gptimers(void)
239{
240 int i;
241 uint16_t result = 0;
242 for (i = 0; i < BFIN_TIMER_NUM_GROUP; ++i)
243 result |= (group_regs[i]->enable << (i << 3));
244 return result;
245}
246EXPORT_SYMBOL(get_enabled_gptimers);
247
248MODULE_AUTHOR("Axel Weiss (awe@aglaia-gmbh.de)");
249MODULE_DESCRIPTION("Blackfin General Purpose Timers API");
250MODULE_LICENSE("GPL");
diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c
index 356078ec462b..ae28aac6fec1 100644
--- a/arch/blackfin/kernel/reboot.c
+++ b/arch/blackfin/kernel/reboot.c
@@ -11,7 +11,7 @@
11#include <asm/reboot.h> 11#include <asm/reboot.h>
12#include <asm/system.h> 12#include <asm/system.h>
13 13
14#if defined(BF537_FAMILY) || defined(BF533_FAMILY) 14#if defined(BF537_FAMILY) || defined(BF533_FAMILY) || defined(BF527_FAMILY)
15#define SYSCR_VAL 0x0 15#define SYSCR_VAL 0x0
16#elif defined(BF561_FAMILY) 16#elif defined(BF561_FAMILY)
17#define SYSCR_VAL 0x20 17#define SYSCR_VAL 0x20
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 8dcd76e87ed5..0e746449c29b 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -459,7 +459,7 @@ static u_long get_vco(void)
459 return vco; 459 return vco;
460} 460}
461 461
462/*Get the Core clock*/ 462/* Get the Core clock */
463u_long get_cclk(void) 463u_long get_cclk(void)
464{ 464{
465 u_long csel, ssel; 465 u_long csel, ssel;
@@ -493,12 +493,24 @@ u_long get_sclk(void)
493} 493}
494EXPORT_SYMBOL(get_sclk); 494EXPORT_SYMBOL(get_sclk);
495 495
496unsigned long sclk_to_usecs(unsigned long sclk)
497{
498 return (USEC_PER_SEC * (u64)sclk) / get_sclk();
499}
500EXPORT_SYMBOL(sclk_to_usecs);
501
502unsigned long usecs_to_sclk(unsigned long usecs)
503{
504 return get_sclk() / (USEC_PER_SEC * (u64)usecs);
505}
506EXPORT_SYMBOL(usecs_to_sclk);
507
496/* 508/*
497 * Get CPU information for use by the procfs. 509 * Get CPU information for use by the procfs.
498 */ 510 */
499static int show_cpuinfo(struct seq_file *m, void *v) 511static int show_cpuinfo(struct seq_file *m, void *v)
500{ 512{
501 char *cpu, *mmu, *fpu, *name; 513 char *cpu, *mmu, *fpu, *vendor, *cache;
502 uint32_t revid; 514 uint32_t revid;
503 515
504 u_long cclk = 0, sclk = 0; 516 u_long cclk = 0, sclk = 0;
@@ -508,70 +520,83 @@ static int show_cpuinfo(struct seq_file *m, void *v)
508 mmu = "none"; 520 mmu = "none";
509 fpu = "none"; 521 fpu = "none";
510 revid = bfin_revid(); 522 revid = bfin_revid();
511 name = bfin_board_name;
512 523
513 cclk = get_cclk(); 524 cclk = get_cclk();
514 sclk = get_sclk(); 525 sclk = get_sclk();
515 526
516 seq_printf(m, "CPU:\t\tADSP-%s Rev. 0.%d\n" 527 switch (bfin_read_CHIPID() & CHIPID_MANUFACTURE) {
517 "MMU:\t\t%s\n" 528 case 0xca:
518 "FPU:\t\t%s\n" 529 vendor = "Analog Devices";
519 "Core Clock:\t%9lu Hz\n" 530 break;
520 "System Clock:\t%9lu Hz\n" 531 default:
521 "BogoMips:\t%lu.%02lu\n" 532 vendor = "unknown";
522 "Calibration:\t%lu loops\n", 533 break;
523 cpu, revid, mmu, fpu, 534 }
524 cclk,
525 sclk,
526 (loops_per_jiffy * HZ) / 500000,
527 ((loops_per_jiffy * HZ) / 5000) % 100,
528 (loops_per_jiffy * HZ));
529 seq_printf(m, "Board Name:\t%s\n", name);
530 seq_printf(m, "Board Memory:\t%ld MB\n", physical_mem_end >> 20);
531 seq_printf(m, "Kernel Memory:\t%ld MB\n", (unsigned long)_ramend >> 20);
532 if (bfin_read_IMEM_CONTROL() & (ENICPLB | IMC))
533 seq_printf(m, "I-CACHE:\tON\n");
534 else
535 seq_printf(m, "I-CACHE:\tOFF\n");
536 if ((bfin_read_DMEM_CONTROL()) & (ENDCPLB | DMC_ENABLE))
537 seq_printf(m, "D-CACHE:\tON"
538#if defined CONFIG_BFIN_WB
539 " (write-back)"
540#elif defined CONFIG_BFIN_WT
541 " (write-through)"
542#endif
543 "\n");
544 else
545 seq_printf(m, "D-CACHE:\tOFF\n");
546
547 535
536 seq_printf(m, "processor\t: %d\n"
537 "vendor_id\t: %s\n"
538 "cpu family\t: 0x%x\n"
539 "model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK)\n"
540 "stepping\t: %d\n",
541 0,
542 vendor,
543 (bfin_read_CHIPID() & CHIPID_FAMILY),
544 cpu, cclk/1000000, sclk/1000000,
545 revid);
546
547 seq_printf(m, "cpu MHz\t\t: %lu.%03lu/%lu.%03lu\n",
548 cclk/1000000, cclk%1000000,
549 sclk/1000000, sclk%1000000);
550 seq_printf(m, "bogomips\t: %lu.%02lu\n"
551 "Calibration\t: %lu loops\n",
552 (loops_per_jiffy * HZ) / 500000,
553 ((loops_per_jiffy * HZ) / 5000) % 100,
554 (loops_per_jiffy * HZ));
555
556 /* Check Cache configutation */
548 switch (bfin_read_DMEM_CONTROL() & (1 << DMC0_P | 1 << DMC1_P)) { 557 switch (bfin_read_DMEM_CONTROL() & (1 << DMC0_P | 1 << DMC1_P)) {
549 case ACACHE_BSRAM: 558 case ACACHE_BSRAM:
550 seq_printf(m, "DBANK-A:\tCACHE\n" "DBANK-B:\tSRAM\n"); 559 cache = "dbank-A/B\t: cache/sram";
551 dcache_size = 16; 560 dcache_size = 16;
552 dsup_banks = 1; 561 dsup_banks = 1;
553 break; 562 break;
554 case ACACHE_BCACHE: 563 case ACACHE_BCACHE:
555 seq_printf(m, "DBANK-A:\tCACHE\n" "DBANK-B:\tCACHE\n"); 564 cache = "dbank-A/B\t: cache/cache";
556 dcache_size = 32; 565 dcache_size = 32;
557 dsup_banks = 2; 566 dsup_banks = 2;
558 break; 567 break;
559 case ASRAM_BSRAM: 568 case ASRAM_BSRAM:
560 seq_printf(m, "DBANK-A:\tSRAM\n" "DBANK-B:\tSRAM\n"); 569 cache = "dbank-A/B\t: sram/sram";
561 dcache_size = 0; 570 dcache_size = 0;
562 dsup_banks = 0; 571 dsup_banks = 0;
563 break; 572 break;
564 default: 573 default:
574 cache = "unknown";
575 dcache_size = 0;
576 dsup_banks = 0;
565 break; 577 break;
566 } 578 }
567 579
580 /* Is it turned on? */
581 if (!((bfin_read_DMEM_CONTROL()) & (ENDCPLB | DMC_ENABLE)))
582 dcache_size = 0;
568 583
569 seq_printf(m, "I-CACHE Size:\t%dKB\n", BFIN_ICACHESIZE / 1024); 584 seq_printf(m, "cache size\t: %d KB(L1 icache) "
570 seq_printf(m, "D-CACHE Size:\t%dKB\n", dcache_size); 585 "%d KB(L1 dcache-%s) %d KB(L2 cache)\n",
571 seq_printf(m, "I-CACHE Setup:\t%d Sub-banks/%d Ways, %d Lines/Way\n", 586 BFIN_ICACHESIZE / 1024, dcache_size,
587#if defined CONFIG_BFIN_WB
588 "wb"
589#elif defined CONFIG_BFIN_WT
590 "wt"
591#endif
592 , 0);
593
594 seq_printf(m, "%s\n", cache);
595
596 seq_printf(m, "icache setup\t: %d Sub-banks/%d Ways, %d Lines/Way\n",
572 BFIN_ISUBBANKS, BFIN_IWAYS, BFIN_ILINES); 597 BFIN_ISUBBANKS, BFIN_IWAYS, BFIN_ILINES);
573 seq_printf(m, 598 seq_printf(m,
574 "D-CACHE Setup:\t%d Super-banks/%d Sub-banks/%d Ways, %d Lines/Way\n", 599 "dcache setup\t: %d Super-banks/%d Sub-banks/%d Ways, %d Lines/Way\n",
575 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS, 600 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS,
576 BFIN_DLINES); 601 BFIN_DLINES);
577#ifdef CONFIG_BFIN_ICACHE_LOCK 602#ifdef CONFIG_BFIN_ICACHE_LOCK
@@ -625,6 +650,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
625 seq_printf(m, "No Ways are locked\n"); 650 seq_printf(m, "No Ways are locked\n");
626 } 651 }
627#endif 652#endif
653
654 seq_printf(m, "board name\t: %s\n", bfin_board_name);
655 seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n",
656 physical_mem_end >> 10, (void *)0, (void *)physical_mem_end);
657 seq_printf(m, "kernel memory\t: %d kB (0x%p -> 0x%p)\n",
658 ((int)memory_end - (int)_stext) >> 10,
659 _stext,
660 (void *)memory_end);
661
628 return 0; 662 return 0;
629} 663}
630 664
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 8823e9ade584..afd044e78af6 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -118,12 +118,14 @@ static int printk_address(unsigned long address)
118 offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT); 118 offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
119 119
120 write_unlock_irq(&tasklist_lock); 120 write_unlock_irq(&tasklist_lock);
121 mmput(mm);
121 return printk("<0x%p> [ %s + 0x%lx ]", 122 return printk("<0x%p> [ %s + 0x%lx ]",
122 (void *)address, name, offset); 123 (void *)address, name, offset);
123 } 124 }
124 125
125 vml = vml->next; 126 vml = vml->next;
126 } 127 }
128 mmput(mm);
127 } 129 }
128 write_unlock_irq(&tasklist_lock); 130 write_unlock_irq(&tasklist_lock);
129 131
diff --git a/arch/blackfin/lib/Makefile b/arch/blackfin/lib/Makefile
index 635288fc5f54..bfdad52c570b 100644
--- a/arch/blackfin/lib/Makefile
+++ b/arch/blackfin/lib/Makefile
@@ -4,7 +4,7 @@
4 4
5lib-y := \ 5lib-y := \
6 ashldi3.o ashrdi3.o lshrdi3.o \ 6 ashldi3.o ashrdi3.o lshrdi3.o \
7 muldi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \ 7 muldi3.o divsi3.o udivsi3.o udivdi3.o modsi3.o umodsi3.o \
8 checksum.o memcpy.o memset.o memcmp.o memchr.o memmove.o \ 8 checksum.o memcpy.o memset.o memcmp.o memchr.o memmove.o \
9 strcmp.o strcpy.o strncmp.o strncpy.o \ 9 strcmp.o strcpy.o strncmp.o strncpy.o \
10 umulsi3_highpart.o smulsi3_highpart.o \ 10 umulsi3_highpart.o smulsi3_highpart.o \
diff --git a/arch/blackfin/lib/udivdi3.S b/arch/blackfin/lib/udivdi3.S
new file mode 100644
index 000000000000..ad1ebee675e1
--- /dev/null
+++ b/arch/blackfin/lib/udivdi3.S
@@ -0,0 +1,375 @@
1/*
2 * udivdi3.S - unsigned long long division
3 *
4 * Copyright 2003-2007 Analog Devices Inc.
5 * Enter bugs at http://blackfin.uclinux.org/
6 *
7 * Licensed under the GPLv2 or later.
8 */
9
10#include <linux/linkage.h>
11
12#define CARRY AC0
13
14#ifdef CONFIG_ARITHMETIC_OPS_L1
15.section .l1.text
16#else
17.text
18#endif
19
20
21ENTRY(___udivdi3)
22 R3 = [SP + 12];
23 [--SP] = (R7:4, P5:3);
24
25 /* Attempt to use divide primitive first; these will handle
26 ** most cases, and they're quick - avoids stalls incurred by
27 ** testing for identities.
28 */
29
30 R4 = R2 | R3;
31 CC = R4 == 0;
32 IF CC JUMP .LDIV_BY_ZERO;
33
34 R4.H = 0x8000;
35 R4 >>>= 16; // R4 now 0xFFFF8000
36 R5 = R0 | R2; // If either dividend or
37 R4 = R5 & R4; // divisor have bits in
38 CC = R4; // top half or low half's sign
39 IF CC JUMP .LIDENTS; // bit, skip builtins.
40 R4 = R1 | R3; // Also check top halves
41 CC = R4;
42 IF CC JUMP .LIDENTS;
43
44 /* Can use the builtins. */
45
46 AQ = CC; // Clear AQ (CC==0)
47 DIVQ(R0, R2);
48 DIVQ(R0, R2);
49 DIVQ(R0, R2);
50 DIVQ(R0, R2);
51 DIVQ(R0, R2);
52 DIVQ(R0, R2);
53 DIVQ(R0, R2);
54 DIVQ(R0, R2);
55 DIVQ(R0, R2);
56 DIVQ(R0, R2);
57 DIVQ(R0, R2);
58 DIVQ(R0, R2);
59 DIVQ(R0, R2);
60 DIVQ(R0, R2);
61 DIVQ(R0, R2);
62 DIVQ(R0, R2);
63 DIVQ(R0, R2);
64 R0 = R0.L (Z);
65 R1 = 0;
66 (R7:4, P5:3) = [SP++];
67 RTS;
68
69.LIDENTS:
70 /* Test for common identities. Value to be returned is
71 ** placed in R6,R7.
72 */
73 // Check for 0/y, return 0
74 R4 = R0 | R1;
75 CC = R4 == 0;
76 IF CC JUMP .LRETURN_R0;
77
78 // Check for x/x, return 1
79 R6 = R0 - R2; // If x == y, then both R6 and R7 will be zero
80 R7 = R1 - R3;
81 R4 = R6 | R7; // making R4 zero.
82 R6 += 1; // which would now make R6:R7==1.
83 CC = R4 == 0;
84 IF CC JUMP .LRETURN_IDENT;
85
86 // Check for x/1, return x
87 R6 = R0;
88 R7 = R1;
89 CC = R3 == 0;
90 IF !CC JUMP .Lnexttest;
91 CC = R2 == 1;
92 IF CC JUMP .LRETURN_IDENT;
93
94.Lnexttest:
95 R4.L = ONES R2; // check for div by power of two which
96 R5.L = ONES R3; // can be done using a shift
97 R6 = PACK (R5.L, R4.L);
98 CC = R6 == 1;
99 IF CC JUMP .Lpower_of_two_upper_zero;
100 R6 = PACK (R4.L, R5.L);
101 CC = R6 == 1;
102 IF CC JUMP .Lpower_of_two_lower_zero;
103
104 // Check for x < y, return 0
105 R6 = 0;
106 R7 = R6;
107 CC = R1 < R3 (IU);
108 IF CC JUMP .LRETURN_IDENT;
109 CC = R1 == R3;
110 IF !CC JUMP .Lno_idents;
111 CC = R0 < R2 (IU);
112 IF CC JUMP .LRETURN_IDENT;
113
114.Lno_idents: // Idents don't match. Go for the full operation
115
116
117 // If X, or X and Y have high bit set, it'll affect the
118 // results, so shift right one to stop this. Note: we've already
119 // checked that X >= Y, so Y's msb won't be set unless X's
120 // is.
121
122 R4 = 0;
123 CC = R1 < 0;
124 IF !CC JUMP .Lx_msb_clear;
125 CC = !CC; // 1 -> 0;
126 R1 = ROT R1 BY -1; // Shift X >> 1
127 R0 = ROT R0 BY -1; // lsb -> CC
128 BITSET(R4,31); // to record only x msb was set
129 CC = R3 < 0;
130 IF !CC JUMP .Ly_msb_clear;
131 CC = !CC;
132 R3 = ROT R3 BY -1; // Shift Y >> 1
133 R2 = ROT R2 BY -1;
134 BITCLR(R4,31); // clear bit to record only x msb was set
135
136.Ly_msb_clear:
137.Lx_msb_clear:
138 // Bit 31 in R4 indicates X msb set, but Y msb wasn't, and no bits
139 // were lost, so we should shift result left by one.
140
141 [--SP] = R4; // save for later
142
143 // In the loop that follows, each iteration we add
144 // either Y' or -Y' to the Remainder. We compute the
145 // negated Y', and store, for convenience. Y' goes
146 // into P0:P1, while -Y' goes into P2:P3.
147
148 P0 = R2;
149 P1 = R3;
150 R2 = -R2;
151 CC = CARRY;
152 CC = !CC;
153 R4 = CC;
154 R3 = -R3;
155 R3 = R3 - R4;
156
157 R6 = 0; // remainder = 0
158 R7 = R6;
159
160 [--SP] = R2; P2 = SP;
161 [--SP] = R3; P3 = SP;
162 [--SP] = R6; P5 = SP; // AQ = 0
163 [--SP] = P1;
164
165 /* In the loop that follows, we use the following
166 ** register assignments:
167 ** R0,R1 X, workspace
168 ** R2,R3 Y, workspace
169 ** R4,R5 partial Div
170 ** R6,R7 partial remainder
171 ** P5 AQ
172 ** The remainder and div form a 128-bit number, with
173 ** the remainder in the high 64-bits.
174 */
175 R4 = R0; // Div = X'
176 R5 = R1;
177 R3 = 0;
178
179 P4 = 64; // Iterate once per bit
180 LSETUP(.LULST,.LULEND) LC0 = P4;
181.LULST:
182 /* Shift Div and remainder up by one. The bit shifted
183 ** out of the top of the quotient is shifted into the bottom
184 ** of the remainder.
185 */
186 CC = R3;
187 R4 = ROT R4 BY 1;
188 R5 = ROT R5 BY 1 || // low q to high q
189 R2 = [P5]; // load saved AQ
190 R6 = ROT R6 BY 1 || // high q to low r
191 R0 = [P2]; // load -Y'
192 R7 = ROT R7 BY 1 || // low r to high r
193 R1 = [P3];
194
195 // Assume add -Y'
196 CC = R2 < 0; // But if AQ is set...
197 IF CC R0 = P0; // then add Y' instead
198 IF CC R1 = P1;
199
200 R6 = R6 + R0; // Rem += (Y' or -Y')
201 CC = CARRY;
202 R0 = CC;
203 R7 = R7 + R1;
204 R7 = R7 + R0 (NS) ||
205 R1 = [SP];
206 // Set the next AQ bit
207 R1 = R7 ^ R1; // from Remainder and Y'
208 R1 = R1 >> 31 || // Negate AQ's value, and
209 [P5] = R1; // save next AQ
210 BITTGL(R1, 0); // add neg AQ to the Div
211.LULEND: R4 = R4 + R1;
212
213 R6 = [SP + 16];
214
215 R0 = R4;
216 R1 = R5;
217 CC = BITTST(R6,30); // Just set CC=0
218 R4 = ROT R0 BY 1; // but if we had to shift X,
219 R5 = ROT R1 BY 1; // and didn't shift any bits out,
220 CC = BITTST(R6,31); // then the result will be half as
221 IF CC R0 = R4; // much as required, so shift left
222 IF CC R1 = R5; // one space.
223
224 SP += 20;
225 (R7:4, P5:3) = [SP++];
226 RTS;
227
228.Lpower_of_two:
229 /* Y has a single bit set, which means it's a power of two.
230 ** That means we can perform the division just by shifting
231 ** X to the right the appropriate number of bits
232 */
233
234 /* signbits returns the number of sign bits, minus one.
235 ** 1=>30, 2=>29, ..., 0x40000000=>0. Which means we need
236 ** to shift right n-signbits spaces. It also means 0x80000000
237 ** is a special case, because that *also* gives a signbits of 0
238 */
239.Lpower_of_two_lower_zero:
240 R7 = 0;
241 R6 = R1 >> 31;
242 CC = R3 < 0;
243 IF CC JUMP .LRETURN_IDENT;
244
245 R2.L = SIGNBITS R3;
246 R2 = R2.L (Z);
247 R2 += -62;
248 (R7:4, P5:3) = [SP++];
249 JUMP ___lshftli;
250
251.Lpower_of_two_upper_zero:
252 CC = R2 < 0;
253 IF CC JUMP .Lmaxint_shift;
254
255 R2.L = SIGNBITS R2;
256 R2 = R2.L (Z);
257 R2 += -30;
258 (R7:4, P5:3) = [SP++];
259 JUMP ___lshftli;
260
261.Lmaxint_shift:
262 R2 = -31;
263 (R7:4, P5:3) = [SP++];
264 JUMP ___lshftli;
265
266.LRETURN_IDENT:
267 R0 = R6;
268 R1 = R7;
269.LRETURN_R0:
270 (R7:4, P5:3) = [SP++];
271 RTS;
272.LDIV_BY_ZERO:
273 R0 = ~R2;
274 R1 = R0;
275 (R7:4, P5:3) = [SP++];
276 RTS;
277
278ENDPROC(___udivdi3)
279
280
281ENTRY(___lshftli)
282 CC = R2 == 0;
283 IF CC JUMP .Lfinished; // nothing to do
284 CC = R2 < 0;
285 IF CC JUMP .Lrshift;
286 R3 = 64;
287 CC = R2 < R3;
288 IF !CC JUMP .Lretzero;
289
290 // We're shifting left, and it's less than 64 bits, so
291 // a valid result will be returned.
292
293 R3 >>= 1; // R3 now 32
294 CC = R2 < R3;
295
296 IF !CC JUMP .Lzerohalf;
297
298 // We're shifting left, between 1 and 31 bits, which means
299 // some of the low half will be shifted into the high half.
300 // Work out how much.
301
302 R3 = R3 - R2;
303
304 // Save that much data from the bottom half.
305
306 P1 = R7;
307 R7 = R0;
308 R7 >>= R3;
309
310 // Adjust both parts of the parameter.
311
312 R0 <<= R2;
313 R1 <<= R2;
314
315 // And include the bits moved across.
316
317 R1 = R1 | R7;
318 R7 = P1;
319 RTS;
320
321.Lzerohalf:
322 // We're shifting left, between 32 and 63 bits, so the
323 // bottom half will become zero, and the top half will
324 // lose some bits. How many?
325
326 R2 = R2 - R3; // N - 32
327 R1 = LSHIFT R0 BY R2.L;
328 R0 = R0 - R0;
329 RTS;
330
331.Lretzero:
332 R0 = R0 - R0;
333 R1 = R0;
334.Lfinished:
335 RTS;
336
337.Lrshift:
338 // We're shifting right, but by how much?
339 R2 = -R2;
340 R3 = 64;
341 CC = R2 < R3;
342 IF !CC JUMP .Lretzero;
343
344 // Shifting right less than 64 bits, so some result bits will
345 // be retained.
346
347 R3 >>= 1; // R3 now 32
348 CC = R2 < R3;
349 IF !CC JUMP .Lsignhalf;
350
351 // Shifting right between 1 and 31 bits, so need to copy
352 // data across words.
353
354 P1 = R7;
355 R3 = R3 - R2;
356 R7 = R1;
357 R7 <<= R3;
358 R1 >>= R2;
359 R0 >>= R2;
360 R0 = R7 | R0;
361 R7 = P1;
362 RTS;
363
364.Lsignhalf:
365 // Shifting right between 32 and 63 bits, so the top half
366 // will become all zero-bits, and the bottom half is some
367 // of the top half. But how much?
368
369 R2 = R2 - R3;
370 R0 = R1;
371 R0 >>= R2;
372 R1 = 0;
373 RTS;
374
375ENDPROC(___lshftli)
diff --git a/arch/blackfin/mach-bf527/Kconfig b/arch/blackfin/mach-bf527/Kconfig
new file mode 100644
index 000000000000..50321f723dee
--- /dev/null
+++ b/arch/blackfin/mach-bf527/Kconfig
@@ -0,0 +1,251 @@
1if (BF52x)
2
3menu "BF527 Specific Configuration"
4
5comment "Alternative Multiplexing Scheme"
6
7choice
8 prompt "SPORT0"
9 default BF527_SPORT0_PORTG
10 help
11 Select PORT used for SPORT0. See Hardware Reference Manual
12
13config BF527_SPORT0_PORTF
14 bool "PORT F"
15 help
16 PORT F
17
18config BF527_SPORT0_PORTG
19 bool "PORT G"
20 help
21 PORT G
22endchoice
23
24choice
25 prompt "SPORT0 TSCLK Location"
26 depends on BF527_SPORT0_PORTG
27 default BF527_SPORT0_TSCLK_PG10
28 help
29 Select PIN used for SPORT0_TSCLK. See Hardware Reference Manual
30
31config BF527_SPORT0_TSCLK_PG10
32 bool "PORT PG10"
33 help
34 PORT PG10
35
36config BF527_SPORT0_TSCLK_PG14
37 bool "PORT PG14"
38 help
39 PORT PG14
40endchoice
41
42choice
43 prompt "UART1"
44 default BF527_UART1_PORTG
45 help
46 Select PORT used for UART1. See Hardware Reference Manual
47
48config BF527_UART1_PORTF
49 bool "PORT F"
50 help
51 PORT F
52
53config BF527_UART1_PORTG
54 bool "PORT G"
55 help
56 PORT G
57endchoice
58
59choice
60 prompt "NAND (NFC) Data"
61 default BF527_NAND_D_PORTH
62 help
63 Select PORT used for NAND Data Bus. See Hardware Reference Manual
64
65config BF527_NAND_D_PORTF
66 bool "PORT F"
67 help
68 PORT F
69
70config BF527_NAND_D_PORTH
71 bool "PORT H"
72 help
73 PORT H
74endchoice
75
76comment "Interrupt Priority Assignment"
77menu "Priority"
78
79config IRQ_PLL_WAKEUP
80 int "IRQ_PLL_WAKEUP"
81 default 7
82config IRQ_DMA0_ERROR
83 int "IRQ_DMA0_ERROR"
84 default 7
85config IRQ_DMAR0_BLK
86 int "IRQ_DMAR0_BLK"
87 default 7
88config IRQ_DMAR1_BLK
89 int "IRQ_DMAR1_BLK"
90 default 7
91config IRQ_DMAR0_OVR
92 int "IRQ_DMAR0_OVR"
93 default 7
94config IRQ_DMAR1_OVR
95 int "IRQ_DMAR1_OVR"
96 default 7
97config IRQ_PPI_ERROR
98 int "IRQ_PPI_ERROR"
99 default 7
100config IRQ_MAC_ERROR
101 int "IRQ_MAC_ERROR"
102 default 7
103config IRQ_SPORT0_ERROR
104 int "IRQ_SPORT0_ERROR"
105 default 7
106config IRQ_SPORT1_ERROR
107 int "IRQ_SPORT1_ERROR"
108 default 7
109config IRQ_UART0_ERROR
110 int "IRQ_UART0_ERROR"
111 default 7
112config IRQ_UART1_ERROR
113 int "IRQ_UART1_ERROR"
114 default 7
115config IRQ_RTC
116 int "IRQ_RTC"
117 default 8
118config IRQ_PPI
119 int "IRQ_PPI"
120 default 8
121config IRQ_SPORT0_RX
122 int "IRQ_SPORT0_RX"
123 default 9
124config IRQ_SPORT0_TX
125 int "IRQ_SPORT0_TX"
126 default 9
127config IRQ_SPORT1_RX
128 int "IRQ_SPORT1_RX"
129 default 9
130config IRQ_SPORT1_TX
131 int "IRQ_SPORT1_TX"
132 default 9
133config IRQ_TWI
134 int "IRQ_TWI"
135 default 10
136config IRQ_SPI
137 int "IRQ_SPI"
138 default 10
139config IRQ_UART0_RX
140 int "IRQ_UART0_RX"
141 default 10
142config IRQ_UART0_TX
143 int "IRQ_UART0_TX"
144 default 10
145config IRQ_UART1_RX
146 int "IRQ_UART1_RX"
147 default 10
148config IRQ_UART1_TX
149 int "IRQ_UART1_TX"
150 default 10
151config IRQ_OPTSEC
152 int "IRQ_OPTSEC"
153 default 11
154config IRQ_CNT
155 int "IRQ_CNT"
156 default 11
157config IRQ_MAC_RX
158 int "IRQ_MAC_RX"
159 default 11
160config IRQ_PORTH_INTA
161 int "IRQ_PORTH_INTA"
162 default 11
163config IRQ_MAC_TX
164 int "IRQ_MAC_TX/NFC"
165 default 11
166config IRQ_PORTH_INTB
167 int "IRQ_PORTH_INTB"
168 default 11
169config IRQ_TMR0
170 int "IRQ_TMR0"
171 default 12
172config IRQ_TMR1
173 int "IRQ_TMR1"
174 default 12
175config IRQ_TMR2
176 int "IRQ_TMR2"
177 default 12
178config IRQ_TMR3
179 int "IRQ_TMR3"
180 default 12
181config IRQ_TMR4
182 int "IRQ_TMR4"
183 default 12
184config IRQ_TMR5
185 int "IRQ_TMR5"
186 default 12
187config IRQ_TMR6
188 int "IRQ_TMR6"
189 default 12
190config IRQ_TMR7
191 int "IRQ_TMR7"
192 default 12
193config IRQ_PORTG_INTA
194 int "IRQ_PORTG_INTA"
195 default 12
196config IRQ_PORTG_INTB
197 int "IRQ_PORTG_INTB"
198 default 12
199config IRQ_MEM_DMA0
200 int "IRQ_MEM_DMA0"
201 default 13
202config IRQ_MEM_DMA1
203 int "IRQ_MEM_DMA1"
204 default 13
205config IRQ_WATCH
206 int "IRQ_WATCH"
207 default 13
208config IRQ_PORTF_INTA
209 int "IRQ_PORTF_INTA"
210 default 13
211config IRQ_PORTF_INTB
212 int "IRQ_PORTF_INTB"
213 default 13
214config IRQ_SPI_ERROR
215 int "IRQ_SPI_ERROR"
216 default 7
217config IRQ_NFC_ERROR
218 int "IRQ_NFC_ERROR"
219 default 7
220config IRQ_HDMA_ERROR
221 int "IRQ_HDMA_ERROR"
222 default 7
223config IRQ_HDMA
224 int "IRQ_HDMA"
225 default 7
226config IRQ_USB_EINT
227 int "IRQ_USB_EINT"
228 default 10
229config IRQ_USB_INT0
230 int "IRQ_USB_INT0"
231 default 10
232config IRQ_USB_INT1
233 int "IRQ_USB_INT1"
234 default 10
235config IRQ_USB_INT2
236 int "IRQ_USB_INT2"
237 default 10
238config IRQ_USB_DMA
239 int "IRQ_USB_DMA"
240 default 10
241
242 help
243 Enter the priority numbers between 7-13 ONLY. Others are Reserved.
244 This applies to all the above. It is not recommended to assign the
245 highest priority number 7 to UART or any other device.
246
247endmenu
248
249endmenu
250
251endif
diff --git a/arch/blackfin/mach-bf527/Makefile b/arch/blackfin/mach-bf527/Makefile
new file mode 100644
index 000000000000..9f99f5d0bcd1
--- /dev/null
+++ b/arch/blackfin/mach-bf527/Makefile
@@ -0,0 +1,9 @@
1#
2# arch/blackfin/mach-bf527/Makefile
3#
4
5extra-y := head.o
6
7obj-y := ints-priority.o dma.o
8
9obj-$(CONFIG_CPU_FREQ) += cpu.o
diff --git a/arch/blackfin/mach-bf527/boards/Makefile b/arch/blackfin/mach-bf527/boards/Makefile
new file mode 100644
index 000000000000..912ac8ebc889
--- /dev/null
+++ b/arch/blackfin/mach-bf527/boards/Makefile
@@ -0,0 +1,7 @@
1#
2# arch/blackfin/mach-bf532/boards/Makefile
3#
4
5obj-y += eth_mac.o
6obj-$(CONFIG_BFIN527_EZKIT) += ezkit.o
7
diff --git a/arch/blackfin/mach-bf527/boards/eth_mac.c b/arch/blackfin/mach-bf527/boards/eth_mac.c
new file mode 100644
index 000000000000..a725cc8a9290
--- /dev/null
+++ b/arch/blackfin/mach-bf527/boards/eth_mac.c
@@ -0,0 +1,50 @@
1/*
2 * arch/blackfin/mach-bf537/board/eth_mac.c
3 *
4 * Copyright (C) 2007 Analog Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/module.h>
21#include <asm/blackfin.h>
22
23#if defined(CONFIG_GENERIC_BOARD) || defined(CONFIG_BFIN537_STAMP)
24
25/*
26 * Currently the MAC address is saved in Flash by U-Boot
27 */
28#define FLASH_MAC 0x203f0000
29
30void get_bf537_ether_addr(char *addr)
31{
32 unsigned int flash_mac = (unsigned int) FLASH_MAC;
33 *(u32 *)(&(addr[0])) = bfin_read32(flash_mac);
34 flash_mac += 4;
35 *(u16 *)(&(addr[4])) = bfin_read16(flash_mac);
36}
37
38#else
39
40/*
41 * Provide MAC address function for other specific board setting
42 */
43void get_bf537_ether_addr(char *addr)
44{
45 printk(KERN_WARNING "%s: No valid Ethernet MAC address found\n", __FILE__);
46}
47
48#endif
49
50EXPORT_SYMBOL(get_bf537_ether_addr);
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
new file mode 100644
index 000000000000..3e884f3a8182
--- /dev/null
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -0,0 +1,737 @@
1/*
2 * File: arch/blackfin/mach-bf527/boards/ezkit.c
3 * Based on: arch/blackfin/mach-bf537/boards/stamp.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2007 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 <linux/pata_platform.h>
41#include <linux/irq.h>
42#include <linux/interrupt.h>
43#include <linux/usb_sl811.h>
44#include <asm/dma.h>
45#include <asm/bfin5xx_spi.h>
46#include <asm/reboot.h>
47#include <linux/spi/ad7877.h>
48
49/*
50 * Name the Board for the /proc/cpuinfo
51 */
52const char bfin_board_name[] = "ADDS-BF527-EZKIT";
53
54/*
55 * Driver needs to know address, irq and flag pin.
56 */
57
58#define ISP1761_BASE 0x203C0000
59#define ISP1761_IRQ IRQ_PF7
60
61#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
62static struct resource bfin_isp1761_resources[] = {
63 [0] = {
64 .name = "isp1761-regs",
65 .start = ISP1761_BASE + 0x00000000,
66 .end = ISP1761_BASE + 0x000fffff,
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
70 .start = ISP1761_IRQ,
71 .end = ISP1761_IRQ,
72 .flags = IORESOURCE_IRQ,
73 },
74};
75
76static struct platform_device bfin_isp1761_device = {
77 .name = "isp1761",
78 .id = 0,
79 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
80 .resource = bfin_isp1761_resources,
81};
82
83static struct platform_device *bfin_isp1761_devices[] = {
84 &bfin_isp1761_device,
85};
86
87int __init bfin_isp1761_init(void)
88{
89 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
90
91 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
92 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
93
94 return platform_add_devices(bfin_isp1761_devices, num_devices);
95}
96
97void __exit bfin_isp1761_exit(void)
98{
99 platform_device_unregister(&bfin_isp1761_device);
100}
101
102arch_initcall(bfin_isp1761_init);
103#endif
104
105#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
106static struct resource bfin_pcmcia_cf_resources[] = {
107 {
108 .start = 0x20310000, /* IO PORT */
109 .end = 0x20312000,
110 .flags = IORESOURCE_MEM,
111 }, {
112 .start = 0x20311000, /* Attribute Memory */
113 .end = 0x20311FFF,
114 .flags = IORESOURCE_MEM,
115 }, {
116 .start = IRQ_PF4,
117 .end = IRQ_PF4,
118 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
119 }, {
120 .start = 6, /* Card Detect PF6 */
121 .end = 6,
122 .flags = IORESOURCE_IRQ,
123 },
124};
125
126static struct platform_device bfin_pcmcia_cf_device = {
127 .name = "bfin_cf_pcmcia",
128 .id = -1,
129 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
130 .resource = bfin_pcmcia_cf_resources,
131};
132#endif
133
134#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
135static struct platform_device rtc_device = {
136 .name = "rtc-bfin",
137 .id = -1,
138};
139#endif
140
141#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
142static struct resource smc91x_resources[] = {
143 {
144 .name = "smc91x-regs",
145 .start = 0x20300300,
146 .end = 0x20300300 + 16,
147 .flags = IORESOURCE_MEM,
148 }, {
149
150 .start = IRQ_PF7,
151 .end = IRQ_PF7,
152 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
153 },
154};
155static struct platform_device smc91x_device = {
156 .name = "smc91x",
157 .id = 0,
158 .num_resources = ARRAY_SIZE(smc91x_resources),
159 .resource = smc91x_resources,
160};
161#endif
162
163#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
164static struct resource dm9000_resources[] = {
165 [0] = {
166 .start = 0x203FB800,
167 .end = 0x203FB800 + 8,
168 .flags = IORESOURCE_MEM,
169 },
170 [1] = {
171 .start = IRQ_PF9,
172 .end = IRQ_PF9,
173 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
174 },
175};
176
177static struct platform_device dm9000_device = {
178 .name = "dm9000",
179 .id = -1,
180 .num_resources = ARRAY_SIZE(dm9000_resources),
181 .resource = dm9000_resources,
182};
183#endif
184
185#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
186static struct resource sl811_hcd_resources[] = {
187 {
188 .start = 0x20340000,
189 .end = 0x20340000,
190 .flags = IORESOURCE_MEM,
191 }, {
192 .start = 0x20340004,
193 .end = 0x20340004,
194 .flags = IORESOURCE_MEM,
195 }, {
196 .start = CONFIG_USB_SL811_BFIN_IRQ,
197 .end = CONFIG_USB_SL811_BFIN_IRQ,
198 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
199 },
200};
201
202#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
203void sl811_port_power(struct device *dev, int is_on)
204{
205 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
206 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS);
207
208 if (is_on)
209 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1);
210 else
211 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0);
212}
213#endif
214
215static struct sl811_platform_data sl811_priv = {
216 .potpg = 10,
217 .power = 250, /* == 500mA */
218#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
219 .port_power = &sl811_port_power,
220#endif
221};
222
223static struct platform_device sl811_hcd_device = {
224 .name = "sl811-hcd",
225 .id = 0,
226 .dev = {
227 .platform_data = &sl811_priv,
228 },
229 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
230 .resource = sl811_hcd_resources,
231};
232#endif
233
234#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
235static struct resource isp1362_hcd_resources[] = {
236 {
237 .start = 0x20360000,
238 .end = 0x20360000,
239 .flags = IORESOURCE_MEM,
240 }, {
241 .start = 0x20360004,
242 .end = 0x20360004,
243 .flags = IORESOURCE_MEM,
244 }, {
245 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
246 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
247 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
248 },
249};
250
251static struct isp1362_platform_data isp1362_priv = {
252 .sel15Kres = 1,
253 .clknotstop = 0,
254 .oc_enable = 0,
255 .int_act_high = 0,
256 .int_edge_triggered = 0,
257 .remote_wakeup_connected = 0,
258 .no_power_switching = 1,
259 .power_switching_mode = 0,
260};
261
262static struct platform_device isp1362_hcd_device = {
263 .name = "isp1362-hcd",
264 .id = 0,
265 .dev = {
266 .platform_data = &isp1362_priv,
267 },
268 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
269 .resource = isp1362_hcd_resources,
270};
271#endif
272
273#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
274static struct platform_device bfin_mac_device = {
275 .name = "bfin_mac",
276};
277#endif
278
279#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
280static struct resource net2272_bfin_resources[] = {
281 {
282 .start = 0x20300000,
283 .end = 0x20300000 + 0x100,
284 .flags = IORESOURCE_MEM,
285 }, {
286 .start = IRQ_PF7,
287 .end = IRQ_PF7,
288 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
289 },
290};
291
292static struct platform_device net2272_bfin_device = {
293 .name = "net2272",
294 .id = -1,
295 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
296 .resource = net2272_bfin_resources,
297};
298#endif
299
300#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
301/* all SPI peripherals info goes here */
302
303#if defined(CONFIG_MTD_M25P80) \
304 || defined(CONFIG_MTD_M25P80_MODULE)
305static struct mtd_partition bfin_spi_flash_partitions[] = {
306 {
307 .name = "bootloader",
308 .size = 0x00020000,
309 .offset = 0,
310 .mask_flags = MTD_CAP_ROM
311 }, {
312 .name = "kernel",
313 .size = 0xe0000,
314 .offset = 0x20000
315 }, {
316 .name = "file system",
317 .size = 0x700000,
318 .offset = 0x00100000,
319 }
320};
321
322static struct flash_platform_data bfin_spi_flash_data = {
323 .name = "m25p80",
324 .parts = bfin_spi_flash_partitions,
325 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
326 .type = "m25p64",
327};
328
329/* SPI flash chip (m25p64) */
330static struct bfin5xx_spi_chip spi_flash_chip_info = {
331 .enable_dma = 0, /* use dma transfer with this chip*/
332 .bits_per_word = 8,
333};
334#endif
335
336#if defined(CONFIG_SPI_ADC_BF533) \
337 || defined(CONFIG_SPI_ADC_BF533_MODULE)
338/* SPI ADC chip */
339static struct bfin5xx_spi_chip spi_adc_chip_info = {
340 .enable_dma = 1, /* use dma transfer with this chip*/
341 .bits_per_word = 16,
342};
343#endif
344
345#if defined(CONFIG_SND_BLACKFIN_AD1836) \
346 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
347static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
348 .enable_dma = 0,
349 .bits_per_word = 16,
350};
351#endif
352
353#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
354static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
355 .enable_dma = 0,
356 .bits_per_word = 16,
357};
358#endif
359
360#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
361static struct bfin5xx_spi_chip spi_mmc_chip_info = {
362 .enable_dma = 1,
363 .bits_per_word = 8,
364};
365#endif
366
367#if defined(CONFIG_PBX)
368static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
369 .ctl_reg = 0x4, /* send zero */
370 .enable_dma = 0,
371 .bits_per_word = 8,
372 .cs_change_per_word = 1,
373};
374#endif
375
376#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
377static struct bfin5xx_spi_chip ad5304_chip_info = {
378 .enable_dma = 0,
379 .bits_per_word = 16,
380};
381#endif
382
383#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
384static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
385 .enable_dma = 0,
386 .bits_per_word = 16,
387};
388
389static const struct ad7877_platform_data bfin_ad7877_ts_info = {
390 .model = 7877,
391 .vref_delay_usecs = 50, /* internal, no capacitor */
392 .x_plate_ohms = 419,
393 .y_plate_ohms = 486,
394 .pressure_max = 1000,
395 .pressure_min = 0,
396 .stopacq_polarity = 1,
397 .first_conversion_delay = 3,
398 .acquisition_time = 1,
399 .averaging = 1,
400 .pen_down_acc_interval = 1,
401};
402#endif
403
404static struct spi_board_info bfin_spi_board_info[] __initdata = {
405#if defined(CONFIG_MTD_M25P80) \
406 || defined(CONFIG_MTD_M25P80_MODULE)
407 {
408 /* the modalias must be the same as spi device driver name */
409 .modalias = "m25p80", /* Name of spi_driver for this device */
410 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
411 .bus_num = 0, /* Framework bus number */
412 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
413 .platform_data = &bfin_spi_flash_data,
414 .controller_data = &spi_flash_chip_info,
415 .mode = SPI_MODE_3,
416 },
417#endif
418
419#if defined(CONFIG_SPI_ADC_BF533) \
420 || defined(CONFIG_SPI_ADC_BF533_MODULE)
421 {
422 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
423 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
424 .bus_num = 0, /* Framework bus number */
425 .chip_select = 1, /* Framework chip select. */
426 .platform_data = NULL, /* No spi_driver specific config */
427 .controller_data = &spi_adc_chip_info,
428 },
429#endif
430
431#if defined(CONFIG_SND_BLACKFIN_AD1836) \
432 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
433 {
434 .modalias = "ad1836-spi",
435 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
436 .bus_num = 0,
437 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
438 .controller_data = &ad1836_spi_chip_info,
439 },
440#endif
441#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
442 {
443 .modalias = "ad9960-spi",
444 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
445 .bus_num = 0,
446 .chip_select = 1,
447 .controller_data = &ad9960_spi_chip_info,
448 },
449#endif
450#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
451 {
452 .modalias = "spi_mmc_dummy",
453 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
454 .bus_num = 0,
455 .chip_select = 0,
456 .platform_data = NULL,
457 .controller_data = &spi_mmc_chip_info,
458 .mode = SPI_MODE_3,
459 },
460 {
461 .modalias = "spi_mmc",
462 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
463 .bus_num = 0,
464 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
465 .platform_data = NULL,
466 .controller_data = &spi_mmc_chip_info,
467 .mode = SPI_MODE_3,
468 },
469#endif
470#if defined(CONFIG_PBX)
471 {
472 .modalias = "fxs-spi",
473 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
474 .bus_num = 0,
475 .chip_select = 8 - CONFIG_J11_JUMPER,
476 .controller_data = &spi_si3xxx_chip_info,
477 .mode = SPI_MODE_3,
478 },
479 {
480 .modalias = "fxo-spi",
481 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
482 .bus_num = 0,
483 .chip_select = 8 - CONFIG_J19_JUMPER,
484 .controller_data = &spi_si3xxx_chip_info,
485 .mode = SPI_MODE_3,
486 },
487#endif
488#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
489 {
490 .modalias = "ad5304_spi",
491 .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */
492 .bus_num = 0,
493 .chip_select = 2,
494 .platform_data = NULL,
495 .controller_data = &ad5304_chip_info,
496 .mode = SPI_MODE_2,
497 },
498#endif
499#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
500 {
501 .modalias = "ad7877",
502 .platform_data = &bfin_ad7877_ts_info,
503 .irq = IRQ_PF6,
504 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
505 .bus_num = 1,
506 .chip_select = 1,
507 .controller_data = &spi_ad7877_chip_info,
508 },
509#endif
510};
511
512/* SPI controller data */
513static struct bfin5xx_spi_master bfin_spi0_info = {
514 .num_chipselect = 8,
515 .enable_dma = 1, /* master has the ability to do dma transfer */
516};
517
518/* SPI (0) */
519static struct resource bfin_spi0_resource[] = {
520 [0] = {
521 .start = SPI0_REGBASE,
522 .end = SPI0_REGBASE + 0xFF,
523 .flags = IORESOURCE_MEM,
524 },
525 [1] = {
526 .start = CH_SPI,
527 .end = CH_SPI,
528 .flags = IORESOURCE_IRQ,
529 },
530};
531
532static struct platform_device bfin_spi0_device = {
533 .name = "bfin-spi",
534 .id = 0, /* Bus number */
535 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
536 .resource = bfin_spi0_resource,
537 .dev = {
538 .platform_data = &bfin_spi0_info, /* Passed to driver */
539 },
540};
541#endif /* spi master and devices */
542
543#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
544static struct platform_device bfin_fb_device = {
545 .name = "bf537-lq035",
546};
547#endif
548
549#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
550static struct platform_device bfin_fb_adv7393_device = {
551 .name = "bfin-adv7393",
552};
553#endif
554
555#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
556static struct resource bfin_uart_resources[] = {
557#ifdef CONFIG_SERIAL_BFIN_UART0
558 {
559 .start = 0xFFC00400,
560 .end = 0xFFC004FF,
561 .flags = IORESOURCE_MEM,
562 },
563#endif
564#ifdef CONFIG_SERIAL_BFIN_UART1
565 {
566 .start = 0xFFC02000,
567 .end = 0xFFC020FF,
568 .flags = IORESOURCE_MEM,
569 },
570#endif
571};
572
573static struct platform_device bfin_uart_device = {
574 .name = "bfin-uart",
575 .id = 1,
576 .num_resources = ARRAY_SIZE(bfin_uart_resources),
577 .resource = bfin_uart_resources,
578};
579#endif
580
581#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
582static struct resource bfin_twi0_resource[] = {
583 [0] = {
584 .start = TWI0_REGBASE,
585 .end = TWI0_REGBASE,
586 .flags = IORESOURCE_MEM,
587 },
588 [1] = {
589 .start = IRQ_TWI,
590 .end = IRQ_TWI,
591 .flags = IORESOURCE_IRQ,
592 },
593};
594
595static struct platform_device i2c_bfin_twi_device = {
596 .name = "i2c-bfin-twi",
597 .id = 0,
598 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
599 .resource = bfin_twi0_resource,
600};
601#endif
602
603#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
604static struct platform_device bfin_sport0_uart_device = {
605 .name = "bfin-sport-uart",
606 .id = 0,
607};
608
609static struct platform_device bfin_sport1_uart_device = {
610 .name = "bfin-sport-uart",
611 .id = 1,
612};
613#endif
614
615#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
616#define PATA_INT 55
617
618static struct pata_platform_info bfin_pata_platform_data = {
619 .ioport_shift = 1,
620 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
621};
622
623static struct resource bfin_pata_resources[] = {
624 {
625 .start = 0x20314020,
626 .end = 0x2031403F,
627 .flags = IORESOURCE_MEM,
628 },
629 {
630 .start = 0x2031401C,
631 .end = 0x2031401F,
632 .flags = IORESOURCE_MEM,
633 },
634 {
635 .start = PATA_INT,
636 .end = PATA_INT,
637 .flags = IORESOURCE_IRQ,
638 },
639};
640
641static struct platform_device bfin_pata_device = {
642 .name = "pata_platform",
643 .id = -1,
644 .num_resources = ARRAY_SIZE(bfin_pata_resources),
645 .resource = bfin_pata_resources,
646 .dev = {
647 .platform_data = &bfin_pata_platform_data,
648 }
649};
650#endif
651
652static struct platform_device *stamp_devices[] __initdata = {
653#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
654 &bfin_pcmcia_cf_device,
655#endif
656
657#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
658 &rtc_device,
659#endif
660
661#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
662 &sl811_hcd_device,
663#endif
664
665#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
666 &isp1362_hcd_device,
667#endif
668
669#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
670 &smc91x_device,
671#endif
672
673#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
674 &dm9000_device,
675#endif
676
677#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
678 &bfin_mac_device,
679#endif
680
681#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
682 &net2272_bfin_device,
683#endif
684
685#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
686 &bfin_spi0_device,
687#endif
688
689#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
690 &bfin_fb_device,
691#endif
692
693#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
694 &bfin_fb_adv7393_device,
695#endif
696
697#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
698 &bfin_uart_device,
699#endif
700
701#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
702 &i2c_bfin_twi_device,
703#endif
704
705#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
706 &bfin_sport0_uart_device,
707 &bfin_sport1_uart_device,
708#endif
709
710#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
711 &bfin_pata_device,
712#endif
713};
714
715static int __init stamp_init(void)
716{
717 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
718 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
719#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
720 spi_register_board_info(bfin_spi_board_info,
721 ARRAY_SIZE(bfin_spi_board_info));
722#endif
723
724#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
725 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
726#endif
727 return 0;
728}
729
730arch_initcall(stamp_init);
731
732void native_machine_restart(char *cmd)
733{
734 /* workaround reboot hang when booting from SPI */
735 if ((bfin_read_SYSCR() & 0x7) == 0x3)
736 bfin_gpio_reset_spi0_ssel1();
737}
diff --git a/arch/blackfin/mach-bf527/cpu.c b/arch/blackfin/mach-bf527/cpu.c
new file mode 100644
index 000000000000..1975402b1dbc
--- /dev/null
+++ b/arch/blackfin/mach-bf527/cpu.c
@@ -0,0 +1,161 @@
1/*
2 * File: arch/blackfin/mach-bf527/cpu.c
3 * Based on: arch/blackfin/mach-bf537/cpu.c
4 * Author: michael.kang@analog.com
5 *
6 * Created:
7 * Description: clock scaling for the bf527
8 *
9 * Modified:
10 * Copyright 2004-2007 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 MFREQ(x) {VCO(x), VCO(x)/4}, {VCO(x), VCO(x)/2}, {VCO(x), VCO(x)}
47/* frequency */
48static struct cpufreq_frequency_table bf527_freq_table[] = {
49 MFREQ(1),
50 MFREQ(3),
51 {VCO4, VCO4 / 2}, {VCO4, VCO4},
52 MFREQ(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 bf527_getfreq(unsigned int cpu)
61{
62 unsigned long cclk_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
70 return cclk_mhz;
71}
72
73static int bf527_target(struct cpufreq_policy *policy,
74 unsigned int target_freq, unsigned int relation)
75{
76 unsigned long cclk_mhz;
77 unsigned long vco_mhz;
78 unsigned long flags;
79 unsigned int index;
80 struct cpufreq_freqs freqs;
81
82 if (cpufreq_frequency_table_target
83 (policy, bf527_freq_table, target_freq, relation, &index))
84 return -EINVAL;
85
86 cclk_mhz = bf527_freq_table[index].frequency;
87 vco_mhz = bf527_freq_table[index].index;
88
89 dpmc_fops.ioctl(NULL, NULL, IOCTL_CHANGE_FREQUENCY, &vco_mhz);
90 freqs.old = bf527_getfreq(0);
91 freqs.new = cclk_mhz;
92 freqs.cpu = 0;
93
94 pr_debug
95 ("cclk begin change to cclk %d,vco=%d,index=%d,target=%d,oldfreq=%d\n",
96 cclk_mhz, vco_mhz, index, target_freq, freqs.old);
97
98 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
99 local_irq_save(flags);
100 dpmc_fops.ioctl(NULL, NULL, IOCTL_SET_CCLK, &cclk_mhz);
101 local_irq_restore(flags);
102 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
103
104 vco_mhz = get_vco();
105 cclk_mhz = get_cclk();
106 return 0;
107}
108
109/* make sure that only the "userspace" governor is run -- anything else wouldn't make sense on
110 * this platform, anyway.
111 */
112static int bf527_verify_speed(struct cpufreq_policy *policy)
113{
114 return cpufreq_frequency_table_verify(policy, &bf527_freq_table);
115}
116
117static int __init __bf527_cpu_init(struct cpufreq_policy *policy)
118{
119 if (policy->cpu != 0)
120 return -EINVAL;
121
122 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
123
124 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
125 /*Now ,only support one cpu */
126 policy->cur = bf527_getfreq(0);
127 cpufreq_frequency_table_get_attr(bf527_freq_table, policy->cpu);
128 return cpufreq_frequency_table_cpuinfo(policy, bf527_freq_table);
129}
130
131static struct freq_attr *bf527_freq_attr[] = {
132 &cpufreq_freq_attr_scaling_available_freqs,
133 NULL,
134};
135
136static struct cpufreq_driver bf527_driver = {
137 .verify = bf527_verify_speed,
138 .target = bf527_target,
139 .get = bf527_getfreq,
140 .init = __bf527_cpu_init,
141 .name = "bf527",
142 .owner = THIS_MODULE,
143 .attr = bf527_freq_attr,
144};
145
146static int __init bf527_cpu_init(void)
147{
148 return cpufreq_register_driver(&bf527_driver);
149}
150
151static void __exit bf527_cpu_exit(void)
152{
153 cpufreq_unregister_driver(&bf527_driver);
154}
155
156MODULE_AUTHOR("Mickael Kang");
157MODULE_DESCRIPTION("cpufreq driver for bf527 CPU");
158MODULE_LICENSE("GPL");
159
160module_init(bf527_cpu_init);
161module_exit(bf527_cpu_exit);
diff --git a/arch/blackfin/mach-bf527/dma.c b/arch/blackfin/mach-bf527/dma.c
new file mode 100644
index 000000000000..522de24cc394
--- /dev/null
+++ b/arch/blackfin/mach-bf527/dma.c
@@ -0,0 +1,115 @@
1/*
2 * File: arch/blackfin/mach-bf527/dma.c
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: This file contains the simple DMA Implementation for Blackfin
8 *
9 * Modified:
10 * Copyright 2004-2007 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#include <asm/blackfin.h>
30#include <asm/dma.h>
31
32struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = {
33 (struct dma_register *) DMA0_NEXT_DESC_PTR,
34 (struct dma_register *) DMA1_NEXT_DESC_PTR,
35 (struct dma_register *) DMA2_NEXT_DESC_PTR,
36 (struct dma_register *) DMA3_NEXT_DESC_PTR,
37 (struct dma_register *) DMA4_NEXT_DESC_PTR,
38 (struct dma_register *) DMA5_NEXT_DESC_PTR,
39 (struct dma_register *) DMA6_NEXT_DESC_PTR,
40 (struct dma_register *) DMA7_NEXT_DESC_PTR,
41 (struct dma_register *) DMA8_NEXT_DESC_PTR,
42 (struct dma_register *) DMA9_NEXT_DESC_PTR,
43 (struct dma_register *) DMA10_NEXT_DESC_PTR,
44 (struct dma_register *) DMA11_NEXT_DESC_PTR,
45 (struct dma_register *) MDMA_D0_NEXT_DESC_PTR,
46 (struct dma_register *) MDMA_S0_NEXT_DESC_PTR,
47 (struct dma_register *) MDMA_D1_NEXT_DESC_PTR,
48 (struct dma_register *) MDMA_S1_NEXT_DESC_PTR,
49};
50
51int channel2irq(unsigned int channel)
52{
53 int ret_irq = -1;
54
55 switch (channel) {
56 case CH_PPI:
57 ret_irq = IRQ_PPI;
58 break;
59
60 case CH_EMAC_RX:
61 ret_irq = IRQ_MAC_RX;
62 break;
63
64 case CH_EMAC_TX:
65 ret_irq = IRQ_MAC_TX;
66 break;
67
68 case CH_UART1_RX:
69 ret_irq = IRQ_UART1_RX;
70 break;
71
72 case CH_UART1_TX:
73 ret_irq = IRQ_UART1_TX;
74 break;
75
76 case CH_SPORT0_RX:
77 ret_irq = IRQ_SPORT0_RX;
78 break;
79
80 case CH_SPORT0_TX:
81 ret_irq = IRQ_SPORT0_TX;
82 break;
83
84 case CH_SPORT1_RX:
85 ret_irq = IRQ_SPORT1_RX;
86 break;
87
88 case CH_SPORT1_TX:
89 ret_irq = IRQ_SPORT1_TX;
90 break;
91
92 case CH_SPI:
93 ret_irq = IRQ_SPI;
94 break;
95
96 case CH_UART0_RX:
97 ret_irq = IRQ_UART0_RX;
98 break;
99
100 case CH_UART0_TX:
101 ret_irq = IRQ_UART0_TX;
102 break;
103
104 case CH_MEM_STREAM0_SRC:
105 case CH_MEM_STREAM0_DEST:
106 ret_irq = IRQ_MEM_DMA0;
107 break;
108
109 case CH_MEM_STREAM1_SRC:
110 case CH_MEM_STREAM1_DEST:
111 ret_irq = IRQ_MEM_DMA1;
112 break;
113 }
114 return ret_irq;
115}
diff --git a/arch/blackfin/mach-bf527/head.S b/arch/blackfin/mach-bf527/head.S
new file mode 100644
index 000000000000..cdb00a084965
--- /dev/null
+++ b/arch/blackfin/mach-bf527/head.S
@@ -0,0 +1,456 @@
1/*
2 * File: arch/blackfin/mach-bf527/head.S
3 * Based on: arch/blackfin/mach-bf533/head.S
4 * Author: Jeff Dionne <jeff@uclinux.org> COPYRIGHT 1998 D. Jeff Dionne
5 *
6 * Created: 1998
7 * Description: Startup code for Blackfin BF537
8 *
9 * Modified:
10 * Copyright 2004-2007 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/linkage.h>
31#include <linux/init.h>
32#include <asm/blackfin.h>
33#include <asm/trace.h>
34
35#if CONFIG_BFIN_KERNEL_CLOCK
36#include <asm/mach-common/clocks.h>
37#include <asm/mach/mem_init.h>
38#endif
39
40.global __rambase
41.global __ramstart
42.global __ramend
43.extern ___bss_stop
44.extern ___bss_start
45.extern _bf53x_relocate_l1_mem
46
47#define INITIAL_STACK 0xFFB01000
48
49__INIT
50
51ENTRY(__start)
52 /* R0: argument of command line string, passed from uboot, save it */
53 R7 = R0;
54 /* Enable Cycle Counter and Nesting Of Interrupts */
55#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
56 R0 = SYSCFG_SNEN;
57#else
58 R0 = SYSCFG_SNEN | SYSCFG_CCEN;
59#endif
60 SYSCFG = R0;
61 R0 = 0;
62
63 /* Clear Out All the data and pointer Registers */
64 R1 = R0;
65 R2 = R0;
66 R3 = R0;
67 R4 = R0;
68 R5 = R0;
69 R6 = R0;
70
71 P0 = R0;
72 P1 = R0;
73 P2 = R0;
74 P3 = R0;
75 P4 = R0;
76 P5 = R0;
77
78 LC0 = r0;
79 LC1 = r0;
80 L0 = r0;
81 L1 = r0;
82 L2 = r0;
83 L3 = r0;
84
85 /* Clear Out All the DAG Registers */
86 B0 = r0;
87 B1 = r0;
88 B2 = r0;
89 B3 = r0;
90
91 I0 = r0;
92 I1 = r0;
93 I2 = r0;
94 I3 = r0;
95
96 M0 = r0;
97 M1 = r0;
98 M2 = r0;
99 M3 = r0;
100
101 trace_buffer_init(p0,r0);
102 P0 = R1;
103 R0 = R1;
104
105 /* Turn off the icache */
106 p0.l = LO(IMEM_CONTROL);
107 p0.h = HI(IMEM_CONTROL);
108 R1 = [p0];
109 R0 = ~ENICPLB;
110 R0 = R0 & R1;
111
112 /* Anomaly 05000125 */
113#if ANOMALY_05000125
114 CLI R2;
115 SSYNC;
116#endif
117 [p0] = R0;
118 SSYNC;
119#if ANOMALY_05000125
120 STI R2;
121#endif
122
123 /* Turn off the dcache */
124 p0.l = LO(DMEM_CONTROL);
125 p0.h = HI(DMEM_CONTROL);
126 R1 = [p0];
127 R0 = ~ENDCPLB;
128 R0 = R0 & R1;
129
130 /* Anomaly 05000125 */
131#if ANOMALY_05000125
132 CLI R2;
133 SSYNC;
134#endif
135 [p0] = R0;
136 SSYNC;
137#if ANOMALY_05000125
138 STI R2;
139#endif
140
141
142#if defined(CONFIG_BF527)
143 p0.h = hi(EMAC_SYSTAT);
144 p0.l = lo(EMAC_SYSTAT);
145 R0.h = 0xFFFF; /* Clear EMAC Interrupt Status bits */
146 R0.l = 0xFFFF;
147 [P0] = R0;
148 SSYNC;
149#endif
150
151 /* Initialise UART - when booting from u-boot, the UART is not disabled
152 * so if we dont initalize here, our serial console gets hosed */
153 p0.h = hi(UART1_LCR);
154 p0.l = lo(UART1_LCR);
155 r0 = 0x0(Z);
156 w[p0] = r0.L; /* To enable DLL writes */
157 ssync;
158
159 p0.h = hi(UART1_DLL);
160 p0.l = lo(UART1_DLL);
161 r0 = 0x0(Z);
162 w[p0] = r0.L;
163 ssync;
164
165 p0.h = hi(UART1_DLH);
166 p0.l = lo(UART1_DLH);
167 r0 = 0x00(Z);
168 w[p0] = r0.L;
169 ssync;
170
171 p0.h = hi(UART1_GCTL);
172 p0.l = lo(UART1_GCTL);
173 r0 = 0x0(Z);
174 w[p0] = r0.L; /* To enable UART clock */
175 ssync;
176
177 /* Initialize stack pointer */
178 sp.l = lo(INITIAL_STACK);
179 sp.h = hi(INITIAL_STACK);
180 fp = sp;
181 usp = sp;
182
183#ifdef CONFIG_EARLY_PRINTK
184 SP += -12;
185 call _init_early_exception_vectors;
186 SP += 12;
187#endif
188
189 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
190 call _bf53x_relocate_l1_mem;
191#if CONFIG_BFIN_KERNEL_CLOCK
192 call _start_dma_code;
193#endif
194
195 /* Code for initializing Async memory banks */
196
197 p2.h = hi(EBIU_AMBCTL1);
198 p2.l = lo(EBIU_AMBCTL1);
199 r0.h = hi(AMBCTL1VAL);
200 r0.l = lo(AMBCTL1VAL);
201 [p2] = r0;
202 ssync;
203
204 p2.h = hi(EBIU_AMBCTL0);
205 p2.l = lo(EBIU_AMBCTL0);
206 r0.h = hi(AMBCTL0VAL);
207 r0.l = lo(AMBCTL0VAL);
208 [p2] = r0;
209 ssync;
210
211 p2.h = hi(EBIU_AMGCTL);
212 p2.l = lo(EBIU_AMGCTL);
213 r0 = AMGCTLVAL;
214 w[p2] = r0;
215 ssync;
216
217 /* This section keeps the processor in supervisor mode
218 * during kernel boot. Switches to user mode at end of boot.
219 * See page 3-9 of Hardware Reference manual for documentation.
220 */
221
222 /* EVT15 = _real_start */
223
224 p0.l = lo(EVT15);
225 p0.h = hi(EVT15);
226 p1.l = _real_start;
227 p1.h = _real_start;
228 [p0] = p1;
229 csync;
230
231 p0.l = lo(IMASK);
232 p0.h = hi(IMASK);
233 p1.l = IMASK_IVG15;
234 p1.h = 0x0;
235 [p0] = p1;
236 csync;
237
238 raise 15;
239 p0.l = .LWAIT_HERE;
240 p0.h = .LWAIT_HERE;
241 reti = p0;
242#if ANOMALY_05000281
243 nop; nop; nop;
244#endif
245 rti;
246
247.LWAIT_HERE:
248 jump .LWAIT_HERE;
249ENDPROC(__start)
250
251ENTRY(_real_start)
252 [ -- sp ] = reti;
253 p0.l = lo(WDOG_CTL);
254 p0.h = hi(WDOG_CTL);
255 r0 = 0xAD6(z);
256 w[p0] = r0; /* watchdog off for now */
257 ssync;
258
259 /* Code update for BSS size == 0
260 * Zero out the bss region.
261 */
262
263 p1.l = ___bss_start;
264 p1.h = ___bss_start;
265 p2.l = ___bss_stop;
266 p2.h = ___bss_stop;
267 r0 = 0;
268 p2 -= p1;
269 lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
270.L_clear_bss:
271 B[p1++] = r0;
272
273 /* In case there is a NULL pointer reference
274 * Zero out region before stext
275 */
276
277 p1.l = 0x0;
278 p1.h = 0x0;
279 r0.l = __stext;
280 r0.h = __stext;
281 r0 = r0 >> 1;
282 p2 = r0;
283 r0 = 0;
284 lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
285.L_clear_zero:
286 W[p1++] = r0;
287
288 /* pass the uboot arguments to the global value command line */
289 R0 = R7;
290 call _cmdline_init;
291
292 p1.l = __rambase;
293 p1.h = __rambase;
294 r0.l = __sdata;
295 r0.h = __sdata;
296 [p1] = r0;
297
298 p1.l = __ramstart;
299 p1.h = __ramstart;
300 p3.l = ___bss_stop;
301 p3.h = ___bss_stop;
302
303 r1 = p3;
304 [p1] = r1;
305
306 /*
307 * load the current thread pointer and stack
308 */
309 r1.l = _init_thread_union;
310 r1.h = _init_thread_union;
311
312 r2.l = 0x2000;
313 r2.h = 0x0000;
314 r1 = r1 + r2;
315 sp = r1;
316 usp = sp;
317 fp = sp;
318 jump.l _start_kernel;
319ENDPROC(_real_start)
320
321__FINIT
322
323.section .l1.text
324#if CONFIG_BFIN_KERNEL_CLOCK
325ENTRY(_start_dma_code)
326
327 /* Enable PHY CLK buffer output */
328 p0.h = hi(VR_CTL);
329 p0.l = lo(VR_CTL);
330 r0.l = w[p0];
331 bitset(r0, 14);
332 w[p0] = r0.l;
333 ssync;
334
335 p0.h = hi(SIC_IWR0);
336 p0.l = lo(SIC_IWR0);
337 r0.l = 0x1;
338 r0.h = 0x0;
339 [p0] = r0;
340 SSYNC;
341
342 /*
343 * Set PLL_CTL
344 * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
345 * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
346 * - [7] = output delay (add 200ps of delay to mem signals)
347 * - [6] = input delay (add 200ps of input delay to mem signals)
348 * - [5] = PDWN : 1=All Clocks off
349 * - [3] = STOPCK : 1=Core Clock off
350 * - [1] = PLL_OFF : 1=Disable Power to PLL
351 * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
352 * all other bits set to zero
353 */
354
355 p0.h = hi(PLL_LOCKCNT);
356 p0.l = lo(PLL_LOCKCNT);
357 r0 = 0x300(Z);
358 w[p0] = r0.l;
359 ssync;
360
361 P2.H = hi(EBIU_SDGCTL);
362 P2.L = lo(EBIU_SDGCTL);
363 R0 = [P2];
364 BITSET (R0, 24);
365 [P2] = R0;
366 SSYNC;
367
368 r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
369 r0 = r0 << 9; /* Shift it over, */
370 r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
371 r0 = r1 | r0;
372 r1 = PLL_BYPASS; /* Bypass the PLL? */
373 r1 = r1 << 8; /* Shift it over */
374 r0 = r1 | r0; /* add them all together */
375
376 p0.h = hi(PLL_CTL);
377 p0.l = lo(PLL_CTL); /* Load the address */
378 cli r2; /* Disable interrupts */
379 ssync;
380 w[p0] = r0.l; /* Set the value */
381 idle; /* Wait for the PLL to stablize */
382 sti r2; /* Enable interrupts */
383
384.Lcheck_again:
385 p0.h = hi(PLL_STAT);
386 p0.l = lo(PLL_STAT);
387 R0 = W[P0](Z);
388 CC = BITTST(R0,5);
389 if ! CC jump .Lcheck_again;
390
391 /* Configure SCLK & CCLK Dividers */
392 r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
393 p0.h = hi(PLL_DIV);
394 p0.l = lo(PLL_DIV);
395 w[p0] = r0.l;
396 ssync;
397
398 p0.l = lo(EBIU_SDRRC);
399 p0.h = hi(EBIU_SDRRC);
400 r0 = mem_SDRRC;
401 w[p0] = r0.l;
402 ssync;
403
404 p0.l = LO(EBIU_SDBCTL);
405 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
406 r0 = mem_SDBCTL;
407 w[p0] = r0.l;
408 ssync;
409
410 P2.H = hi(EBIU_SDGCTL);
411 P2.L = lo(EBIU_SDGCTL);
412 R0 = [P2];
413 BITCLR (R0, 24);
414 p0.h = hi(EBIU_SDSTAT);
415 p0.l = lo(EBIU_SDSTAT);
416 r2.l = w[p0];
417 cc = bittst(r2,3);
418 if !cc jump .Lskip;
419 NOP;
420 BITSET (R0, 23);
421.Lskip:
422 [P2] = R0;
423 SSYNC;
424
425 R0.L = lo(mem_SDGCTL);
426 R0.H = hi(mem_SDGCTL);
427 R1 = [p2];
428 R1 = R1 | R0;
429 [P2] = R1;
430 SSYNC;
431
432 p0.h = hi(SIC_IWR0);
433 p0.l = lo(SIC_IWR0);
434 r0.l = lo(IWR_ENABLE_ALL);
435 r0.h = hi(IWR_ENABLE_ALL);
436 [p0] = r0;
437 SSYNC;
438
439 RTS;
440ENDPROC(_start_dma_code)
441#endif /* CONFIG_BFIN_KERNEL_CLOCK */
442
443.data
444
445/*
446 * Set up the usable of RAM stuff. Size of RAM is determined then
447 * an initial stack set up at the end.
448 */
449
450.align 4
451__rambase:
452.long 0
453__ramstart:
454.long 0
455__ramend:
456.long 0
diff --git a/arch/blackfin/mach-bf527/ints-priority.c b/arch/blackfin/mach-bf527/ints-priority.c
new file mode 100644
index 000000000000..1fa389793968
--- /dev/null
+++ b/arch/blackfin/mach-bf527/ints-priority.c
@@ -0,0 +1,100 @@
1/*
2 * File: arch/blackfin/mach-bf537/ints-priority.c
3 * Based on: arch/blackfin/mach-bf533/ints-priority.c
4 * Author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * Created:
7 * Description: Set up the interrupt priorities
8 *
9 * Modified:
10 * Copyright 2004-2007 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/module.h>
31#include <linux/irq.h>
32#include <asm/blackfin.h>
33
34void program_IAR(void)
35{
36 /* Program the IAR0 Register with the configured priority */
37 bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
38 ((CONFIG_IRQ_DMA0_ERROR - 7) << IRQ_DMA0_ERROR_POS) |
39 ((CONFIG_IRQ_DMAR0_BLK - 7) << IRQ_DMAR0_BLK_POS) |
40 ((CONFIG_IRQ_DMAR1_BLK - 7) << IRQ_DMAR1_BLK_POS) |
41 ((CONFIG_IRQ_DMAR0_OVR - 7) << IRQ_DMAR0_OVR_POS) |
42 ((CONFIG_IRQ_DMAR1_OVR - 7) << IRQ_DMAR1_OVR_POS) |
43 ((CONFIG_IRQ_PPI_ERROR - 7) << IRQ_PPI_ERROR_POS) |
44 ((CONFIG_IRQ_MAC_ERROR - 7) << IRQ_MAC_ERROR_POS));
45
46
47 bfin_write_SIC_IAR1(((CONFIG_IRQ_SPORT0_ERROR - 7) << IRQ_SPORT0_ERROR_POS) |
48 ((CONFIG_IRQ_SPORT1_ERROR - 7) << IRQ_SPORT1_ERROR_POS) |
49 ((CONFIG_IRQ_UART0_ERROR - 7) << IRQ_UART0_ERROR_POS) |
50 ((CONFIG_IRQ_UART1_ERROR - 7) << IRQ_UART1_ERROR_POS) |
51 ((CONFIG_IRQ_RTC - 7) << IRQ_RTC_POS) |
52 ((CONFIG_IRQ_PPI - 7) << IRQ_PPI_POS));
53
54 bfin_write_SIC_IAR2(((CONFIG_IRQ_SPORT0_RX - 7) << IRQ_SPORT0_RX_POS) |
55 ((CONFIG_IRQ_SPORT0_TX - 7) << IRQ_SPORT0_TX_POS) |
56 ((CONFIG_IRQ_SPORT1_RX - 7) << IRQ_SPORT1_RX_POS) |
57 ((CONFIG_IRQ_SPORT1_TX - 7) << IRQ_SPORT1_TX_POS) |
58 ((CONFIG_IRQ_TWI - 7) << IRQ_TWI_POS) |
59 ((CONFIG_IRQ_SPI - 7) << IRQ_SPI_POS) |
60 ((CONFIG_IRQ_UART0_RX - 7) << IRQ_UART0_RX_POS) |
61 ((CONFIG_IRQ_UART0_TX - 7) << IRQ_UART0_TX_POS));
62
63 bfin_write_SIC_IAR3(((CONFIG_IRQ_UART1_RX - 7) << IRQ_UART1_RX_POS) |
64 ((CONFIG_IRQ_UART1_TX - 7) << IRQ_UART1_TX_POS) |
65 ((CONFIG_IRQ_OPTSEC - 7) << IRQ_OPTSEC_POS) |
66 ((CONFIG_IRQ_CNT - 7) << IRQ_CNT_POS) |
67 ((CONFIG_IRQ_MAC_RX - 7) << IRQ_MAC_RX_POS) |
68 ((CONFIG_IRQ_PORTH_INTA - 7) << IRQ_PORTH_INTA_POS) |
69 ((CONFIG_IRQ_MAC_TX - 7) << IRQ_MAC_TX_POS) |
70 ((CONFIG_IRQ_PORTH_INTB - 7) << IRQ_PORTH_INTB_POS));
71
72 bfin_write_SIC_IAR4(((CONFIG_IRQ_TMR0 - 7) << IRQ_TMR0_POS) |
73 ((CONFIG_IRQ_TMR1 - 7) << IRQ_TMR1_POS) |
74 ((CONFIG_IRQ_TMR2 - 7) << IRQ_TMR2_POS) |
75 ((CONFIG_IRQ_TMR3 - 7) << IRQ_TMR3_POS) |
76 ((CONFIG_IRQ_TMR4 - 7) << IRQ_TMR4_POS) |
77 ((CONFIG_IRQ_TMR5 - 7) << IRQ_TMR5_POS) |
78 ((CONFIG_IRQ_TMR6 - 7) << IRQ_TMR6_POS) |
79 ((CONFIG_IRQ_TMR7 - 7) << IRQ_TMR7_POS));
80
81 bfin_write_SIC_IAR5(((CONFIG_IRQ_PORTG_INTA - 7) << IRQ_PORTG_INTA_POS) |
82 ((CONFIG_IRQ_PORTG_INTB - 7) << IRQ_PORTG_INTB_POS) |
83 ((CONFIG_IRQ_MEM_DMA0 - 7) << IRQ_MEM_DMA0_POS) |
84 ((CONFIG_IRQ_MEM_DMA1 - 7) << IRQ_MEM_DMA1_POS) |
85 ((CONFIG_IRQ_WATCH - 7) << IRQ_WATCH_POS) |
86 ((CONFIG_IRQ_PORTF_INTA - 7) << IRQ_PORTF_INTA_POS) |
87 ((CONFIG_IRQ_PORTF_INTB - 7) << IRQ_PORTF_INTB_POS) |
88 ((CONFIG_IRQ_SPI_ERROR - 7) << IRQ_SPI_ERROR_POS));
89
90 bfin_write_SIC_IAR6(((CONFIG_IRQ_NFC_ERROR - 7) << IRQ_NFC_ERROR_POS) |
91 ((CONFIG_IRQ_HDMA_ERROR - 7) << IRQ_HDMA_ERROR_POS) |
92 ((CONFIG_IRQ_HDMA - 7) << IRQ_HDMA_POS) |
93 ((CONFIG_IRQ_USB_EINT - 7) << IRQ_USB_EINT_POS) |
94 ((CONFIG_IRQ_USB_INT0 - 7) << IRQ_USB_INT0_POS) |
95 ((CONFIG_IRQ_USB_INT1 - 7) << IRQ_USB_INT1_POS) |
96 ((CONFIG_IRQ_USB_INT2 - 7) << IRQ_USB_INT2_POS) |
97 ((CONFIG_IRQ_USB_DMA - 7) << IRQ_USB_DMA_POS));
98
99 SSYNC();
100}
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index a57b52d207cd..1c5a86adfab7 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -42,7 +42,7 @@
42/* 42/*
43 * Name the Board for the /proc/cpuinfo 43 * Name the Board for the /proc/cpuinfo
44 */ 44 */
45char *bfin_board_name = "Bluetechnix CM BF533"; 45const char bfin_board_name[] = "Bluetechnix CM BF533";
46 46
47#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 47#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
48/* all SPI peripherals info goes here */ 48/* all SPI peripherals info goes here */
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 5c1e35d3c012..34b63920e272 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -43,7 +43,7 @@
43/* 43/*
44 * Name the Board for the /proc/cpuinfo 44 * Name the Board for the /proc/cpuinfo
45 */ 45 */
46char *bfin_board_name = "ADDS-BF533-EZKIT"; 46const char bfin_board_name[] = "ADDS-BF533-EZKIT";
47 47
48#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 48#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
49static struct platform_device rtc_device = { 49static struct platform_device rtc_device = {
diff --git a/arch/blackfin/mach-bf533/boards/generic_board.c b/arch/blackfin/mach-bf533/boards/generic_board.c
index 9bc1f0d0ab50..310b7772c458 100644
--- a/arch/blackfin/mach-bf533/boards/generic_board.c
+++ b/arch/blackfin/mach-bf533/boards/generic_board.c
@@ -35,7 +35,7 @@
35/* 35/*
36 * Name the Board for the /proc/cpuinfo 36 * Name the Board for the /proc/cpuinfo
37 */ 37 */
38char *bfin_board_name = "UNKNOWN BOARD"; 38const char bfin_board_name[] = "UNKNOWN BOARD";
39 39
40#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 40#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
41static struct platform_device rtc_device = { 41static struct platform_device rtc_device = {
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 8975e06ea158..f84be4eabfd1 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -46,7 +46,7 @@
46/* 46/*
47 * Name the Board for the /proc/cpuinfo 47 * Name the Board for the /proc/cpuinfo
48 */ 48 */
49char *bfin_board_name = "ADDS-BF533-STAMP"; 49const char bfin_board_name[] = "ADDS-BF533-STAMP";
50 50
51#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 51#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
52static struct platform_device rtc_device = { 52static struct platform_device rtc_device = {
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c
index 44dea05e1d03..52e2320307de 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c
@@ -43,7 +43,7 @@
43/* 43/*
44 * Name the Board for the /proc/cpuinfo 44 * Name the Board for the /proc/cpuinfo
45 */ 45 */
46char *bfin_board_name = "Bluetechnix CM BF537"; 46const char bfin_board_name[] = "Bluetechnix CM BF537";
47 47
48#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 48#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
49/* all SPI peripherals info goes here */ 49/* all SPI peripherals info goes here */
diff --git a/arch/blackfin/mach-bf537/boards/generic_board.c b/arch/blackfin/mach-bf537/boards/generic_board.c
index 6668c8e4a3fc..255da7a98481 100644
--- a/arch/blackfin/mach-bf537/boards/generic_board.c
+++ b/arch/blackfin/mach-bf537/boards/generic_board.c
@@ -49,7 +49,7 @@
49/* 49/*
50 * Name the Board for the /proc/cpuinfo 50 * Name the Board for the /proc/cpuinfo
51 */ 51 */
52char *bfin_board_name = "GENERIC Board"; 52const char bfin_board_name[] = "GENERIC Board";
53 53
54/* 54/*
55 * Driver needs to know address, irq and flag pin. 55 * Driver needs to know address, irq and flag pin.
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index f83a2544004d..87b808926789 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -47,7 +47,7 @@
47/* 47/*
48 * Name the Board for the /proc/cpuinfo 48 * Name the Board for the /proc/cpuinfo
49 */ 49 */
50char *bfin_board_name = "PNAV-1.0"; 50const char bfin_board_name[] = "PNAV-1.0";
51 51
52/* 52/*
53 * Driver needs to know address, irq and flag pin. 53 * Driver needs to know address, irq and flag pin.
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index f42ba3aa86d7..cc41f6c2ef4f 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -49,7 +49,7 @@
49/* 49/*
50 * Name the Board for the /proc/cpuinfo 50 * Name the Board for the /proc/cpuinfo
51 */ 51 */
52char *bfin_board_name = "ADDS-BF537-STAMP"; 52const char bfin_board_name[] = "ADDS-BF537-STAMP";
53 53
54/* 54/*
55 * Driver needs to know address, irq and flag pin. 55 * Driver needs to know address, irq and flag pin.
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 046e6d84bbfc..6b6490e66b30 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -49,7 +49,7 @@
49/* 49/*
50 * Name the Board for the /proc/cpuinfo 50 * Name the Board for the /proc/cpuinfo
51 */ 51 */
52char *bfin_board_name = "ADSP-BF548-EZKIT"; 52const char bfin_board_name[] = "ADSP-BF548-EZKIT";
53 53
54/* 54/*
55 * Driver needs to know address, irq and flag pin. 55 * Driver needs to know address, irq and flag pin.
@@ -560,7 +560,7 @@ static struct platform_device *ezkit_devices[] __initdata = {
560 560
561#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 561#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
562 &bf54x_spi_master0, 562 &bf54x_spi_master0,
563/* &bf54x_spi_master1,*/ 563 &bf54x_spi_master1,
564#endif 564#endif
565 565
566#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) 566#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
diff --git a/arch/blackfin/mach-bf548/dma.c b/arch/blackfin/mach-bf548/dma.c
index a8184113be48..957bf1366eff 100644
--- a/arch/blackfin/mach-bf548/dma.c
+++ b/arch/blackfin/mach-bf548/dma.c
@@ -64,6 +64,7 @@
64 (struct dma_register *) MDMA_D3_NEXT_DESC_PTR, 64 (struct dma_register *) MDMA_D3_NEXT_DESC_PTR,
65 (struct dma_register *) MDMA_S3_NEXT_DESC_PTR, 65 (struct dma_register *) MDMA_S3_NEXT_DESC_PTR,
66}; 66};
67EXPORT_SYMBOL(base_addr);
67 68
68int channel2irq(unsigned int channel) 69int channel2irq(unsigned int channel)
69{ 70{
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index cd827a1b6ba1..97aeb43fd8b4 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -42,7 +42,7 @@
42/* 42/*
43 * Name the Board for the /proc/cpuinfo 43 * Name the Board for the /proc/cpuinfo
44 */ 44 */
45char *bfin_board_name = "Bluetechnix CM BF561"; 45const char bfin_board_name[] = "Bluetechnix CM BF561";
46 46
47#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 47#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
48/* all SPI peripherals info goes here */ 48/* all SPI peripherals info goes here */
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 57e14edca8b1..059d516cec23 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -39,7 +39,7 @@
39/* 39/*
40 * Name the Board for the /proc/cpuinfo 40 * Name the Board for the /proc/cpuinfo
41 */ 41 */
42char *bfin_board_name = "ADDS-BF561-EZKIT"; 42const char bfin_board_name[] = "ADDS-BF561-EZKIT";
43 43
44#define ISP1761_BASE 0x2C0F0000 44#define ISP1761_BASE 0x2C0F0000
45#define ISP1761_IRQ IRQ_PF10 45#define ISP1761_IRQ IRQ_PF10
diff --git a/arch/blackfin/mach-bf561/boards/generic_board.c b/arch/blackfin/mach-bf561/boards/generic_board.c
index 4dfea5da674c..46816be4b2ba 100644
--- a/arch/blackfin/mach-bf561/boards/generic_board.c
+++ b/arch/blackfin/mach-bf561/boards/generic_board.c
@@ -32,7 +32,7 @@
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34 34
35char *bfin_board_name = "UNKNOWN BOARD"; 35const char bfin_board_name[] = "UNKNOWN BOARD";
36 36
37/* 37/*
38 * Driver needs to know address, irq and flag pin. 38 * Driver needs to know address, irq and flag pin.
diff --git a/arch/blackfin/mach-bf561/boards/tepla.c b/arch/blackfin/mach-bf561/boards/tepla.c
index c442eb23db5e..4a17c6da2a59 100644
--- a/arch/blackfin/mach-bf561/boards/tepla.c
+++ b/arch/blackfin/mach-bf561/boards/tepla.c
@@ -16,7 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/irq.h> 17#include <linux/irq.h>
18 18
19char *bfin_board_name = "Tepla-BF561"; 19const char bfin_board_name[] = "Tepla-BF561";
20 20
21/* 21/*
22 * Driver needs to know address, irq and flag pin. 22 * Driver needs to know address, irq and flag pin.
diff --git a/arch/blackfin/mach-common/ints-priority-dc.c b/arch/blackfin/mach-common/ints-priority-dc.c
index 2db3546fc874..c2f05fabedc1 100644
--- a/arch/blackfin/mach-common/ints-priority-dc.c
+++ b/arch/blackfin/mach-common/ints-priority-dc.c
@@ -52,7 +52,13 @@
52 * - 52 * -
53 */ 53 */
54 54
55unsigned long irq_flags = 0; 55/* Initialize this to an actual value to force it into the .data
56 * section so that we know it is properly initialized at entry into
57 * the kernel but before bss is initialized to zero (which is where
58 * it would live otherwise). The 0x1f magic represents the IRQs we
59 * cannot actually mask out in hardware.
60 */
61unsigned long irq_flags = 0x1f;
56 62
57/* The number of spurious interrupts */ 63/* The number of spurious interrupts */
58atomic_t num_spurious; 64atomic_t num_spurious;
diff --git a/arch/blackfin/mach-common/ints-priority-sc.c b/arch/blackfin/mach-common/ints-priority-sc.c
index d3b7672b2b94..2d2b63567b30 100644
--- a/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/arch/blackfin/mach-common/ints-priority-sc.c
@@ -58,7 +58,13 @@
58 * - 58 * -
59 */ 59 */
60 60
61unsigned long irq_flags = 0; 61/* Initialize this to an actual value to force it into the .data
62 * section so that we know it is properly initialized at entry into
63 * the kernel but before bss is initialized to zero (which is where
64 * it would live otherwise). The 0x1f magic represents the IRQs we
65 * cannot actually mask out in hardware.
66 */
67unsigned long irq_flags = 0x1f;
62 68
63/* The number of spurious interrupts */ 69/* The number of spurious interrupts */
64atomic_t num_spurious; 70atomic_t num_spurious;
@@ -92,10 +98,15 @@ static void __init search_IAR(void)
92 98
93 for (irqn = 0; irqn < NR_PERI_INTS; irqn++) { 99 for (irqn = 0; irqn < NR_PERI_INTS; irqn++) {
94 int iar_shift = (irqn & 7) * 4; 100 int iar_shift = (irqn & 7) * 4;
95 if (ivg == 101 if (ivg ==
96 (0xf & 102 (0xf &
103#ifndef CONFIG_BF52x
97 bfin_read32((unsigned long *)SIC_IAR0 + 104 bfin_read32((unsigned long *)SIC_IAR0 +
98 (irqn >> 3)) >> iar_shift)) { 105 (irqn >> 3)) >> iar_shift)) {
106#else
107 bfin_read32((unsigned long *)SIC_IAR0 +
108 ((irqn%32) >> 3) + ((irqn / 32) * 16)) >> iar_shift)) {
109#endif
99 ivg_table[irq_pos].irqno = IVG7 + irqn; 110 ivg_table[irq_pos].irqno = IVG7 + irqn;
100 ivg_table[irq_pos].isrflag = 1 << (irqn % 32); 111 ivg_table[irq_pos].isrflag = 1 << (irqn % 32);
101 ivg7_13[ivg].istop++; 112 ivg7_13[ivg].istop++;
@@ -140,7 +151,7 @@ static void bfin_core_unmask_irq(unsigned int irq)
140 151
141static void bfin_internal_mask_irq(unsigned int irq) 152static void bfin_internal_mask_irq(unsigned int irq)
142{ 153{
143#ifndef CONFIG_BF54x 154#ifdef CONFIG_BF53x
144 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() & 155 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() &
145 ~(1 << (irq - (IRQ_CORETMR + 1)))); 156 ~(1 << (irq - (IRQ_CORETMR + 1))));
146#else 157#else
@@ -155,7 +166,7 @@ static void bfin_internal_mask_irq(unsigned int irq)
155 166
156static void bfin_internal_unmask_irq(unsigned int irq) 167static void bfin_internal_unmask_irq(unsigned int irq)
157{ 168{
158#ifndef CONFIG_BF54x 169#ifdef CONFIG_BF53x
159 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() | 170 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() |
160 (1 << (irq - (IRQ_CORETMR + 1)))); 171 (1 << (irq - (IRQ_CORETMR + 1))));
161#else 172#else
@@ -750,13 +761,15 @@ int __init init_arch_irq(void)
750 int irq; 761 int irq;
751 unsigned long ilat = 0; 762 unsigned long ilat = 0;
752 /* Disable all the peripheral intrs - page 4-29 HW Ref manual */ 763 /* Disable all the peripheral intrs - page 4-29 HW Ref manual */
753#ifdef CONFIG_BF54x 764#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x)
754 bfin_write_SIC_IMASK0(SIC_UNMASK_ALL); 765 bfin_write_SIC_IMASK0(SIC_UNMASK_ALL);
755 bfin_write_SIC_IMASK1(SIC_UNMASK_ALL); 766 bfin_write_SIC_IMASK1(SIC_UNMASK_ALL);
756 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
757 bfin_write_SIC_IWR0(IWR_ENABLE_ALL); 767 bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
758 bfin_write_SIC_IWR1(IWR_ENABLE_ALL); 768 bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
769#ifdef CONFIG_BF54x
770 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
759 bfin_write_SIC_IWR2(IWR_ENABLE_ALL); 771 bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
772#endif
760#else 773#else
761 bfin_write_SIC_IMASK(SIC_UNMASK_ALL); 774 bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
762 bfin_write_SIC_IWR(IWR_ENABLE_ALL); 775 bfin_write_SIC_IWR(IWR_ENABLE_ALL);
@@ -787,7 +800,7 @@ int __init init_arch_irq(void)
787 800
788 switch (irq) { 801 switch (irq) {
789#ifdef CONFIG_IRQCHIP_DEMUX_GPIO 802#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
790#ifndef CONFIG_BF54x 803#if defined(CONFIG_BF53x)
791 case IRQ_PROG_INTA: 804 case IRQ_PROG_INTA:
792 set_irq_chained_handler(irq, 805 set_irq_chained_handler(irq,
793 bfin_demux_gpio_irq); 806 bfin_demux_gpio_irq);
@@ -798,7 +811,7 @@ int __init init_arch_irq(void)
798 bfin_demux_gpio_irq); 811 bfin_demux_gpio_irq);
799 break; 812 break;
800#endif 813#endif
801#else 814#elif defined(CONFIG_BF54x)
802 case IRQ_PINT0: 815 case IRQ_PINT0:
803 set_irq_chained_handler(irq, 816 set_irq_chained_handler(irq,
804 bfin_demux_gpio_irq); 817 bfin_demux_gpio_irq);
@@ -815,7 +828,20 @@ int __init init_arch_irq(void)
815 set_irq_chained_handler(irq, 828 set_irq_chained_handler(irq,
816 bfin_demux_gpio_irq); 829 bfin_demux_gpio_irq);
817 break; 830 break;
818#endif /*CONFIG_BF54x */ 831#elif defined(CONFIG_BF52x)
832 case IRQ_PORTF_INTA:
833 set_irq_chained_handler(irq,
834 bfin_demux_gpio_irq);
835 break;
836 case IRQ_PORTG_INTA:
837 set_irq_chained_handler(irq,
838 bfin_demux_gpio_irq);
839 break;
840 case IRQ_PORTH_INTA:
841 set_irq_chained_handler(irq,
842 bfin_demux_gpio_irq);
843 break;
844#endif
819#endif 845#endif
820 default: 846 default:
821 set_irq_handler(irq, handle_simple_irq); 847 set_irq_handler(irq, handle_simple_irq);
@@ -880,14 +906,15 @@ void do_irq(int vec, struct pt_regs *fp)
880 } else { 906 } else {
881 struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst; 907 struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst;
882 struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop; 908 struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop;
883#ifdef CONFIG_BF54x 909#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x)
884 unsigned long sic_status[3]; 910 unsigned long sic_status[3];
885 911
886 SSYNC(); 912 SSYNC();
887 sic_status[0] = bfin_read_SIC_ISR(0) & bfin_read_SIC_IMASK(0); 913 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
888 sic_status[1] = bfin_read_SIC_ISR(1) & bfin_read_SIC_IMASK(1); 914 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
889 sic_status[2] = bfin_read_SIC_ISR(2) & bfin_read_SIC_IMASK(2); 915#ifdef CONFIG_BF54x
890 916 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
917#endif
891 for (;; ivg++) { 918 for (;; ivg++) {
892 if (ivg >= ivg_stop) { 919 if (ivg >= ivg_stop) {
893 atomic_inc(&num_spurious); 920 atomic_inc(&num_spurious);