Commit 353ca85a authored by Linus Torvalds's avatar Linus Torvalds

Linux 2.3.7pre6

Anybody who is interested in FS performance should take a look at the
latest pre-patch of 2.3.7 (only pre-6 and possibly later: do NOT get any
earlier versions. pre-5 still causes file corruption, pre-6 looks good so
far).

Careful, though: I fixed the problem that caused some corruption less than
an hour ago, and while my tests indicate it all works fine, this is a very
fundamental change. The difference to earlier kernels is:

 - ext2 (and some other block device filesystems that have been taught
   about it) uses write-through from the page cache instead of having a
   separate buffer cache and the page cache to maintain dirty state. This
   means much less memory pressure in certain situations, and it also
   means that we can avoid unnecessary copies.
 - the page cache has been threaded, so on SMP you can actually get
   noticeable speedups from processes that do concurrent file accesses.
 - lower-latency read paths, especially the cached case.

Both of these are big, and fundamental changes. So don't mistake me when I
say it is experimental: Ingo, David and I have been spending the last
weeks (especialy Ingo, who deserves a _lot_ of credit for this all: I
designed much of it, but Ingo made it a reality. Thanks Ingo) on making it
do the right thing and be stable, but if you worry about not having
backups you might not want to play with it even so. It took us this long
just to make it work reliably enough that we can't find any obvious
problems..

The interesting areas are things like
 - writes to shared mappings now go blindingly fast. We're talking mondo
   cleanups here. We used to do really badly on this, now we do really
   well.
 - does bdflush still do the right thing? There may be a _lot_ of tweaking
   to do to get everything working at full capacity.
 - can people confirm that it is stable for everybody?
 - if anybody has 8-way machines etc, scalability is interesting. It
   should scale to 8-way no problem. We used to scale to 1-way, barely.
   Numbers?
 - fsync(). It doesn't work right now, but it should be easy to make it
   work well on big files etc - something we've never been able to do
   before (we used to lack the indexing from file to dirty blocks: now we
   have access to that quite automatically thanks to having the
   inode->page index in place, and the dirty blocks are right there)

and I'd really appreciate comments from people, as long as people are
aware that it _looks_ stable but we don't guarantee anything at this
point.

                Linus
