Commit f5adafba authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.44pre3

parent 70e39deb
......@@ -536,6 +536,19 @@ CONFIG_FIREWALL
proxy server). Chances are that you should use this on every machine
being run as a router and not on any regular host. If unsure, say N.
SYN flood protection
CONFIG_SYN_COOKIES
Normal TCP/IP networking is open to an attack known as SYN flooding.
This attack prevents legitimate users from being able to connect to
your computer and requires very little work for the attacker.
SYN cookies provide protection against this type of attack. With
this option turned on the TCP/IP stack will use a cryptographic
challenge protocol known as SYN cookies to enable legitimate users
to continue to connect, even when your machine is under attack.
Note that SYN cookies aren't enabled per default, you need to add
echo 1 >/proc/sys/net/ipv4/tcp_syncookies to one of your startup scripts
(e.g. /etc/rc.local or /etc/rc.d/rc.local).
Socket Security API Support (EXPERIMENTAL)
CONFIG_NET_SECURITY
Enable use of the socket security API. Note that Linux does not include
......@@ -1326,7 +1339,7 @@ CONFIG_IPDDP
networking available. This feature is experimental. Please see
http://www.maths.unm.edu/~bradford/ltpc.html for support software.
LocalTalk PC card support
Apple/Farallon LocalTalk PC card support
CONFIG_LTPC
This allows you to use the AppleTalk PC card to connect to LocalTalk
networks. The card is also known as the Farallon PhoneNet PC card.
......@@ -1338,6 +1351,26 @@ CONFIG_LTPC
See README.ltpc in the drivers/net directory, and the web site
http://www.math.unm.edu/~bradford/ltpc.html
COPS LocalTalk PC card support
CONFIG_COPS
This allows you to use the COPS AppleTalk card to connect to LocalTalk
networks. You also need version 1.3.3 or later of the netatalk package.
This driver is experimental, which means that it may not work.
In particular the module support is not yet working for the 2.1.xx
kernels, so choose Y or N, but not M for now.
See the web site http://www.math.unm.edu/~bradford/ltpc.html for localtalk
IP tools.
Dayna firmware support
CONFIG_COPS_DAYNA
Support COPS compatible cards with Dayna style firmware (Dayna DL2000/
Daynatalk/PC (half length), COPS LT-95, Farallon PhoneNET PC III)
Tangent firmware support
CONFIG_COPS_TANGENT
Support COPS compatible cards with Tangent style firmware (Tangent ATB_II,
Novell NL-1000, Daystar Digital LT-200
Amateur Radio AX.25 Level 2
CONFIG_AX25
This is the protocol used for computer communication over amateur
......
......@@ -91,6 +91,7 @@ Code Seq# Include File Comments
<mailto:natalia@nikhefk.nikhef.nl>
'c' all linux/comstats.h
'f' all linux/ext2_fs.h
'k' all asm-sparc/kbio.h, asm-sparc64/kbio.h
'l' 00-3F linux/tcfs_fs.h in development:
<http://mikonos.dia.unisa.it/tcfs>
'm' all linux/mtio.h conflict!
......
README for the COPS LocalTalk Linux driver (cops.c).
By Jay Schulist <Jay.Schulist@spacs.k12.wi.us>
This driver compiles well against 2.1.29 - 2.1.41.
Building the driver from the cops-0.0*.tar.gz file.
1. Untar the cops-0.0*.tar.gz it will make a directory called cops.
2. Copy the cops-kernel.diff to /usr/src/ and then type patch -p0 < cops-kernel.diff
3. In the cops driver directory type make install. It will copy the driver to
the linux/drivers/net directory.
4. When you configure your kernel select Y or M for COPS LocalTalk PC support.
Also make sure you have choosen Appletalk support.
5. Compile like usual and you should bet set.
This driver has 2 modes and they are: Dayna mode and Tangent mode.
Each mode corresponds with the type of card. It has been found
that there are 2 main types of cards and all other cards are
the same and just have different names or only have minor differences
such as more IO ports. As this driver is tested it will
become more clear on exactly what cards are supported. The driver
defaults to using Dayna mode. To change the drivers mode if you build
a driver with dual support use board_type=1 or board_type=2 for
dayna and tangent in the insmod.
Operation/loading of the driver.
Use modprobe like this: /sbin/modprobe cops.o (IO #) (IRQ #)
If you do not specify any options the driver will try and use the IO = 0x240,
IRQ = 5. As of right now I would only use IRQ 5 for the card, if autoprobing.
Use ifconfig like this: /sbin/ifconfig lt0 127.0.0.34 up
You will need to configure atalkd with something like the following to make
it work with the cops.c driver.
dummy -seed -phase 2 -net 2000 -addr 2000.10 -zone "1033"
lt0 -seed -phase 1 -net 1000 -addr 1000.50 -zone "1033"
- Or -
eth0 -seed -phase 2 -net 3000 -addr 3000.20 -zone "1033"
lt0 -seed -phase 1 -net 1000 -addr 1000.50 -zone "1033"
......@@ -159,6 +159,13 @@ atp.c: *Not modularized*
(Probes ports: 0x378, 0x278, 0x3BC;
fixed IRQs: 5 and 7 )
cops.c:
io = 0x240
irq = 5
nodeid = 0 (AutoSelect = 0, NodeID 1-254 is hand selected.)
(Probes ports: 0x240, 0x340, 0x200, 0x210, 0x220, 0x230, 0x260,
0x2A0, 0x300, 0x310, 0x320, 0x330, 0x350, 0x360)
de4x5.c:
io = 0x000b
irq = 10
......
......@@ -260,6 +260,13 @@ M: layes@loran.com
L: linux-net@vger.rutgers.edu
S: Maintained
MIPS:
P: Ralf Baechle
M: ralf@gnu.ai.mit.edu
W: http://lena.fnet.fr/
L: linux-mips@fnet.fr
S: Maintained
NCP FILESYSTEM:
P: Volker Lendecke
M: lendecke@Math.Uni-Goettingen.de
......
......@@ -48,7 +48,7 @@ endif
piggy.o: $(SYSTEM)
tmppiggy=/tmp/$$$$piggy; \
tmppiggy=_tmp_$$$$piggy; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \
$(OBJCOPY) $(SYSTEM) $$tmppiggy; \
gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
......
......@@ -80,6 +80,7 @@ CONFIG_INET=y
# CONFIG_IP_ACCT is not set
# CONFIG_IP_ROUTER is not set
# CONFIG_NET_IPIP is not set
# CONFIG_SYN_COOKIES is not set
#
# (it is safe to leave these untouched)
......
......@@ -526,6 +526,8 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_query_module)
.long SYMBOL_NAME(sys_poll)
.long SYMBOL_NAME(sys_nfsservctl)
.rept NR_syscalls-169
.long SYMBOL_NAME(sys_setresgid) /* 170 */
.long SYMBOL_NAME(sys_getresgid)
.rept NR_syscalls-171
.long SYMBOL_NAME(sys_ni_syscall)
.endr
......@@ -82,12 +82,13 @@ static inline void mask_and_ack_irq(int irq_nr)
if (irq_nr & 8) {
inb(0xA1); /* DUMMY */
outb(cached_A1,0xA1);
outb(0x62,0x20); /* Specific EOI to cascade */
outb(0x20,0xA0);
} else {
inb(0x21); /* DUMMY */
outb(cached_21,0x21);
outb(0x20,0x20);
}
outb(0x20,0x20);
spin_unlock(&irq_controller_lock);
}
......
......@@ -35,24 +35,7 @@
|
#include <linux/linkage.h>
/*
* This has to match entry.S
*/
LOFF_ORIG_D0 = 0x24
#define curptr a2
#define SAVE_ALL \
clrl %sp@-; /* stk_adj */ \
movel %d0,%sp@-; /* orig d0 */ \
movel %d0,%sp@-; /* d0 */ \
moveml %d1-%d5/%a0-%a1/%curptr,%sp@-;
#define GET_CURRENT(tmp) \
movel %sp,tmp; \
andw &-8192,tmp; \
movel tmp,%curptr;
#include <asm/entry.h>
|################################
| (1) EXAMPLE CALL-OUTS #
......@@ -92,9 +75,8 @@ Lnotkern:
bne Lmustsched
rte
Lmustsched:
SAVE_ALL
moveq #-1,%d0
movel %d0,%sp@(LOFF_ORIG_D0) | indicate stack frame not for syscall
SAVE_ALL_INT
GET_CURRENT(%d0)
bral SYMBOL_NAME(ret_from_exception) | deliver signals, reschedule etc..
......
#
# $Id: Makefile,v 1.5 1997/06/16 00:34:01 ralf Exp $
#
# arch/mips/Makefile
#
# This file is included by the global makefile so that you can add your own
......@@ -10,36 +12,33 @@
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994, 1995 by Ralf Baechle
# Copyright (C) 1994, 1995, 1996 by Ralf Baechle
# DECStation modifications by Paul M. Antoine, 1996
#
ifdef CONFIG_CPU_LITTLE_ENDIAN
prefix = mipsel-
oformat = a.out-mips-little-linux
CROSS_COMPILE = mipsel-
ifdef CONFIG_MIPS_ECOFF
oformat = ecoff-littlemips
else
oformat = a.out-mips-big-linux
endif
else
CROSS_COMPILE = mips-
ifdef CONFIG_MIPS_ECOFF
oformat = ecoff-bigmips
else
prefix = mips-
oformat = a.out-mips-big-linux
endif
endif
ifdef CONFIG_EXTRA_ELF_COMPILER
prefix := $(prefix)linuxelf-
CROSS_COMPILE := $(CROSS_COMPILE)linuxelf-
else
prefix := $(prefix)linux-
CROSS_COMPILE := $(CROSS_COMPILE)linux-
endif
AS = $(prefix)as
LD = $(prefix)ld
LINKFLAGS = -N -Ttext 0x80000000
#LINKFLAGS = -oformat=$(oformat) -N -Ttext 0x80000000
#HOSTCC = gcc
CC = $(prefix)gcc -D__KERNEL__ -I$(TOPDIR)/include
CPP = $(CC) -E $(CFLAGS)
AR = $(prefix)ar
RANLIB = $(prefix)ranlib
OBJCOPY = $(prefix)objcopy
OBJDUMP = $(prefix)objdump
STRIP = $(prefix)strip
NM = $(prefix)nm
LINKFLAGS = -static -N
#
# The new ELF GCC uses -G0 -mabicalls -fpic as default. We don't need PIC
......@@ -47,46 +46,134 @@ NM = $(prefix)nm
# old GCC these options are just the defaults. At some point we might
# make use of global pointer optimizations.
#
# The DECStation requires an ECOFF kernel for remote booting, other MIPS
# machines may also.
#
ifdef CONFIG_ELF_KERNEL
CFLAGS := $(CFLAGS) -G0 -mno-abicalls -fno-pic
LINKFLAGS += -T arch/mips/ld.script
CFLAGS += -G 0 -mno-abicalls -fno-pic
LINKFLAGS += -G 0
endif
ifdef CONFIG_ECOFF_KERNEL
CFLAGS += -G 0 -mno-abicalls -fno-pic
LINKFLAGS += -G 0 -oformat ecoff-littlemips
endif
ifdef CONFIG_REMOTE_DEBUG
CFLAGS := $(CFLAGS) -g
endif
#
# CPU dependand compiler/assembler options for optimization.
#
ifdef CONFIG_CPU_R3000
CFLAGS := $(CFLAGS) -mcpu=r3000 -mips1
#ASFLAGS := $(ASFLAGS) -mcpu=r3000 -mips1
endif
ifdef CONFIG_CPU_R6000
CFLAGS := $(CFLAGS) -mcpu=r6000 -mips2
#ASFLAGS := $(ASFLAGS) -mcpu=r6000 -mips2
endif
ifdef CONFIG_CPU_R4300
CFLAGS := $(CFLAGS) -mcpu=r4600 -Wa,-mcpu=vr4300 -mips2
endif
ifdef CONFIG_CPU_R4X00
CFLAGS := $(CFLAGS) -D__R4000__ -mcpu=r4400 -mips2
#ASFLAGS := $(ASFLAGS) -mcpu=r4400 -mips2
CFLAGS := $(CFLAGS) -mcpu=r4600 -mips2
endif
ifdef CONFIG_CPU_R4600
CFLAGS := $(CFLAGS) -D__R4000__ -mcpu=r4600 -mips2
#ASFLAGS := $(ASFLAGS) -mcpu=r4600 -mips2
ifdef CONFIG_CPU_R5000
CFLAGS := $(CFLAGS) -mcpu=r8000 -mips2
endif
ifdef CONFIG_CPU_R8000
CFLAGS := $(CFLAGS) -D__R4000__ -mcpu=r8000 -mips2
#ASFLAGS := $(ASFLAGS) -mcpu=r8000 -mips2
CFLAGS := $(CFLAGS) -mcpu=r8000 -mips2
endif
ifdef CONFIG_CPU_R10000
CFLAGS := $(CFLAGS) -D__R4000__ -mcpu=r8000 -mips2
#ASFLAGS := $(ASFLAGS) -mcpu=r8000 -mips2
CFLAGS := $(CFLAGS) -mcpu=r8000 -mips2
endif
#
# Board dependand options and extra files
#
ifdef CONFIG_ALGOR_P4032
CORE_FILES += arch/mips/algor/algor.o
SUBDIRS += arch/mips/algor
#LOADADDR += 0x80000000
endif
ifdef CONFIG_ACER_PICA_61
CORE_FILES += arch/mips/jazz/jazz.o
SUBDIRS += arch/mips/jazz
LOADADDR += 0x80000000
endif
ifdef CONFIG_DECSTATION
CORE_FILES += arch/mips/dec/dec.o
SUBDIRS += arch/mips/dec
LINKSCRIPT += arch/mips/dec/ld.script
LOADADDR += 0x80000000
endif
ifdef CONFIG_DESKSTATION_RPC44
CORE_FILES += arch/mips/deskstation/deskstation.o
SUBDIRS += arch/mips/deskstation
LOADADDR += 0x80100000
endif
ifdef CONFIG_DESKSTATION_TYNE
CORE_FILES += arch/mips/deskstation/deskstation.o
SUBDIRS += arch/mips/deskstation
LOADADDR += 0x80000000
endif
ifdef CONFIG_MIPS_MAGNUM_3000
LOADADDR += 0x80000000
endif
ifdef CONFIG_MIPS_MAGNUM_4000
CORE_FILES += arch/mips/jazz/jazz.o
SUBDIRS += arch/mips/jazz
LOADADDR += 0x80000000
endif
ifdef CONFIG_OLIVETTI_M700
CORE_FILES += arch/mips/jazz/jazz.o
SUBDIRS += arch/mips/jazz
LOADADDR += 0x80000000
endif
ifdef CONFIG_SNI_RM200_PCI
CORE_FILES += arch/mips/sni/sni.o
SUBDIRS += arch/mips/sni
LOADADDR += 0x80000000
endif
ifdef CONFIG_SGI
LIBS += arch/mips/sgi/kernel/sgikern.a arch/mips/sgi/prom/promlib.a
SUBDIRS += arch/mips/sgi/kernel arch/mips/sgi/prom
#
# Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
# 0x88002000 for production kernels. Note that the value must be
# 8kb aligned or the handling of the current variable will break.
#
LOADADDR += 0x88002000
HOSTCC = cc
endif
#
# Choosing incompatible machines durings configuration will result in
# error messages during linking. Select a default linkscript if
# none has been choosen above.
#
ifndef LINKSCRIPT
ifndef CONFIG_CPU_LITTLE_ENDIAN
LINKSCRIPT = arch/mips/ld.script.big
else
LINKSCRIPT = arch/mips/ld.script.little
endif
endif
LINKFLAGS += -T $(word 1,$(LINKSCRIPT))
CFLAGS := $(CFLAGS) -pipe
ifdef LOADADDR
LINKFLAGS += -Ttext $(word 1,$(LOADADDR))
endif
#
# The pipe options is bad for my low-mem machine
# Uncomment this if you want this.
#
CFLAGS += -pipe
HEAD := arch/mips/kernel/head.o
HEAD := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
SUBDIRS := $(SUBDIRS) arch/mips/kernel arch/mips/mm arch/mips/lib
ARCHIVES := arch/mips/kernel/kernel.o arch/mips/mm/mm.o $(ARCHIVES)
SUBDIRS := $(SUBDIRS) $(addprefix arch/mips/, kernel mm lib tools)
CORE_FILES := arch/mips/kernel/kernel.o arch/mips/mm/mm.o $(CORE_FILES)
LIBS := arch/mips/lib/lib.a $(LIBS) arch/mips/lib/lib.a
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
......@@ -102,6 +189,7 @@ zdisk: vmlinux
archclean:
@$(MAKEBOOT) clean
$(MAKE) -C arch/$(ARCH)/kernel clean
$(MAKE) -C arch/$(ARCH)/tools clean
archdep:
@$(MAKEBOOT) dep
......@@ -19,47 +19,32 @@ OBJS = milo.o a.out.o
# Drop some uninteresting sections in the kernel.
# This is only relevant for ELF kernels but doesn't hurt a.out
#
DROP_SECTIONS = .reginfo .mdebug
#
# The new options of binutils 2.6 help to shrink object files a lot.
# This is especially useful for booting from floppy. Though we
# don't yet require everyone to have binutils 2.6 installed.
#
OBJDUMP_VERSION = $(word 4,$(shell $(OBJDUMP) --version))
ifneq ($(OBJDUMP_VERSION),2.5.2)
KEEP = kernel_entry boot_info screen_info _end
STRIP_FLAGS = $(addprefix --keep-symbol=,$(KEEP))
else
STRIP_FLAGS = --discard-all
endif
drop-sections = .reginfo .mdebug
strip-flags = $(addprefix --remove-section=,$(drop-sections))
#
# Fake compressed boot
#
ifdef CONFIG_ELF_KERNEL
zImage: $(CONFIGURE) $(TOPDIR)/vmlinux
cp $(TOPDIR)/vmlinux zImage.tmp
$(STRIP) $(addprefix --remove-section=,$(DROP_SECTIONS)) \
--strip-symbol=blurb zImage.tmp
$(LD) -oformat=$(oformat) -N -e except_vec0 -Ttext=0x80000000 \
-o zImage zImage.tmp
zImage: $(CONFIGURE) mkboot $(TOPDIR)/vmlinux
$(OBJCOPY) $(strip-flags) $(TOPDIR)/vmlinux zImage.tmp
./mkboot zImage.tmp zImage
rm -f zImage.tmp
$(STRIP) $(STRIP_FLAGS) zImage
else
zImage: $(CONFIGURE) $(TOPDIR)/vmlinux
cp $(TOPDIR)/vmlinux $@
$(STRIP) $(STRIP_FLAGS) $@
endif
mkboot: mkboot.c
$(HOSTCC) -o $@ $^
zdisk: zImage
mcopy -n zImage a:vmlinux
if [ -f /etc/remote-mcopy ]; then \
ssh rio mcopy -o - a:vmlinux <zImage; \
else \
mcopy -o zImage a:vmlinux; \
fi
dep:
$(CPP) -M *.[cS] > .depend
clean:
rm -f zImage zImage.tmp
rm -f zImage zImage.tmp mkboot
dummy:
......
This diff is collapsed.
......@@ -3,62 +3,102 @@
# see the Configure script.
#
mainmenu_name "Linux Kernel Configuration"
mainmenu_option next_comment
comment 'Machine setup'
comment 'Code maturity level options'
bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL
endmenu
mainmenu_option next_comment
comment 'Machine selection'
bool 'Support for Acer PICA 1 chipset' CONFIG_ACER_PICA_61
bool 'Support for DECstation' CONFIG_DECSTATION
bool 'Support for Deskstation RPC44' CONFIG_DESKSTATION_RPC44
bool 'Support for Deskstation Tyne' CONFIG_DESKSTATION_TYNE
bool 'Support for Mips Magnum 3000' CONFIG_MIPS_MAGNUM_3000
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
bool 'Support for Algorithmics P4032' CONFIG_ALGOR_P4032
bool 'Support for DECstation' CONFIG_DECSTATION
bool 'Support for Deskstation RPC44' CONFIG_DESKSTATION_RPC44
bool 'Support for Deskstation Tyne' CONFIG_DESKSTATION_TYNE
bool 'Support for Mips Magnum 3000' CONFIG_MIPS_MAGNUM_3000
fi
bool 'Support for Mips Magnum 4000' CONFIG_MIPS_MAGNUM_4000
bool 'Support for Olivetti M700' CONFIG_OLIVETTI_M700
if [ "$CONFIG_ACER_PICA_61" = "y" -o \
"$CONFIG_MIPS_MAGNUM_4000" = "y" -o \
bool 'Support for Olivetti M700-10' CONFIG_OLIVETTI_M700
if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o \
"$CONFIG_OLIVETTI_M700" = "y" ]; then
define_bool CONFIG_VIDEO_G364 y
fi
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
bool 'Support for SGI workstations' CONFIG_SGI
fi
bool 'Support for SNI RM200 PCI' CONFIG_SNI_RM200_PCI
if [ "$CONFIG_DESKSTATION_RPC44" = "y" -o \
"$CONFIG_DESKSTATION_TYNE" = "y" ]; then
define_bool CONFIG_MIPS_ARC y
fi
if [ "$CONFIG_ACER_PICA_61" = "y" -o \
"$CONFIG_OLIVETTI_M700" = "y" -o \
"$CONFIG_MIPS_MAGNUM_4000" = "y" ]; then
define_bool CONFIG_MIPS_JAZZ y
fi
unset CONFIG_PCI
if [ "$CONFIG_SNI_RM200_PCI" = "y" -o \
"$CONFIG_ALGOR_P4032" = "y" ]; then
define_bool CONFIG_PCI y
fi
endmenu
mainmenu_option next_comment
comment 'CPU selection'
choice 'CPU type' \
"R3000 CONFIG_CPU_R3000 \
R6000 CONFIG_CPU_R6000 \
R4300 CONFIG_CPU_R4300 \
R4x00 CONFIG_CPU_R4X00 \
R4600 CONFIG_CPU_R4600 \
R5000 CONFIG_CPU_R5000 \
R8000 CONFIG_CPU_R8000 \
R10000 CONFIG_CPU_R10000" R4x00
if [ "$CONFIG_CPU_R3000" = "y" -o \
"$CONFIG_CPU_R6000" = "y" -o \
"$CONFIG_CPU_R4X00" = "y" -o \
"$CONFIG_CPU_R4600" = "y" -o \
"$CONFIG_CPU_R8000" = "y" ]; then
define_bool CONFIG_TLB_SHUTDOWN y
fi
endmenu
mainmenu_option next_comment
comment 'General setup'
if [ "$CONFIG_DECSTATION" = "y" ]; then
bool 'Compile the kernel into the ECOFF object format' CONFIG_ECOFF_KERNEL
define_bool CONFIG_CPU_LITTLE_ENDIAN y
else
define_bool CONFIG_ELF_KERNEL y
bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN
fi
if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then
define_bool CONFIG_BINFMT_IRIX y
fi
define_bool CONFIG_BINFMT_ELF y
define_bool CONFIG_BINFMT_AOUT y
bool 'Compile the kernel into the ELF object format' CONFIG_ELF_KERNEL
if [ "$CONFIG_ELF_KERNEL" = "y" ]; then
bool 'Is your ELF compiler an extra compiler' CONFIG_EXTRA_ELF_COMPILER
define_bool CONFIG_BINFMT_AOUT n
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Kernel support for JAVA binaries' CONFIG_BINFMT_JAVA
fi
bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN
bool 'Networking support' CONFIG_NET
#bool 'PCI bios support' CONFIG_PCI
#if [ "$CONFIG_PCI" = "y" ]; then
# if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
# bool ' PCI bridge optimization (experimental)' CONFIG_PCI_OPTIMIZE
# fi
#fi
bool 'System V IPC' CONFIG_SYSVIPC
bool 'Sysctl support' CONFIG_SYSCTL
if [ "$CONFIG_SGI" != "y" ]; then
tristate 'Parallel port support' CONFIG_PNP_PARPORT
fi
endmenu
mainmenu_option next_comment
comment 'Loadable module support'
bool 'Set version information on all symbols for modules' CONFIG_MODVERSIONS
endmenu
bool 'Enable loadable module support' CONFIG_MODULES
if [ "$CONFIG_MODULES" = "y" ]; then
bool 'Set version information on all symbols for modules' CONFIG_MODVERSIONS
bool 'Kernel daemon support (e.g. autoload of modules)' CONFIG_KERNELD
fi
source drivers/block/Config.in
#
# All SGI block devices are SCSI based AFAIK. -davem
#
if [ "$CONFIG_SGI" != "y" ]; then
source drivers/block/Config.in
fi
if [ "$CONFIG_NET" = "y" ]; then
source net/Config.in
......@@ -70,7 +110,27 @@ comment 'SCSI support'
tristate 'SCSI support' CONFIG_SCSI
if [ "$CONFIG_SCSI" != "n" ]; then
source drivers/scsi/Config.in
if [ "$CONFIG_SGI" = "y" ]; then
comment 'SCSI support type (disk, tape, CDrom)'
dep_tristate 'SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI
dep_tristate 'SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI
dep_tristate 'SCSI CDROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI
dep_tristate 'SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI
comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs'
bool 'Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN
bool 'Verbose SCSI error reporting' CONFIG_SCSI_CONSTANTS
#mainmenu_option next_comment
comment 'SCSI low-level drivers'
dep_tristate 'SGI wd93 Scsi Driver' CONFIG_SCSI_SGIWD93 $CONFIG_SCSI
else
source drivers/scsi/Config.in
fi
fi
endmenu
......@@ -80,38 +140,76 @@ if [ "$CONFIG_NET" = "y" ]; then
bool 'Network device support' CONFIG_NETDEVICES
if [ "$CONFIG_NETDEVICES" = "y" ]; then
source drivers/net/Config.in
if [ "$CONFIG_SGI" != "y" ]; then
source drivers/net/Config.in
else
tristate 'Dummy net driver support' CONFIG_DUMMY
tristate 'SLIP (serial line) support' CONFIG_SLIP
if [ "$CONFIG_SLIP" != "n" ]; then
bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED
bool ' Keepalive and linefill' CONFIG_SLIP_SMART
fi
tristate 'PPP (point-to-point) support' CONFIG_PPP
if [ ! "$CONFIG_PPP" = "n" ]; then
comment 'CCP compressors for PPP are only built as modules.'
fi
bool 'SGI Seeq ethernet controller support' CONFIG_SGISEEQ
fi
fi
endmenu
fi
mainmenu_option next_comment
comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)'
if [ "$CONFIG_SGI" != "y" ]; then
mainmenu_option next_comment
comment 'ISDN subsystem'
bool 'Support non-SCSI/IDE/ATAPI drives' CONFIG_CD_NO_IDESCSI
if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
source drivers/cdrom/Config.in
tristate 'ISDN support' CONFIG_ISDN
if [ "$CONFIG_ISDN" != "n" ]; then
source drivers/isdn/Config.in
fi
endmenu
mainmenu_option next_comment
comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)'
bool 'Support non-SCSI/IDE/ATAPI drives' CONFIG_CD_NO_IDESCSI
if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
source drivers/cdrom/Config.in
fi
endmenu
fi
endmenu
source fs/Config.in
source drivers/char/Config.in
bool 'Standard serial device support' CONFIG_SERIAL n
if [ "$CONFIG_SGI" != "y" ]; then
source drivers/char/Config.in
mainmenu_option next_comment
comment 'Sound'
mainmenu_option next_comment
comment 'Sound'
tristate 'Sound card support' CONFIG_SOUND
if [ "$CONFIG_SOUND" != "n" ]; then
source drivers/sound/Config.in
tristate 'Sound card support' CONFIG_SOUND
if [ "$CONFIG_SOUND" != "n" ]; then
source drivers/sound/Config.in
fi
endmenu
else
comment 'SGI Character Devices'
bool 'Virtual terminal' CONFIG_VT
if [ "$CONFIG_VT" = "y" ]; then
bool 'Console on virtual terminal' CONFIG_VT_CONSOLE
fi
tristate 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
bool 'SGI Zilog85C30 serial support' CONFIG_SGI_SERIAL
if [ "$CONFIG_SGI_SERIAL" != "n" ]; then
define_bool CONFIG_SERIAL y
fi
fi
endmenu
mainmenu_option next_comment
comment 'Kernel hacking'
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
bool 'Kernel profiling support' CONFIG_PROFILE
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
......
#
# Makefile for the DECstation family specific parts of the kernel
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
.S.s:
$(CPP) $(CFLAGS) $< -o $*.s
.S.o:
$(CC) $(CFLAGS) -c $< -o $*.o
all: dec.o
O_TARGET := dec.o
O_OBJS := boot.o int-handler.o decstation.o hw-access.o reset.o setup.o
boot.o: boot.S
int-handler.o: int-handler.S
clean:
include $(TOPDIR)/Rules.make
/*
* arch/mips/dec/boot.S
*
* Copyright (C) 1995, 1996 Paul M. Antoine
*
* Written by Ralf Baechle and Andreas Busse, modified for DECStation
* support by Paul Antoine.
*
* NOTE: There are references to R4X00 code in here, because there is an
* upgrade module for Personal DECStations with such a CPU!
*/
#include <asm/asm.h>
#include <asm/regdef.h>
#include <asm/fpregdef.h>
#include <asm/mipsconfig.h>
#include <asm/mipsregs.h>
#include <asm/stackframe.h>
#include <asm/bootinfo.h>
/*
* dec_entry: Called by the boot PROM loader to do DECStation setup, prior
* to calling dec_setup() to fill in the boot_info structure.
*
* This code should also go in the boot loader for loading off
* floppy and HD... in addition to the tags code in dec_setup().
*
* FIXME: arrange for this code only to be linked in when building a
* kernel image to be booted via tftp from the boot prom??
*/
.text
.globl dec_entry
dec_entry:
/* Save the address of the REX call vector for later
* use in printing debug messages.
*/
sw a3,pmax_rex_base
sw a2,rex_prom_magic
la a0,dec_signon
jal pmax_printf
nop
/* Now set up the bootinfo with things that
* should be loaded by the boot loader, except that
* for the moment we're booting using tftp.
*/
jal dec_setup
nop
/*
* Now we need to move exception vector handler routines that appear
* in head.S down to the right addresses, 'cos the DECStation loads
* kernels at 0x80030000... <sigh>
*/
/*
* First move the TLB refill code down to offset 0x000, at addr 0x80000000
*/
la t0,except_vec0 # begining of exception code
la t1,except_vec1 # end of exception code
la t2,0x80000000 # where the code should live
lw t3,(t0) # get first word
1: sw t3,(t2) # put it where it should go
addiu t0,4 # increment both pointers
addiu t2,4
lw t3,(t0) # will be in the delay slot
bne t0,t1,1b
/*
* Now move the General Exception code down to offset 0x080 at 0x80000000
*/
la t0,except_vec3 # begining of general exception code
la t1,end_except # end of general exception code
la t2,0x80000080 # where the code should live
lw t3,(t0) # get first word
1: sw t3,(t2)
addiu t0,4
addiu t2,4
lw t3,(t0)
bne t0,t1,1b
la a0,dec_launch # say where we are going
jal pmax_printf
nop
la t0,mach_mem_upper # get upper memory bound
lw a0,(t0)
j kernel_entry
nop
.data
.align 2
dec_signon: .ascii "\n\nLinux/MIPS DECStation Boot\n";
.asciiz "Copyright (C) Paul M. Antoine 1995, 1996 and others, 1994, 1995, 1996\n\n";
dec_launch: .asciiz "Setup complete, launching kernel...\n";
/*
* arch/mips/kernel/decstation.S
*
* Copyright (C) 1995, 1996 Paul M. Antoine
*
* Written by Ralf Baechle and Andreas Busse, modified for DECStation
* support by Paul Antoine.
*
* NOTE: There are references to R4X00 code in here, because I believe
* that there is an upgrade module for Personal DECStations with
* such CPU's!
*
* FIXME: still plenty to do in this file, as much of the code towards
* the end hasn't been modified to suit the DECStation's interrupts.
* (Paul, you need to fix this file to comply with NAPS. Won't be
* too hard - Ralf)
*/
#include <asm/asm.h>
#include <asm/mipsconfig.h>
#include <asm/mipsregs.h>
#include <asm/regdef.h>
#include <asm/decstation.h>
#include <asm/stackframe.h>
#include <asm/bootinfo.h>
/*
* dec_entry: Called at boot in head.S to do DECStation setup, and to
* fill in the boot_info structure.
*/
.text
.globl dec_entry
dec_entry:
/* Save the address of the REX call vector for later
* use in printing debug messages.
*/
sw a3,pmax_rex_base
la a0,dec_signon
jal pmax_printf
nop
/* Now set up the bootinfo structure with things that
* should be loaded by the boot loader, except that
* for the moment we're booting using tftp.
*/
la t0,boot_info
li t1,0x40 # 64 TLB entries
/*
* FIXME: Ideally, all DEC workstations should be supported, so here we
* should put some clevernesses to determine machine type and CPU
* type. Needs a hierarchy of DEC machine types. Perhaps Machine
* AND Model fields in bootinfo structure?
*/
sw t1,OFFSET_BOOTINFO_TLB_ENTRIES(t0)
li t1,MACH_DECSTATION # Machine type
sw t1,(t0)
li t1,CPU_R3000A # CPU type
sw t1,OFFSET_BOOTINFO_CPUTYPE(t0)
/*
* FIXME: the following should find the memory size from the boot PROM
*/
li t1,0x80000000 # Lower memory bound
sw t1,OFFSET_BOOTINFO_MEMLOWER(t0)
li t1,0x88000000 # Upper memory bound (8MB)
sw t1,OFFSET_BOOTINFO_MEMUPPER(t0)
/*
* FIXME: the following should determine the cache size a la the method
* used in MACH. For now we just guess - PMA.
*/
li t1,0x100000 # 64K icache
sw t1,OFFSET_BOOTINFO_ICACHE_SIZE(t0)
li t1,0x100000 # 64K dcache
sw t1,OFFSET_BOOTINFO_DCACHE_SIZE(t0)
/*
* FIXME: template for other bootinfo fields that probably need filling in...
*
li t1,0x80000000
sw t1,OFFSET_BOOTINFO_(t0)
*/
/*
* Now we need to move exception vector handler routines that appear
* in head.S down to the right addresses, 'cos the DECStation loads
* kernels at 0x80030000... <sigh>
*/
/*
* First move the TLB refill code down to offset 0x000, at addr 0x80000000
*/
la t0,except_vec0 # begining of TLB exception code
la t1,except_vec1 # end of TLB exception code
la t2,0x80000000 # where the code should live
lw t3,(t0) # get first word
1: sw t3,(t2) # put it where it should go
addiu t0,4 # increment both pointers
addiu t2,4
lw t3,(t0) # will be in the delay slot
bne t0,t1,1b
/*
* Now move the General Exception code down to offset 0x080 at 0x80000000
*/
la t0,except_vec3 # begining of general exception code
la t1,kernel_entry # end of general exception code
la t2,0x80000080 # where the code should live
lw t3,(t0) # get first word
1: sw t3,(t2)
addiu t0,4
addiu t2,4
lw t3,(t0)
bne t0,t1,1b
/*
* FIXME: Don't forget to set the gp regster... why do I need this?
*/
la gp,_gp
la a0,dec_launch # say where we are going
jal pmax_printf
nop
j kernel_entry
nop
.data
.align 2
dec_signon: .ascii "\n\nLinux/MIPS DECStation Boot\n";
.asciiz "Copyright (C) Paul M. Antoine 1995, 1996 and others, 1994, 1995, 1996\n\n";
dec_launch: .asciiz "Launching kernel...\n";
.text
.set noreorder
/*
* decstation_handle_int: Interrupt handler for Personal DECStation 5000/2x
*
* FIXME: this is *extremely* experimental, though it is probably o.k. for
* most DECStation models.
*/
NESTED(decstation_handle_int, FR_SIZE, ra)
.set noat
SAVE_ALL
REG_S sp,FR_ORIG_REG2(sp)
CLI
.set at
/*
* Get pending interrupts
*/
mfc0 t0,CP0_CAUSE # get pending interrupts
mfc0 t1,CP0_STATUS # get enabled interrupts
and t0,t1 # isolate allowed ones
andi t0,0xff00 # isolate pending bits
/*
* FIXME: The following branch was:
* beqz t0,spurious_interrupt
*
* ...but the wonders of ecoff cause the gas assembler (ver 2.5.1 )
* to complain:
*
* "Can not represent relocation in this object file format"...
*
* hence this hack to branch foward a bit, and then jump <sigh>
* Perhaps a later version of gas will cope? - Paul
* (No, this is impossible in COFF as well as in ELF. - Ralf)
*/
beqz t0,3f;
sll t0,16 # delay slot
/*
* Find irq with highest priority
* FIXME: This is slow
*/
la t1,ll_vectors
1: bltz t0,2f # found pending irq
sll t0,1
b 1b
subu t1,PTRSIZE # delay slot
/*
* Do the low-level stuff
*/
.set reorder
2: LOAD_L t0,(t1)
jr t0
.set noreorder
END(decstation_handle_int)
/*
* FIXME: The hack mentioned above.
*/
3: j spurious_interrupt
nop
/*
* FIXME: the rest of this is pretty suspect, as it's straight from
* jazz.S... and I really haven't altered it at all - Paul
*/
/*
* Used for keyboard driver's fake_keyboard_interrupt()
* (Paul, even for i386 this is no longer being used -- Ralf)
*/
ll_sw0: li s1,~IE_SW0
mfc0 t0,CP0_CAUSE
and t0,s1
mtc0 t0,CP0_CAUSE
PRINT("sw0 received...\n")
li t1,1
b call_real
li t3,PTRSIZE # delay slot, re-map to irq level 1
ll_sw1: li s1,~IE_SW1
PANIC("Unimplemented sw1 handler")
loc_no_irq: PANIC("Unimplemented loc_no_irq handler")
loc_sound: PANIC("Unimplemented loc_sound handler")
loc_video: PANIC("Unimplemented loc_video handler")
loc_scsi: PANIC("Unimplemented loc_scsi handler")
/*
* Ethernet interrupt, remapped to level 15
* NOTE: Due to a bug somewhere in the kernel I was not able
* to figure out, the PRINT() is necessary. Without this,
* I get a "gfp called nonatomically from interrupt 00000000".
* Only god knows why... Tell me if you find the reason!
* (You were fouled by the caches and this is the wrong file for this
* comment - Ralf)
* Andy, 6/16/95
*/
loc_ethernet: PANIC("Unimplemented loc_ethernet\n")
/*
* Keyboard interrupt, remapped to level 1
*/
loc_keyboard: PANIC("Unimplemented loc_keyboard\n")
loc_mouse: PANIC("Unimplemented loc_mouse handler")
/*
* Serial port 1 IRQ, remapped to level 3
*/
loc_serial1: PANIC("Unimplemented loc_serial handler")
/*
* Serial port 2 IRQ, remapped to level 4
*/
loc_serial2: PANIC("Unimplemented loc_serial handler")
/*
* Parallel port IRQ, remapped to level 5
*/
loc_parallel: PANIC("Unimplemented loc_parallel handler")
/*
* Floppy IRQ, remapped to level 6
*/
loc_floppy: PANIC("Unimplemented loc_floppy handler")
/*
* Now call the real handler
*/
loc_call: la t0,IRQ_vectors # delay slot
/*
* Temporarily disable interrupt source
*/
/* lhu t2,JAZZ_IO_IRQ_ENABLE
*/
addu t0,t3 # make ptr to IRQ handler
LOAD_L t0,(t0)
and t2,s1 # delay slot
/* sh t2,JAZZ_IO_IRQ_ENABLE */
jalr t0 # call IRQ handler
nor s1,zero,s1 # delay slot
/*
* Reenable interrupt
*/
/* lhu t2,JAZZ_IO_IRQ_ENABLE */
or t2,s1
/* sh t2,JAZZ_IO_IRQ_ENABLE */
jr v0
nop # delay slot
ll_tc3: PANIC("Unimplemented tc3 interrupt handler")
ll_fpu: PANIC("Unimplemented fpu interrupt handler")
ll_io_error: PANIC("Unimplemented I/O write timeout interrupt handler")
ll_rtc: PANIC("Unimplemented RTC interrupt handler")
/*
* Timer IRQ
* We remap the timer irq to be more similar to a IBM compatible
*/
ll_timer: PANIC("Timer interrupt!\n");
/*
* CPU count/compare IRQ (unused)
*/
ll_reset: li a0,0
jal pmax_halt
li a1,0 # delay slot
/*
* Now call the real handler
*/
call_real: la t0,IRQ_vectors # delay slot
/*
* temporarily disable interrupt
*/
mfc0 t2,CP0_STATUS
and t2,s1
addu t0,t3
LOAD_L t0,(t0)
mtc0 t2,CP0_STATUS # delay slot
jalr t0
nor s1,zero,s1 # delay slot
/*
* reenable interrupt
*/
mfc0 t2,CP0_STATUS
or t2,s1
mtc0 t2,CP0_STATUS
jr v0
nop # delay slot
/*
* Just for debugging... load a0 with address of the point inside the
* framebuffer at which you want to draw a line of 16x32 pixels.
* Maxine's framebuffer starts at 0xaa000000.
*/
.set reorder
LEAF(drawline)
li t1,0xffffffff # set all pixels on
li t2,0x10 # we will write 16 words
1: sw t1,(a0) # write the first word
addiu a0,a0,4 # move our framebuffer pointer
addiu t2,t2,-1 # one less to do
bnez t2,1b # finished?
jr ra
END(drawline)
/*
* FIXME: I have begun to alter this table to reflect Personal DECStation
* (i.e. Maxine) interrupts... Paul.
*/
.data
PTR ll_sw0 # SW0
PTR ll_sw1 # SW1
PTR ll_timer # Periodic interrupt
PTR ll_rtc # RTC periodic interrupt
PTR ll_io_error # Timeout on I/O writes
PTR ll_tc3 # TC slot 3, motherboard
PTR ll_reset # Halt keycode (CTRL+ALT+ENTER)
ll_vectors: PTR ll_fpu # FPU
local_vector: PTR loc_no_irq
PTR loc_parallel
PTR loc_floppy
PTR loc_sound
PTR loc_video
PTR loc_ethernet
PTR loc_scsi
PTR loc_keyboard
PTR loc_mouse
PTR loc_serial1
PTR loc_serial2
/*
* arch/mips/dec/decstation.c
*
* Copyright (C) 1996 Paul M. Antoine
*
* Written by Paul Antoine.
*
* FIXME: still plenty to do in this file, as we don't yet fully fill
* the boot info structure with DEC-specific tags. Also still
* too specific to the Person Decstattion 5000/2x!!
*/
#include <asm/dec/decstation.h>
#include <asm/dec/maxine.h> /* FIXME: what about other decstations? */
#include <asm/bootinfo.h>
/*
* dec_setup: Called at boot from dec_entry() in boot.S to do
* DECStation-specific setup, and to fill in the kernel argument
* tags.
*
* FIXME: I'm not sure all DEC workstations are correctly supported. This
* code may not need to be here when booting off floppy or HD??
*/
unsigned long mach_mem_upper = 0;
unsigned long mach_mem_lower = 0;
unsigned long mips_dcache_size = 0;
unsigned long mips_icache_size = 0;
unsigned long rex_prom_magic; /* from boot.S */
unsigned long dec_get_memory_size(void);
void dec_setup(void)
{
unsigned long int mem_mask = 0;
unsigned long tag_data_dummy, dec_sysid;
unsigned char dec_cpunum, dec_systype, dec_firmrev, dec_etc;
extern const char *linux_banner;
pmax_printf("%s\n", linux_banner);
/* First we need the memory upper bound before we can add tag entries... */
mach_mem_lower = 0x80000000L;
mach_mem_upper = mach_mem_lower + dec_get_memory_size();
/* First tag is always memory upper limit, right Stoned?? */
(void)bi_TagAdd(tag_memupper, ULONGSIZE, &mach_mem_upper);
/* We're obviously one of the DEC machines */
tag_data_dummy = MACH_GROUP_DEC;
(void)bi_TagAdd(tag_machgroup, ULONGSIZE, &tag_data_dummy);
/* Now let's try to figure out what type of DECStation we are */
pmax_printf("System id is: ");
if ((dec_sysid = pmax_getsysid()) != 0)
pmax_printf("%x\n", dec_sysid);
else
pmax_printf("unknown\n");
dec_cpunum = (dec_sysid & 0xff000000) >> 24;
dec_systype = (dec_sysid & 0xff0000) >> 16;
dec_firmrev = (dec_sysid & 0xff00) >> 8;
dec_etc = dec_sysid & 0xff;
/*
* FIXME: for now use the PROM to determine the CPU type - should
* probably just get the CPU to tell us.
*/
pmax_printf("System has an ");
switch(dec_cpunum)
{
case 0x82:
{
pmax_printf("R3000 CPU\n");
tag_data_dummy = CPU_R3000A;
break;
}
case 0x84:
{
pmax_printf("R4000 CPU\n");
/* FIXME: assume a plain R4000PC for now */
tag_data_dummy = CPU_R4000PC;
break;
}
default:
{
pmax_printf("unknown CPU, code is %x\n", dec_cpunum);
/* FIXME: assume an R2000 for now */
tag_data_dummy = CPU_R2000;
break;
}
}
/* Add the CPU type */
(void)bi_TagAdd(tag_cputype, ULONGSIZE, &tag_data_dummy);
pmax_printf("System has firmware type: ");
if (dec_firmrev == 2)
pmax_printf("TCF0\n");
else
pmax_printf("TCF1\n");
pmax_printf("This DECStation is a: ");
switch(dec_systype) {
case 1: /* DS2100/3100 Pmax */
pmax_printf("DS2100/3100\n");
tag_data_dummy = MACH_DECSTATION;
break;
case 2: /* DS5000 3max */
pmax_printf("DS5000\n");
tag_data_dummy = MACH_DECSTATION;
break;
case 3: /* DS5000/100 3min */
pmax_printf("DS5000/1x0\n");
tag_data_dummy = MACH_DECSTATION;
break;
case 7: /* Personal DS5000/2x */
pmax_printf("Personal DS5000/2x\n");
tag_data_dummy = MACH_DECSTATION;
break;
default:
pmax_printf("unknown, id is: %x\n", dec_systype);
tag_data_dummy = MACH_UNKNOWN;
break;
}
/* Add the machine type */
(void)bi_TagAdd(tag_machtype, ULONGSIZE, &tag_data_dummy);
/* Add the number of tlb entries */
tag_data_dummy = 64;
(void)bi_TagAdd(tag_tlb_entries, ULONGSIZE, &tag_data_dummy);
/*
* Add the instruction cache size
* FIXME: should determine this somehow
*/
tag_data_dummy = 0x100000; /* set it to 64K for now */
(void)bi_TagAdd(tag_icache_size, ULONGSIZE, &tag_data_dummy);
mips_icache_size = tag_data_dummy;
/*
* Add the data cache size
* FIXME: should determine this somehow
*/
tag_data_dummy = 0x100000; /* set it to 64K for now */
(void)bi_TagAdd(tag_dcache_size, ULONGSIZE, &tag_data_dummy);
mips_dcache_size = tag_data_dummy;
/* FIXME: should determine vram_base properly */
tag_data_dummy = 0xa8000000;
(void)bi_TagAdd(tag_vram_base, ULONGSIZE, &tag_data_dummy);
/* FIXME: dummy drive info tag */
tag_data_dummy = 0;
(void)bi_TagAdd(tag_drive_info, ULONGSIZE, &tag_data_dummy);
/* FIXME: do we need a dummy tag at the end? */
tag_data_dummy = 0;
(void)bi_TagAdd(tag_dummy, 0, &tag_data_dummy);
pmax_printf("Added tags\n");
} /* dec_setup */
unsigned long dec_get_memory_size()
{
int i, bitmap_size;
unsigned long mem_size = 0;
struct pmax_bitmap {
int pagesize;
unsigned char bitmap[64*1024*1024 - 4];
} *bm;
/* some free 64k */
bm = (struct pmax_bitmap *)0x8002f000;
bitmap_size = pmax_getbitmap(bm);
pmax_printf("Page size is: %x\n", bm->pagesize);
pmax_printf("Bitmap size is: %d bytes\n", bitmap_size);
for (i = 0; i < bitmap_size; i++)
{
/* FIXME: very simplistically only add full sets of pages */
if (bm->bitmap[i] == 0xff)
mem_size += (8 * bm->pagesize);
}
pmax_printf("Main memory size is: %d KB\n", (mem_size / 1024));
return(mem_size);
} /* dec_get_memory_size */
unsigned char maxine_rtc_read_data(unsigned long addr)
{
char *rtc = (char *)(PMAX_RTC_BASE);
return(rtc[addr * 4]);
} /* maxine_rtc_read_data */
void maxine_rtc_write_data(unsigned char data, unsigned long addr)
{
char *rtc = (char *)(PMAX_RTC_BASE);
rtc[addr * 4] = data;
} /* maxine_rtc_read_data */
/*
* DECstation specific hardware access code.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996 by Paul Antoine
*/
#include <linux/linkage.h>
#include <linux/types.h>
#include <asm/mc146818rtc.h>
#include <asm/vector.h>
asmlinkage void decstation_handle_int(void);
extern unsigned char maxine_rtc_read_data(unsigned long);
extern void maxine_rtc_write_data(unsigned char, unsigned long);
/*
* FIXME: Don't have any of the goo required to access fd etc.
*/
struct feature decstation_feature = {
0,0,0,0,0,0,0,0,0,0,0,0,0,
maxine_rtc_read_data,
maxine_rtc_write_data
};
/*
* arch/mips/kernel/magnum4000.S
* arch/mips/dec/int-handler.S
*
* Copyright (C) 1995 Waldorf Electronics
* written by Ralf Baechle and Andreas Busse
* Copyright (C) 1995, 1996 Paul M. Antoine
*
* Written by Ralf Baechle and Andreas Busse, modified for DECStation
* support by Paul Antoine.
*
* NOTE: There are references to R4X00 code in here, because there is an
* upgrade module for Personal DECStations with such a CPU!
*
* FIXME: still plenty to do in this file, as much of the code hasn't been
* modified to suit the DECStation's interrupts.
*/
#include <asm/asm.h>
#include <asm/regdef.h>
#include <asm/fpregdef.h>
#include <asm/mipsconfig.h>
#include <asm/mipsregs.h>
#include <asm/jazz.h>
#include <asm/stackframe.h>
#include <asm/bootinfo.h>
.text
.set noreorder
/*
* mips_magnum_4000_handle_int: Interrupt handler for Mips Magnum 4000
* decstation_handle_int: Interrupt handler for Personal DECStation 5000/2x
*
* FIXME: this is *extremely* experimental, though it is probably o.k. for
* most DECStation models.
*/
.set noreorder
NESTED(mips_magnum_4000_handle_int, FR_SIZE, ra)
NESTED(decstation_handle_int, FR_SIZE, ra)
.set noat
SAVE_ALL
CLI
......@@ -27,7 +41,19 @@
mfc0 t1,CP0_STATUS # get enabled interrupts
and t0,t1 # isolate allowed ones
andi t0,0xff00 # isolate pending bits
beqz t0,spurious_interrupt
/*
* FIXME: The following branch was:
* beqz t0,spurious_interrupt
*
* ...but the wonders of ecoff cause the gas assembler (ver 2.5.1 )
* to complain:
*
* "Can not represent relocation in this object file format"...
*
* hence this hack to branch foward a bit, and then jump <sigh>
* Perhaps a later version of gas will cope? - Paul
*/
beqz t0,3f;
sll t0,16 # delay slot
/*
......@@ -46,10 +72,22 @@
2: lw t0,(t1)
jr t0
nop # delay slot
END(mips_magnum_4000_handle_int)
END(decstation_handle_int)
/*
* FIXME: The hack mentioned above.
*/
3: j spurious_interrupt
nop
/*
* FIXME: the rest of this is pretty suspect, as it's straight from
* jazz.S... and I really haven't altered it at all - Paul
*/
/*
* Used for keyboard driver's fake_keyboard_interrupt()
* (Paul, even for i386 this is no longer being used -- Ralf)
*/
ll_sw0: li s1,~IE_SW0
mfc0 t0,CP0_CAUSE
......@@ -63,139 +101,99 @@ ll_sw0: li s1,~IE_SW0
ll_sw1: li s1,~IE_SW1
PANIC("Unimplemented sw1 handler")
ll_local_dma: li s1,~IE_IRQ0
PANIC("Unimplemented local_dma handler")
ll_local_dev: lbu t0,JAZZ_IO_IRQ_SOURCE
#if __mips == 3
dsll t0,1
ld t0,local_vector(t0)
#else /* 32 bit */
lw t0,local_vector(t0)
#endif
jr t0
nop
loc_no_irq: PANIC("Unimplemented loc_no_irq handler")
loc_sound: PANIC("Unimplemented loc_sound handler")
loc_video: PANIC("Unimplemented loc_video handler")
loc_scsi: PANIC("Unimplemented loc_scsi handler")
/*
* Keyboard interrupt handler
* Ethernet interrupt, remapped to level 15
* NOTE: Due to a bug somewhere in the kernel I was not able
* to figure out, the PRINT() is necessary. Without this,
* I get a "gfp called nonatomically from interrupt 00000000".
* Only god knows why... Tell me if you find the reason!
* Andy, 6/16/95
*/
loc_keyboard: li s1,~JAZZ_IE_KEYBOARD
li t1,JAZZ_KEYBOARD_IRQ
b loc_call
li t3,PTRSIZE*JAZZ_KEYBOARD_IRQ # delay slot
loc_ethernet: PANIC("Unimplemented loc_ethernet\n")
/*
* Ethernet interrupt handler, remapped to level 2
* Keyboard interrupt, remapped to level 1
*/
loc_ethernet: /* PRINT ("ethernet IRQ\n"); */
li s1,~JAZZ_IE_ETHERNET
li t1,JAZZ_ETHERNET_IRQ
b loc_call
li t3,PTRSIZE*JAZZ_ETHERNET_IRQ # delay slot
loc_keyboard: PANIC("Unimplemented loc_keyboard\n")
loc_mouse: PANIC("Unimplemented loc_mouse handler")
/*
* Serial port 1 IRQ, remapped to level 3
*/
loc_serial1: li s1,~JAZZ_IE_SERIAL1
li t1,JAZZ_SERIAL1_IRQ
b loc_call
li t3,PTRSIZE*JAZZ_SERIAL1_IRQ # delay slot
loc_serial1: PANIC("Unimplemented loc_serial handler")
/*
* Serial port 2 IRQ, remapped to level 4
*/
loc_serial2: li s1,~JAZZ_IE_SERIAL2
li t1,JAZZ_SERIAL2_IRQ
b loc_call
li t3,PTRSIZE*JAZZ_SERIAL2_IRQ # delay slot
loc_serial2: PANIC("Unimplemented loc_serial handler")
/*
* Parallel port IRQ, remapped to level 5
*/
loc_parallel: li s1,~JAZZ_IE_PARALLEL
li t1,JAZZ_PARALLEL_IRQ
b loc_call
li t3,PTRSIZE*JAZZ_PARALLEL_IRQ # delay slot
loc_parallel: PANIC("Unimplemented loc_parallel handler")
/*
* Floppy IRQ, remapped to level 6
*/
loc_floppy: li s1,~JAZZ_IE_FLOPPY
li t1,JAZZ_FLOPPY_IRQ
b loc_call
li t3,PTRSIZE*JAZZ_FLOPPY_IRQ # delay slot
loc_floppy: PANIC("Unimplemented loc_floppy handler")
/*
* Now call the real handler
*/
loc_call: lui s3,%hi(intr_count)
lw t2,%lo(intr_count)(s3)
la t0,IRQ_vectors # delay slot
addiu t2,1
sw t2,%lo(intr_count)(s3)
loc_call: la t0,IRQ_vectors # delay slot
/*
* Temporarily disable interrupt source
*/
lhu t2,JAZZ_IO_IRQ_ENABLE
addu t0,t3 # make ptr to IRQ handler
/* lhu t2,JAZZ_IO_IRQ_ENABLE
*/
addu t0,t3 # make ptr to IRQ handler
lw t0,(t0)
and t2,s1 # delay slot
sh t2,JAZZ_IO_IRQ_ENABLE
jalr t0 # call IRQ handler
nor s1,zero,s1 # delay slot
and t2,s1 # delay slot
/* sh t2,JAZZ_IO_IRQ_ENABLE */
jalr t0 # call IRQ handler
nor s1,zero,s1 # delay slot
/*
* Reenable interrupt
*/
lhu t2,JAZZ_IO_IRQ_ENABLE
lw t1,%lo(intr_count)(s3) # delay slot
/* lhu t2,JAZZ_IO_IRQ_ENABLE */
or t2,s1
sh t2,JAZZ_IO_IRQ_ENABLE
/* sh t2,JAZZ_IO_IRQ_ENABLE */
subu t1,1
jr v0
sw t1,%lo(intr_count)(s3)
nop # delay slot
ll_eisa_irq: li s1,~IE_IRQ2
PANIC("Unimplemented eisa_irq handler")
ll_tc3: PANIC("Unimplemented tc3 interrupt handler")
ll_eisa_nmi: li s1,~IE_IRQ3
PANIC("Unimplemented eisa_nmi handler")
ll_fpu: PANIC("Unimplemented fpu interrupt handler")
ll_io_error: PANIC("Unimplemented I/O write timeout interrupt handler")
ll_rtc: PANIC("Unimplemented RTC interrupt handler")
/*
* Timer IRQ
* We remap the timer irq to be more similar to a IBM compatible
*/
ll_timer: lw t0,JAZZ_TIMER_REGISTER # timer irq cleared on read
li s1,~IE_IRQ4
li t1,0
b call_real
li t3,0 # delay slot, re-map to irq level 0
ll_timer: PANIC("Timer interrupt!\n");
/*
* CPU count/compare IRQ (unused)
*/
ll_count: j return
mtc0 zero,CP0_COMPARE
ll_reset: li a0,0
jal pmax_halt
li a1,0 # delay slot
/*
* Now call the real handler
*/
call_real: lui s3,%hi(intr_count)
lw t2,%lo(intr_count)(s3)
la t0,IRQ_vectors # delay slot
addiu t2,1
sw t2,%lo(intr_count)(s3)
call_real: la t0,IRQ_vectors # delay slot
/*
* temporarily disable interrupt
......@@ -216,37 +214,38 @@ call_real: lui s3,%hi(intr_count)
or t2,s1
mtc0 t2,CP0_STATUS
lw t2,%lo(intr_count)(s3)
subu t2,1
jr v0
sw t2,%lo(intr_count)(s3)
nop # delay slot
/*
* Just for debugging...
* Just for debugging... load a0 with address of the point inside the
* framebuffer at which you want to draw a line of 16x32 pixels.
* Maxine's framebuffer starts at 0xaa000000.
*/
.set reorder
LEAF(drawline)
li t1,0xffffffff
li t2,0x100
1: sw t1,(a0)
addiu a0,a0,4
addiu t2,t2,-1
bnez t2,1b
nop
li t1,0xffffffff # set all pixels on
li t2,0x10 # we will write 16 words
1: sw t1,(a0) # write the first word
addiu a0,a0,4 # move our framebuffer pointer
addiu t2,t2,-1 # one less to do
bnez t2,1b # finished?
jr ra
nop
END(drawline)
/*
* FIXME: I have begun to alter this table to reflect Personal DECStation
* (i.e. Maxine) interrupts... Paul.
*/
.data
PTR ll_sw0 # SW0
PTR ll_sw1 # SW1
PTR ll_local_dma # Local DMA
PTR ll_local_dev # Local devices
PTR ll_eisa_irq # EISA IRQ
PTR ll_eisa_nmi # EISA NMI
PTR ll_timer # Timer
ll_vectors: PTR ll_count # Count/Compare IRQ
PTR ll_timer # Periodic interrupt
PTR ll_rtc # RTC periodic interrupt
PTR ll_io_error # Timeout on I/O writes
PTR ll_tc3 # TC slot 3, motherboard
PTR ll_reset # Halt keycode (CTRL+ALT+ENTER)
ll_vectors: PTR ll_fpu # FPU
local_vector: PTR loc_no_irq
PTR loc_parallel
......@@ -259,17 +258,3 @@ local_vector: PTR loc_no_irq
PTR loc_mouse
PTR loc_serial1
PTR loc_serial2
.align 5
LEAF(spurious_interrupt)
/*
* Nothing happened... (whistle)
*/
lui t1,%hi(spurious_count)
lw t0,%lo(spurious_count)(t1)
la v0,return
addiu t0,1
jr ra
sw t0,%lo(spurious_count)(t1)
END(spurious_interrupt)
OUTPUT_FORMAT("ecoff-littlemips")
OUTPUT_ARCH(mips)
ENTRY(dec_entry)
SECTIONS
{
/* This is probably a little simplistic, and is based on work by
* Chris Fraser of Softway Pty Ltd as used in his port of Vsta to
* the DECStation - Paul M. Antoine 21/1/96.
*/
. = 0x80030000;
.text :
{
*(.text)
. = ALIGN(0x10);
_etext = .;
__etext = .;
}
.lit8 : {
*(.lit8)
}
.lit4 : {
*(.lit4)
}
. = ALIGN(0x1000);
.data :
{
*(.data .rdata .rodata)
_edata = .;
__edata = .;
}
__bss_start = ALIGN(16) + 0x8000;
.sbss :
{
*(.sbss)
*(.scommon)
}
.bss :
{
*(.bss)
*(COMMON)
_end = ALIGN(4) ;
__end = ALIGN(4) ;
}
.reginfo : {
*(.reginfo)
}
}
/*
* linux/arch/mips/dec/process.c
*
* Reset a DECstation.
*/
#include <linux/kernel.h>
#include <asm/reboot.h>
void dec_machine_restart(char *command)
{
printk("Implement dec_machine_restart().\n");
printk("Press reset to continue.\n");
while(1);
}
void dec_machine_halt(void)
{
printk("Implement dec_machine_halt().\n");
printk("Press reset to continue.\n");
while(1);
}
void dec_machine_power_off(void)
{
printk("Implement dec_machine_power_off().\n");
printk("Press reset to continue.\n");
while(1);
}
/*
* Setup pointers to hardware dependand routines.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996 by Ralf Baechle
*/
#include <asm/ptrace.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/reboot.h>
#include <asm/vector.h>
extern struct feature decstation_feature;
static void
dec_irq_setup(void)
{
/* FIXME: should set up the clock as per above? */
pmax_printf("Please write the IRQ setup code for the DECStation!\n");
}
void (*board_time_init)(struct irqaction *irq);
static void dec_time_init(struct irqaction *irq)
{
pmax_printf("Please write the time init code for the DECStation!\n");
}
extern void dec_machine_restart(char *command);
extern void dec_machine_halt(void);
extern void dec_machine_power_off(void).
void
decstation_setup(void)
{
irq_setup = dec_irq_setup;
board_time_init = dec_time_init;
/* FIXME: Setup fd_cacheflush */
feature = &decstation_feature; /* FIXME: Will go away */
_machine_restart = dec_machine_restart;
_machine_halt = dec_machine_halt;
_machine_power_off = dec_machine_power_off;
}
......@@ -3,48 +3,147 @@
#
#
# Machine setup
# Code maturity level options
#
# CONFIG_EXPERIMENTAL is not set
#
# Machine selection
#
CONFIG_ACER_PICA_61=y
# CONFIG_DECSTATION is not set
# CONFIG_DESKSTATION_RPC44 is not set
# CONFIG_DESKSTATION_TYNE is not set
# CONFIG_MIPS_MAGNUM_3000 is not set
# CONFIG_MIPS_MAGNUM_4000 is not set
# CONFIG_OLIVETTI_M700 is not set
CONFIG_SNI_RM200_PCI=y
CONFIG_MIPS_JAZZ=y
CONFIG_PCI=y
#
# CPU selection
#
# CONFIG_CPU_R3000 is not set
# CONFIG_CPU_R6000 is not set
# CONFIG_CPU_R4300 is not set
CONFIG_CPU_R4X00=y
# CONFIG_CPU_R4600 is not set
# CONFIG_CPU_R5000 is not set
# CONFIG_CPU_R8000 is not set
# CONFIG_CPU_R10000 is not set
CONFIG_TLB_SHUTDOWN=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_AOUT=y
# CONFIG_ELF_KERNEL is not set
#
# General setup
#
CONFIG_ELF_KERNEL=y
CONFIG_CPU_LITTLE_ENDIAN=y
# CONFIG_NET is not set
# CONFIG_SYSVIPC is not set
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_AOUT is not set
CONFIG_NET=y
CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
# CONFIG_PNP_PARPORT is not set
#
# Loadable module support
#
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULES is not set
#
# block devices
# Floppy, IDE, and other block devices
#
CONFIG_BLK_DEV_FD=y
# CONFIG_ST506 is not set
CONFIG_BLK_DEV_IDE=y
#
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_HD_IDE is not set
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_BLK_DEV_IDESCSI is not set
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_BLK_DEV_TRITON is not set
# CONFIG_IDE_CHIPSETS is not set
#
# Additional Block Devices
#
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_MD is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_BLK_DEV_EZ is not set
# CONFIG_BLK_DEV_HD is not set
#
# Networking options
#
# CONFIG_NETLINK is not set
# CONFIG_FIREWALL is not set
# CONFIG_NET_ALIAS is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ACCT is not set
# CONFIG_IP_ROUTER is not set
# CONFIG_NET_IPIP is not set
#
# (it is safe to leave these untouched)
#
# CONFIG_INET_PCTCP is not set
# CONFIG_INET_RARP is not set
CONFIG_PATH_MTU_DISCOVERY=y
CONFIG_IP_NOSR=y
# CONFIG_SKB_LARGE is not set
#
#
#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_AX25 is not set
#
# SCSI support
#
# CONFIG_SCSI is not set
#
# Network device support
#
CONFIG_NETDEVICES=y
# CONFIG_ARCNET is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
CONFIG_NET_ETHERNET=y
CONFIG_MIPS_JAZZ_SONIC=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_ISA is not set
CONFIG_NET_EISA=y
CONFIG_PCNET32=y
# CONFIG_APRICOT is not set
# CONFIG_CS89x0 is not set
# CONFIG_DE4X5 is not set
# CONFIG_DEC_ELCP is not set
# CONFIG_DGRS is not set
# CONFIG_EEXPRESS_PRO100 is not set
# CONFIG_NET_POCKET is not set
# CONFIG_FDDI is not set
# CONFIG_DLCI is not set
# CONFIG_PPP is not set
# CONFIG_NET_RADIO is not set
# CONFIG_SLIP is not set
# CONFIG_TR is not set
# CONFIG_LAPBETHER is not set
# CONFIG_X25_ASY is not set
#
# ISDN subsystem
#
# CONFIG_ISDN is not set
#
# CD-ROM drivers (not for SCSI or IDE/ATAPI drives)
#
......@@ -53,30 +152,44 @@ CONFIG_BLK_DEV_FD=y
#
# Filesystems
#
# CONFIG_QUOTA is not set
# CONFIG_MINIX_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_UMSDOS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_ISO9660_FS is not set
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
CONFIG_RNFS_BOOTP=y
# CONFIG_RNFS_RARP is not set
CONFIG_NFSD=y
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_SMB_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_UFS_FS is not set
#
# character devices
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
# CONFIG_CYCLADES is not set
# CONFIG_STALDRV is not set
# CONFIG_PRINTER is not set
# CONFIG_BUSMOUSE is not set
# CONFIG_PSMOUSE is not set
# CONFIG_MS_BUSMOUSE is not set
# CONFIG_ATIXL_BUSMOUSE is not set
CONFIG_SERIAL=y
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_MOUSE is not set
# CONFIG_QIC02_TAPE is not set
# CONFIG_FTAPE is not set
# CONFIG_APM is not set
# CONFIG_SERIAL is not set
# CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set
#
# Sound
......@@ -86,4 +199,5 @@ CONFIG_VT_CONSOLE=y
#
# Kernel hacking
#
# CONFIG_REMOTE_DEBUG is not set
# CONFIG_PROFILE is not set
#
# Makefile for the Deskstation family specific parts of the kernel
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
.S.s:
$(CPP) $(CFLAGS) $< -o $*.s
.S.o:
$(CC) $(CFLAGS) -c $< -o $*.o
all: deskstation.o
O_TARGET := deskstation.o
O_OBJS := hw-access.o int-handler.o reset.o setup.o
int-handler.o: int-handler.S
clean:
include $(TOPDIR)/Rules.make
/*
* Low-level hardware access stuff for Deskstation rPC44/Tyne
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996 by Ralf Baechle
*/
#include <linux/config.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/linkage.h>
#include <linux/types.h>
#include <asm/bootinfo.h>
#include <asm/cachectl.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/vector.h>
extern int FLOPPY_IRQ;
extern int FLOPPY_DMA;
asmlinkage extern void deskstation_handle_int(void);
/*
* How to access the FDC's registers.
*/
static unsigned char
fd_inb(unsigned int port)
{
return inb_p(port);
}
static void
fd_outb(unsigned char value, unsigned int port)
{
outb_p(value, port);
}
/*
* How to access the floppy DMA functions.
*/
static void
fd_enable_dma(void)
{
enable_dma(FLOPPY_DMA);
}
static void
fd_disable_dma(void)
{
disable_dma(FLOPPY_DMA);
}
static int
fd_request_dma(void)
{
return request_dma(FLOPPY_DMA, "floppy");
}
static void
fd_free_dma(void)
{
free_dma(FLOPPY_DMA);
}
static void
fd_clear_dma_ff(void)
{
clear_dma_ff(FLOPPY_DMA);
}
static void
fd_set_dma_mode(char mode)
{
set_dma_mode(FLOPPY_DMA, mode);
}
static void
fd_set_dma_addr(unsigned int addr)
{
set_dma_addr(FLOPPY_DMA, addr);
}
static void
fd_set_dma_count(unsigned int count)
{
set_dma_count(FLOPPY_DMA, count);
}
static int
fd_get_dma_residue(void)
{
return get_dma_residue(FLOPPY_DMA);
}
static void
fd_enable_irq(void)
{
enable_irq(FLOPPY_IRQ);
}
static void
fd_disable_irq(void)
{
disable_irq(FLOPPY_IRQ);
}
void
deskstation_fd_cacheflush(const void *addr, size_t size)
{
flush_cache_all();
}
/*
* RTC stuff
*/
static unsigned char *
rtc_read_data()
{
return 0;
}
static void
rtc_write_data(unsigned char data)
{
}
/*
* KLUDGE
*/
static unsigned long
vdma_alloc(unsigned long paddr, unsigned long size)
{
return 0;
}
#ifdef CONFIG_DESKSTATION_TYNE
struct feature deskstation_tyne_feature = {
/*
* How to access the floppy controller's ports
*/
fd_inb,
fd_outb,
/*
* How to access the floppy DMA functions.
*/
fd_enable_dma,
fd_disable_dma,
fd_request_dma,
fd_free_dma,
fd_clear_dma_ff,
fd_set_dma_mode,
fd_set_dma_addr,
fd_set_dma_count,
fd_get_dma_residue,
fd_enable_irq,
fd_disable_irq,
/*
* How to access the RTC functions.
*/
rtc_read_data,
rtc_write_data
};
#endif
#ifdef CONFIG_DESKSTATION_RPC44
struct feature deskstation_rpc44_feature = {
/*
* How to access the floppy controller's ports
*/
fd_inb,
fd_outb,
/*
* How to access the floppy DMA functions.
*/
fd_enable_dma,
fd_disable_dma,
fd_request_dma,
fd_free_dma,
fd_clear_dma_ff,
fd_set_dma_mode,
fd_set_dma_addr,
fd_set_dma_count,
fd_get_dma_residue,
fd_enable_irq,
fd_disable_irq,
/*
* How to access the RTC functions.
*/
rtc_read_data,
rtc_write_data
};
#endif
/*
* arch/mips/kernel/tyne.S
* Deskstation rPC44/Tyne specific interrupt handler code
*
* Deskstation Tyne specific Assembler code
*
* Copyright (C) 1994, 1995 Waldorf Electronics
* written by Ralf Baechle and Andreas Busse
* Copyright (C) 1994, 1995, 1996 by Ralf Baechle
*/
#include <asm/asm.h>
#include <asm/mipsconfig.h>
#include <asm/mipsregs.h>
#include <asm/regdef.h>
#include <asm/stackframe.h>
/*
* Deskstation Tyne interrupt handler
*/
#error "FIXME - PORT_BASE is defined to port_base which breaks this file"
.text
.set noreorder
.set noat
.align 5
NESTED(deskstation_tyne_handle_int, FR_SIZE, sp)
NESTED(deskstation_handle_int, PT_SIZE, sp)
SAVE_ALL
REG_S sp,PT_OR2(sp)
CLI
.set at
lui s0,%hi(PORT_BASE)
li t1,0x0f
sb t1,%lo(PORT_BASE+0x20)(s0) # poll command
lb t1,%lo(PORT_BASE+0x20)(s0) # read result
li s1,1
bgtz t1,Lpoll_second
andi t1,t1,7
li a0,0x0f
sb a0,%lo(PORT_BASE+0x20)(s0) # poll command
lb a0,%lo(PORT_BASE+0x20)(s0) # read result
bgtz a0,poll_second
andi a0,7
beq a0,2,poll_second # cascade?
li s1,1 # delay slot
/*
* Acknowledge first pic
*/
lb t2,%lo(PORT_BASE+0x21)(s0)
lui s4,%hi(cache_21)
lb t0,%lo(cache_21)(s4)
sllv s1,s1,t1
or t0,t0,s1
sllv s1,s1,a0
or t0,s1
sb t0,%lo(cache_21)(s4)
sb t0,%lo(PORT_BASE+0x21)(s0)
lui s3,%hi(intr_count)
lw t0,%lo(intr_count)(s3)
li t2,0x20
sb t2,%lo(PORT_BASE+0x20)(s0)
/*
* Now call the real handler
*/
la t3,IRQ_vectors
sll t2,t1,2
addu t3,t3,t2
lw t3,(t3)
addiu t0,t0,1
sll t2,a0,PTRLOG
addu t3,t2
LONG_L t3,(t3)
jalr t3
sw t0,%lo(intr_count)(s3) # delay slot
lw t0,%lo(intr_count)(s3)
nop # delay slot
/*
* Unblock first pic
*/
lbu t1,%lo(PORT_BASE+0x21)(s0)
lb t1,%lo(cache_21)(s4)
subu t0,t0,1
sw t0,%lo(intr_count)(s3)
nor s1,zero,s1
and t1,t1,s1
and t1,s1
sb t1,%lo(cache_21)(s4)
jr v0
sb t1,%lo(PORT_BASE+0x21)(s0) # delay slot
/*
* Cascade interrupt from second PIC
*/
.align 5
Lpoll_second: li t1,0x0f
sb t1,%lo(PORT_BASE+0xa0)(s0) # poll command
lb t1,%lo(PORT_BASE+0xa0)(s0) # read result
lui s4,%hi(cache_A1)
bgtz t1,spurious_interrupt
andi t1,t1,7
poll_second: li a0,0x0f
sb a0,%lo(PORT_BASE+0xa0)(s0) # poll command
lb a0,%lo(PORT_BASE+0xa0)(s0) # read result
bgtz a0,3f
andi a0,7
/*
* Acknowledge second pic
*/
lbu t2,%lo(PORT_BASE+0xa1)(s0)
lui s4,%hi(cache_A1)
lb t3,%lo(cache_A1)(s4)
sllv s1,s1,t1
or t3,t3,s1
sllv s1,s1,a0
or t3,s1
sb t3,%lo(cache_A1)(s4)
sb t3,%lo(PORT_BASE+0xa1)(s0)
li t3,0x20
sb t3,%lo(PORT_BASE+0xa0)(s0)
lui s3,%hi(intr_count)
lw t0,%lo(intr_count)(s3)
sb t3,%lo(PORT_BASE+0x20)(s0)
/*
* Now call the real handler
*/
la t0,IRQ_vectors
sll t2,t1,2
addu t0,t0,t2
lw t0,32(t0)
addiu t0,t0,1
jalr t0
sw t0,%lo(intr_count)(s3) # delay slot
lw t0,%lo(intr_count)(s3)
la t3,IRQ_vectors
addiu a0,8
sll t2,a0,PTRLOG
addu t3,t2
LONG_L t3,(t3)
jalr t3
nop # delay slot
/*
* Unblock second pic
*/
lb t1,%lo(PORT_BASE+0xa1)(s0)
lb t1,%lo(cache_A1)(s4)
subu t0,t0,1
lw t0,%lo(intr_count)(s3)
nor s1,zero,s1
and t1,t1,s1
sb t1,%lo(cache_A1)(s4)
jr v0
sb t1,%lo(PORT_BASE+0xa1)(s0) # delay slot
END(deskstation_tyne_handle_int)
.align 5
LEAF(spurious_interrupt)
/*
* Nothing happened... (whistle)
*/
lui t1,%hi(spurious_count)
lw t0,%lo(spurious_count)(t1)
la v0,return
addiu t0,1
jr ra
sw t0,%lo(spurious_count)(t1)
END(spurious_interrupt)
/*
* "Jump extender" to reach spurious_interrupt
*/
3: j spurious_interrupt
nop # delay slot
END(deskstation_handle_int)
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Low level I/O functions for Jazz family machine.
*
* FIXME: This implementation fits the Tyne. How does the EISA rPC44 handle
* the eight high address bits?
*/
#include <linux/string.h>
#include <asm/mipsconfig.h>
#include <asm/addrspace.h>
#include <asm/sni.h>
/*
* isa_slot_offset is the address where E(ISA) busaddress 0 is is mapped
* for the processor.
*/
extern unsigned long isa_slot_offset;
static unsigned char deskstation_readb(unsigned long addr)
{
return *(volatile unsigned char *) (isa_slot_offset + addr);
}
static unsigned short deskstation_readw(unsigned long addr)
{
return *(volatile unsigned short *) (isa_slot_offset + addr);
}
static unsigned int deskstation_readl(unsigned long addr)
{
return *(volatile unsigned int *) (isa_slot_offset + addr);
}
static void deskstation_writeb(unsigned char val, unsigned long addr)
{
*(volatile unsigned char *) (isa_slot_offset + addr) = val;
}
static void deskstation_writew(unsigned short val, unsigned long addr)
{
*(volatile unsigned char *) (isa_slot_offset + addr) = val;
}
static void deskstation_writel(unsigned int val, unsigned long addr)
{
*(volatile unsigned char *) (isa_slot_offset + addr) = val;
}
static void deskstation_memset_io(unsigned long addr, int val, unsigned long len)
{
addr += isa_slot_offset;
memset((void *)addr, val, len);
}
static void deskstation_memcpy_fromio(unsigned long to, unsigned long from, unsigned long len)
{
from += isa_slot_offset;
memcpy((void *)to, (void *)from, len);
}
static void deskstation_memcpy_toio(unsigned long to, unsigned long from, unsigned long len)
{
to += isa_slot_offset;
memcpy((void *)to, (void *)from, len);
}
/*
* linux/arch/mips/deskstation/process.c
*
* Reset a Deskstation.
*/
#include <asm/io.h>
#include <asm/reboot.h>
#include <asm/system.h>
void deskstation_machine_restart(void)
{
printk("Implement deskstation_machine_restart().\n");
printk("Press reset to continue.\n");
while(1);
}
void deskstation_machine_halt(void)
{
printk("Implement deskstation_machine_halt().\n");
printk("Press reset to continue.\n");
while(1);
}
void deskstation_machine_power_off(void)
{
printk("Implement dec_machine_power_off().\n");
printk("Press reset to continue.\n");
while(1);
}
/*
* Setup pointers to hardware dependand routines.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996, 1997 by Ralf Baechle
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <asm/bootinfo.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/ptrace.h>
#include <asm/mipsregs.h>
#include <asm/reboot.h>
#include <asm/vector.h>
/*
* Initial irq handlers.
*/
static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
/*
* IRQ2 is cascade interrupt to second interrupt controller
*/
static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
extern asmlinkage void deskstation_handle_int(void);
extern asmlinkage void deskstation_fd_cacheflush(const void *addr, size_t size);
extern struct feature deskstation_tyne_feature;
extern struct feature deskstation_rpc44_feature;
extern void deskstation_machine_reboot(void);
extern void deskstation_machine_halt(void);
extern void deskstation_machine_power_off(void);
#ifdef CONFIG_DESKSTATION_TYNE
unsigned long mips_dma_cache_size = 0;
unsigned long mips_dma_cache_base = KSEG0;
__initfunc(static void tyne_irq_setup(void))
{
set_except_vector(0, deskstation_handle_int);
/* set the clock to 100 Hz */
outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
outb_p(LATCH & 0xff , 0x40); /* LSB */
outb(LATCH >> 8 , 0x40); /* MSB */
request_region(0x20,0x20, "pic1");
request_region(0xa0,0x20, "pic2");
setup_x86_irq(2, &irq2);
}
#endif
#ifdef CONFIG_DESKSTATION_RPC44
__initfunc(static void rpc44_irq_setup(void))
{
/*
* For the moment just steal the TYNE support. In the
* future, we need to consider merging the two -- imp
*/
set_except_vector(0, deskstation_handle_int);
/* set the clock to 100 Hz */
outb_p(0x34, 0x43); /* binary, mode 2, LSB/MSB, ch 0 */
outb_p(LATCH & 0xff , 0x40); /* LSB */
outb(LATCH >> 8 , 0x40); /* MSB */
request_region(0x20,0x20, "pic1");
request_region(0xa0,0x20, "pic2");
setup_x86_irq(2, &irq2);
set_cp0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
}
#endif
__initfunc(void deskstation_setup(void))
{
switch(mips_machtype) {
#ifdef CONFIG_DESKSTATION_TYNE
case MACH_DESKSTATION_TYNE:
atag = bi_TagFind(tag_dma_cache_size);
memcpy(&mips_dma_cache_size, TAGVALPTR(atag), atag->size);
atag = bi_TagFind(tag_dma_cache_base);
memcpy(&mips_dma_cache_base, TAGVALPTR(atag), atag->size);
irq_setup = tyne_irq_setup;
feature = &deskstation_tyne_feature;
isa_slot_offset = 0xe3000000; // Will go away
break;
#endif
#ifdef CONFIG_DESKSTATION_RPC44
case MACH_DESKSTATION_RPC44:
irq_setup = rpc44_irq_setup;
mips_memory_upper = KSEG0 + (32 << 20); /* xxx fixme imp */
feature = &deskstation_rpc44_feature; // Will go away
isa_slot_offset = 0xa0000000;
break;
#endif
}
fd_cacheflush = deskstation_fd_cacheflush;
request_region(0x00,0x20,"dma1");
request_region(0x40,0x20,"timer");
request_region(0x70,0x10,"rtc");
request_region(0x80,0x10,"dma page reg");
request_region(0xc0,0x20,"dma2");
}
#
# Makefile for the Jazz family specific parts of the kernel
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
.S.s:
$(CPP) $(CFLAGS) $< -o $*.s
.S.o:
$(CC) $(CFLAGS) -c $< -o $*.o
all: jazz.o
O_TARGET := jazz.o
O_OBJS := hw-access.o int-handler.o jazzdma.o reset.o setup.o
ifdef CONFIG_VIDEO_G364
O_OBJS += g364.o
endif
int-handler.o: int-handler.S
clean:
include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
/*
* Jazz specific C parts
* Low-level hardware access stuff for Jazz family machines.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1995 by Ralf Baechle
* Copyright (C) 1995, 1996 by Ralf Baechle
*/
#include <linux/delay.h>
#include <asm/cachectl.h>
#include <linux/linkage.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <asm/addrspace.h>
#include <asm/vector.h>
#include <asm/jazz.h>
#include <asm/jazzdma.h>
#include <asm/segment.h>
#include <asm/pgtable.h>
#include <asm/mc146818rtc.h>
unsigned char jazz_fd_inb(unsigned int port)
static unsigned char
fd_inb(unsigned int port)
{
unsigned char c;
......@@ -24,7 +29,8 @@ unsigned char jazz_fd_inb(unsigned int port)
return c;
}
void jazz_fd_outb(unsigned char value, unsigned int port)
static void
fd_outb(unsigned char value, unsigned int port)
{
*(volatile unsigned char *) port = value;
}
......@@ -32,68 +38,111 @@ void jazz_fd_outb(unsigned char value, unsigned int port)
/*
* How to access the floppy DMA functions.
*/
void jazz_fd_enable_dma(void)
static void
fd_enable_dma(void)
{
vdma_enable(JAZZ_FLOPPY_DMA);
}
void jazz_fd_disable_dma(void)
static void
fd_disable_dma(void)
{
vdma_disable(JAZZ_FLOPPY_DMA);
}
int jazz_fd_request_dma(void)
static int
fd_request_dma(void)
{
return 0;
}
void jazz_fd_free_dma(void)
static void
fd_free_dma(void)
{
}
void jazz_fd_clear_dma_ff(void)
static void
fd_clear_dma_ff(void)
{
}
void jazz_fd_set_dma_mode(char mode)
static void
fd_set_dma_mode(char mode)
{
vdma_set_mode(JAZZ_FLOPPY_DMA, mode);
}
void jazz_fd_set_dma_addr(unsigned int a)
static void
fd_set_dma_addr(unsigned int a)
{
vdma_set_addr(JAZZ_FLOPPY_DMA, vdma_phys2log(PHYSADDR(a)));
}
void jazz_fd_set_dma_count(unsigned int count)
static void
fd_set_dma_count(unsigned int count)
{
vdma_set_count(JAZZ_FLOPPY_DMA, count);
}
int jazz_fd_get_dma_residue(void)
static int
fd_get_dma_residue(void)
{
return vdma_get_residue(JAZZ_FLOPPY_DMA);
}
void jazz_fd_enable_irq(void)
static void
fd_enable_irq(void)
{
}
void jazz_fd_disable_irq(void)
static void
fd_disable_irq(void)
{
}
void jazz_fd_cacheflush(unsigned char *addr, unsigned int size)
void
jazz_fd_cacheflush(const void *addr, size_t size)
{
sys_cacheflush((void *)addr, size, DCACHE);
flush_cache_all();
}
unsigned char jazz_rtc_read_data(void)
static unsigned char
rtc_read_data(unsigned long addr)
{
outb_p(addr, RTC_PORT(0));
return *(char *)JAZZ_RTC_BASE;
}
void jazz_rtc_write_data(unsigned char data)
static void
rtc_write_data(unsigned char data, unsigned long addr)
{
outb_p(addr, RTC_PORT(0));
*(char *)JAZZ_RTC_BASE = data;
}
struct feature jazz_feature = {
/*
* How to access the floppy controller's ports
*/
fd_inb,
fd_outb,
/*
* How to access the floppy DMA functions.
*/
fd_enable_dma,
fd_disable_dma,
fd_request_dma,
fd_free_dma,
fd_clear_dma_ff,
fd_set_dma_mode,
fd_set_dma_addr,
fd_set_dma_count,
fd_get_dma_residue,
fd_enable_irq,
fd_disable_irq,
/*
* How to access the RTC functions.
*/
rtc_read_data,
rtc_write_data
};
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Low level I/O functions for Jazz family machines.
*
* Copyright (C) 1997 by Ralf Baechle.
*/
#include <linux/string.h>
#include <asm/mipsconfig.h>
#include <asm/addrspace.h>
#include <asm/system.h>
#include <asm/spinlock.h>
#include <asm/jazz.h>
/*
* Map an 16mb segment of the EISA address space to 0xe3000000;
*/
static inline void map_eisa_address(unsigned long address)
{
/* XXX */
/* We've got an wired entry in the TLB. We just need to modify it.
fast and clean. But since we want to get rid of wired entries
things are a little bit more complicated ... */
}
static unsigned char jazz_readb(unsigned long addr)
{
unsigned char res;
map_eisa_address(addr);
addr &= 0xffffff;
res = *(volatile unsigned char *) (JAZZ_EISA_BASE + addr);
return res;
}
static unsigned short jazz_readw(unsigned long addr)
{
unsigned short res;
map_eisa_address(addr);
addr &= 0xffffff;
res = *(volatile unsigned char *) (JAZZ_EISA_BASE + addr);
return res;
}
static unsigned int jazz_readl(unsigned long addr)
{
unsigned int res;
map_eisa_address(addr);
addr &= 0xffffff;
res = *(volatile unsigned char *) (JAZZ_EISA_BASE + addr);
return res;
}
static void jazz_writeb(unsigned char val, unsigned long addr)
{
map_eisa_address(addr);
addr &= 0xffffff;
*(volatile unsigned char *) (JAZZ_EISA_BASE + addr) = val;
}
static void jazz_writew(unsigned short val, unsigned long addr)
{
map_eisa_address(addr);
addr &= 0xffffff;
*(volatile unsigned char *) (JAZZ_EISA_BASE + addr) = val;
}
static void jazz_writel(unsigned int val, unsigned long addr)
{
map_eisa_address(addr);
addr &= 0xffffff;
*(volatile unsigned char *) (JAZZ_EISA_BASE + addr) = val;
}
static void jazz_memset_io(unsigned long addr, int val, unsigned long len)
{
unsigned long waddr;
waddr = JAZZ_EISA_BASE | (addr & 0xffffff);
while(len) {
unsigned long fraglen;
fraglen = (~addr + 1) & 0xffffff;
fraglen = (fraglen < len) ? fraglen : len;
map_eisa_address(addr);
memset((char *)waddr, val, fraglen);
addr += fraglen;
waddr = waddr + fraglen - 0x1000000;
len -= fraglen;
}
}
static void jazz_memcpy_fromio(unsigned long to, unsigned long from, unsigned long len)
{
unsigned long waddr;
waddr = JAZZ_EISA_BASE | (from & 0xffffff);
while(len) {
unsigned long fraglen;
fraglen = (~from + 1) & 0xffffff;
fraglen = (fraglen < len) ? fraglen : len;
map_eisa_address(from);
memcpy((void *)to, (void *)waddr, fraglen);
to += fraglen;
from += fraglen;
waddr = waddr + fraglen - 0x1000000;
len -= fraglen;
}
}
static void jazz_memcpy_toio(unsigned long to, unsigned long from, unsigned long len)
{
unsigned long waddr;
waddr = JAZZ_EISA_BASE | (to & 0xffffff);
while(len) {
unsigned long fraglen;
fraglen = (~to + 1) & 0xffffff;
fraglen = (fraglen < len) ? fraglen : len;
map_eisa_address(to);
memcpy((char *)to + JAZZ_EISA_BASE, (void *)from, fraglen);
to += fraglen;
from += fraglen;
waddr = waddr + fraglen - 0x1000000;
len -= fraglen;
}
}
/*
* jazzdma.c
* arch/mips/jazz/jazzdma.c
*
* Mips Jazz DMA controller support
* (C) 1995 Andreas Busse
* Copyright (C) 1995, 1996 by Andreas Busse
*
* NOTE: Some of the argument checking could be removed when
* things have settled down. Also, instead of returning 0xffffffff
* on failure of vdma_alloc() one could leave page #0 unused
* and return the more usual NULL pointer as logical address.
*
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <asm/mipsregs.h>
#include <asm/mipsconfig.h>
#include <asm/jazz.h>
#include <asm/io.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <asm/dma.h>
#include <asm/jazzdma.h>
#include <asm/pgtable.h>
/*
* Set this to one to enable additional vdma debug code.
*/
#define CONF_DEBUG_VDMA 0
static unsigned long vdma_pagetable_start = 0;
static unsigned long vdma_pagetable_end = 0;
......@@ -32,9 +37,24 @@ static unsigned long vdma_pagetable_end = 0;
static int debuglvl = 3;
/*
* Local prototypes
* Initialize the pagetable with a one-to-one mapping of
* the first 16 Mbytes of main memory and declare all
* entries to be unused. Using this method will at least
* allow some early device driver operations to work.
*/
static void vdma_pgtbl_init(void);
static inline void vdma_pgtbl_init(void)
{
int i;
unsigned long paddr = 0;
VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
for (i=0; i<VDMA_PGTBL_ENTRIES; i++)
{
pgtbl[i].frame = paddr;
pgtbl[i].owner = VDMA_PAGE_EMPTY;
paddr += VDMA_PAGESIZE;
}
}
/*
* Initialize the Jazz R4030 dma controller
......@@ -49,6 +69,7 @@ unsigned long vdma_init(unsigned long memory_start, unsigned long memory_end)
*/
vdma_pagetable_start = KSEG1ADDR((memory_start + 4095) & ~4095);
vdma_pagetable_end = vdma_pagetable_start + VDMA_PGTBL_SIZE;
flush_cache_all();
/*
* Clear the R4030 translation table
......@@ -60,6 +81,7 @@ unsigned long vdma_init(unsigned long memory_start, unsigned long memory_end)
r4030_write_reg32(JAZZ_R4030_TRSTBL_INV,0);
printk("VDMA: R4030 DMA pagetables initialized.\n");
return KSEG0ADDR(vdma_pagetable_end);
}
......@@ -91,7 +113,9 @@ unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
return VDMA_ERROR; /* invalid physical address */
}
/* find free chunk */
/*
* Find free chunk
*/
pages = (size + 4095) >> 12; /* no. of pages to allocate */
first = 0;
while (1)
......@@ -110,8 +134,9 @@ unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
break; /* found */
}
/* mark pages as allocated */
/*
* Mark pages as allocated
*/
laddr = (first << 12) + (paddr & (VDMA_PAGESIZE-1));
frame = paddr & ~(VDMA_PAGESIZE-1);
......@@ -123,8 +148,7 @@ unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
}
/*
* update translation table and
* return logical start address
* Update translation table and return logical start address
*/
r4030_write_reg32(JAZZ_R4030_TRSTBL_INV,0);
......@@ -188,8 +212,7 @@ int vdma_free(unsigned long laddr)
int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size)
{
VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
int first;
int pages;
int first, pages, npages;
if (laddr > 0xffffff)
{
......@@ -204,7 +227,7 @@ int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size)
return -EINVAL; /* invalid physical address */
}
pages = (((paddr & (VDMA_PAGESIZE-1)) + size) >> 12) + 1;
npages = pages = (((paddr & (VDMA_PAGESIZE-1)) + size) >> 12) + 1;
first = laddr >> 12;
if (vdma_debug)
printk("vdma_remap: first=%x, pages=%x\n",first,pages);
......@@ -230,8 +253,9 @@ int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size)
pages--;
}
/* update translation table */
/*
* Update translation table
*/
r4030_write_reg32(JAZZ_R4030_TRSTBL_INV,0);
if (vdma_debug > 2)
......@@ -274,7 +298,7 @@ unsigned long vdma_phys2log(unsigned long paddr)
}
if (i == VDMA_PGTBL_ENTRIES)
return 0xffffffff;
return ~0UL;
return (i<<12) + (paddr & (VDMA_PAGESIZE-1));
}
......@@ -289,28 +313,6 @@ unsigned long vdma_log2phys(unsigned long laddr)
return pgtbl[laddr >> 12].frame + (laddr & (VDMA_PAGESIZE-1));
}
/*
* Initialize the pagetable with a one-to-one mapping of
* the first 16 Mbytes of main memory and declare all
* entries to be unused. Using this method will at least
* allow some early device driver operations to work.
*/
static void vdma_pgtbl_init(void)
{
int i;
unsigned long paddr = 0;
VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *)vdma_pagetable_start;
for (i=0; i<VDMA_PGTBL_ENTRIES; i++)
{
pgtbl[i].frame = paddr;
pgtbl[i].owner = VDMA_PAGE_EMPTY;
paddr += VDMA_PAGESIZE;
}
/* vdma_stats(); */
}
/*
* Print DMA statistics
*/
......@@ -424,7 +426,7 @@ void vdma_disable(int channel)
void vdma_set_mode(int channel, int mode)
{
if (vdma_debug)
printk("vdma_set_mode: channel %d, mode 0x%x\n",channel,mode);
printk("vdma_set_mode: channel %d, mode 0x%x\n", channel, mode);
switch(channel)
{
......
/*
* linux/arch/mips/jazz/process.c
*
* Reset a Jazz machine.
*/
#include <asm/io.h>
#include <asm/system.h>
#include <asm/reboot.h>
void jazz_machine_restart(char *command)
{
printk("Implement jazz_machine_restart().\n");
printk("Press reset to continue.\n");
while(1);
}
void jazz_machine_halt(void)
{
}
void jazz_machine_power_off(void)
{
/* Jazz machines don't have a software power switch */
}
/*
* Setup pointers to hardware dependand routines.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996, 1997 by Ralf Baechle
*/
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <asm/irq.h>
#include <asm/jazz.h>
#include <asm/ptrace.h>
#include <asm/reboot.h>
#include <asm/vector.h>
#include <asm/io.h>
/*
* Initial irq handlers.
*/
static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
/*
* IRQ2 is cascade interrupt to second interrupt controller
*/
static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
extern asmlinkage void jazz_handle_int(void);
extern asmlinkage void jazz_fd_cacheflush(const void *addr, size_t size);
extern struct feature jazz_feature;
extern void jazz_machine_restart(char *command);
extern void jazz_machine_halt(void);
extern void jazz_machine_power_off(void);
__initfunc(static void jazz_irq_setup(void))
{
set_except_vector(0, jazz_handle_int);
r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
JAZZ_IE_ETHERNET |
JAZZ_IE_SERIAL1 |
JAZZ_IE_SERIAL2 |
JAZZ_IE_PARALLEL |
JAZZ_IE_FLOPPY);
r4030_read_reg16(JAZZ_IO_IRQ_SOURCE); /* clear pending IRQs */
r4030_read_reg32(JAZZ_R4030_INVAL_ADDR); /* clear error bits */
set_cp0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
/* set the clock to 100 Hz */
r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
request_region(0x20, 0x20, "pic1");
request_region(0xa0, 0x20, "pic2");
setup_x86_irq(2, &irq2);
}
__initfunc(void jazz_setup(void))
{
irq_setup = jazz_irq_setup;
fd_cacheflush = jazz_fd_cacheflush;
feature = &jazz_feature; // Will go away
isa_slot_offset = 0xe3000000;
request_region(0x00,0x20,"dma1");
request_region(0x40,0x20,"timer");
request_region(0x80,0x10,"dma page reg");
request_region(0xc0,0x20,"dma2");
/* The RTC is outside the port address space */
_machine_restart = jazz_machine_restart;
_machine_halt = jazz_machine_halt;
_machine_power_off = jazz_machine_power_off;
}
......@@ -6,72 +6,44 @@
# unless it's something special (ie not a .c file).
#
.S.s:
$(CPP) $(CFLAGS) $< -o $*.s
.S.o:
$(CC) $(CFLAGS) -c $< -o $*.o
all: kernel.o head.o
all: kernel.o head.o init_task.o
EXTRA_ASFLAGS = -mips3 -mcpu=r4000
O_TARGET := kernel.o
O_OBJS := process.o signal.o entry.o traps.o irq.o ptrace.o vm86.o ioport.o \
setup.o syscall.o sysmips.o time.o bios32.o ipc.o
O_OBJS := branch.o process.o signal.o entry.o traps.o ptrace.o vm86.o \
ioport.o pci.o reset.o setup.o syscall.o sysmips.o ipc.o \
r4k_switch.o r4k_misc.o r4k_scall.o r4k_fpu.o r2300_switch.o \
r2300_misc.o r2300_scall.o r2300_fpu.o r6000_fpu.o unaligned.o
OX_OBJS := mips_ksyms.o
#
# Kernel debugging
# SGI's have very different interrupt/timer hardware.
#
ifdef CONFIG_REMOTE_DEBUG
OBJS += gdb-low.o gdb-stub.o
ifndef CONFIG_SGI
O_OBJS += irq.o time.o
endif
#
# Board specific code
# Do we want to be able to execute IRIX elf binaries?
#
ifdef CONFIG_MIPS_JAZZ
O_OBJS += jazzdma.o jazz-c.o
endif
ifdef CONFIG_ACER_PICA_61
O_OBJS += pica.o
endif
ifdef CONFIG_DESKSTATION_TYNE
O_OBJS += tyne.o tyne-c.o
endif
ifdef CONFIG_MIPS_MAGNUM_4000
O_OBJS += magnum4000.o
ifdef CONFIG_BINFMT_IRIX
O_OBJS += irixelf.o irixioctl.o irixsig.o sysirix.o
endif
#
# CPU model specific code
# Kernel debugging
#
ifdef CONFIG_CPU_R2000
O_OBJS += r3000.o
endif
ifdef CONFIG_CPU_R3000
O_OBJS += r3000.o
endif
ifdef CONFIG_CPU_R4X00
O_OBJS += r4xx0.o
endif
ifdef CONFIG_CPU_R4600
O_OBJS += r4xx0.o
endif
ifdef CONFIG_CPU_R6000
exit 1 # no detailed information about CPU yet.
endif
ifdef CONFIG_CPU_R8000
exit 1 # no detailed information about CPU yet.
ifdef CONFIG_REMOTE_DEBUG
O_OBJS += gdb-low.o gdb-stub.o
endif
ifdef CONFIG_CPU_R10000
O_OBJS += r4xx0.o
#
# Depending from some other kernel option
#
ifdef CONFIG_PROC_FS
O_OBJS += proc.o
endif
#
......@@ -88,13 +60,23 @@ entry.o: entry.S
head.o: head.S
magnum4000.o: magnum4000.S
pica.o: pica.S
r4xx0.o: r4xx0.S
tyne.o: tyne.S
#r4k_switch.o: r4k_switch.S
#
#r4k_misc.o: r4k_misc.S
#
#r4k_scall.o: r4k_scall.S
#
#r4k_fpu.o: r4k_fpu.S
#
#r2300_switch.o: r2300_switch.S
#
#r2300_misc.o: r2300_misc.S
#
#r2300_scall.o: r2300_scall.S
#
#r2300_fpu.o: r2300_fpu.S
#
#r6000_fpu.o: r6000_fpu.S
clean:
......
/*
* bios 32 replacement
*/
unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
{
return memory_start;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -70,7 +70,6 @@
#include <asm/asm.h>
#include <asm/mipsregs.h>
#include <asm/segment.h>
#include <asm/cachectl.h>
#include <asm/system.h>
#include <asm/gdb-stub.h>
......@@ -326,7 +325,10 @@ static struct hard_trap_info
void set_debug_traps(void)
{
struct hard_trap_info *ht;
unsigned long flags;
unsigned char c;
save_flags(flags); cli();
for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
set_except_vector(ht->tt, trap_low);
......@@ -334,9 +336,14 @@ void set_debug_traps(void)
* In case GDB is started before us, ack any packets
* (presumably "$?#xx") sitting there.
*/
while((c = getDebugChar()) != '$');
while((c = getDebugChar()) != '#');
c = getDebugChar(); /* eat first csum byte */
c = getDebugChar(); /* eat second csum byte */
putDebugChar('+'); /* ack it */
putDebugChar ('+');
initialized = 1;
restore_flags(flags);
breakpoint();
}
......@@ -605,7 +612,7 @@ void handle_exception (struct gdb_regs *regs)
* NB: We flush both caches, just to be sure...
*/
sys_cacheflush((void *)KSEG0,KSEG1-KSEG0,BCACHE);
flush_cache_all();
return;
/* NOTREACHED */
break;
......
This diff is collapsed.
#include <linux/mm.h>
#include <linux/sched.h>
#include <asm/pgtable.h>
static struct vm_area_struct init_mmap = INIT_MMAP;
static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS;
struct mm_struct init_mm = INIT_MM;
/*
* Initial task structure.
*
* We need to make sure that this is 8192-byte aligned due to the
* way process stacks are handled. This is done by making sure
* the linker maps this in the .text segment right after head.S,
* and making head.S ensure the proper alignment.
*
* The things we do for performance..
*/
union task_union init_task_union __attribute__((__section__(".text"))) = { INIT_TASK };
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.
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.
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