summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /arch/arm
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Makefile120
-rw-r--r--arch/arm/boot/Makefile13
-rw-r--r--arch/arm/boot/bootp/Makefile3
-rw-r--r--arch/arm/boot/bootp/init.S67
-rw-r--r--arch/arm/boot/compressed/Makefile2
-rw-r--r--arch/arm/boot/compressed/head-ftvpci.S7
-rw-r--r--arch/arm/boot/compressed/head-l7200.S13
-rw-r--r--arch/arm/boot/compressed/head-sa1100.S8
-rw-r--r--arch/arm/boot/compressed/head-shark.S121
-rw-r--r--arch/arm/boot/compressed/head.S8
-rw-r--r--arch/arm/boot/compressed/ofw-shark.c216
-rw-r--r--arch/arm/boot/compressed/setup-sa1100.S14
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in5
-rw-r--r--arch/arm/kernel/Makefile42
-rw-r--r--arch/arm/kernel/bios32.c32
-rw-r--r--arch/arm/kernel/dma-arc.c16
-rw-r--r--arch/arm/kernel/dma-rpc.c68
-rw-r--r--arch/arm/kernel/dma.c2
-rw-r--r--arch/arm/kernel/ecard.c2
-rw-r--r--arch/arm/kernel/entry-armo.S6
-rw-r--r--arch/arm/kernel/fiq.c22
-rw-r--r--arch/arm/kernel/irq.c2
-rw-r--r--arch/arm/kernel/process.c23
-rw-r--r--arch/arm/kernel/sys_arm.c2
-rw-r--r--arch/arm/kernel/time.c27
-rw-r--r--arch/arm/kernel/traps.c4
-rw-r--r--arch/arm/lib/Makefile76
-rw-r--r--arch/arm/lib/io-acorn.S24
-rw-r--r--arch/arm/lib/io-pcio.S28
-rw-r--r--arch/arm/lib/io-readsb.S5
-rw-r--r--arch/arm/lib/io-readsl-armv3.S76
-rw-r--r--arch/arm/lib/io-readsl-armv4.S (renamed from arch/arm/lib/io-readsl.S)5
-rw-r--r--arch/arm/lib/io-readsw-armv3.S5
-rw-r--r--arch/arm/lib/io-readsw-armv4.S9
-rw-r--r--arch/arm/lib/io-writesb.S13
-rw-r--r--arch/arm/lib/io-writesl.S2
-rw-r--r--arch/arm/lib/io-writesw-armv3.S6
-rw-r--r--arch/arm/lib/io-writesw-armv4.S45
-rw-r--r--arch/arm/mach-sa1100/Makefile11
-rw-r--r--arch/arm/mach-sa1100/hw.c58
-rw-r--r--arch/arm/mach-shark/Makefile13
-rw-r--r--arch/arm/mm/Makefile28
-rw-r--r--arch/arm/mm/fault-armo.c10
-rw-r--r--arch/arm/mm/fault-armv.c145
-rw-r--r--arch/arm/mm/fault-common.c47
-rw-r--r--arch/arm/mm/init.c28
-rw-r--r--arch/arm/mm/mm-armv.c2
-rw-r--r--arch/arm/mm/proc-arm6,7.S12
-rw-r--r--arch/arm/mm/proc-arm720.S20
-rw-r--r--arch/arm/mm/proc-arm920.S6
-rw-r--r--arch/arm/mm/proc-sa110.S4
-rw-r--r--arch/arm/nwfpe/Makefile34
-rw-r--r--arch/arm/vmlinux-armo.lds.in2
-rw-r--r--arch/arm/vmlinux-armv.lds.in2
54 files changed, 1044 insertions, 517 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c19ccddec..0320dba31 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -12,25 +12,18 @@
#
# Copyright (C) 1995-2000 by Russell King
-OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
-CPP := $(CC) -E
-LINKFLAGS := -p -X -T arch/arm/vmlinux.lds
-ARCHCC := $(word 1,$(CC))
-
-AFLAGS += -mno-fpu
-CFLAGS_PIPE := -pipe
-CFLAGS := $(CFLAGS) $(CFLAGS_PIPE) -msoft-float
+LINKFLAGS :=-p -X -T arch/arm/vmlinux.lds
+GZFLAGS :=-9
+CFLAGS +=-fno-common -pipe
ifdef CONFIG_FRAME_POINTER
-CFLAGS := $(CFLAGS:-fomit-frame-pointer=)
+CFLAGS :=$(CFLAGS:-fomit-frame-pointer=)
endif
ifdef CONFIG_DEBUG_INFO
-CFLAGS += -g
+CFLAGS +=-g
endif
-GZFLAGS = -9
-
# Ensure this is ld "2.9.4" or later
NEW_LINKER := $(shell $(LD) --gc-sections --version >/dev/null 2>&1; echo $$?)
@@ -40,61 +33,42 @@ dummy:; @echo '*** ${VERSION}.${PATCHLEVEL} kernels no longer build correctly w
@false
endif
-# GCC 2.7 uses different options to later compilers; sort out which we have
-NEW_GCC := $(shell $(CC) --version 2>&1 | grep '^2\.7' > /dev/null; echo $$?)
-
-#
-# select flags depending on the compiler
+# Select CPU dependent flags. Note that order of declaration is important;
+# the options further down the list override previous items.
#
-ifneq ($(NEW_GCC),0)
-CFLAGS += -mshort-load-bytes
-CFLAGS_PROC_CPU_26 := -mcpu=arm3 -mapcs-26 -Os
-CFLAGS_PROC_CPU_32v3 := -march=armv3
-CFLAGS_PROC_CPU_32v4 := -march=armv4
-else
-CFLAGS += -DNO_TEXT_SECTIONS
-CFLAGS_PROC_CPU_26 := -m3
-CFLAGS_PROC_CPU_32v3 := -m6
-CFLAGS_PROC_CPU_32v4 := -m6
-endif
+apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3 -Os
+apcs-$(CONFIG_CPU_32) :=-mapcs-32
+
+arch-$(CONFIG_CPU_32v3) :=-march=armv3
+arch-$(CONFIG_CPU_32v4) :=-march=armv4
+arch-$(CONFIG_CPU_32v5) :=-march=armv5
+
+proc-$(CONFIG_CPU_32v3) :=-marmv3m
+proc-$(CONFIG_CPU_32v4) :=-marmv4
+proc-$(CONFIG_CPU_32v5) :=-marmv5
+
+tune-$(CONFIG_CPU_ARM610) :=-mtune=arm610
+tune-$(CONFIG_CPU_ARM710) :=-mtune=arm710
+tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi
+tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi
+tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
+tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100
+
+CFLAGS += $(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float
+AFLAGS += $(apcs-y) $(proc-y) -mno-fpu
+
+LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
-#
-# Select CPU dependent flags
-#
ifeq ($(CONFIG_CPU_26),y)
- PROCESSOR = armo
- TEXTADDR = 0x02080000
- CFLAGS += $(CFLAGS_PROC_CPU_26)
- AFLAGS += -mapcs-26
+PROCESSOR = armo
+TEXTADDR = 0x02080000
endif
ifeq ($(CONFIG_CPU_32),y)
- PROCESSOR = armv
- TEXTADDR = 0xC0008000
- ifeq ($(CONFIG_CPU_32v4),y)
- CFLAGS += $(CFLAGS_PROC_CPU_32v4)
- AFLAGS += -mapcs-32 -marmv4
- else
- CFLAGS += $(CFLAGS_PROC_CPU_32v3)
- AFLAGS += -mapcs-32 -marmv3m
- endif
-
- opt-$(CONFIG_CPU_ARM6) := -mtune=arm6
- opt-$(CONFIG_CPU_ARM7) := -mtune=arm7
- opt-$(CONFIG_CPU_ARM720) := -mtune=arm7tdmi
- opt-$(CONFIG_CPU_ARM920) := -mtune=arm9tdmi
- opt-$(CONFIG_CPU_SA110) := -mtune=strongarm110
- opt-$(CONFIG_CPU_SA1100) := -mtune=strongarm110
-
- ifneq ($(NEW_GCC),0)
- CFLAGS += $(opt-y)
- endif
+PROCESSOR = armv
+TEXTADDR = 0xC0008000
endif
-LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
-
-export LIBGCC MACHINE PROCESSOR TEXTADDR GZFLAGS
-
ifeq ($(CONFIG_ARCH_ARCA5K),y)
MACHINE = arc
endif
@@ -132,6 +106,10 @@ MACHINE = shark
endif
ifeq ($(CONFIG_ARCH_SA1100),y)
+ifeq ($(CONFIG_SA1111),y)
+# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
+TEXTADDR = 0xc0208000
+endif
MACHINE = sa1100
endif
@@ -143,6 +121,13 @@ ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
MACHINE = integrator
endif
+ifeq ($(CONFIG_ARCH_CLPS711X),y)
+TEXTADDR = 0xc0018000
+MACHINE = clps711x
+endif
+
+export LIBGCC MACHINE PROCESSOR TEXTADDR GZFLAGS
+
# Only set INCDIR if its not already defined above
# Grr, ?= doesn't work as all the other assignment operators do. Make bug?
ifeq ($(origin INCDIR), undefined)
@@ -158,8 +143,7 @@ endif
HEAD := arch/arm/kernel/head-$(PROCESSOR).o \
arch/arm/kernel/init_task.o
-SUBDIRS += arch/arm/kernel arch/arm/mm arch/arm/lib \
- arch/arm/nwfpe
+SUBDIRS += arch/arm/kernel arch/arm/mm arch/arm/lib arch/arm/nwfpe
CORE_FILES := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
LIBS := arch/arm/lib/lib.o arch/arm/lib/lib.a $(LIBS) $(LIBGCC)
@@ -167,14 +151,6 @@ ifeq ($(CONFIG_NWFPE),y)
LIBS := arch/arm/nwfpe/math-emu.o $(LIBS)
endif
-ifeq ($(CONFIG_ARCH_ACORN),y)
-SUBDIRS += drivers/acorn
-DRIVERS += drivers/acorn/block/acorn-block.a
-DRIVERS += drivers/acorn/char/acorn-char.o
-DRIVERS += drivers/acorn/net/acorn-net.o
-DRIVERS += drivers/acorn/scsi/acorn-scsi.a
-endif
-
ifeq ($(CONFIG_ARCH_CLPS7500),y)
SUBDIRS += drivers/acorn/char
DRIVERS += drivers/acorn/char/acorn-char.o
@@ -230,6 +206,7 @@ zImg:; @$(MAKEBOOT) zImage
Img:; @$(MAKEBOOT) Image
i:; @$(MAKEBOOT) install
zi:; @$(MAKEBOOT) zinstall
+bp:; @$(MAKEBOOT) bootpImage
#
# Configuration targets. Use these to select a
@@ -237,9 +214,10 @@ zi:; @$(MAKEBOOT) zinstall
CFGS= a5k_config ebsa110_config \
footbridge_config rpc_config \
brutus_config victor_config \
- empeg_config thinclient_config \
+ empeg_config graphicsclient_config \
assabet_config lart_config \
- cerf_config lusl7200_config
+ cerf_config lusl7200_config \
+ sherman_config pangolin_config
$(CFGS):
@( \
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index f74033b36..7b13b1bcb 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -83,15 +83,18 @@ ZTEXTADDR = 0xc0008000
ZRELADDR = 0xc0008000
ifeq ($(CONFIG_SA1100_VICTOR),y)
ZTEXTADDR = 0x00002000
- ZBSSADDR = 0xc0100000
+ ZBSSADDR = 0xc0200000
endif
ifeq ($(CONFIG_SA1100_SHERMAN),y)
ZTEXTADDR = 0x00050000
- ZBSSADDR = 0xc0100000
+ ZBSSADDR = 0xc0200000
endif
ifeq ($(CONFIG_SA1100_GRAPHICSCLIENT),y)
ZTEXTADDR = 0xC0200000
endif
+ifeq ($(CONFIG_SA1111),y)
+ ZRELADDR = 0xc0208000
+endif
endif
#
@@ -105,15 +108,15 @@ endif
export SYSTEM ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS INITRD_VIRT PARAMS_PHYS
Image: $(CONFIGURE) $(SYSTEM)
- $(OBJCOPY) $(SYSTEM) $@
+ $(OBJCOPY) -O binary -R .note -R .comment -S $(SYSTEM) $@
bzImage: zImage
zImage: $(CONFIGURE) compressed/vmlinux
- $(OBJCOPY) compressed/vmlinux $@
+ $(OBJCOPY) -O binary -R .note -R .comment -S compressed/vmlinux $@
bootpImage: bootp/bootp
- $(OBJCOPY) bootp/bootp $@
+ $(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
compressed/vmlinux: $(TOPDIR)/vmlinux dep
@$(MAKE) -C compressed vmlinux
diff --git a/arch/arm/boot/bootp/Makefile b/arch/arm/boot/bootp/Makefile
index 918e3eb9e..adeeeddc5 100644
--- a/arch/arm/boot/bootp/Makefile
+++ b/arch/arm/boot/bootp/Makefile
@@ -7,7 +7,8 @@ INITRD =$(ZSYSTEM)
ZLDFLAGS =-p -X -T bootp.lds \
--defsym initrd_addr=$(INITRD_PHYS) \
--defsym initrd_virt=$(INITRD_VIRT) \
- --defsym params=$(PARAMS_PHYS)
+ --defsym params=$(PARAMS_PHYS) \
+ --defsym kernel_addr=$(ZTEXTADDR)
all: bootp
diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S
index 2b498b7bb..9963fbc2b 100644
--- a/arch/arm/boot/bootp/init.S
+++ b/arch/arm/boot/bootp/init.S
@@ -12,33 +12,59 @@
*/
.section .start,#alloc,#execinstr
.type _entry, #function
-_entry:
-kernel_addr: adr r10, initdata
- ldmia r10, {r11, r12}
+_entry: adr r10, initdata
+ ldr r11, initdata
sub r11, r10, r11 @ work out exec offset
- add r12, r12, r11 @ correct "splitify"
- mov pc, r12 @ jump to splitify
+ b splitify
.size _entry,. - _entry
.type initdata, #object
initdata: .word initdata @ compiled address of this
- .word splitify
.size initdata,. - initdata
.text
splitify: adr r13, data
- ldmia r13!, {r4-r6} @ move the kernel
+ ldmia r13!, {r4-r6} @ move the initrd
add r4, r4, r11 @ correction
- mov r12, r5
bl move
- ldmia r13!, {r4-r6} @ then the initrd
+ ldmia r13!, {r4-r6} @ then the kernel
+ mov r12, r5
add r4, r4, r11 @ correction
bl move
- ldmib r13, {r5,r6,r7} @ get size and addr of initrd
- add r7, r7, #16*4 @ offset of initrd_start in param_struct
- stmia r7, {r5,r6} @ save in param_struct
+/*
+ * Setup the initrd parameters to pass to the kernel. This can either be
+ * passed in via a param_struct or a tag list. We spot the param_struct
+ * method by looking at the first word; this should either indicate a page
+ * size of 4K, 16K or 32K.
+ */
+ ldmia r13, {r5-r8} @ get size and addr of initrd
+ @ r5 = ATAG_INITRD
+ @ r6 = initrd start
+ @ r7 = initrd end
+ @ r8 = param_struct address
+ ldr r9, [r8, #0] @ no param struct?
+ teq r9, #0x1000 @ 4K?
+ teqne r9, #0x4000 @ 16K?
+ teqne r9, #0x8000 @ 32K?
+ beq no_taglist
+
+/*
+ * find the end of the tag list, and then add an INITRD tag on the end.
+ */
+taglist: ldr r9, [r8, #0] @ tag length
+ teq r9, #0 @ last tag?
+ addne r8, r8, r9
+ bne taglist
+
+ mov r4, #16 @ length of initrd tag
+ mov r9, #0 @ end of tag list terminator
+ stmia r8, {r4, r5, r6, r7, r9}
+ mov pc, r12 @ call kernel
+
+no_taglist: add r8, r8, #16*4
+ stmia r8, {r6,r7} @ save in param_struct
mov pc, r12 @ call kernel
move: ldmia r4!, {r7 - r10} @ move 32-bytes at a time
@@ -49,17 +75,18 @@ move: ldmia r4!, {r7 - r10} @ move 32-bytes at a time
bcs move
mov pc, lr
-data: .word kernel_start
- .word kernel_addr
- .word kernel_len
-
- .word initrd_start
+data: .word initrd_start
.word initrd_addr
.word initrd_len
- .word initrd_virt
- .word initrd_len
- .word params
+ .word kernel_start
+ .word kernel_addr
+ .word kernel_len
+
+ .word 0x54410005 @ r5 = ATAG_INITRD
+ .word initrd_virt @ r6
+ .word initrd_len @ r7
+ .word params @ r8
.type kernel_start,#object
.type initrd_start,#object
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index bf8f1c947..7f077cd21 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -66,7 +66,7 @@ $(HEAD): $(HEAD:.o=.S)
$(CC) $(AFLAGS) -traditional -c $(HEAD:.o=.S)
piggy.o: $(SYSTEM)
- $(OBJCOPY) $(SYSTEM) piggy
+ $(OBJCOPY) -O binary -R .note -R .comment -S $(SYSTEM) piggy
gzip $(GZFLAGS) < piggy > piggy.gz
$(LD) -r -o $@ -b binary piggy.gz
rm -f piggy piggy.gz
diff --git a/arch/arm/boot/compressed/head-ftvpci.S b/arch/arm/boot/compressed/head-ftvpci.S
index a8c806ef3..8e10667ca 100644
--- a/arch/arm/boot/compressed/head-ftvpci.S
+++ b/arch/arm/boot/compressed/head-ftvpci.S
@@ -6,6 +6,13 @@
* Special startup code for FTV PCI board.
*/
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
.section ".start", #alloc, #execinstr
ftv_start:
mcr p15, 0, r0, c7, c5, 0 @ flush I cache
diff --git a/arch/arm/boot/compressed/head-l7200.S b/arch/arm/boot/compressed/head-l7200.S
index ecf4d6881..8ab9eafdb 100644
--- a/arch/arm/boot/compressed/head-l7200.S
+++ b/arch/arm/boot/compressed/head-l7200.S
@@ -3,7 +3,7 @@
*
* Copyright (C) 2000 Steve Hill <sjhill@cotw.com>
*
- * Some code borrowed from Nicola Pitre's 'head-sa1100.S' file. This
+ * Some code borrowed from Nicolas Pitre's 'head-sa1100.S' file. This
* is merged with head.S by the linker.
*/
@@ -16,15 +16,14 @@
.section ".start", #alloc, #execinstr
__L7200_start:
-
mov r0, #0x00100000 @ FLASH address of initrd
mov r2, #0xf1000000 @ RAM address of initrd
- add r1, r2, #0x00700000 @ Size of initrd
+ add r3, r2, #0x00700000 @ Size of initrd
1:
- ldmia r0!, {r3, r4, r5, r6}
- stmia r2!, {r3, r4, r5, r6}
- cmp r2, r1
+ ldmia r0!, {r4, r5, r6, r7}
+ stmia r2!, {r4, r5, r6, r7}
+ cmp r2, r3
ble 1b
-
+
mov r8, #0 @ Zero it out
mov r7, #19 @ Set architecture ID
diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S
index 73cef4bd8..f49ceb5e6 100644
--- a/arch/arm/boot/compressed/head-sa1100.S
+++ b/arch/arm/boot/compressed/head-sa1100.S
@@ -11,10 +11,6 @@
#include <linux/linkage.h>
#include <asm/mach-types.h>
-#ifndef CONFIG_ARCH_SA1100
-#error What am I doing here...
-#endif
-
.section ".start", #alloc, #execinstr
__SA1100_start:
@@ -54,6 +50,8 @@ __SA1100_start:
bic r0, r0, #0x0d @ clear WB, DC, MMU
bic r0, r0, #0x1000 @ clear Icache
mcr p15, 0, r0, c1, c0, 0
+
+#ifdef CONFIG_ANGELBOOT
/*
* Pause for a short time so that we give enough time
* for the host to start a terminal up.
@@ -61,3 +59,5 @@ __SA1100_start:
mov r0, #0x00200000
1: subs r0, r0, #1
bne 1b
+#endif
+
diff --git a/arch/arm/boot/compressed/head-shark.S b/arch/arm/boot/compressed/head-shark.S
new file mode 100644
index 000000000..817b75366
--- /dev/null
+++ b/arch/arm/boot/compressed/head-shark.S
@@ -0,0 +1,121 @@
+/* The head-file for the Shark
+ * by Alexander.Schulz@stud.uni-karlsruhe.de
+ *
+ * Does the following:
+ * - get the memory layout from firmware. This can only be done as long as the mmu
+ * is still on.
+ * - switch the mmu off, so we have physical addresses
+ * - copy the kernel to 0x08508000. This is done to have a fixed address where the
+ * C-parts (misc.c) are executed. This address must be known at compile-time,
+ * but the load-address of the kernel depends on how much memory is installed.
+ * - Jump to this location.
+ * - Set r8 with 0, r7 with the architecture ID for head.S
+ */
+
+#include <linux/linkage.h>
+
+#include <asm/assembler.h>
+
+ .section ".start", #alloc, #execinstr
+
+ b __beginning
+
+__serial_addr: .long 0xf7eff3f8
+ .long 0 @ space
+__ofw_data: .long 0 @ the number of memory blocks
+ .space 128 @ (startaddr,size) ...
+ .space 128 @ bootargs
+ .align
+
+__beginning: mov r4, r0 @ save the entry to the firmware
+
+ mov r0, #0xC0 @ disable irq and fiq
+ mov r1, r0
+ mrs r3, cpsr_all
+ bic r2, r3, r0
+ eor r2, r2, r1
+ msr cpsr_all, r2
+
+ ldr r0, __serial_addr @ disable serial interrupt
+ mov r1, #0 @ hangs the machine, I don t know why.
+ strb r1, [r0, #0x01]
+
+ mov r0, r4 @ get the Memory layout from firmware
+ adr r1, __ofw_data
+ add r2, r1, #4
+ mov lr, pc
+ b SYMBOL_NAME(ofw_init)
+ mov r1, #0
+
+ adr r2, __mmu_off @ calculate physical address
+ sub r2, r2, #0xf0000000 @ openprom maps us at f000 virt, 0e50 phys
+ adr r0, __ofw_data
+ ldr r0, [r0, #4]
+ add r2, r2, r0
+ add r2, r2, #0x00500000
+
+ mrc p15, 0, r3, c1, c0
+ bic r3, r3, #0xC @ Write Buffer and DCache
+ bic r3, r3, #0x1000 @ ICache
+ mcr p15, 0, r3, c1, c0 @ disabled
+
+ mov r0, #0
+ mcr p15, 0, r0, c7, c7 @ flush I,D caches on v4
+ mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
+ mcr p15, 0, r0, c8, c7 @ flush I,D TLBs on v4
+
+ bic r3, r3, #0x1 @ MMU
+ mcr p15, 0, r3, c1, c0 @ disabled
+
+ mov pc, r2
+
+__copy_target: .long 0x08508000
+__copy_end: .long 0x08608000
+
+ .word _start
+ .word __bss_start
+
+ .align
+__temp_stack: .space 128
+
+__mmu_off:
+ adr r0, __ofw_data
+ ldr r0, [r0, #4]
+ orr r0, r0, #0x00600000
+
+ ldr r1, __copy_end
+ ldr r3, __copy_target
+
+/* r0 = 0x0e600000 (current end of kernelcode)
+ * r3 = 0x08508000 (where it should begin)
+ * r1 = 0x08608000 (end of copying area, 1MB)
+ * The kernel is compressed, so 1 MB should be enough.
+ * copy the kernel to the beginning of physical memory
+ * We start from the highest address, so we can copy
+ * from 0x08500000 to 0x08508000 if we have only 8MB
+ */
+
+
+__Copy: ldr r2, [r0], #-4
+ str r2, [r1], #-4
+ teq r1, r3
+ bne __Copy
+ /* and jump to it */
+ adr r2, __go_on
+ adr r0, __ofw_data
+ ldr r0, [r0, #4]
+ sub r2, r2, r0
+ sub r2, r2, #0x00500000
+ ldr r0, __copy_target
+ add r2, r2, r0
+ mov pc, r2
+
+__go_on:
+ adr sp, __temp_stack
+ add sp, sp, #128
+ adr r0, __ofw_data
+ mov lr, pc
+ b SYMBOL_NAME(create_params)
+
+ mov r8, #0
+ mov r7, #15
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 21bdb43c0..0e384ec72 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -112,8 +112,7 @@ start:
*/
.text
-1: mrc p15, 0, r6, c0, c0 @ get processor ID
- adr r2, LC0
+1: adr r2, LC0
ldmia r2, {r2, r3, r4, r5, sp}
mov r0, #0
@@ -124,14 +123,15 @@ start:
cmp r2, r3
blt 1b
+ mrc p15, 0, r6, c0, c0 @ get processor ID
bl cache_on
mov r1, sp @ malloc space above stack
add r2, sp, #0x10000 @ 64k max
teq r4, r5 @ will we overwrite ourselves?
- moveq r5, r2
- movne r5, r4
+ moveq r5, r2 @ decompress after image
+ movne r5, r4 @ decompress to final location
mov r0, r5
mov r3, r7
diff --git a/arch/arm/boot/compressed/ofw-shark.c b/arch/arm/boot/compressed/ofw-shark.c
new file mode 100644
index 000000000..0b4474c59
--- /dev/null
+++ b/arch/arm/boot/compressed/ofw-shark.c
@@ -0,0 +1,216 @@
+/*
+ * linux/arch/arm/boot/compressed/ofw-shark.c
+ *
+ * by Alexander.Schulz@stud.uni-karlsruhe.de
+ *
+ * This file is used to get some basic information
+ * about the memory layout of the shark we are running
+ * on. Memory is usually divided in blocks a 8 MB.
+ * And bootargs are copied from OpenFirmware.
+ */
+
+
+#include <linux/kernel.h>
+#include <asm/setup.h>
+#include <asm/page.h>
+
+
+asmlinkage void
+create_params (unsigned long *buffer)
+{
+ /* Is there a better address? Also change in kernel/arch.c */
+ struct param_struct *params = (struct param_struct *) 0x08003000;
+ int j,i,m,k,nr_banks,size;
+
+ for (j=0;j<256;j++) params->u1.unused[j]=0;
+
+ size=0;
+ nr_banks=(unsigned int) buffer[0];
+ if (nr_banks > NR_BANKS) nr_banks = NR_BANKS;
+ for (j=0;j<nr_banks;j++){
+ /* search the lowest address and put it into the next entry */
+ /* not a fast sort algorithm, but there are at most 8 entries */
+ /* and this is used only once anyway */
+ m=0xffffffff;
+ for (i=0;i<(unsigned int) buffer[0];i++){
+ if (buffer[2*i+1]<m) {
+ m=buffer[2*i+1];
+ k=i;
+ }
+ }
+
+ /* using pages_in_bank for startaddress and size */
+ /* start is in bytes, size in pages and not bigger than 0x2000 */
+ /* This is decoded in fixup_shark in arch/arm/kernel/arch.c */
+ params->u1.s.pages_in_bank[j]=buffer[2*k+1]|(buffer[2*k+2]/PAGE_SIZE);
+ size += buffer[2*k+2];
+
+ buffer[2*k+1]=0xffffffff; /* mark as copied */
+ }
+
+ params->u1.s.page_size = PAGE_SIZE;
+ params->u1.s.nr_pages = size/PAGE_SIZE;
+ params->u1.s.flags = FLAG_READONLY;
+
+ /* Copy over the bootargs */
+ for (j=0;j<128/4;j++) {
+ ((unsigned long *) params->commandline)[j]=buffer[33+j];
+ }
+}
+
+
+typedef int (*ofw_handle_t)(void *);
+
+/* Everything below is called with a wrong MMU setting.
+ * This means: no string constants, no initialization of
+ * arrays, no global variables! This is ugly but I didn't
+ * want to write this in assembler :-)
+ */
+
+int
+of_decode_int(const unsigned char *p)
+{
+ unsigned int i = *p++ << 8;
+ i = (i + *p++) << 8;
+ i = (i + *p++) << 8;
+ return (i + *p);
+}
+
+int
+OF_finddevice(ofw_handle_t openfirmware, char *name)
+{
+ unsigned int args[8];
+ char service[12];
+
+ service[0]='f';
+ service[1]='i';
+ service[2]='n';
+ service[3]='d';
+ service[4]='d';
+ service[5]='e';
+ service[6]='v';
+ service[7]='i';
+ service[8]='c';
+ service[9]='e';
+ service[10]='\0';
+
+ args[0]=(unsigned int)service;
+ args[1]=1;
+ args[2]=1;
+ args[3]=(unsigned int)name;
+
+ if (openfirmware(args) == -1)
+ return -1;
+ return args[4];
+}
+
+int
+OF_getproplen(ofw_handle_t openfirmware, int handle, char *prop)
+{
+ unsigned int args[8];
+ char service[12];
+
+ service[0]='g';
+ service[1]='e';
+ service[2]='t';
+ service[3]='p';
+ service[4]='r';
+ service[5]='o';
+ service[6]='p';
+ service[7]='l';
+ service[8]='e';
+ service[9]='n';
+ service[10]='\0';
+
+ args[0] = (unsigned int)service;
+ args[1] = 2;
+ args[2] = 1;
+ args[3] = (unsigned int)handle;
+ args[4] = (unsigned int)prop;
+
+ if (openfirmware(args) == -1)
+ return -1;
+ return args[5];
+}
+
+int
+OF_getprop(ofw_handle_t openfirmware, int handle, char *prop, void *buf, unsigned int buflen)
+{
+ unsigned int args[8];
+ char service[8];
+
+ service[0]='g';
+ service[1]='e';
+ service[2]='t';
+ service[3]='p';
+ service[4]='r';
+ service[5]='o';
+ service[6]='p';
+ service[7]='\0';
+
+ args[0] = (unsigned int)service;
+ args[1] = 4;
+ args[2] = 1;
+ args[3] = (unsigned int)handle;
+ args[4] = (unsigned int)prop;
+ args[5] = (unsigned int)buf;
+ args[6] = buflen;
+
+ if (openfirmware(args) == -1)
+ return -1;
+ return args[7];
+}
+
+asmlinkage void ofw_init(ofw_handle_t o, int *nomr, int *pointer)
+{
+ int phandle,i,mem_len,buffer[32];
+ char temp[12];
+
+ temp[0]='/';
+ temp[1]='m';
+ temp[2]='e';
+ temp[3]='m';
+ temp[4]='o';
+ temp[5]='r';
+ temp[6]='y';
+ temp[7]='\0';
+
+ phandle=OF_finddevice(o,temp);
+
+ temp[0]='r';
+ temp[1]='e';
+ temp[2]='g';
+ temp[3]='\0';
+
+ mem_len = OF_getproplen(o,phandle, temp);
+ OF_getprop(o,phandle, temp, buffer, mem_len);
+ *nomr=mem_len >> 3;
+
+ for (i=0; i<=mem_len/4; i++) pointer[i]=of_decode_int((const unsigned char *)&buffer[i]);
+
+ temp[0]='/';
+ temp[1]='c';
+ temp[2]='h';
+ temp[3]='o';
+ temp[4]='s';
+ temp[5]='e';
+ temp[6]='n';
+ temp[7]='\0';
+
+ phandle=OF_finddevice(o,temp);
+
+ temp[0]='b';
+ temp[1]='o';
+ temp[2]='o';
+ temp[3]='t';
+ temp[4]='a';
+ temp[5]='r';
+ temp[6]='g';
+ temp[7]='s';
+ temp[8]='\0';
+
+ mem_len = OF_getproplen(o,phandle, temp);
+ OF_getprop(o,phandle, temp, buffer, mem_len);
+ for (i=0; i<=mem_len/4; i++) pointer[i+32]=buffer[i];
+
+}
diff --git a/arch/arm/boot/compressed/setup-sa1100.S b/arch/arm/boot/compressed/setup-sa1100.S
index 3babde180..32e77c285 100644
--- a/arch/arm/boot/compressed/setup-sa1100.S
+++ b/arch/arm/boot/compressed/setup-sa1100.S
@@ -33,13 +33,11 @@ UART3_BASE: .long 0x80050000
#define UTSR0 0x1c
#define UTSR1 0x20
-#define BAUD_DIV_230400 0x000
-#define BAUD_DIV_115200 0x001
-#define BAUD_DIV_57600 0x003
-#define BAUD_DIV_38400 0x005
-#define BAUD_DIV_19200 0x00b
-#define BAUD_DIV_9600 0x017
-#define BAUD_DIV BAUD_DIV_9600
+#ifndef CONFIG_SA1100_DEFAULT_BAUDRATE
+#define CONFIG_SA1100_DEFAULT_BAUDRATE 9600
+#endif
+
+#define BAUD_DIV ((230400/CONFIG_SA1100_DEFAULT_BAUDRATE)-1)
SCR_loc: .long SYMBOL_NAME(SCR_value)
#define GPIO_2_9 0x3fc
@@ -92,7 +90,7 @@ skip_SCR:
bne skip_uart
@ UART3 if Assabet is used with Neponset
- teq r3, #25 @ if Assabet
+ teq r3, #MACH_TYPE_ASSABET @ if Assabet
tsteq r2, #(1 << 9) @ ... and Neponset present
ldreq r0, UART3_BASE
beq uart_init
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index 86ed5e6e3..8608996e9 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -19,12 +19,13 @@ SECTIONS
.text : {
_start = .;
- head.o(.start)
*(.start)
- head.o(.text)
*(.text)
*(.fixup)
*(.gnu.warning)
+ *(.rodata)
+ *(.glue_7)
+ *(.glue_7t)
input_data = .;
piggy.o
input_data_end = .;
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index ed5115c53..45956ea07 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -10,16 +10,14 @@ USE_STANDARD_AS_RULE := true
HEAD_OBJ = head-$(PROCESSOR).o
ENTRY_OBJ = entry-$(PROCESSOR).o
-AFLAGS_head-armv.o := -DTEXTADDR=$(TEXTADDR) -traditional
-AFLAGS_head-armo.o := -DTEXTADDR=$(TEXTADDR) -traditional
+AFLAGS_head-armv.o := -DTEXTADDR=$(TEXTADDR)
+AFLAGS_head-armo.o := -DTEXTADDR=$(TEXTADDR)
O_OBJS_arc = dma-arc.o oldlatches.o
O_OBJS_rpc = dma-rpc.o
O_OBJS_footbridge = dma-footbridge.o isa.o
O_OBJS_l7200 = fiq.o
-leds-ebsa110 = leds-ebsa110.o
-
pci-nexuspci = plx90x0.o
pci-footbridge = dec21285.o
pci-shark = via82c505.o
@@ -31,37 +29,29 @@ O_TARGET := kernel.o
# Object file lists.
-obj-y := arch.o dma.o $(ENTRY_OBJ) irq.o process.o ptrace.o \
- semaphore.o setup.o signal.o sys_arm.o time.o \
- traps.o $(O_OBJS_$(MACHINE))
-obj-m :=
-obj-n :=
-obj- :=
+obj-y := arch.o dma.o $(ENTRY_OBJ) irq.o process.o ptrace.o \
+ semaphore.o setup.o signal.o sys_arm.o time.o traps.o \
+ $(O_OBJS_$(MACHINE))
+obj-m :=
+obj-n :=
+obj- :=
+
+export-objs := armksyms.o dma.o ecard.o fiq.o oldlatches.o time.o
-export-objs := armksyms.o dma.o ecard.o \
- $(leds-$(MACHINE)) oldlatches.o \
- time.o
+no-irq-arch := $(CONFIG_ARCH_INTEGRATOR) $(CONFIG_ARCH_CLPS711X) \
+ $(CONFIG_ARCH_FOOTBRIDGE) $(CONFIG_ARCH_EBSA110)
+
+ifneq ($(findstring y,$(no-irq-arch)),y)
+ obj-y += irq-arch.o
+endif
obj-$(CONFIG_ARCH_ACORN) += ecard.o fiq.o time-acorn.o
obj-$(CONFIG_DEBUG_LL) += debug-$(PROCESSOR).o
obj-$(CONFIG_MODULES) += armksyms.o
-obj-$(CONFIG_LEDS) += $(leds-$(MACHINE))
obj-$(CONFIG_ARTHUR) += arthur.o
obj-$(CONFIG_ISA_DMA) += dma-isa.o
-
obj-$(CONFIG_PCI) += bios32.o $(pci-$(MACHINE)) $(pci-y)
-# Files that are both resident and modular; remove from modular.
-
-obj-m := $(filter-out $(obj-y), $(obj-m))
-
-# Translate to Rules.make lists.
-
-O_OBJS := $(filter-out $(export-objs), $(obj-y))
-OX_OBJS := $(filter $(export-objs), $(obj-y))
-M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
-MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
-
all: kernel.o $(HEAD_OBJ) init_task.o
include $(TOPDIR)/Rules.make
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 868fbd4a7..bbc43c509 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -257,11 +257,30 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
(struct arm_pci_sysdata *)bus->sysdata;
struct arm_bus_sysdata *busdata;
- if (bus->number < MAX_NR_BUS)
- busdata = sysdata->bus + bus->number;
- else
+ if (bus->number >= MAX_NR_BUS)
BUG();
+ if (bus->self) {
+ struct pci_dev *dev = bus->self;
+ int i;
+
+ for (i = 0; i < 3; i++) {
+ bus->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES + i];
+ bus->resource[i]->name = bus->name;
+ }
+ bus->resource[0]->start = ioport_resource.start;
+ bus->resource[0]->end = ioport_resource.end;
+ bus->resource[0]->flags |= pci_bridge_check_io(dev);
+ bus->resource[1]->start = iomem_resource.start;
+ bus->resource[1]->end = iomem_resource.end;
+ bus->resource[1]->flags |= IORESOURCE_MEM;
+
+ /* Turn off downsteam prefetchable memory address range */
+ bus->resource[2]->start = 1024*1024;
+ bus->resource[2]->end = bus->resource[2]->start - 1;
+ }
+
+ busdata = sysdata->bus + bus->number;
busdata->max_lat = 255;
/*
@@ -363,10 +382,6 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
void __init
pcibios_fixup_pbus_ranges(struct pci_bus *bus, struct pbus_set_ranges_data *ranges)
{
- ranges->io_start -= bus->resource[0]->start;
- ranges->io_end -= bus->resource[0]->start;
- ranges->mem_start -= bus->resource[1]->start;
- ranges->mem_end -= bus->resource[1]->start;
}
u8 __init no_swizzle(struct pci_dev *dev, u8 *pin)
@@ -442,7 +457,8 @@ void __init pcibios_init(void)
hw_pci->init(&sysdata);
/*
- * Other architectures don't seem to do this... should we?
+ * Claim the currently allocated resources. This ensures
+ * that we will not allocate an already inuse region.
*/
pcibios_claim_resources();
diff --git a/arch/arm/kernel/dma-arc.c b/arch/arm/kernel/dma-arc.c
index 121a2792b..ad9ca3de5 100644
--- a/arch/arm/kernel/dma-arc.c
+++ b/arch/arm/kernel/dma-arc.c
@@ -40,7 +40,7 @@ static void arc_floppy_data_enable_dma(dmach_t channel, dma_t *dma)
memcpy ((void *)0x1c, (void *)&fdc1772_dma_read,
&fdc1772_dma_read_end - &fdc1772_dma_read);
fdc1772_setupdma(dma->buf.length, dma->buf.address); /* Sets data pointer up */
- enable_irq (64);
+ enable_fiq(FIQ_FLOPPYDATA);
restore_flags(flags);
}
break;
@@ -55,7 +55,7 @@ static void arc_floppy_data_enable_dma(dmach_t channel, dma_t *dma)
memcpy ((void *)0x1c, (void *)&fdc1772_dma_write,
&fdc1772_dma_write_end - &fdc1772_dma_write);
fdc1772_setupdma(dma->buf.length, dma->buf.address); /* Sets data pointer up */
- enable_irq (64);
+ enable_fiq(FIQ_FLOPPYDATA;
restore_flags(flags);
}
@@ -102,7 +102,7 @@ static int arc_floppy_cmdend_get_dma_residue(dmach_t channel, dma_t *dma)
static void arc_disable_dma(dmach_t channel, dma_t *dma)
{
- disable_irq(dma->dma_irq);
+ disable_fiq(dma->dma_irq);
}
static struct dma_ops arc_floppy_data_dma_ops = {
@@ -158,12 +158,12 @@ static void a5k_floppy_enable_dma(dmach_t channel, dma_t *dma)
regs.ARM_r10 = dma->buf.address;
regs.ARM_fp = FLOPPYDMA_BASE;
set_fiq_regs(&regs);
- enable_irq(dma->dma_irq);
+ enable_fiq(dma->dma_irq);
}
static void a5k_floppy_disable_dma(dmach_t channel, dma_t *dma)
{
- disable_irq(dma->dma_irq);
+ disable_fiq(dma->dma_irq);
release_fiq(&fh);
}
@@ -192,15 +192,15 @@ void __init arch_dma_init(dma_t *dma)
{
#if defined(CONFIG_BLK_DEV_FD1772) || defined(CONFIG_BLK_DEV_FD1772_MODULE)
if (machine_is_archimedes()) {
- dma[DMA_VIRTUAL_FLOPPY0].dma_irq = 64;
+ dma[DMA_VIRTUAL_FLOPPY0].dma_irq = FIQ_FLOPPYDATA;
dma[DMA_VIRTUAL_FLOPPY0].d_ops = &arc_floppy_data_dma_ops;
- dma[DMA_VIRTUAL_FLOPPY1].dma_irq = 65;
+ dma[DMA_VIRTUAL_FLOPPY1].dma_irq = 1;
dma[DMA_VIRTUAL_FLOPPY1].d_ops = &arc_floppy_cmdend_dma_ops;
}
#endif
#ifdef CONFIG_ARCH_A5K
if (machine_is_a5k()) {
- dma[DMA_VIRTUAL_FLOPPY0].dma_irq = 64;
+ dma[DMA_VIRTUAL_FLOPPY0].dma_irq = FIQ_FLOPPYDATA;
dma[DMA_VIRTUAL_FLOPPY0].d_ops = &a5k_floppy_dma_ops;
}
#endif
diff --git a/arch/arm/kernel/dma-rpc.c b/arch/arm/kernel/dma-rpc.c
index b46ca7753..402b71cdb 100644
--- a/arch/arm/kernel/dma-rpc.c
+++ b/arch/arm/kernel/dma-rpc.c
@@ -10,7 +10,7 @@
* DMA functions specific to RiscPC architecture
*/
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/mman.h>
#include <linux/init.h>
#include <linux/pci.h>
@@ -42,11 +42,11 @@ typedef struct {
#define TRANSFER_SIZE 2
#define CURA (0)
-#define ENDA ((IOMD_IO0ENDA - IOMD_IO0CURA) << 2)
-#define CURB ((IOMD_IO0CURB - IOMD_IO0CURA) << 2)
-#define ENDB ((IOMD_IO0ENDB - IOMD_IO0CURA) << 2)
-#define CR ((IOMD_IO0CR - IOMD_IO0CURA) << 2)
-#define ST ((IOMD_IO0ST - IOMD_IO0CURA) << 2)
+#define ENDA (IOMD_IO0ENDA - IOMD_IO0CURA)
+#define CURB (IOMD_IO0CURB - IOMD_IO0CURA)
+#define ENDB (IOMD_IO0ENDB - IOMD_IO0CURA)
+#define CR (IOMD_IO0CR - IOMD_IO0CURA)
+#define ST (IOMD_IO0ST - IOMD_IO0CURA)
#define state_prog_a 0
#define state_wait_a 1
@@ -93,14 +93,14 @@ static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma)
static inline void iomd_setup_dma_a(struct scatterlist *sg, dma_t *dma)
{
- outl_t(sg->dma_address, dma->dma_base + CURA);
- outl_t(sg->length, dma->dma_base + ENDA);
+ iomd_writel(sg->dma_address, dma->dma_base + CURA);
+ iomd_writel(sg->length, dma->dma_base + ENDA);
}
static inline void iomd_setup_dma_b(struct scatterlist *sg, dma_t *dma)
{
- outl_t(sg->dma_address, dma->dma_base + CURB);
- outl_t(sg->length, dma->dma_base + ENDB);
+ iomd_writel(sg->dma_address, dma->dma_base + CURB);
+ iomd_writel(sg->length, dma->dma_base + ENDB);
}
static void iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
@@ -116,7 +116,7 @@ static void iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
dma->state = state_wait_a;
case state_wait_a:
- status = inb_t(dma->dma_base + ST);
+ status = iomd_readb(dma->dma_base + ST);
switch (status & (DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB)) {
case DMA_ST_OFL|DMA_ST_INT:
iomd_get_next_sg(&dma->cur_sg, dma);
@@ -137,7 +137,7 @@ static void iomd_dma_handle(int irq, void *dev_id, struct pt_regs *regs)
break;
case state_wait_b:
- status = inb_t(dma->dma_base + ST);
+ status = iomd_readb(dma->dma_base + ST);
switch (status & (DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB)) {
case DMA_ST_OFL|DMA_ST_INT|DMA_ST_AB:
iomd_get_next_sg(&dma->cur_sg, dma);
@@ -193,14 +193,14 @@ static void iomd_enable_dma(dmach_t channel, dma_t *dma)
PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
}
- outb_t(DMA_CR_C, dma_base + CR);
+ iomd_writeb(DMA_CR_C, dma_base + CR);
dma->state = state_prog_a;
}
if (dma->dma_mode == DMA_MODE_READ)
ctrl |= DMA_CR_D;
- outb_t(ctrl, dma_base + CR);
+ iomd_writeb(ctrl, dma_base + CR);
enable_irq(dma->dma_irq);
}
@@ -210,8 +210,8 @@ static void iomd_disable_dma(dmach_t channel, dma_t *dma)
unsigned int ctrl;
disable_irq(dma->dma_irq);
- ctrl = inb_t(dma_base + CR);
- outb_t(ctrl & ~DMA_CR_E, dma_base + CR);
+ ctrl = iomd_readb(dma_base + CR);
+ iomd_writeb(ctrl & ~DMA_CR_E, dma_base + CR);
}
static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
@@ -227,7 +227,7 @@ static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
else
speed = 0;
- tcr = inb(IOMD_DMATCR);
+ tcr = iomd_readb(IOMD_DMATCR);
speed &= 3;
switch (channel) {
@@ -251,7 +251,7 @@ static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
break;
}
- outb(tcr, IOMD_DMATCR);
+ iomd_writeb(tcr, IOMD_DMATCR);
return speed;
}
@@ -287,7 +287,7 @@ static void floppy_enable_dma(dmach_t channel, dma_t *dma)
regs.ARM_r9 = dma->buf.length;
regs.ARM_r10 = (unsigned long)dma->buf.address;
- regs.ARM_fp = (unsigned long)PCIO_FLOPPYDMABASE;
+ regs.ARM_fp = FLOPPYDMA_BASE;
if (claim_fiq(&fh)) {
printk("floppydma: couldn't claim FIQ.\n");
@@ -296,12 +296,12 @@ static void floppy_enable_dma(dmach_t channel, dma_t *dma)
set_fiq_handler(fiqhandler_start, fiqhandler_length);
set_fiq_regs(&regs);
- enable_irq(dma->dma_irq);
+ enable_fiq(dma->dma_irq);
}
static void floppy_disable_dma(dmach_t channel, dma_t *dma)
{
- disable_irq(dma->dma_irq);
+ disable_fiq(dma->dma_irq);
release_fiq(&fh);
}
@@ -334,32 +334,32 @@ static struct dma_ops sound_dma_ops = {
void __init arch_dma_init(dma_t *dma)
{
- outb(0, IOMD_IO0CR);
- outb(0, IOMD_IO1CR);
- outb(0, IOMD_IO2CR);
- outb(0, IOMD_IO3CR);
+ iomd_writeb(0, IOMD_IO0CR);
+ iomd_writeb(0, IOMD_IO1CR);
+ iomd_writeb(0, IOMD_IO2CR);
+ iomd_writeb(0, IOMD_IO3CR);
- outb(0xa0, IOMD_DMATCR);
+ iomd_writeb(0xa0, IOMD_DMATCR);
- dma[DMA_0].dma_base = ioaddr(IOMD_IO0CURA);
+ dma[DMA_0].dma_base = IOMD_IO0CURA;
dma[DMA_0].dma_irq = IRQ_DMA0;
dma[DMA_0].d_ops = &iomd_dma_ops;
- dma[DMA_1].dma_base = ioaddr(IOMD_IO1CURA);
+ dma[DMA_1].dma_base = IOMD_IO1CURA;
dma[DMA_1].dma_irq = IRQ_DMA1;
dma[DMA_1].d_ops = &iomd_dma_ops;
- dma[DMA_2].dma_base = ioaddr(IOMD_IO2CURA);
+ dma[DMA_2].dma_base = IOMD_IO2CURA;
dma[DMA_2].dma_irq = IRQ_DMA2;
dma[DMA_2].d_ops = &iomd_dma_ops;
- dma[DMA_3].dma_base = ioaddr(IOMD_IO3CURA);
+ dma[DMA_3].dma_base = IOMD_IO3CURA;
dma[DMA_3].dma_irq = IRQ_DMA3;
dma[DMA_3].d_ops = &iomd_dma_ops;
- dma[DMA_S0].dma_base = ioaddr(IOMD_SD0CURA);
+ dma[DMA_S0].dma_base = IOMD_SD0CURA;
dma[DMA_S0].dma_irq = IRQ_DMAS0;
dma[DMA_S0].d_ops = &iomd_dma_ops;
- dma[DMA_S1].dma_base = ioaddr(IOMD_SD1CURA);
+ dma[DMA_S1].dma_base = IOMD_SD1CURA;
dma[DMA_S1].dma_irq = IRQ_DMAS1;
dma[DMA_S1].d_ops = &iomd_dma_ops;
- dma[DMA_VIRTUAL_FLOPPY].dma_irq = 64;
+ dma[DMA_VIRTUAL_FLOPPY].dma_irq = FIQ_FLOPPYDATA;
dma[DMA_VIRTUAL_FLOPPY].d_ops = &floppy_dma_ops;
dma[DMA_VIRTUAL_SOUND].d_ops = &sound_dma_ops;
@@ -367,5 +367,5 @@ void __init arch_dma_init(dma_t *dma)
* Setup DMA channels 2,3 to be for podules
* and channels 0,1 for internal devices
*/
- outb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT);
+ iomd_writeb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT);
}
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c
index ad311020f..7f0106953 100644
--- a/arch/arm/kernel/dma.c
+++ b/arch/arm/kernel/dma.c
@@ -12,7 +12,7 @@
* DMA facilities.
*/
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/mman.h>
#include <linux/init.h>
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 3584c3227..07de0170c 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -35,7 +35,7 @@
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
diff --git a/arch/arm/kernel/entry-armo.S b/arch/arm/kernel/entry-armo.S
index e4df9fe1a..65f70c727 100644
--- a/arch/arm/kernel/entry-armo.S
+++ b/arch/arm/kernel/entry-armo.S
@@ -197,8 +197,7 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
#endif
#define FAULT_CODE_PREFETCH 0x04
#define FAULT_CODE_WRITE 0x02
-#define FAULT_CODE_USER 0x01
-
+#define FAULT_CODE_FORCECOW 0x01
#define SVC_SAVE_ALL \
str sp, [sp, #-16]! ;\
@@ -487,7 +486,6 @@ vector_data: sub lr, lr, #8 @ Correct lr
save_user_regs
teqp pc, #0x00000003 @ NOT a problem - doesnt change mode
mask_pc r0, lr
- mov r2, #FAULT_CODE_USER
bl Ldata_do
b ret_from_exception
@@ -499,7 +497,6 @@ Ldata_not_user:
tst lr, #0x08000000
teqeqp pc, #0x00000003 @ NOT a problem - doesnt change mode
mask_pc r0, lr
- mov r2, #0
bl Ldata_do
SVC_RESTORE_ALL
@@ -510,6 +507,7 @@ Ldata_illegal_mode:
Ldata_do: mov r3, sp
ldr r4, [r0] @ Get instruction
+ mov r2, #0
tst r4, #1 << 20 @ Check to see if it is a write instruction
orreq r2, r2, #FAULT_CODE_WRITE @ Indicate write instruction
mov r1, r4, lsr #22 @ Now branch to the relevent processing routine
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index 1be23e8fb..da32d69f9 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -36,12 +36,14 @@
* 6. Goto 3
*/
#include <linux/config.h>
+#include <linux/module.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/init.h>
#include <asm/fiq.h>
#include <asm/io.h>
+#include <asm/irq.h>
#include <asm/pgalloc.h>
#include <asm/system.h>
#include <asm/uaccess.h>
@@ -71,7 +73,7 @@ static inline void protect_page_0(void)
* - we always relinquish FIQ control
* - we always reacquire FIQ control
*/
-int fiq_def_op(void *ref, int relinquish)
+static int fiq_def_op(void *ref, int relinquish)
{
if (!relinquish) {
unprotect_page_0();
@@ -214,6 +216,24 @@ void release_fiq(struct fiq_handler *f)
while (current_fiq->fiq_op(current_fiq->dev_id, 0));
}
+void enable_fiq(int fiq)
+{
+ enable_irq(fiq + FIQ_START);
+}
+
+void disable_fiq(int fiq)
+{
+ disable_irq(fiq + FIQ_START);
+}
+
+EXPORT_SYMBOL(set_fiq_handler);
+EXPORT_SYMBOL(set_fiq_regs);
+EXPORT_SYMBOL(get_fiq_regs);
+EXPORT_SYMBOL(claim_fiq);
+EXPORT_SYMBOL(release_fiq);
+EXPORT_SYMBOL(enable_fiq);
+EXPORT_SYMBOL(disable_fiq);
+
void __init init_FIQ(void)
{
no_fiq_insn = *(unsigned long *)FIQ_VECTOR;
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 3c6899264..ae599d255 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -24,7 +24,7 @@
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/random.h>
#include <linux/smp.h>
#include <linux/init.h>
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 9f50ab6fd..6b045845f 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -17,7 +17,7 @@
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/user.h>
#include <linux/delay.h>
#include <linux/reboot.h>
@@ -92,8 +92,10 @@ void cpu_idle(void)
void (*idle)(void) = pm_idle;
if (!idle)
idle = arch_idle;
+ leds_event(led_idle_start);
while (!current->need_resched)
idle();
+ leds_event(led_idle_end);
schedule();
#ifndef CONFIG_NO_PGT_CACHE
check_pgt_cache();
@@ -364,20 +366,23 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
*/
pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
{
- extern long sys_exit(int) __attribute__((noreturn));
pid_t __ret;
__asm__ __volatile__(
- "mov r0, %1 @ kernel_thread sys_clone
+ "orr r0, %1, %2 @ kernel_thread sys_clone
mov r1, #0
"__syscall(clone)"
- teq r0, #0 @ if we are the child
- moveq fp, #0 @ ensure that fp is zero
- mov %0, r0"
+ movs %0, r0 @ if we are the child
+ bne 1f
+ mov fp, #0 @ ensure that fp is zero
+ mov r0, %4
+ mov lr, pc
+ mov pc, %3
+ b sys_exit
+1: "
: "=r" (__ret)
- : "Ir" (flags | CLONE_VM) : "r0", "r1");
- if (__ret == 0)
- sys_exit((fn)(arg));
+ : "Ir" (flags), "I" (CLONE_VM), "r" (fn), "r" (arg)
+ : "r0", "r1", "lr");
return __ret;
}
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 36bbf3ac8..16b8e59ea 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -14,7 +14,7 @@
*/
#include <linux/errno.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/sem.h>
#include <linux/msg.h>
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 926cdff2f..be24bdcfc 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -134,32 +134,17 @@ void (*leds_event)(led_event_t) = dummy_leds_event;
#ifdef CONFIG_MODULES
EXPORT_SYMBOL(leds_event);
#endif
+#endif
+#ifdef CONFIG_LEDS_TIMER
static void do_leds(void)
{
-#ifdef CONFIG_LEDS_CPU
- {
- static int last_pid;
-
- if (current->pid != last_pid) {
- last_pid = current->pid;
- if (last_pid)
- leds_event(led_idle_end);
- else
- leds_event(led_idle_start);
- }
- }
-#endif
-#ifdef CONFIG_LEDS_TIMER
- {
- static unsigned int count = 50;
+ static unsigned int count = 50;
- if (--count == 0) {
- count = 50;
- leds_event(led_timer);
- }
+ if (--count == 0) {
+ count = 50;
+ leds_event(led_timer);
}
-#endif
}
#else
#define do_leds()
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 9d0cc5c69..8455caf78 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -107,7 +107,7 @@ static void dump_instr(struct pt_regs *regs)
bad = __get_user(val, &((u32 *)addr)[i]);
if (!bad)
- printk(i == 0 ? "(%0*x) " : "%0*x", width, val);
+ printk(i == 0 ? "(%0*x) " : "%0*x ", width, val);
else {
printk("bad PC value.");
break;
@@ -133,7 +133,7 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
printk("no frame pointer");
ok = 0;
} else if (verify_stack(fp)) {
- printk("invalid frame pointer %08lx", fp);
+ printk("invalid frame pointer 0x%08x", fp);
ok = 0;
} else if (fp < 4096+(unsigned long)tsk)
printk("frame pointer underflow");
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index fa7f10117..ee111801f 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -1,58 +1,58 @@
#
# linux/arch/arm/lib/Makefile
#
-# Copyright (C) 1995-1999 Russell King
+# Copyright (C) 1995-2000 Russell King
#
USE_STANDARD_AS_RULE := true
-L_TARGET := lib.a
-L_OBJS := changebit.o csumipv6.o csumpartial.o csumpartialcopy.o \
- csumpartialcopyuser.o clearbit.o copy_page.o findbit.o \
- memchr.o memcpy.o memset.o memzero.o setbit.o \
- strncpy_from_user.o strnlen_user.o strchr.o strrchr.o \
- testchangebit.o testclearbit.o testsetbit.o uaccess.o
-
-l-obj-y :=
-l-obj-n :=
-
-O_TARGET := lib.o
-O_OBJS := backtrace.o delay.o
-
-ifeq ($(CONFIG_ARCH_ACORN),y)
- half := n
- full := y
+L_TARGET := lib.a
+
+obj-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
+ csumpartialcopy.o csumpartialcopyuser.o clearbit.o \
+ copy_page.o delay.o findbit.o memchr.o memcpy.o \
+ memset.o memzero.o setbit.o strncpy_from_user.o \
+ strnlen_user.o strchr.o strrchr.o testchangebit.o \
+ testclearbit.o testsetbit.o uaccess.o
+obj-m :=
+obj-n :=
+
+export-objs := io.o
+
+obj-arc := ecard.o io-acorn.o floppydma.o
+obj-rpc := ecard.o io-acorn.o floppydma.o
+obj-clps7500 := io-acorn.o
+obj-footbridge := io-pcio.o
+obj-l7200 := io-acorn.o
+obj-nexuspci := io-pcio.o
+obj-sa1100 := io-pcio.o
+obj-shark := io-shark.o
+obj-integrator := io-pcio.o
+obj-clps711x := io-shark.o
+
+obj-y += $(obj-$(MACHINE))
+
+ifeq ($(CONFIG_CPU_32v4),y)
+ v3 := n
+ v4 := y
else
- half := y
- full := n
+ v3 := y
+ v4 := n
endif
-L_OBJS_arc := ecard.o io-acorn.o floppydma.o
-L_OBJS_rpc := ecard.o io-acorn.o floppydma.o
-L_OBJS_clps7500 := io-acorn.o
-L_OBJS_footbridge := io-pcio.o
-L_OBJS_l7200 := io-acorn.o
-L_OBJS_nexuspci := io-pcio.o
-L_OBJS_sa1100 := io-pcio.o
-L_OBJS_shark := io-shark.o
-L_OBJS_integrator := io-pcio.o
-L_OBJS_clps711x := io-shark.o
-
-l-obj-y += io-readsb.o io-writesb.o
-l-obj-$(full) += io-readsw-armv3.o io-writesw-armv3.o
-l-obj-$(half) += io-readsw-armv4.o io-writesw-armv4.o
-l-obj-y += io-readsl.o io-writesl.o
+obj-y += io-readsb.o io-writesb.o
+obj-$(v3) += io-readsw-armv3.o io-writesw-armv3.o io-readsl-armv3.o
+obj-$(v4) += io-readsw-armv4.o io-writesw-armv4.o io-readsl-armv4.o
+obj-y += io-writesl.o
ifeq ($(PROCESSOR),armo)
- L_OBJS += uaccess-armo.o
+ obj-y += uaccess-armo.o
endif
ifneq ($(MACHINE),ebsa110)
- OX_OBJS += io.o
+ obj-y += io.o
endif
-L_OBJS += $(L_OBJS_$(MACHINE)) $(l-obj-y)
-
include $(TOPDIR)/Rules.make
constants.h: getconsdata.o extractconstants.pl
diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
index a40272fdb..db19d932e 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/lib/io-acorn.S
@@ -60,32 +60,32 @@ ENTRY(outsl)
*/
ENTRY(insw)
- teq r2, #0
- RETINSTR(moveq, pc, lr)
addr r0
- b __arch_readsw
+ teq r2, #0
+ bne __arch_readsw
+ RETINSTR(mov, pc, lr)
ENTRY(insb)
- teq r2, #0
- RETINSTR(moveq, pc, lr)
addr r0
- b __arch_readsb
+ teq r2, #0
+ bne __arch_readsb
+ RETINSTR(mov, pc, lr)
@ Purpose: write a block of data from memory to a hardware register.
@ Proto : outsw(int to_reg, void *from, int len_in_words);
@ Notes : increments from
ENTRY(outsw)
- teq r2, #0
- RETINSTR(moveq, pc, lr)
addr r0
- b __arch_writesw
+ teq r2, #0
+ bne __arch_writesw
+ RETINSTR(mov, pc, lr)
ENTRY(outsb)
- teq r2, #0
- RETINSTR(moveq, pc, lr)
addr r0
- b __arch_writesb
+ teq r2, #0
+ bne __arch_writesb
+ RETINSTR(mov, pc, lr)
@ Purpose: write a memc register
@ Proto : void memc_write(int register, int value);
diff --git a/arch/arm/lib/io-pcio.S b/arch/arm/lib/io-pcio.S
index f57abfc10..243366b86 100644
--- a/arch/arm/lib/io-pcio.S
+++ b/arch/arm/lib/io-pcio.S
@@ -1,4 +1,5 @@
#include <linux/linkage.h>
+#include <asm/assembler.h>
#include <asm/hardware.h>
.equ pcio_high, PCIO_BASE & 0xff000000
@@ -13,26 +14,37 @@
ENTRY(insl)
ioaddr r0, r0
- b __arch_readsl
+ teq r2, #0
+ bne __arch_readsl
+ RETINSTR(mov, pc, lr)
ENTRY(outsl)
ioaddr r0, r0
- b __arch_writesl
-
- /* Nobody could say these are optimal, but not to worry. */
+ teq r2, #0
+ bne __arch_writesl
+ RETINSTR(mov, pc, lr)
ENTRY(outsw)
ioaddr r0, r0
- b __arch_writesw
+ teq r2, #0
+ bne __arch_writesw
+ RETINSTR(mov, pc, lr)
ENTRY(insw)
ioaddr r0, r0
- b __arch_readsw
+ teq r2, #0
+ bne __arch_readsw
+ RETINSTR(mov, pc, lr)
ENTRY(insb)
ioaddr r0, r0
- b __arch_readsb
+ teq r2, #0
+ bne __arch_readsb
+ RETINSTR(mov, pc, lr)
ENTRY(outsb)
ioaddr r0, r0
- b __arch_writesb
+ teq r2, #0
+ bne __arch_writesb
+ RETINSTR(mov, pc, lr)
+
diff --git a/arch/arm/lib/io-readsb.S b/arch/arm/lib/io-readsb.S
index 23cca8929..a31381fd5 100644
--- a/arch/arm/lib/io-readsb.S
+++ b/arch/arm/lib/io-readsb.S
@@ -62,6 +62,7 @@ ENTRY(__arch_readsb)
ldrb ip, [r0]
orr r6, r6, ip, lsl #24
stmia r1!, {r3 - r6}
+
subs r2, r2, #16
bpl .insb_16_lp
@@ -88,7 +89,7 @@ ENTRY(__arch_readsb)
stmia r1!, {r3, r4}
.insb_no_8: tst r2, #4
- bne .insb_no_4
+ beq .insb_no_4
ldrb r3, [r0]
ldrb r4, [r0]
@@ -101,6 +102,7 @@ ENTRY(__arch_readsb)
.insb_no_4: ands r2, r2, #3
LOADREGS(eqfd, sp!, {r4 - r6, pc})
+
cmp r2, #2
ldrb r3, [r0]
strb r3, [r1], #1
@@ -108,4 +110,5 @@ ENTRY(__arch_readsb)
strgeb r3, [r1], #1
ldrgtb r3, [r0]
strgtb r3, [r1]
+
LOADREGS(fd, sp!, {r4 - r6, pc})
diff --git a/arch/arm/lib/io-readsl-armv3.S b/arch/arm/lib/io-readsl-armv3.S
new file mode 100644
index 000000000..0751c3157
--- /dev/null
+++ b/arch/arm/lib/io-readsl-armv3.S
@@ -0,0 +1,76 @@
+/*
+ * linux/arch/arm/lib/io-readsl-armv3.S
+ *
+ * Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+#include <asm/hardware.h>
+
+/*
+ * Note that some reads can be aligned on half-word boundaries.
+ */
+ENTRY(__arch_readsl)
+ ands ip, r1, #3
+ bne 2f
+
+1: ldr r3, [r0]
+ str r3, [r1], #4
+ subs r2, r2, #1
+ bne 1b
+ mov pc, lr
+
+2: cmp ip, #2
+ ldr ip, [r0]
+ blt 4f
+ bgt 6f
+
+ strb ip, [r1], #1
+ mov ip, ip, lsr #8
+ strb ip, [r1], #1
+ mov ip, ip, lsr #8
+3: subs r2, r2, #1
+ ldrne r3, [r0]
+ orrne ip, ip, r3, lsl #16
+ strne ip, [r1], #4
+ movne ip, r3, lsr #16
+ bne 3b
+ strb ip, [r1], #1
+ mov ip, ip, lsr #8
+ strb ip, [r1], #1
+ mov pc, lr
+
+4: strb ip, [r1], #1
+ mov ip, ip, lsr #8
+ strb ip, [r1], #1
+ mov ip, ip, lsr #8
+ strb ip, [r1], #1
+ mov ip, ip, lsr #8
+5: subs r2, r2, #1
+ ldrne r3, [r0]
+ orrne ip, ip, r3, lsl #8
+ strne ip, [r1], #4
+ movne ip, r3, lsr #24
+ bne 5b
+ strb ip, [r1], #1
+ mov pc, lr
+
+6: strb ip, [r1], #1
+ mov ip, ip, lsr #8
+7: subs r2, r2, #1
+ ldrne r3, [r0]
+ orrne ip, ip, r3, lsl #24
+ strne ip, [r1], #4
+ movne ip, r3, lsr #8
+ bne 7b
+ strb ip, [r1], #1
+ mov ip, ip, lsr #8
+ strb ip, [r1], #1
+ mov ip, ip, lsr #8
+ strb ip, [r1], #1
+ mov pc, lr
+
diff --git a/arch/arm/lib/io-readsl.S b/arch/arm/lib/io-readsl-armv4.S
index 530175485..08b3d350f 100644
--- a/arch/arm/lib/io-readsl.S
+++ b/arch/arm/lib/io-readsl-armv4.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/io-readsb.S
+ * linux/arch/arm/lib/io-readsl-armv4.S
*
* Copyright (C) 1995-2000 Russell King
*
@@ -11,6 +11,9 @@
#include <asm/assembler.h>
#include <asm/hardware.h>
+/*
+ * Note that some reads can be aligned on half-word boundaries.
+ */
ENTRY(__arch_readsl)
ands ip, r1, #3
bne 2f
diff --git a/arch/arm/lib/io-readsw-armv3.S b/arch/arm/lib/io-readsw-armv3.S
index 65fb94e2f..cb2d5cee9 100644
--- a/arch/arm/lib/io-readsw-armv3.S
+++ b/arch/arm/lib/io-readsw-armv3.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/io-readsb.S
+ * linux/arch/arm/lib/io-readsw-armv3.S
*
* Copyright (C) 1995-2000 Russell King
*
@@ -62,8 +62,10 @@ ENTRY(__arch_readsw)
orr r6, r6, lr, lsl #16
stmia r1!, {r3 - r6}
+
subs r2, r2, #8
bpl .insw_8_lp
+
tst r2, #7
LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
@@ -97,6 +99,7 @@ ENTRY(__arch_readsw)
strneb r3, [r1], #1
movne r3, r3, lsr #8
strneb r3, [r1]
+
LOADREGS(fd, sp!, {r4, r5, r6, pc})
diff --git a/arch/arm/lib/io-readsw-armv4.S b/arch/arm/lib/io-readsw-armv4.S
index 6f1750a49..10eeee99f 100644
--- a/arch/arm/lib/io-readsw-armv4.S
+++ b/arch/arm/lib/io-readsw-armv4.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/io-readsb.S
+ * linux/arch/arm/lib/io-readsw-armv4.S
*
* Copyright (C) 1995-2000 Russell King
*
@@ -46,16 +46,18 @@ ENTRY(__arch_readsw)
orr r4, r4, r5, lsl #16
ldrh r5, [r0]
- ldrh r6, [r0]
- orr r5, r5, r6, lsl #16
+ ldrh ip, [r0]
+ orr r5, r5, ip, lsl #16
ldrh ip, [r0]
ldrh lr, [r0]
orr ip, ip, lr, lsl #16
stmia r1!, {r3 - r5, ip}
+
subs r2, r2, #8
bpl .insw_8_lp
+
tst r2, #7
LOADREGS(eqfd, sp!, {r4, r5, pc})
@@ -84,4 +86,5 @@ ENTRY(__arch_readsw)
.no_insw_2: tst r2, #1
ldrneh r3, [r0]
strneh r3, [r1]
+
LOADREGS(fd, sp!, {r4, r5, pc})
diff --git a/arch/arm/lib/io-writesb.S b/arch/arm/lib/io-writesb.S
index b919fdaad..a9a8c4af9 100644
--- a/arch/arm/lib/io-writesb.S
+++ b/arch/arm/lib/io-writesb.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/io-readsb.S
+ * linux/arch/arm/lib/io-writesb.S
*
* Copyright (C) 1995-2000 Russell King
*
@@ -13,7 +13,7 @@
.outsb_align: rsb ip, ip, #4
cmp ip, r2
- mov ip, r2
+ movgt ip, r2
cmp ip, #2
ldrb r3, [r1], #1
strb r3, [r0]
@@ -34,6 +34,7 @@ ENTRY(__arch_writesb)
bmi .outsb_no_16
.outsb_16_lp: ldmia r1!, {r3 - r6}
+
strb r3, [r0]
mov r3, r3, lsr #8
strb r3, [r0]
@@ -65,6 +66,7 @@ ENTRY(__arch_writesb)
strb r6, [r0]
mov r6, r6, lsr #8
strb r6, [r0]
+
subs r2, r2, #16
bpl .outsb_16_lp
@@ -74,7 +76,8 @@ ENTRY(__arch_writesb)
.outsb_no_16: tst r2, #8
beq .outsb_no_8
- ldmia r1, {r3, r4}
+ ldmia r1!, {r3, r4}
+
strb r3, [r0]
mov r3, r3, lsr #8
strb r3, [r0]
@@ -92,7 +95,7 @@ ENTRY(__arch_writesb)
strb r4, [r0]
.outsb_no_8: tst r2, #4
- bne .outsb_no_4
+ beq .outsb_no_4
ldr r3, [r1], #4
strb r3, [r0]
@@ -105,6 +108,7 @@ ENTRY(__arch_writesb)
.outsb_no_4: ands r2, r2, #3
LOADREGS(eqfd, sp!, {r4 - r6, pc})
+
cmp r2, #2
ldrb r3, [r1], #1
strb r3, [r0]
@@ -112,4 +116,5 @@ ENTRY(__arch_writesb)
strgeb r3, [r0]
ldrgtb r3, [r1]
strgtb r3, [r0]
+
LOADREGS(fd, sp!, {r4 - r6, pc})
diff --git a/arch/arm/lib/io-writesl.S b/arch/arm/lib/io-writesl.S
index ccda08c39..aa3340bdd 100644
--- a/arch/arm/lib/io-writesl.S
+++ b/arch/arm/lib/io-writesl.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/io-readsb.S
+ * linux/arch/arm/lib/io-writesl.S
*
* Copyright (C) 1995-2000 Russell King
*
diff --git a/arch/arm/lib/io-writesw-armv3.S b/arch/arm/lib/io-writesw-armv3.S
index 29c94cc3d..fce7d5ef5 100644
--- a/arch/arm/lib/io-writesw-armv3.S
+++ b/arch/arm/lib/io-writesw-armv3.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/io-readsb.S
+ * linux/arch/arm/lib/io-writesw-armv3.S
*
* Copyright (C) 1995-2000 Russell King
*
@@ -39,6 +39,7 @@ ENTRY(__arch_writesw)
subs r2, r2, #8
bmi .no_outsw_8
+
.outsw_8_lp: ldmia r1!, {r3, r4, r5, r6}
mov ip, r3, lsl #16
@@ -75,6 +76,7 @@ ENTRY(__arch_writesw)
subs r2, r2, #8
bpl .outsw_8_lp
+
tst r2, #7
LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
@@ -121,5 +123,3 @@ ENTRY(__arch_writesw)
strne ip, [r0]
LOADREGS(fd, sp!, {r4, r5, r6, pc})
-
-
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S
index 0f96d1325..bac67a42e 100644
--- a/arch/arm/lib/io-writesw-armv4.S
+++ b/arch/arm/lib/io-writesw-armv4.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/io-readsb.S
+ * linux/arch/arm/lib/io-writesw-armv4.S
*
* Copyright (C) 1995-2000 Russell King
*
@@ -32,11 +32,11 @@ ENTRY(__arch_writesw)
tst r1, #3
bne .outsw_align
+ stmfd sp!, {r4, r5, lr}
+
subs r2, r2, #8
bmi .no_outsw_8
- stmfd sp!, {r4, r5, lr}
-
.outsw_8_lp: ldmia r1!, {r3, r4, r5, ip}
strh r3, [r0]
@@ -54,26 +54,31 @@ ENTRY(__arch_writesw)
subs r2, r2, #8
bpl .outsw_8_lp
- ldmfd sp!, {r4, r5, lr}
+
tst r2, #7
- RETINSTR(moveq, pc, lr)
+ LOADREGS(eqfd, sp!, {r4, r5, pc})
.no_outsw_8: tst r2, #4
- ldmneia r1!, {r3, ip}
- strneh r3, [r0]
- movne r3, r3, lsr #16
- strneh r3, [r0]
- strneh ip, [r0]
- movne ip, ip, lsr #16
- strneh ip, [r0]
- tst r2, #2
- ldrne r3, [r1], #4
- strneh r3, [r0]
- movne r3, r3, lsr #16
- strneh r3, [r0]
- tst r2, #1
+ beq .no_outsw_4
+
+ ldmia r1!, {r3, ip}
+ strh r3, [r0]
+ mov r3, r3, lsr #16
+ strh r3, [r0]
+ strh ip, [r0]
+ mov ip, ip, lsr #16
+ strh ip, [r0]
+
+.no_outsw_4: tst r2, #2
+ beq .no_outsw_2
+
+ ldr r3, [r1], #4
+ strh r3, [r0]
+ mov r3, r3, lsr #16
+ strh r3, [r0]
+
+.no_outsw_2: tst r2, #1
ldrneh r3, [r1]
strneh r3, [r0]
- RETINSTR(mov, pc, lr)
-
+ LOADREGS(fd, sp!, {r4, r5, pc})
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
index 441608295..3a61edf39 100644
--- a/arch/arm/mach-sa1100/Makefile
+++ b/arch/arm/mach-sa1100/Makefile
@@ -20,15 +20,4 @@ export-objs := hw.o leds.o
obj-$(CONFIG_LEDS) += leds.o
-# Files that are both resident and modular; remove from modular.
-
-obj-m := $(filter-out $(obj-y), $(obj-m))
-
-# Translate to Rules.make lists.
-
-O_OBJS := $(filter-out $(export-objs), $(obj-y))
-OX_OBJS := $(filter $(export-objs), $(obj-y))
-M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
-MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
-
include $(TOPDIR)/Rules.make
diff --git a/arch/arm/mach-sa1100/hw.c b/arch/arm/mach-sa1100/hw.c
index 1ccc61fe3..a28b28177 100644
--- a/arch/arm/mach-sa1100/hw.c
+++ b/arch/arm/mach-sa1100/hw.c
@@ -90,12 +90,12 @@ static int bitsy_egpio = EGPIO_BITSY_RS232_ON;
void clr_bitsy_egpio(unsigned long x)
{
bitsy_egpio &= ~x;
- *(volatile int *)0xdc000000 = bitsy_egpio;
+ BITSY_EGPIO = bitsy_egpio;
}
void set_bitsy_egpio(unsigned long x)
{
bitsy_egpio |= x;
- *(volatile int *)0xdc000000 = bitsy_egpio;
+ BITSY_EGPIO = bitsy_egpio;
}
EXPORT_SYMBOL(clr_bitsy_egpio);
EXPORT_SYMBOL(set_bitsy_egpio);
@@ -119,8 +119,8 @@ static void __init sa1111_init(void){
/* First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
* (SA-1110 Developer's Manual, section 9.1.2.1)
*/
- GAFR |= GPIO_GPIO27;
- GPDR |= GPIO_GPIO27;
+ GAFR |= GPIO_32_768kHz;
+ GPDR |= GPIO_32_768kHz;
TUCR = TUCR_3_6864MHz;
/* Now, set up the PLL and RCLK in the SA-1111: */
@@ -133,32 +133,32 @@ static void __init sa1111_init(void){
* using the SKPCR.
*/
- {
- /*
- * SA1111 DMA bus master setup
+ /* If the system is going to use the SA-1111 DMA engines, set up
+ * the memory bus request/grant pins. Also configure the shared
+ * memory controller on the SA-1111 (SA-1111 Developer's Manual,
+ * section 3.2.3) and power up the DMA bus clock:
*/
- int cas;
-
- /* SA1111 side */
- switch ( (MDCNFG>>12) & 0x03 ) {
- case 0x02:
- cas = 0; break;
- case 0x03:
- cas = 1; break;
- default:
- cas = 1; break;
- }
- SMCR = 1 /* 1: memory is SDRAM */
- | ( 1 << 1 ) /* 1:MBGNT is enable */
- | ( ((MDCNFG >> 4) & 0x07) << 2 ) /* row address lines */
- | ( cas << 5 ); /* CAS latency */
-
- /* SA1110 side */
- GPDR |= 1<<21;
- GPDR &= ~(1<<22);
- GAFR |= ( (1<<21) | (1<<22) );
-
- TUCR |= (1<<10);
+ if(machine_is_assabet()){
+
+ GAFR |= (GPIO_MBGNT | GPIO_MBREQ);
+ GPDR |= GPIO_MBGNT;
+ GPDR &= ~GPIO_MBREQ;
+ TUCR |= TUCR_MR;
+
+ /* Assabet is populated by default with two Samsung KM416S8030T-G8
+ * 128Mb SDRAMs, which are organized as 12-bit (row addr) x 9-bit
+ * (column addr), according to the data sheet. Apparently, the
+ * bank selects factor into the row address, as Angel sets up the
+ * SA-1110 to use 14x9 addresses. The SDRAM datasheet specifies
+ * that when running at 100-125MHz, the CAS latency for -8 parts
+ * is 3 cycles, which is consistent with Angel.
+ */
+
+ SMCR = (SMCR_DTIM | SMCR_MBGE |
+ FInsrt(FExtr(MDCNFG, MDCNFG_SA1110_DRAC0), SMCR_DRAC) |
+ ((FExtr(MDCNFG, MDCNFG_SA1110_TDL0)==3) ? SMCR_CLAT : 0));
+
+ SKPCR |= SKPCR_DCLKEN;
}
}
diff --git a/arch/arm/mach-shark/Makefile b/arch/arm/mach-shark/Makefile
index 414d0c2e1..c6a4d4023 100644
--- a/arch/arm/mach-shark/Makefile
+++ b/arch/arm/mach-shark/Makefile
@@ -5,6 +5,8 @@
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
+USE_STANDARD_AS_RULE := true
+
O_TARGET := shark.o
# Object file lists.
@@ -18,15 +20,4 @@ export-objs :=
#obj-$(CONFIG_LEDS) += leds.o
-# Files that are both resident and modular; remove from modular.
-
-obj-m := $(filter-out $(obj-y), $(obj-m))
-
-# Translate to Rules.make lists.
-
-O_OBJS := $(filter-out $(export-objs), $(obj-y))
-OX_OBJS := $(filter $(export-objs), $(obj-y))
-M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
-MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
-
include $(TOPDIR)/Rules.make
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index fe3cf5eac..5cc3ff520 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -9,12 +9,11 @@
USE_STANDARD_AS_RULE := true
-EXTRA_AFLAGS := -traditional
O_TARGET := mm.o
# Object file lists.
-obj-y := extable.o fault-$(PROCESSOR).o init.o \
+obj-y := extable.o fault-common.o fault-$(PROCESSOR).o init.o \
mm-$(PROCESSOR).o small_page.o
obj-m :=
obj-n :=
@@ -22,10 +21,10 @@ obj- :=
export-objs := proc-syms.o
p-$(CONFIG_CPU_26) += proc-arm2,3.o
-p-$(CONFIG_CPU_ARM6) += proc-arm6,7.o
-p-$(CONFIG_CPU_ARM7) += proc-arm6,7.o
-p-$(CONFIG_CPU_ARM720) += proc-arm720.o
-p-$(CONFIG_CPU_ARM920) += proc-arm920.o
+p-$(CONFIG_CPU_ARM610) += proc-arm6,7.o
+p-$(CONFIG_CPU_ARM710) += proc-arm6,7.o
+p-$(CONFIG_CPU_ARM720T) += proc-arm720.o
+p-$(CONFIG_CPU_ARM920T) += proc-arm920.o
p-$(CONFIG_CPU_ARM10) += proc-arm10.o
p-$(CONFIG_CPU_SA110) += proc-sa110.o
p-$(CONFIG_CPU_SA1100) += proc-sa110.o
@@ -37,29 +36,16 @@ endif
# Integrator follows "new style"
# Soon, others will do too, and we can get rid of this
-MMMACH := mm-$(MACHINE).o
+MMMACH := mm-$(MACHINE).c
ifeq ($(MMMACH),$(wildcard $(MMMACH)))
-obj-$(CONFIG_CPU_32) += $(MMMACH)
+obj-$(CONFIG_CPU_32) += $(MMMACH:.c=.o)
endif
obj-y += $(sort $(p-y))
-# Files that are both resident and modular; remove from modular.
-
-obj-m := $(filter-out $(obj-y), $(obj-m))
-
-# Translate to Rules.make lists.
-
-O_OBJS := $(filter-out $(export-objs), $(obj-y))
-OX_OBJS := $(filter $(export-objs), $(obj-y))
-M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
-MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
-
include $(TOPDIR)/Rules.make
# Special dependencies
-fault-armv.o: fault-common.c
-fault-armo.o: fault-common.c
proc-arm2,3.o: ../lib/constants.h
proc-arm6,7.o: ../lib/constants.h
proc-arm720.o: ../lib/constants.h
diff --git a/arch/arm/mm/fault-armo.c b/arch/arm/mm/fault-armo.c
index 85b2dc2f4..a37c625f4 100644
--- a/arch/arm/mm/fault-armo.c
+++ b/arch/arm/mm/fault-armo.c
@@ -23,14 +23,20 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>
-#define FAULT_CODE_FORCECOW 0x80
+#define FAULT_CODE_LDRSTRPOST 0x80
+#define FAULT_CODE_LDRSTRPRE 0x40
+#define FAULT_CODE_LDRSTRREG 0x20
+#define FAULT_CODE_LDMSTM 0x10
+#define FAULT_CODE_LDCSTC 0x08
#define FAULT_CODE_PREFETCH 0x04
#define FAULT_CODE_WRITE 0x02
+#define FAULT_CODE_FORCECOW 0x01
#define DO_COW(m) ((m) & (FAULT_CODE_WRITE|FAULT_CODE_FORCECOW))
#define READ_FAULT(m) (!((m) & FAULT_CODE_WRITE))
-#include "fault-common.c"
+extern int do_page_fault(unsigned long addr, int mode, struct pt_regs *regs);
+extern void show_pte(struct mm_struct *mm, unsigned long addr);
/*
* Handle a data abort. Note that we have to handle a range of addresses
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index f184b4e68..a6a45f091 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -27,27 +27,9 @@
#include <asm/pgtable.h>
#include <asm/unaligned.h>
-#define FAULT_CODE_READ 0x02
-
-#define DO_COW(m) (!((m) & FAULT_CODE_READ))
-#define READ_FAULT(m) ((m) & FAULT_CODE_READ)
-
extern void die_if_kernel(const char *str, struct pt_regs *regs, int err);
-
-#include "fault-common.c"
-
-#ifdef DEBUG
-static int sp_valid(unsigned long *sp)
-{
- unsigned long addr = (unsigned long) sp;
-
- if (addr >= 0xb0000000 && addr < 0xd0000000)
- return 1;
- if (addr >= 0x03ff0000 && addr < 0x04000000)
- return 1;
- return 0;
-}
-#endif
+extern void show_pte(struct mm_struct *mm, unsigned long addr);
+extern int do_page_fault(unsigned long addr, int mode, struct pt_regs *regs);
#ifdef CONFIG_ALIGNMENT_TRAP
/*
@@ -178,6 +160,15 @@ do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
eaddr -= offset.un;
}
+ /*
+ * This is a "hint" - we already have eaddr worked out by the
+ * processor for us.
+ */
+ if (addr != eaddr)
+ printk(KERN_ERR "LDRHSTRH: PC = %08lx, instr = %08x, "
+ "addr = %08lx, eaddr = %08lx\n",
+ instruction_pointer(regs), instr, addr, eaddr);
+
if (LDST_L_BIT(instr))
regs->uregs[rd] = get_unaligned((unsigned short *)eaddr);
else
@@ -253,8 +244,15 @@ do_alignment(unsigned long addr, int error_code, struct pt_regs *regs)
}
}
-if (addr != eaddr)
-printk("PC = %08lx, instr = %08x, addr = %08lx, eaddr = %08lx\n", instruction_pointer(regs), instr, addr, eaddr);
+ /*
+ * This is a "hint" - we already have eaddr worked out by the
+ * processor for us.
+ */
+ if (addr != eaddr)
+ printk(KERN_ERR "LDRSTR: PC = %08lx, instr = %08x, "
+ "addr = %08lx, eaddr = %08lx\n",
+ instruction_pointer(regs), instr, addr, eaddr);
+
if (LDST_L_BIT(instr)) {
regs->uregs[rd] = get_unaligned((unsigned long *)eaddr);
if (rd == 15)
@@ -284,6 +282,15 @@ printk("PC = %08lx, instr = %08x, addr = %08lx, eaddr = %08lx\n", instruction_po
if (!LDST_U_BIT(instr))
eaddr -= nr_regs;
+ /*
+ * This is a "hint" - we already have eaddr worked out by the
+ * processor for us.
+ */
+ if (addr != eaddr)
+ printk(KERN_ERR "LDMSTM: PC = %08lx, instr = %08x, "
+ "addr = %08lx, eaddr = %08lx\n",
+ instruction_pointer(regs), instr, addr, eaddr);
+
if ((LDST_U_BIT(instr) == 0 && LDST_P_BIT(instr) == 0) ||
(LDST_U_BIT(instr) && LDST_P_BIT(instr)))
eaddr += 4;
@@ -322,39 +329,39 @@ printk("PC = %08lx, instr = %08x, addr = %08lx, eaddr = %08lx\n", instruction_po
#endif
-#ifdef CONFIG_DEBUG_USER
-
+/*
+ * Some section permission faults need to be handled gracefully, for
+ * instance, when they happen due to a __{get,put}_user during an oops).
+ * In this case, we should return an error to the __{get,put}_user caller
+ * instead of causing another oops. We should also fixup this fault as
+ * the user could pass a pointer to a section to the kernel.
+ */
static int
do_sect_fault(unsigned long addr, int error_code, struct pt_regs *regs)
{
+ unsigned long fixup;
+
if (user_mode(regs)) {
+#ifdef CONFIG_DEBUG_USER
printk("%s: permission fault on section, "
"address=0x%08lx, code %d\n",
current->comm, addr, error_code);
+#endif
+ goto fail;
+ }
+
+ fixup = search_exception_table(instruction_pointer(regs));
+ if (fixup != 0) {
#ifdef DEBUG
- {
- unsigned int i, j;
- unsigned long *sp;
-
- sp = (unsigned long *) (regs->ARM_sp - 128);
- for (j = 0; j < 20 && sp_valid(sp); j++) {
- printk("%p: ", sp);
- for (i = 0; i < 8 && sp_valid(sp); i += 1, sp++)
- printk("%08lx ", *sp);
- printk("\n");
- }
- show_regs(regs);
- c_backtrace(regs->ARM_fp, regs->ARM_cpsr);
- }
+ printk(KERN_DEBUG "%s: Exception at [<%lx>] addr=%lx (fixup: %lx)\n",
+ tsk->comm, regs->ARM_pc, addr, fixup);
#endif
+ regs->ARM_pc = fixup;
+ return 0;
}
+fail:
return 1; /* not fixed up */
}
-#else
-
-#define do_sect_fault NULL
-
-#endif
static const struct fsr_info {
int (*fn)(unsigned long addr, int error_code, struct pt_regs *regs);
@@ -382,18 +389,19 @@ static const struct fsr_info {
/*
* Currently dropped down to debug level
*/
-#define BUG_PROC_MSG \
- KERN_DEBUG "Weird data abort (%08X).\n" \
- KERN_DEBUG "Please see http://www.arm.linux.org.uk/state.html for " \
- "more information\n"
-
asmlinkage void
do_DataAbort(unsigned long addr, int error_code, struct pt_regs *regs, int fsr)
{
const struct fsr_info *inf = fsr_info + (fsr & 15);
+#if defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_SA1100)
if (addr == regs->ARM_pc)
- goto weirdness;
+ goto sa1_weirdness;
+#endif
+#if defined(CONFIG_CPU_ARM720T) && defined(CONFIG_ALIGNMENT_TRAP)
+ if (addr & 3 && (fsr & 13) != 1)
+ goto arm720_weirdness;
+#endif
if (!inf->fn)
goto bad;
@@ -409,26 +417,51 @@ bad:
die_if_kernel("Oops", regs, 0);
return;
-weirdness:
+#if defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_SA1100)
+sa1_weirdness:
if (user_mode(regs)) {
static int first = 1;
if (first)
- /*
- * I want statistical information on this problem,
- * but we don't want to hastle the users too much.
- */
- printk(BUG_PROC_MSG, fsr);
+ printk(KERN_DEBUG "Weird data abort detected\n");
first = 0;
return;
}
if (!inf->fn || inf->fn(addr, error_code, regs))
goto bad;
+ return;
+#endif
+#if defined(CONFIG_CPU_ARM720T) && defined(CONFIG_ALIGNMENT_TRAP)
+arm720_weirdness:
+ if (!user_mode(regs)) {
+ unsigned long instr;
+
+ instr = *(unsigned long *)instruction_pointer(regs);
+
+ if ((instr & 0x04400000) != 0x04400000) {
+ static int first = 1;
+ if (first)
+ printk("Mis-reported alignment fault at "
+ "0x%08lx, fsr 0x%02x, code 0x%02x, "
+ "PC = 0x%08lx, instr = 0x%08lx\n",
+ addr, fsr, error_code, regs->ARM_pc,
+ instr);
+ first = 0;
+ cpu_tlb_invalidate_all();
+ cpu_cache_clean_invalidate_all();
+ return;
+ }
+ }
+
+ if (!inf->fn || inf->fn(addr, error_code, regs))
+ goto bad;
+ return;
+#endif
}
asmlinkage int
do_PrefetchAbort(unsigned long addr, struct pt_regs *regs)
{
- do_page_fault(addr, FAULT_CODE_READ, regs);
+ do_page_fault(addr, 0, regs);
return 1;
}
diff --git a/arch/arm/mm/fault-common.c b/arch/arm/mm/fault-common.c
index 1cbdd7790..f79b618a2 100644
--- a/arch/arm/mm/fault-common.c
+++ b/arch/arm/mm/fault-common.c
@@ -9,8 +9,41 @@
* published by the Free Software Foundation.
*/
#include <linux/config.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/ptrace.h>
+#include <linux/mman.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/proc_fs.h>
+#include <linux/init.h>
+
+#include <asm/system.h>
+#include <asm/uaccess.h>
+#include <asm/pgtable.h>
+#include <asm/unaligned.h>
+
+#ifdef CONFIG_CPU_26
+#define FAULT_CODE_WRITE 0x02
+#define FAULT_CODE_FORCECOW 0x01
+#define DO_COW(m) ((m) & (FAULT_CODE_WRITE|FAULT_CODE_FORCECOW))
+#define READ_FAULT(m) (!((m) & FAULT_CODE_WRITE))
+#else
+/*
+ * On 32-bit processors, we define "mode" to be zero when reading,
+ * non-zero when writing. This now ties up nicely with the polarity
+ * of the 26-bit machines, and also means that we avoid the horrible
+ * gcc code for "int val = !other_val;".
+ */
+#define DO_COW(m) (m)
+#define READ_FAULT(m) (!(m))
+#endif
-extern void die(const char *msg, struct pt_regs *regs, int err);
+NORET_TYPE void die(const char *msg, struct pt_regs *regs, int err) ATTRIB_NORET;
/*
* This is useful to dump out the page tables associated with
@@ -60,7 +93,9 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
printk("\n");
}
-static int __do_page_fault(struct mm_struct *mm, unsigned long addr, int mode, struct task_struct *tsk)
+static int
+__do_page_fault(struct mm_struct *mm, unsigned long addr, int mode,
+ struct task_struct *tsk)
{
struct vm_area_struct *vma;
int fault, mask;
@@ -159,7 +194,7 @@ bad_area:
return -2;
}
-static int do_page_fault(unsigned long addr, int mode, struct pt_regs *regs)
+int do_page_fault(unsigned long addr, int mode, struct pt_regs *regs)
{
struct task_struct *tsk;
struct mm_struct *mm;
@@ -278,8 +313,10 @@ no_context:
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.
*/
- printk(KERN_ALERT "Unable to handle kernel %s at virtual address %08lx\n",
- (addr < PAGE_SIZE) ? "NULL pointer dereference" : "paging request", addr);
+ printk(KERN_ALERT
+ "Unable to handle kernel %s at virtual address %08lx\n",
+ (addr < PAGE_SIZE) ? "NULL pointer dereference" :
+ "paging request", addr);
show_pte(mm, addr);
die("Oops", regs, mode);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index bfa085a52..6ceec5a22 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -49,7 +49,7 @@
#define TABLE_SIZE ((TABLE_OFFSET + PTRS_PER_PTE) * sizeof(void *))
static unsigned long totalram_pages;
-pgd_t swapper_pg_dir[PTRS_PER_PGD];
+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
extern char _stext, _text, _etext, _end, __init_begin, __init_end;
/*
@@ -418,7 +418,7 @@ static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot
if (machine_is_archimedes() || machine_is_a5k())
reserve_bootmem_node(pgdat, 0x02000000, 0x00080000);
if (machine_is_p720t())
- reserve_bootmem_node(pgdat, 0xc0000000, 0x00014000);
+ reserve_bootmem_node(pgdat, PAGE_OFFSET, 0x00014000);
}
/*
@@ -450,8 +450,28 @@ void __init bootmem_init(struct meminfo *mi)
initrd_node = check_initrd(mi);
map_pg = bootmap_pfn;
-
- for (node = 0; node < numnodes; node++, np++) {
+
+ /*
+ * Initialise the bootmem nodes.
+ *
+ * What we really want to do is:
+ *
+ * unmap_all_regions_except_kernel();
+ * for_each_node_in_reverse_order(node) {
+ * map_node(node);
+ * allocate_bootmem_map(node);
+ * init_bootmem_node(node);
+ * free_bootmem_node(node);
+ * }
+ *
+ * but this is a 2.5-type change. For now, we just set
+ * the nodes up in reverse order.
+ *
+ * (we could also do with rolling bootmem_init and paging_init
+ * into one generic "memory_init" type function).
+ */
+ np += numnodes - 1;
+ for (node = numnodes - 1; node >= 0; node--, np--) {
/*
* If there are no pages in this node, ignore it.
* Note that node 0 must always have some pages.
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index d96fcbccb..a2fc69ea4 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -275,7 +275,7 @@ static void __init create_mapping(struct map_desc *md)
off = md->physical - virt;
length = md->length;
- while ((virt & 1048575 || (virt + off) & 1048575) && length >= PAGE_SIZE) {
+ while ((virt & 0xfffff || (virt + off) & 0xfffff) && length >= PAGE_SIZE) {
alloc_init_page(virt, virt + off, md->domain, prot_pte);
virt += PAGE_SIZE;
diff --git a/arch/arm/mm/proc-arm6,7.S b/arch/arm/mm/proc-arm6,7.S
index 61e135e19..d26a98f75 100644
--- a/arch/arm/mm/proc-arm6,7.S
+++ b/arch/arm/mm/proc-arm6,7.S
@@ -7,10 +7,8 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
- * MMU functions for ARM6
- *
* These are the low level assembler for performing cache and TLB
- * functions on the ARM6 & ARM7.
+ * functions on the ARM610 & ARM710.
*/
#include <linux/linkage.h>
#include <asm/assembler.h>
@@ -105,9 +103,9 @@ ENTRY(cpu_arm7_tlb_invalidate_page)
ENTRY(cpu_arm6_data_abort)
ldr r4, [r0] @ read instruction causing problem
- mov r1, r4, lsr #19 @ r1 b1 = L
+ tst r4, r4, lsr #21 @ C = bit 20
+ sbc r1, r1, r1 @ r1 = C - 1
and r2, r4, #14 << 24
- and r1, r1, #2 @ check read/write bit
teq r2, #8 << 24 @ was it ldm/stm
bne Ldata_simple
@@ -138,9 +136,9 @@ Ldata_simple: mrc p15, 0, r0, c6, c0, 0 @ get FAR
ENTRY(cpu_arm7_data_abort)
ldr r4, [r0] @ read instruction causing problem
- mov r1, r4, lsr #19 @ r1 b1 = L
+ tst r4, r4, lsr #21 @ C = bit 20
+ sbc r1, r1, r1 @ r1 = C - 1
and r2, r4, #15 << 24
- and r1, r1, #2 @ check read/write bit
add pc, pc, r2, lsr #22 @ Now branch to the relevent processing routine
movs pc, lr
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index e6fc86bd1..77b689bdf 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -144,9 +144,9 @@ Ldata_simple: mrc p15, 0, r0, c6, c0, 0 @ get FAR
ENTRY(cpu_arm720_data_abort)
ldr r4, [r0] @ read instruction causing problem
- mov r1, r4, lsr #19 @ r1 b1 = L
+ tst r4, r4, lsr #21 @ C = bit 20
+ sbc r1, r1, r1 @ r1 = C - 1
and r2, r4, #15 << 24
- and r1, r1, #2 @ check read/write bit
add pc, pc, r2, lsr #22 @ Now branch to the relevent processing routine
movs pc, lr
@@ -283,23 +283,11 @@ ENTRY(cpu_arm720_proc_fin)
ldmfd sp!, {pc}
/*
- * Function: arm720_proc_do_idle (void)
- *
- * Params : r0 = call type:
- * 0 = slow idle
- * 1 = fast idle
- * 2 = switch to slow processor clock
- * 3 = switch to fast processor clock
- *
+ * Function: arm720_proc_do_idle(void)
+ * Params : r0 = unused
* Purpose : put the processer in proper idle mode
*/
ENTRY(cpu_arm720_do_idle)
-#if 0 /* FIXME: is this part of the processor? */
- ldr r2, =IO_BASE @ Virt addr of IO
- add r2, r2, #0x00050000 @ Start of PMU regs
- mov r1, #0x01 @ Idle mode
- str r1, [r2, #4]
-#endif
mov pc, lr
/*
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index a4306f08a..6f1f11601 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -68,9 +68,9 @@
ENTRY(cpu_arm920_data_abort)
ldr r1, [r0] @ read aborted instruction
mrc p15, 0, r0, c6, c0, 0 @ get FAR
- mov r1, r1, lsr #19 @ b1 = L
+ tst r1, r1, lsr #21 @ C = bit 20
mrc p15, 0, r3, c5, c0, 0 @ get FSR
- and r1, r1, #2
+ sbc r1, r1, r1 @ r1 = C - 1
and r3, r3, #255
mov pc, lr
@@ -330,7 +330,7 @@ ENTRY(cpu_arm920_icache_invalidate_range)
mov r0, #0
mcr p15, 0, r0, c7, c10, 4 @ drain WB
ENTRY(cpu_arm920_icache_invalidate_page)
- /* why no invalidate I cache --rmk */
+ mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
mov pc, lr
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index 031ba648a..45b0a31fe 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -83,9 +83,9 @@ ENTRY(cpu_sa110_data_abort)
ENTRY(cpu_sa1100_data_abort)
ldr r1, [r0] @ read aborted instruction
mrc p15, 0, r0, c6, c0, 0 @ get FAR
- mov r1, r1, lsr #19 @ b1 = L
+ tst r1, r1, lsr #21 @ C = bit 20
mrc p15, 0, r3, c5, c0, 0 @ get FSR
- and r1, r1, #2
+ sbc r1, r1, r1 @ r1 = C - 1
and r3, r3, #255
mov pc, lr
diff --git a/arch/arm/nwfpe/Makefile b/arch/arm/nwfpe/Makefile
index a7f69d405..16c7c0aed 100644
--- a/arch/arm/nwfpe/Makefile
+++ b/arch/arm/nwfpe/Makefile
@@ -6,27 +6,27 @@
USE_STANDARD_AS_RULE := true
-NWFPE_OBJS := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o \
- fpmodule.o fpopcode.o softfloat.o \
- single_cpdo.o double_cpdo.o extended_cpdo.o
+O_TARGET := math-emu.o
-ifeq ($(CONFIG_CPU_26),y)
-NWFPE_OBJS += entry26.o
-else
-NWFPE_OBJS += entry.o
-endif
+obj-y :=
+obj-m :=
+obj-n :=
+
+list-multi := nwfpe.o
-ifeq ($(CONFIG_NWFPE),y)
-O_TARGET := math-emu.o
-O_OBJS = $(NWFPE_OBJS)
+obj-$(CONFIG_NWFPE) += nwfpe.o
+
+nwfpe-objs := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o \
+ fpmodule.o fpopcode.o softfloat.o \
+ single_cpdo.o double_cpdo.o extended_cpdo.o
+
+ifeq ($(CONFIG_CPU_26),y)
+nwfpe-objs += entry26.o
else
- ifeq ($(CONFIG_NWFPE),m)
- M_OBJS = nwfpe.o
- MI_OBJS = $(NWFPE_OBJS)
- endif
+nwfpe-objs += entry.o
endif
include $(TOPDIR)/Rules.make
-nwfpe.o: $(MI_OBJS) $(MIX_OBJS)
- $(LD) $(LD_RFLAG) -r -o $@ $(MI_OBJS) $(MIX_OBJS)
+nwfpe.o: $(nwfpe-objs)
+ $(LD) -r -o $@ $(nwfpe-objs)
diff --git a/arch/arm/vmlinux-armo.lds.in b/arch/arm/vmlinux-armo.lds.in
index 0c0e720aa..f42deb72c 100644
--- a/arch/arm/vmlinux-armo.lds.in
+++ b/arch/arm/vmlinux-armo.lds.in
@@ -47,6 +47,8 @@ SECTIONS
*(.gnu.warning)
*(.text.lock) /* out-of-line lock text */
*(.rodata)
+ *(.glue_7)
+ *(.glue_7t)
*(.kstrtab)
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
diff --git a/arch/arm/vmlinux-armv.lds.in b/arch/arm/vmlinux-armv.lds.in
index b0398852d..10661f414 100644
--- a/arch/arm/vmlinux-armv.lds.in
+++ b/arch/arm/vmlinux-armv.lds.in
@@ -42,6 +42,8 @@ SECTIONS
*(.gnu.warning)
*(.text.lock) /* out-of-line lock text */
*(.rodata)
+ *(.glue_7)
+ *(.glue_7t)
*(.kstrtab)
. = ALIGN(16);
__start___ex_table = .; /* Exception table */