parent 2549c237
ARM Linux 2.1.99
================
Since this is a development kernel, it will not be as stable as the 2.0
series, and can cause very nasty problems (eg, trashing your hard disk).
When running one of these kernels, I advise you to back up the complete
contents of all your hard disks.
Contributors
------------
Here is a list of people actively working on the project (If you
wish to be added to the list, please email me):
Name: Russell King
Mail: linux@arm.uk.linux.org
Desc: Original developer of ARM Linux, project co-ordinator.
Name: Dave Gilbert
Mail: linux@treblig.org
Desc: A3/4/5xx floppy and hard disk code maintainer.
Name: Philip Blundell
Mail: Philip.Blundell@pobox.com
Desc: Architecture and processor selection during make config.
Todo list
---------
This is the list of changes to be done (roughly prioritised):
* fully test new MEMC translation code
* fully test new AcornSCSI driver.
* reply to email ;)
Notes
=====
Compilation of kernel
---------------------
In order to compile ARM Linux, you will need a compiler capable of
generating ARM ELF code with GNU extensions. GCC-2.7.2.2 is good.
To build ARM Linux natively, you shouldn't have to alter the ARCH = line in
the top level Makefile. However, if you don't have the ARM Linux ELF tools
installed as default, then you should change the CROSS_COMPILE line as
detailed below.
If you wish to cross-compile, then alter the following lines in the top
level make file:
ARCH = <whatever>
with
ARCH = arm
and
CROSS_COMPILE=
to
CROSS_COMPILE=<your-path-to-your-compiler-without-gcc>
eg.
CROSS_COMPILE=/usr/bin/arm-unknown-linuxelf-
Do a 'make config', followed by 'make dep', and finally 'make all' to
build the kernel (vmlinux). A compressed image can be built by doing
a 'make zImage' instead of 'make all'.
Bug reports etc.
----------------
Please send patches, bug reports and code for the ARM Linux project
to linux@arm.uk.linux.org. Patches will not be included into future
kernels unless they come to me (or the relevant person concerned).
When sending bug reports, please ensure that they contain all relevant
information, eg. the kernel messages that were printed before/during
the problem, what you were doing, etc.
For patches, please include some explanation as to what the patch does
and why (if relevant).
Modules
-------
Although modularisation is supported (and required for the FP emulator),
each module on an arm2/arm250/arm3 machine when is loaded will take
memory up to the next 32k boundary due to the size of the pages. Hence is
modularisation on these machines really worth it?
However, arm6 and up machines allow modules to take multiples of 4k, and
as such Acorn RiscPCs and other architectures using these processors can
make good use of modularisation.
ADFS Image files
----------------
You can access image files on your ADFS partitions by mounting the ADFS
partition, and then using the loopback device driver. You must have
losetup installed.
Please note that the PCEmulator DOS partitions have a partition table at
the start, and as such, you will have to give '-o offset' to losetup.
Kernel initialisation abort codes
---------------------------------
When the kernel is unable to boot, it will if possible display a colour
at the top of the screen. The colours have the following significance
when run in a 16 colour mode with the default palette:
Stripes of white, red, yellow, and green:
Kernel does not support the processor architecture detected.
Request to developers
---------------------
When writing device drivers which include a separate assembler file, please
include it in with the C file, and not the arch/arm/lib directory. This
allows the driver to be compiled as a loadable module without requiring
half the code to be compiled into the kernel image.
In general, try to avoid using assembler unless it is really necessary. It
makes drivers far less easy to port to other hardware.
ST506 hard drives
-----------------
The ST506 hard drive controllers seem to be working fine (if a little
slowly). At the moment they will only work off the controllers on an
A4x0's motherboard, but for it to work off a Podule just requires
someone with a podule to add the addresses for the IRQ mask and the
HDC base to the source.
As of 31/3/96 it works with two drives (you should get the ADFS
*configure hard drive set to 2). I've got an internal 20 MB and a great
big external 5.25" FH 64 MB drive (who could ever want more :-) ).
I've just got 240 K/s off it (a dd with bs=128k); that's about half of what
RiscOS gets, but it's a heck of a lot better than the 50 K/s I was getting
last week :-)
Known bug: Drive data errors can cause a hang; including cases where
the controller has fixed the error using ECC. (Possibly ONLY
in that case...hmm).
1772 Floppy
-----------
This also seems to work OK, but hasn't been stressed much lately. It
hasn't got any code for disc change detection in there at the moment which
could be a bit of a problem! Suggestions on the correct way to do this
are welcome.
Kernel entry (head-armv.S)
--------------------------
The initial entry into the kernel made via head-armv.S uses architecture
independent code. The architecture is selected by the value of 'r1' on
entry, which must be kept unique. You can register a new architecture
by mailing the following details to rmk@arm.uk.linux.org. Please give
the mail a subject of 'Register new architecture':
Name: <name of your architecture>
ARCHDIR: <name of include/asm-arm/arch-* directory>
Description:
<description of your architecture>
Please follow this format - it is an automated system. You should
receive a reply the next day.
---
Russell King (03/05/1998)
......@@ -11348,7 +11348,8 @@ Footbridge Mode
CONFIG_HOST_FOOTBRIDGE
The 21285 Footbridge chip can operate in either `host mode' or
`add-in' mode. Say Y if your 21285 is in host mode, and therefore
is the configuration master, otherwise say N.
is the configuration master, otherwise say N. This must not be
set to 'Y' if the card is used in 'add-in' mode.
MFM harddisk support
CONFIG_BLK_DEV_MFM
......
......@@ -4,7 +4,7 @@
"What should you avoid when writing PCI drivers"
by Martin Mares <mj@atrey.karlin.mff.cuni.cz> on 13-Feb-1998
by Martin Mares <mj@atrey.karlin.mff.cuni.cz> on 17-Jun-1999
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -19,6 +19,10 @@ ID, it should use:
For class-based search, use pci_find_class(CLASS_ID, dev).
You can use the constant PCI_ANY_ID as a wildcard replacement for
VENDOR_ID or DEVICE_ID. This allows searching for any device from a
specific vendor, for example.
In case you want to do some complex matching, look at pci_devices -- it's
a linked list of pci_dev structures for all PCI devices in the system.
......
......@@ -10,21 +10,31 @@
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995, 1996 by Russell King
# Copyright (C) 1995-1999 by Russell King
CFLAGS_PROC :=
ASFLAGS_PROC :=
# All processors get `-mshort-load-bytes' for now, to work around alignment
# problems. This is more of a hack that just happens to work than a real fix
# but it will do for now.
# GCC 2.7 uses different options to later compilers; sort out which we have
CONFIG_GCC_NEW := $(shell if $(CC) --version 2>&1 | grep '^2\.7' > /dev/null; then echo n; else echo y; fi)
# Hack to get around RiscPC with StrongARM optimistaion
# problem - force ARM710 optimisation for now.
ifeq ($(CONFIG_GCC_NEW),y)
ifeq ($(CONFIG_ARCH_RPC),y)
ifeq ($(CONFIG_CPU_SA110),y)
CONFIG_CPU_SA110 := n
CONFIG_CPU_ARM7 := y
endif
endif
endif
ifeq ($(CONFIG_CPU_26),y)
PROCESSOR = armo
TEXTADDR = 0x02080000
ZTEXTADDR = 0x01800000
ZRELADDR = 0x02080000
ifeq ($(CONFIG_BINUTILS_NEW),y)
ifeq ($(CONFIG_GCC_NEW),y)
CFLAGS_PROC += -mapcs-26 -mshort-load-bytes
ifeq ($(CONFIG_CPU_ARM2),y)
CFLAGS_PROC += -mcpu=arm2
......@@ -49,7 +59,7 @@ endif
ifeq ($(CONFIG_CPU_32),y)
PROCESSOR = armv
TEXTADDR = 0xC0008000
ifeq ($(CONFIG_BINUTILS_NEW),y)
ifeq ($(CONFIG_GCC_NEW),y)
CFLAGS_PROC += -mapcs-32 -mshort-load-bytes
ifeq ($(CONFIG_CPU_ARM6),y)
CFLAGS_PROC += -mcpu=arm6
......@@ -68,10 +78,11 @@ endif
# Processor Architecture
# CFLAGS_PROC - processor dependent CFLAGS
# PROCESSOR - processor type
# TEXTADDR - Uncompressed kernel link text address
# ZTEXTADDR - Compressed kernel link text address
# ZRELADDR - Compressed kernel relocating address (point at which uncompressed kernel is loaded).
# PROCESSOR - processor type
# TEXTADDR - Uncompressed kernel link text address
# ZTEXTADDR - Compressed kernel link text address
# ZRELADDR - Compressed kernel relocating address
# (point at which uncompressed kernel is loaded).
#
COMPRESSED_HEAD = head.o
......@@ -79,19 +90,16 @@ COMPRESSED_HEAD = head.o
ifeq ($(CONFIG_ARCH_A5K),y)
MACHINE = a5k
ARCHDIR = arc
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr.o
endif
ifeq ($(CONFIG_ARCH_ARC),y)
MACHINE = arc
ARCHDIR = arc
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr.o
endif
ifeq ($(CONFIG_ARCH_RPC),y)
MACHINE = rpc
ARCHDIR = rpc
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr.o
ZTEXTADDR = 0x10008000
ZRELADDR = 0x10008000
endif
......@@ -103,13 +111,17 @@ ZTEXTADDR = 0x00008000
ZRELADDR = 0x00008000
endif
ifeq ($(CONFIG_ARCH_EBSA285),y)
MACHINE = ebsa285
ifeq ($(CONFIG_FOOTBRIDGE),y)
MACHINE = footbridge
ARCHDIR = ebsa285
ZTEXTADDR = 0x00008000
ZRELADDR = 0x00008000
endif
ifeq ($(CONFIG_ARCH_CO285),y)
TEXTADDR = 0x60008000
endif
ifeq ($(CONFIG_ARCH_NEXUSPCI),y)
MACHINE = nexuspci
ARCHDIR = nexuspci
......@@ -119,31 +131,13 @@ COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr_scc.o
COMPRESSED_HEAD = head-nexuspci.o
endif
ifeq ($(CONFIG_ARCH_VNC),y)
TEXTADDR = 0xC000C000
MACHINE = vnc
ARCHDIR = vnc
endif
ifeq ($(CONFIG_ARCH_TBOX),y)
MACHINE = tbox
ARCHDIR = tbox
ZTEXTADDR = 0x80008000
ZRELDIR = 0x80008000
endif
PERL = perl
ifeq ($(CONFIG_BINUTILS_NEW),y)
LD = $(CROSS_COMPILE)ld -m elf32arm
else
LD = $(CROSS_COMPILE)ld -m elf_arm
endif
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
OBJDUMP = $(CROSS_COMPILE)objdump
CPP = $(CC) -E
ARCHCC := $(word 1,$(CC))
GCCLIB := `$(CC) $(CFLAGS_PROC) --print-libgcc-file-name`
#GCCARCH := -B/usr/bin/arm-linuxelf-
HOSTCFLAGS := $(CFLAGS:-fomit-frame-pointer=)
ifeq ($(CONFIG_FRAME_POINTER),y)
CFLAGS := $(CFLAGS:-fomit-frame-pointer=)
......@@ -153,75 +147,40 @@ ASFLAGS := $(ASFLAGS_PROC) $(ASFLAGS)
LINKFLAGS = -T $(TOPDIR)/arch/arm/vmlinux-$(PROCESSOR).lds -e stext -Ttext $(TEXTADDR)
ZLINKFLAGS = -Ttext $(ZTEXTADDR)
SUBDIRS := $(SUBDIRS:drivers=arch/arm/drivers) arch/arm/lib arch/arm/kernel arch/arm/mm
HEAD := arch/arm/kernel/head-$(PROCESSOR).o arch/arm/kernel/init_task.o
# If we're intending to debug the kernel, make sure it has line number
# information. This gets stripped out when building (z)Image so it doesn't
# add anything to the footprint of the running kernel.
ifeq ($(CONFIG_DEBUG_INFO),y)
CFLAGS += -g
endif
HEAD := arch/arm/kernel/head-$(PROCESSOR).o \
arch/arm/kernel/init_task.o
SUBDIRS := arch/arm/special $(SUBDIRS) arch/arm/lib arch/arm/kernel \
arch/arm/mm arch/arm/nwfpe
CORE_FILES := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
LIBS := arch/arm/lib/lib.a $(LIBS) $(GCCLIB)
BLOCK_DRIVERS := drivers/block/block.a
CDROM_DRIVERS := drivers/cdrom/cdrom.a
ifeq ($(CONFIG_FB),y)
CHAR_DRIVERS := arch/arm/drivers/char1/char1.a drivers/char/char.a arch/arm/drivers/char1/char1.a
else
ifeq ($(CONFIG_VGA_CONSOLE),y)
CHAR_DRIVERS := arch/arm/drivers/char1/char1.a drivers/char/char.a arch/arm/drivers/char1/char1.a
else
CHAR_DRIVERS := arch/arm/drivers/char/char.a
endif
endif
MISC_DRIVERS := drivers/misc/misc.a
NET_DRIVERS := drivers/net/net.a
PARIDE_DRIVERS := drivers/block/paride/paride.a
PCI_DRIVERS := drivers/pci/pci.a
SCSI_DRIVERS := drivers/scsi/scsi.a
SOUND_DRIVERS := drivers/sound/sound.a
VIDEO_DRIVERS := drivers/video/video.a
PNP_DRIVERS := drivers/pnp/pnp.a
DRIVERS += arch/arm/special/special.a
ifeq ($(CONFIG_ARCH_ACORN),y)
BLOCK_DRIVERS += drivers/acorn/block/acorn-block.a
CHAR_DRIVERS += drivers/acorn/char/acorn-char.a
NET_DRIVERS += drivers/acorn/net/acorn-net.a drivers/net/net.a
SCSI_DRIVERS += drivers/acorn/scsi/acorn-scsi.a
SUBDIRS += drivers/acorn/block drivers/acorn/char drivers/acorn/net \
drivers/acorn/scsi
DRIVERS += drivers/acorn/block/acorn-block.a \
drivers/acorn/char/acorn-char.a \
drivers/acorn/net/acorn-net.a \
drivers/acorn/scsi/acorn-scsi.a
endif
DRIVERS := $(BLOCK_DRIVERS) $(CHAR_DRIVERS) $(MISC_DRIVERS) $(NET_DRIVERS)
ifeq ($(CONFIG_FB),y)
DRIVERS := $(DRIVERS) $(VIDEO_DRIVERS)
else
ifeq ($(CONFIG_VGA_CONSOLE),y)
DRIVERS := $(DRIVERS) $(VIDEO_DRIVERS)
endif
endif
ifeq ($(CONFIG_SCSI),y)
DRIVERS := $(DRIVERS) $(SCSI_DRIVERS)
endif
ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR),)
DRIVERS := $(DRIVERS) $(CDROM_DRIVERS)
endif
ifdef CONFIG_PCI
DRIVERS := $(DRIVERS) $(PCI_DRIVERS)
endif
ifeq ($(CONFIG_SOUND),y)
DRIVERS := $(DRIVERS) $(SOUND_DRIVERS)
endif
ifeq ($(CONFIG_PARIDE),y)
DRIVERS := $(DRIVERS) $(PARIDE_DRIVERS)
endif
ifdef CONFIG_PNP
DRIVERS := $(DRIVERS) $(PNP_DRIVERS)
ifeq ($(CONFIG_NWFPE),y)
DRIVERS += arch/arm/nwfpe/math-emu.a
endif
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
symlinks::
$(RM) include/asm-arm/arch include/asm-arm/proc
(cd include/asm-arm; ln -sf arch-$(ARCHDIR) arch; ln -sf proc-$(PROCESSOR) proc)
# Once we've finished integrating the sources, the @$(MAKE) will disappear
archmrproper:
rm -f include/asm-arm/arch include/asm-arm/proc
@$(MAKE) -C arch/$(ARCH)/drivers mrproper
arch/arm/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/arm/kernel
......@@ -231,19 +190,20 @@ arch/arm/mm: dummy
arch/arm/lib: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/arm/lib
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
zImage: vmlinux
@$(MAKEBOOT) zImage
zImage zinstall Image install: vmlinux
@$(MAKEBOOT) $@
zinstall: vmlinux
@$(MAKEBOOT) zinstall
# Once we've finished integrating the sources, the @$(MAKE) will disappear
archmrproper:
rm -f include/asm-arm/arch include/asm-arm/proc
@$(MAKE) -C arch/$(ARCH)/special mrproper
Image: vmlinux
@$(MAKEBOOT) Image
archclean:
@$(MAKEBOOT) clean
$(RM) arch/arm/lib/constants.h
install: vmlinux
@$(MAKEBOOT) install
archdep:
@$(MAKEBOOT) dep
# My testing targets (that short circuit a few dependencies)
zImg:; @$(MAKEBOOT) zImage
......@@ -251,10 +211,19 @@ Img:; @$(MAKEBOOT) Image
i:; @$(MAKEBOOT) install
zi:; @$(MAKEBOOT) zinstall
archclean:
@$(MAKEBOOT) clean
$(RM) arch/arm/lib/constants.h
a5k_config:
$(RM) arch/arm/defconfig
cp arch/arm/def-configs/a5k arch/arm/defconfig
ebsa110_config:
$(RM) arch/arm/defconfig
cp arch/arm/def-configs/ebsa110 arch/arm/defconfig
footbridge_config:
$(RM) arch/arm/defconfig
cp arch/arm/def-configs/footbridge arch/arm/defconfig
rpc_config:
$(RM) arch/arm/defconfig
cp arch/arm/def-configs/rpc arch/arm/defconfig
archdep:
@$(MAKEBOOT) dep
sed -e /^MACHINE..*=/s,= .*,= rpc,;/^PROCESSOR..*=/s,= .*,= armv, linux/arch/arm/Makefile.normal
......@@ -11,10 +11,15 @@ HEAD =$(COMPRESSED_HEAD)
OBJS =$(HEAD) misc.o $(COMPRESSED_EXTRA)
CFLAGS =-O2 -DSTDC_HEADERS $(CFLAGS_PROC)
ARFLAGS =rc
FONTC =$(TOPDIR)/drivers/video/font_acorn_8x8.c
ifeq ($(CONFIG_ARCH_ACORN),y)
OBJS += ll_char_wr.o font.o
endif
all: vmlinux
vmlinux: piggy.o $(OBJS)
vmlinux: $(OBJS) piggy.o
$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJS) piggy.o
$(HEAD): $(HEAD:.o=.S)
......@@ -29,5 +34,8 @@ piggy.o: $(SYSTEM)
$(LD) -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-arm -T $$tmppiggy.lnk; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk;
font.o: $(FONTC)
$(CC) -Dstatic= -c -o $@ $(FONTC)
clean:; rm -f vmlinux core
......@@ -12,7 +12,7 @@
@ Regs: [] = corruptible
@ {} = used
@ () = do not use
#define __ASSEMBLY__
#include <linux/linkage.h>
#include <asm/assembler.h>
.text
......@@ -25,7 +25,7 @@
LC0: .word SYMBOL_NAME(bytes_per_char_h)
.word SYMBOL_NAME(video_size_row)
.word SYMBOL_NAME(cmap_80)
.word SYMBOL_NAME(acorndata_8x8)
.word SYMBOL_NAME(con_charconvtable)
ENTRY(ll_write_char)
......
......@@ -14,18 +14,31 @@ choice 'ARM system type' \
A5000 CONFIG_ARCH_A5K \
RiscPC CONFIG_ARCH_RPC \
EBSA-110 CONFIG_ARCH_EBSA110 \
EBSA-285 CONFIG_ARCH_EBSA285 \
NexusPCI CONFIG_ARCH_NEXUSPCI \
Corel-VNC CONFIG_ARCH_VNC \
Tbox CONFIG_ARCH_TBOX" RiscPC
FootBridge-based CONFIG_FOOTBRIDGE" RiscPC
if [ "$CONFIG_FOOTBRIDGE" = "y" ]; then
bool 'FootBridge in HOST mode' CONFIG_HOST_FOOTBRIDGE
if [ "$CONFIG_HOST_FOOTBRIDGE" = "y" ]; then
define_bool CONFIG_ADDIN_FOOTBRIDGE n
else
define_bool CONFIG_ADDIN_FOOTBRIDGE y
fi
fi
if [ "$CONFIG_HOST_FOOTBRIDGE" = "y" ]; then
bool ' Include support for Intel EBSA285' CONFIG_ARCH_EBSA285
bool ' Include support for Chalice CATS boards' CONFIG_CATS
bool ' Include support for Corel NetWinder' CONFIG_ARCH_NETWINDER
fi
if [ "$CONFIG_ARCH_EBSA285" = "y" ]; then
bool ' Include support for CATS boards' CONFIG_CATS
if [ "$CONFIG_ADDIN_FOOTBRIDGE" = "y" ]; then
# If we get any other footbridge-based plug-in boards, then
# add your architecture options here
define_bool CONFIG_ARCH_CO285 y
fi
# Select various configuration options depending on the machine type
# Easy check for Acorn-style architectures
if [ "$CONFIG_ARCH_ARC" = "y" -o \
"$CONFIG_ARCH_A5K" = "y" -o \
"$CONFIG_ARCH_RPC" = "y" ]; then
......@@ -34,23 +47,19 @@ else
define_bool CONFIG_ARCH_ACORN n
fi
if [ "$CONFIG_ARCH_TBOX" = "y" ]; then
define_bool CONFIG_BUS_I2C y
fi
#if [ "$CONFIG_ARCH_TBOX" = "y" ]; then
# define_bool CONFIG_BUS_I2C y
#fi
# These machines always have PCI
if [ "$CONFIG_ARCH_NEXUSPCI" = "y" -o \
"$CONFIG_ARCH_VNC" = "y" ]; then
"$CONFIG_HOST_FOOTBRIDGE" = "y" ]; then
define_bool CONFIG_PCI y
fi
if [ "$CONFIG_ARCH_EBSA285" = "y" ]; then
bool "PCI support" CONFIG_PCI
fi
# These machines have ISA-DMA
if [ "$CONFIG_CATS" = "y" -o \
"$CONFIG_ARCH_VNC" = "y" ]; then
"$CONFIG_ARCH_NETWINDER" = "y" ]; then
define_bool CONFIG_ISA_DMA y
else
define_bool CONFIG_ISA_DMA n
......@@ -59,7 +68,6 @@ fi
# Figure out whether this system uses 26-bit or 32-bit CPUs. Nobody has
# ever built a machine that can take both, and now that ARM3 is obsolete
# nobody is likely to either.
if [ "$CONFIG_ARCH_ARC" = "y" -o \
"$CONFIG_ARCH_A5K" = "y" ]; then
define_bool CONFIG_CPU_32 n
......@@ -71,7 +79,6 @@ fi
# Now allow the user to choose a more precise CPU. This is only used to set
# the flags we pass to GCC, not in any code.
choice 'Optimise for CPU' \
"ARM2 CONFIG_CPU_ARM2 \
ARM3 CONFIG_CPU_ARM3 \
......@@ -80,22 +87,21 @@ choice 'Optimise for CPU' \
SA110 CONFIG_CPU_SA110" ARM6
if [ "$CONFIG_CPU_26" = "y" ]; then
# For 26-bit CPUs, the page size changes with the amount of physical RAM!
# The default is 4MB but if the user has less they have to own up to it here.
choice 'Physical memory size' \
"4MB+ CONFIG_PAGESIZE_32 \
2MB CONFIG_PAGESIZE_16 \
1MB/512K CONFIG_PAGESIZE_8" 4MB+
2MB CONFIG_PAGESIZE_16" 4MB+
fi
endmenu
mainmenu_option next_comment
comment 'Code maturity level options'
bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL
bool 'Use new compilation options (for GCC 2.8)' CONFIG_BINUTILS_NEW
bool 'Compile kernel with frame pointer (for useful debugging)' CONFIG_FRAME_POINTER
if [ "$CONFIG_CPU_32" = "y" -a "$CONFIG_ARCH_EBSA110" != "y" ]; then
bool 'Enable kernel-mode alignment trap handler (EXPERIMENTAL)' CONFIG_ALIGNMENT_TRAP
fi
bool 'Split text into discardable sections' CONFIG_TEXT_SECTIONS
endmenu
mainmenu_option next_comment
......@@ -113,13 +119,19 @@ bool 'Networking support' CONFIG_NET
bool 'System V IPC' CONFIG_SYSVIPC
bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
bool 'Sysctl support' CONFIG_SYSCTL
tristate 'Math emulation' CONFIG_NWFPE
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
if [ "$CONFIG_CPU_32" = "y" ]; then
tristate 'RISC OS personality' CONFIG_ARTHUR
fi
tristate 'Parallel port support' CONFIG_PARPORT
if [ "$CONFIG_PARPORT" != "n" ]; then
dep_tristate ' Archimedes hardware' CONFIG_PARPORT_ARC $CONFIG_PARPORT
if [ "$CONFIG_ARCH_ARC" = "y" ]; then
dep_tristate ' Archimedes hardware' CONFIG_PARPORT_ARC $CONFIG_PARPORT
fi
dep_tristate ' PC-style hardware' CONFIG_PARPORT_PC $CONFIG_PARPORT
# If exactly one hardware type is selected then parport will optimise away
# support for loading any others. Defeat this if the user is keen.
......@@ -129,13 +141,29 @@ if [ "$CONFIG_PARPORT" != "n" ]; then
fi
fi
fi
if [ "$CONFIG_ARCH_EBSA285" = "y" -o \
"$CONFIG_ARCH_EBSA110" = "y" -o \
"$CONFIG_ARCH_VNC" = "y" ]; then
if [ "$CONFIG_ARCH_EBSA110" = "y" -o \
"$CONFIG_ARCH_NETWINDER" = "y" -o \
"$CONFIG_CATS" = "y" ]; then
string 'Initial kernel command string' CONFIG_CMDLINE
fi
if [ "$CONFIG_ARCH_NETWINDER" = "y" -o \
"$CONFIG_ARCH_EBSA110" = "y" -o \
"$CONFIG_ARCH_EBSA285" = "y" -o \
"$CONFIG_ARCH_CO285" = "y" ]; then
bool 'Timer and CPU usage LEDs' CONFIG_LEDS
if [ "$CONFIG_LEDS" = "y" ]; then
if [ "$CONFIG_ARCH_NETWINDER" = "y" -o \
"$CONFIG_ARCH_EBSA285" = "y" -o \
"$CONFIG_ARCH_CO285" = "y" ]; then
bool ' Timer LED' CONFIG_LEDS_TIMER
bool ' CPU usage LED' CONFIG_LEDS_CPU
fi
fi
fi
endmenu
source drivers/i2o/Config.in
source drivers/pnp/Config.in
source drivers/block/Config.in
......@@ -144,15 +172,19 @@ if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
source drivers/acorn/block/Config.in
fi
if [ "$CONFIG_VGA_CONSOLE" = "n" -a "$CONFIG_FB" = "n" ]; then
source arch/arm/drivers/char/Config.in
else
source drivers/char/Config.in
fi
source drivers/char/Config.in
if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
source drivers/acorn/char/Config.in
if [ "$CONFIG_MOUSE" = "y" ]; then
if [ "$CONFIG_ARCH_RPC" != "y" ]; then
define_bool CONFIG_KBDMOUSE y
else
define_bool CONFIG_RPCMOUSE y
fi
fi
fi
source drivers/usb/Config.in
if [ "$CONFIG_VT" = "y" ]; then
mainmenu_option next_comment
comment 'Console drivers'
......@@ -166,9 +198,11 @@ fi
if [ "$CONFIG_NET" = "y" ]; then
source net/Config.in
fi
if [ "$CONFIG_NET" = "y" ]; then
source net/ax25/Config.in
source net/irda/Config.in
mainmenu_option next_comment
comment 'Network device support'
......@@ -179,6 +213,15 @@ if [ "$CONFIG_NET" = "y" ]; then
endmenu
fi
# mainmenu_option next_comment
# comment 'ISDN subsystem'
#
# tristate 'ISDN support' CONFIG_ISDN
# if [ "$CONFIG_ISDN" != "n" ]; then
# source drivers/isdn/Config.in
# fi
# endmenu
mainmenu_option next_comment
comment 'SCSI support'
......@@ -200,21 +243,29 @@ if [ "$CONFIG_ARCH_ACORN" = "y" -o "$CONFIG_PCI" = "y" ]; then
endmenu
fi
# mainmenu_option next_comment
# comment 'ISDN subsystem'
#
# tristate 'ISDN support' CONFIG_ISDN
# if [ "$CONFIG_ISDN" != "n" ]; then
# source drivers/isdn/Config.in
# fi
# endmenu
source fs/Config.in
mainmenu_option next_comment
comment 'Kernel hacking'
bool 'Debug kernel errors' CONFIG_DEBUG_ERRORS
bool 'Compile kernel with frame pointer (for useful debugging)' CONFIG_FRAME_POINTER
bool 'Verbose kernel error messages' CONFIG_DEBUG_ERRORS
bool 'Verbose user fault messages' CONFIG_DEBUG_USER
bool 'Include debugging information in kernel binary' CONFIG_DEBUG_INFO
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
if [ "$CONFIG_CPU_26" = "y" ]; then
bool 'Disable pgtable cache (EXPERIMENTAL)' CONFIG_NO_PGT_CACHE
fi
# These options are only for real kernel hackers
# who want to get their hands dirty.
bool 'Kernel low-level debugging functions' CONFIG_DEBUG_LL
if [ "$CONFIG_DEBUG_LL" = "y" ]; then
if [ "$CONFIG_FOOTBRIDGE" = "y" ]; then
bool 'Kernel low-level debugging messages via DC21285 port' CONFIG_DEBUG_DC21285_PORT
fi
fi
fi
endmenu
This diff is collapsed.
......@@ -9,31 +9,37 @@ HEAD_OBJ = head-$(PROCESSOR).o
ENTRY_OBJ = entry-$(PROCESSOR).o
O_TARGET := kernel.o
O_OBJS := $(ENTRY_OBJ) ioport.o irq.o process.o ptrace.o setup.o \
O_OBJS := $(ENTRY_OBJ) irq.o process.o ptrace.o setup.o \
signal.o sys_arm.o time.o traps.o
DMA_OBJS_arc = dma-arc.o
DMA_OBJS_a5k = dma-a5k.o
DMA_OBJS_rpc = dma-rpc.o
DMA_OBJS_ebsa110 = dma-dummy.o
DMA_OBJS_ebsa285 = dma-ebsa285.o
DMA_OBJS_nexuspci =
DMA_OBJS_vnc = dma-vnc.o
O_OBJS_arc = ecard.o iic.o fiq.o oldlatches.o
O_OBJS_a5k = ecard.o iic.o fiq.o
O_OBJS_rpc = ecard.o iic.o fiq.o
O_OBJS_ebsa110 = leds-ebsa110.o
O_OBJS_ebsa285 = leds-ebsa285.o hw-ebsa285.o
O_OBJS_nexuspci =
O_OBJS_vnc = leds-ebsa285.o hw-vnc.o
ifeq ($(CONFIG_ISA_DMA),y)
ISA_DMA_OBJS += dma-isa.o
endif
O_OBJS_arc = dma-arc.o iic.o fiq.o oldlatches.o
O_OBJS_a5k = dma-a5k.o iic.o fiq.o
O_OBJS_rpc = dma-rpc.o iic.o fiq.o
O_OBJS_ebsa110 = dma-dummy.o
O_OBJS_footbridge = dma-footbridge.o $(ISA_DMA_OBJS)
O_OBJS_nexuspci = dma-dummy.o
OX_OBJS_arc = dma.o
OX_OBJS_a5k = dma.o
OX_OBJS_rpc = dma.o
OX_OBJS_ebsa110 =
OX_OBJS_footbridge= dma.o hw-footbridge.o
OX_OBJS_nexuspci =
all: lib kernel.o $(HEAD_OBJ) init_task.o
O_OBJS += $(O_OBJS_$(MACHINE))
ifeq ($(CONFIG_MODULES),y)
OX_OBJS = armksyms.o
else
O_OBJS += armksyms.o
endif
ifeq ($(CONFIG_ARCH_ACORN),y)
OX_OBJS += ecard.o
endif
ifeq ($(MACHINE),nexuspci)
......@@ -46,17 +52,23 @@ else
endif
endif
ifneq ($(DMA_OBJS_$(MACHINE)),)
OX_OBJS += dma.o
O_OBJS += $(DMA_OBJS_$(MACHINE))
ifeq ($(CONFIG_ISA_DMA),y)
O_OBJS += dma-isa.o
endif
ifdef CONFIG_LEDS
OX_OBJS += leds-$(MACHINE).o
endif
ifeq ($(CONFIG_MODULES),y)
OX_OBJS += $(OX_OBJS_$(MACHINE))
else
O_OBJS += dma-dummy.o
O_OBJS += $(OX_OBJS_$(MACHINE))
endif
O_OBJS += $(O_OBJS_$(MACHINE))
ifeq ($(CONFIG_ARTHUR),y)
O_OBJS += arthur.o
else
ifeq ($(CONFIG_ARTHUR),m)
M_OBJS += arthur.o
endif
endif
$(HEAD_OBJ): $(HEAD_OBJ:.o=.S)
$(CC) -D__ASSEMBLY__ -DTEXTADDR=$(TEXTADDR) -traditional -c $(HEAD_OBJ:.o=.S) -o $@
......@@ -72,3 +84,7 @@ $(ENTRY_OBJ): ../lib/constants.h
lib:
$(MAKE) -C ../lib constants.h
# Spell out some dependencies that `make dep' doesn't spot
entry-armv.o: calls.S
entry-armo.o: calls.S
......@@ -6,20 +6,40 @@
#include <linux/mman.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/in6.h>
#include <asm/ecard.h>
#include <asm/elf.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/pgtable.h>
#include <asm/semaphore.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/checksum.h>
extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(struct pt_regs *, struct user_fp_struct *);
extern void inswb(unsigned int port, void *to, int len);
extern void outswb(unsigned int port, const void *to, int len);
extern unsigned int local_bh_count[NR_CPUS];
extern unsigned int local_irq_count[NR_CPUS];
extern void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags);
extern void iounmap(void *addr);
extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
/*
* syscalls
*/
extern int sys_write(int, const char *, int);
extern int sys_read(int, char *, int);
extern int sys_lseek(int, off_t, int);
extern int sys_open(const char *, int, int);
extern int sys_exit(int);
extern int sys_wait4(int, int *, int, struct rusage *);
/*
* libgcc functions - functions that are used internally by the
* compiler... (prototypes are not correct though, but that
......@@ -43,6 +63,8 @@ extern void __udivsi3(void);
extern void __umoddi3(void);
extern void __umodsi3(void);
extern void ret_from_exception(void);
extern void fpundefinstr(void);
extern void fp_enter(void);
#define EXPORT_SYMBOL_ALIAS(sym,orig) \
const char __kstrtab_##sym##[] __attribute__((section(".kstrtab"))) = \
......@@ -57,32 +79,46 @@ EXPORT_SYMBOL_ALIAS(kern_fp_enter,fp_enter);
EXPORT_SYMBOL_ALIAS(fp_printk,printk);
EXPORT_SYMBOL_ALIAS(fp_send_sig,send_sig);
#ifdef CONFIG_CPU_26
EXPORT_SYMBOL(fpundefinstr);
EXPORT_SYMBOL(ret_from_exception);
#endif
/* platform dependent support */
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(udelay);
EXPORT_SYMBOL(xchg_str);
/* expansion card support */
#ifdef CONFIG_ARCH_ACORN
EXPORT_SYMBOL(ecard_startfind);
EXPORT_SYMBOL(ecard_find);
EXPORT_SYMBOL(ecard_readchunk);
EXPORT_SYMBOL(ecard_address);
EXPORT_SYMBOL(local_bh_count);
EXPORT_SYMBOL(local_irq_count);
#ifdef CONFIG_CPU_32
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);
#endif
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
/* processor dependencies */
EXPORT_SYMBOL(processor);
EXPORT_SYMBOL(machine_type);
EXPORT_SYMBOL(__machine_arch_type);
/* networking */
EXPORT_SYMBOL(csum_partial_copy);
EXPORT_SYMBOL(__csum_ipv6_magic);
/* io */
EXPORT_SYMBOL(outswb);
EXPORT_SYMBOL(outsb);
EXPORT_SYMBOL(outsw);
EXPORT_SYMBOL(inswb);
EXPORT_SYMBOL(outsl);
EXPORT_SYMBOL(insb);
EXPORT_SYMBOL(insw);
EXPORT_SYMBOL(insl);
EXPORT_SYMBOL(_memcpy_fromio);
EXPORT_SYMBOL(_memcpy_toio);
EXPORT_SYMBOL(_memset_io);
/* address translation */
#ifndef __virt_to_phys__is_a_macro
......@@ -98,7 +134,9 @@ EXPORT_SYMBOL(__virt_to_bus);
EXPORT_SYMBOL(__bus_to_virt);
#endif
#ifndef CONFIG_NO_PGT_CACHE
EXPORT_SYMBOL(quicklists);
#endif
EXPORT_SYMBOL(__bad_pmd);
EXPORT_SYMBOL(__bad_pmd_kernel);
......@@ -167,3 +205,17 @@ EXPORT_SYMBOL(find_next_zero_bit);
EXPORT_SYMBOL(armidlist);
EXPORT_SYMBOL(armidindex);
EXPORT_SYMBOL(elf_platform);
/* syscalls */
EXPORT_SYMBOL(sys_write);
EXPORT_SYMBOL(sys_read);
EXPORT_SYMBOL(sys_lseek);
EXPORT_SYMBOL(sys_open);
EXPORT_SYMBOL(sys_exit);
EXPORT_SYMBOL(sys_wait4);
/* semaphores */
EXPORT_SYMBOL_NOVERS(__down_failed);
EXPORT_SYMBOL_NOVERS(__down_interruptible_failed);
EXPORT_SYMBOL_NOVERS(__up_wakeup);
/*
* Arthur personality
* Copyright (C) 1998 Philip Blundell
*/
#include <linux/personality.h>
#include <linux/module.h>
#include <linux/stddef.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <asm/ptrace.h>
/* RISC OS doesn't have many signals, and a lot of those that it does
have don't map easily to any Linux equivalent. Never mind. */
#define RISCOS_SIGABRT 1
#define RISCOS_SIGFPE 2
#define RISCOS_SIGILL 3
#define RISCOS_SIGINT 4
#define RISCOS_SIGSEGV 5
#define RISCOS_SIGTERM 6
#define RISCOS_SIGSTAK 7
#define RISCOS_SIGUSR1 8
#define RISCOS_SIGUSR2 9
#define RISCOS_SIGOSERROR 10
static unsigned long riscos_to_linux_signals[32] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31
};
static unsigned long linux_to_riscos_signals[32] = {
0, -1, RISCOS_SIGINT, -1,
RISCOS_SIGILL, 5, RISCOS_SIGABRT, 7,
RISCOS_SIGFPE, 9, RISCOS_SIGUSR1, RISCOS_SIGSEGV,
RISCOS_SIGUSR2, 13, 14, RISCOS_SIGTERM,
16, 17, 18, 19,
20, 21, 22, 23,
24, 25, 26, 27,
28, 29, 30, 31
};
static void arthur_lcall7(int nr, struct pt_regs *regs)
{
struct siginfo info;
info.si_signo = SIGSWI;
info.si_code = nr;
/* Bounce it to the emulator */
send_sig_info(SIGSWI, &info, current);
}
static struct exec_domain riscos_exec_domain = {
"Arthur", /* name */
(lcall7_func)arthur_lcall7,
PER_RISCOS, PER_RISCOS,
riscos_to_linux_signals,
linux_to_riscos_signals,
#ifdef MODULE
&__this_module, /* No usage counter. */
#else
NULL,
#endif
NULL /* Nothing after this in the list. */
};
/*
* We could do with some locking to stop Arthur being removed while
* processes are using it.
*/
#ifdef MODULE
int init_module(void)
#else
int initialise_arthur(void)
#endif
{
return register_exec_domain(&riscos_exec_domain);
}
#ifdef MODULE
void cleanup_module(void)
{
unregister_exec_domain(&riscos_exec_domain);
}
#endif
......@@ -31,7 +31,7 @@
.long SYMBOL_NAME(sys_lseek)
/* 20 */ .long SYMBOL_NAME(sys_getpid)
.long SYMBOL_NAME(sys_mount_wrapper)
.long SYMBOL_NAME(sys_umount)
.long SYMBOL_NAME(sys_oldumount)
.long SYMBOL_NAME(sys_setuid)
.long SYMBOL_NAME(sys_getuid)
/* 25 */ .long SYMBOL_NAME(sys_stime)
......@@ -61,7 +61,7 @@
.long SYMBOL_NAME(sys_geteuid)
/* 50 */ .long SYMBOL_NAME(sys_getegid)
.long SYMBOL_NAME(sys_acct)
.long SYMBOL_NAME(sys_ni_syscall) /* was sys_phys */
.long SYMBOL_NAME(sys_umount)
.long SYMBOL_NAME(sys_ni_syscall) /* was sys_lock */
.long SYMBOL_NAME(sys_ioctl)
/* 55 */ .long SYMBOL_NAME(sys_fcntl)
......@@ -110,7 +110,7 @@
.long SYMBOL_NAME(sys_ni_syscall) /* was sys_profil */
.long SYMBOL_NAME(sys_statfs)
/* 100 */ .long SYMBOL_NAME(sys_fstatfs)
.long SYMBOL_NAME(sys_ni_syscall) /* .long _sys_ioperm */
.long SYMBOL_NAME(sys_ni_syscall)
.long SYMBOL_NAME(sys_socketcall)
.long SYMBOL_NAME(sys_syslog)
.long SYMBOL_NAME(sys_setitimer)
......@@ -119,7 +119,7 @@
.long SYMBOL_NAME(sys_newlstat)
.long SYMBOL_NAME(sys_newfstat)
.long SYMBOL_NAME(sys_uname)
/* 110 */ .long SYMBOL_NAME(sys_iopl)
/* 110 */ .long SYMBOL_NAME(sys_ni_syscall)
.long SYMBOL_NAME(sys_vhangup)
.long SYMBOL_NAME(sys_idle)
.long SYMBOL_NAME(sys_syscall) /* call a syscall */
......@@ -196,6 +196,10 @@
.long SYMBOL_NAME(sys_capget)
/* 185 */ .long SYMBOL_NAME(sys_capset)
.long SYMBOL_NAME(sys_sigaltstack_wrapper)
.long SYMBOL_NAME(sys_sendfile)
.long SYMBOL_NAME(sys_ni_syscall)
.long SYMBOL_NAME(sys_ni_syscall)
/* 190 */ .long SYMBOL_NAME(sys_vfork_wrapper)
.rept NR_syscalls-186
.long SYMBOL_NAME(sys_ni_syscall)
......
......@@ -8,17 +8,17 @@
#include <linux/pci.h>
#include <linux/ptrace.h>
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/hardware.h>
#define MAX_SLOTS 20
#define MAX_SLOTS 21
extern void pcibios_fixup_ebsa285(struct pci_dev *dev);
extern void pcibios_init_ebsa285(void);
extern void pcibios_fixup_vnc(struct pci_dev *dev);
extern void pcibios_init_vnc(void);
int
pcibios_present(void)
......@@ -33,11 +33,12 @@ pcibios_base_address(unsigned char bus, unsigned char dev_fn)
int slot = PCI_SLOT(dev_fn);
if (slot < MAX_SLOTS)
return 0xf8c00000 + (slot << 11) + (PCI_FUNC(dev_fn) << 8);
return PCICFG0_BASE + 0xc00000 +
(slot << 11) + (PCI_FUNC(dev_fn) << 8);
else
return 0;
} else
return 0xf9000000 | (bus << 16) | (dev_fn << 8);
return PCICFG1_BASE | (bus << 16) | (dev_fn << 8);
}
int
......@@ -151,10 +152,7 @@ __initfunc(void pcibios_fixup(void))
struct pci_dev *dev;
for (dev = pci_devices; dev; dev = dev->next) {
if (machine_is_ebsa285() || machine_is_cats())
pcibios_fixup_ebsa285(dev);
if (machine_is_netwinder())
pcibios_fixup_vnc(dev);
pcibios_fixup_ebsa285(dev);
pcibios_write_config_byte(dev->bus->number, dev->devfn,
PCI_INTERRUPT_LINE, dev->irq);
......@@ -164,18 +162,83 @@ __initfunc(void pcibios_fixup(void))
dev->bus->number, dev->devfn,
dev->vendor, dev->device, dev->irq);
}
if (machine_is_netwinder())
hw_init();
hw_init();
}
__initfunc(void pcibios_init(void))
{
if (machine_is_ebsa285() || machine_is_cats())
pcibios_init_ebsa285();
if (machine_is_netwinder())
pcibios_init_vnc();
printk("DEC21285 PCI revision %02X\n", *(unsigned char *)0xfe000008);
unsigned int mem_size = (unsigned int)high_memory - PAGE_OFFSET;
unsigned long cntl;
*CSR_SDRAMBASEMASK = (mem_size - 1) & 0x0ffc0000;
*CSR_SDRAMBASEOFFSET = 0;
*CSR_ROMBASEMASK = 0x80000000;
*CSR_CSRBASEMASK = 0;
*CSR_CSRBASEOFFSET = 0;
*CSR_PCIADDR_EXTN = 0;
#ifdef CONFIG_HOST_FOOTBRIDGE
/*
* Against my better judgement, Philip Blundell still seems
* to be saying that we should initialise the PCI stuff here
* when the PCI_CFN bit is not set, dispite my comment below,
* which he decided to remove. If it is not set, then
* the card is in add-in mode, and we're in a machine where
* the bus is set up by 'others'.
*
* We should therefore not mess about with the mapping in
* anyway, and we should not be using the virt_to_bus functions
* that exist in the HOST architecture mode (since they assume
* a fixed mapping).
*
* Instead, you should be using ADDIN mode, which allows for
* this situation. This does assume that you have correctly
* initialised the PCI bus, which you must have done to get
* your PC booted.
*
* Unfortunately, he seems to be blind to this. I guess he'll
* also remove all this.
*
* And THIS COMMENT STAYS, even if this gets patched, thank
* you.
*/
/*
* Map our SDRAM at a known address in PCI space, just in case
* the firmware had other ideas. Using a nonzero base is
* necessary, since some VGA cards forcefully use PCI addresses
* in the range 0x000a0000 to 0x000c0000. (eg, S3 cards).
*
* NOTE! If you need to chec the PCI_CFN bit in the SA110
* control register then you've configured the kernel wrong.
* If you're not using host mode, then DO NOT set
* CONFIG_HOST_FOOTBRIDGE, but use CONFIG_ADDIN_FOOTBRIDGE
* instead. In this case, you MUST supply some firmware
* to allow your PC to boot, plus we should not modify the
* mappings that the PC BIOS has set up for us.
*/
*CSR_PCICACHELINESIZE = 0x00002008;
*CSR_PCICSRBASE = 0;
*CSR_PCICSRIOBASE = 0;
*CSR_PCISDRAMBASE = virt_to_bus((void *)PAGE_OFFSET);
*CSR_PCIROMBASE = 0;
*CSR_PCICMD = PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER | PCI_COMMAND_FAST_BACK |
PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY |
(1 << 31) | (1 << 29) | (1 << 28) | (1 << 24);
#endif
/*
* Clear any existing errors - we aren't
* interested in historical data...
*/
cntl = *CSR_SA110_CNTL & 0xffffde07;
*CSR_SA110_CNTL = cntl | SA110_CNTL_RXSERR;
pcibios_init_ebsa285();
printk(KERN_DEBUG"PCI: DEC21285 revision %02lX\n", *CSR_CLASSREV & 0xff);
}
__initfunc(void pcibios_fixup_bus(struct pci_bus *bus))
......
......@@ -12,7 +12,6 @@
#include <asm/fiq.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/pgtable.h>
#include "dma.h"
......@@ -37,8 +36,9 @@ int arch_get_dma_residue(dmach_t channel, dma_t *dma)
if (channel != DMA_VIRTUAL_FLOPPY)
printk("arch_dma_count: invalid channel %d\n", channel);
else {
extern int floppy_fiqresidual(void);
return floppy_fiqresidual();
struct pt_regs regs;
get_fiq_regs(&regs);
return regs.ARM_r9;
}
return 0;
}
......@@ -48,6 +48,7 @@ void arch_enable_dma(dmach_t channel, dma_t *dma)
if (channel != DMA_VIRTUAL_FLOPPY)
printk("arch_enable_dma: invalid channel %d\n", channel);
else {
struct pt_regs regs;
void *fiqhandler_start;
unsigned int fiqhandler_length;
extern void floppy_fiqsetup(unsigned long len, unsigned long addr,
......@@ -67,8 +68,10 @@ void arch_enable_dma(dmach_t channel, dma_t *dma)
return;
}
memcpy((void *)0x1c, fiqhandler_start, fiqhandler_length);
flush_page_to_ram(0);
floppy_fiqsetup(dma->buf.length, __bus_to_virt(dma->buf.address), (int)PCIO_FLOPPYDMABASE);
regs.ARM_r9 = dma->buf.length;
regs.ARM_r10 = __bus_to_virt(dma->buf.address);
regs.ARM_fp = (int)PCIO_FLOPPYDMABASE;
set_fiq_regs(&regs);
enable_irq(dma->dma_irq);
}
}
......@@ -83,6 +86,11 @@ void arch_disable_dma(dmach_t channel, dma_t *dma)
}
}
int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
{
return 0;
}
__initfunc(void arch_dma_init(dma_t *dma))
{
dma[DMA_VIRTUAL_FLOPPY].dma_irq = 64;
......
/*
* arch/arm/kernel/dma-arc.c
*
* Copyright (C) 1998 Dave Gilbert / Russell King
* Copyright (C) 1998-1999 Dave Gilbert / Russell King
*
* DMA functions specific to Archimedes architecture
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/init.h>
......@@ -14,7 +15,7 @@
#include "dma.h"
int arch_request_dma(dmach_t channel, dma_t *dma)
int arch_request_dma(dmach_t channel, dma_t *dma, const char * dev_id)
{
if (channel == DMA_VIRTUAL_FLOPPY0 ||
channel == DMA_VIRTUAL_FLOPPY1)
......@@ -25,16 +26,12 @@ int arch_request_dma(dmach_t channel, dma_t *dma)
void arch_free_dma(dmach_t channel, dma_t *dma)
{
if (channel != DMA_VIRTUAL_FLOPPY0 &&
channel != DMA_VIRTUAL_FLOPPY1)
return 0;
else
return -EINVAL;
}
void arch_enable_dma(dmach_t channel, dma_t *dma)
{
switch (channel) {
#ifdef CONFIG_BLK_DEV_FD
case DMA_VIRTUAL_FLOPPY0: { /* Data DMA */
switch (dma->dma_mode) {
case DMA_MODE_READ: /* read */
......@@ -96,9 +93,38 @@ void arch_enable_dma(dmach_t channel, dma_t *dma)
restore_flags(flags);
}
break;
#endif
}
}
int arch_get_dma_residue(dmach_t channel, dma_t *dma)
{
switch (channel) {
#ifdef CONFIG_BLK_DEV_FD
case DMA_VIRTUAL_FLOPPY0: { /* Data DMA */
extern unsigned int fdc1772_bytestogo;
/* 10/1/1999 DAG - I presume its the number of bytes left? */
return fdc1772_bytestogo;
};
break;
case DMA_VIRTUAL_FLOPPY1: { /* Command completed */
/* 10/1/1999 DAG - Presume whether there is an outstanding command? */
extern unsigned int fdc1772_fdc_int_done;
return (fdc1772_fdc_int_done==0)?1:0; /* Explicit! If the int done is 0 then 1 int to go */
};
break;
#endif
default:
printk("dma-arc.c:arch_get_dma_residue called with unknown/unconfigured DMA channel\n");
return 0;
};
}
void arch_disable_dma(dmach_t channel, dma_t *dma)
{
if (channel != DMA_VIRTUAL_FLOPPY0 &&
......@@ -108,6 +134,11 @@ void arch_disable_dma(dmach_t channel, dma_t *dma)
disable_irq(dma->dma_irq);
}
int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
{
return 0;
}
__initfunc(void arch_dma_init(dma_t *dma))
{
dma[DMA_VIRTUAL_FLOPPY0].dma_irq = 64;
......
......@@ -9,6 +9,10 @@
#include <linux/errno.h>
#include <linux/init.h>
#include <asm/spinlock.h>
spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
int request_dma(int channel, const char *device_id)
{
return -EINVAL;
......
......@@ -6,7 +6,9 @@
* DMA functions specific to EBSA-285/CATS architectures
*
* Changelog:
* 09/11/1998 RMK Split out ISA DMA functions to dma-isa.c
* 09-Nov-1998 RMK Split out ISA DMA functions to dma-isa.c
* 17-Mar-1999 RMK Allow any EBSA285-like architecture to have
* ISA DMA controllers.
*/
#include <linux/config.h>
......@@ -16,7 +18,6 @@
#include <linux/init.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/hardware.h>
......@@ -24,16 +25,22 @@
#include "dma.h"
#include "dma-isa.h"
#ifdef CONFIG_ISA_DMA
static int has_isa_dma;
#else
#define has_isa_dma 0
#endif
int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_name)
{
switch (channel) {
case 0:
case 1: /* 21285 internal channels */
case _DC21285_DMA(0):
case _DC21285_DMA(1): /* 21285 internal channels */
return 0;
case 2 ... 9:
if (machine_is_cats())
return isa_request_dma(channel - 2, dma, dev_name);
case _ISA_DMA(0) ... _ISA_DMA(7):
if (has_isa_dma)
return isa_request_dma(channel - _ISA_DMA(0), dma, dev_name);
}
return -EINVAL;
......@@ -49,14 +56,13 @@ int arch_get_dma_residue(dmach_t channel, dma_t *dma)
int residue = 0;
switch (channel) {
case 0:
case 1:
case _DC21285_DMA(0):
case _DC21285_DMA(1):
break;
#ifdef CONFIG_CATS
case 2 ... 9:
if (machine_is_cats())
residue = isa_get_dma_residue(channel - 2);
#endif
case _ISA_DMA(0) ... _ISA_DMA(7):
if (has_isa_dma)
residue = isa_get_dma_residue(channel - _ISA_DMA(0), dma);
}
return residue;
}
......@@ -64,38 +70,43 @@ int arch_get_dma_residue(dmach_t channel, dma_t *dma)
void arch_enable_dma(dmach_t channel, dma_t *dma)
{
switch (channel) {
case 0:
case 1:
case _DC21285_DMA(0):
case _DC21285_DMA(1):
/*
* Not yet implemented
*/
break;
#ifdef CONFIG_CATS
case 2 ... 9:
if (machine_is_cats())
isa_enable_dma(channel - 2, dma);
#endif
case _ISA_DMA(0) ... _ISA_DMA(7):
if (has_isa_dma)
isa_enable_dma(channel - _ISA_DMA(0), dma);
}
}
void arch_disable_dma(dmach_t channel, dma_t *dma)
{
switch (channel) {
case 0:
case 1:
case _DC21285_DMA(0):
case _DC21285_DMA(1):
/*
* Not yet implemented
*/
break;
#ifdef CONFIG_CATS
case 2 ... 9:
if (machine_is_cats())
isa_disable_dma(channel - 2, dma);
#endif
case _ISA_DMA(0) ... _ISA_DMA(7):
if (has_isa_dma)
isa_disable_dma(channel - _ISA_DMA(0), dma);
}
}
int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
{
return 0;
}
__initfunc(void arch_dma_init(dma_t *dma))
{
/* Nothing to do */
#ifdef CONFIG_ISA_DMA
has_isa_dma = isa_init_dma();
#endif
}
......@@ -11,6 +11,7 @@
* Copyright (C) 1998 Phil Blundell
*/
#include <linux/sched.h>
#include <linux/init.h>
#include <asm/dma.h>
#include <asm/io.h>
......@@ -18,6 +19,11 @@
#include "dma.h"
#include "dma-isa.h"
#define ISA_DMA_MODE_READ 0x44
#define ISA_DMA_MODE_WRITE 0x48
#define ISA_DMA_MODE_CASCADE 0xc0
#define ISA_DMA_AUTOINIT 0x10
#define ISA_DMA_MASK 0
#define ISA_DMA_MODE 1
#define ISA_DMA_CLRFF 2
......@@ -40,10 +46,7 @@ static unsigned int isa_dma_port[8][7] = {
int isa_request_dma(int channel, dma_t *dma, const char *dev_name)
{
if (channel != 4)
return 0;
return -EINVAL;
return 0;
}
void isa_free_dma(int channel, dma_t *dma)
......@@ -56,25 +59,27 @@ int isa_get_dma_residue(int channel, dma_t *dma)
unsigned int io_port = isa_dma_port[channel][ISA_DMA_COUNT];
int count;
count = 1 + inb(io_port) + (inb(io_port) << 8);
count = 1 + inb(io_port);
count |= inb(io_port) << 8;
return channel < 4 ? count : (count << 1);
}
void isa_enable_dma(int channel, dma_t *dma)
{
unsigned long address, length;
if (dma->invalid) {
unsigned long address, length;
unsigned int mode;
address = dma->buf.address;
length = dma->buf.length - 1;
outb(address >> 24, isa_dma_port[channel][ISA_DMA_PGHI]);
outb(address >> 16, isa_dma_port[channel][ISA_DMA_PGLO]);
outb(address >> 24, isa_dma_port[channel][ISA_DMA_PGHI]);
if (channel >= 4) {
address >>= 1;
length = (length >> 1) & 0xfe; /* why &0xfe? */
length >>= 1;
}
outb(0, isa_dma_port[channel][ISA_DMA_CLRFF]);
......@@ -85,17 +90,31 @@ void isa_enable_dma(int channel, dma_t *dma)
outb(length, isa_dma_port[channel][ISA_DMA_COUNT]);
outb(length >> 8, isa_dma_port[channel][ISA_DMA_COUNT]);
outb(dma->dma_mode | (channel & 3), isa_dma_port[channel][ISA_DMA_MODE]);
mode = channel & 3;
switch (dma->dma_mode) {
switch (dma->dma_mode & DMA_MODE_MASK) {
case DMA_MODE_READ:
mode |= ISA_DMA_MODE_READ;
dma_cache_inv(__bus_to_virt(dma->buf.address), dma->buf.length);
break;
case DMA_MODE_WRITE:
mode |= ISA_DMA_MODE_WRITE;
dma_cache_wback(__bus_to_virt(dma->buf.address), dma->buf.length);
break;
case DMA_MODE_CASCADE:
mode |= ISA_DMA_MODE_CASCADE;
break;
default:
break;
}
if (dma->dma_mode & DMA_AUTOINIT)
mode |= ISA_DMA_AUTOINIT;
outb(mode, isa_dma_port[channel][ISA_DMA_MODE]);
dma->invalid = 0;
}
outb(channel & 3, isa_dma_port[channel][ISA_DMA_MASK]);
......@@ -105,3 +124,56 @@ void isa_disable_dma(int channel, dma_t *dma)
{
outb(channel | 4, isa_dma_port[channel][ISA_DMA_MASK]);
}
__initfunc(int isa_init_dma(void))
{
int dmac_found;
outb(0xff, 0x0d);
outb(0xff, 0xda);
outb(0x55, 0x00);
outb(0xaa, 0x00);
dmac_found = inb(0x00) == 0x55 && inb(0x00) == 0xaa;
if (dmac_found) {
int channel;
for (channel = 0; channel < 8; channel++)
isa_disable_dma(channel, NULL);
outb(0x40, 0x0b);
outb(0x41, 0x0b);
outb(0x42, 0x0b);
outb(0x43, 0x0b);
outb(0xc0, 0xd6);
outb(0x41, 0xd6);
outb(0x42, 0xd6);
outb(0x43, 0xd6);
outb(0, 0xd4);
outb(0x10, 0x08);
outb(0x10, 0xd0);
/*
* Is this correct? According to
* my documentation, it doesn't
* appear to be. It should be
* outb(0x3f, 0x40b); outb(0x3f, 0x4d6);
*/
outb(0x30, 0x40b);
outb(0x31, 0x40b);
outb(0x32, 0x40b);
outb(0x33, 0x40b);
outb(0x31, 0x4d6);
outb(0x32, 0x4d6);
outb(0x33, 0x4d6);
request_dma(DMA_ISA_CASCADE, "cascade");
}
return dmac_found;
}
......@@ -23,3 +23,7 @@ void isa_enable_dma(int channel, dma_t *dma);
*/
void isa_disable_dma(int channel, dma_t *dma);
/*
* Initialise DMA
*/
int isa_init_dma(void);
......@@ -11,10 +11,10 @@
#include <linux/init.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/dma.h>
#include <asm/fiq.h>
#include <asm/io.h>
#include <asm/iomd.h>
#include <asm/hardware.h>
#include <asm/uaccess.h>
......@@ -223,8 +223,9 @@ int arch_get_dma_residue(dmach_t channel, dma_t *dma)
break;
case DMA_VIRTUAL_FLOPPY: {
extern int floppy_fiqresidual(void);
residue = floppy_fiqresidual();
struct pt_regs regs;
get_fiq_regs(&regs);
return regs.ARM_r9;
}
break;
}
......@@ -286,7 +287,6 @@ void arch_enable_dma(dmach_t channel, dma_t *dma)
set_fiq_handler(fiqhandler_start, fiqhandler_length);
set_fiq_regs(&regs);
enable_irq(dma->dma_irq);
}
break;
......@@ -319,6 +319,46 @@ void arch_disable_dma(dmach_t channel, dma_t *dma)
}
}
int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
{
int tcr, speed;
if (cycle < 188)
speed = 3;
else if (cycle <= 250)
speed = 2;
else if (cycle < 438)
speed = 1;
else
speed = 0;
tcr = inb(IOMD_DMATCR);
speed &= 3;
switch (channel) {
case DMA_0:
tcr = (tcr & ~0x03) | speed;
break;
case DMA_1:
tcr = (tcr & ~0x0c) | (speed << 2);
break;
case DMA_2:
tcr = (tcr & ~0x30) | (speed << 4);
break;
case DMA_3:
tcr = (tcr & ~0xc0) | (speed << 6);
break;
default:
break;
}
outb(tcr, IOMD_DMATCR);
}
__initfunc(void arch_dma_init(dma_t *dma))
{
outb(0, IOMD_IO0CR);
......@@ -326,7 +366,7 @@ __initfunc(void arch_dma_init(dma_t *dma))
outb(0, IOMD_IO2CR);
outb(0, IOMD_IO3CR);
// outb(0xf0, IOMD_DMATCR);
outb(0xa0, IOMD_DMATCR);
dma[0].dma_base = ioaddr(IOMD_IO0CURA);
dma[0].dma_irq = IRQ_DMA0;
......
/*
* arch/arm/kernel/dma-vnc.c
*
* Copyright (C) 1998 Russell King
*/
#include <linux/sched.h>
#include <linux/malloc.h>
#include <linux/mman.h>
#include <linux/init.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include "dma.h"
#include "dma-isa.h"
int arch_request_dma(dmach_t channel, dma_t *dma, const char *dev_name)
{
if (channel < 8)
return isa_request_dma(channel, dma, dev_name);
return -EINVAL;
}
void arch_free_dma(dmach_t channel, dma_t *dma)
{
isa_free_dma(channel, dma);
}
int arch_get_dma_residue(dmach_t channel, dma_t *dma)
{
return isa_get_dma_residue(channel, dma);
}
void arch_enable_dma(dmach_t channel, dma_t *dma)
{
isa_enable_dma(channel, dma);
}
void arch_disable_dma(dmach_t channel, dma_t *dma)
{
isa_disable_dma(channel, dma);
}
__initfunc(void arch_dma_init(dma_t *dma))
{
/* Nothing to do */
}
......@@ -21,7 +21,6 @@
#include <linux/init.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/io.h>
......@@ -201,6 +200,12 @@ void disable_dma (dmach_t channel)
printk (KERN_ERR "Trying to disable free DMA%d\n", channel);
}
void set_dma_speed(dmach_t channel, int cycle_ns)
{
dma_chan[channel].speed =
arch_set_dma_speed(channel, &dma_chan[channel], cycle_ns);
}
int get_dma_residue(dmach_t channel)
{
return arch_get_dma_residue(channel, &dma_chan[channel]);
......@@ -214,6 +219,7 @@ EXPORT_SYMBOL(set_dma_count);
EXPORT_SYMBOL(set_dma_mode);
EXPORT_SYMBOL(get_dma_residue);
EXPORT_SYMBOL(set_dma_sg);
EXPORT_SYMBOL(set_dma_speed);
__initfunc(void init_dma(void))
{
......
......@@ -15,6 +15,7 @@ typedef struct {
unsigned int active:1; /* Transfer active */
unsigned int invalid:1; /* Address/Count changed */
dmamode_t dma_mode; /* DMA mode */
int speed; /* DMA speed */
unsigned int lock; /* Device is allocated */
const char *device_id; /* Device name */
......@@ -63,6 +64,15 @@ void arch_disable_dma(dmach_t channel, dma_t *dma);
*/
int arch_get_dma_residue(dmach_t channel, dma_t *dma);
/* Prototype: int arch_set_dma_speed(channel, dma, cycle)
* Purpose : Convert a cycle time to a register setting
* Params : channel - DMA channel number
* : dma - DMA structure for channel
* : cycle - cycle time in NS
* Returns : setting for 'dma->speed'
*/
int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle);
/* Prototype: void arch_dma_init(dma)
* Purpose : Initialise architecture specific DMA
* Params : dma - pointer to array of DMA structures
......
This diff is collapsed.
......@@ -159,8 +159,8 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
.macro restore_user_regs
ldmia sp, {r0 - lr}^
mov r0, r0
add sp, sp, #15*4
ldr lr, [sp], #8
ldr lr, [sp, #15*4]
add sp, sp, #15*4+8
movs pc, lr
.endm
......@@ -226,13 +226,6 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
str r0, [sp, #S_OLD_R0] ;\
mov fp, #0
#define USER_RESTORE_ALL \
ldmia sp, {r0 - lr}^ ;\
mov r0, r0 ;\
add sp, sp, #15*4 ;\
ldr lr, [sp], #8 ;\
movs pc, lr
#define SVC_RESTORE_ALL \
ldmfd sp, {r0 - pc}^
......@@ -253,7 +246,7 @@ _unexp_fiq: ldr sp, .LCfiq
mov r0, r0
movs pc, lr
Lfiqmsg: .ascii "*** Unexpeced FIQ\n\0"
Lfiqmsg: .ascii "*** Unexpected FIQ\n\0"
.align
.LCfiq: .word __temp_fiq
......@@ -315,14 +308,14 @@ fpe_not_present:
and r4, r10, #255 @ get offset
and r6, r10, #0x000f0000
tst r10, #0x00800000 @ +/-
rsbeq r4, r4, #0
ldr r5, [sp, r6, lsr #14] @ Load reg
rsbeq r4, r4, #0
add r5, r5, r4, lsl #2
str r5, [sp, r6, lsr #14] @ Save reg
b ret_from_exception
wfs_mask_data: .word 0x0e200110 @ WFS
.word 0x0fff0fff
wfs_mask_data: .word 0x0e200110 @ WFS/RFS
.word 0x0fef0fff
.word 0x0d0d0100 @ LDF [sp]/STF [sp]
.word 0x0d0b0100 @ LDF [fp]/STF [fp]
.word 0x0f0f0f00
......@@ -341,8 +334,7 @@ vector_prefetch:
save_user_regs
teqp pc, #0x00000003 @ NOT a problem - doesnt change mode
mask_pc r0, lr @ Address of abort
mov r1, #FAULT_CODE_PREFETCH|FAULT_CODE_USER @ Error code
mov r2, sp @ Tasks registers
mov r1, sp @ Tasks registers
bl SYMBOL_NAME(do_PrefetchAbort)
teq r0, #0 @ If non-zero, we believe this abort..
bne ret_from_sys_call
......@@ -451,6 +443,7 @@ vector_IRQ: ldr r13, .LCirq @ I will leave this one in just in case...
adr lr, 1b
orr lr, lr, #0x08000003 @ Force SVC
bne do_IRQ
mov r4, #0
b ret_with_reschedule
irq_prio_table
......@@ -562,8 +555,8 @@ Ldata_ldrstr_numindex:
and r0, r0, #15 << 2 @ Mask out reg.
teq r0, #15 << 2
ldr r0, [r3, r0] @ Get register
biceq r0, r0, #PCMASK
mov r1, r4, lsl #20
biceq r0, r0, #PCMASK
tst r4, #1 << 23
addne r0, r0, r1, lsr #20
subeq r0, r0, r1, lsr #20
......@@ -578,12 +571,12 @@ Ldata_ldrstr_regindex:
and r0, r0, #15 << 2 @ Mask out reg.
teq r0, #15 << 2
ldr r0, [r3, r0] @ Get register
biceq r0, r0, #PCMASK
and r7, r4, #15
biceq r0, r0, #PCMASK
teq r7, #15 @ Check for PC
ldr r7, [r3, r7, lsl #2] @ Get Rm
biceq r7, r7, #PCMASK
and r8, r4, #0x60 @ Get shift types
biceq r7, r7, #PCMASK
mov r9, r4, lsr #7 @ Get shift amount
and r9, r9, #31
teq r8, #0
......@@ -645,8 +638,8 @@ Ldata_ldcstc_pre:
and r0, r0, #15 << 2 @ Mask out reg.
teq r0, #15 << 2
ldr r0, [r3, r0] @ Get register
biceq r0, r0, #PCMASK
mov r1, r4, lsl #24 @ Get offset
biceq r0, r0, #PCMASK
tst r4, #1 << 23
addne r0, r0, r1, lsr #24
subeq r0, r0, r1, lsr #24
......@@ -656,9 +649,54 @@ Ldata_ldcstc_pre:
#endif
b SYMBOL_NAME(do_DataAbort)
#include "entry-common.S"
/*
*=============================================================================
* Low-level interface code
*-----------------------------------------------------------------------------
* Trap initialisation
*-----------------------------------------------------------------------------
*
* Note - FIQ code has changed. The default is a couple of words in 0x1c, 0x20
* that call _unexp_fiq. Nowever, we now copy the FIQ routine to 0x1c (removes
* some excess cycles).
*
* What we need to put into 0-0x1c are branches to branch to the kernel.
*/
.data
.section ".text.init",#alloc,#execinstr
.Ljump_addresses:
swi SYS_ERROR0
.word vector_undefinstr - 12
.word vector_swi - 16
.word vector_prefetch - 20
.word vector_data - 24
.word vector_addrexcptn - 28
.word vector_IRQ - 32
.word _unexp_fiq - 36
b . + 8
/*
* initialise the trap system
*/
ENTRY(trap_init)
stmfd sp!, {r4 - r7, lr}
adr r1, .Ljump_addresses
ldmia r1, {r1 - r7, ip, lr}
orr r2, lr, r2, lsr #2
orr r3, lr, r3, lsr #2
orr r4, lr, r4, lsr #2
orr r5, lr, r5, lsr #2
orr r6, lr, r6, lsr #2
orr r7, lr, r7, lsr #2
orr ip, lr, ip, lsr #2
mov r0, #0
stmia r0, {r1 - r7, ip}
ldmfd sp!, {r4 - r7, pc}^
.text
#include "entry-common.S"
__temp_irq: .word 0 @ saved lr_irq
.bss
__temp_irq: .space 4 @ saved lr_irq
__temp_fiq: .space 128
This diff is collapsed.
/*============================================================================
* All exits to user mode from the kernel go through this code.
*/
#include <linux/config.h>
.globl ret_from_sys_call
ret_from_exception:
adr r0, 1f
ldmia r0, {r0, r1}
.align 5
fast_syscall_return:
str r0, [sp, #S_R0 + 4] @ returned r0
slow_syscall_return:
add sp, sp, #4
ret_from_sys_call:
adr r0, bh_data
ldmia r0, {r0, r4}
ldr r0, [r0]
ldr r1, [r1]
ldr r1, [r4]
tst r0, r1
blne SYMBOL_NAME(do_bottom_half)
ret_from_intr: ldr r0, [sp, #S_PSR]
tst r0, #3
beq ret_with_reschedule
b ret_from_all
ret_with_reschedule:
get_current_task r1 @ check for scheduling
ldr r0, [r1, #TSK_NEED_RESCHED]
teq r0, #0
bne ret_reschedule
ldr r1, [r1, #TSK_SIGPENDING]
teq r1, #0 @ check for signals
bne ret_signal
ret_from_all: restore_user_regs
ret_signal: mov r1, sp
adrsvc al, lr, ret_from_all
mov r2, r4
b SYMBOL_NAME(do_signal)
2: bl SYMBOL_NAME(schedule)
ret_reschedule: adrsvc al, lr, ret_with_reschedule
b SYMBOL_NAME(schedule)
ret_from_sys_call:
adr r0, 1f
.globl ret_from_exception
ret_from_exception:
adr r0, bh_data
ldmia r0, {r0, r1}
ldr r0, [r0]
ldr r1, [r1]
mov r4, #0
tst r0, r1
adrsvc ne, lr, ret_from_intr
bne SYMBOL_NAME(do_bottom_half)
ret_with_reschedule:
get_current_task r1
ldr r0, [r1, #TSK_NEED_RESCHED]
teq r0, #0
bne 2b
ldr r1, [r1, #TSK_SIGPENDING]
teq r1, #0
bne ret_signal
ret_from_all: restore_user_regs
blne SYMBOL_NAME(do_bottom_half)
ldr r0, [sp, #S_PSR]
tst r0, #3 @ returning to user mode?
beq ret_with_reschedule
b ret_from_all
1: .word SYMBOL_NAME(bh_mask)
.word SYMBOL_NAME(bh_active)
#include "calls.S"
/*=============================================================================
* SWI handler
......@@ -57,84 +60,65 @@ ret_from_all: restore_user_regs
* too worried.
*/
#include "calls.S"
.align 5
vector_swi: save_user_regs
mov fp, #0
mask_pc lr, lr
ldr r6, [lr, #-4]! @ get SWI instruction
mov fp, #0
ldr r6, [lr, #-4] @ get SWI instruction
arm700_bug_check r6, r7
#ifdef CONFIG_ALIGNMENT_TRAP
ldr r7, .LCswi
ldr r7, [r7]
mcr p15, 0, r7, c1, c0
#endif
enable_irqs r7
str r4, [sp, #-4]! @ new style: (r0 = arg1, r4 = arg5)
adrsvc al, lr, fast_syscall_return
bic r6, r6, #0xff000000 @ mask off SWI op-code
eor r6, r6, #OS_NUMBER<<20 @ check OS number
cmp r6, #NR_syscalls @ check upper syscall limit
bcs 2f
get_current_task r5
ldr ip, [r5, #TSK_FLAGS] @ check for syscall tracing
get_current_task r7
ldr ip, [r7, #TSK_FLAGS] @ check for syscall tracing
adr r5, SYMBOL_NAME(sys_call_table)
tst ip, #PF_TRACESYS
bne 1f
ldreq pc, [r5, r6, lsl #2] @ call sys routine
adr ip, SYMBOL_NAME(sys_call_table)
str r4, [sp, #-4]! @ new style: (r0 = arg1, r5 = arg5)
mov lr, pc
ldr pc, [ip, r6, lsl #2] @ call sys routine
add sp, sp, #4
str r0, [sp, #S_R0] @ returned r0
b ret_from_sys_call
1: ldr r7, [sp, #S_IP] @ save old IP
ldr r7, [sp, #S_IP + 4] @ save old IP
mov r0, #0
str r0, [sp, #S_IP] @ trace entry [IP = 0]
str r0, [sp, #S_IP + 4] @ trace entry [IP = 0]
bl SYMBOL_NAME(syscall_trace)
str r7, [sp, #S_IP]
ldmia sp, {r0 - r3} @ have to reload r0 - r3
adr ip, SYMBOL_NAME(sys_call_table)
str r4, [sp, #-4]! @ new style: (r0 = arg1, r5 = arg5)
str r7, [sp, #S_IP + 4]
ldmib sp, {r0 - r3} @ have to reload r0 - r3
mov lr, pc
ldr pc, [ip, r6, lsl #2] @ call sys routine
add sp, sp, #4
str r0, [sp, #S_R0] @ returned r0
ldr pc, [r5, r6, lsl #2] @ call sys routine
str r0, [sp, #S_R0 + 4] @ returned r0
mov r0, #1
str r0, [sp, #S_IP] @ trace exit [IP = 1]
str r0, [sp, #S_IP + 4] @ trace exit [IP = 1]
bl SYMBOL_NAME(syscall_trace)
str r7, [sp, #S_IP]
b ret_from_sys_call
str r7, [sp, #S_IP + 4]
b slow_syscall_return
2: tst r6, #0x00f00000 @ is it a Unix SWI?
2: add r1, sp, #4
tst r6, #0x00f00000 @ is it a Unix SWI?
bne 3f
cmp r6, #(KSWI_SYS_BASE - KSWI_BASE)
bcc 4f @ not private func
bic r0, r6, #0x000f0000
mov r1, sp
bl SYMBOL_NAME(arm_syscall)
b ret_from_sys_call
3: eor r0, r6, #OS_NUMBER<<20 @ Put OS number back
mov r1, sp
bl SYMBOL_NAME(deferred)
ldmfd sp, {r0 - r3}
b ret_from_sys_call
4: bl SYMBOL_NAME(sys_ni_syscall)
str r0, [sp, #0] @ returned r0
b ret_from_sys_call
subs r0, r6, #(KSWI_SYS_BASE - KSWI_BASE)
bcs SYMBOL_NAME(arm_syscall)
b SYMBOL_NAME(sys_ni_syscall) @ not private func
@ r0 = syscall number
@ r1 = syscall r0
@ r5 = syscall r4
@ ip = syscall table
SYMBOL_NAME(sys_syscall):
mov r6, r0
eor r6, r6, #OS_NUMBER << 20
cmp r6, #NR_syscalls @ check range
movgt r0, #-ENOSYS
movgt pc, lr
add sp, sp, #4 @ take of the save of our r4
ldmib sp, {r0 - r4} @ get our args
str r4, [sp, #-4]! @ Put our arg on the stack
ldr pc, [ip, r6, lsl #2]
3: eor r0, r6, #OS_NUMBER <<20 @ Put OS number back
adrsvc al, lr, slow_syscall_return
b SYMBOL_NAME(deferred)
.align 5
bh_data: .word SYMBOL_NAME(bh_mask)
.word SYMBOL_NAME(bh_active)
ENTRY(sys_call_table)
#include "calls.S"
......@@ -142,10 +126,25 @@ ENTRY(sys_call_table)
/*============================================================================
* Special system call wrappers
*/
@ r0 = syscall number
@ r5 = syscall table
SYMBOL_NAME(sys_syscall):
eor r6, r0, #OS_NUMBER << 20
cmp r6, #NR_syscalls @ check range
ldmleib sp, {r0 - r4} @ get our args
strle r4, [sp] @ Put our arg on the stack
ldrle pc, [r5, r6, lsl #2]
mov r0, #-ENOSYS
mov pc, lr
sys_fork_wrapper:
add r0, sp, #4
b SYMBOL_NAME(sys_fork)
sys_vfork_wrapper:
add r0, sp, #4
b SYMBOL_NAME(sys_vfork)
sys_execve_wrapper:
add r3, sp, #4
b SYMBOL_NAME(sys_execve)
......@@ -192,99 +191,6 @@ sys_sigaltstack_wrapper:
ldr r2, [sp, #4 + S_SP]
b do_sigaltstack
/*
*=============================================================================
* Low-level interface code
*-----------------------------------------------------------------------------
* Trap initialisation
*-----------------------------------------------------------------------------
*
* Note - FIQ code has changed. The default is a couple of words in 0x1c, 0x20
* that call _unexp_fiq. Nowever, we now copy the FIQ routine to 0x1c (removes
* some excess cycles).
*
* What we need to put into 0-0x1c are ldrs to branch to 0xC0000000
* (the kernel).
* 0x1c onwards is reserved for FIQ, so I think that I will allocate 0xe0 onwards for
* the actual address to jump to.
*/
.section ".text.init",#alloc,#execinstr
#if defined(CONFIG_CPU_32)
/*
* these go into 0x00
*/
.Lbranches: swi SYS_ERROR0
ldr pc, .Lbranches + 0xe4
ldr pc, .Lbranches + 0xe8
ldr pc, .Lbranches + 0xec
ldr pc, .Lbranches + 0xf0
ldr pc, .Lbranches + 0xf4
ldr pc, .Lbranches + 0xf8
ldr pc, .Lbranches + 0xfc
/*
* this is put into 0xe4 and above
*/
.Ljump_addresses:
.word vector_undefinstr @ 0xe4
.word vector_swi @ 0xe8
.word vector_prefetch @ 0xec
.word vector_data @ 0xf0
.word vector_addrexcptn @ 0xf4
.word vector_IRQ @ 0xf8
.word _unexp_fiq @ 0xfc
/*
* initialise the trap system
*/
ENTRY(trap_init)
stmfd sp!, {r4 - r7, lr}
initialise_traps_extra
mov r0, #0xe4
adr r1, .Ljump_addresses
ldmia r1, {r1 - r7}
stmia r0, {r1 - r7}
mov r0, #0
adr r1, .Lbranches
ldmia r1, {r1 - r7}
stmia r0, {r1 - r7}
LOADREGS(fd, sp!, {r4 - r7, pc})
#elif defined(CONFIG_CPU_26)
.Ljump_addresses:
swi SYS_ERROR0
.word vector_undefinstr - 12
.word vector_swi - 16
.word vector_prefetch - 20
.word vector_data - 24
.word vector_addrexcptn - 28
.word vector_IRQ - 32
.word _unexp_fiq - 36
b . + 8
/*
* initialise the trap system
*/
ENTRY(trap_init)
stmfd sp!, {r4 - r7, lr}
adr r1, .Ljump_addresses
ldmia r1, {r1 - r7, ip, lr}
orr r2, lr, r2, lsr #2
orr r3, lr, r3, lsr #2
orr r4, lr, r4, lsr #2
orr r5, lr, r5, lsr #2
orr r6, lr, r6, lsr #2
orr r7, lr, r7, lsr #2
orr ip, lr, ip, lsr #2
mov r0, #0
stmia r0, {r1 - r7, ip}
ldmfd sp!, {r4 - r7, pc}^
#endif
.previous
/*============================================================================
* FP support
*/
.data
ENTRY(fp_enter)
......
......@@ -2,6 +2,8 @@
* linux/arch/arm/kernel/fiq.c
*
* Copyright (C) 1998 Russell King
* Copyright (C) 1998, 1999 Phil Blundell
*
* FIQ support written by Philip Blundell <philb@gnu.org>, 1998.
*
* FIQ support re-written by Russell King to be more generic
......@@ -78,7 +80,7 @@ int fiq_def_op(void *ref, int relinquish)
unprotect_page_0();
*(unsigned long *)FIQ_VECTOR = no_fiq_insn;
protect_page_0();
__flush_entry_to_ram(FIQ_VECTOR);
flush_icache_range(FIQ_VECTOR, FIQ_VECTOR + 4);
}
return 0;
......@@ -106,28 +108,77 @@ void set_fiq_handler(void *start, unsigned int length)
memcpy((void *)FIQ_VECTOR, start, length);
protect_page_0();
#ifdef CONFIG_CPU_32
processor.u.armv3v4._flush_cache_area(FIQ_VECTOR, FIQ_VECTOR + length, 1);
#endif
flush_icache_range(FIQ_VECTOR, FIQ_VECTOR + length);
}
/*
* Taking an interrupt in FIQ mode is death, so both these functions
* disable irqs for the duration.
*/
void set_fiq_regs(struct pt_regs *regs)
{
/* not yet -
* this is temporary to get the floppy working
* again on RiscPC. It *will* become more
* generic.
*/
#ifdef CONFIG_ARCH_ACORN
extern void floppy_fiqsetup(unsigned long len, unsigned long addr,
unsigned long port);
floppy_fiqsetup(regs->ARM_r9, regs->ARM_r10, regs->ARM_fp);
register unsigned long tmp, tmp2;
__asm__ volatile (
#ifdef CONFIG_CPU_26
"mov %0, pc
bic %1, %0, #0x3
orr %1, %1, #0x0c000001
teqp %1, #0 @ select FIQ mode
mov r0, r0
ldmia %2, {r8 - r14}
teqp %0, #0 @ return to SVC mode
mov r0, r0"
#endif
#ifdef CONFIG_CPU_32
"mrs %0, cpsr
bic %1, %0, #0xf
orr %1, %1, #0xc1
msr cpsr, %1 @ select FIQ mode
mov r0, r0
ldmia %2, {r8 - r14}
msr cpsr, %0 @ return to SVC mode
mov r0, r0"
#endif
: "=r" (tmp), "=r" (tmp2)
: "r" (&regs->ARM_r8)
/* These registers aren't modified by the above code in a way
visible to the compiler, but we mark them as clobbers anyway
so that GCC won't put any of the input or output operands in
them. */
: "r8", "r9", "r10", "r11", "r12", "r13", "r14");
}
void get_fiq_regs(struct pt_regs *regs)
{
/* not yet */
register unsigned long tmp, tmp2;
__asm__ volatile (
#ifdef CONFIG_CPU_26
"mov %0, pc
bic %1, %0, #0x3
orr %1, %1, #0x0c000001
teqp %1, #0 @ select FIQ mode
mov r0, r0
stmia %2, {r8 - r14}
teqp %0, #0 @ return to SVC mode
mov r0, r0"
#endif
#ifdef CONFIG_CPU_32
"mrs %0, cpsr
bic %1, %0, #0xf
orr %1, %1, #0xc1
msr cpsr, %1 @ select FIQ mode
mov r0, r0
stmia %2, {r8 - r14}
msr cpsr, %0 @ return to SVC mode
mov r0, r0"
#endif
: "=r" (tmp), "=r" (tmp2)
: "r" (&regs->ARM_r8)
/* These registers aren't modified by the above code in a way
visible to the compiler, but we mark them as clobbers anyway
so that GCC won't put any of the input or output operands in
them. */
: "r8", "r9", "r10", "r11", "r12", "r13", "r14");
}
int claim_fiq(struct fiq_handler *f)
......
......@@ -7,13 +7,21 @@
*/
#include <linux/config.h>
#include <linux/linkage.h>
#include <asm/hardware.h>
#include <asm/dec21285.h>
.globl SYMBOL_NAME(swapper_pg_dir)
.equ SYMBOL_NAME(swapper_pg_dir), TEXTADDR - 0x4000
.section ".text.init",#alloc,#execinstr
ENTRY(stext)
ENTRY(_stext)
#ifndef CONFIG_ARCH_VNC
#if (TEXTADDR & 0xffff) != 0x8000
#error TEXTADDR must start at 0xXXXX8000
#endif
#else
.text
#ifdef CONFIG_ARCH_NETWINDER
mov r0, r0
mov r0, r0
mov r0, r0
......@@ -22,16 +30,34 @@
mov r0, r0
mov r0, r0
mov r0, r0
adr r2, 1f
ldmdb r2, {r7, r8}
and r3, r2, #0x0000c000
teq r3, #0x00008000
beq __entry
bic r3, r2, #0xc000
orr r3, r3, #0x8000
mov r0, r3
mov r4, #32
sub r5, r8, r7
b 1f
.word _stext
.word _end
1: ldmia r2!, {r6, r7, r8, r9}
stmia r3!, {r6, r7, r8, r9}
subs r4, r4, #16
bcs 1b
movs r4, r5
mov r5, #0
movne pc, r0
mov r0, #0
mov r1, #5
#endif
#define DEBUG
.globl SYMBOL_NAME(swapper_pg_dir)
.equ SYMBOL_NAME(swapper_pg_dir), TEXTADDR - 0x4000
.text
/*
* Entry point and restart point. Entry *must* be called with r0 == 0,
* MMU off. Note! These should be unique!!! Please read Documentation/ARM-README
......@@ -45,16 +71,15 @@
* r1 = 5 -> Corel Netwinder
* r1 = 6 -> CATS
* r1 = 7 -> tbox
* r1 = 8 -> SA110/21285 as co-processor
*/
ENTRY(stext)
ENTRY(_stext)
__entry: teq r0, #0 @ check for illegal entry...
bne .Lerror @ loop indefinitely
cmp r1, #8 @ Unknown machine architecture
cmp r1, #9 @ Unknown machine architecture
bge .Lerror
/* First thing to do is to get the page tables set up so that we can call the kernel
* in the correct place. This is relocatable code...
/* First thing to do is to get the page tables set up so that we can call
* the kernel in the correct place. This is relocatable code...
* - Read processor ID register (CP#15, CR0).
*/
mrc p15, 0, r9, c0, c0 @ get Processor ID
......@@ -74,7 +99,7 @@ __entry: teq r0, #0 @ check for illegal entry...
adr r4, .LCMachTypes
add r4, r4, r1, lsl #4
ldmia r4, {r4, r5, r6}
ldmia r4, {r4, r5, r6, r7}
/*
* r4 = page dir in physical ram
* r5 = physical address of start of RAM
......@@ -99,26 +124,28 @@ __entry: teq r0, #0 @ check for illegal entry...
add r3, r3, #1 << 20
str r3, [r0], #4
add r3, r3, #1 << 20
#ifdef DEBUG
#ifdef CONFIG_DEBUG_LL
/* Map in IO space
* This allows debug messages to be output via a serial
* before/while paging_init.
*/
add r0, r4, #0x3800
add r0, r4, r7
orr r3, r6, r8
add r2, r0, #0x0800
1: str r3, [r0], #4
add r3, r3, #1 << 20
teq r0, r2
bne 1b
#ifdef CONFIG_ARCH_VNC
add r0, r4, #0x3f00
add r0, r0, #0x00f8
#ifdef CONFIG_ARCH_NETWINDER
teq r1, #5
bne 1f
add r0, r4, #0x3fc0
mov r3, #0x7c000000
orr r3, r3, r8
str r3, [r0], #4
add r3, r3, #1 << 20
str r3, [r0], #4
1:
#endif
#endif
#ifdef CONFIG_ARCH_RPC
......@@ -168,49 +195,55 @@ __entry: teq r0, #0 @ check for illegal entry...
.LCMachTypes: .long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long 0xe0000000 @ I/O address
.long 0
.long 0x3800
@ Acorn RiscPC
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 + 0x10000000
.long 0x10000000
.long 0x03000000
.long 0
.long 0x3800
@ EBSIT ???
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000
.long 0
.long 0xe0000000
.long 0
.long 0x3800
@ NexusPCI
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 + 0x40000000
.long 0x40000000
.long 0x10000000
.long 0
.long 0x3800
@ DEC EBSA285
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long 0x24000000 @ I/O base address (0x42000000 -> 0xFE000000)
.long 0
.long 0x3800
@ Corel VNC
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long 0x24000000 @ I/O base address (0x42000000 -> 0xfe000000)
.long 0
.long 0x3800
@ CATS
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long 0x24000000 @ I/O base address (0x42000000 -> 0xfe000000)
.long 0
.long 0x3800
@ tbox
.long SYMBOL_NAME(swapper_pg_dir) - 0xc0000000 + 0x80000000
.long 0x80000000 @ Address of RAM
.long 0x00400000 @ Uart
.long 0
.long 0x3800
@ DEC EBSA285 as co-processor
.long 0x4000 @ Address of page tables (physical)
.long 0 @ Address of RAM
.long DC21285_ARMCSR_BASE @ Physical I/O base address
.long 0x7cf00000 >> 18 @ Virtual I/O base address
.LCProcTypes: @ ARM6 / 610
.long 0x41560600
......@@ -250,7 +283,11 @@ __entry: teq r0, #0 @ check for illegal entry...
mcr p15, 0, r4, c2, c0 @ load page table pointer
mov r0, #0x1f @ Domains 0, 1 = client
mcr p15, 0, r0, c3, c0 @ load domain access register
#ifdef CONFIG_ALIGNMENT_TRAP
mov r0, #0x3f @ ....S..DPWCAM
#else
mov r0, #0x3d @ ....S..DPWC.M
#endif
orr r0, r0, #0x100
mov pc, lr
......@@ -261,7 +298,11 @@ __entry: teq r0, #0 @ check for illegal entry...
mcr p15, 0, r4, c2, c0 @ load page table pointer
mov r0, #0x1f @ Domains 0, 1 = client
mcr p15, 0, r0, c3, c0 @ load domain access register
#ifdef CONFIG_ALIGNMENT_TRAP
mov r0, #0x7f @ ....S.LDPWCAM
#else
mov r0, #0x7d @ ....S.LDPWC.M
#endif
orr r0, r0, #0x100
mov pc, lr
......@@ -276,32 +317,38 @@ __entry: teq r0, #0 @ check for illegal entry...
mrc p15, 0, r0, c1, c0 @ get control register v4
bic r0, r0, #0x0e00
bic r0, r0, #0x0002
#ifdef CONFIG_ALIGNMENT_TRAP
orr r0, r0, #0x003f @ I...S..DPWCAM
#else
orr r0, r0, #0x003d @ I...S..DPWC.M
#endif
orr r0, r0, #0x1100 @ v4 supports separate I cache
mov pc, lr
.section ".text.init",#alloc,#execinstr
.Lsa_fastclock: mcr p15, 0, r4, c15, c1, 2 @ Enable clock switching
mov pc, lr
.LC0: .long SYMBOL_NAME(__entry)
.long SYMBOL_NAME(machine_type)
.long SYMBOL_NAME(__machine_arch_type)
.long SYMBOL_NAME(__bss_start)
.long SYMBOL_NAME(processor_id)
.long SYMBOL_NAME(_end)
.long SYMBOL_NAME(cr_alignment)
.long SYMBOL_NAME(init_task_union)+8192
.align
.Lalready_done_mmap:
adr r4, .LC0
ldmia r4, {r3, r4, r5, r6, r8, sp} @ Setup stack
ldmia r4, {r3, r4, r5, r6, r7, r8, sp} @ Setup stack
add r10, r10, r3 @ Add base back in
mov fp, #0
1: cmp r5, r8 @ Clear BSS
1: cmp r5, r7 @ Clear BSS
strcc fp, [r5],#4
bcc 1b
bic r2, r0, #2 @ Clear 'A' bit
stmia r8, {r0, r2} @ Save control register values
str r1, [r4] @ Save machine type
str r9, [r6] @ Save processor ID
mov lr, pc
......@@ -310,10 +357,12 @@ __entry: teq r0, #0 @ check for illegal entry...
b SYMBOL_NAME(start_kernel)
.text
#ifdef DEBUG
#ifdef CONFIG_DEBUG_LL
/*
* Some debugging routines (useful if you've got MM problems and
* printk isn't working). For DEBUGGING ONLY!!!
* printk isn't working). For DEBUGGING ONLY!!! Do not leave
* references to these in a production kernel!
*/
#if defined(CONFIG_ARCH_RPC)
.macro addruart,rx
......@@ -362,64 +411,71 @@ __entry: teq r0, #0 @ check for illegal entry...
beq 1001b
.endm
#elif defined(CONFIG_ARCH_EBSA285)
#elif defined(CONFIG_HOST_FOOTBRIDGE) || defined(CONFIG_ADDIN_FOOTBRIDGE)
#ifndef CONFIG_DEBUG_DC21285_PORT
/* For NetWinder debugging */
.macro addruart,rx
mov \rx, #0xfe000000
mov \rx, #0xff000000
orr \rx, \rx, #0x000003f8
.endm
.macro senduart,rd,rx
str \rd, [\rx, #0x160] @ UARTDR
strb \rd, [\rx]
.endm
.macro busyuart,rd,rx
1001: ldr \rd, [\rx, #0x178] @ UARTFLG
tst \rd, #1 << 3
bne 1001b
1002: ldrb \rd, [\rx, #0x5]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1002b
.endm
.macro waituart,rd,rx
1001: ldrb \rd, [\rx, #0x6]
tst \rd, #0x10
beq 1001b
.endm
#else
/* For EBSA285 debugging */
.equ dc21285_high, ARMCSR_BASE & 0xff000000
.equ dc21285_low, ARMCSR_BASE & 0x00ffffff
#elif defined(CONFIG_ARCH_NEXUSPCI)
.macro addruart,rx
ldr \rx, =0xfff00000
mov \rx, #dc21285_high
.if dc21285_low
orr \rx, \rx, #dc21285_low
.endif
.endm
.macro senduart,rd,rx
str \rd, [\rx, #0xc]
str \rd, [\rx, #0x160] @ UARTDR
.endm
.macro busyuart,rd,rx
1001: ldr \rd, [\rx, #0x4]
tst \rd, #1 << 0
1001: ldr \rd, [\rx, #0x178] @ UARTFLG
tst \rd, #1 << 3
bne 1001b
.endm
.macro waituart,rd,rx
.endm
#elif defined(CONFIG_ARCH_VNC)
#endif
#elif defined(CONFIG_ARCH_NEXUSPCI)
.macro addruart,rx
mov \rx, #0xff000000
orr \rx, \rx, #0x00e00000
orr \rx, \rx, #0x000003f8
ldr \rx, =0xfff00000
.endm
.macro senduart,rd,rx
strb \rd, [\rx]
str \rd, [\rx, #0xc]
.endm
.macro busyuart,rd,rx
1002: ldrb \rd, [\rx, #0x5]
and \rd, \rd, #0x60
teq \rd, #0x60
bne 1002b
1001: ldr \rd, [\rx, #0x4]
tst \rd, #1 << 0
bne 1001b
.endm
.macro waituart,rd,rx
1001: ldrb \rd, [\rx, #0x6]
tst \rd, #0x10
beq 1001b
.endm
#else
#error Unknown architecture
......@@ -476,8 +532,6 @@ ENTRY(printch)
mov r0, #0
b 1b
.ltorg
.bss
hexbuf: .space 16
......
/*
* arch/arm/kernel/hw-ebsa286.c
*
* EBSA285 hardware specific functions
*
* Copyright (C) 1998 Russell King, Phil Blundel
*/
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/ptrace.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/system.h>
extern int setup_arm_irq(int, struct irqaction *);
extern void pci_set_cmd(struct pci_dev *dev, unsigned short clear, unsigned short set);
extern void pci_set_base_addr(struct pci_dev *dev, int idx, unsigned int addr);
extern void pci_set_irq_line(struct pci_dev *dev, unsigned int irq);
static int irqmap_ebsa[] __initdata = { 9, 8, 18, 11 };
static int irqmap_cats[] __initdata = { 18, 8, 9, 11 };
__initfunc(static int ebsa_irqval(struct pci_dev *dev))
{
unsigned char pin;
pcibios_read_config_byte(dev->bus->number,
dev->devfn,
PCI_INTERRUPT_PIN,
&pin);
return irqmap_ebsa[(PCI_SLOT(dev->devfn) + pin) & 3];
}
__initfunc(static int cats_irqval(struct pci_dev *dev))
{
if (dev->irq >= 128)
return 32 + (dev->irq & 0x1f);
switch (dev->irq) {
case 1:
case 2:
case 3:
case 4:
return irqmap_cats[dev->irq - 1];
case 0:
return 0;
}
printk("PCI: device %02x:%02x has unknown irq line %x\n",
dev->bus->number, dev->devfn, dev->irq);
return 0;
}
__initfunc(void pcibios_fixup_ebsa285(struct pci_dev *dev))
{
char cmd;
/* sort out the irq mapping for this device */
switch (machine_type) {
case MACH_TYPE_EBSA285:
dev->irq = ebsa_irqval(dev);
break;
case MACH_TYPE_CATS:
dev->irq = cats_irqval(dev);
break;
}
/* Turn on bus mastering - boot loader doesn't
* - perhaps it should! - dag
*/
pci_read_config_byte(dev, PCI_COMMAND, &cmd);
pci_write_config_byte(dev, PCI_COMMAND, cmd | PCI_COMMAND_MASTER);
}
static void irq_pci_err(int irq, void *dev_id, struct pt_regs *regs)
{
const char *err = "unknown";
unsigned long cmd = *(unsigned long *)0xfe000004 & 0xffff;
unsigned long ctrl = *(unsigned long *)0xfe00013c & 0xffffde07;
static unsigned long next_warn[7];
int idx = 6;
switch(irq) {
case IRQ_PCIPARITY:
*(unsigned long *)0xfe000004 = cmd | 1 << 31;
idx = 0;
err = "parity";
break;
case IRQ_PCITARGETABORT:
*(unsigned long *)0xfe000004 = cmd | 1 << 28;
idx = 1;
err = "target abort";
break;
case IRQ_PCIMASTERABORT:
*(unsigned long *)0xfe000004 = cmd | 1 << 29;
idx = 2;
err = "master abort";
break;
case IRQ_PCIDATAPARITY:
*(unsigned long *)0xfe000004 = cmd | 1 << 24;
idx = 3;
err = "data parity";
break;
case IRQ_DISCARDTIMER:
*(unsigned long *)0xfe00013c = ctrl | 1 << 8;
idx = 4;
err = "discard timer";
break;
case IRQ_SERR:
*(unsigned long *)0xfe00013c = ctrl | 1 << 3;
idx = 5;
err = "system";
break;
}
if (time_after_eq(jiffies, next_warn[idx])) {
next_warn[idx] = jiffies + 3 * HZ / 100;
printk(KERN_ERR "PCI %s error detected\n", err);
}
}
static struct irqaction irq_pci_error = {
irq_pci_err, SA_INTERRUPT, 0, "PCI error", NULL, NULL
};
__initfunc(void pcibios_init_ebsa285(void))
{
setup_arm_irq(IRQ_PCIPARITY, &irq_pci_error);
setup_arm_irq(IRQ_PCITARGETABORT, &irq_pci_error);
setup_arm_irq(IRQ_PCIMASTERABORT, &irq_pci_error);
setup_arm_irq(IRQ_PCIDATAPARITY, &irq_pci_error);
setup_arm_irq(IRQ_DISCARDTIMER, &irq_pci_error);
setup_arm_irq(IRQ_SERR, &irq_pci_error);
/*
* Map our SDRAM at a known address in PCI space, just in case
* the firmware had other ideas. Using a nonzero base is slightly
* bizarre but apparently necessary to avoid problems with some
* video cards.
*
* We should really only do this if the central function is enabled.
*/
*(unsigned long *)0xfe000010 = 0;
*(unsigned long *)0xfe000018 = 0xe0000000;
*(unsigned long *)0xfe0000f8 = 0;
*(unsigned long *)0xfe0000fc = 0;
*(unsigned long *)0xfe000100 = 0x01fc0000;
*(unsigned long *)0xfe000104 = 0;
*(unsigned long *)0xfe000108 = 0x80000000;
*(unsigned long *)0xfe000004 = 0x17;
}
This diff is collapsed.
This diff is collapsed.
......@@ -6,9 +6,10 @@
static struct vm_area_struct init_mmap = INIT_MMAP;
static struct fs_struct init_fs = INIT_FS;
static struct file * init_fd_array[NR_OPEN] = { NULL, };
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS;
struct mm_struct init_mm = INIT_MM;
struct mm_struct init_mm = INIT_MM(init_mm);
/*
* Initial task structure.
......@@ -20,4 +21,5 @@ struct mm_struct init_mm = INIT_MM;
*
* The things we do for performance..
*/
union task_union init_task_union __attribute__((__section__(".init.task"))) = { INIT_TASK };
union task_union init_task_union __attribute__((__section__(".init.task"))) =
{ INIT_TASK(init_task_union.task) };
/*
* linux/arch/arm/kernel/ioport.c
*
* Io-port support is not used for ARM
*/
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ioport.h>
/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
/*asmlinkage void set_bitmap(unsigned long *bitmap, short base, short extent, int new_value)
{
}*/
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
{
return -ENOSYS;
}
asmlinkage int sys_iopl(long ebx,long ecx,long edx,
long esi, long edi, long ebp, long eax, long ds,
long es, long fs, long gs, long orig_eax,
long eip,long cs,long eflags,long esp,long ss)
{
return -ENOSYS;
}
This diff is collapsed.
......@@ -7,11 +7,13 @@
*
* - Red - toggles state every 50 timer interrupts
*/
#include <linux/module.h>
#include <asm/hardware.h>
#include <asm/leds.h>
#include <asm/system.h>
void leds_event(led_event_t ledevt)
void ebsa110_leds_event(led_event_t ledevt)
{
unsigned long flags;
......@@ -28,3 +30,7 @@ void leds_event(led_event_t ledevt)
restore_flags(flags);
}
void (*leds_event)(led_event_t) = ebsa110_leds_event;
EXPORT_SYMBOL(leds_event);
This diff is collapsed.
This diff is collapsed.
......@@ -4,6 +4,7 @@
* (c) David Alan Gilbert 1995/1996
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/hardware.h>
......@@ -40,7 +41,7 @@ void oldlatch_bupdate(unsigned char mask,unsigned char newdata)
}
#endif
void oldlatch_init(void)
void __init oldlatch_init(void)
{
printk("oldlatch: init\n");
#ifdef LATCHAADDR
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -18,7 +18,7 @@ void _memcpy_fromio(void * to, unsigned long from, unsigned long count)
* Copy data from "real" memory space to IO memory space.
* This needs to be optimized.
*/
void _memcpy_toio(unsigned long to, void * from, unsigned long count)
void _memcpy_toio(unsigned long to, const void * from, unsigned long count)
{
while (count) {
count--;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment