## Automatically generated incremental diff
## From:   linux-2.4.19-rc1
## To:     linux-2.4.19-rc2
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.4.19-rc1/CREDITS linux-2.4.19-rc2/CREDITS
--- linux-2.4.19-rc1/CREDITS	Tue Jul 16 16:25:12 2002
+++ linux-2.4.19-rc2/CREDITS	Tue Jul 16 16:25:18 2002
@@ -198,12 +198,10 @@
 S: USA
 
 N: Greg Banks
-E: gnb@linuxfan.com
+E: gnb@alphalink.com.au
 D: IDT77105 ATM network driver
-S: NEC Australia
-S: 649-655 Springvale Rd
-S: Mulgrave, Victoria 3170
-S: Australia
+D: some SuperH port work
+D: some trivial futzing with kconfig
 
 N: James Banks
 E: james@sovereign.org
diff -urN linux-2.4.19-rc1/Documentation/Configure.help linux-2.4.19-rc2/Documentation/Configure.help
--- linux-2.4.19-rc1/Documentation/Configure.help	Tue Jul 16 16:25:12 2002
+++ linux-2.4.19-rc2/Documentation/Configure.help	Tue Jul 16 16:25:18 2002
@@ -2,7 +2,7 @@
 #	Eric S. Raymond <mailto:esr@thyrsus.com>
 #	Steven Cole <mailto:elenstev@mesatop.com>
 #
-# Merged version 2.69: current with 2.4.17-pre8/2.5.1-pre10.
+# Version 3.00: current with 2.4.19
 #
 # This version of the Linux kernel configuration help texts
 # corresponds to kernel versions 2.4.x and 2.5.x.
@@ -3862,6 +3862,12 @@
   because some crucial programs on your system might still be in A.OUT
   format.
 
+OSF/1 v4 readv/writev compatibility
+CONFIG_OSF4_COMPAT
+  Say Y if you are using OSF/1 binaries (like Netscape and Acrobat)
+  with v4 shared libraries freely available from Compaq. If you're
+  going to use shared libraries from Tru64 version 5.0 or later, say N.
+
 Kernel support for Linux/Intel ELF binaries
 CONFIG_BINFMT_EM86
   Say Y here if you want to be able to execute Linux/Intel ELF
@@ -24995,6 +25001,285 @@
   information:  http://www.candelatech.com/~greear/vlan.html  If unsure,
   you can safely say 'N'.
 
+ARC console support
+CONFIG_ARC_CONSOLE
+  Support for the PROM-based console on MIPS machines built according
+  to the Advanced Risc Computing specification, which is now (2001)
+  dead.  These included boxes from Deskstation, Acer, Olivetti and
+  NEC.  There is a history at <http://www.openbsd.org/arc.html>.
+
+AUTCPU12
+CONFIG_ARCH_AUTCPU12
+  Say Y if you intend to run the kernel on the autronix autcpu12
+  board. This board is based on a Cirrus Logic CS89712.
+
+IT8172 IDE support
+CONFIG_BLK_DEV_IT8172
+  Say Y here to support the on-board IDE controller on the Integrated
+  Technology Express, Inc. ITE8172 SBC.  Vendor page at
+  <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the
+  board at <http://www.mvista.com/allies/semiconductor/ite.html>.
+
+Use chscs for Common I/O
+CONFIG_CHSC
+  Select this option if you want the s390 common I/O layer to use information
+  obtained by channel subsystem calls. This will enable Linux to process link
+  failures and resource accessibility events. Moreover, if you have procfs
+  enabled, you'll be able to toggle chpids logically offline and online. Even
+  if you don't understand what this means, you should say "Y".
+
+Support ARM926T processor
+CONFIG_CPU_ARM926T
+  This is a variant of the ARM920.  It has slightly different
+  instruction sequences for cache and TLB operations.  Curiously,
+  there is no documentation on it at the ARM corporate website.
+
+  Say Y if you want support for the ARM926T processor.
+  Otherwise, say N.
+
+Support CPU clock change (EXPERIMENTAL)
+CONFIG_CPU_FREQ
+  CPU clock scaling allows you to change the clock speed of the
+  running CPU on the fly. This is a nice method to save battery power,
+  because the lower the clock speed, the less power the CPU
+  consumes. Note that this driver doesn't automatically change the CPU
+  clock speed, you need some userland tools (which still have to be
+  written) to implement the policy. If you don't understand what this
+  is all about, it's safe to say 'N'.
+
+Automatic activation of DIAG module
+CONFIG_DASD_AUTO_DIAG
+  Enable this option if you want your DIAG discipline module loaded
+  on DASD driver startup.
+
+Automatic activation of ECKD module
+CONFIG_DASD_AUTO_ECKD
+  Enable this option if you want your ECKD discipline module loaded
+  on DASD driver startup.
+
+Automatic activation of FBA  module
+CONFIG_DASD_AUTO_FBA
+  Enable this option if you want your FBA discipline module loaded
+  on DASD driver startup.
+
+SiS
+CONFIG_DRM_SIS
+  Choose this option if you have a SIS graphics card. AGP support is
+  required for this driver to work.
+
+Etrax Ethernet slave support (over lp0/1)
+CONFIG_ETRAX_ETHERNET_LPSLAVE
+  This option enables a slave ETRAX 100 or ETRAX 100LX, connected to a
+  master ETRAX 100 or ETRAX 100LX through par0 and par1, to act as an
+  Ethernet controller.
+
+Slave has its own LEDs
+CONFIG_ETRAX_ETHERNET_LPSLAVE_HAS_LEDS
+  Enable if the slave has it's own LEDs.
+
+ATA/IDE support
+CONFIG_ETRAX_IDE
+  Enable this to get support for ATA/IDE.  You can't use parallel
+  ports or SCSI ports at the same time.
+
+LED on when link
+CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK
+
+  Selecting LED_on_when_link will light the LED when there is a
+  connection and will flash off when there is activity.
+
+  Selecting LED_on_when_activity will light the LED only when
+  there is activity.
+
+  This setting will also affect the behaviour of other activity LEDs
+  e.g. Bluetooth.
+
+Power button bit on port G
+CONFIG_ETRAX_POWERBUTTON_BIT
+  Configure where power button is connected.
+
+Root device name
+CONFIG_ETRAX_ROOT_DEVICE
+  Specifies the device that should be mounted as root file system
+  when booting from flash. The axisflashmap driver adds an additional
+  mtd partition for the appended root file system image, so this option
+  should normally be the mtdblock device for the partition after the
+  last partition in the partition table.
+
+Serial port 0 enabled
+CONFIG_ETRAX_SERIAL_PORT0
+  Enables the ETRAX 100 serial driver for ser0 (ttyS0)
+  Normally you want this on, unless you use external DMA 1 that uses
+  the same DMA channels.
+
+Shutdown bit on port CSP0
+CONFIG_ETRAX_SHUTDOWN_BIT
+  Configure what pin on CSPO-port that is used for controlling power
+  supply.
+
+Software Shutdown Support
+CONFIG_ETRAX_SOFT_SHUTDOWN
+  Enable this if Etrax is used with a power-supply that can be turned
+  off and on with PS_ON signal. Gives the possibility to detect
+  powerbutton and then do a power off after unmounting disks.
+
+Disable watchdog during Oops printouts
+CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
+  By enabling this you make sure that the watchdog does not bite while
+  printing oopses. Recommended for development systems but not for
+  production releases.
+
+Compaq iPAQ Handheld sleeve support
+CONFIG_H3600_SLEEVE
+  Choose this option to enable support for extension packs (sleeves)
+  for the Compaq iPAQ H3XXX series of handheld computers.  This option
+  is required for the CF, PCMCIA, Bluetooth and GSM/GPRS extension
+  packs.
+
+AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)
+CONFIG_HISAX_FRITZ_PCIPNP
+  This enables the driver for the AVM Fritz!Card PCI, Fritz!Card PCI v2
+  and Fritz!Card PnP.
+  (the latter also needs you to select "ISA Plug and Play support"
+  from the menu "Plug and Play configuration")
+
+IBM PCI Hotplug driver
+CONFIG_HOTPLUG_PCI_IBM
+  Say Y here if you have a motherboard with a IBM PCI Hotplug
+  controller.
+
+  This code is also available as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want).
+  The module will be called cpqphp.o. If you want to compile it
+  as a module, say M here and read Documentation/modules.txt.
+
+  When in doubt, say N.
+
+Control-Program Identification
+CONFIG_HWC_CPI
+  This option enables the hardware console interface for system
+  identification This is commonly used for workload management and
+  gives you a nice name for the system on the service element.
+  Please select this option as a module since built-in operation is
+  completely untested.
+  You should only select this option if you know what you are doing,
+  need this feature and intend to run your kernel in LPAR.
+
+Enable autotest (llsc). Option to run cache test instead of booting
+CONFIG_IA64_SGI_AUTOTEST
+  Build a kernel used for hardware validation. If you include the
+  keyword "autotest" on the boot command line, the kernel does NOT boot.
+  Instead, it starts all cpus and runs cache coherency tests instead.
+
+  If unsure, say N.
+
+IEC61883-6 (Audio transmission) support
+CONFIG_IEEE1394_AMDTP
+  This option enables the Audio & Music Data Transmission Protocol
+  (IEC61883-6) driver, which implements audio transmission over
+  IEEE1394.
+
+  The userspace interface is documented in amdtp.h.
+
+  If you want to compile this as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want),
+  say M here and read Documentation/modules.txt.  The module
+  will be called amdtp.o.
+
+IEC61883-1 Plug support
+CONFIG_IEEE1394_CMP
+  This option enables the Connection Management Procedures
+  (IEC61883-1) driver, which implements input and output plugs.
+
+  If you want to compile this as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want),
+  say M here and read Documentation/modules.txt.  The module
+  will be called amdtp.o.
+
+OHCI-DV I/O support
+CONFIG_IEEE1394_DV1394
+  This driver allows you to transmit and receive DV (digital video)
+  streams on an OHCI-1394 card using a simple frame-oriented
+  interface.
+
+  The user-space API for dv1394 is documented in dv1394.h.
+
+  If you want to compile this as a module ( = code which can be
+  inserted in and removed from the running kernel whenever you want),
+  say M here and read Documentation/modules.txt.  The module
+  will be called dv1394.o.
+
+Ethernet over 1394
+CONFIG_IEEE1394_ETH1394
+  Extremely Experimental! This driver is a Linux specific way to use your
+  IEEE1394 Host as an Ethernet type device. This is _NOT_ IP1394.
+
+Support for older IT8172 (Rev C)
+CONFIG_IT8172_REVC
+  Say Y here to support the older, Revision C version of the Integrated
+  Technology Express, Inc. ITE8172 SBC.  Vendor page at
+  <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the
+  board at <http://www.mvista.com/allies/semiconductor/ite.html>.
+
+Enable Smart Card Reader 0 Support
+CONFIG_IT8172_SCR0
+  Say Y here to support smart-card reader 0 (SCR0) on the Integrated
+  Technology Express, Inc. ITE8172 SBC.  Vendor page at
+  <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the
+  board at <http://www.mvista.com/allies/semiconductor/ite.html>.
+
+Enable Smart Card Reader 1 Support
+CONFIG_IT8172_SCR1
+  Say Y here to support smart-card reader 1 (SCR1) on the Integrated
+  Technology Express, Inc. ITE8172 SBC.  Vendor page at
+  <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the
+  board at <http://www.mvista.com/allies/semiconductor/ite.html>.
+
+IT8172 IDE Tuning support
+CONFIG_IT8172_TUNING
+  Say Y here to support tuning the ITE8172's IDE interface.  This makes
+  it possible to set DMA channel or PIO opration and the transfer rate.
+
+Process warning machine checks
+CONFIG_MACHCHK_WARNING
+  Select this option if you want the machine check handler on IBM S/390 or
+  zSeries to process warning machine checks (e.g. on power failures).
+  If unsure, say "Y".
+
+Pseudo page fault support
+CONFIG_PFAULT
+  Select this option, if you want to use PFAULT pseudo page fault
+  handling under VM. If running native or in LPAR, this option
+  has no effect. If your VM does not support PFAULT, PAGEEX
+  pseudo page fault handling will be used.
+  Note that VM 4.2 supports PFAULT but has a bug in its
+  implementation that causes some problems.
+  Everybody who wants to run Linux under VM != VM4.2 should select
+  this option.
+
+Enable protocol mode for the L1 console
+CONFIG_SERIAL_SGI_L1_PROTOCOL
+  Uses protocol mode instead of raw mode for the level 1 console on the
+  SGI SN (Scalable NUMA) platform for IA64.  If you are compiling for
+  an SGI SN box then Y is the recommended value, otherwise say N.
+
+VM shared kernel support
+CONFIG_SHARED_KERNEL
+  Select this option, if you want to share the text segment of the
+  Linux kernel between different VM guests. This reduces memory
+  usage with lots of guests but greatly increases kernel size.
+  You should only select this option if you know what you are
+  doing and want to exploit this feature.
+
+New bus configuration (EXPERIMENTAL)  
+CONFIG_TULIP_MWI
+  This configures your Tulip card specifically for the card and
+  system cache line size type you are using.
+
+  This is experimental code, not yet tested on many boards.
+
+  If unsure, say N.
+
 #
 # A couple of things I keep forgetting:
 #   capitalize: AppleTalk, Ethernet, DOS, DMA, FAT, FTP, Internet,
diff -urN linux-2.4.19-rc1/MAINTAINERS linux-2.4.19-rc2/MAINTAINERS
--- linux-2.4.19-rc1/MAINTAINERS	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/MAINTAINERS	Tue Jul 16 16:25:18 2002
@@ -1291,6 +1291,17 @@
 W:	http://www.pnd-pc.demon.co.uk/promise/
 S:	Maintained
 
+PROMISE PDC202XX IDE CONTROLLER DRIVER
+P:	Hank Yang
+M:	support@promise.com.tw [TAIWAN]
+P:	Jordan Rhody
+M:	support@promise.com [U.S.A]
+P:	Jack Hu
+M:	support-china@promise.com [CHINA]
+W:	http://www.promise.com/support/linux_eng.asp
+W:	http://www.promise.com.tw/support/linux_eng.asp
+S:	Maintained
+
 QNX4 FILESYSTEM
 P:	Anders Larsen
 M:	al@alarsen.net
diff -urN linux-2.4.19-rc1/Makefile linux-2.4.19-rc2/Makefile
--- linux-2.4.19-rc1/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/Makefile	Tue Jul 16 16:25:18 2002
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 19
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc2
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
@@ -358,10 +358,10 @@
 	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(ARCH)"' -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c
 
 init/main.o: init/main.c include/config/MARKER
-	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $*.o $<
+	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
 
 init/do_mounts.o: init/do_mounts.c include/config/MARKER
-	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $*.o $<
+	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $@ $<
 
 fs lib mm ipc kernel drivers net: dummy
 	$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
diff -urN linux-2.4.19-rc1/Rules.make linux-2.4.19-rc2/Rules.make
--- linux-2.4.19-rc1/Rules.make	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/Rules.make	Tue Jul 16 16:25:18 2002
@@ -176,7 +176,7 @@
 _modinst__: dummy
 ifneq "$(strip $(ALL_MOBJS))" ""
 	mkdir -p $(MODLIB)/kernel/$(MOD_DESTDIR)
-	cp $(ALL_MOBJS) $(MODLIB)/kernel/$(MOD_DESTDIR)
+	cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
 endif
 
 .PHONY: modules_install
diff -urN linux-2.4.19-rc1/arch/alpha/config.in linux-2.4.19-rc2/arch/alpha/config.in
--- linux-2.4.19-rc1/arch/alpha/config.in	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/alpha/config.in	Tue Jul 16 16:25:18 2002
@@ -283,6 +283,10 @@
 fi
  
 tristate 'Kernel support for a.out (ECOFF) binaries' CONFIG_BINFMT_AOUT
+if [ "$CONFIG_BINFMT_AOUT" != "n" ]; then
+	bool '  OSF/1 v4 readv/writev compatibility' CONFIG_OSF4_COMPAT
+fi
+
 tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
 tristate 'Kernel support for Linux/Intel ELF binaries' CONFIG_BINFMT_EM86
diff -urN linux-2.4.19-rc1/arch/alpha/kernel/entry.S linux-2.4.19-rc2/arch/alpha/kernel/entry.S
--- linux-2.4.19-rc1/arch/alpha/kernel/entry.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/alpha/kernel/entry.S	Tue Jul 16 16:25:18 2002
@@ -886,8 +886,13 @@
 	.quad osf_getrusage
 	.quad sys_getsockopt
 	.quad alpha_ni_syscall
+#ifdef CONFIG_OSF4_COMPAT
+	.quad osf_readv				/* 120 */
+	.quad osf_writev
+#else
 	.quad sys_readv				/* 120 */
 	.quad sys_writev
+#endif
 	.quad osf_settimeofday
 	.quad sys_fchown
 	.quad sys_fchmod
diff -urN linux-2.4.19-rc1/arch/alpha/kernel/osf_sys.c linux-2.4.19-rc2/arch/alpha/kernel/osf_sys.c
--- linux-2.4.19-rc1/arch/alpha/kernel/osf_sys.c	Fri Nov  2 17:39:20 2001
+++ linux-2.4.19-rc2/arch/alpha/kernel/osf_sys.c	Tue Jul 16 16:25:18 2002
@@ -1384,3 +1384,44 @@
 
 	return addr;
 }
+
+#ifdef CONFIG_OSF4_COMPAT
+extern ssize_t sys_readv(unsigned long, const struct iovec *, unsigned long);
+extern ssize_t sys_writev(unsigned long, const struct iovec *, unsigned long);
+
+/* Clear top 32 bits of iov_len in the user's buffer for
+   compatibility with old versions of OSF/1 where iov_len
+   was defined as int. */
+static int
+osf_fix_iov_len(const struct iovec *iov, unsigned long count)
+{
+	unsigned long i;
+
+	for (i = 0 ; i < count ; i++) {
+		int *iov_len_high = (int *)&iov[i].iov_len + 1;
+
+		if (put_user(0, iov_len_high))
+			return -EFAULT;
+	}
+	return 0;
+}
+
+asmlinkage ssize_t
+osf_readv(unsigned long fd, const struct iovec * vector, unsigned long count)
+{
+	if (unlikely(personality(current->personality) == PER_OSF4))
+		if (osf_fix_iov_len(vector, count))
+			return -EFAULT;
+	return sys_readv(fd, vector, count);
+}
+
+asmlinkage ssize_t
+osf_writev(unsigned long fd, const struct iovec * vector, unsigned long count)
+{
+	if (unlikely(personality(current->personality) == PER_OSF4))
+		if (osf_fix_iov_len(vector, count))
+			return -EFAULT;
+	return sys_writev(fd, vector, count);
+}
+
+#endif
diff -urN linux-2.4.19-rc1/arch/i386/boot/compressed/misc.c linux-2.4.19-rc2/arch/i386/boot/compressed/misc.c
--- linux-2.4.19-rc1/arch/i386/boot/compressed/misc.c	Mon Nov 12 09:59:43 2001
+++ linux-2.4.19-rc2/arch/i386/boot/compressed/misc.c	Tue Jul 16 16:25:18 2002
@@ -125,7 +125,7 @@
 static int lines, cols;
 
 #ifdef CONFIG_MULTIQUAD
-static void *xquad_portio = NULL;
+static void * const xquad_portio = NULL;
 #endif
 
 #include "../../../../lib/inflate.c"
diff -urN linux-2.4.19-rc1/arch/i386/kernel/i386_ksyms.c linux-2.4.19-rc2/arch/i386/kernel/i386_ksyms.c
--- linux-2.4.19-rc1/arch/i386/kernel/i386_ksyms.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/i386/kernel/i386_ksyms.c	Tue Jul 16 16:25:18 2002
@@ -175,3 +175,7 @@
 
 extern int is_sony_vaio_laptop;
 EXPORT_SYMBOL(is_sony_vaio_laptop);
+
+#ifdef CONFIG_MULTIQUAD
+EXPORT_SYMBOL(xquad_portio);
+#endif
diff -urN linux-2.4.19-rc1/arch/i386/kernel/process.c linux-2.4.19-rc2/arch/i386/kernel/process.c
--- linux-2.4.19-rc1/arch/i386/kernel/process.c	Mon Feb 25 11:37:53 2002
+++ linux-2.4.19-rc2/arch/i386/kernel/process.c	Tue Jul 16 16:25:18 2002
@@ -311,7 +311,7 @@
 	/*
 	 * Use `swapper_pg_dir' as our page directory.
 	 */
-	asm volatile("movl %0,%%cr3": :"r" (__pa(swapper_pg_dir)));
+	load_cr3(swapper_pg_dir);
 
 	/* Write 0x1234 to absolute memory location 0x472.  The BIOS reads
 	   this on booting to tell it to "Bypass memory test (also warm
diff -urN linux-2.4.19-rc1/arch/i386/kernel/smp.c linux-2.4.19-rc2/arch/i386/kernel/smp.c
--- linux-2.4.19-rc1/arch/i386/kernel/smp.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/i386/kernel/smp.c	Tue Jul 16 16:25:18 2002
@@ -298,11 +298,15 @@
 /*
  * We cannot call mmdrop() because we are in interrupt context, 
  * instead update mm->cpu_vm_mask.
+ *
+ * We need to reload %cr3 since the page tables may be going
+ * away frm under us...
  */
 static void inline leave_mm (unsigned long cpu)
 {
 	BUG_ON(cpu_tlbstate[cpu].state == TLBSTATE_OK);
 	clear_bit(cpu, &cpu_tlbstate[cpu].active_mm->cpu_vm_mask);
+	load_cr3(swapper_pg_dir);
 }
 
 /*
diff -urN linux-2.4.19-rc1/arch/i386/kernel/smpboot.c linux-2.4.19-rc2/arch/i386/kernel/smpboot.c
--- linux-2.4.19-rc1/arch/i386/kernel/smpboot.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/i386/kernel/smpboot.c	Tue Jul 16 16:25:18 2002
@@ -973,7 +973,7 @@
 
 static int boot_cpu_logical_apicid;
 /* Where the IO area was mapped on multiquad, always 0 otherwise */
-void *xquad_portio = NULL;
+void *xquad_portio;
 
 int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
 
diff -urN linux-2.4.19-rc1/arch/i386/mm/init.c linux-2.4.19-rc2/arch/i386/mm/init.c
--- linux-2.4.19-rc1/arch/i386/mm/init.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/i386/mm/init.c	Tue Jul 16 16:25:18 2002
@@ -331,7 +331,7 @@
 {
 	pagetable_init();
 
-	__asm__( "movl %%ecx,%%cr3\n" ::"c"(__pa(swapper_pg_dir)));
+	load_cr3(swapper_pg_dir);	
 
 #if CONFIG_X86_PAE
 	/*
diff -urN linux-2.4.19-rc1/arch/mips/Makefile linux-2.4.19-rc2/arch/mips/Makefile
--- linux-2.4.19-rc1/arch/mips/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/Makefile	Tue Jul 16 16:25:18 2002
@@ -5,6 +5,7 @@
 #
 # Copyright (C) 1994, 1995, 1996 by Ralf Baechle
 # DECStation modifications by Paul M. Antoine, 1996
+# Copyright (C) 2002  Maciej W. Rozycki
 #
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
@@ -22,7 +23,7 @@
 endif
 
 ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE  = $(tool-prefix)
+CROSS_COMPILE	= $(tool-prefix)
 endif
 
 #
@@ -35,13 +36,13 @@
 # machines may also.  Since BFD is incredibly buggy with respect to
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
-GCCFLAGS	:= -G 0 -mno-abicalls -fno-pic
-LINKFLAGS	+= -static
+GCCFLAGS	:= -I $(TOPDIR)/include/asm/gcc
+GCCFLAGS	+= -G 0 -mno-abicalls -fno-pic -pipe
+LINKFLAGS	+= -G 0 -static # -N
 MODFLAGS	+= -mlong-calls
-LD		:= $(LD) -G 0
 
 ifdef CONFIG_REMOTE_DEBUG
-CFLAGS		:= $(CFLAGS) -g
+GCCFLAGS	+= -g
 endif
 
 #
@@ -78,7 +79,7 @@
 GCCFLAGS	+= -mcpu=r5000 -mips2 -Wa,--trap
 endif
 ifdef CONFIG_CPU_R5432
-GCCFLAGS        += -mcpu=r5000 -mips2 -Wa,--trap
+GCCFLAGS	+= -mcpu=r5000 -mips2 -Wa,--trap
 endif
 ifdef CONFIG_CPU_NEVADA
 # Cannot use -mmad with currently recommended tools
@@ -90,21 +91,19 @@
 ifdef CONFIG_CPU_SB1
 GCCFLAGS	+= -mcpu=sb1 -mips2 -Wa,--trap
 ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
-MODFLAGS       += -msb1-pass1-workarounds
+MODFLAGS	+= -msb1-pass1-workarounds
 endif
 endif
 
-GCCFLAGS	+= -pipe
-
-CFLAGS		:= -I $(TOPDIR)/include/asm/gcc $(CFLAGS) $(GCCFLAGS)
 AFLAGS		+= $(GCCFLAGS)
-ASFLAGS		+= $(GCCFLAGS)
+CFLAGS		+= $(GCCFLAGS)
+
 
 #
 # We unconditionally build the math emulator
 #
-CORE_FILES	+=arch/mips/math-emu/fpu_emulator.o
-SUBDIRS		+=arch/mips/math-emu
+CORE_FILES	+= arch/mips/math-emu/fpu_emulator.o
+SUBDIRS		+= arch/mips/math-emu
 
 #
 # ramdisk/initrd support
@@ -116,138 +115,145 @@
 SUBDIRS		+= arch/mips/ramdisk
 endif
 
+
 #
 # Board-dependent options and extra files
 #
-ifdef CONFIG_ALGOR_P4032
-CORE_FILES    += arch/mips/algor/algor.o
-SUBDIRS       += arch/mips/algor
-LOADADDR      += 0x80000000
-endif
 
 #
-# DECstation family
+# Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
 #
-ifdef CONFIG_DECSTATION
-CORE_FILES    += arch/mips/dec/dec.o
-SUBDIRS       += arch/mips/dec arch/mips/dec/prom
-LIBS          += arch/mips/dec/prom/rexlib.a
-LOADADDR      += 0x80040000
+ifdef CONFIG_MIPS_JAZZ
+CORE_FILES	+= arch/mips/jazz/jazz.o
+SUBDIRS		+= arch/mips/jazz arch/mips/arc
+LIBS		+= arch/mips/arc/arclib.a
+LOADADDR	:= 0x80080000
 endif
 
-ifdef CONFIG_MIPS_ATLAS
-LIBS          += arch/mips/mips-boards/atlas/atlas.o arch/mips/mips-boards/generic/mipsboards.o
-SUBDIRS       += arch/mips/mips-boards/generic arch/mips/mips-boards/atlas
-LOADADDR      += 0x80100000
+#
+# Au1000 (Alchemy Semi PB1000) eval board
+#
+ifdef CONFIG_MIPS_PB1000
+LIBS		+= arch/mips/au1000/pb1000/pb1000.o \
+		   arch/mips/au1000/common/au1000.o
+SUBDIRS		+= arch/mips/au1000/pb1000 arch/mips/au1000/common
+LOADADDR	:= 0x80100000
 endif
 
-ifdef CONFIG_MIPS_MALTA
-LIBS          += arch/mips/mips-boards/malta/malta.o arch/mips/mips-boards/generic/mipsboards.o
-SUBDIRS       += arch/mips/mips-boards/malta arch/mips/mips-boards/generic
-LOADADDR      += 0x80100000
+#
+# Au1000 (Alchemy Semi PB1500) eval board
+#
+ifdef CONFIG_MIPS_PB1500
+LIBS		+= arch/mips/au1000/pb1500/pb1500.o \
+		   arch/mips/au1000/common/au1000.o
+SUBDIRS		+= arch/mips/au1000/pb1500 arch/mips/au1000/common
+LOADADDR	:= 0x80100000
 endif
 
 #
-# Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
+# Algorithmics P4032
 #
-ifdef CONFIG_MIPS_JAZZ
-CORE_FILES    += arch/mips/jazz/jazz.o
-SUBDIRS       += arch/mips/jazz arch/mips/arc
-LIBS          += arch/mips/arc/arclib.a
-LOADADDR      += 0x80080000
+ifdef CONFIG_ALGOR_P4032
+CORE_FILES	+= arch/mips/algor/algor.o
+SUBDIRS		+= arch/mips/algor
+LOADADDR	:= 0x80000000
 endif
 
-ifdef CONFIG_MIPS_COBALT
-SUBDIRS       += arch/mips/cobalt
-CORE_FILES    += arch/mips/cobalt/cobalt.o
-LOADADDR      += 0x80080000
+#
+# Baget/MIPS
+#
+ifdef CONFIG_BAGET_MIPS
+SUBDIRS		+= arch/mips/baget arch/mips/baget/prom
+LIBS		+= arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a
+LOADADDR	:= 0x80001000
 endif
 
-ifdef CONFIG_SNI_RM200_PCI
-CORE_FILES    += arch/mips/sni/sni.o
-SUBDIRS       += arch/mips/sni arch/mips/arc
-LIBS          += arch/mips/arc/arclib.a
-LOADADDR      += 0x80080000
+#
+# Cobalt Server
+#
+ifdef CONFIG_MIPS_COBALT
+SUBDIRS		+= arch/mips/cobalt
+CORE_FILES	+= arch/mips/cobalt/cobalt.o
+LOADADDR	:= 0x80080000
 endif
 
-ifdef CONFIG_SGI_IP22
-CORE_FILES    += arch/mips/sgi-ip22/ip22-kern.o
-LIBS          += arch/mips/arc/arclib.a
-SUBDIRS       += arch/mips/sgi-ip22 arch/mips/arc
 #
-# 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.
+# DECstation family
 #
-LOADADDR      += 0x88002000
+ifdef CONFIG_DECSTATION
+CORE_FILES	+= arch/mips/dec/dec.o
+SUBDIRS		+= arch/mips/dec arch/mips/dec/prom
+LIBS		+= arch/mips/dec/prom/rexlib.a
+LOADADDR	:= 0x80040000
 endif
 
 #
-# Baget/MIPS
+# Galileo EV64120 Board
 #
-ifdef CONFIG_BAGET_MIPS
-SUBDIRS       += arch/mips/baget arch/mips/baget/prom
-LIBS          += arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a
-LOADADDR      += 0x80001000
+ifdef CONFIG_MIPS_EV64120
+LIBS		+= arch/mips/galileo-boards/ev64120/ev64120.o
+SUBDIRS		+= arch/mips/galileo-boards/ev64120
+LOADADDR	:= 0x80100000
 endif
 
 #
-# NEC DDB Vrc-5074
+# Galileo EV96100 Board
 #
-ifdef CONFIG_DDB5074
-SUBDIRS       += arch/mips/ddb5074
-LIBS          += arch/mips/ddb5074/ddb5074.a
-LOADADDR      += 0x80080000
+ifdef CONFIG_MIPS_EV96100
+LIBS		+= arch/mips/galileo-boards/ev96100/ev96100.o \
+		   arch/mips/galileo-boards/generic/galboards.o
+SUBDIRS		+= arch/mips/galileo-boards/generic \
+		   arch/mips/galileo-boards/ev96100
+LOADADDR	:= 0x80100000
 endif
 
 #
+# Globespan IVR eval board with QED 5231 CPU
 #
-# NEC DDB Vrc-5476
-#
-ifdef CONFIG_DDB5476
-SUBDIRS       += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5476
-LIBS          += arch/mips/ddb5xxx/common/ddb5xxx.o \
-		 arch/mips/ddb5xxx/ddb5476/ddb5476.o
-LOADADDR      += 0x80080000
+ifdef CONFIG_MIPS_IVR
+LIBS		+= arch/mips/ite-boards/ivr/ivr.o \
+		   arch/mips/ite-boards/generic/it8172.o
+SUBDIRS		+= arch/mips/ite-boards/generic arch/mips/ite-boards/ivr
+LOADADDR	:= 0x80100000
 endif
 
 #
+# HP LaserJet
 #
-# NEC DDB Vrc-5477
-#
-ifdef CONFIG_DDB5477
-SUBDIRS       += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5477
-LIBS          += arch/mips/ddb5xxx/common/ddb5xxx.o \
-                 arch/mips/ddb5xxx/ddb5477/ddb5477.o
-LOADADDR      += 0x80080000
+ifdef CONFIG_HP_LASERJET
+SUBDIRS		+= arch/mips/hp-lj
+LIBS		+= arch/mips/hp-lj/hp-lj.o
+LOADADDR	:= 0x80030000
 endif
 
 #
-# NEC Osprey (vr4181) board
+# ITE 8172 eval board with QED 5231 CPU
 #
-ifdef CONFIG_NEC_OSPREY
-SUBDIRS       += arch/mips/vr4181/common arch/mips/vr4181/osprey
-LIBS          += arch/mips/vr4181/common/vr4181.o \
-                 arch/mips/vr4181/osprey/osprey.o
-LOADADDR      += 0x80002000
+ifdef CONFIG_MIPS_ITE8172
+LIBS		+= arch/mips/ite-boards/qed-4n-s01b/ite.o \
+		   arch/mips/ite-boards/generic/it8172.o
+SUBDIRS		+= arch/mips/ite-boards/generic arch/mips/ite-boards/qed-4n-s01b
+LOADADDR	:= 0x80100000
 endif
 
 #
-# Galileo EV64120 Board
+# MIPS Atlas board
 #
-ifdef CONFIG_MIPS_EV64120
-LIBS          += arch/mips/galileo-boards/ev64120/ev64120.o
-SUBDIRS       += arch/mips/galileo-boards/ev64120
-LOADADDR      += 0x80100000
+ifdef CONFIG_MIPS_ATLAS
+LIBS		+= arch/mips/mips-boards/atlas/atlas.o \
+		   arch/mips/mips-boards/generic/mipsboards.o
+SUBDIRS		+= arch/mips/mips-boards/generic arch/mips/mips-boards/atlas
+LOADADDR	:= 0x80100000
 endif
 
 #
-# Galileo EV96100 Board
+# MIPS Malta board
 #
-ifdef CONFIG_MIPS_EV96100
-LIBS          += arch/mips/galileo-boards/ev96100/ev96100.o arch/mips/galileo-boards/generic/galboards.o
-SUBDIRS       += arch/mips/galileo-boards/generic arch/mips/galileo-boards/ev96100
-LOADADDR      += 0x80100000
+ifdef CONFIG_MIPS_MALTA
+LIBS		+= arch/mips/mips-boards/malta/malta.o \
+		   arch/mips/mips-boards/generic/mipsboards.o
+SUBDIRS		+= arch/mips/mips-boards/malta arch/mips/mips-boards/generic
+LOADADDR	:= 0x80100000
 endif
 
 #
@@ -256,53 +262,73 @@
 ifdef CONFIG_MOMENCO_OCELOT
 # The Ocelot setup.o must be linked early - it does the ioremap() for the
 # mips_io_port_base.
-CORE_FILES    += arch/mips/gt64120/common/gt64120.o arch/mips/gt64120/momenco_ocelot/momenco_ocelot.o
-SUBDIRS       += arch/mips/gt64120/common arch/mips/gt64120/momenco_ocelot
-LOADADDR      += 0x80100000
+CORE_FILES	+= arch/mips/gt64120/common/gt64120.o \
+		   arch/mips/gt64120/momenco_ocelot/momenco_ocelot.o
+SUBDIRS		+= arch/mips/gt64120/common arch/mips/gt64120/momenco_ocelot
+LOADADDR	:= 0x80100000
 endif
 
 #
-# Philips Nino
+# NEC DDB Vrc-5074
 #
-ifdef CONFIG_NINO
-CORE_FILES    += arch/mips/philips/nino/nino.o
-SUBDIRS       += arch/mips/philips/nino
-LOADADDR      += 0x80000000
+ifdef CONFIG_DDB5074
+SUBDIRS		+= arch/mips/ddb5074
+LIBS		+= arch/mips/ddb5074/ddb5074.a
+LOADADDR	:= 0x80080000
 endif
 
 #
-# ITE 8172 eval board with QED 5231 CPU
+# NEC DDB Vrc-5476
 #
-ifdef CONFIG_MIPS_ITE8172
-LIBS          += arch/mips/ite-boards/qed-4n-s01b/ite.o arch/mips/ite-boards/generic/it8172.o
-SUBDIRS       += arch/mips/ite-boards/generic arch/mips/ite-boards/qed-4n-s01b
-LOADADDR      += 0x80100000
+ifdef CONFIG_DDB5476
+SUBDIRS		+= arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5476
+LIBS		+= arch/mips/ddb5xxx/common/ddb5xxx.o \
+		   arch/mips/ddb5xxx/ddb5476/ddb5476.o
+LOADADDR	:= 0x80080000
 endif
 
 #
-# Globespan IVR eval board with QED 5231 CPU
+# NEC DDB Vrc-5477
 #
-ifdef CONFIG_MIPS_IVR
-LIBS          += arch/mips/ite-boards/ivr/ivr.o arch/mips/ite-boards/generic/it8172.o
-SUBDIRS       += arch/mips/ite-boards/generic arch/mips/ite-boards/ivr
-LOADADDR      += 0x80100000
+ifdef CONFIG_DDB5477
+SUBDIRS		+= arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5477
+LIBS		+= arch/mips/ddb5xxx/common/ddb5xxx.o \
+		   arch/mips/ddb5xxx/ddb5477/ddb5477.o
+LOADADDR	:= 0x80080000
 endif
 
 #
-# Au1000 eval board
+# NEC Osprey (vr4181) board
 #
-ifdef CONFIG_MIPS_PB1000
-LIBS          += arch/mips/au1000/pb1000/pb1000.o \
-                 arch/mips/au1000/common/au1000.o
-SUBDIRS       += arch/mips/au1000/pb1000 arch/mips/au1000/common
-LOADADDR      += 0x80100000
+ifdef CONFIG_NEC_OSPREY
+SUBDIRS		+= arch/mips/vr4181/common arch/mips/vr4181/osprey
+LIBS		+= arch/mips/vr4181/common/vr4181.o \
+		   arch/mips/vr4181/osprey/osprey.o
+LOADADDR	:= 0x80002000
 endif
 
-ifdef CONFIG_MIPS_PB1500
-LIBS          += arch/mips/au1000/pb1500/pb1500.o \
-                 arch/mips/au1000/common/au1000.o
-SUBDIRS       += arch/mips/au1000/pb1500 arch/mips/au1000/common
-LOADADDR      += 0x80100000
+#
+# Philips Nino
+#
+ifdef CONFIG_NINO
+CORE_FILES	+= arch/mips/philips/nino/nino.o
+SUBDIRS		+= arch/mips/philips/nino
+LOADADDR	:= 0x80000000
+endif
+
+#
+# SGI IP22 (Indy/Indigo2)
+#
+ifdef CONFIG_SGI_IP22
+CORE_FILES	+= arch/mips/sgi-ip22/ip22-kern.o
+LIBS		+= arch/mips/arc/arclib.a
+SUBDIRS		+= arch/mips/sgi-ip22 arch/mips/arc
+#
+# 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
 endif
 
 #
@@ -312,38 +338,47 @@
 # This is a LIB so that it links at the end, and initcalls are later
 # the sequence; but it is built as an object so that modules don't get
 # removed (as happens, even if they have __initcall/module_init)
-LIBS          += arch/mips/sibyte/sb1250/sb1250.o
-SUBDIRS       += arch/mips/sibyte/sb1250 
+LIBS		+= arch/mips/sibyte/sb1250/sb1250.o
+SUBDIRS		+= arch/mips/sibyte/sb1250
 endif
 
 #
 # Sibyte SWARM board
 #
-ifdef CONFIG_SB1_CACHE_ERROR
-LIBS          += arch/mips/sibyte/sb1/sb1kern.a
-SUBDIRS       += arch/mips/sibyte/sb1
+ifdef CONFIG_SIBYTE_SWARM
+LIBS		+= arch/mips/sibyte/swarm/sbswarm.a
+SUBDIRS		+= arch/mips/sibyte/swarm
+LOADADDR	:= 0x80100000
 endif
 
-ifdef CONFIG_SIBYTE_SWARM
-LIBS          += arch/mips/sibyte/swarm/sbswarm.a
-SUBDIRS       += arch/mips/sibyte/swarm
-LOADADDR      += 0x80100000
+#
+# SB1 Cache Error handler
+#
+ifdef CONFIG_SB1_CACHE_ERROR
+LIBS		+= arch/mips/sibyte/sb1/sb1kern.a
+SUBDIRS		+= arch/mips/sibyte/sb1
 endif
 
 #
-# HP LaserJet
+# SNI RM200 PCI
 #
-ifdef CONFIG_HP_LASERJET
-SUBDIRS       += arch/mips/hp-lj
-LIBS          += arch/mips/hp-lj/hp-lj.o
-LOADADDR      := 0x80030000
+ifdef CONFIG_SNI_RM200_PCI
+CORE_FILES	+= arch/mips/sni/sni.o
+SUBDIRS		+= arch/mips/sni arch/mips/arc
+LIBS		+= arch/mips/arc/arclib.a
+LOADADDR	:= 0x80080000
 endif
 
+#
+# Toshiba JMR-TX3927 board
+#
 ifdef CONFIG_TOSHIBA_JMR3927
-CORE_FILES    += arch/mips/jmr3927/rbhma3100/jmr3927.o arch/mips/jmr3927/common/tx3927.o
-SUBDIRS       += arch/mips/jmr3927/rbhma3100  arch/mips/jmr3927/common
-LOADADDR      += 0x80050000 
-endif                                                        
+CORE_FILES	+= arch/mips/jmr3927/rbhma3100/jmr3927.o \
+		   arch/mips/jmr3927/common/tx3927.o
+SUBDIRS		+= arch/mips/jmr3927/rbhma3100 arch/mips/jmr3927/common
+LOADADDR	:= 0x80050000
+endif
+
 
 #
 # Choosing incompatible machines durings configuration will result in
@@ -366,7 +401,7 @@
 
 BAGETBOOT = $(MAKE) -C arch/$(ARCH)/baget
 
-balo:  vmlinux
+balo: vmlinux
 	$(BAGETBOOT) balo
 
 endif
@@ -375,7 +410,7 @@
 GALILEOBOOT = $(MAKE) -C arch/$(ARCH)/galileo-boards/ev64120
 
 gboot: vmlinux
-	$(MAKE) -C arch/$(ARCH)/galileo-boards/ev64120/compressed 
+	$(MAKE) -C arch/$(ARCH)/galileo-boards/ev64120/compressed
 endif
 
 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
@@ -395,6 +430,6 @@
 
 archdep:
 	if [ ! -f $(TOPDIR)/include/asm-$(ARCH)/offset.h ]; then \
-	 touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
+		touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
 	fi;
 	@$(MAKEBOOT) dep
diff -urN linux-2.4.19-rc1/arch/mips/arc/console.c linux-2.4.19-rc2/arch/mips/arc/console.c
--- linux-2.4.19-rc1/arch/mips/arc/console.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/arc/console.c	Tue Jul 16 16:25:18 2002
@@ -6,7 +6,6 @@
  * Copyright (C) 1996 David S. Miller (dm@sgi.com)
  * Compability with board caches, Ulf Carlsson
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <asm/sgialib.h>
diff -urN linux-2.4.19-rc1/arch/mips/arc/identify.c linux-2.4.19-rc2/arch/mips/arc/identify.c
--- linux-2.4.19-rc1/arch/mips/arc/identify.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/arc/identify.c	Tue Jul 16 16:25:18 2002
@@ -7,6 +7,7 @@
  * 
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -89,7 +90,7 @@
 	} else
 		iname = (char *) (long) p->iname;
 
-	printk("ARCH: %s\n", iname);
+	printk(KERN_INFO "ARCH: %s\n", iname);
 	mach = string_to_mach(iname);
 	system_type = mach->liname;
 
diff -urN linux-2.4.19-rc1/arch/mips/arc/init.c linux-2.4.19-rc2/arch/mips/arc/init.c
--- linux-2.4.19-rc1/arch/mips/arc/init.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/arc/init.c	Tue Jul 16 16:25:18 2002
@@ -16,19 +16,18 @@
 
 /* Master romvec interface. */
 struct linux_romvec *romvec;
-PSYSTEM_PARAMETER_BLOCK sgi_pblock;
 int prom_argc;
 char **prom_argv, **prom_envp;
-unsigned short prom_vers, prom_rev;
 
 extern void prom_testtree(void);
 
 void __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
 {
 	PSYSTEM_PARAMETER_BLOCK pb;
+	unsigned short prom_vers, prom_rev;
 
 	romvec = ROMVECTOR;
-	pb = sgi_pblock = PROMBLOCK;
+	pb = PROMBLOCK;
 	prom_argc = argc;
 	prom_argv = argv;
 	prom_envp = envp;
diff -urN linux-2.4.19-rc1/arch/mips/boot/Makefile linux-2.4.19-rc2/arch/mips/boot/Makefile
--- linux-2.4.19-rc1/arch/mips/boot/Makefile	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/arch/mips/boot/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # Copyright (C) 1995, 1998, 2001 by Ralf Baechle
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 OBJS  = milo.o a.out.o
 
diff -urN linux-2.4.19-rc1/arch/mips/cobalt/Makefile linux-2.4.19-rc2/arch/mips/cobalt/Makefile
--- linux-2.4.19-rc1/arch/mips/cobalt/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/cobalt/Makefile	Tue Jul 16 16:25:18 2002
@@ -7,10 +7,7 @@
 #
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := cobalt.o
 
diff -urN linux-2.4.19-rc1/arch/mips/cobalt/int-handler.S linux-2.4.19-rc2/arch/mips/cobalt/int-handler.S
--- linux-2.4.19-rc1/arch/mips/cobalt/int-handler.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/cobalt/int-handler.S	Tue Jul 16 16:25:18 2002
@@ -9,8 +9,6 @@
  * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
  *
  */
-
-#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
 #include <asm/cobalt/cobalt.h>
diff -urN linux-2.4.19-rc1/arch/mips/cobalt/irq.c linux-2.4.19-rc2/arch/mips/cobalt/irq.c
--- linux-2.4.19-rc1/arch/mips/cobalt/irq.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/cobalt/irq.c	Tue Jul 16 16:25:18 2002
@@ -64,7 +64,7 @@
 static unsigned short irqnr_to_type[COBALT_IRQS] = 
 { CPUINT_LINE(0),  NOINT_LINE,      VIAINT_LINE,  NOINT_LINE, 
   CPUINT_LINE(1),  NOINT_LINE,      NOINT_LINE,   CPUINT_LINE(3),
-  VIAINT_LINE,     CPUINT_LINE(5),  NOINT_LINE,   NOINT_LINE,
+  VIAINT_LINE,     VIAINT_LINE,     NOINT_LINE,   NOINT_LINE,
   NOINT_LINE,      CPUINT_LINE(2),  VIAINT_LINE,  VIAINT_LINE };
 
 /*
diff -urN linux-2.4.19-rc1/arch/mips/cobalt/pci.c linux-2.4.19-rc2/arch/mips/cobalt/pci.c
--- linux-2.4.19-rc1/arch/mips/cobalt/pci.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/cobalt/pci.c	Tue Jul 16 16:25:18 2002
@@ -22,18 +22,18 @@
  
 #ifdef CONFIG_PCI
 
-static void qube_expansion_slot_bist(void)
+static void qube_expansion_slot_bist(struct pci_dev *dev)
 {
 	unsigned char ctrl;
 	int timeout = 100000;
 
-	pcibios_read_config_byte(0, (0x0a<<3), PCI_BIST, &ctrl);
+	pci_read_config_byte(dev, PCI_BIST, &ctrl);
 	if(!(ctrl & PCI_BIST_CAPABLE))
 		return;
 
-	pcibios_write_config_byte(0, (0x0a<<3), PCI_BIST, ctrl|PCI_BIST_START);
+	pci_write_config_byte(dev, PCI_BIST, ctrl|PCI_BIST_START);
 	do {
-		pcibios_read_config_byte(0, (0x0a<<3), PCI_BIST, &ctrl);
+		pci_read_config_byte(dev, PCI_BIST, &ctrl);
 		if(!(ctrl & PCI_BIST_START))
 			break;
 	} while(--timeout > 0);
@@ -42,20 +42,20 @@
 		       (ctrl & PCI_BIST_CODE_MASK));
 }
 
-static void qube_expansion_slot_fixup(void)
+static void qube_expansion_slot_fixup(struct pci_dev *dev)
 {
 	unsigned short pci_cmd;
-	unsigned long ioaddr_base = 0x108000; /* It's magic, ask Doug. */
+	unsigned long ioaddr_base = 0x10108000; /* It's magic, ask Doug. */
 	unsigned long memaddr_base = 0x12000000;
 	int i;
 
 	/* Enable bits in COMMAND so driver can talk to it. */
-	pcibios_read_config_word(0, (0x0a<<3), PCI_COMMAND, &pci_cmd);
+	pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);
 	pci_cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
-	pcibios_write_config_word(0, (0x0a<<3), PCI_COMMAND, pci_cmd);
+	pci_write_config_word(dev, PCI_COMMAND, pci_cmd);
 
 	/* Give it a working IRQ. */
-	pcibios_write_config_byte(0, (0x0a<<3), PCI_INTERRUPT_LINE, 9);
+	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, COBALT_QUBE_SLOT_IRQ);
 
 	/* Fixup base addresses, we only support I/O at the moment. */
 	for(i = 0; i <= 5; i++) {
@@ -64,14 +64,14 @@
 		unsigned long *basep = &ioaddr_base;
 
 		/* Check type first, punt if non-IO. */
-		pcibios_read_config_dword(0, (0x0a<<3), regaddr, &rval);
+		pci_read_config_dword(dev, regaddr, &rval);
 		aspace = (rval & PCI_BASE_ADDRESS_SPACE);
 		if(aspace != PCI_BASE_ADDRESS_SPACE_IO)
 			basep = &memaddr_base;
 
 		/* Figure out how much it wants, if anything. */
-		pcibios_write_config_dword(0, (0x0a<<3), regaddr, 0xffffffff);
-		pcibios_read_config_dword(0, (0x0a<<3), regaddr, &rval);
+		pci_write_config_dword(dev, regaddr, 0xffffffff);
+		pci_read_config_dword(dev, regaddr, &rval);
 
 		/* Unused? */
 		if(rval == 0)
@@ -85,9 +85,15 @@
 			alignme = 0x400;
 		rval = ((*basep + (alignme - 1)) & ~(alignme - 1));
 		*basep = (rval + size);
-		pcibios_write_config_dword(0, (0x0a<<3), regaddr, rval | aspace);
+		pci_write_config_dword(dev, regaddr, rval | aspace);
+		dev->resource[i].start = rval;
+		dev->resource[i].end = *basep - 1;
+		if(aspace == PCI_BASE_ADDRESS_SPACE_IO) {
+			dev->resource[i].start -= 0x10000000;
+			dev->resource[i].end -= 0x10000000;
+		}
 	}
-	qube_expansion_slot_bist();
+	qube_expansion_slot_bist(dev);
 }
 
 static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev)
@@ -225,15 +231,16 @@
 static void
 qube_pcibios_fixup(struct pci_dev *dev)
 {
-	unsigned int tmp;
+	if (PCI_SLOT(dev->devfn) == COBALT_PCICONF_PCISLOT) {
+		unsigned int tmp;
 
-	/* See if there is a device in the expansion slot, if so
-	 * fixup IRQ, fix base addresses, and enable master +
-	 * I/O + memory accesses in config space.
-	 */
-	pcibios_read_config_dword(0, 0x0a<<3, PCI_VENDOR_ID, &tmp);
-	if(tmp != 0xffffffff && tmp != 0x00000000)
-		qube_expansion_slot_fixup();
+		/* See if there is a device in the expansion slot, if so
+		 * discover its resources and fixup whatever we need to
+		 */
+		pci_read_config_dword(dev, PCI_VENDOR_ID, &tmp);
+		if(tmp != 0xffffffff && tmp != 0x00000000)
+			qube_expansion_slot_fixup(dev);
+	}
 }
 
 struct pci_fixup pcibios_fixups[] = {
diff -urN linux-2.4.19-rc1/arch/mips/cobalt/reset.c linux-2.4.19-rc2/arch/mips/cobalt/reset.c
--- linux-2.4.19-rc1/arch/mips/cobalt/reset.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/cobalt/reset.c	Tue Jul 16 16:25:18 2002
@@ -9,7 +9,6 @@
  * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
  *
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <asm/io.h>
diff -urN linux-2.4.19-rc1/arch/mips/cobalt/setup.c linux-2.4.19-rc2/arch/mips/cobalt/setup.c
--- linux-2.4.19-rc1/arch/mips/cobalt/setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/cobalt/setup.c	Tue Jul 16 16:25:18 2002
@@ -25,6 +25,7 @@
 #include <asm/pci.h>
 #include <asm/processor.h>
 #include <asm/reboot.h>
+#include <asm/traps.h>
 
 extern void cobalt_machine_restart(char *command);
 extern void cobalt_machine_halt(void);
@@ -71,6 +72,10 @@
 	*((volatile unsigned long *) GALILEO_CPU_MASK) = (unsigned long) 0x00000100; 
 }
 
+
+void __init bus_error_init(void) { /* nothing */ }
+
+
 int cobalt_serial_present;
 int cobalt_serial_type;
 int cobalt_is_raq;
diff -urN linux-2.4.19-rc1/arch/mips/config.in linux-2.4.19-rc2/arch/mips/config.in
--- linux-2.4.19-rc1/arch/mips/config.in	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/config.in	Tue Jul 16 16:25:18 2002
@@ -5,7 +5,7 @@
 define_bool CONFIG_MIPS y
 define_bool CONFIG_MIPS32 y
 
-mainmenu_name "Linux Kernel Configuration"
+mainmenu_name "Linux/MIPS Kernel Configuration"
 
 mainmenu_option next_comment
 comment 'Code maturity level options'
@@ -13,99 +13,128 @@
 endmenu
 
 mainmenu_option next_comment
+comment 'Loadable module support'
+bool 'Enable loadable module support' CONFIG_MODULES
+if [ "$CONFIG_MODULES" = "y" ]; then
+   bool '  Set version information on all module symbols' CONFIG_MODVERSIONS
+   bool '  Kernel module loader' CONFIG_KMOD
+fi
+endmenu
+
+mainmenu_option next_comment
 comment 'Machine selection'
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   bool 'Support for Acer PICA 1 chipset' CONFIG_ACER_PICA_61
-   bool 'Support for Algorithmics P4032 (EXPERIMENTAL)' CONFIG_ALGOR_P4032
-   bool 'Support for BAGET MIPS series (EXPERIMENTAL)' CONFIG_BAGET_MIPS
-   bool 'Support for Cobalt Server (EXPERIMENTAL)' CONFIG_MIPS_COBALT
-   bool 'Support for DECstations (EXPERIMENTAL)' CONFIG_DECSTATION
-   bool 'Support for NEC DDB Vrc-5074 (EXPERIMENTAL)' CONFIG_DDB5074
-   bool 'Support for Galileo EV64120 Evaluation board' CONFIG_MIPS_EV64120
-   if [ "$CONFIG_MIPS_EV64120" = "y" ]; then
-		  bool 'Enable Second PCI (PCI1)' CONFIG_EVB_PCI1
-      choice 'Galileo Chip Clock' \
-        "75 CONFIG_SYSCLK_75\
-         83.3 CONFIG_SYSCLK_83\
-         100 CONFIG_SYSCLK_100" CONFIG_SYSCLK_83
-   fi
-   bool 'Support for Galileo EV96100 Evaluation board' CONFIG_MIPS_EV96100
-   bool 'Support for MIPS Atlas board' CONFIG_MIPS_ATLAS
-   bool 'Support for MIPS Malta board' CONFIG_MIPS_MALTA
-   bool 'Support for Philips Nino (EXPERIMENTAL)' CONFIG_NINO
-   if [ "$CONFIG_NINO" = "y" ]; then
-      choice 'Nino Model Number' \
-        "Model-300/301/302/319 CONFIG_NINO_4MB \
-         Model-200/210/312/320/325/350/390 CONFIG_NINO_8MB \
-         Model-500/510 CONFIG_NINO_16MB" CONFIG_NINO_8MB
-   fi
-   bool 'Support for SiByte SB1250 SOC' CONFIG_SIBYTE_SB1250
-   if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
-      bool '  Support for SB1250 onchip PCI controller' CONFIG_PCI
-      bool '  Support for SB1250 profiling - SB1/SCD perf counters' CONFIG_SIBYTE_SB1250_PROF
-      bool '  Support for BCM1250 profiling using trace buffer' CONFIG_BCM1250_TBPROF
-      bool '  Remote debugging (kgdb over UART 1)' CONFIG_REMOTE_DEBUG
-      bool '  Support for SiByte SWARM board' CONFIG_SIBYTE_SWARM
-      if [ "$CONFIG_SIBYTE_SWARM" = "y" ]; then
-	 bool '    Running under simulation' CONFIG_SIMULATION
-	 bool '    Configure for L3proc Demo' CONFIG_L3DEMO
-	 int '      Maximum memory chunks' CONFIG_SIBYTE_SWARM_MAX_MEM_REGIONS 16
-         bool '      Multi-Processing support' CONFIG_SMP
-      fi
-   fi
+dep_bool 'Support for Acer PICA 1 chipset (EXPERIMENTAL)' CONFIG_ACER_PICA_61 $CONFIG_EXPERIMENTAL
+bool 'Support for Alchemy Semi PB1000 board' CONFIG_MIPS_PB1000
+if [ "$CONFIG_MIPS_PB1000" = "y" ]; then
+   bool '  Support for PCI AUTO Config' CONFIG_PCI_AUTO
+fi
+bool 'Support for Alchemy Semi PB1500 board' CONFIG_MIPS_PB1500
+dep_bool 'Support for Algorithmics P4032 (EXPERIMENTAL)' CONFIG_ALGOR_P4032 $CONFIG_EXPERIMENTAL
+dep_bool 'Support for BAGET MIPS series (EXPERIMENTAL)' CONFIG_BAGET_MIPS $CONFIG_EXPERIMENTAL
+dep_bool 'Support for Cobalt Server (EXPERIMENTAL)' CONFIG_MIPS_COBALT $CONFIG_EXPERIMENTAL
+bool 'Support for DECstations' CONFIG_DECSTATION
+dep_bool 'Support for Galileo EV64120 Evaluation board (EXPERIMENTAL)' CONFIG_MIPS_EV64120 $CONFIG_EXPERIMENTAL
+if [ "$CONFIG_MIPS_EV64120" = "y" ]; then
+   bool '  Enable Second PCI (PCI1)' CONFIG_EVB_PCI1
+   choice '  Galileo Chip Clock' \
+	"75	CONFIG_SYSCLK_75 \
+	 83.3	CONFIG_SYSCLK_83 \
+	 100	CONFIG_SYSCLK_100" 83.3
+fi
+dep_bool 'Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)' CONFIG_MIPS_EV96100 $CONFIG_EXPERIMENTAL
+bool 'Support for Globespan IVR board' CONFIG_MIPS_IVR
+bool 'Support for Hewlett Packard LaserJet board' CONFIG_HP_LASERJET
+bool 'Support for ITE 8172G board' CONFIG_MIPS_ITE8172
+if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
+   bool '  Support for older IT8172 (Rev C)' CONFIG_IT8172_REVC
 fi
-bool 'Support for Mips Magnum 4000' CONFIG_MIPS_MAGNUM_4000
+dep_bool 'Support for MIPS Atlas board (EXPERIMENTAL)' CONFIG_MIPS_ATLAS $CONFIG_EXPERIMENTAL
+bool 'Support for MIPS Magnum 4000' CONFIG_MIPS_MAGNUM_4000
+dep_bool 'Support for MIPS Malta board (EXPERIMENTAL)' CONFIG_MIPS_MALTA $CONFIG_EXPERIMENTAL
 bool 'Support for Momentum Ocelot board' CONFIG_MOMENCO_OCELOT
+dep_bool 'Support for NEC DDB Vrc-5074 (EXPERIMENTAL)' CONFIG_DDB5074 $CONFIG_EXPERIMENTAL
 bool 'Support for NEC DDB Vrc-5476' CONFIG_DDB5476
 bool 'Support for NEC DDB Vrc-5477' CONFIG_DDB5477
 bool 'Support for NEC Osprey board' CONFIG_NEC_OSPREY
 bool 'Support for Olivetti M700-10' CONFIG_OLIVETTI_M700
-bool 'Support for SGI IP22' CONFIG_SGI_IP22
-bool 'Support for SNI RM200 PCI' CONFIG_SNI_RM200_PCI
-bool 'Support for ITE 8172G board' CONFIG_MIPS_ITE8172
-if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
-   bool '    Support for older IT8172 (Rev C)' CONFIG_IT8172_REVC
+dep_bool 'Support for Philips Nino (EXPERIMENTAL)' CONFIG_NINO $CONFIG_EXPERIMENTAL
+if [ "$CONFIG_NINO" = "y" ]; then
+   choice 'Nino Model Number' \
+	"Model-300/301/302/319			CONFIG_NINO_4MB \
+	 Model-200/210/312/320/325/350/390	CONFIG_NINO_8MB \
+	 Model-500/510				CONFIG_NINO_16MB" Model-200
 fi
-bool 'Support for Globespan IVR board' CONFIG_MIPS_IVR
-bool 'Support for Alchemy Semi PB1000 board' CONFIG_MIPS_PB1000
-if [ "$CONFIG_MIPS_PB1000" = "y" ]; then
-   bool '    Support for PCI AUTO Config' CONFIG_PCI_AUTO
+bool 'Support for SGI IP22 (Indy/Indigo2)' CONFIG_SGI_IP22
+dep_bool 'Support for SiByte SB1250 SOC (EXPERIMENTAL)' CONFIG_SIBYTE_SB1250 $CONFIG_EXPERIMENTAL
+if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
+   bool '  Support for SB1250 onchip PCI controller' CONFIG_PCI
+   bool '  Support for SB1250 profiling - SB1/SCD perf counters' CONFIG_SIBYTE_SB1250_PROF
+   bool '  Support for BCM1250 profiling using trace buffer' CONFIG_BCM1250_TBPROF
+   bool '  Remote debugging (kgdb over UART 1)' CONFIG_REMOTE_DEBUG
+   bool '  Support for SiByte SWARM board' CONFIG_SIBYTE_SWARM
+   if [ "$CONFIG_SIBYTE_SWARM" = "y" ]; then
+      bool '    Running under simulation' CONFIG_SIMULATION
+      bool '    Configure for L3proc Demo' CONFIG_L3DEMO
+      int '    Maximum memory chunks' CONFIG_SIBYTE_SWARM_MAX_MEM_REGIONS 16
+      bool '    Multi-Processing support' CONFIG_SMP
+   fi
 fi
-bool 'Support for Alchemy Semi PB1500 board' CONFIG_MIPS_PB1500
+bool 'Support for SNI RM200 PCI' CONFIG_SNI_RM200_PCI
 bool 'Support for Toshiba JMR-TX3927 board' CONFIG_TOSHIBA_JMR3927
-bool 'Support for Hewlett Packard LaserJet board' CONFIG_HP_LASERJET
 
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-  bool 'High Memory Support (experimental)' CONFIG_HIGHMEM
-fi
+dep_bool 'High Memory Support (EXPERIMENTAL)' CONFIG_HIGHMEM $CONFIG_EXPERIMENTAL
 
 define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
 define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
 
 #
-# Select some configuration options automatically for certain systems.
+# Select some configuration options automatically based on user selections.
 #
 
-define_bool CONFIG_MCA n
-define_bool CONFIG_SBUS n
-
-if [ "$CONFIG_DECSTATION" = "y" ]; then
+if [ "$CONFIG_ACER_PICA_61" = "y" ]; then
+   define_bool CONFIG_ARC32 y
+   define_bool CONFIG_I8259 y
+   define_bool CONFIG_ISA y
+   define_bool CONFIG_MIPS_JAZZ y
    define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PC_KEYB y
+   define_bool CONFIG_ROTTEN_IRQ y
+   define_bool CONFIG_OLD_TIME_C y
 fi
-
-if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
+if [ "$CONFIG_MIPS_PB1000" = "y" ]; then
+   define_bool CONFIG_MIPS_AU1000 y
    define_bool CONFIG_NEW_IRQ y
-   define_bool CONFIG_SWAP_IO_SPACE y
-fi
-
-if [ "$CONFIG_MIPS_EV96100" = "y" ]; then
    define_bool CONFIG_PCI y
-   define_bool CONFIG_MIPS_GT96100 y
-   define_bool CONFIG_NEW_IRQ y
    define_bool CONFIG_NEW_PCI y
    define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PC_KEYB y
+   define_int  MAX_HWIFS 1
+fi
+if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
+   define_bool CONFIG_MIPS_AU1000 y
+   define_bool CONFIG_NEW_IRQ y
+   define_bool CONFIG_PCI y
    define_bool CONFIG_PCI_AUTO y
-   define_bool CONFIG_SWAP_IO_SPACE y
+   define_bool CONFIG_NEW_PCI y
+   define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PC_KEYB y
+fi
+if [ "$CONFIG_ALGOR_P4032" = "y" ]; then
+   define_bool CONFIG_PCI y
+   define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_OLD_TIME_C y
+fi
+if [ "$CONFIG_MIPS_COBALT" = "y" ]; then
+   define_bool CONFIG_COBALT_LCD y
+   define_bool CONFIG_PCI y
+   define_bool CONFIG_NEW_IRQ y
+   define_bool CONFIG_NEW_TIME_C y
+   define_bool CONFIG_NONCOHERENT_IO y
+fi
+if [ "$CONFIG_DECSTATION" = "y" ]; then
+   define_bool CONFIG_IRQ_CPU y
+   define_bool CONFIG_NEW_IRQ y
+   define_bool CONFIG_NONCOHERENT_IO y
 fi
 if [ "$CONFIG_MIPS_EV64120" = "y" ]; then
    define_bool CONFIG_PCI y
@@ -114,33 +143,44 @@
    define_bool CONFIG_NONCOHERENT_IO y
    define_bool CONFIG_OLD_TIME_C y
 fi
-
-if [ "$CONFIG_ALGOR_P4032" = "y" ]; then
+if [ "$CONFIG_MIPS_EV96100" = "y" ]; then
    define_bool CONFIG_PCI y
+   define_bool CONFIG_MIPS_GT96100 y
+   define_bool CONFIG_NEW_IRQ y
+   define_bool CONFIG_NEW_PCI y
    define_bool CONFIG_NONCOHERENT_IO y
-   define_bool CONFIG_OLD_TIME_C y
+   define_bool CONFIG_PCI_AUTO y
+   define_bool CONFIG_SWAP_IO_SPACE y
 fi
-if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o \
-     "$CONFIG_OLIVETTI_M700" = "y" ]; then
-   define_bool CONFIG_ARC32 y
-   define_bool CONFIG_I8259 y
-   define_bool CONFIG_ISA y
-   define_bool CONFIG_FB y
-   define_bool CONFIG_FB_G364 y	
-   define_bool CONFIG_MIPS_JAZZ y
-   define_bool CONFIG_NONCOHERENT_IO y
+if [ "$CONFIG_MIPS_IVR" = "y" ]; then
+   define_bool CONFIG_PCI y
    define_bool CONFIG_PC_KEYB y
-   define_bool CONFIG_OLD_TIME_C y
+   define_bool CONFIG_NEW_PCI y
+   define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PCI_AUTO y
+   define_bool CONFIG_IT8172_CIR y
+   define_bool CONFIG_NEW_IRQ y
+   define_bool CONFIG_NEW_TIME_C y
 fi
-if [ "$CONFIG_ACER_PICA_61" = "y" ]; then
-   define_bool CONFIG_ARC32 y
-   define_bool CONFIG_I8259 y
-   define_bool CONFIG_ISA y
-   define_bool CONFIG_MIPS_JAZZ y
+if [ "$CONFIG_HP_LASERJET" = "y" ]; then
+   define_bool CONFIG_IRQ_CPU y
+   define_bool CONFIG_NEW_TIME_C y
+   define_bool CONFIG_NEW_IRQ y
+   define_bool CONFIG_NEW_PCI y
    define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PCI y
+   #not yet define_bool CONFIG_PCI_AUTO y
+fi
+if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
+   define_bool CONFIG_PCI y
+   define_bool CONFIG_IT8712 y
    define_bool CONFIG_PC_KEYB y
-   define_bool CONFIG_ROTTEN_IRQ y
-   define_bool CONFIG_OLD_TIME_C y
+   define_bool CONFIG_NEW_PCI y
+   define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PCI_AUTO y
+   define_bool CONFIG_IT8172_CIR y
+   define_bool CONFIG_NEW_IRQ y
+   define_bool CONFIG_NEW_TIME_C y
 fi
 if [ "$CONFIG_MIPS_ATLAS" = "y" ]; then
    define_bool CONFIG_NEW_IRQ y
@@ -149,6 +189,18 @@
    define_bool CONFIG_PCI y
    define_bool CONFIG_SWAP_IO_SPACE y
 fi
+if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o \
+     "$CONFIG_OLIVETTI_M700" = "y" ]; then
+   define_bool CONFIG_ARC32 y
+   define_bool CONFIG_I8259 y
+   define_bool CONFIG_ISA y
+   define_bool CONFIG_FB y
+   define_bool CONFIG_FB_G364 y
+   define_bool CONFIG_MIPS_JAZZ y
+   define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PC_KEYB y
+   define_bool CONFIG_OLD_TIME_C y
+fi
 if [ "$CONFIG_MIPS_MALTA" = "y" ]; then
    define_bool CONFIG_I8259 y
    define_bool CONFIG_PCI y
@@ -157,6 +209,7 @@
    define_bool CONFIG_NEW_TIME_C y
    define_bool CONFIG_NONCOHERENT_IO y
    define_bool CONFIG_SWAP_IO_SPACE y
+   define_bool CONFIG_PC_KEYB y
 fi
 if [ "$CONFIG_MOMENCO_OCELOT" = "y" ]; then
    define_bool CONFIG_PCI y
@@ -166,26 +219,6 @@
    define_bool CONFIG_NONCOHERENT_IO y
    define_bool CONFIG_OLD_TIME_C y
 fi
-if [ "$CONFIG_SGI_IP22" = "y" ]; then
-   define_bool CONFIG_ARC32 y
-   define_bool CONFIG_BOARD_SCACHE y
-   define_bool CONFIG_IRQ_CPU y
-   define_bool CONFIG_PC_KEYB y
-   define_bool CONFIG_SGI y
-   define_bool CONFIG_NEW_IRQ y
-   define_bool CONFIG_NEW_TIME_C y
-   define_bool CONFIG_NONCOHERENT_IO y
-fi
-if [ "$CONFIG_SNI_RM200_PCI" = "y" ]; then
-   define_bool CONFIG_ARC32 y
-   define_bool CONFIG_I8259 y
-   define_bool CONFIG_ISA y
-   define_bool CONFIG_NEW_IRQ y
-   define_bool CONFIG_NONCOHERENT_IO y
-   define_bool CONFIG_OLD_TIME_C y
-   define_bool CONFIG_PC_KEYB y
-   define_bool CONFIG_PCI y
-fi
 if [ "$CONFIG_DDB5074" = "y" ]; then
    define_bool CONFIG_HAVE_STD_PC_SERIAL_PORT y
    define_bool CONFIG_I8259 y
@@ -230,100 +263,52 @@
    define_bool CONFIG_DUMMY_KEYB y
    define_bool CONFIG_SCSI n
 fi
-if [ "$CONFIG_MIPS_COBALT" = "y" ]; then
-   define_bool CONFIG_COBALT_LCD y
-   define_bool CONFIG_PCI y
+if [ "$CONFIG_NINO" = "y" ]; then
    define_bool CONFIG_NEW_IRQ y
    define_bool CONFIG_NEW_TIME_C y
    define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_PC_KEYB y
 fi
-if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
-   define_bool CONFIG_PCI y
-   define_bool CONFIG_IT8712 y
+if [ "$CONFIG_SGI_IP22" = "y" ]; then
+   define_bool CONFIG_ARC32 y
+   define_bool CONFIG_BOARD_SCACHE y
+   define_bool CONFIG_IRQ_CPU y
    define_bool CONFIG_PC_KEYB y
-   define_bool CONFIG_NEW_PCI y
-   define_bool CONFIG_NONCOHERENT_IO y
-   define_bool CONFIG_PCI_AUTO y
-   define_bool CONFIG_IT8172_CIR y
+   define_bool CONFIG_SGI y
    define_bool CONFIG_NEW_IRQ y
    define_bool CONFIG_NEW_TIME_C y
-fi
-if [ "$CONFIG_MIPS_IVR" = "y" ]; then
-   define_bool CONFIG_PCI y
-   define_bool CONFIG_PC_KEYB y
-   define_bool CONFIG_NEW_PCI y
    define_bool CONFIG_NONCOHERENT_IO y
-   define_bool CONFIG_PCI_AUTO y
-   define_bool CONFIG_IT8172_CIR y
+fi
+if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
    define_bool CONFIG_NEW_IRQ y
    define_bool CONFIG_NEW_TIME_C y
+   define_bool CONFIG_DUMMY_KEYB y
+   define_bool CONFIG_SWAP_IO_SPACE y
 fi
-if [ "$CONFIG_MIPS_PB1000" = "y" ]; then
-   define_bool CONFIG_MIPS_AU1000 y
+if [ "$CONFIG_SNI_RM200_PCI" = "y" ]; then
+   define_bool CONFIG_ARC32 y
+   define_bool CONFIG_I8259 y
+   define_bool CONFIG_ISA y
    define_bool CONFIG_NEW_IRQ y
-   define_bool CONFIG_PCI y
-   define_bool CONFIG_NEW_PCI y
    define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_OLD_TIME_C y
    define_bool CONFIG_PC_KEYB y
-   define_int  MAX_HWIFS 1
+   define_bool CONFIG_PCI y
 fi
-if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
-   define_bool CONFIG_MIPS_AU1000 y
-   define_bool CONFIG_NEW_IRQ y
+if [ "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
+   define_bool CONFIG_TOSHIBA_BOARDS y
    define_bool CONFIG_PCI y
-   define_bool CONFIG_PCI_AUTO y
    define_bool CONFIG_NEW_PCI y
-   define_bool CONFIG_NONCOHERENT_IO y
-   define_bool CONFIG_PC_KEYB y
-fi
-if [ "$CONFIG_NINO" = "y" ]; then
+   define_bool CONFIG_PCI_AUTO y
    define_bool CONFIG_NEW_IRQ y
    define_bool CONFIG_NEW_TIME_C y
    define_bool CONFIG_NONCOHERENT_IO y
+   define_bool CONFIG_SWAP_IO_SPACE y
    define_bool CONFIG_PC_KEYB y
 fi
-if [ "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
-   define_bool CONFIG_NONCOHERENT_IO y
-fi
-if [ "$CONFIG_HP_LASERJET" = "y" ]; then
-   define_bool CONFIG_IRQ_CPU y
-   define_bool CONFIG_NEW_TIME_C y
-   define_bool CONFIG_NEW_IRQ y
-   define_bool CONFIG_NEW_PCI y
-   define_bool CONFIG_NONCOHERENT_IO y
-   define_bool CONFIG_PCI y
-   #not yet define_bool CONFIG_PCI_AUTO y
-fi
-
-if [ "$CONFIG_SIBYTE_SWARM" = "y" ]; then
-   define_bool CONFIG_NEW_TIME_C y
-fi
-
-if [ "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
-       define_bool CONFIG_TOSHIBA_BOARDS y
-       define_bool CONFIG_PCI y 
-       define_bool CONFIG_NEW_PCI y
-       define_bool CONFIG_PCI_AUTO y
-       define_bool CONFIG_NEW_IRQ y
-       define_bool CONFIG_NEW_TIME_C y
-       define_bool CONFIG_SWAP_IO_SPACE y
-       define_bool CONFIG_PC_KEYB y
-fi                             
 
-if [ "$CONFIG_ISA" != "y" ]; then
-   define_bool CONFIG_ISA n
-   define_bool CONFIG_EISA n
-else
-   define_bool CONFIG_EISA y
-fi
-endmenu
-
-mainmenu_option next_comment
-comment 'Loadable module support'
-bool 'Enable loadable module support' CONFIG_MODULES
-if [ "$CONFIG_MODULES" = "y" ]; then
-   bool '  Set version information on all module symbols' CONFIG_MODVERSIONS
-   bool '  Kernel module loader' CONFIG_KMOD
+if [ "$CONFIG_MIPS_AU1000" != "y" ]; then
+   define_bool CONFIG_MIPS_AU1000 n
 fi
 endmenu
 
@@ -331,28 +316,30 @@
 comment 'CPU selection'
 
 choice 'CPU type' \
-	"R3000 CONFIG_CPU_R3000	\
-	 R39XX CONFIG_CPU_TX39XX	\
-	 R6000 CONFIG_CPU_R6000	\
-	 R41xx CONFIG_CPU_VR41XX \
-	 R4300 CONFIG_CPU_R4300	\
-	 R4x00 CONFIG_CPU_R4X00	\
-	 R49XX CONFIG_CPU_TX49XX	\
-	 R5000 CONFIG_CPU_R5000	\
-	 R5432 CONFIG_CPU_R5432 \
-	 RM7000 CONFIG_CPU_RM7000 \
-	 R52xx CONFIG_CPU_NEVADA \
-	 R10000 CONFIG_CPU_R10000 \
-	 SB1    CONFIG_CPU_SB1    \
-	 MIPS32 CONFIG_CPU_MIPS32 \
-	 MIPS64 CONFIG_CPU_MIPS64" R4x00
+	"R3000	CONFIG_CPU_R3000 \
+	 R39XX	CONFIG_CPU_TX39XX \
+	 R6000	CONFIG_CPU_R6000 \
+	 R41xx	CONFIG_CPU_VR41XX \
+	 R4300	CONFIG_CPU_R4300 \
+	 R4x00	CONFIG_CPU_R4X00 \
+	 R49XX	CONFIG_CPU_TX49XX \
+	 R5000	CONFIG_CPU_R5000 \
+	 R5432	CONFIG_CPU_R5432 \
+	 RM7000	CONFIG_CPU_RM7000 \
+	 R52xx	CONFIG_CPU_NEVADA \
+	 R10000	CONFIG_CPU_R10000 \
+	 SB1	CONFIG_CPU_SB1 \
+	 MIPS32	CONFIG_CPU_MIPS32 \
+	 MIPS64	CONFIG_CPU_MIPS64" R4x00
 
 if [ "$CONFIG_CPU_MIPS32" = "y" ]; then
    define_bool CONFIG_CPU_HAS_PREFETCH y
+   bool '  Support for Virtual Tagged I-cache' CONFIG_VTAG_ICACHE
 fi
 
 if [ "$CONFIG_CPU_MIPS64" = "y" ]; then
    define_bool CONFIG_CPU_HAS_PREFETCH y
+   bool '  Support for Virtual Tagged I-cache' CONFIG_VTAG_ICACHE
 fi
 
 if [ "$CONFIG_CPU_RM7000" = "y" ]; then
@@ -373,7 +360,7 @@
      "$CONFIG_CPU_SB1" = "y" -o \
      "$CONFIG_CPU_MIPS32" = "y" -o \
      "$CONFIG_CPU_MIPS64" = "y" ]; then
-   bool '  Support for 64-bit physical addresspace' CONFIG_64BIT_PHYS_ADDR
+   bool '  Support for 64-bit physical address space' CONFIG_64BIT_PHYS_ADDR
 fi
 
 bool 'Override CPU Options' CONFIG_CPU_ADVANCED
@@ -421,33 +408,38 @@
 
 if [ "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
        bool 'DS1742 BRAM/RTC support' CONFIG_RTC_DS1742
-fi                             
-
-if [ "$CONFIG_PROC_FS" = "y" ]; then
-   define_bool CONFIG_KCORE_ELF y
 fi
-define_bool CONFIG_ELF_KERNEL y
 
 if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then
-   bool 'Include IRIX binary compatibility' CONFIG_BINFMT_IRIX 
-   bool 'Include forward keyboard' CONFIG_FORWARD_KEYBOARD 
+   bool 'Include IRIX binary compatibility' CONFIG_BINFMT_IRIX
+   bool 'Include forward keyboard' CONFIG_FORWARD_KEYBOARD
 fi
 
 if [ "$CONFIG_ARC32" = "y" ]; then
    bool 'ARC console support' CONFIG_ARC_CONSOLE
 fi
 
-define_bool CONFIG_BINFMT_AOUT n
-define_bool CONFIG_BINFMT_ELF y
-tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
-if [ "$CONFIG_MIPS_AU1000" = "y" ]; then
-dep_bool 'Power Management support (experimental)' CONFIG_PM $CONFIG_EXPERIMENTAL
-fi
-
 bool 'Networking support' CONFIG_NET
 
+if [ "$CONFIG_PCI" != "y" ]; then
+   define_bool CONFIG_PCI n
+fi
+
 source drivers/pci/Config.in
 
+if [ "$CONFIG_ISA" != "y" ]; then
+   define_bool CONFIG_ISA n
+   define_bool CONFIG_EISA n
+else
+   define_bool CONFIG_EISA y
+fi
+
+dep_bool 'TURBOchannel support' CONFIG_TC $CONFIG_DECSTATION
+#dep_bool 'Access.Bus support' CONFIG_ACCESSBUS $CONFIG_TC
+
+define_bool CONFIG_MCA n
+define_bool CONFIG_SBUS n
+
 bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
 
 if [ "$CONFIG_HOTPLUG" = "y" ] ; then
@@ -461,28 +453,26 @@
 bool 'System V IPC' CONFIG_SYSVIPC
 bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
 bool 'Sysctl support' CONFIG_SYSCTL
+define_bool CONFIG_KCORE_ELF y
+define_bool CONFIG_KCORE_AOUT n
+define_bool CONFIG_BINFMT_AOUT n
+define_bool CONFIG_BINFMT_ELF y
+tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
 
-if [ "$CONFIG_DECSTATION" = "y" ]; then
-    bool 'TURBOchannel support' CONFIG_TC
-#    if [ "$CONFIG_TC" = "y" ]; then
-#	bool ' Access.Bus support' CONFIG_ACCESSBUS
-#    fi
-fi
+dep_bool 'Power Management support (EXPERIMENTAL)' CONFIG_PM $CONFIG_EXPERIMENTAL $CONFIG_MIPS_AU1000
 endmenu
 
-if [ "$CONFIG_ISA" = "y" ]; then
-   source drivers/pnp/Config.in
-fi
-
 source drivers/mtd/Config.in
 
 source drivers/parport/Config.in
 
+source drivers/pnp/Config.in
+
 source drivers/block/Config.in
 if [ "$CONFIG_BLK_DEV_INITRD" = "y" ]; then
    mainmenu_option next_comment
    comment 'MIPS initrd options'
-   bool '  Embed root filesystem ramdisk into the kernel' CONFIG_EMBEDDED_RAMDISK 
+   bool '  Embed root filesystem ramdisk into the kernel' CONFIG_EMBEDDED_RAMDISK
    endmenu
 fi
 
@@ -494,14 +484,13 @@
 
 source drivers/telephony/Config.in
 
-if [ "$CONFIG_SGI_IP22" != "y" -a \
-     "$CONFIG_DECSTATION" != "y" ]; then
+if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" ]; then
 
    mainmenu_option next_comment
    comment 'ATA/IDE/MFM/RLL support'
-    
+
    tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
-    
+
    if [ "$CONFIG_IDE" != "n" ]; then
       source drivers/ide/Config.in
    else
@@ -521,8 +510,7 @@
 fi
 endmenu
 
-if [ "$CONFIG_DECSTATION" != "y" -a \
-     "$CONFIG_SGI_IP22" != "y" ]; then
+if [ "$CONFIG_PCI" = "y" ]; then
    source drivers/message/i2o/Config.in
 fi
 
@@ -534,7 +522,7 @@
    if [ "$CONFIG_NETDEVICES" = "y" ]; then
       source drivers/net/Config.in
       if [ "$CONFIG_ATM" = "y" ]; then
-         source drivers/atm/Config.in
+	 source drivers/atm/Config.in
       fi
    fi
    endmenu
@@ -544,43 +532,43 @@
 
 source net/irda/Config.in
 
-mainmenu_option next_comment
-comment 'ISDN subsystem'
 if [ "$CONFIG_NET" != "n" ]; then
+   mainmenu_option next_comment
+   comment 'ISDN subsystem'
+
    tristate 'ISDN support' CONFIG_ISDN
    if [ "$CONFIG_ISDN" != "n" ]; then
       source drivers/isdn/Config.in
    fi
+   endmenu
 fi
-endmenu
 
-mainmenu_option next_comment
-comment 'Old CD-ROM drivers (not SCSI, not IDE)'
+if [ "$CONFIG_ISA" = "y" ]; then
+   mainmenu_option next_comment
+   comment 'Old CD-ROM drivers (not SCSI, not IDE)'
 
-bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
-if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
-   source drivers/cdrom/Config.in
+   bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
+   if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
+      source drivers/cdrom/Config.in
+   fi
+   endmenu
 fi
-endmenu
 
 source drivers/char/Config.in
 
+#source drivers/misc/Config.in
+
 source drivers/media/Config.in
 
 if [ "$CONFIG_DECSTATION" = "y" ]; then
    mainmenu_option next_comment
    comment 'DECStation Character devices'
+
    tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL
-   if [ "$CONFIG_SERIAL" = "y" ]; then
-      bool 'DZ11 Serial Support' CONFIG_DZ
-      if [ "$CONFIG_TC" = "y" ]; then
-	 bool 'Z85C30 Serial Support' CONFIG_ZS
-      fi
-   bool '   Support for console on serial port' CONFIG_SERIAL_CONSOLE
-   fi
-#   if [ "$CONFIG_ACCESSBUS" = "y" ]; then
-#      bool 'MAXINE Access.Bus mouse (VSXXX-BB/GB) support' CONFIG_DTOP_MOUSE
-#   fi
+   dep_bool '  DZ11 Serial Support' CONFIG_DZ $CONFIG_SERIAL
+   dep_bool '  Z85C30 Serial Support' CONFIG_ZS $CONFIG_SERIAL $CONFIG_TC
+   dep_bool '  Support for console on serial port' CONFIG_SERIAL_CONSOLE $CONFIG_SERIAL
+#   dep_bool 'MAXINE Access.Bus mouse (VSXXX-BB/GB) support' CONFIG_DTOP_MOUSE $CONFIG_ACCESSBUS
    bool 'Enhanced Real Time Clock Support' CONFIG_RTC
    endmenu
 fi
@@ -590,11 +578,10 @@
    comment 'SGI Character devices'
    if [ "$CONFIG_VT" = "y" ]; then
       tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
-      if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
-	 define_bool CONFIG_DUMMY_CONSOLE y
-      else
+      if [ "$CONFIG_SGI_NEWPORT_CONSOLE" = "y" ]; then
 	 define_bool CONFIG_FONT_8x16 y
       fi
+      define_bool CONFIG_DUMMY_CONSOLE y
    fi
    endmenu
 fi
@@ -612,22 +599,23 @@
    endmenu
 fi
 
-if [ "$CONFIG_DECSTATION" != "y" ]; then
-   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
-   fi
-   endmenu
+tristate 'Sound card support' CONFIG_SOUND
+if [ "$CONFIG_SOUND" != "n" ]; then
+   source drivers/sound/Config.in
 fi
+endmenu
 
 if [ "$CONFIG_SGI_IP22" = "y" ]; then
    source drivers/sgi/Config.in
 fi
 
 source drivers/usb/Config.in
+
+source net/bluetooth/Config.in
+
 source drivers/input/Config.in
 
 mainmenu_option next_comment
diff -urN linux-2.4.19-rc1/arch/mips/dec/Makefile linux-2.4.19-rc2/arch/mips/dec/Makefile
--- linux-2.4.19-rc1/arch/mips/dec/Makefile	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/arch/mips/dec/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,17 +6,15 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(AFLAGS) $< -o $@
-.S.o:
-	$(CC) $(AFLAGS) -c $< -o $@
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := dec.o
 
 all: dec.o
 
-export-objs := wbflush.o
-obj-y	 := int-handler.o setup.o irq.o time.o reset.o rtc-dec.o wbflush.o
+export-objs := setup.o wbflush.o
+obj-y	 := int-handler.o ioasic-irq.o kn02-irq.o reset.o rtc-dec.o setup.o \
+	time.o wbflush.o
 
 obj-$(CONFIG_PROM_CONSOLE)	+= promcon.o
 
diff -urN linux-2.4.19-rc1/arch/mips/dec/boot/Makefile linux-2.4.19-rc2/arch/mips/dec/boot/Makefile
--- linux-2.4.19-rc1/arch/mips/dec/boot/Makefile	Fri Apr 13 20:26:07 2001
+++ linux-2.4.19-rc2/arch/mips/dec/boot/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 netboot: all
 	mipsel-linux-ld -N -G 0 -T ld.ecoff ../../boot/zImage \
diff -urN linux-2.4.19-rc1/arch/mips/dec/int-handler.S linux-2.4.19-rc2/arch/mips/dec/int-handler.S
--- linux-2.4.19-rc1/arch/mips/dec/int-handler.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/dec/int-handler.S	Tue Jul 16 16:25:18 2002
@@ -2,7 +2,7 @@
  * arch/mips/dec/int-handler.S
  *
  * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen
- * Copyright (C) 2000, 2001  Maciej W. Rozycki
+ * Copyright (C) 2000, 2001, 2002  Maciej W. Rozycki
  *
  * Written by Ralf Baechle and Andreas Busse, modified for DECStation
  * support by Paul Antoine and Harald Koerfgen.
@@ -10,6 +10,8 @@
  * completly rewritten:
  * Copyright (C) 1998 Harald Koerfgen
  *
+ * Rewritten extensively for controller-driven IRQ support
+ * by Maciej W. Rozycki.
  */
 #include <asm/asm.h>
 #include <asm/regdef.h>
@@ -17,12 +19,13 @@
 #include <asm/stackframe.h>
 #include <asm/addrspace.h>
 
+#include <asm/dec/interrupts.h>
+#include <asm/dec/ioasic_addrs.h>
+#include <asm/dec/ioasic_ints.h>
 #include <asm/dec/kn01.h>
 #include <asm/dec/kn02.h>
 #include <asm/dec/kn02xa.h>
 #include <asm/dec/kn03.h>
-#include <asm/dec/ioasic_addrs.h>
-#include <asm/dec/interrupts.h>
 
 
 		.text
@@ -84,7 +87,7 @@
  *             4        TurboChannel Slot 2
  *             5        TurboChannel Slot 3 (ASIC)
  *             6        Halt button
- *             7        FPU
+ *             7        FPU/R4k timer
  *
  * DS5000/2x's, aka kn02ca, aka maxine:
  *
@@ -97,7 +100,7 @@
  *             4        I/O write timeout
  *             5        TurboChannel (ASIC)
  *             6        Halt Keycode from Access.Bus keyboard (CTRL-ALT-ENTER)
- *             7        FPU
+ *             7        FPU/R4k timer
  *
  * DS5000/2xx's, aka kn03, aka 3maxplus:
  *
@@ -110,22 +113,11 @@
  *             4        Reserved
  *             5        Memory
  *             6        Halt Button
- *             7        FPU
- *
- * We handle the IRQ according to _our_ priority.
- * Priority is:
- *
- * Highest ----     RTC
- *                  SCSI (if separate from TC)
- *                  Ethernet (if separate from TC)
- *		    Serial (if separate from TC)
- *                  TurboChannel (if there is one!)
- *                  Memory Controller (execept kmin)
- * Lowest  ----     Halt (if there is one!)
- *
- * then we just return, if multiple IRQs are pending then we will just take
- * another exception, big deal.
+ *             7        FPU/R4k timer
  *
+ * We handle the IRQ according to _our_ priority (see setup.c),
+ * then we just return.  If multiple IRQs are pending then we will
+ * just take another exception, big deal.
  */
 		.align	5
 		NESTED(decstation_handle_int, PT_SIZE, ra)
@@ -139,87 +131,135 @@
 		 * Get pending Interrupts
 		 */
 		mfc0	t0,CP0_CAUSE		# get pending interrupts
-		mfc0	t2,CP0_STATUS
+		mfc0	t1,CP0_STATUS
+		lw	t2,cpu_fpu_mask
 		andi	t0,ST0_IM		# CAUSE.CE may be non-zero!
-		and	t0,t2			# isolate allowed ones
+		and	t0,t1			# isolate allowed ones
 
 		beqz	t0,spurious
 
-		 andi	t2,t0,DEC_IE_FPU
+		 and	t2,t0
 		bnez	t2,fpu			# handle FPU immediately
 
 		/*
 		 * Find irq with highest priority
 		 */
-		 la	t1,cpu_mask_tbl
+		 la	t1,cpu_mask_nr_tbl
 1:		lw	t2,(t1)
-		move	t3,t0
-		and	t3,t2
-		beq	t3,zero,1b
-		 addu	t1,PTRSIZE		# delay slot
+		nop
+		and	t2,t0
+		beqz	t2,1b
+		 addu	t1,2*PTRSIZE		# delay slot
 
 		/*
 		 * Do the low-level stuff
 		 */
-		lw	a0,%lo(cpu_irq_nr-cpu_mask_tbl-PTRSIZE)(t1)
-		lw	t0,%lo(cpu_ivec_tbl-cpu_mask_tbl-PTRSIZE)(t1)
-		bgez	a0, handle_it		# irq_nr >= 0?
-						# irq_nr < 0: t0 contains an address
+		lw	a0,(-PTRSIZE)(t1)
+		nop
+		bgez	a0,handle_it		# irq_nr >= 0?
+						# irq_nr < 0: it is an address
 		 nop
-		jr	t0
-		 nop				# delay slot
+		jr	a0
+						# a trick to save a branch:
+		 lui	t2,KN03_IOASIC_BASE>>16	# upper part of IOASIC Address
 
 /*
  * Handle "IRQ Controller" Interrupts
  * Masked Interrupts are still visible and have to be masked "by hand".
  */
-		FEXPORT(kn02_io_int)
-kn02_io_int:					# 3max
+		FEXPORT(kn02_io_int)		# 3max
 		lui	t0,KN02_CSR_ADDR>>16	# get interrupt status and mask
 		lw	t0,(t0)
-		la	t1,asic_mask_tbl
-		move	t3,t0
-		sll	t3,16			# shift interrupt status
-		b	find_int
-		 and	t0,t3			# mask out allowed ones
-
-		FEXPORT(kn03_io_int)
-kn03_io_int:					# 3max+
-		lui	t2,KN03_IOASIC_BASE>>16	# upper part of IOASIC Address
-		lw	t0,SIR(t2)		# get status: IOASIC isr
-		lw	t3,SIMR(t2)		# get mask:   IOASIC isrm
-		la	t1,asic_mask_tbl
-		b	find_int
-		 and	t0,t3			# mask out allowed ones
-
-		FEXPORT(kn02xa_io_int)
-kn02xa_io_int:					# 3min/maxine
-		lui	t2,KN02XA_IOASIC_BASE>>16		
-						# upper part of IOASIC Address
+		nop
+		andi	t1,t0,KN02_IRQ_ALL
+		b	1f
+		 srl	t0,16			# shift interrupt mask
+
+		FEXPORT(kn02xa_io_int)		# 3min/maxine
+		lui	t2,KN02XA_IOASIC_BASE>>16 # upper part of IOASIC Address
+
+		FEXPORT(kn03_io_int)		# 3max+ (t2 loaded earlier)
 		lw	t0,SIR(t2)		# get status: IOASIC isr
-		lw	t3,SIMR(t2)		# get mask:   IOASIC isrm
-		la	t1,asic_mask_tbl
-		and	t0,t3
+		lw	t1,SIMR(t2)		# get mask:   IOASIC isrm
+		nop
+
+1:		and	t0,t1			# mask out allowed ones
+
+		beqz	t0,spurious
 
 		/*
 		 * Find irq with highest priority
 		 */
-find_int:	beqz	t0,spurious
-
-1:		 lw	t2,(t1)
-		move	t3,t0
-		and	t3,t2
-		beq	zero,t3,1b
-		 addu	t1,PTRSIZE		# delay slot
+		 la	t1,asic_mask_nr_tbl
+2:		lw	t2,(t1)
+		nop
+		and	t2,t0
+		beq	zero,t2,2b
+		 addu	t1,2*PTRSIZE		# delay slot
 
 		/*
 		 * Do the low-level stuff
 		 */
-		lw	a0,%lo(asic_irq_nr-asic_mask_tbl-PTRSIZE)(t1)
-                nop
+		lw	a0,%lo(-PTRSIZE)(t1)
+		nop
+		bgez	a0,handle_it		# irq_nr >= 0?
+						# irq_nr < 0: it is an address
+		 nop
+		jr	a0
+		 nop				# delay slot
 
-handle_it:	jal	do_IRQ
+/*
+ * Dispatch low-priority interrupts.  We reconsider all status
+ * bits again, which looks like a lose, but it makes the code
+ * simple and O(log n), so it gets compensated.
+ */
+		FEXPORT(cpu_all_int)		# HALT, timers, software junk
+		li	a0,DEC_CPU_IRQ_BASE
+		srl	t0,CAUSEB_IP
+		li	t1,CAUSEF_IP>>CAUSEB_IP	# mask
+		b	1f
+		 li	t2,4			# nr of bits / 2
+
+		FEXPORT(kn02_all_int)		# impossible ?
+		li	a0,KN02_IRQ_BASE
+		li	t1,KN02_IRQ_ALL		# mask
+		b	1f
+		 li	t2,4			# nr of bits / 2
+
+		FEXPORT(asic_all_int)		# various I/O ASIC junk
+		li	a0,IO_IRQ_BASE
+		li	t1,IO_IRQ_ALL		# mask
+		b	1f
+		 li	t2,8			# nr of bits / 2
+
+/*
+ * Dispatch DMA interrupts -- O(log n).
+ */
+		FEXPORT(asic_dma_int)		# I/O ASIC DMA events
+		li	a0,IO_IRQ_BASE+IO_INR_DMA
+		srl	t0,IO_INR_DMA
+		li	t1,IO_IRQ_DMA>>IO_INR_DMA # mask
+		li	t2,8			# nr of bits / 2
+		
+		/*
+		 * Find irq with highest priority.
+		 * Highest irq number takes precedence.
+		 */
+1:		srlv	t3,t1,t2
+2:		xor	t1,t3
+		and	t3,t0,t1
+		beqz	t3,3f
+		 nop
+		move	t0,t3
+		addu	a0,t2
+3:		srl	t2,1
+		bnez	t2,2b
+		 srlv	t3,t1,t2
+
+handle_it:
+		jal	do_IRQ
 		 move	a1,sp
+
 		j	ret_from_irq
 		 nop
 
@@ -233,135 +273,15 @@
 		END(decstation_handle_int)
 
 /*
- * Generic unimplemented interrupt routines - ivec_tbl is initialised to
- * point all interrupts here.  The table is then filled in by machine-specific
- * initialisation in dec_setup().
+ * Generic unimplemented interrupt routines -- cpu_mask_nr_tbl
+ * and asic_mask_nr_tbl are initialized to point all interrupts here.
+ * The tables are then filled in by machine-specific initialisation
+ * in dec_setup().
  */
 		FEXPORT(dec_intr_unimplemented)
-dec_intr_unimplemented:
-		mfc0	a1,CP0_CAUSE		# cheats way of printing an arg!
-		nop				# to be sure...
-		PANIC("Unimplemented cpu interrupt! CP0_CAUSE: 0x%x");
+		move	a1,t0			# cheats way of printing an arg!
+		PANIC("Unimplemented cpu interrupt! CP0_CAUSE: 0x%08x");
 
 		FEXPORT(asic_intr_unimplemented)
-asic_intr_unimplemented:
 		move	a1,t0			# cheats way of printing an arg!
-		PANIC("Unimplemented asic interrupt! ASIC ISR: 0x%x");
-
-/*
- * FIXME: This interrupt vector table is experimental.  It is initialised with 
- *	  *_intr_unimplemented and filled in with the addresses of
- *	  machine-specific interrupt routines in dec_setup()  Paul 10/5/97.
- *
- *	  The mask_tbls contain the interrupt masks which are used. It is 
- *	  initialised with all possible interrupt status bits set, so that 
- * 	  unused Interrupts are catched.				Harald
- */
-		.data
-		EXPORT(cpu_mask_tbl)
-cpu_mask_tbl:
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000		# these two are unlikely 
-		.word	0x00000000		# to be used
-		.word	0x0000ff00		# End of list
-
-		EXPORT(cpu_irq_nr)
-cpu_irq_nr:
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000
-		.word	0x00000000		# these two are unlikely 
-		.word	0x00000000		# to be used
-		.word	0x00ffffff		# End of list
-
-		EXPORT(cpu_ivec_tbl)
-cpu_ivec_tbl:
-		PTR	dec_intr_unimplemented
-		PTR	dec_intr_unimplemented
-		PTR	dec_intr_unimplemented
-		PTR	dec_intr_unimplemented
-		PTR	dec_intr_unimplemented
-		PTR	dec_intr_unimplemented
-		PTR	dec_intr_unimplemented	# these two are unlikely
-		PTR	dec_intr_unimplemented	# to be used
-		PTR	dec_intr_unimplemented	# EOL
-
-		EXPORT(asic_mask_tbl)
-asic_mask_tbl:
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0xffffffff			# EOL
-
-		EXPORT(asic_irq_nr)
-asic_irq_nr:
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0
-		.word	0xffffffff		# EOL
+		PANIC("Unimplemented asic interrupt! ASIC ISR: 0x%08x");
diff -urN linux-2.4.19-rc1/arch/mips/dec/ioasic-irq.c linux-2.4.19-rc2/arch/mips/dec/ioasic-irq.c
--- linux-2.4.19-rc1/arch/mips/dec/ioasic-irq.c	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/arch/mips/dec/ioasic-irq.c	Tue Jul 16 16:25:18 2002
@@ -0,0 +1,160 @@
+/*
+ *	linux/arch/mips/dec/ioasic-irq.c
+ *
+ *	DEC I/O ASIC interrupts.
+ *
+ *	Copyright (c) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
+
+#include <asm/dec/ioasic.h>
+#include <asm/dec/ioasic_addrs.h>
+#include <asm/dec/ioasic_ints.h>
+
+
+static spinlock_t ioasic_lock = SPIN_LOCK_UNLOCKED;
+
+static int ioasic_irq_base;
+
+
+static inline void unmask_ioasic_irq(unsigned int irq)
+{
+	u32 simr;
+
+	simr = ioasic_read(SIMR);
+	simr |= (1 << (irq - ioasic_irq_base));
+	ioasic_write(SIMR, simr);
+}
+
+static inline void mask_ioasic_irq(unsigned int irq)
+{
+	u32 simr;
+
+	simr = ioasic_read(SIMR);
+	simr &= ~(1 << (irq - ioasic_irq_base));
+	ioasic_write(SIMR, simr);
+}
+
+static inline void clear_ioasic_irq(unsigned int irq)
+{
+	u32 sir;
+
+	sir = ~(1 << (irq - ioasic_irq_base));
+	ioasic_write(SIR, sir);
+}
+
+static inline void enable_ioasic_irq(unsigned int irq)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&ioasic_lock, flags);
+	unmask_ioasic_irq(irq);
+	spin_unlock_irqrestore(&ioasic_lock, flags);
+}
+
+static inline void disable_ioasic_irq(unsigned int irq)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&ioasic_lock, flags);
+	mask_ioasic_irq(irq);
+	spin_unlock_irqrestore(&ioasic_lock, flags);
+}
+
+
+static inline unsigned int startup_ioasic_irq(unsigned int irq)
+{
+	enable_ioasic_irq(irq);
+	return 0;
+}
+
+#define shutdown_ioasic_irq disable_ioasic_irq
+
+static inline void ack_ioasic_irq(unsigned int irq)
+{
+	spin_lock(&ioasic_lock);
+	mask_ioasic_irq(irq);
+	spin_unlock(&ioasic_lock);
+}
+
+static inline void end_ioasic_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+		enable_ioasic_irq(irq);
+}
+
+#define set_ioasic_affinity NULL
+
+static struct hw_interrupt_type ioasic_irq_type = {
+	"IO-ASIC",
+	startup_ioasic_irq,
+	shutdown_ioasic_irq,
+	enable_ioasic_irq,
+	disable_ioasic_irq,
+	ack_ioasic_irq,
+	end_ioasic_irq,
+	set_ioasic_affinity,
+};
+
+
+#define startup_ioasic_dma_irq startup_ioasic_irq
+
+#define shutdown_ioasic_dma_irq shutdown_ioasic_irq
+
+#define enable_ioasic_dma_irq enable_ioasic_irq
+
+#define disable_ioasic_dma_irq disable_ioasic_irq
+
+#define ack_ioasic_dma_irq ack_ioasic_irq
+
+static inline void end_ioasic_dma_irq(unsigned int irq)
+{
+	clear_ioasic_irq(irq);
+	end_ioasic_irq(irq);
+}
+
+#define set_ioasic_dma_affinity set_ioasic_affinity
+
+static struct hw_interrupt_type ioasic_dma_irq_type = {
+	"IO-ASIC-DMA",
+	startup_ioasic_dma_irq,
+	shutdown_ioasic_dma_irq,
+	enable_ioasic_dma_irq,
+	disable_ioasic_dma_irq,
+	ack_ioasic_dma_irq,
+	end_ioasic_dma_irq,
+	set_ioasic_dma_affinity,
+};
+
+
+void __init init_ioasic_irqs(int base)
+{
+	int i;
+
+	/* Mask interrupts. */
+	ioasic_write(SIMR, 0);
+
+	for (i = base; i < base + IO_INR_DMA; i++) {
+		irq_desc[i].status = IRQ_DISABLED;
+		irq_desc[i].action = 0;
+		irq_desc[i].depth = 1;
+		irq_desc[i].handler = &ioasic_irq_type;
+	}
+	for (; i < base + IO_IRQ_LINES; i++) {
+		irq_desc[i].status = IRQ_DISABLED;
+		irq_desc[i].action = 0;
+		irq_desc[i].depth = 1;
+		irq_desc[i].handler = &ioasic_dma_irq_type;
+	}
+
+	ioasic_irq_base = base;
+}
diff -urN linux-2.4.19-rc1/arch/mips/dec/kn02-irq.c linux-2.4.19-rc2/arch/mips/dec/kn02-irq.c
--- linux-2.4.19-rc1/arch/mips/dec/kn02-irq.c	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/arch/mips/dec/kn02-irq.c	Tue Jul 16 16:25:18 2002
@@ -0,0 +1,125 @@
+/*
+ *	linux/arch/mips/dec/kn02-irq.c
+ *
+ *	DECstation 5000/200 (KN02) Control and Status Register
+ *	interrupts.
+ *
+ *	Copyright (c) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
+
+#include <asm/dec/kn02.h>
+
+
+/*
+ * Bits 7:0 of the Control Register are write-only -- the
+ * corresponding bits of the Status Register have a different
+ * meaning.  Hence we use a cache.  It speeds up things a bit
+ * as well.
+ *
+ * There is no default value -- it has to be initialized.
+ */
+u32 cached_kn02_csr;
+spinlock_t kn02_lock = SPIN_LOCK_UNLOCKED;
+
+
+static int kn02_irq_base;
+
+
+static inline void unmask_kn02_irq(unsigned int irq)
+{
+	volatile u32 *csr = (volatile u32 *)KN02_CSR_ADDR;
+
+	cached_kn02_csr |= (1 << (irq - kn02_irq_base + 16));
+	*csr = cached_kn02_csr;
+}
+
+static inline void mask_kn02_irq(unsigned int irq)
+{
+	volatile u32 *csr = (volatile u32 *)KN02_CSR_ADDR;
+
+	cached_kn02_csr &= ~(1 << (irq - kn02_irq_base + 16));
+	*csr = cached_kn02_csr;
+}
+
+static inline void enable_kn02_irq(unsigned int irq)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&kn02_lock, flags);
+	unmask_kn02_irq(irq);
+	spin_unlock_irqrestore(&kn02_lock, flags);
+}
+
+static inline void disable_kn02_irq(unsigned int irq)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&kn02_lock, flags);
+	mask_kn02_irq(irq);
+	spin_unlock_irqrestore(&kn02_lock, flags);
+}
+
+
+static unsigned int startup_kn02_irq(unsigned int irq)
+{
+	enable_kn02_irq(irq);
+	return 0;
+}
+
+#define shutdown_kn02_irq disable_kn02_irq
+
+static void ack_kn02_irq(unsigned int irq)
+{
+	spin_lock(&kn02_lock);
+	mask_kn02_irq(irq);
+	spin_unlock(&kn02_lock);
+}
+
+static void end_kn02_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+		enable_kn02_irq(irq);
+}
+
+#define set_kn02_affinity NULL
+
+static struct hw_interrupt_type kn02_irq_type = {
+	"KN02-CSR",
+	startup_kn02_irq,
+	shutdown_kn02_irq,
+	enable_kn02_irq,
+	disable_kn02_irq,
+	ack_kn02_irq,
+	end_kn02_irq,
+	set_kn02_affinity,
+};
+
+
+void __init init_kn02_irqs(int base)
+{
+	volatile u32 *csr = (volatile u32 *)KN02_CSR_ADDR;
+	int i;
+
+	/* Mask interrupts and preset write-only bits. */
+	cached_kn02_csr = (*csr & ~0xff0000) | 0xff;
+	*csr = cached_kn02_csr;
+
+	for (i = base; i < base + KN02_IRQ_LINES; i++) {
+		irq_desc[i].status = IRQ_DISABLED;
+		irq_desc[i].action = 0;
+		irq_desc[i].depth = 1;
+		irq_desc[i].handler = &kn02_irq_type;
+	}
+
+	kn02_irq_base = base;
+}
diff -urN linux-2.4.19-rc1/arch/mips/dec/prom/Makefile linux-2.4.19-rc2/arch/mips/dec/prom/Makefile
--- linux-2.4.19-rc1/arch/mips/dec/prom/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/dec/prom/Makefile	Tue Jul 16 16:25:18 2002
@@ -8,10 +8,7 @@
 #
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 L_TARGET  = rexlib.a
 
diff -urN linux-2.4.19-rc1/arch/mips/dec/prom/memory.c linux-2.4.19-rc2/arch/mips/dec/prom/memory.c
--- linux-2.4.19-rc1/arch/mips/dec/prom/memory.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/dec/prom/memory.c	Tue Jul 16 16:25:18 2002
@@ -116,7 +116,7 @@
 	 * the first page reserved for the exception handlers.
 	 */
 
-#ifdef CONFIG_DECLANCE
+#if defined(CONFIG_DECLANCE) || defined(CONFIG_DECLANCE_MODULE)
 	/*
 	 * Leave 128 KB reserved for Lance memory for
 	 * IOASIC DECstations.
diff -urN linux-2.4.19-rc1/arch/mips/dec/setup.c linux-2.4.19-rc2/arch/mips/dec/setup.c
--- linux-2.4.19-rc1/arch/mips/dec/setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/dec/setup.c	Tue Jul 16 16:25:18 2002
@@ -6,489 +6,758 @@
  * for more details.
  *
  * Copyright (C) 1998 Harald Koerfgen
- * Copyright (C) 2000, 2001 Maciej W. Rozycki
+ * Copyright (C) 2000, 2001, 2002  Maciej W. Rozycki
  */
+#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/mc146818rtc.h>
 #include <linux/param.h>
 #include <linux/console.h>
-#include <asm/mipsregs.h>
-#include <asm/bootinfo.h>
 #include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
 #include <asm/irq.h>
+#include <asm/irq_cpu.h>
+#include <asm/mipsregs.h>
 #include <asm/reboot.h>
+#include <asm/traps.h>
 
 #include <asm/dec/interrupts.h>
 #include <asm/dec/kn01.h>
 #include <asm/dec/kn02.h>
-#include <asm/dec/kn02xa.h>
+#include <asm/dec/kn02ba.h>
+#include <asm/dec/kn02ca.h>
 #include <asm/dec/kn03.h>
+#include <asm/dec/kn230.h>
 #include <asm/dec/ioasic.h>
 #include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/ioasic_ints.h>
 
 
-char *dec_rtc_base = (void *) KN01_RTC_BASE;	/* Assume DS2100/3100 initially */
+extern void dec_machine_restart(char *command);
+extern void dec_machine_halt(void);
+extern void dec_machine_power_off(void);
+extern void dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs);
+
+extern asmlinkage void decstation_handle_int(void);
 
-volatile unsigned int *ioasic_base;
 
-decint_t dec_interrupt[NR_INTS];
+char *dec_rtc_base = (void *) KN01_RTC_BASE; /* Assume DS2100/3100 initially */
+
+volatile u32 *ioasic_base;
 
 /*
- * Information regarding the IRQ Controller
+ * IRQ routing and priority tables.  Priorites are set as follows:
+ *
+ * 		KN01	KN230	KN02	KN02-BA	KN02-CA	KN03
+ *
+ * MEMORY	CPU	CPU	CPU	ASIC	CPU	CPU
+ * RTC		CPU	CPU	CPU	ASIC	CPU	CPU
+ * DMA		-	-	-	ASIC	ASIC	ASIC
+ * SERIAL0	CPU	CPU	CSR	ASIC	ASIC	ASIC
+ * SERIAL1	-	-	-	ASIC	-	ASIC
+ * SCSI		CPU	CPU	CSR	ASIC	ASIC	ASIC
+ * ETHERNET	CPU	*	CSR	ASIC	ASIC	ASIC
+ * other	-	-	-	ASIC	-	-
+ * TC2		-	-	CSR	CPU	ASIC	ASIC
+ * TC1		-	-	CSR	CPU	ASIC	ASIC
+ * TC0		-	-	CSR	CPU	ASIC	ASIC
+ * other	-	CPU	-	CPU	ASIC	ASIC
+ * other	-	-	-	-	CPU	CPU
+ *
+ * * -- shared with SCSI
  */
+ 
+int dec_interrupt[DEC_NR_INTS] = {
+	[0 ... DEC_NR_INTS - 1] = -1
+};
+int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2] = {
+	{ { i: ~0 }, { p: dec_intr_unimplemented } },
+};
+int_ptr asic_mask_nr_tbl[DEC_MAX_ASIC_INTS][2] = {
+	{ { i: ~0 }, { p: asic_intr_unimplemented } },
+};
+int cpu_fpu_mask = DEC_CPU_IRQ_MASK(DEC_CPU_INR_FPU);
 
-volatile unsigned int *isr = 0L;	/* address of the interrupt status register     */
-volatile unsigned int *imr = 0L;	/* address of the interrupt mask register       */
+static struct irqaction ioirq = {NULL, 0, 0, "cascade", NULL, NULL};
+static struct irqaction fpuirq = {NULL, 0, 0, "fpu", NULL, NULL};
+
+static struct irqaction haltirq = {dec_intr_halt, 0, 0, "halt", NULL, NULL};
 
-extern void dec_machine_restart(char *command);
-extern void dec_machine_halt(void);
-extern void dec_machine_power_off(void);
-extern void dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs);
 
 extern void wbflush_setup(void);
 
 extern struct rtc_ops dec_rtc_ops;
 
-extern int setup_dec_irq(int, struct irqaction *);
-
 void (*board_time_init) (struct irqaction * irq);
 
-static struct irqaction haltirq = {dec_intr_halt, 0, 0, "halt", NULL, NULL};
 
 /*
  * enable the periodic interrupts
  */
 static void __init dec_time_init(struct irqaction *irq)
 {
-    /*
-     * Here we go, enable periodic rtc interrupts.
-     */
+	/*
+	* Here we go, enable periodic rtc interrupts.
+	*/
 
 #ifndef LOG_2_HZ
 #  define LOG_2_HZ 7
 #endif
 
-    CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - LOG_2_HZ), RTC_REG_A);
-    CMOS_WRITE(CMOS_READ(RTC_REG_B) | RTC_PIE, RTC_REG_B);
-    setup_dec_irq(CLOCK, irq);
+	CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - LOG_2_HZ), RTC_REG_A);
+	CMOS_WRITE(CMOS_READ(RTC_REG_B) | RTC_PIE, RTC_REG_B);
+	setup_irq(dec_interrupt[DEC_IRQ_RTC], irq);
 }
 
+
 /*
- * Enable the halt interrupt.
+ * Bus error (DBE/IBE exceptions and memory interrupts) handling
+ * setup.  Nothing for now.
  */
-static void __init dec_halt_init(struct irqaction *irq)
+void __init bus_error_init(void)
 {
-    setup_dec_irq(HALT, irq);
 }
 
+
 void __init decstation_setup(void)
 {
-    board_time_init = dec_time_init;
+	board_time_init = dec_time_init;
 
-    wbflush_setup();
+	wbflush_setup();
 
-    _machine_restart = dec_machine_restart;
-    _machine_halt = dec_machine_halt;
-    _machine_power_off = dec_machine_power_off;
+	_machine_restart = dec_machine_restart;
+	_machine_halt = dec_machine_halt;
+	_machine_power_off = dec_machine_power_off;
 
 #ifdef CONFIG_FB
-    conswitchp = &dummy_con;
+	conswitchp = &dummy_con;
 #endif
 
-    rtc_ops = &dec_rtc_ops;
+	rtc_ops = &dec_rtc_ops;
 }
 
+
 /*
- * Machine-specific initialisation for kn01, aka Pmax, aka DS2100, DS3100,
- * and possibly also the DS5100.
+ * Machine-specific initialisation for KN01, aka DS2100 (aka Pmin)
+ * or DS3100 (aka Pmax).
  */
+static int kn01_interrupt[DEC_NR_INTS] __initdata = {
+	[DEC_IRQ_CASCADE]	= -1,
+	[DEC_IRQ_AB_RECV]	= -1,
+	[DEC_IRQ_AB_XMIT]	= -1,
+	[DEC_IRQ_DZ11]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11),
+	[DEC_IRQ_ASC]		= -1,
+	[DEC_IRQ_FLOPPY]	= -1,
+	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
+	[DEC_IRQ_HALT]		= -1,
+	[DEC_IRQ_ISDN]		= -1,
+	[DEC_IRQ_LANCE]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE),
+	[DEC_IRQ_MEMORY]	= DEC_CPU_IRQ_NR(KN01_CPU_INR_MEMORY),
+	[DEC_IRQ_PSU]		= -1,
+	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC),
+	[DEC_IRQ_SCC0]		= -1,
+	[DEC_IRQ_SCC1]		= -1,
+	[DEC_IRQ_SII]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_SII),
+	[DEC_IRQ_TC0]		= -1,
+	[DEC_IRQ_TC1]		= -1,
+	[DEC_IRQ_TC2]		= -1,
+	[DEC_IRQ_TIMER]		= -1,
+	[DEC_IRQ_VIDEO]		= DEC_CPU_IRQ_NR(KN01_CPU_INR_VIDEO),
+	[DEC_IRQ_ASC_MERR]	= -1,
+	[DEC_IRQ_ASC_ERR]	= -1,
+	[DEC_IRQ_ASC_DMA]	= -1,
+	[DEC_IRQ_FLOPPY_ERR]	= -1,
+	[DEC_IRQ_ISDN_ERR]	= -1,
+	[DEC_IRQ_ISDN_RXDMA]	= -1,
+	[DEC_IRQ_ISDN_TXDMA]	= -1,
+	[DEC_IRQ_LANCE_MERR]	= -1,
+	[DEC_IRQ_SCC0A_RXERR]	= -1,
+	[DEC_IRQ_SCC0A_RXDMA]	= -1,
+	[DEC_IRQ_SCC0A_TXERR]	= -1,
+	[DEC_IRQ_SCC0A_TXDMA]	= -1,
+	[DEC_IRQ_SCC0B_RXERR]	= -1,
+	[DEC_IRQ_SCC0B_RXDMA]	= -1,
+	[DEC_IRQ_SCC0B_TXERR]	= -1,
+	[DEC_IRQ_SCC0B_TXDMA]	= -1,
+	[DEC_IRQ_SCC1A_RXERR]	= -1,
+	[DEC_IRQ_SCC1A_RXDMA]	= -1,
+	[DEC_IRQ_SCC1A_TXERR]	= -1,
+	[DEC_IRQ_SCC1A_TXDMA]	= -1,
+};
+
+static int_ptr kn01_cpu_mask_nr_tbl[][2] __initdata = {
+	{ { i: DEC_CPU_IRQ_MASK(KN01_CPU_INR_MEMORY) },
+		{ i: DEC_CPU_IRQ_NR(KN01_CPU_INR_MEMORY) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN01_CPU_INR_RTC) },
+		{ i: DEC_CPU_IRQ_NR(KN01_CPU_INR_RTC) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN01_CPU_INR_DZ11) },
+		{ i: DEC_CPU_IRQ_NR(KN01_CPU_INR_DZ11) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN01_CPU_INR_SII) },
+		{ i: DEC_CPU_IRQ_NR(KN01_CPU_INR_SII) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN01_CPU_INR_LANCE) },
+		{ i: DEC_CPU_IRQ_NR(KN01_CPU_INR_LANCE) } },
+	{ { i: DEC_CPU_IRQ_ALL },
+		{ p: cpu_all_int } },
+};
+
 void __init dec_init_kn01(void)
 {
-    /*
-     * Setup some memory addresses.
-     */
-    dec_rtc_base = (char *) KN01_RTC_BASE;
-
-    /*
-     * Setup interrupt structure
-     */
-    dec_interrupt[CLOCK].cpu_mask = IE_IRQ3;
-    dec_interrupt[CLOCK].iemask = 0;
-    cpu_mask_tbl[0] = IE_IRQ3;
-    cpu_irq_nr[0] = CLOCK;
-
-    dec_interrupt[SCSI_INT].cpu_mask = IE_IRQ0;
-    dec_interrupt[SCSI_INT].iemask = 0;
-    cpu_mask_tbl[1] = IE_IRQ0;
-    cpu_irq_nr[1] = SCSI_INT;
-
-    dec_interrupt[ETHER].cpu_mask = IE_IRQ1;
-    dec_interrupt[ETHER].iemask = 0;
-    cpu_mask_tbl[2] = IE_IRQ1;
-    cpu_irq_nr[2] = ETHER;
-
-    dec_interrupt[SERIAL].cpu_mask = IE_IRQ2;
-    dec_interrupt[SERIAL].iemask = 0;
-    cpu_mask_tbl[3] = IE_IRQ2;
-    cpu_irq_nr[3] = SERIAL;
-
-    dec_interrupt[MEMORY].cpu_mask = IE_IRQ4;
-    dec_interrupt[MEMORY].iemask = 0;
-    cpu_mask_tbl[4] = IE_IRQ4;
-    cpu_irq_nr[4] = MEMORY;
-
-    /*
-     * Enable board interrupts: FPU.
-     */
-    set_cp0_status(DEC_IE_FPU);
+	/* Setup some memory addresses. */
+	dec_rtc_base = (char *) KN01_RTC_BASE;
+
+	/* IRQ routing. */
+	memcpy(&dec_interrupt, &kn01_interrupt,
+		sizeof(kn01_interrupt));
+
+	/* CPU IRQ priorities. */
+	memcpy(&cpu_mask_nr_tbl, &kn01_cpu_mask_nr_tbl,
+		sizeof(kn01_cpu_mask_nr_tbl));
+
+	mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
+
 }				/* dec_init_kn01 */
 
+
 /*
- * Machine-specific initialisation for kn230, aka MIPSmate, aka DS5100
- *
- * There are a lot of experiments to do, this is definitely incomplete.
+ * Machine-specific initialisation for KN230, aka DS5100, aka MIPSmate.
  */
+static int kn230_interrupt[DEC_NR_INTS] __initdata = {
+	[DEC_IRQ_CASCADE]	= -1,
+	[DEC_IRQ_AB_RECV]	= -1,
+	[DEC_IRQ_AB_XMIT]	= -1,
+	[DEC_IRQ_DZ11]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11),
+	[DEC_IRQ_ASC]		= -1,
+	[DEC_IRQ_FLOPPY]	= -1,
+	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
+	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_HALT),
+	[DEC_IRQ_ISDN]		= -1,
+	[DEC_IRQ_LANCE]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_LANCE),
+	[DEC_IRQ_MEMORY]	= DEC_CPU_IRQ_NR(KN230_CPU_INR_MEMORY),
+	[DEC_IRQ_PSU]		= -1,
+	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC),
+	[DEC_IRQ_SCC0]		= -1,
+	[DEC_IRQ_SCC1]		= -1,
+	[DEC_IRQ_SII]		= DEC_CPU_IRQ_NR(KN230_CPU_INR_SII),
+	[DEC_IRQ_TC0]		= -1,
+	[DEC_IRQ_TC1]		= -1,
+	[DEC_IRQ_TC2]		= -1,
+	[DEC_IRQ_TIMER]		= -1,
+	[DEC_IRQ_VIDEO]		= -1,
+	[DEC_IRQ_ASC_MERR]	= -1,
+	[DEC_IRQ_ASC_ERR]	= -1,
+	[DEC_IRQ_ASC_DMA]	= -1,
+	[DEC_IRQ_FLOPPY_ERR]	= -1,
+	[DEC_IRQ_ISDN_ERR]	= -1,
+	[DEC_IRQ_ISDN_RXDMA]	= -1,
+	[DEC_IRQ_ISDN_TXDMA]	= -1,
+	[DEC_IRQ_LANCE_MERR]	= -1,
+	[DEC_IRQ_SCC0A_RXERR]	= -1,
+	[DEC_IRQ_SCC0A_RXDMA]	= -1,
+	[DEC_IRQ_SCC0A_TXERR]	= -1,
+	[DEC_IRQ_SCC0A_TXDMA]	= -1,
+	[DEC_IRQ_SCC0B_RXERR]	= -1,
+	[DEC_IRQ_SCC0B_RXDMA]	= -1,
+	[DEC_IRQ_SCC0B_TXERR]	= -1,
+	[DEC_IRQ_SCC0B_TXDMA]	= -1,
+	[DEC_IRQ_SCC1A_RXERR]	= -1,
+	[DEC_IRQ_SCC1A_RXDMA]	= -1,
+	[DEC_IRQ_SCC1A_TXERR]	= -1,
+	[DEC_IRQ_SCC1A_TXDMA]	= -1,
+};
+
+static int_ptr kn230_cpu_mask_nr_tbl[][2] __initdata = {
+	{ { i: DEC_CPU_IRQ_MASK(KN230_CPU_INR_MEMORY) },
+		{ i: DEC_CPU_IRQ_NR(KN230_CPU_INR_MEMORY) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN230_CPU_INR_RTC) },
+		{ i: DEC_CPU_IRQ_NR(KN230_CPU_INR_RTC) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN230_CPU_INR_DZ11) },
+		{ i: DEC_CPU_IRQ_NR(KN230_CPU_INR_DZ11) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN230_CPU_INR_SII) },
+		{ i: DEC_CPU_IRQ_NR(KN230_CPU_INR_SII) } },
+	{ { i: DEC_CPU_IRQ_ALL },
+		{ p: cpu_all_int } },
+};
+
 void __init dec_init_kn230(void)
 {
-    /*
-     * Setup some memory addresses.
-     */
-    dec_rtc_base = (char *) KN01_RTC_BASE;
-
-    /*
-     * Setup interrupt structure
-     */
-    dec_interrupt[CLOCK].cpu_mask = IE_IRQ2;
-    dec_interrupt[CLOCK].iemask = 0;
-    cpu_mask_tbl[0] = IE_IRQ2;
-    cpu_irq_nr[0] = CLOCK;
-
-    /*
-     * Enable board interrupts: FPU.
-     */
-    set_cp0_status(DEC_IE_FPU);
+	/* Setup some memory addresses. */
+	dec_rtc_base = (char *) KN01_RTC_BASE;
+
+	/* IRQ routing. */
+	memcpy(&dec_interrupt, &kn230_interrupt,
+		sizeof(kn230_interrupt));
+
+	/* CPU IRQ priorities. */
+	memcpy(&cpu_mask_nr_tbl, &kn230_cpu_mask_nr_tbl,
+		sizeof(kn230_cpu_mask_nr_tbl));
+
+	mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
+
 }				/* dec_init_kn230 */
 
+
 /*
- * Machine-specific initialisation for kn02, aka 3max, aka DS5000/2xx.
+ * Machine-specific initialisation for KN02, aka DS5000/200, aka 3max.
  */
+static int kn02_interrupt[DEC_NR_INTS] __initdata = {
+	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02_CPU_INR_CASCADE),
+	[DEC_IRQ_AB_RECV]	= -1,
+	[DEC_IRQ_AB_XMIT]	= -1,
+	[DEC_IRQ_DZ11]		= KN02_IRQ_NR(KN02_CSR_INR_DZ11),
+	[DEC_IRQ_ASC]		= KN02_IRQ_NR(KN02_CSR_INR_ASC),
+	[DEC_IRQ_FLOPPY]	= -1,
+	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
+	[DEC_IRQ_HALT]		= -1,
+	[DEC_IRQ_ISDN]		= -1,
+	[DEC_IRQ_LANCE]		= KN02_IRQ_NR(KN02_CSR_INR_LANCE),
+	[DEC_IRQ_MEMORY]	= DEC_CPU_IRQ_NR(KN02_CPU_INR_MEMORY),
+	[DEC_IRQ_PSU]		= -1,
+	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC),
+	[DEC_IRQ_SCC0]		= -1,
+	[DEC_IRQ_SCC1]		= -1,
+	[DEC_IRQ_SII]		= -1,
+	[DEC_IRQ_TC0]		= KN02_IRQ_NR(KN02_CSR_INR_TC0),
+	[DEC_IRQ_TC1]		= KN02_IRQ_NR(KN02_CSR_INR_TC1),
+	[DEC_IRQ_TC2]		= KN02_IRQ_NR(KN02_CSR_INR_TC2),
+	[DEC_IRQ_TIMER]		= -1,
+	[DEC_IRQ_VIDEO]		= -1,
+	[DEC_IRQ_ASC_MERR]	= -1,
+	[DEC_IRQ_ASC_ERR]	= -1,
+	[DEC_IRQ_ASC_DMA]	= -1,
+	[DEC_IRQ_FLOPPY_ERR]	= -1,
+	[DEC_IRQ_ISDN_ERR]	= -1,
+	[DEC_IRQ_ISDN_RXDMA]	= -1,
+	[DEC_IRQ_ISDN_TXDMA]	= -1,
+	[DEC_IRQ_LANCE_MERR]	= -1,
+	[DEC_IRQ_SCC0A_RXERR]	= -1,
+	[DEC_IRQ_SCC0A_RXDMA]	= -1,
+	[DEC_IRQ_SCC0A_TXERR]	= -1,
+	[DEC_IRQ_SCC0A_TXDMA]	= -1,
+	[DEC_IRQ_SCC0B_RXERR]	= -1,
+	[DEC_IRQ_SCC0B_RXDMA]	= -1,
+	[DEC_IRQ_SCC0B_TXERR]	= -1,
+	[DEC_IRQ_SCC0B_TXDMA]	= -1,
+	[DEC_IRQ_SCC1A_RXERR]	= -1,
+	[DEC_IRQ_SCC1A_RXDMA]	= -1,
+	[DEC_IRQ_SCC1A_TXERR]	= -1,
+	[DEC_IRQ_SCC1A_TXDMA]	= -1,
+};
+
+static int_ptr kn02_cpu_mask_nr_tbl[][2] __initdata = {
+	{ { i: DEC_CPU_IRQ_MASK(KN02_CPU_INR_MEMORY) },
+		{ i: DEC_CPU_IRQ_NR(KN02_CPU_INR_MEMORY) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN02_CPU_INR_RTC) },
+		{ i: DEC_CPU_IRQ_NR(KN02_CPU_INR_RTC) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN02_CPU_INR_CASCADE) },
+		{ p: kn02_io_int } },
+	{ { i: DEC_CPU_IRQ_ALL },
+		{ p: cpu_all_int } },
+};
+
+static int_ptr kn02_asic_mask_nr_tbl[][2] __initdata = {
+	{ { i: KN02_IRQ_MASK(KN02_CSR_INR_DZ11) },
+		{ i: KN02_IRQ_NR(KN02_CSR_INR_DZ11) } },
+	{ { i: KN02_IRQ_MASK(KN02_CSR_INR_ASC) },
+		{ i: KN02_IRQ_NR(KN02_CSR_INR_ASC) } },
+	{ { i: KN02_IRQ_MASK(KN02_CSR_INR_LANCE) },
+		{ i: KN02_IRQ_NR(KN02_CSR_INR_LANCE) } },
+	{ { i: KN02_IRQ_MASK(KN02_CSR_INR_TC2) },
+		{ i: KN02_IRQ_NR(KN02_CSR_INR_TC2) } },
+	{ { i: KN02_IRQ_MASK(KN02_CSR_INR_TC1) },
+		{ i: KN02_IRQ_NR(KN02_CSR_INR_TC1) } },
+	{ { i: KN02_IRQ_MASK(KN02_CSR_INR_TC0) },
+		{ i: KN02_IRQ_NR(KN02_CSR_INR_TC0) } },
+	{ { i: KN02_IRQ_ALL },
+		{ p: kn02_all_int } },
+};
+
 void __init dec_init_kn02(void)
 {
-    int dec_ie_io;
+	/* Setup some memory addresses. */
+	dec_rtc_base = (char *) KN02_RTC_BASE;
+
+	/* IRQ routing. */
+	memcpy(&dec_interrupt, &kn02_interrupt,
+		sizeof(kn02_interrupt));
+
+	/* CPU IRQ priorities. */
+	memcpy(&cpu_mask_nr_tbl, &kn02_cpu_mask_nr_tbl,
+		sizeof(kn02_cpu_mask_nr_tbl));
+
+	/* KN02 CSR IRQ priorities. */
+	memcpy(&asic_mask_nr_tbl, &kn02_asic_mask_nr_tbl,
+		sizeof(kn02_asic_mask_nr_tbl));
+
+	mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
+	init_kn02_irqs(KN02_IRQ_BASE);
 
-    /*
-     * Setup some memory addresses. FIXME: probably incomplete!
-     */
-    dec_rtc_base = (char *) KN02_RTC_BASE;
-    isr = (void *) KN02_CSR_ADDR;
-    imr = (void *) KN02_CSR_ADDR;
-
-    /*
-     * Setup I/O interrupt
-     */
-    dec_ie_io = IE_IRQ0;
-    cpu_ivec_tbl[1] = kn02_io_int;
-    cpu_mask_tbl[1] = dec_ie_io;
-    cpu_irq_nr[1] = -1;
-    *imr = *imr & 0xff00ff00;
-
-    /*
-     * Setup interrupt structure
-     */
-    dec_interrupt[CLOCK].cpu_mask = IE_IRQ1;
-    dec_interrupt[CLOCK].iemask = 0;
-    cpu_mask_tbl[0] = IE_IRQ1;
-    cpu_irq_nr[0] = CLOCK;
-
-    dec_interrupt[SCSI_INT].cpu_mask = IE_IRQ0;
-    dec_interrupt[SCSI_INT].iemask = KN02_SLOT5;
-    asic_mask_tbl[0] = KN02_SLOT5;
-    asic_irq_nr[0] = SCSI_INT;
-
-    dec_interrupt[ETHER].cpu_mask = IE_IRQ0;
-    dec_interrupt[ETHER].iemask = KN02_SLOT6;
-    asic_mask_tbl[1] = KN02_SLOT6;
-    asic_irq_nr[1] = ETHER;
-
-    dec_interrupt[SERIAL].cpu_mask = IE_IRQ0;
-    dec_interrupt[SERIAL].iemask = KN02_SLOT7;
-    asic_mask_tbl[2] = KN02_SLOT7;
-    asic_irq_nr[2] = SERIAL;
-
-    dec_interrupt[TC0].cpu_mask = IE_IRQ0;
-    dec_interrupt[TC0].iemask = KN02_SLOT0;
-    asic_mask_tbl[3] = KN02_SLOT0;
-    asic_irq_nr[3] = TC0;
-
-    dec_interrupt[TC1].cpu_mask = IE_IRQ0;
-    dec_interrupt[TC1].iemask = KN02_SLOT1;
-    asic_mask_tbl[4] = KN02_SLOT1;
-    asic_irq_nr[4] = TC1;
-
-    dec_interrupt[TC2].cpu_mask = IE_IRQ0;
-    dec_interrupt[TC2].iemask = KN02_SLOT2;
-    asic_mask_tbl[5] = KN02_SLOT2;
-    asic_irq_nr[5] = TC2;
-
-    dec_interrupt[MEMORY].cpu_mask = IE_IRQ3;
-    dec_interrupt[MEMORY].iemask = 0;
-    cpu_mask_tbl[2] = IE_IRQ3;
-    cpu_irq_nr[2] = MEMORY;
-
-    /*
-     * Enable board interrupts: FPU, I/O.
-     */
-    set_cp0_status(DEC_IE_FPU | dec_ie_io);
 }				/* dec_init_kn02 */
 
+
 /*
- * Machine-specific initialisation for kn02ba, aka 3min, aka DS5000/1xx.
+ * Machine-specific initialisation for KN02-BA, aka DS5000/1xx
+ * (xx = 20, 25, 33), aka 3min.  Also applies to KN04(-BA), aka
+ * DS5000/150, aka 4min.
  */
+static int kn02ba_interrupt[DEC_NR_INTS] __initdata = {
+	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_CASCADE),
+	[DEC_IRQ_AB_RECV]	= -1,
+	[DEC_IRQ_AB_XMIT]	= -1,
+	[DEC_IRQ_DZ11]		= -1,
+	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN02BA_IO_INR_ASC),
+	[DEC_IRQ_FLOPPY]	= -1,
+	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
+	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_HALT),
+	[DEC_IRQ_ISDN]		= -1,
+	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN02BA_IO_INR_LANCE),
+	[DEC_IRQ_MEMORY]	= IO_IRQ_NR(KN02BA_IO_INR_MEMORY),
+	[DEC_IRQ_PSU]		= IO_IRQ_NR(KN02BA_IO_INR_PSU),
+	[DEC_IRQ_RTC]		= IO_IRQ_NR(KN02BA_IO_INR_RTC),
+	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN02BA_IO_INR_SCC0),
+	[DEC_IRQ_SCC1]		= IO_IRQ_NR(KN02BA_IO_INR_SCC1),
+	[DEC_IRQ_SII]		= -1,
+	[DEC_IRQ_TC0]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0),
+	[DEC_IRQ_TC1]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1),
+	[DEC_IRQ_TC2]		= DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2),
+	[DEC_IRQ_TIMER]		= -1,
+	[DEC_IRQ_VIDEO]		= -1,
+	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
+	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
+	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
+	[DEC_IRQ_FLOPPY_ERR]	= -1,
+	[DEC_IRQ_ISDN_ERR]	= -1,
+	[DEC_IRQ_ISDN_RXDMA]	= -1,
+	[DEC_IRQ_ISDN_TXDMA]	= -1,
+	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
+	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
+	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
+	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
+	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
+	[DEC_IRQ_SCC0B_RXERR]	= -1,
+	[DEC_IRQ_SCC0B_RXDMA]	= -1,
+	[DEC_IRQ_SCC0B_TXERR]	= -1,
+	[DEC_IRQ_SCC0B_TXDMA]	= -1,
+	[DEC_IRQ_SCC1A_RXERR]	= IO_IRQ_NR(IO_INR_SCC1A_RXERR),
+	[DEC_IRQ_SCC1A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_RXDMA),
+	[DEC_IRQ_SCC1A_TXERR]	= IO_IRQ_NR(IO_INR_SCC1A_TXERR),
+	[DEC_IRQ_SCC1A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_TXDMA),
+};
+
+static int_ptr kn02ba_cpu_mask_nr_tbl[][2] __initdata = {
+	{ { i: DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_CASCADE) },
+		{ p: kn02xa_io_int } },
+	{ { i: DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC2) },
+		{ i: DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC2) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC1) },
+		{ i: DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC1) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN02BA_CPU_INR_TC0) },
+		{ i: DEC_CPU_IRQ_NR(KN02BA_CPU_INR_TC0) } },
+	{ { i: DEC_CPU_IRQ_ALL },
+		{ p: cpu_all_int } },
+};
+
+static int_ptr kn02ba_asic_mask_nr_tbl[][2] __initdata = {
+	{ { i: IO_IRQ_MASK(KN02BA_IO_INR_MEMORY) },
+		{ i: IO_IRQ_NR(KN02BA_IO_INR_MEMORY) } },
+	{ { i: IO_IRQ_MASK(KN02BA_IO_INR_RTC) },
+		{ i: IO_IRQ_NR(KN02BA_IO_INR_RTC) } },
+	{ { i: IO_IRQ_DMA },
+		{ p: asic_dma_int } },
+	{ { i: IO_IRQ_MASK(KN02BA_IO_INR_SCC0) },
+		{ i: IO_IRQ_NR(KN02BA_IO_INR_SCC0) } },
+	{ { i: IO_IRQ_MASK(KN02BA_IO_INR_SCC1) },
+		{ i: IO_IRQ_NR(KN02BA_IO_INR_SCC1) } },
+	{ { i: IO_IRQ_MASK(KN02BA_IO_INR_ASC) },
+		{ i: IO_IRQ_NR(KN02BA_IO_INR_ASC) } },
+	{ { i: IO_IRQ_MASK(KN02BA_IO_INR_LANCE) },
+		{ i: IO_IRQ_NR(KN02BA_IO_INR_LANCE) } },
+	{ { i: IO_IRQ_ALL },
+		{ p: asic_all_int } },
+};
+
 void __init dec_init_kn02ba(void)
 {
-    int dec_ie_ioasic;
+	/* Setup some memory addresses. */
+	ioasic_base = (void *) KN02BA_IOASIC_BASE;
+	dec_rtc_base = (char *) KN02BA_RTC_BASE;
+
+	/* IRQ routing. */
+	memcpy(&dec_interrupt, &kn02ba_interrupt,
+		sizeof(kn02ba_interrupt));
+
+	/* CPU IRQ priorities. */
+	memcpy(&cpu_mask_nr_tbl, &kn02ba_cpu_mask_nr_tbl,
+		sizeof(kn02ba_cpu_mask_nr_tbl));
+
+	/* I/O ASIC IRQ priorities. */
+	memcpy(&asic_mask_nr_tbl, &kn02ba_asic_mask_nr_tbl,
+		sizeof(kn02ba_asic_mask_nr_tbl));
 
-    /*
-     * Setup some memory addresses.
-     */
-    ioasic_base = (void *) KN02XA_IOASIC_BASE;
-    dec_rtc_base = (char *) KN02XA_RTC_BASE;
-    isr = (void *) KN02XA_IOASIC_REG(SIR);
-    imr = (void *) KN02XA_IOASIC_REG(SIMR);
-
-    /*
-     * Setup IOASIC interrupt
-     */
-    dec_ie_ioasic = IE_IRQ3;
-    cpu_ivec_tbl[0] = kn02xa_io_int;
-    cpu_mask_tbl[0] = dec_ie_ioasic;
-    cpu_irq_nr[0] = -1;
-    *imr = 0;
-
-    /*
-     * Setup interrupt structure
-     */
-    dec_interrupt[CLOCK].cpu_mask = IE_IRQ3;
-    dec_interrupt[CLOCK].iemask = KMIN_CLOCK;
-    asic_mask_tbl[0] = KMIN_CLOCK;
-    asic_irq_nr[0] = CLOCK;
-
-    dec_interrupt[SCSI_DMA_INT].cpu_mask = IE_IRQ3;
-    dec_interrupt[SCSI_DMA_INT].iemask = SCSI_DMA_INTS;
-    asic_mask_tbl[1] = SCSI_DMA_INTS;
-    asic_irq_nr[1] = SCSI_DMA_INT;
-
-    dec_interrupt[SCSI_INT].cpu_mask = IE_IRQ3;
-    dec_interrupt[SCSI_INT].iemask = SCSI_CHIP;
-    asic_mask_tbl[2] = SCSI_CHIP;
-    asic_irq_nr[2] = SCSI_INT;
-
-    dec_interrupt[ETHER].cpu_mask = IE_IRQ3;
-    dec_interrupt[ETHER].iemask = LANCE_INTS;
-    asic_mask_tbl[3] = LANCE_INTS;
-    asic_irq_nr[3] = ETHER;
-
-    dec_interrupt[SERIAL].cpu_mask = IE_IRQ3;
-    dec_interrupt[SERIAL].iemask = SERIAL_INTS;
-    asic_mask_tbl[4] = SERIAL_INTS;
-    asic_irq_nr[4] = SERIAL;
-
-    dec_interrupt[MEMORY].cpu_mask = IE_IRQ3;
-    dec_interrupt[MEMORY].iemask = KMIN_TIMEOUT;
-    asic_mask_tbl[5] = KMIN_TIMEOUT;
-    asic_irq_nr[5] = MEMORY;
-
-    dec_interrupt[TC0].cpu_mask = IE_IRQ0;
-    dec_interrupt[TC0].iemask = 0;
-    cpu_mask_tbl[1] = IE_IRQ0;
-    cpu_irq_nr[1] = TC0;
-
-    dec_interrupt[TC1].cpu_mask = IE_IRQ1;
-    dec_interrupt[TC1].iemask = 0;
-    cpu_mask_tbl[2] = IE_IRQ1;
-    cpu_irq_nr[2] = TC1;
-
-    dec_interrupt[TC2].cpu_mask = IE_IRQ2;
-    dec_interrupt[TC2].iemask = 0;
-    cpu_mask_tbl[3] = IE_IRQ2;
-    cpu_irq_nr[3] = TC2;
-
-    dec_interrupt[HALT].cpu_mask = IE_IRQ4;
-    dec_interrupt[HALT].iemask = 0;
-    cpu_mask_tbl[4] = IE_IRQ4;
-    cpu_irq_nr[4] = HALT;
-
-    /*
-     * Enable board interrupts: FPU, I/O ASIC.
-     */
-    set_cp0_status(DEC_IE_FPU | dec_ie_ioasic);
+	mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
+	init_ioasic_irqs(IO_IRQ_BASE);
 
-    dec_halt_init(&haltirq);
 }				/* dec_init_kn02ba */
 
+
 /*
- * Machine-specific initialisation for kn02ca, aka maxine, aka DS5000/2x.
+ * Machine-specific initialisation for KN02-CA, aka DS5000/xx,
+ * (xx = 20, 25, 33), aka MAXine.  Also applies to KN04(-CA), aka
+ * DS5000/50, aka 4MAXine.
  */
+static int kn02ca_interrupt[DEC_NR_INTS] __initdata = {
+	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_CASCADE),
+	[DEC_IRQ_AB_RECV]	= IO_IRQ_NR(KN02CA_IO_INR_AB_RECV),
+	[DEC_IRQ_AB_XMIT]	= IO_IRQ_NR(KN02CA_IO_INR_AB_XMIT),
+	[DEC_IRQ_DZ11]		= -1,
+	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN02CA_IO_INR_ASC),
+	[DEC_IRQ_FLOPPY]	= IO_IRQ_NR(KN02CA_IO_INR_FLOPPY),
+	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
+	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_HALT),
+	[DEC_IRQ_ISDN]		= IO_IRQ_NR(KN02CA_IO_INR_ISDN),
+	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN02CA_IO_INR_LANCE),
+	[DEC_IRQ_MEMORY]	= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_MEMORY),
+	[DEC_IRQ_PSU]		= -1,
+	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC),
+	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN02CA_IO_INR_SCC0),
+	[DEC_IRQ_SCC1]		= -1,
+	[DEC_IRQ_SII]		= -1,
+	[DEC_IRQ_TC0]		= IO_IRQ_NR(KN02CA_IO_INR_TC0),
+	[DEC_IRQ_TC1]		= IO_IRQ_NR(KN02CA_IO_INR_TC1),
+	[DEC_IRQ_TC2]		= -1,
+	[DEC_IRQ_TIMER]		= DEC_CPU_IRQ_NR(KN02CA_CPU_INR_TIMER),
+	[DEC_IRQ_VIDEO]		= IO_IRQ_NR(KN02CA_IO_INR_VIDEO),
+	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
+	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
+	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
+	[DEC_IRQ_FLOPPY_ERR]	= IO_IRQ_NR(IO_INR_FLOPPY_ERR),
+	[DEC_IRQ_ISDN_ERR]	= IO_IRQ_NR(IO_INR_ISDN_ERR),
+	[DEC_IRQ_ISDN_RXDMA]	= IO_IRQ_NR(IO_INR_ISDN_RXDMA),
+	[DEC_IRQ_ISDN_TXDMA]	= IO_IRQ_NR(IO_INR_ISDN_TXDMA),
+	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
+	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
+	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
+	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
+	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
+	[DEC_IRQ_SCC0B_RXERR]	= IO_IRQ_NR(IO_INR_SCC0B_RXERR),
+	[DEC_IRQ_SCC0B_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0B_RXDMA),
+	[DEC_IRQ_SCC0B_TXERR]	= IO_IRQ_NR(IO_INR_SCC0B_TXERR),
+	[DEC_IRQ_SCC0B_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0B_TXDMA),
+	[DEC_IRQ_SCC1A_RXERR]	= -1,
+	[DEC_IRQ_SCC1A_RXDMA]	= -1,
+	[DEC_IRQ_SCC1A_TXERR]	= -1,
+	[DEC_IRQ_SCC1A_TXDMA]	= -1,
+};
+
+static int_ptr kn02ca_cpu_mask_nr_tbl[][2] __initdata = {
+	{ { i: DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_MEMORY) },
+		{ i: DEC_CPU_IRQ_NR(KN02CA_CPU_INR_MEMORY) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_RTC) },
+		{ i: DEC_CPU_IRQ_NR(KN02CA_CPU_INR_RTC) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN02CA_CPU_INR_CASCADE) },
+		{ p: kn02xa_io_int } },
+	{ { i: DEC_CPU_IRQ_ALL },
+		{ p: cpu_all_int } },
+};
+
+static int_ptr kn02ca_asic_mask_nr_tbl[][2] __initdata = {
+	{ { i: IO_IRQ_DMA },
+		{ p: asic_dma_int } },
+	{ { i: IO_IRQ_MASK(KN02CA_IO_INR_SCC0) },
+		{ i: IO_IRQ_NR(KN02CA_IO_INR_SCC0) } },
+	{ { i: IO_IRQ_MASK(KN02CA_IO_INR_ASC) },
+		{ i: IO_IRQ_NR(KN02CA_IO_INR_ASC) } },
+	{ { i: IO_IRQ_MASK(KN02CA_IO_INR_LANCE) },
+		{ i: IO_IRQ_NR(KN02CA_IO_INR_LANCE) } },
+	{ { i: IO_IRQ_MASK(KN02CA_IO_INR_TC1) },
+		{ i: IO_IRQ_NR(KN02CA_IO_INR_TC1) } },
+	{ { i: IO_IRQ_MASK(KN02CA_IO_INR_TC0) },
+		{ i: IO_IRQ_NR(KN02CA_IO_INR_TC0) } },
+	{ { i: IO_IRQ_ALL },
+		{ p: asic_all_int } },
+};
+
 void __init dec_init_kn02ca(void)
 {
-    int dec_ie_ioasic;
+	/* Setup some memory addresses. */
+	ioasic_base = (void *) KN02CA_IOASIC_BASE;
+	dec_rtc_base = (char *) KN02CA_RTC_BASE;
+
+	/* IRQ routing. */
+	memcpy(&dec_interrupt, &kn02ca_interrupt,
+		sizeof(kn02ca_interrupt));
+
+	/* CPU IRQ priorities. */
+	memcpy(&cpu_mask_nr_tbl, &kn02ca_cpu_mask_nr_tbl,
+		sizeof(kn02ca_cpu_mask_nr_tbl));
+
+	/* I/O ASIC IRQ priorities. */
+	memcpy(&asic_mask_nr_tbl, &kn02ca_asic_mask_nr_tbl,
+		sizeof(kn02ca_asic_mask_nr_tbl));
 
-    /*
-     * Setup some memory addresses. FIXME: probably incomplete!
-     */
-    ioasic_base = (void *) KN02XA_IOASIC_BASE;
-    dec_rtc_base = (char *) KN02XA_RTC_BASE;
-    isr = (void *) KN02XA_IOASIC_REG(SIR);
-    imr = (void *) KN02XA_IOASIC_REG(SIMR);
-
-    /*
-     * Setup IOASIC interrupt
-     */
-    dec_ie_ioasic = IE_IRQ3;
-    cpu_ivec_tbl[1] = kn02xa_io_int;
-    cpu_mask_tbl[1] = dec_ie_ioasic;
-    cpu_irq_nr[1] = -1;
-    *imr = 0;
-
-    /*
-     * Setup interrupt structure
-     */
-    dec_interrupt[CLOCK].cpu_mask = IE_IRQ1;
-    dec_interrupt[CLOCK].iemask = 0;
-    cpu_mask_tbl[0] = IE_IRQ1;
-    cpu_irq_nr[0] = CLOCK;
-
-    dec_interrupt[SCSI_DMA_INT].cpu_mask = IE_IRQ3;
-    dec_interrupt[SCSI_DMA_INT].iemask = SCSI_DMA_INTS;
-    asic_mask_tbl[0] = SCSI_DMA_INTS;
-    asic_irq_nr[0] = SCSI_DMA_INT;
-
-    dec_interrupt[SCSI_INT].cpu_mask = IE_IRQ3;
-    dec_interrupt[SCSI_INT].iemask = SCSI_CHIP;
-    asic_mask_tbl[1] = SCSI_CHIP;
-    asic_irq_nr[1] = SCSI_INT;
-
-    dec_interrupt[ETHER].cpu_mask = IE_IRQ3;
-    dec_interrupt[ETHER].iemask = LANCE_INTS;
-    asic_mask_tbl[2] = LANCE_INTS;
-    asic_irq_nr[2] = ETHER;
-
-    dec_interrupt[SERIAL].cpu_mask = IE_IRQ3;
-    dec_interrupt[SERIAL].iemask = XINE_SERIAL_INTS;
-    asic_mask_tbl[3] = XINE_SERIAL_INTS;
-    asic_irq_nr[3] = SERIAL;
-
-    dec_interrupt[TC0].cpu_mask = IE_IRQ3;
-    dec_interrupt[TC0].iemask = MAXINE_TC0;
-    asic_mask_tbl[4] = MAXINE_TC0;
-    asic_irq_nr[4] = TC0;
-
-    dec_interrupt[TC1].cpu_mask = IE_IRQ3;
-    dec_interrupt[TC1].iemask = MAXINE_TC1;
-    asic_mask_tbl[5] = MAXINE_TC1;
-    asic_irq_nr[5] = TC1;
-
-    dec_interrupt[MEMORY].cpu_mask = IE_IRQ2;
-    dec_interrupt[MEMORY].iemask = 0;
-    cpu_mask_tbl[2] = IE_IRQ2;
-    cpu_irq_nr[2] = MEMORY;
-
-    dec_interrupt[HALT].cpu_mask = IE_IRQ4;
-    dec_interrupt[HALT].iemask = 0;
-    cpu_mask_tbl[3] = IE_IRQ4;
-    cpu_irq_nr[3] = HALT;
-
-    /*
-     * Enable board interrupts: FPU, I/O ASIC.
-     */
-    set_cp0_status(DEC_IE_FPU | dec_ie_ioasic);
+	mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
+	init_ioasic_irqs(IO_IRQ_BASE);
 
-    dec_halt_init(&haltirq);
 }				/* dec_init_kn02ca */
 
+
 /*
- * Machine-specific initialisation for kn03, aka 3max+, aka DS5000/240.
+ * Machine-specific initialisation for KN03, aka DS5000/240,
+ * aka 3max+ and DS5900, aka BIGmax.  Also applies to KN05, aka
+ * DS5000/260, aka 4max+ and DS5900-260.
  */
+static int kn03_interrupt[DEC_NR_INTS] __initdata = {
+	[DEC_IRQ_CASCADE]	= DEC_CPU_IRQ_NR(KN03_CPU_INR_CASCADE),
+	[DEC_IRQ_AB_RECV]	= -1,
+	[DEC_IRQ_AB_XMIT]	= -1,
+	[DEC_IRQ_DZ11]		= -1,
+	[DEC_IRQ_ASC]		= IO_IRQ_NR(KN03_IO_INR_ASC),
+	[DEC_IRQ_FLOPPY]	= -1,
+	[DEC_IRQ_FPU]		= DEC_CPU_IRQ_NR(DEC_CPU_INR_FPU),
+	[DEC_IRQ_HALT]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_HALT),
+	[DEC_IRQ_ISDN]		= -1,
+	[DEC_IRQ_LANCE]		= IO_IRQ_NR(KN03_IO_INR_LANCE),
+	[DEC_IRQ_MEMORY]	= DEC_CPU_IRQ_NR(KN03_CPU_INR_MEMORY),
+	[DEC_IRQ_PSU]		= IO_IRQ_NR(KN03_IO_INR_PSU),
+	[DEC_IRQ_RTC]		= DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC),
+	[DEC_IRQ_SCC0]		= IO_IRQ_NR(KN03_IO_INR_SCC0),
+	[DEC_IRQ_SCC1]		= IO_IRQ_NR(KN03_IO_INR_SCC1),
+	[DEC_IRQ_SII]		= -1,
+	[DEC_IRQ_TC0]		= IO_IRQ_NR(KN03_IO_INR_TC0),
+	[DEC_IRQ_TC1]		= IO_IRQ_NR(KN03_IO_INR_TC1),
+	[DEC_IRQ_TC2]		= IO_IRQ_NR(KN03_IO_INR_TC2),
+	[DEC_IRQ_TIMER]		= -1,
+	[DEC_IRQ_VIDEO]		= -1,
+	[DEC_IRQ_ASC_MERR]	= IO_IRQ_NR(IO_INR_ASC_MERR),
+	[DEC_IRQ_ASC_ERR]	= IO_IRQ_NR(IO_INR_ASC_ERR),
+	[DEC_IRQ_ASC_DMA]	= IO_IRQ_NR(IO_INR_ASC_DMA),
+	[DEC_IRQ_FLOPPY_ERR]	= -1,
+	[DEC_IRQ_ISDN_ERR]	= -1,
+	[DEC_IRQ_ISDN_RXDMA]	= -1,
+	[DEC_IRQ_ISDN_TXDMA]	= -1,
+	[DEC_IRQ_LANCE_MERR]	= IO_IRQ_NR(IO_INR_LANCE_MERR),
+	[DEC_IRQ_SCC0A_RXERR]	= IO_IRQ_NR(IO_INR_SCC0A_RXERR),
+	[DEC_IRQ_SCC0A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_RXDMA),
+	[DEC_IRQ_SCC0A_TXERR]	= IO_IRQ_NR(IO_INR_SCC0A_TXERR),
+	[DEC_IRQ_SCC0A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC0A_TXDMA),
+	[DEC_IRQ_SCC0B_RXERR]	= -1,
+	[DEC_IRQ_SCC0B_RXDMA]	= -1,
+	[DEC_IRQ_SCC0B_TXERR]	= -1,
+	[DEC_IRQ_SCC0B_TXDMA]	= -1,
+	[DEC_IRQ_SCC1A_RXERR]	= IO_IRQ_NR(IO_INR_SCC1A_RXERR),
+	[DEC_IRQ_SCC1A_RXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_RXDMA),
+	[DEC_IRQ_SCC1A_TXERR]	= IO_IRQ_NR(IO_INR_SCC1A_TXERR),
+	[DEC_IRQ_SCC1A_TXDMA]	= IO_IRQ_NR(IO_INR_SCC1A_TXDMA),
+};
+
+static int_ptr kn03_cpu_mask_nr_tbl[][2] __initdata = {
+	{ { i: DEC_CPU_IRQ_MASK(KN03_CPU_INR_MEMORY) },
+		{ i: DEC_CPU_IRQ_NR(KN03_CPU_INR_MEMORY) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN03_CPU_INR_RTC) },
+		{ i: DEC_CPU_IRQ_NR(KN03_CPU_INR_RTC) } },
+	{ { i: DEC_CPU_IRQ_MASK(KN03_CPU_INR_CASCADE) }, 
+		{ p: kn03_io_int } },
+	{ { i: DEC_CPU_IRQ_ALL }, 
+		{ p: cpu_all_int } },
+};
+
+static int_ptr kn03_asic_mask_nr_tbl[][2] __initdata = {
+	{ { i: IO_IRQ_DMA },
+		{ p: asic_dma_int } },
+	{ { i: IO_IRQ_MASK(KN03_IO_INR_SCC0) },
+		{ i: IO_IRQ_NR(KN03_IO_INR_SCC0) } },
+	{ { i: IO_IRQ_MASK(KN03_IO_INR_SCC1) },
+		{ i: IO_IRQ_NR(KN03_IO_INR_SCC1) } },
+	{ { i: IO_IRQ_MASK(KN03_IO_INR_ASC) },
+		{ i: IO_IRQ_NR(KN03_IO_INR_ASC) } },
+	{ { i: IO_IRQ_MASK(KN03_IO_INR_LANCE) },
+		{ i: IO_IRQ_NR(KN03_IO_INR_LANCE) } },
+	{ { i: IO_IRQ_MASK(KN03_IO_INR_TC2) },
+		{ i: IO_IRQ_NR(KN03_IO_INR_TC2) } },
+	{ { i: IO_IRQ_MASK(KN03_IO_INR_TC1) },
+		{ i: IO_IRQ_NR(KN03_IO_INR_TC1) } },
+	{ { i: IO_IRQ_MASK(KN03_IO_INR_TC0) },
+		{ i: IO_IRQ_NR(KN03_IO_INR_TC0) } },
+	{ { i: IO_IRQ_ALL },
+		{ p: asic_all_int } },
+};
+
 void __init dec_init_kn03(void)
 {
-    int dec_ie_ioasic;
+	/* Setup some memory addresses.  */
+	ioasic_base = (void *) KN03_IOASIC_BASE;
+	dec_rtc_base = (char *) KN03_RTC_BASE;
+
+	/* IRQ routing. */
+	memcpy(&dec_interrupt, &kn03_interrupt,
+		sizeof(kn03_interrupt));	
+
+	/* CPU IRQ priorities. */
+	memcpy(&cpu_mask_nr_tbl, &kn03_cpu_mask_nr_tbl,
+		sizeof(kn03_cpu_mask_nr_tbl));
+
+	/* I/O ASIC IRQ priorities. */
+	memcpy(&asic_mask_nr_tbl, &kn03_asic_mask_nr_tbl,
+		sizeof(kn03_asic_mask_nr_tbl));
 
-    /*
-     * Setup some memory addresses. FIXME: probably incomplete!
-     */
-    ioasic_base = (void *) KN03_IOASIC_BASE;
-    dec_rtc_base = (char *) KN03_RTC_BASE;
-    isr = (void *) KN03_IOASIC_REG(SIR);
-    imr = (void *) KN03_IOASIC_REG(SIMR);
-
-    /*
-     * Setup IOASIC interrupt
-     */
-    dec_ie_ioasic = IE_IRQ0;
-    cpu_ivec_tbl[1] = kn03_io_int;
-    cpu_mask_tbl[1] = dec_ie_ioasic;
-    cpu_irq_nr[1] = -1;
-    *imr = 0;
-
-    /*
-     * Setup interrupt structure
-     */
-    dec_interrupt[CLOCK].cpu_mask = IE_IRQ1;
-    dec_interrupt[CLOCK].iemask = 0;
-    cpu_mask_tbl[0] = IE_IRQ1;
-    cpu_irq_nr[0] = CLOCK;
-
-    dec_interrupt[SCSI_DMA_INT].cpu_mask = IE_IRQ0;
-    dec_interrupt[SCSI_DMA_INT].iemask = SCSI_DMA_INTS;
-    asic_mask_tbl[0] = SCSI_DMA_INTS;
-    asic_irq_nr[0] = SCSI_DMA_INT;
-
-    dec_interrupt[SCSI_INT].cpu_mask = IE_IRQ0;
-    dec_interrupt[SCSI_INT].iemask = SCSI_CHIP;
-    asic_mask_tbl[1] = SCSI_CHIP;
-    asic_irq_nr[1] = SCSI_INT;
-
-    dec_interrupt[ETHER].cpu_mask = IE_IRQ0;
-    dec_interrupt[ETHER].iemask = LANCE_INTS;
-    asic_mask_tbl[2] = LANCE_INTS;
-    asic_irq_nr[2] = ETHER;
-
-    dec_interrupt[SERIAL].cpu_mask = IE_IRQ0;
-    dec_interrupt[SERIAL].iemask = SERIAL_INTS;
-    asic_mask_tbl[3] = SERIAL_INTS;
-    asic_irq_nr[3] = SERIAL;
-
-    dec_interrupt[TC0].cpu_mask = IE_IRQ0;
-    dec_interrupt[TC0].iemask = KN03_TC0;
-    asic_mask_tbl[4] = KN03_TC0;
-    asic_irq_nr[4] = TC0;
-
-    dec_interrupt[TC1].cpu_mask = IE_IRQ0;
-    dec_interrupt[TC1].iemask = KN03_TC1;
-    asic_mask_tbl[5] = KN03_TC1;
-    asic_irq_nr[5] = TC1;
-
-    dec_interrupt[TC2].cpu_mask = IE_IRQ0;
-    dec_interrupt[TC2].iemask = KN03_TC2;
-    asic_mask_tbl[6] = KN03_TC2;
-    asic_irq_nr[6] = TC2;
-
-    dec_interrupt[MEMORY].cpu_mask = IE_IRQ3;
-    dec_interrupt[MEMORY].iemask = 0;
-    cpu_mask_tbl[2] = IE_IRQ3;
-    cpu_irq_nr[2] = MEMORY;
-
-    dec_interrupt[HALT].cpu_mask = IE_IRQ4;
-    dec_interrupt[HALT].iemask = 0;
-    cpu_mask_tbl[3] = IE_IRQ4;
-    cpu_irq_nr[3] = HALT;
-
-    /*
-     * Enable board interrupts: FPU, I/O ASIC.
-     */
-    set_cp0_status(DEC_IE_FPU | dec_ie_ioasic);
+	mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
+	init_ioasic_irqs(IO_IRQ_BASE);
 
-    dec_halt_init(&haltirq);
 }				/* dec_init_kn03 */
+
+
+void __init init_IRQ(void)
+{
+	switch (mips_machtype) {
+	case MACH_DS23100:	/* DS2100/DS3100 Pmin/Pmax */
+		dec_init_kn01();
+		break;
+	case MACH_DS5100:	/* DS5100 MIPSmate */
+		dec_init_kn230();
+		break;
+	case MACH_DS5000_200:	/* DS5000/200 3max */
+		dec_init_kn02();
+		break;
+	case MACH_DS5000_1XX:	/* DS5000/1xx 3min */
+		dec_init_kn02ba();
+		break;
+	case MACH_DS5000_2X0:	/* DS5000/240 3max+ */
+		dec_init_kn03();
+		break;
+	case MACH_DS5000_XX:	/* Personal DS5000/xx */
+		dec_init_kn02ca();
+		break;
+	case MACH_DS5800:	/* DS5800 Isis */
+		panic("Don't know how to set this up!");
+		break;
+	case MACH_DS5400:	/* DS5400 MIPSfair */
+		panic("Don't know how to set this up!");
+		break;
+	case MACH_DS5500:	/* DS5500 MIPSfair-2 */
+		panic("Don't know how to set this up!");
+		break;
+	}
+	set_except_vector(0, decstation_handle_int);
+
+	/* Free the FPU interrupt if the exception is present. */
+	if (!(mips_cpu.options & MIPS_CPU_NOFPUEX)) {
+		cpu_fpu_mask = 0;
+		dec_interrupt[DEC_IRQ_FPU] = -1;
+	}
+
+	/* Register board interrupts: FPU and cascade. */
+	if (dec_interrupt[DEC_IRQ_FPU] >= 0)
+		setup_irq(dec_interrupt[DEC_IRQ_FPU], &fpuirq);
+	if (dec_interrupt[DEC_IRQ_CASCADE] >= 0)
+		setup_irq(dec_interrupt[DEC_IRQ_CASCADE], &ioirq);
+
+	/* Register the HALT interrupt. */
+	if (dec_interrupt[DEC_IRQ_HALT] >= 0)
+		setup_irq(dec_interrupt[DEC_IRQ_HALT], &haltirq);
+}
+
+EXPORT_SYMBOL(dec_interrupt);
diff -urN linux-2.4.19-rc1/arch/mips/defconfig linux-2.4.19-rc2/arch/mips/defconfig
--- linux-2.4.19-rc1/arch/mips/defconfig	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,44 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 CONFIG_SGI_IP22=y
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_ARC32=y
 CONFIG_BOARD_SCACHE=y
 CONFIG_IRQ_CPU=y
@@ -51,15 +56,7 @@
 CONFIG_NEW_IRQ=y
 CONFIG_NEW_TIME_C=y
 CONFIG_NONCOHERENT_IO=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -89,21 +86,28 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
 CONFIG_BINFMT_IRIX=y
 CONFIG_FORWARD_KEYBOARD=y
 # CONFIG_ARC_CONSOLE is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -116,6 +120,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -123,7 +133,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -173,6 +185,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -190,6 +207,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -304,6 +326,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -344,11 +367,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 CONFIG_VT=y
@@ -372,6 +390,7 @@
 CONFIG_PSMOUSE=y
 # CONFIG_82C710_MOUSE is not set
 # CONFIG_PC110_PAD is not set
+# CONFIG_MK712_MOUSE is not set
 
 #
 # Joysticks
@@ -392,21 +411,25 @@
 #
 CONFIG_WATCHDOG=y
 # CONFIG_WATCHDOG_NOWAYOUT is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_WDT is not set
-# CONFIG_WDTPCI is not set
-# CONFIG_PCWATCHDOG is not set
 # CONFIG_ACQUIRE_WDT is not set
 # CONFIG_ADVANTECH_WDT is not set
+# CONFIG_ALIM7101_WDT is not set
+# CONFIG_SC520_WDT is not set
+# CONFIG_PCWATCHDOG is not set
 # CONFIG_EUROTECH_WDT is not set
 # CONFIG_IB700_WDT is not set
+# CONFIG_WAFER_WDT is not set
+CONFIG_INDYDOG=y
 # CONFIG_I810_TCO is not set
 # CONFIG_MIXCOMWD is not set
 # CONFIG_60XX_WDT is not set
+# CONFIG_SC1200_WDT is not set
+# CONFIG_SOFT_WATCHDOG is not set
 # CONFIG_W83877F_WDT is not set
+# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
 # CONFIG_MACHZ_WDT is not set
 CONFIG_INDYDOG=y
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -430,6 +453,7 @@
 #
 CONFIG_SGI_NEWPORT_CONSOLE=y
 CONFIG_FONT_8x16=y
+CONFIG_DUMMY_CONSOLE=y
 
 #
 # File systems
@@ -457,7 +481,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -557,103 +581,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-atlas linux-2.4.19-rc2/arch/mips/defconfig-atlas
--- linux-2.4.19-rc1/arch/mips/defconfig-atlas	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-atlas	Tue Jul 16 16:25:18 2002
@@ -10,51 +10,48 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 CONFIG_MIPS_ATLAS=y
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_NEW_IRQ=y
 CONFIG_NEW_TIME_C=y
 CONFIG_NONCOHERENT_IO=y
 CONFIG_PCI=y
 CONFIG_SWAP_IO_SPACE=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-# CONFIG_MODULES is not set
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -84,21 +81,27 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
 CONFIG_BINFMT_IRIX=y
 # CONFIG_FORWARD_KEYBOARD is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 # CONFIG_PCI_NAMES is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_SYSCTL is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -111,6 +114,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -118,7 +127,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 CONFIG_BLK_DEV_RAM=y
@@ -167,6 +178,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -184,6 +200,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -322,6 +343,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -362,11 +384,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -406,7 +423,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -451,7 +467,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -519,103 +535,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-cobalt linux-2.4.19-rc2/arch/mips/defconfig-cobalt
--- linux-2.4.19-rc1/arch/mips/defconfig-cobalt	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-cobalt	Tue Jul 16 16:25:18 2002
@@ -10,51 +10,48 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 CONFIG_MIPS_COBALT=y
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_COBALT_LCD=y
 CONFIG_PCI=y
 CONFIG_NEW_IRQ=y
 CONFIG_NEW_TIME_C=y
 CONFIG_NONCOHERENT_IO=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-# CONFIG_MODULES is not set
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -83,19 +80,25 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 # CONFIG_PCI_NAMES is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -108,6 +111,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -115,7 +124,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -161,6 +172,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -178,6 +194,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -201,6 +222,7 @@
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
 # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
 # CONFIG_BLK_DEV_IDEDISK_IBM is not set
@@ -215,6 +237,7 @@
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
 
 #
 # IDE chipset support/bugfixes
@@ -226,12 +249,15 @@
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 # CONFIG_IDEDMA_PCI_AUTO is not set
+# CONFIG_IDEDMA_ONLYDISK is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_PCI_WIP is not set
+# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
 # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
+CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_AEC62XX_TUNING is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
@@ -239,6 +265,7 @@
 # CONFIG_BLK_DEV_AMD74XX is not set
 # CONFIG_AMD74XX_OVERRIDE is not set
 # CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_CMD680 is not set
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
 # CONFIG_BLK_DEV_HPT34X is not set
@@ -353,6 +380,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -393,11 +421,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -437,7 +460,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -482,7 +504,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -563,107 +585,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-decstation linux-2.4.19-rc2/arch/mips/defconfig-decstation
--- linux-2.4.19-rc1/arch/mips/defconfig-decstation	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-decstation	Tue Jul 16 16:25:18 2002
@@ -10,49 +10,48 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 CONFIG_DECSTATION=y
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
+CONFIG_IRQ_CPU=y
+CONFIG_NEW_IRQ=y
 CONFIG_NONCOHERENT_IO=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -81,19 +80,25 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+CONFIG_TC=y
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
-CONFIG_TC=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -106,6 +111,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -113,7 +124,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -162,6 +175,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -179,6 +197,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -292,6 +315,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -332,11 +356,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -376,7 +395,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -430,7 +448,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -501,108 +519,19 @@
 # CONFIG_NLS is not set
 
 #
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
+# Sound
 #
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
+# CONFIG_SOUND is not set
 
 #
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
+# USB support
 #
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB is not set
 
 #
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-ev64120 linux-2.4.19-rc2/arch/mips/defconfig-ev64120
--- linux-2.4.19-rc1/arch/mips/defconfig-ev64120	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-ev64120	Tue Jul 16 16:25:18 2002
@@ -10,57 +10,54 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 CONFIG_MIPS_EV64120=y
 # CONFIG_EVB_PCI1 is not set
 # CONFIG_SYSCLK_75 is not set
 # CONFIG_SYSCLK_83 is not set
 CONFIG_SYSCLK_100=y
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_PCI=y
 # CONFIG_ISA is not set
 CONFIG_MIPS_GT64120=y
 CONFIG_NONCOHERENT_IO=y
 CONFIG_OLD_TIME_C=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -90,21 +87,27 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
 # CONFIG_BINFMT_IRIX is not set
 # CONFIG_FORWARD_KEYBOARD is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 # CONFIG_PCI_NAMES is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -117,6 +120,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -124,7 +133,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -172,6 +183,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -189,6 +205,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -290,6 +311,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -337,11 +359,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -381,7 +398,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -494,107 +510,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-ev96100 linux-2.4.19-rc2/arch/mips/defconfig-ev96100
--- linux-2.4.19-rc1/arch/mips/defconfig-ev96100	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-ev96100	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,44 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 CONFIG_MIPS_EV96100=y
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_PCI=y
 CONFIG_MIPS_GT96100=y
 CONFIG_NEW_IRQ=y
@@ -50,15 +55,7 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_PCI_AUTO=y
 CONFIG_SWAP_IO_SPACE=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_KMOD is not set
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -89,21 +86,27 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
 # CONFIG_BINFMT_IRIX is not set
 # CONFIG_FORWARD_KEYBOARD is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -116,6 +119,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -123,7 +132,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -171,6 +182,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -188,6 +204,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -292,6 +313,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -332,11 +354,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -376,7 +393,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -421,7 +437,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -489,107 +505,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-hp-lj linux-2.4.19-rc2/arch/mips/defconfig-hp-lj
--- linux-2.4.19-rc1/arch/mips/defconfig-hp-lj	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-hp-lj	Tue Jul 16 16:25:18 2002
@@ -21,7 +21,7 @@
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
+CONFIG_MIPS_MALTA=y
 # CONFIG_NINO is not set
 # CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
@@ -37,27 +37,26 @@
 # CONFIG_MIPS_PB1000 is not set
 # CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-CONFIG_HP_LASERJET=y
+# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 # CONFIG_MCA is not set
 # CONFIG_SBUS is not set
-CONFIG_IRQ_CPU=y
-CONFIG_NEW_TIME_C=y
+CONFIG_I8259=y
+CONFIG_PCI=y
+CONFIG_HAVE_STD_PC_SERIAL_PORT=y
 CONFIG_NEW_IRQ=y
-CONFIG_NEW_PCI=y
+CONFIG_NEW_TIME_C=y
 CONFIG_NONCOHERENT_IO=y
-CONFIG_PCI=y
+CONFIG_SWAP_IO_SPACE=y
 # CONFIG_ISA is not set
 # CONFIG_EISA is not set
 
 #
 # Loadable module support
 #
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_MODULES is not set
 
 #
 # CPU selection
@@ -69,18 +68,19 @@
 # CONFIG_CPU_R4300 is not set
 # CONFIG_CPU_R4X00 is not set
 # CONFIG_CPU_TX49XX is not set
-CONFIG_CPU_R5000=y
+# CONFIG_CPU_R5000 is not set
 # CONFIG_CPU_R5432 is not set
 # CONFIG_CPU_RM7000 is not set
 # CONFIG_CPU_NEVADA is not set
 # CONFIG_CPU_R10000 is not set
 # CONFIG_CPU_SB1 is not set
-# CONFIG_CPU_MIPS32 is not set
+CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_MIPS64 is not set
+CONFIG_CPU_HAS_PREFETCH=y
 # CONFIG_64BIT_PHYS_ADDR is not set
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_LLDSCD=y
+# CONFIG_CPU_HAS_LLDSCD is not set
 # CONFIG_CPU_HAS_WB is not set
 
 #
@@ -99,76 +99,12 @@
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+# CONFIG_SYSCTL is not set
 
 #
 # Memory Technology Devices (MTD)
 #
-CONFIG_MTD=y
-CONFIG_MTD_DEBUG=y
-CONFIG_MTD_DEBUG_VERBOSE=3
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_AMDSTD=y
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
-# CONFIG_MTD_AMDSTD is not set
-# CONFIG_MTD_SHARP is not set
-# CONFIG_MTD_JEDEC is not set
-
-#
-# Mapping drivers for chip access
-#
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_START=10040000
-CONFIG_MTD_PHYSMAP_LEN=00fc0000
-CONFIG_MTD_PHYSMAP_BUSWIDTH=4
-# CONFIG_MTD_PB1000 is not set
-# CONFIG_MTD_PB1500 is not set
-# CONFIG_MTD_CSTM_MIPS_IXX is not set
-# CONFIG_MTD_OCELOT is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
-
-#
-# NAND Flash Device Drivers
-#
-CONFIG_MTD_NAND=y
-# CONFIG_MTD_NAND_ECC is not set
-# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD is not set
 
 #
 # Parallel port support
@@ -178,7 +114,7 @@
 #
 # Block devices
 #
-# CONFIG_BLK_DEV_FD is not set
+CONFIG_BLK_DEV_FD=y
 # CONFIG_BLK_DEV_XD is not set
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
@@ -186,7 +122,8 @@
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_BLK_DEV_INITRD is not set
 
 #
@@ -204,8 +141,7 @@
 #
 # Networking options
 #
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
+# CONFIG_PACKET is not set
 # CONFIG_NETLINK_DEV is not set
 # CONFIG_NETFILTER is not set
 # CONFIG_FILTER is not set
@@ -214,7 +150,7 @@
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_DHCP is not set
 # CONFIG_IP_PNP_BOOTP is not set
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
@@ -258,86 +194,81 @@
 #
 # ATA/IDE/MFM/RLL support
 #
-CONFIG_IDE=y
-
-#
-# IDE, ATA and ATAPI Block devices
-#
-CONFIG_BLK_DEV_IDE=y
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
 
 #
-# Please see Documentation/ide.txt for help/info on IDE drives
+# SCSI support
 #
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
-# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
-# CONFIG_BLK_DEV_IDEDISK_IBM is not set
-# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
-# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
-# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
-# CONFIG_BLK_DEV_IDEDISK_WD is not set
-# CONFIG_BLK_DEV_COMMERIAL is not set
-# CONFIG_BLK_DEV_TIVO is not set
-# CONFIG_BLK_DEV_IDECS is not set
-# CONFIG_BLK_DEV_IDECD is not set
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
-
-#
-# IDE chipset support/bugfixes
-#
-CONFIG_BLK_DEV_CMD640=y
-CONFIG_BLK_DEV_CMD640_ENHANCED=y
-# CONFIG_BLK_DEV_ISAPNP is not set
-# CONFIG_BLK_DEV_RZ1000 is not set
-CONFIG_BLK_DEV_IDEPCI=y
-# CONFIG_IDEPCI_SHARE_IRQ is not set
-CONFIG_BLK_DEV_IDEDMA_PCI=y
-CONFIG_BLK_DEV_ADMA=y
-# CONFIG_BLK_DEV_OFFBOARD is not set
-CONFIG_IDEDMA_PCI_AUTO=y
-CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_IDEDMA_PCI_WIP is not set
-# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
-# CONFIG_BLK_DEV_AEC62XX is not set
-# CONFIG_AEC62XX_TUNING is not set
-# CONFIG_BLK_DEV_ALI15X3 is not set
-# CONFIG_WDC_ALI15X3 is not set
-# CONFIG_BLK_DEV_AMD74XX is not set
-# CONFIG_AMD74XX_OVERRIDE is not set
-# CONFIG_BLK_DEV_CMD64X is not set
-# CONFIG_BLK_DEV_CY82C693 is not set
-# CONFIG_BLK_DEV_CS5530 is not set
-# CONFIG_BLK_DEV_HPT34X is not set
-# CONFIG_HPT34X_AUTODMA is not set
-# CONFIG_BLK_DEV_HPT366 is not set
-# CONFIG_BLK_DEV_NS87415 is not set
-# CONFIG_BLK_DEV_OPTI621 is not set
-# CONFIG_BLK_DEV_PDC202XX is not set
-# CONFIG_PDC202XX_BURST is not set
-# CONFIG_PDC202XX_FORCE is not set
-# CONFIG_BLK_DEV_SVWKS is not set
-# CONFIG_BLK_DEV_SIS5513 is not set
-# CONFIG_BLK_DEV_SLC90E66 is not set
-# CONFIG_BLK_DEV_TRM290 is not set
-# CONFIG_BLK_DEV_VIA82CXXX is not set
-# CONFIG_IDE_CHIPSETS is not set
-CONFIG_IDEDMA_AUTO=y
-# CONFIG_IDEDMA_IVB is not set
-# CONFIG_DMA_NONPCI is not set
-CONFIG_BLK_DEV_IDE_MODES=y
-# CONFIG_BLK_DEV_ATARAID is not set
-# CONFIG_BLK_DEV_ATARAID_PDC is not set
-# CONFIG_BLK_DEV_ATARAID_HPT is not set
+CONFIG_SCSI=y
 
 #
-# SCSI support
+# SCSI support type (disk, tape, CD-ROM)
 #
-# CONFIG_SCSI is not set
+CONFIG_BLK_DEV_SD=y
+CONFIG_SD_EXTRA_DEVS=40
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_DEBUG_QUEUES is not set
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_AM53C974 is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_DMA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_NCR53C8XX is not set
+# CONFIG_SCSI_SYM53C8XX is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_ISP is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_DEBUG is not set
 
 #
 # I2O device support
@@ -380,14 +311,12 @@
 # CONFIG_HP100 is not set
 # CONFIG_NET_ISA is not set
 CONFIG_NET_PCI=y
-# CONFIG_PCNET32 is not set
+CONFIG_PCNET32=y
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_APRICOT is not set
 # CONFIG_CS89x0 is not set
-CONFIG_TULIP=y
+# CONFIG_TULIP is not set
 # CONFIG_TC35815 is not set
-# CONFIG_TULIP_MWI is not set
-# CONFIG_TULIP_MMIO is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_DGRS is not set
 # CONFIG_DM9102 is not set
@@ -433,17 +362,7 @@
 #
 # Wireless LAN (non-hamradio)
 #
-CONFIG_NET_RADIO=y
-# CONFIG_STRIP is not set
-# CONFIG_WAVELAN is not set
-# CONFIG_ARLAN is not set
-# CONFIG_AIRONET4500 is not set
-# CONFIG_AIRONET4500_NONCS is not set
-# CONFIG_AIRONET4500_PROC is not set
-# CONFIG_AIRO is not set
-# CONFIG_HERMES is not set
-# CONFIG_PLX_HERMES is not set
-CONFIG_NET_WIRELESS=y
+# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
@@ -486,7 +405,8 @@
 CONFIG_SERIAL_CONSOLE=y
 # CONFIG_SERIAL_EXTENDED is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_UNIX98_PTYS is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 
 #
 # I2C support
@@ -519,7 +439,7 @@
 # CONFIG_WATCHDOG is not set
 # CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
+CONFIG_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -540,7 +460,7 @@
 # File systems
 #
 # CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS_FS=y
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
@@ -557,13 +477,12 @@
 # CONFIG_MSDOS_FS is not set
 # CONFIG_UMSDOS_FS is not set
 # CONFIG_VFAT_FS is not set
-# CONFIG_EFS_FS is not set
+CONFIG_EFS_FS=y
 # CONFIG_JFFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=3
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-CONFIG_RAMFS=m
+# CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -576,7 +495,7 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
@@ -593,13 +512,12 @@
 # CONFIG_CODA_FS is not set
 # CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
+# CONFIG_NFS_V3 is not set
 CONFIG_ROOT_NFS=y
 # CONFIG_NFSD is not set
 # CONFIG_NFSD_V3 is not set
 CONFIG_SUNRPC=y
 CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
 # CONFIG_SMB_FS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_NCPFS_PACKET_SIGNING is not set
@@ -643,10 +561,6 @@
 #
 # CONFIG_USB_AUDIO is not set
 # CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
 # CONFIG_USB_STORAGE is not set
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
@@ -747,7 +661,7 @@
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
-CONFIG_REMOTE_DEBUG=y
+# CONFIG_REMOTE_DEBUG is not set
 # CONFIG_GDB_CONSOLE is not set
 # CONFIG_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-ip22 linux-2.4.19-rc2/arch/mips/defconfig-ip22
--- linux-2.4.19-rc1/arch/mips/defconfig-ip22	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-ip22	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,44 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 CONFIG_SGI_IP22=y
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_ARC32=y
 CONFIG_BOARD_SCACHE=y
 CONFIG_IRQ_CPU=y
@@ -51,15 +56,7 @@
 CONFIG_NEW_IRQ=y
 CONFIG_NEW_TIME_C=y
 CONFIG_NONCOHERENT_IO=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -89,21 +86,28 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
 CONFIG_BINFMT_IRIX=y
 CONFIG_FORWARD_KEYBOARD=y
 # CONFIG_ARC_CONSOLE is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -116,6 +120,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -123,7 +133,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -173,6 +185,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -190,6 +207,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -304,6 +326,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -344,11 +367,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 CONFIG_VT=y
@@ -372,6 +390,7 @@
 CONFIG_PSMOUSE=y
 # CONFIG_82C710_MOUSE is not set
 # CONFIG_PC110_PAD is not set
+# CONFIG_MK712_MOUSE is not set
 
 #
 # Joysticks
@@ -392,21 +411,25 @@
 #
 CONFIG_WATCHDOG=y
 # CONFIG_WATCHDOG_NOWAYOUT is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_WDT is not set
-# CONFIG_WDTPCI is not set
-# CONFIG_PCWATCHDOG is not set
 # CONFIG_ACQUIRE_WDT is not set
 # CONFIG_ADVANTECH_WDT is not set
+# CONFIG_ALIM7101_WDT is not set
+# CONFIG_SC520_WDT is not set
+# CONFIG_PCWATCHDOG is not set
 # CONFIG_EUROTECH_WDT is not set
 # CONFIG_IB700_WDT is not set
+# CONFIG_WAFER_WDT is not set
+CONFIG_INDYDOG=y
 # CONFIG_I810_TCO is not set
 # CONFIG_MIXCOMWD is not set
 # CONFIG_60XX_WDT is not set
+# CONFIG_SC1200_WDT is not set
+# CONFIG_SOFT_WATCHDOG is not set
 # CONFIG_W83877F_WDT is not set
+# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
 # CONFIG_MACHZ_WDT is not set
 CONFIG_INDYDOG=y
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -430,6 +453,7 @@
 #
 CONFIG_SGI_NEWPORT_CONSOLE=y
 CONFIG_FONT_8x16=y
+CONFIG_DUMMY_CONSOLE=y
 
 #
 # File systems
@@ -457,7 +481,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -557,103 +581,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-ivr linux-2.4.19-rc2/arch/mips/defconfig-ivr
--- linux-2.4.19-rc1/arch/mips/defconfig-ivr	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-ivr	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,44 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+CONFIG_MIPS_IVR=y
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-CONFIG_MIPS_IVR=y
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_PCI=y
 CONFIG_PC_KEYB=y
 CONFIG_NEW_PCI=y
@@ -51,15 +56,7 @@
 CONFIG_IT8172_CIR=y
 CONFIG_NEW_IRQ=y
 CONFIG_NEW_TIME_C=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -88,19 +85,25 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -113,6 +116,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -120,7 +129,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -169,6 +180,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -186,6 +202,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -209,6 +230,7 @@
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
 # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
 # CONFIG_BLK_DEV_IDEDISK_IBM is not set
@@ -223,6 +245,7 @@
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
 
 #
 # IDE chipset support/bugfixes
@@ -234,12 +257,15 @@
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_PCI_WIP is not set
+# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
 # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
+CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_AEC62XX_TUNING is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
@@ -247,6 +273,7 @@
 # CONFIG_BLK_DEV_AMD74XX is not set
 # CONFIG_AMD74XX_OVERRIDE is not set
 # CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_CMD680 is not set
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
 # CONFIG_BLK_DEV_HPT34X is not set
@@ -365,6 +392,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -405,11 +433,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 CONFIG_VT=y
@@ -475,7 +498,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -520,7 +542,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -607,8 +629,9 @@
 # CONFIG_USB_LONG_TIMEOUT is not set
 
 #
-# USB Controllers
+# USB Host Controller Drivers
 #
+# CONFIG_USB_EHCI_HCD is not set
 # CONFIG_USB_UHCI is not set
 # CONFIG_USB_UHCI_ALT is not set
 CONFIG_USB_OHCI=y
@@ -617,6 +640,7 @@
 # USB Device Class drivers
 #
 # CONFIG_USB_AUDIO is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_BLUETOOTH is not set
 
 #
@@ -638,6 +662,7 @@
 # USB Human Interface Devices (HID)
 #
 CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT is not set
 # CONFIG_USB_HIDDEV is not set
 # CONFIG_USB_WACOM is not set
 
@@ -662,6 +687,7 @@
 # USB Network adaptors
 #
 # CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_CATC is not set
 # CONFIG_USB_CDCETHER is not set
@@ -707,6 +733,13 @@
 # USB Miscellaneous drivers
 #
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_BRLVGER is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-malta linux-2.4.19-rc2/arch/mips/defconfig-malta
--- linux-2.4.19-rc1/arch/mips/defconfig-malta	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-malta	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,42 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-CONFIG_MIPS_MALTA=y
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+CONFIG_MIPS_MALTA=y
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_I8259=y
 CONFIG_PCI=y
 CONFIG_HAVE_STD_PC_SERIAL_PORT=y
@@ -50,13 +53,8 @@
 CONFIG_NEW_TIME_C=y
 CONFIG_NONCOHERENT_IO=y
 CONFIG_SWAP_IO_SPACE=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-# CONFIG_MODULES is not set
+CONFIG_PC_KEYB=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -77,6 +75,7 @@
 CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_MIPS64 is not set
 CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_VTAG_ICACHE is not set
 # CONFIG_64BIT_PHYS_ADDR is not set
 # CONFIG_CPU_ADVANCED is not set
 CONFIG_CPU_HAS_LLSC=y
@@ -87,19 +86,25 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 # CONFIG_PCI_NAMES is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_SYSCTL is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -112,6 +117,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 CONFIG_BLK_DEV_FD=y
@@ -119,7 +130,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 CONFIG_BLK_DEV_RAM=y
@@ -168,6 +181,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -185,6 +203,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -353,6 +376,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -393,11 +417,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -437,7 +456,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -482,7 +500,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -550,103 +568,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-osprey linux-2.4.19-rc2/arch/mips/defconfig-osprey
--- linux-2.4.19-rc1/arch/mips/defconfig-osprey	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-osprey	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,44 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 CONFIG_NEC_OSPREY=y
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_VR4181=y
 CONFIG_SERIAL=y
 CONFIG_SERIAL_MANY_PORTS=y
@@ -52,15 +57,7 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_DUMMY_KEYB=y
 # CONFIG_SCSI is not set
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -89,18 +86,25 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -113,6 +117,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -120,7 +130,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -169,6 +181,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -186,6 +203,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -193,27 +215,11 @@
 # CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
 # SCSI support
 #
 # CONFIG_SCSI is not set
 
 #
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -255,6 +261,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -295,11 +302,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 CONFIG_VT=y
@@ -340,7 +342,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -385,7 +386,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -464,107 +465,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-pb1000 linux-2.4.19-rc2/arch/mips/defconfig-pb1000
--- linux-2.4.19-rc1/arch/mips/defconfig-pb1000	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-pb1000	Tue Jul 16 16:25:18 2002
@@ -10,40 +10,45 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+CONFIG_MIPS_PB1000=y
+CONFIG_PCI_AUTO=y
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-CONFIG_MIPS_PB1000=y
-CONFIG_PCI_AUTO=y
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_MIPS_AU1000=y
 CONFIG_NEW_IRQ=y
 CONFIG_PCI=y
@@ -51,15 +56,6 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_PC_KEYB=y
 MAX_HWIFS=1
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
 
 #
 # CPU selection
@@ -80,6 +76,7 @@
 CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_MIPS64 is not set
 CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_VTAG_ICACHE is not set
 # CONFIG_64BIT_PHYS_ADDR is not set
 CONFIG_CPU_ADVANCED=y
 CONFIG_CPU_HAS_LLSC=y
@@ -90,14 +87,13 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 CONFIG_HOTPLUG=y
 
 #
@@ -105,9 +101,9 @@
 #
 CONFIG_PCMCIA=m
 # CONFIG_CARDBUS is not set
+# CONFIG_TCIC is not set
 # CONFIG_I82092 is not set
 # CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
 CONFIG_PCMCIA_AU1000=m
 
 #
@@ -116,9 +112,16 @@
 # CONFIG_HOTPLUG_PCI is not set
 # CONFIG_HOTPLUG_PCI_COMPAQ is not set
 # CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+# CONFIG_HOTPLUG_PCI_ACPI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -126,6 +129,7 @@
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
 # CONFIG_MTD_REDBOOT_PARTS is not set
 
 #
@@ -161,11 +165,13 @@
 # CONFIG_MTD_PB1500 is not set
 # CONFIG_MTD_CSTM_MIPS_IXX is not set
 # CONFIG_MTD_OCELOT is not set
+# CONFIG_MTD_PCI is not set
 
 #
 # Self-contained MTD device drivers
 #
 # CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_MS02NV is not set
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_MTDRAM is not set
 # CONFIG_MTD_BLKMTD is not set
@@ -189,6 +195,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -196,7 +208,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -245,6 +259,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -262,6 +281,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -285,6 +309,7 @@
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
 # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
 # CONFIG_BLK_DEV_IDEDISK_IBM is not set
@@ -299,6 +324,7 @@
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
 
 #
 # IDE chipset support/bugfixes
@@ -375,6 +401,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -420,11 +447,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -484,7 +506,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -537,7 +558,7 @@
 CONFIG_JFFS2_FS_DEBUG=0
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -612,7 +633,6 @@
 # CONFIG_SOUND_ICH is not set
 # CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
-# CONFIG_SOUND_HAL2 is not set
 CONFIG_SOUND_AU1000=y
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
@@ -628,107 +648,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-pb1500 linux-2.4.19-rc2/arch/mips/defconfig-pb1500
--- linux-2.4.19-rc1/arch/mips/defconfig-pb1500	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-pb1500	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,44 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+CONFIG_MIPS_PB1500=y
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-CONFIG_MIPS_PB1500=y
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_MIPS_AU1000=y
 CONFIG_NEW_IRQ=y
 CONFIG_PCI=y
@@ -50,15 +55,6 @@
 CONFIG_NEW_PCI=y
 CONFIG_NONCOHERENT_IO=y
 CONFIG_PC_KEYB=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
 
 #
 # CPU selection
@@ -79,6 +75,7 @@
 CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_MIPS64 is not set
 CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_VTAG_ICACHE is not set
 # CONFIG_64BIT_PHYS_ADDR is not set
 CONFIG_CPU_ADVANCED=y
 CONFIG_CPU_HAS_LLSC=y
@@ -89,14 +86,13 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_PM is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 CONFIG_HOTPLUG=y
 
 #
@@ -104,9 +100,9 @@
 #
 CONFIG_PCMCIA=m
 # CONFIG_CARDBUS is not set
+# CONFIG_TCIC is not set
 # CONFIG_I82092 is not set
 # CONFIG_I82365 is not set
-# CONFIG_TCIC is not set
 # CONFIG_PCMCIA_AU1000 is not set
 
 #
@@ -115,9 +111,16 @@
 # CONFIG_HOTPLUG_PCI is not set
 # CONFIG_HOTPLUG_PCI_COMPAQ is not set
 # CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+# CONFIG_HOTPLUG_PCI_ACPI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -125,6 +128,7 @@
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
 # CONFIG_MTD_REDBOOT_PARTS is not set
 
 #
@@ -162,11 +166,13 @@
 # CONFIG_MTD_PB1500_USER is not set
 # CONFIG_MTD_CSTM_MIPS_IXX is not set
 # CONFIG_MTD_OCELOT is not set
+# CONFIG_MTD_PCI is not set
 
 #
 # Self-contained MTD device drivers
 #
 # CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_MS02NV is not set
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_MTDRAM is not set
 # CONFIG_MTD_BLKMTD is not set
@@ -190,6 +196,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -197,7 +209,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -245,6 +259,7 @@
 # CONFIG_IP_NF_CONNTRACK is not set
 # CONFIG_IP_NF_QUEUE is not set
 # CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
 # CONFIG_IP_NF_COMPAT_IPCHAINS is not set
 # CONFIG_IP_NF_COMPAT_IPFWADM is not set
 # CONFIG_IPV6 is not set
@@ -257,6 +272,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -274,6 +294,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -297,6 +322,7 @@
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
 # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
 # CONFIG_BLK_DEV_IDEDISK_IBM is not set
@@ -311,6 +337,7 @@
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
 
 #
 # IDE chipset support/bugfixes
@@ -322,12 +349,15 @@
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-CONFIG_BLK_DEV_ADMA=y
 CONFIG_BLK_DEV_OFFBOARD=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_PCI_WIP is not set
+# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
 # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
+CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_AEC62XX_TUNING is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
@@ -335,6 +365,7 @@
 # CONFIG_BLK_DEV_AMD74XX is not set
 # CONFIG_AMD74XX_OVERRIDE is not set
 # CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_CMD680 is not set
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
 # CONFIG_BLK_DEV_HPT34X is not set
@@ -448,6 +479,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -511,11 +543,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 CONFIG_VT=y
@@ -598,7 +625,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -653,7 +679,7 @@
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_CRAMFS=m
 CONFIG_TMPFS=y
-CONFIG_RAMFS=m
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -767,12 +793,14 @@
 # CONFIG_FB_RIVA is not set
 # CONFIG_FB_CLGEN is not set
 # CONFIG_FB_PM2 is not set
+# CONFIG_FB_PM3 is not set
 # CONFIG_FB_CYBER2000 is not set
 # CONFIG_FB_MATROX is not set
 # CONFIG_FB_ATY is not set
 # CONFIG_FB_RADEON is not set
 # CONFIG_FB_ATY128 is not set
 # CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
 # CONFIG_FB_3DFX is not set
 # CONFIG_FB_VOODOO1 is not set
 # CONFIG_FB_TRIDENT is not set
@@ -817,7 +845,6 @@
 # CONFIG_SOUND_ICH is not set
 # CONFIG_SOUND_RME96XX is not set
 # CONFIG_SOUND_SONICVIBES is not set
-# CONFIG_SOUND_HAL2 is not set
 CONFIG_SOUND_AU1000=y
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
@@ -841,8 +868,9 @@
 # CONFIG_USB_LONG_TIMEOUT is not set
 
 #
-# USB Controllers
+# USB Host Controller Drivers
 #
+# CONFIG_USB_EHCI_HCD is not set
 # CONFIG_USB_UHCI is not set
 # CONFIG_USB_UHCI_ALT is not set
 CONFIG_USB_OHCI=y
@@ -851,6 +879,7 @@
 # USB Device Class drivers
 #
 # CONFIG_USB_AUDIO is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_BLUETOOTH is not set
 
 #
@@ -872,6 +901,7 @@
 # USB Human Interface Devices (HID)
 #
 CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT is not set
 # CONFIG_USB_HIDDEV is not set
 # CONFIG_USB_WACOM is not set
 
@@ -896,6 +926,7 @@
 # USB Network adaptors
 #
 # CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_CATC is not set
 # CONFIG_USB_CDCETHER is not set
@@ -941,6 +972,13 @@
 # USB Miscellaneous drivers
 #
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_BRLVGER is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-rm200 linux-2.4.19-rc2/arch/mips/defconfig-rm200
--- linux-2.4.19-rc1/arch/mips/defconfig-rm200	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-rm200	Tue Jul 16 16:25:18 2002
@@ -10,39 +10,44 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_NINO is not set
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_MIPS_MAGNUM_4000 is not set
+# CONFIG_MIPS_MALTA is not set
 # CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
+# CONFIG_NINO is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 CONFIG_SNI_RM200_PCI=y
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_ARC32=y
 CONFIG_I8259=y
 CONFIG_ISA=y
@@ -51,14 +56,7 @@
 CONFIG_OLD_TIME_C=y
 CONFIG_PC_KEYB=y
 CONFIG_PCI=y
-CONFIG_EISA=y
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -88,26 +86,25 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
 # CONFIG_ARC_CONSOLE is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
 # CONFIG_PCI_NAMES is not set
+CONFIG_EISA=y
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 # CONFIG_SYSVIPC is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
-
-#
-# Plug and Play configuration
-#
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -120,6 +117,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 CONFIG_BLK_DEV_FD=y
@@ -127,7 +130,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -173,6 +178,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -190,6 +200,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -283,7 +298,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -328,7 +342,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -420,107 +434,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/defconfig-sb1250-swarm linux-2.4.19-rc2/arch/mips/defconfig-sb1250-swarm
--- linux-2.4.19-rc1/arch/mips/defconfig-sb1250-swarm	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/defconfig-sb1250-swarm	Tue Jul 16 16:25:18 2002
@@ -10,19 +10,38 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_ACER_PICA_61 is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1500 is not set
 # CONFIG_ALGOR_P4032 is not set
 # CONFIG_BAGET_MIPS is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_DECSTATION is not set
-# CONFIG_DDB5074 is not set
 # CONFIG_MIPS_EV64120 is not set
 # CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_HP_LASERJET is not set
+# CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MAGNUM_4000 is not set
 # CONFIG_MIPS_MALTA is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_NEC_OSPREY is not set
+# CONFIG_OLIVETTI_M700 is not set
 # CONFIG_NINO is not set
+# CONFIG_SGI_IP22 is not set
 CONFIG_SIBYTE_SB1250=y
 # CONFIG_PCI is not set
 # CONFIG_SIBYTE_SB1250_PROF is not set
@@ -33,37 +52,16 @@
 # CONFIG_L3DEMO is not set
 CONFIG_SIBYTE_SWARM_MAX_MEM_REGIONS=16
 CONFIG_SMP=y
-# CONFIG_MIPS_MAGNUM_4000 is not set
-# CONFIG_MOMENCO_OCELOT is not set
-# CONFIG_DDB5476 is not set
-# CONFIG_DDB5477 is not set
-# CONFIG_NEC_OSPREY is not set
-# CONFIG_OLIVETTI_M700 is not set
-# CONFIG_SGI_IP22 is not set
 # CONFIG_SNI_RM200_PCI is not set
-# CONFIG_MIPS_ITE8172 is not set
-# CONFIG_MIPS_IVR is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1500 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_HP_LASERJET is not set
 # CONFIG_HIGHMEM is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 CONFIG_NEW_IRQ=y
-CONFIG_SWAP_IO_SPACE=y
 CONFIG_NEW_TIME_C=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+CONFIG_DUMMY_KEYB=y
+CONFIG_SWAP_IO_SPACE=y
+# CONFIG_MIPS_AU1000 is not set
 
 #
 # CPU selection
@@ -97,20 +95,27 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_KCORE_ELF=y
-CONFIG_ELF_KERNEL=y
 # CONFIG_BINFMT_IRIX is not set
 # CONFIG_FORWARD_KEYBOARD is not set
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
 CONFIG_NET=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_TC is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_SYSCTL is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_PM is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -123,6 +128,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -130,11 +141,12 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=9220
+# CONFIG_BLK_DEV_RAM is not set
 # CONFIG_BLK_DEV_INITRD is not set
 
 #
@@ -176,6 +188,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -193,6 +210,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -200,27 +222,11 @@
 # CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
 # SCSI support
 #
 # CONFIG_SCSI is not set
 
 #
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -240,6 +246,7 @@
 #
 CONFIG_NET_ETHERNET=y
 CONFIG_NET_SB1250_MAC=y
+CONFIG_NET_SB1250_MAC=y
 # CONFIG_SUNLANCE is not set
 # CONFIG_SUNBMAC is not set
 # CONFIG_SUNQE is not set
@@ -262,6 +269,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -302,11 +310,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -338,7 +341,8 @@
 CONFIG_SERIAL_CONSOLE=y
 CONFIG_SB1250_DUART_OUTPUT_BUF_SIZE=1024
 # CONFIG_SIBYTE_SB1250_DUART_NO_PORT_1 is not set
-# CONFIG_UNIX98_PTYS is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
 
 #
 # I2C support
@@ -369,7 +373,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -402,8 +405,8 @@
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
@@ -413,8 +416,8 @@
 # CONFIG_JFFS_FS is not set
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
-# CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_TMPFS=y
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -427,11 +430,11 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
+CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_QNX4FS_RW is not set
 # CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UDF_FS is not set
 # CONFIG_UDF_RW is not set
@@ -483,107 +486,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/Makefile linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/Makefile
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/Makefile	Tue Jul 16 16:25:18 2002
@@ -10,10 +10,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 all:	ev64120.o int-handler.o
 
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/Makefile linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/Makefile
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/Makefile	Tue Jul 16 16:25:18 2002
@@ -41,6 +41,8 @@
 #
 # =============================================================
 
+USE_STANDARD_AS_RULE := true
+
 all: ramsys.srec \
      flashsys.srec \
      flashsys2.srec \
@@ -66,11 +68,6 @@
 flashdrv.o:
 	$(CC) $(CFLAGS) $(CFLAGS_2) -c flashdrv.c -o $*.o
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
-
 gz2asm: gz2asm.c
 	g++ -o gz2asm gz2asm.c
 
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/burner.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/burner.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/burner.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/burner.c	Tue Jul 16 16:25:18 2002
@@ -6,8 +6,6 @@
  *  Burn image from ram to flash 
  *  For use with Galileo EVB64120A MIPS eval board.
  */
-
-#include <linux/config.h>
 #include <asm/types.h>
 #include <asm/byteorder.h>
 #include <asm/galileo-boards/evb64120A/eeprom_param.h>
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/evb64120A_Setup.c	Tue Jul 16 16:25:18 2002
@@ -6,8 +6,6 @@
  *  Xfer an image from flash to ram.
  *  For use with Galileo EVB64120A MIPS eval board.
  */
-
-#include <linux/config.h>
 #include "ns16550.h"
 #include <linux/serial_reg.h>
 #include <asm/galileo-boards/evb64120A/pci.h>
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/gt64011.h linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/gt64011.h
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/gt64011.h	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/gt64011.h	Tue Jul 16 16:25:18 2002
@@ -3,7 +3,7 @@
  * Copyright (c) 1998 Algorithmics Ltd
  */
 
-#ifdef __ASSEMBLER__
+#ifdef __ASSEMBLY__
 
 /* offsets from base register */
 #define GT64011(x)		(x)
@@ -20,7 +20,7 @@
 /* #define ltohl(x) (x) */
 #endif
 
-#else				/* !__ASSEMBLER */
+#else /* !__ASSEMBLY__ */
 
 /* offsets from base pointer, this construct allows optimisation */
 static char *const _gt64011p = (char *) PA_TO_KVA1(GT64011_BASE);
@@ -44,7 +44,7 @@
 #define htoll(x) (x)
 #define ltohl(x) (x)
 #endif
-#endif				/* __ASSEMBLER__ */
+#endif /* __ASSEMBLY__ */
 /* CPU configuration */
 #define GT_CPU_CFG	GT64011(0x000)
 #define GT_CPU_CFG_WriteMode	(1<<11)
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/ns16550.h linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/ns16550.h
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/ns16550.h	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/ns16550.h	Tue Jul 16 16:25:18 2002
@@ -11,7 +11,7 @@
 #define NS16550_HZ      3686400
 #endif
 
-#ifdef __ASSEMBLER__
+#ifdef __ASSEMBLY__
 
 #ifndef NSREG
 #define NSREG(x) ((x)*4)
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/pci_etherboot.c	Tue Jul 16 16:25:18 2002
@@ -4,12 +4,12 @@
  * published by the Free Software Foundation; either version 2, or (at
  * your option) any later version.
  */
-
-#include "etherboot.h"
+#include <linux/config.h>
 #include <asm/galileo-boards/evb64120A/pci.h>
 #include <asm/byteorder.h>
+
+#include "etherboot.h"
 #include "pci_etherboot.h"
-//#include "gt64120ARegs.h"
 #include "galileo_port.h"
 
 #define MAX_PCI_DEVS 10
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/sbd.h linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/sbd.h
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/sbd.h	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/sbd.h	Tue Jul 16 16:25:18 2002
@@ -28,7 +28,7 @@
 #define RAMMS		ASMDELAY(1000000, CACHEMISS+RAMCYCLE)
 #define ROMMS		ASMDELAY(1000000, CACHEMISS+ROMCYCLE)
 
-#ifndef __ASSEMBLER__
+#ifndef __ASSEMBLY__
 #define nsdelay(ns)	mips_cycle (ASMDELAY (ns, CACHECYCLE))
 #define usdelay(us)	mips_cycle (ASMDELAY ((us)*1000, CACHECYCLE))
 #endif
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/compressed/sbdreset_evb64120A.S	Tue Jul 16 16:25:18 2002
@@ -6,7 +6,6 @@
  */
 
 #ifdef EVB64120A
-#include <linux/config.h>
 
 #include <asm/asm.h>
 #include <asm/regdef.h>
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/int-handler.S linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/int-handler.S
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/int-handler.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/int-handler.S	Tue Jul 16 16:25:18 2002
@@ -3,7 +3,6 @@
  *
  * Based on the cobalt handler.
  */
-#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
 #include <asm/addrspace.h>
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/irq.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/irq.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/irq.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/irq.c	Tue Jul 16 16:25:18 2002
@@ -27,6 +27,7 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/promcon.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/promcon.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/promcon.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/promcon.c	Tue Jul 16 16:25:18 2002
@@ -7,43 +7,28 @@
  * Derived from DECstation promcon.c
  * Copyright (c) 1998 Harald Koerfgen 
  */
-
 #include <linux/tty.h>
 #include <linux/major.h>
 #include <linux/ptrace.h>
 #include <linux/init.h>
 #include <linux/console.h>
 #include <linux/fs.h>
-/*
-#include <asm/sgialib.h>
-*/
 
 static void prom_console_write(struct console *co, const char *s,
 			       unsigned count)
 {
 	extern int CONSOLE_CHANNEL;	// The default serial port
 	unsigned i;
-	/*
-	 *    Now, do each character
-	 */
+
 	for (i = 0; i < count; i++) {
 		if (*s == 10)
 			serial_putc(CONSOLE_CHANNEL, 13);
 		serial_putc(CONSOLE_CHANNEL, *s++);
 	}
 }
-int prom_getchar(void)
-{
-	return 0;
-}
-static int prom_console_wait_key(struct console *co)
-{
-	return prom_getchar();
-}
 
-static int __init prom_console_setup(struct console *co, char *options)
+int prom_getchar(void)
 {
-
 	return 0;
 }
 
@@ -53,20 +38,13 @@
 }
 
 static struct console sercons = {
-	"ttyS",
-	prom_console_write,
-	NULL,
-	prom_console_device,
-	prom_console_wait_key,
-	NULL,
-	prom_console_setup,
-	CON_PRINTBUFFER,
-	-1,
-	0,
-	NULL
+    name:	"ttyS",
+    write:	prom_console_write,
+    device:	prom_console_device,
+    flags:	CON_PRINTBUFFER,
+    index:	-1,
 };
 
-
 /*
  *    Register console.
  */
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/setup.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/setup.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev64120/setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev64120/setup.c	Tue Jul 16 16:25:18 2002
@@ -51,6 +51,7 @@
 #include <asm/ptrace.h>
 #include <asm/reboot.h>
 #include <asm/mc146818rtc.h>
+#include <asm/traps.h>
 #include <linux/version.h>
 #include <linux/bootmem.h>
 
@@ -105,6 +106,10 @@
 	&galileo_rtc_bcd_mode
 };
 
+
+void __init bus_error_init(void) { /* nothing */ }
+
+
 /********************************************************************
  *ev64120_setup -
  *
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev96100/Makefile linux-2.4.19-rc2/arch/mips/galileo-boards/ev96100/Makefile
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev96100/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev96100/Makefile	Tue Jul 16 16:25:18 2002
@@ -10,10 +10,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET:= ev96100.o
 
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev96100/init.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev96100/init.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev96100/init.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev96100/init.c	Tue Jul 16 16:25:18 2002
@@ -33,13 +33,12 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/bootmem.h>
-#include <asm/addrspace.h>
-#include <asm/bootinfo.h>
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
 #include <asm/galileo-boards/ev96100.h>
 
 
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/ev96100/time.c linux-2.4.19-rc2/arch/mips/galileo-boards/ev96100/time.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/ev96100/time.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/ev96100/time.c	Tue Jul 16 16:25:18 2002
@@ -33,18 +33,15 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
+#include <linux/timex.h>
 
 #include <asm/mipsregs.h>
 #include <asm/ptrace.h>
 
-#include <linux/timex.h>
-
 
 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
 
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/generic/Makefile linux-2.4.19-rc2/arch/mips/galileo-boards/generic/Makefile
--- linux-2.4.19-rc1/arch/mips/galileo-boards/generic/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/generic/Makefile	Tue Jul 16 16:25:18 2002
@@ -27,10 +27,7 @@
 #
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET:= galboards.o
 
diff -urN linux-2.4.19-rc1/arch/mips/galileo-boards/generic/reset.c linux-2.4.19-rc2/arch/mips/galileo-boards/generic/reset.c
--- linux-2.4.19-rc1/arch/mips/galileo-boards/generic/reset.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/galileo-boards/generic/reset.c	Tue Jul 16 16:25:18 2002
@@ -32,7 +32,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <asm/io.h>
diff -urN linux-2.4.19-rc1/arch/mips/hp-lj/Makefile linux-2.4.19-rc2/arch/mips/hp-lj/Makefile
--- linux-2.4.19-rc1/arch/mips/hp-lj/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/hp-lj/Makefile	Tue Jul 16 16:25:18 2002
@@ -7,8 +7,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 all: hp-lj.o
 
diff -urN linux-2.4.19-rc1/arch/mips/hp-lj/gdb_hook.c linux-2.4.19-rc2/arch/mips/hp-lj/gdb_hook.c
--- linux-2.4.19-rc1/arch/mips/hp-lj/gdb_hook.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/hp-lj/gdb_hook.c	Tue Jul 16 16:25:18 2002
@@ -22,8 +22,6 @@
  * This is the interface to the remote debugger stub.
  *
  */
-
-#include <linux/config.h>
 #include <linux/serialP.h>
 #include <linux/serial_reg.h>
 
diff -urN linux-2.4.19-rc1/arch/mips/hp-lj/utils.c linux-2.4.19-rc2/arch/mips/hp-lj/utils.c
--- linux-2.4.19-rc1/arch/mips/hp-lj/utils.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/hp-lj/utils.c	Tue Jul 16 16:25:18 2002
@@ -4,8 +4,6 @@
  *
  *
  */
-
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
diff -urN linux-2.4.19-rc1/arch/mips/kernel/Makefile linux-2.4.19-rc2/arch/mips/kernel/Makefile
--- linux-2.4.19-rc1/arch/mips/kernel/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(AFLAGS) $< -o $@
-.S.o:
-	$(CC) $(AFLAGS) -c $< -o $@
+USE_STANDARD_AS_RULE := true
 
 all:	kernel.o head.o init_task.o
 
diff -urN linux-2.4.19-rc1/arch/mips/kernel/entry.S linux-2.4.19-rc2/arch/mips/kernel/entry.S
--- linux-2.4.19-rc1/arch/mips/kernel/entry.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/entry.S	Tue Jul 16 16:25:18 2002
@@ -18,7 +18,7 @@
 #include <asm/errno.h>
 #include <asm/mipsregs.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <asm/pgtable-bits.h>
 #include <asm/stackframe.h>
 #include <asm/processor.h>
 #include <asm/regdef.h>
@@ -236,8 +236,8 @@
 
 		BUILD_HANDLER(adel,ade,ade,silent)		/* #4  */
 		BUILD_HANDLER(ades,ade,ade,silent)		/* #5  */
-		BUILD_HANDLER(ibe,ibe,cli,silent)		/* #6  */
-		BUILD_HANDLER(dbe,dbe,cli,silent)		/* #7  */
+		BUILD_HANDLER(ibe,be,cli,silent)		/* #6  */
+		BUILD_HANDLER(dbe,be,cli,silent)		/* #7  */
 		BUILD_HANDLER(bp,bp,sti,silent)			/* #9  */
 		BUILD_HANDLER(ri,ri,sti,silent)			/* #10 */
 		BUILD_HANDLER(cpu,cpu,sti,silent)		/* #11 */
diff -urN linux-2.4.19-rc1/arch/mips/kernel/gdb-stub.c linux-2.4.19-rc2/arch/mips/kernel/gdb-stub.c
--- linux-2.4.19-rc1/arch/mips/kernel/gdb-stub.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/gdb-stub.c	Tue Jul 16 16:25:18 2002
@@ -119,6 +119,7 @@
  *
  */
 
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
diff -urN linux-2.4.19-rc1/arch/mips/kernel/head.S linux-2.4.19-rc2/arch/mips/kernel/head.S
--- linux-2.4.19-rc1/arch/mips/kernel/head.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/head.S	Tue Jul 16 16:25:18 2002
@@ -21,21 +21,21 @@
 #include <asm/asm.h>
 #include <asm/current.h>
 #include <asm/offset.h>
-#include <asm/pgtable.h>
+#include <asm/pgtable-bits.h>
 #include <asm/processor.h>
 #include <asm/regdef.h>
 #include <asm/cachectl.h>
 #include <asm/mipsregs.h>
 #include <asm/stackframe.h>
 
-		__INIT
-
 		.text
 		/*
 		 * Reserved space for exception handlers.
 		 * Necessary for machines which link their kernels at KSEG0.
 		 */
-		.fill	0x280
+		.fill	0x400
+
+		__INIT
 
 		/* Cache Error */
 		LEAF(except_vec2_generic)
@@ -77,7 +77,7 @@
 		END(except_vec4)
 
 		/*
-		 * SBDDP EJTAG debug exception handler.
+		 * EJTAG debug exception handler.
 		 * The EJTAG debug exception entry point is 0xbfc00480, which
 		 * normally is in the boot PROM, so the boot PROM must do a
 		 * unconditional jump to this vector.
@@ -93,24 +93,56 @@
 		NESTED(ejtag_debug_handler, PT_SIZE, sp)
 		.set	noat
 		.set	noreorder
+		mtc0	k0, CP0_DESAVE
+		mfc0	k0, CP0_DEBUG	
+
+		sll	k0, k0, 30	# Check for SDBBP.
+		bgez	k0, ejtag_return
+
+		la	k0, ejtag_debug_buffer
+		sw	k1, 0(k0)
 		SAVE_ALL
-		PRINT("SDBBP EJTAG debug exception - not handled yet, just ignored!\n");
-		mfc0	k0, $23         # Get EJTAG Debug register.
-		mfc0    k1, $24         # Get DEPC register.
-		bgez	k0, 1f
-		 addiu	k1, k1, 4	# SBDDP inst. in delay slot.
-		addiu	k1, k1, 4
-1:		mtc0	k1, $24
+		jal	ejtag_exception_handler
+		 move	a0, sp
 		RESTORE_ALL
-		.word	0x4200001f      # deret, return EJTAG debug exception.
+		la	k0, ejtag_debug_buffer
+		lw	k1, 0(k0)	
+
+ejtag_return:
+		mfc0	k0, CP0_DESAVE	
+		.word	0x4200001f     # DERET, return from EJTAG debug exception.
 		 nop
 		.set	at
 		END(ejtag_debug_handler)
+	
+		/*
+		* NMI debug exception handler for MIPS reference boards.
+		* The NMI debug exception entry point is 0xbfc00000, which
+		* normally is in the boot PROM, so the boot PROM must do a
+		* unconditional jump to this vector.
+		*/
+		NESTED(except_vec_nmi, 0, sp)
+		j       nmi_handler
+		 nop
+		END(except_vec_nmi)
+
+		NESTED(nmi_handler, PT_SIZE, sp)
+		.set    noat
+		.set    noreorder
+		.set    mips3
+		SAVE_ALL
+		jal     nmi_exception_handler
+		 move   a0, sp
+		RESTORE_ALL
+		eret
+		.set    at
+		.set    mips0
+		END(nmi_handler)	
 
 		/*
 		 * Kernel entry point
 		 */
-NESTED(kernel_entry, 16, sp)
+		NESTED(kernel_entry, 16, sp)
 		.set	noreorder
 		/* The following two symbols are used for kernel profiling. */
 		EXPORT(stext)
@@ -156,7 +188,7 @@
 		mfc0	t0, CP0_STATUS
 		li	t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX)
 		and	t0, t1
-		or	t0, (ST0_CU0|ST0_FR);
+		or	t0, (ST0_CU0);
 		jal	start_secondary
 		mtc0	t0, CP0_STATUS
 		.set pop
@@ -165,23 +197,28 @@
 
 		__FINIT
 
+		/*
+		 * This buffer is reserved for the use of the EJTAG debug 
+		 * handler.
+		 */
+		.data
+		EXPORT(ejtag_debug_buffer)
+		.fill	4
+	
 		.comm	kernelsp,    NR_CPUS * 8, 8
 		.comm	pgd_current, NR_CPUS * 8, 8
 
-#undef PAGE_SIZE
-#define PAGE_SIZE	0x1000
-
 	.macro	page name, order=0
 	.globl	\name
-\name:	.size	\name, (PAGE_SIZE << \order)
-	.org	. + (PAGE_SIZE << \order)
+\name:	.size	\name, (_PAGE_SIZE << \order)
+	.org	. + (_PAGE_SIZE << \order)
 	.type	\name, @object
 	.endm
 
 	.data
 	.align	12
 
-	page	swapper_pg_dir, PGD_ORDER
+	page	swapper_pg_dir, _PGD_ORDER
 	page	empty_bad_page, 0
 	page	empty_bad_page_table, 0
 	page	invalid_pte_table, 0
diff -urN linux-2.4.19-rc1/arch/mips/kernel/irixelf.c linux-2.4.19-rc2/arch/mips/kernel/irixelf.c
--- linux-2.4.19-rc1/arch/mips/kernel/irixelf.c	Mon Mar 19 12:35:09 2001
+++ linux-2.4.19-rc2/arch/mips/kernel/irixelf.c	Tue Jul 16 16:25:18 2002
@@ -23,7 +23,6 @@
 #include <linux/string.h>
 #include <linux/file.h>
 #include <linux/fcntl.h>
-#include <linux/ptrace.h>
 #include <linux/slab.h>
 #include <linux/shm.h>
 #include <linux/personality.h>
@@ -32,6 +31,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
+#include <asm/ptrace.h>
 #include <asm/mipsregs.h>
 #include <asm/prctl.h>
 
diff -urN linux-2.4.19-rc1/arch/mips/kernel/irq.c linux-2.4.19-rc2/arch/mips/kernel/irq.c
--- linux-2.4.19-rc1/arch/mips/kernel/irq.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/irq.c	Tue Jul 16 16:25:18 2002
@@ -76,13 +76,13 @@
 
 int get_irq_list(char *buf)
 {
+	int i, j;
 	struct irqaction * action;
 	char *p = buf;
-	int i;
 
 	p += sprintf(p, "           ");
-	for (i=0; i < 1 /*smp_num_cpus*/; i++)
-		p += sprintf(p, "CPU%d       ", i);
+	for (j=0; j<smp_num_cpus; j++)
+		p += sprintf(p, "CPU%d       ",j);
 	*p++ = '\n';
 
 	for (i = 0 ; i < NR_IRQS ; i++) {
@@ -90,7 +90,13 @@
 		if (!action) 
 			continue;
 		p += sprintf(p, "%3d: ",i);
+#ifndef CONFIG_SMP
 		p += sprintf(p, "%10u ", kstat_irqs(i));
+#else
+		for (j = 0; j < smp_num_cpus; j++)
+			p += sprintf(p, "%10u ",
+				kstat.irqs[cpu_logical_map(j)][i]);
+#endif
 		p += sprintf(p, " %14s", irq_desc[i].handler->typename);
 		p += sprintf(p, "  %s", action->name);
 
@@ -98,7 +104,8 @@
 			p += sprintf(p, ", %s", action->name);
 		*p++ = '\n';
 	}
-	p += sprintf(p, "ERR: %10lu\n", irq_err_count);
+	p += sprintf(p, "\n");
+	p += sprintf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
 	return p - buf;
 }
 
diff -urN linux-2.4.19-rc1/arch/mips/kernel/irq_cpu.c linux-2.4.19-rc2/arch/mips/kernel/irq_cpu.c
--- linux-2.4.19-rc1/arch/mips/kernel/irq_cpu.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/irq_cpu.c	Tue Jul 16 16:25:18 2002
@@ -14,15 +14,17 @@
  * Almost all MIPS CPUs define 8 interrupt sources.  They are typically
  * level triggered (i.e., cannot be cleared from CPU; must be cleared from
  * device).  The first two are software interrupts.  The last one is 
- * usually cpu timer interrupt if coutner register is present.
+ * usually the CPU timer interrupt if counter register is present or, for
+ * CPUs with an external FPU, by convention it's the FPU exception interrupt.
  *
  * This file exports one global function:
- *	mips_cpu_irq_init(u32 irq_base);
+ *	void mips_cpu_irq_init(int irq_base);
  */
+#include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/types.h>
 #include <linux/kernel.h>
 
+#include <asm/irq_cpu.h>
 #include <asm/mipsregs.h>
 
 static int mips_cpu_irq_base = -1;
@@ -65,7 +67,7 @@
 }
 
 static hw_irq_controller mips_cpu_irq_controller = {
-	"CPU_irq",
+	"MIPS",
 	mips_cpu_irq_startup,
 	mips_cpu_irq_shutdown,
 	mips_cpu_irq_enable,
@@ -76,9 +78,9 @@
 };
 
 
-void mips_cpu_irq_init(u32 irq_base)
+void __init mips_cpu_irq_init(int irq_base)
 {
-	u32 i;
+	int i;
 
 	for (i = irq_base; i < irq_base + 8; i++) {
 		irq_desc[i].status = IRQ_DISABLED;
diff -urN linux-2.4.19-rc1/arch/mips/kernel/mips_ksyms.c linux-2.4.19-rc2/arch/mips/kernel/mips_ksyms.c
--- linux-2.4.19-rc1/arch/mips/kernel/mips_ksyms.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/mips_ksyms.c	Tue Jul 16 16:25:18 2002
@@ -25,6 +25,7 @@
 #include <asm/pgalloc.h>
 #include <asm/semaphore.h>
 #include <asm/sgi/sgihpc.h>
+#include <asm/sgi/sgimc.h>
 #include <asm/softirq.h>
 #include <asm/uaccess.h>
 #ifdef CONFIG_BLK_DEV_FD
@@ -107,6 +108,8 @@
 
 #ifdef CONFIG_SGI_IP22
 EXPORT_SYMBOL(hpc3c0);
+EXPORT_SYMBOL(hpc3c1);
+EXPORT_SYMBOL(mcmisc_regs);
 #endif
 
 /*
diff -urN linux-2.4.19-rc1/arch/mips/kernel/pci.c linux-2.4.19-rc2/arch/mips/kernel/pci.c
--- linux-2.4.19-rc1/arch/mips/kernel/pci.c	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/arch/mips/kernel/pci.c	Tue Jul 16 16:25:18 2002
@@ -55,6 +55,7 @@
  *		Dave Rusling david.rusling@reo.mts.dec.com
  *		David Mosberger davidm@cs.arizona.edu
  */
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
diff -urN linux-2.4.19-rc1/arch/mips/kernel/proc.c linux-2.4.19-rc2/arch/mips/kernel/proc.c
--- linux-2.4.19-rc1/arch/mips/kernel/proc.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/proc.c	Tue Jul 16 16:25:18 2002
@@ -59,14 +59,15 @@
 	[CPU_TX3912]	"TX3912",
 	[CPU_TX3922]	"TX3922",
 	[CPU_TX3927]	"TX3927",
-        [CPU_AU1000]	"Au1000",
-        [CPU_AU1500]	"Au1500",
+	[CPU_AU1000]	"Au1000",
+	[CPU_AU1500]	"Au1500",
 	[CPU_4KEC]	"MIPS 4KEc",
 	[CPU_4KSC]	"MIPS 4KSc",
 	[CPU_VR41XX]	"NEC Vr41xx",
 	[CPU_R5500]	"R5500",
 	[CPU_TX49XX]	"TX49xx",
-        [CPU_TX39XX]	"TX39xx"
+	[CPU_TX39XX]	"TX39xx",
+	[CPU_20KC]	"MIPS 20Kc"
 };
 
 
@@ -78,7 +79,7 @@
 	char fmt [64];
 
 #ifdef CONFIG_SMP
-	if (!(cpu_online_map & (1<<n)))
+	if (!CPUMASK_TSTB(cpu_online_map, n))
 		return 0;
 #endif
 
diff -urN linux-2.4.19-rc1/arch/mips/kernel/process.c linux-2.4.19-rc2/arch/mips/kernel/process.c
--- linux-2.4.19-rc1/arch/mips/kernel/process.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/process.c	Tue Jul 16 16:25:18 2002
@@ -6,7 +6,6 @@
  * Copyright (C) 1994 - 2000 by Ralf Baechle and others.
  * Copyright (C) 1999 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -14,7 +13,6 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/personality.h>
-#include <linux/ptrace.h>
 #include <linux/slab.h>
 #include <linux/mman.h>
 #include <linux/sys.h>
@@ -27,7 +25,7 @@
 #include <asm/system.h>
 #include <asm/mipsregs.h>
 #include <asm/processor.h>
-#include <asm/stackframe.h>
+#include <asm/ptrace.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/elf.h>
@@ -196,7 +194,7 @@
 #define first_sched	((unsigned long) scheduling_functions_start_here)
 #define last_sched	((unsigned long) scheduling_functions_end_here)
 
-/* get_wchan - a maintenance nightmare ...  */
+/* get_wchan - a maintenance nightmare^W^Wpain in the ass ...  */
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long frame, pc;
@@ -217,26 +215,29 @@
 		goto schedule_timeout_caller;
 	if (pc >= (unsigned long)interruptible_sleep_on)
 		goto schedule_caller;
-	goto schedule_timeout_caller;
+	/* Fall through */
 
 schedule_caller:
-	frame = ((unsigned long *)p->thread.reg30)[9];
-	pc    = ((unsigned long *)frame)[11];
+	pc = ((unsigned long *)p->thread.reg30)[13];
+
 	return pc;
 
 schedule_timeout_caller:
-	/* Must be schedule_timeout ...  */
-	pc    = ((unsigned long *)p->thread.reg30)[10];
-	frame = ((unsigned long *)p->thread.reg30)[9];
-
-	/* The schedule_timeout frame ...  */
-	pc    = ((unsigned long *)frame)[14];
-	frame = ((unsigned long *)frame)[13];
+	/*
+	 * The schedule_timeout frame
+	 */
+	frame = ((unsigned long *)p->thread.reg30)[13];
+
+	/*
+	 * frame now points to sleep_on_timeout's frame
+	 */
+	frame = ((unsigned long *)frame)[9];
+	pc    = ((unsigned long *)frame)[10];
 
 	if (pc >= first_sched && pc < last_sched) {
 		/* schedule_timeout called by interruptible_sleep_on_timeout */
-		pc    = ((unsigned long *)frame)[11];
-		frame = ((unsigned long *)frame)[10];
+		frame = ((unsigned long *)frame)[9];
+		pc    = ((unsigned long *)frame)[10];
 	}
 
 	return pc;
diff -urN linux-2.4.19-rc1/arch/mips/kernel/r2300_switch.S linux-2.4.19-rc2/arch/mips/kernel/r2300_switch.S
--- linux-2.4.19-rc1/arch/mips/kernel/r2300_switch.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/r2300_switch.S	Tue Jul 16 16:25:18 2002
@@ -10,6 +10,7 @@
  * Further modifications to make this work:
  * Copyright (c) 1998-2000 Harald Koerfgen
  */
+#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/cachectl.h>
 #include <asm/current.h>
@@ -17,7 +18,7 @@
 #include <asm/mipsregs.h>
 #include <asm/offset.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <asm/pgtable-bits.h>
 #include <asm/processor.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
@@ -71,7 +72,7 @@
 
 LEAF(lazy_fpu_switch)
 	mfc0	t0, CP0_STATUS			# enable cp1
-	li	t3, 0x20000000
+	li	t3, ST0_CU1
 	or	t0, t3
 	mtc0	t0, CP0_STATUS
 
@@ -117,7 +118,7 @@
 
 LEAF(init_fpu)
 	mfc0	t0, CP0_STATUS
-	li	t1, 0x20000000
+	li	t1, ST0_CU1
 	or	t0, t1
 	mtc0	t0, CP0_STATUS
 
diff -urN linux-2.4.19-rc1/arch/mips/kernel/r4k_switch.S linux-2.4.19-rc2/arch/mips/kernel/r4k_switch.S
--- linux-2.4.19-rc1/arch/mips/kernel/r4k_switch.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/r4k_switch.S	Tue Jul 16 16:25:18 2002
@@ -18,7 +18,7 @@
 #include <asm/mipsregs.h>
 #include <asm/offset.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <asm/pgtable-bits.h>
 #include <asm/processor.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
@@ -77,7 +77,7 @@
 
 LEAF(lazy_fpu_switch)
 	mfc0	t0, CP0_STATUS			# enable cp1
-	li	t3, 0x20000000
+	li	t3, ST0_CU1
 	or	t0, t3
 	mtc0	t0, CP0_STATUS
 
@@ -126,7 +126,7 @@
 LEAF(init_fpu)
 	.set	mips3
 	mfc0	t0, CP0_STATUS
-	li	t1, 0x20000000
+	li	t1, ST0_CU1
 	or	t0, t1
 	mtc0	t0, CP0_STATUS
 
diff -urN linux-2.4.19-rc1/arch/mips/kernel/scall_o32.S linux-2.4.19-rc2/arch/mips/kernel/scall_o32.S
--- linux-2.4.19-rc1/arch/mips/kernel/scall_o32.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/scall_o32.S	Tue Jul 16 16:25:18 2002
@@ -6,8 +6,9 @@
  * Copyright (C) 1997, 1998, 1999, 2000, 2001 by Ralf Baechle
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <asm/asm.h>
+#include <linux/config.h>
 #include <linux/errno.h>
+#include <asm/asm.h>
 #include <asm/current.h>
 #include <asm/mipsregs.h>
 #include <asm/regdef.h>
@@ -16,12 +17,6 @@
 #include <asm/sysmips.h>
 #include <asm/unistd.h>
 
-/* This duplicates the definition from <linux/sched.h> */
-#define PT_TRACESYS	0x00000002	/* tracing system calls */
-
-/* This duplicates the definition from <asm/signal.h> */
-#define SIGILL		4		/* Illegal instruction (ANSI).  */
-
 /* Highest syscall used of any syscall flavour */
 #define MAX_SYSCALL_NO	__NR_Linux + __NR_Linux_syscalls
 
@@ -271,3 +266,69 @@
 	beq	a0, MIPS_ATOMIC_SET, mips_atomic_set
 	j	_sys_sysmips
 	END(sys_sysmips)
+
+	LEAF(sys_syscall)
+	lw	t0, PT_R29(sp)			# user sp
+
+	sltu	v0, a0, __NR_Linux + __NR_Linux_syscalls + 1
+	beqz	v0, enosys
+
+	sll	v0, t1, 2
+	la	v1, sys_syscall
+	lw	t2, sys_call_table(v0)		# function pointer
+	lbu	t4, sys_narg_table(t1)		# number of arguments
+
+	li	v0, -EINVAL
+	beq	t2, v1, out			# do not recurse
+
+	beqz	t2, enosys			# null function pointer?
+
+	andi	v0, t0, 0x3			# unaligned stack pointer?
+	bnez	v0, sigsegv
+
+	addu	v0, t0, 16			# v0 = usp + 16
+	addu	t1, v0, 12			# 3 32-bit arguments
+	lw	v1, THREAD_CURDS($28)
+	or	v0, v0, t1
+	and	v1, v1, v0
+	bltz	v1, efault
+
+	move	a0, a1				# shit argument registers
+	move	a1, a2
+	move	a2, a3
+
+1:	lw	a3, 16(t0)
+2:	lw	t3, 20(t0)
+3:	lw	t4, 24(t0)
+
+	.section	__ex_table, "a"
+	.word	1b, efault
+	.word	2b, efault
+	.word	3b, efault
+	.previous
+
+	sw	t3, 16(sp)			# put into new stackframe
+	sw	t4, 20(sp)
+
+	bnez	t4, 1f				# zero arguments?
+	addu	a0, sp, 32			# then pass sp in a0
+1:
+
+	sw	t3, 16(sp)
+	sw	v1, 20(sp)
+	jr	t2
+	/* Unreached */
+
+enosys:	li	v0, -ENOSYS
+	b	out
+
+sigsegv:
+	li	a0, _SIGSEGV
+	move	a1, $28
+	jal	force_sig
+	/* Fall through */
+
+efault:	li	v0, -EFAULT
+
+out:	jr	ra
+	END(sys_syscall)
diff -urN linux-2.4.19-rc1/arch/mips/kernel/setup.c linux-2.4.19-rc2/arch/mips/kernel/setup.c
--- linux-2.4.19-rc1/arch/mips/kernel/setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/setup.c	Tue Jul 16 16:25:18 2002
@@ -21,7 +21,6 @@
 #include <linux/stddef.h>
 #include <linux/string.h>
 #include <linux/unistd.h>
-#include <linux/ptrace.h>
 #include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/utsname.h>
@@ -37,11 +36,8 @@
 #include <asm/cachectl.h>
 #include <asm/cpu.h>
 #include <asm/io.h>
-#include <asm/stackframe.h>
+#include <asm/ptrace.h>
 #include <asm/system.h>
-#ifdef CONFIG_SGI_IP22
-#include <asm/sgialib.h>
-#endif
 
 #ifndef CONFIG_SMP
 struct cpuinfo_mips cpu_data[1];
@@ -150,6 +146,11 @@
 	case CPU_NEVADA:
 	case CPU_RM7000:
 	case CPU_TX49XX:
+	case CPU_4KC:
+	case CPU_4KEC:
+	case CPU_4KSC:
+	case CPU_5KC:
+/*	case CPU_20KC:*/
 		cpu_wait = r4k_wait;
 		printk(" available.\n");
 		break;
@@ -224,9 +225,26 @@
 static inline void cpu_probe(void)
 {
 #ifdef CONFIG_CPU_MIPS32
+	unsigned long config0 = read_32bit_cp0_register(CP0_CONFIG);
 	unsigned long config1;
-#endif
 
+        if (config0 & (1 << 31)) {
+		/* MIPS32 compliant CPU. Read Config 1 register. */
+		mips_cpu.isa_level = MIPS_CPU_ISA_M32;
+		mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
+			MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC;
+		config1 = read_mips32_cp0_config1();
+		if (config1 & (1 << 3))
+			mips_cpu.options |= MIPS_CPU_WATCH;
+		if (config1 & (1 << 2))
+			mips_cpu.options |= MIPS_CPU_MIPS16;
+		if (config1 & (1 << 1))
+			mips_cpu.options |= MIPS_CPU_EJTAG;
+		if (config1 & 1)
+			mips_cpu.options |= MIPS_CPU_FPU;
+		mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
+	}
+#endif
 	mips_cpu.processor_id = read_32bit_cp0_register(CP0_PRID);
 	switch (mips_cpu.processor_id & 0xff0000) {
 	case PRID_COMP_LEGACY:
@@ -234,7 +252,7 @@
 		case PRID_IMP_R2000:
 			mips_cpu.cputype = CPU_R2000;
 			mips_cpu.isa_level = MIPS_CPU_ISA_I;
-			mips_cpu.options = MIPS_CPU_TLB;
+			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX;
 			if (cpu_has_fpu())
 				mips_cpu.options |= MIPS_CPU_FPU;
 			mips_cpu.tlbsize = 64;
@@ -248,7 +266,7 @@
 			else
 				mips_cpu.cputype = CPU_R3000;
 			mips_cpu.isa_level = MIPS_CPU_ISA_I;
-			mips_cpu.options = MIPS_CPU_TLB;
+			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX;
 			if (cpu_has_fpu())
 				mips_cpu.options |= MIPS_CPU_FPU;
 			mips_cpu.tlbsize = 64;
@@ -273,7 +291,8 @@
 		case PRID_IMP_R4300:
 			mips_cpu.cputype = CPU_R4300;
 			mips_cpu.isa_level = MIPS_CPU_ISA_III;
-			mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR;
+			mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU |
+					   MIPS_CPU_32FPR;
 			mips_cpu.tlbsize = 32;
 			break;
 		case PRID_IMP_R4600:
@@ -410,6 +429,14 @@
 				           MIPS_CPU_COUNTER | MIPS_CPU_WATCH;
 			mips_cpu.tlbsize = 64;
 			break;
+		case PRID_IMP_R12000:
+			mips_cpu.cputype = CPU_R12000;
+			mips_cpu.isa_level = MIPS_CPU_ISA_IV;
+			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
+				           MIPS_CPU_FPU | MIPS_CPU_32FPR | 
+				           MIPS_CPU_COUNTER | MIPS_CPU_WATCH;
+			mips_cpu.tlbsize = 64;
+			break;
 		default:
 			mips_cpu.cputype = CPU_UNKNOWN;
 			break;
@@ -420,47 +447,20 @@
 		switch (mips_cpu.processor_id & 0xff00) {
 		case PRID_IMP_4KC:
 			mips_cpu.cputype = CPU_4KC;
-			goto cpu_4kc;
+			break;
 		case PRID_IMP_4KEC:
 			mips_cpu.cputype = CPU_4KEC;
-			goto cpu_4kc;
+			break;
 		case PRID_IMP_4KSC:
 			mips_cpu.cputype = CPU_4KSC;
-cpu_4kc:
-			/*
-			 * Why do we set all these options by default, THEN
-			 * query them??
-			 */
-			mips_cpu.isa_level = MIPS_CPU_ISA_M32;
-			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
-				           MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | 
-				           MIPS_CPU_DIVEC | MIPS_CPU_WATCH |
-			                   MIPS_CPU_MCHECK;
-			config1 = read_mips32_cp0_config1();
-			if (config1 & (1 << 3))
-				mips_cpu.options |= MIPS_CPU_WATCH;
-			if (config1 & (1 << 2))
-				mips_cpu.options |= MIPS_CPU_MIPS16;
-			if (config1 & 1)
-				mips_cpu.options |= MIPS_CPU_FPU;
-			mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
 			break;
 		case PRID_IMP_5KC:
 			mips_cpu.cputype = CPU_5KC;
 			mips_cpu.isa_level = MIPS_CPU_ISA_M64;
-			/* See comment above about querying options */
-			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
-				           MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | 
-				           MIPS_CPU_DIVEC | MIPS_CPU_WATCH |
-			                   MIPS_CPU_MCHECK;
-			config1 = read_mips32_cp0_config1();
-			if (config1 & (1 << 3))
-				mips_cpu.options |= MIPS_CPU_WATCH;
-			if (config1 & (1 << 2))
-				mips_cpu.options |= MIPS_CPU_MIPS16;
-			if (config1 & 1)
-				mips_cpu.options |= MIPS_CPU_FPU;
-			mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
+			break;
+		case PRID_IMP_20KC:
+			mips_cpu.cputype = CPU_20KC;
+			mips_cpu.isa_level = MIPS_CPU_ISA_M64;
 			break;
 		default:
 			mips_cpu.cputype = CPU_UNKNOWN;
@@ -475,18 +475,6 @@
 				mips_cpu.cputype = CPU_AU1500;
 			else
 				mips_cpu.cputype = CPU_AU1000;
-			mips_cpu.isa_level = MIPS_CPU_ISA_M32;
-			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
-					   MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | 
-					   MIPS_CPU_DIVEC | MIPS_CPU_WATCH;
-			config1 = read_mips32_cp0_config1();
-			if (config1 & (1 << 3))
-				mips_cpu.options |= MIPS_CPU_WATCH;
-			if (config1 & (1 << 2))
-				mips_cpu.options |= MIPS_CPU_MIPS16;
-			if (config1 & 1)
-				mips_cpu.options |= MIPS_CPU_FPU;
-			mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
 			break;
 		default:
 			mips_cpu.cputype = CPU_UNKNOWN;
@@ -549,11 +537,9 @@
 	 */
 	loadmmu();
 
-	/* Disable coprocessors and set FPU for 16 FPRs */
-	s = read_32bit_cp0_register(CP0_STATUS);
-	s &= ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
-	s |= ST0_CU0;
-	write_32bit_cp0_register(CP0_STATUS, s);
+	/* Disable coprocessors and set FPU for 16/32 FPR register model */
+	clear_cp0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
+	set_cp0_status(ST0_CU0);
 
 	start_kernel();
 }
@@ -580,8 +566,9 @@
 
 	for (i = 0; i < boot_mem_map.nr_map; i++) {
 		printk(" memory: %08Lx @ %08Lx ",
-			(unsigned long long) boot_mem_map.map[i].size,
-			(unsigned long long) boot_mem_map.map[i].addr);
+			(u64) boot_mem_map.map[i].size,
+		        (u64) boot_mem_map.map[i].addr);
+
 		switch (boot_mem_map.map[i].type) {
 		case BOOT_MEM_RAM:
 			printk("(usable)\n");
@@ -1045,7 +1032,7 @@
 		".set\tmips0");
 }
 
-int __init fpu_disable(char *s)
+static int __init fpu_disable(char *s)
 {
 	mips_cpu.options &= ~MIPS_CPU_FPU;
 	return 1;
diff -urN linux-2.4.19-rc1/arch/mips/kernel/smp.c linux-2.4.19-rc2/arch/mips/kernel/smp.c
--- linux-2.4.19-rc1/arch/mips/kernel/smp.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/smp.c	Tue Jul 16 16:25:18 2002
@@ -18,7 +18,6 @@
  * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
  * Copyright (C) 2000, 2001 Broadcom Corporation
  */ 
-#include <linux/config.h>
 #include <linux/cache.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
@@ -43,8 +42,11 @@
 /* Ze Big Kernel Lock! */
 spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 int smp_threads_ready;
+atomic_t smp_commenced = ATOMIC_INIT(0);
 int smp_num_cpus = 1;			/* Number that came online.  */
 cpumask_t cpu_online_map;		/* Bitmask of currently online CPUs */
+int __cpu_number_map[NR_CPUS];
+int __cpu_logical_map[NR_CPUS];
 struct cpuinfo_mips cpu_data[NR_CPUS];
 void (*volatile smp_cpu0_finalize)(void);
 
@@ -101,12 +103,14 @@
 	printk("Slave cpu booted successfully\n");
 	CPUMASK_SETB(cpu_online_map, cpu);
 	atomic_inc(&cpus_booted);
+	while (!atomic_read(&smp_commenced));
 	cpu_idle();
 }
 
 void __init smp_commence(void)
 {
-	/* Not sure what to do here yet */
+	wmb();
+	atomic_set(&smp_commenced, 1);
 }
 
 void smp_send_reschedule(int cpu)
@@ -140,7 +144,7 @@
 	if (wait)
 		atomic_set(&data.finished, 0);
 
-	spin_lock_bh(&call_lock);
+	spin_lock(&call_lock);
 	call_data = &data;
 
 	/* Send a message to all other CPUs and wait for them to respond */
@@ -156,7 +160,7 @@
 	if (wait)
 		while (atomic_read(&data.finished) != cpus)
 			barrier();
-	spin_unlock_bh(&call_lock);
+	spin_unlock(&call_lock);
 
 	return 0;
 }
@@ -308,6 +312,7 @@
 	local_flush_tlb_page(vma, page);
 }
 
+EXPORT_SYMBOL(smp_num_cpus);
 EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(cpu_data);
 EXPORT_SYMBOL(synchronize_irq);
diff -urN linux-2.4.19-rc1/arch/mips/kernel/syscall.c linux-2.4.19-rc2/arch/mips/kernel/syscall.c
--- linux-2.4.19-rc1/arch/mips/kernel/syscall.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/syscall.c	Tue Jul 16 16:25:18 2002
@@ -14,6 +14,7 @@
 #undef CONF_DEBUG_IRIX
 
 #include <linux/config.h>
+#include <linux/compiler.h>
 #include <linux/linkage.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
@@ -28,7 +29,7 @@
 #include <asm/offset.h>
 #include <asm/ptrace.h>
 #include <asm/signal.h>
-#include <asm/stackframe.h>
+#include <asm/shmparam.h>
 #include <asm/uaccess.h>
 
 extern asmlinkage void syscall_trace(void);
@@ -54,6 +55,59 @@
 	return res;
 }
 
+#define COLOUR_ALIGN(addr,pgoff)		\
+	((((addr)+SHMLBA-1)&~(SHMLBA-1)) +	\
+	 (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1)))
+
+unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
+	unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+	struct vm_area_struct * vmm;
+	int do_color_align;
+
+	if (flags & MAP_FIXED) {
+		/*
+		 * We do not accept a shared mapping if it would violate
+		 * cache aliasing constraints.
+		 */
+		if ((flags & MAP_SHARED) && (addr & (SHMLBA - 1)))
+			return -EINVAL;
+		return addr;
+	}
+
+	if (len > TASK_SIZE)
+		return -ENOMEM;
+	do_color_align = 0;
+	if (filp || (flags & MAP_SHARED))
+		do_color_align = 1;
+	if (addr) {
+		if (do_color_align)
+			addr = COLOUR_ALIGN(addr, pgoff);
+		else
+			addr = PAGE_ALIGN(addr);
+		vmm = find_vma(current->mm, addr);
+		if (TASK_SIZE - len >= addr &&
+		    (!vmm || addr + len <= vmm->vm_start))
+			return addr;
+	}
+	addr = TASK_UNMAPPED_BASE;
+	if (do_color_align)
+		addr = COLOUR_ALIGN(addr, pgoff);
+	else
+		addr = PAGE_ALIGN(addr);
+
+	for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
+		/* At this point:  (!vmm || addr < vmm->vm_end). */
+		if (TASK_SIZE - len < addr)
+			return -ENOMEM;
+		if (!vmm || addr + len <= vmm->vm_start)
+			return addr;
+		addr = vmm->vm_end;
+		if (do_color_align)
+			addr = COLOUR_ALIGN(addr, pgoff);
+	}
+}
+
 /* common code for old and new mmaps */
 static inline long
 do_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
@@ -184,76 +238,6 @@
 }
 
 /*
- * Do the indirect syscall syscall.
- * Don't care about kernel locking; the actual syscall will do it.
- *
- * XXX This is borken.
- */
-asmlinkage int sys_syscall(struct pt_regs regs)
-{
-	syscall_t syscall;
-	unsigned long syscallnr = regs.regs[4];
-	unsigned long a0, a1, a2, a3, a4, a5, a6;
-	int nargs, errno;
-
-	if (syscallnr > __NR_Linux + __NR_Linux_syscalls)
-		return -ENOSYS;
-
-	syscall = sys_call_table[syscallnr];
-	nargs = sys_narg_table[syscallnr];
-	/*
-	 * Prevent stack overflow by recursive
-	 * syscall(__NR_syscall, __NR_syscall,...);
-	 */
-	if (syscall == (syscall_t) sys_syscall) {
-		return -EINVAL;
-	}
-
-	if (syscall == NULL) {
-		return -ENOSYS;
-	}
-
-	if(nargs > 3) {
-		unsigned long usp = regs.regs[29];
-		unsigned long *sp = (unsigned long *) usp;
-		if(usp & 3) {
-			printk("unaligned usp -EFAULT\n");
-			force_sig(SIGSEGV, current);
-			return -EFAULT;
-		}
-		errno = verify_area(VERIFY_READ, (void *) (usp + 16),
-		                    (nargs - 3) * sizeof(unsigned long));
-		if(errno) {
-			return -EFAULT;
-		}
-		switch(nargs) {
-		case 7:
-			a3 = sp[4]; a4 = sp[5]; a5 = sp[6]; a6 = sp[7];
-			break;
-		case 6:
-			a3 = sp[4]; a4 = sp[5]; a5 = sp[6]; a6 = 0;
-			break;
-		case 5:
-			a3 = sp[4]; a4 = sp[5]; a5 = a6 = 0;
-			break;
-		case 4:
-			a3 = sp[4]; a4 = a5 = a6 = 0;
-			break;
-
-		default:
-			a3 = a4 = a5 = a6 = 0;
-			break;
-		}
-	} else {
-		a3 = a4 = a5 = a6 = 0;
-	}
-	a0 = regs.regs[5]; a1 = regs.regs[6]; a2 = regs.regs[7];
-	if(nargs == 0)
-		a0 = (unsigned long) &regs;
-	return syscall((void *)a0, a1, a2, a3, a4, a5, a6);
-}
-
-/*
  * If we ever come here the user sp is bad.  Zap the process right away.
  * Due to the bad stack signaling wouldn't work.
  * XXX kernel locking???
diff -urN linux-2.4.19-rc1/arch/mips/kernel/syscalls.h linux-2.4.19-rc2/arch/mips/kernel/syscalls.h
--- linux-2.4.19-rc1/arch/mips/kernel/syscalls.h	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/syscalls.h	Tue Jul 16 16:25:18 2002
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2002 by Ralf Baechle
  */
 
 /*
@@ -20,7 +20,7 @@
 SYS(sys_read, 3)
 SYS(sys_write, 3)
 SYS(sys_open, 3)				/* 4005 */
-SYS(sys_close, 3)
+SYS(sys_close, 1)
 SYS(sys_waitpid, 3)
 SYS(sys_creat, 2)
 SYS(sys_link, 2)
@@ -250,5 +250,8 @@
 SYS(sys_ni_syscall, 0)				/* reserved for removexattr */
 SYS(sys_ni_syscall, 0)				/* reserved for lremovexattr */
 SYS(sys_ni_syscall, 0)				/* 4235 res. for fremovexattr */
-SYS(sys_gettid, 0)
 SYS(sys_tkill, 2)
+SYS(sys_ni_syscall, 0)				/* res. for sendfile64 */
+SYS(sys_ni_syscall, 0)				/* res. for futex */
+SYS(sys_ni_syscall, 0)				/* res. for sched_setaffinity */
+SYS(sys_ni_syscall, 0)				/* 4240 res. for sched_getaffinity */
diff -urN linux-2.4.19-rc1/arch/mips/kernel/sysmips.c linux-2.4.19-rc2/arch/mips/kernel/sysmips.c
--- linux-2.4.19-rc1/arch/mips/kernel/sysmips.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/sysmips.c	Tue Jul 16 16:25:18 2002
@@ -6,7 +6,6 @@
  * Copyright (C) 1995, 1996, 1997, 2000, 2001 by Ralf Baechle
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/linkage.h>
 #include <linux/mm.h>
diff -urN linux-2.4.19-rc1/arch/mips/kernel/time.c linux-2.4.19-rc2/arch/mips/kernel/time.c
--- linux-2.4.19-rc1/arch/mips/kernel/time.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/time.c	Tue Jul 16 16:25:18 2002
@@ -39,6 +39,11 @@
 extern volatile unsigned long wall_jiffies;
 
 /*
+ * whether we emulate local_timer_interrupts for SMP machines.
+ */
+int emulate_local_timer_interrupt;
+
+/*
  * By default we provide the null RTC ops
  */
 static unsigned long null_rtc_get_time(void)
@@ -283,6 +288,42 @@
 
 
 /*
+ * local_timer_interrupt() does profiling and process accounting
+ * on a per-CPU basis.  
+ *
+ * In UP mode, it is invoked from the (global) timer_interrupt.  
+ *
+ * In SMP mode, it might invoked by per-CPU timer interrupt, or
+ * a broadcasted inter-processor interrupt which itself is triggered
+ * by the global timer interrupt.
+ */
+void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	if (!user_mode(regs)) {
+		if (prof_buffer && current->pid) {
+			extern int _stext;
+			unsigned long pc = regs->cp0_epc;
+
+			pc -= (unsigned long) &_stext;
+			pc >>= prof_shift;
+			/*
+			 * Dont ignore out-of-bounds pc values silently,
+			 * put them into the last histogram slot, so if
+			 * present, they will show up as a sharp peak.
+			 */
+			if (pc > prof_len-1)
+			pc = prof_len-1;
+			atomic_inc((atomic_t *)&prof_buffer[pc]);
+		}
+	}
+
+#ifdef CONFIG_SMP
+	/* in UP mode, update_process_times() is invoked by do_timer() */
+	update_process_times(user_mode(regs));
+#endif
+}
+
+/*
  * high-level timer interrupt service routines.  This function
  * is set as irqaction->handler and is invoked through do_IRQ.
  */
@@ -309,24 +350,6 @@
 
 	}
 
-	if(!user_mode(regs)) {
-		if (prof_buffer && current->pid) {
-			extern int _stext;
-			unsigned long pc = regs->cp0_epc;
-
-			pc -= (unsigned long) &_stext;
-			pc >>= prof_shift;
-			/*
-			 * Dont ignore out-of-bounds pc values silently,
-			 * put them into the last histogram slot, so if
-			 * present, they will show up as a sharp peak.
-			 */
-			if (pc > prof_len-1)
-			pc = prof_len-1;
-			atomic_inc((atomic_t *)&prof_buffer[pc]);
-		}
-	}
-
 	/*
 	 * call the generic timer interrupt handling
 	 */
@@ -359,6 +382,31 @@
 	if (!jiffies) {
 		timerhi = timerlo = 0;
 	}
+
+#if !defined(CONFIG_SMP)
+	/* 
+	 * In UP mode, we call local_timer_interrupt() to do profiling
+	 * and process accouting.  
+	 *
+	 * In SMP mode, local_timer_interrupt() is invoked by appropriate
+	 * low-level local timer interrupt handler.
+	 */
+	local_timer_interrupt(0, NULL, regs);
+
+#else	/* CONFIG_SMP */
+
+	if (emulate_local_timer_interrupt) {
+		/* 
+		 * this is the place where we send out inter-process
+		 * interrupts and let each CPU do its own profiling
+		 * and process accouting.
+		 *
+		 * Obviously we need to call local_timer_interrupt() for
+		 * the current CPU too.
+		 */
+		panic("Not implemented yet!!!");
+	}
+#endif	/* CONFIG_SMP */
 }
 
 asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs)
@@ -377,6 +425,21 @@
 		do_softirq();
 }
 
+asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs)
+{
+	int cpu = smp_processor_id();
+
+	irq_enter(cpu, irq);
+	kstat.irqs[cpu][irq]++;
+
+	/* we keep interrupt disabled all the time */
+	local_timer_interrupt(irq, NULL, regs);
+	
+	irq_exit(cpu, irq);
+
+	if (softirq_pending(cpu))
+		do_softirq();
+}
 
 /*
  * time_init() - it does the following things.
diff -urN linux-2.4.19-rc1/arch/mips/kernel/traps.c linux-2.4.19-rc2/arch/mips/kernel/traps.c
--- linux-2.4.19-rc1/arch/mips/kernel/traps.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/traps.c	Tue Jul 16 16:25:18 2002
@@ -10,6 +10,7 @@
  *
  * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000, 01 MIPS Technologies, Inc.
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -32,6 +33,7 @@
 #include <asm/siginfo.h>
 #include <asm/watch.h>
 #include <asm/system.h>
+#include <asm/traps.h>
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
 
@@ -66,8 +68,7 @@
 
 char watch_available = 0;
 
-void (*ibe_board_handler)(struct pt_regs *regs);
-void (*dbe_board_handler)(struct pt_regs *regs);
+int (*be_board_handler)(struct pt_regs *regs, int is_fixup);
 
 int kstack_depth_to_print = 24;
 
@@ -417,20 +418,35 @@
 #endif
 }
 
-static void default_be_board_handler(struct pt_regs *regs)
+asmlinkage void do_be(struct pt_regs *regs)
 {
 	unsigned long new_epc;
-	unsigned long fixup;
+	unsigned long fixup = 0;
 	int data = regs->cp0_cause & 4;
+	int action = MIPS_BE_FATAL;
 
-	if (data && !user_mode(regs)) {
+	if (data && !user_mode(regs))
 		fixup = search_dbe_table(regs->cp0_epc);
+
+	if (fixup)
+		action = MIPS_BE_FIXUP;
+
+	if (be_board_handler)
+		action = be_board_handler(regs, fixup != 0);
+
+	switch (action) {
+	case MIPS_BE_DISCARD:
+		return;
+	case MIPS_BE_FIXUP:
 		if (fixup) {
 			new_epc = fixup_exception(dpf_reg, fixup,
 						  regs->cp0_epc);
 			regs->cp0_epc = new_epc;
 			return;
 		}
+		break;
+	default:
+		break;
 	}
 
 	/*
@@ -443,16 +459,6 @@
 	force_sig(SIGBUS, current);
 }
 
-asmlinkage void do_ibe(struct pt_regs *regs)
-{
-	ibe_board_handler(regs);
-}
-
-asmlinkage void do_dbe(struct pt_regs *regs)
-{
-	dbe_board_handler(regs);
-}
-
 asmlinkage void do_ov(struct pt_regs *regs)
 {
 	if (compute_return_epc(regs))
@@ -487,24 +493,30 @@
 		sig = fpu_emulator_cop1Handler(regs);
 
 		/* 
-		 * We can't allow the emulated instruction to leave the
-		 * Unimplemented Operation bit set in $fcr31.
+		 * We can't allow the emulated instruction to leave any of 
+		 * the cause bit set in $fcr31.
 		 */
-		current->thread.fpu.soft.sr &= ~FPU_CSR_UNI_X;
+		current->thread.fpu.soft.sr &= ~FPU_CSR_ALL_X;
 
 		/* Restore the hardware register state */
 		restore_fp(current);
 
 		/* If something went wrong, signal */
 		if (sig)
+		{
+			/* 
+			 * Return EPC is not calculated in the FPU emulator, 
+			 * if a signal is being send. So we calculate it here.
+			 */
+			compute_return_epc(regs);
 			force_sig(sig, current);
+		}
 
 		return;
 	}
 
 	if (compute_return_epc(regs))
 		return;
-
 	force_sig(SIGFPE, current);
 }
 
@@ -687,7 +699,14 @@
 	sig = fpu_emulator_cop1Handler(regs);
 	last_task_used_math = current;
 	if (sig)
+	{
+		/* 
+		 * Return EPC is not calculated in the FPU emulator, if 
+		 * a signal is being send. So we calculate it here.
+		 */
+		compute_return_epc(regs);
 		force_sig(sig, current);
+	}
 	return;
 
 bad_cid:
@@ -797,6 +816,50 @@
 	panic("Can't handle the cache error!");
 }
 
+/*
+ * SDBBP EJTAG debug exception handler.
+ * We skip the instruction and return to the next instruction.
+ */
+void ejtag_exception_handler(struct pt_regs *regs)
+{
+        unsigned int depc, old_epc, debug;
+
+        printk("SDBBP EJTAG debug exception - not handled yet, just ignored!\n");
+        depc = read_32bit_cp0_register(CP0_DEPC);
+        debug = read_32bit_cp0_register(CP0_DEBUG);
+        printk("DEPC = %08x, DEBUG = %08x\n", depc, debug); 
+        if (debug & 0x80000000) {
+                /* 
+                 * In branch delay slot.
+                 * We cheat a little bit here and use EPC to calculate the
+                 * debug return address (DEPC). EPC is restored after the
+                 * calculation.
+                 */
+                old_epc = regs->cp0_epc;
+                regs->cp0_epc = depc;
+                __compute_return_epc(regs);
+                depc = regs->cp0_epc;
+                regs->cp0_epc = old_epc;
+        } else
+                depc += 4;
+        write_32bit_cp0_register(CP0_DEPC, depc);
+
+#if 0
+	printk("\n\n----- Enable EJTAG single stepping ----\n\n");
+	write_32bit_cp0_register(CP0_DEBUG, debug | 0x100);
+#endif
+}
+
+/*
+ * NMI exception handler.
+ */
+void nmi_exception_handler(struct pt_regs *regs)
+{
+        printk("NMI taken!!!!\n");
+        die("NMI", regs);
+        while(1) ;  /* We die here. */
+}
+
 unsigned long exception_handlers[32];
 
 /*
@@ -852,11 +915,13 @@
 	extern char except_vec_ejtag_debug;
 	unsigned long i;
 
+	per_cpu_trap_init();
+
 	/* Copy the generic exception handler code to it's final destination. */
 	memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
 	memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80);
 	memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80);
-	flush_icache_range(KSEG0 + 0x80, KSEG0 + 0x200);
+
 	/*
 	 * Setup default vectors
 	 */
@@ -868,7 +933,7 @@
 	 * destination.
 	 */
 	if (mips_cpu.options & MIPS_CPU_EJTAG)
-		memcpy((void *)(KSEG0 + 0x200), &except_vec_ejtag_debug, 0x80);
+		memcpy((void *)(KSEG0 + 0x300), &except_vec_ejtag_debug, 0x80);
 
 	/*
 	 * Only some CPUs have the watch exceptions or a dedicated
@@ -891,21 +956,21 @@
 	 */
 	parity_protection_init();
 
+	/*
+	 * The Data Bus Errors / Instruction Bus Errors are signaled
+	 * by external hardware.  Therefore these two exceptions
+	 * may have board specific handlers.
+	 */
+	bus_error_init();
+
 	set_except_vector(1, handle_mod);
 	set_except_vector(2, handle_tlbl);
 	set_except_vector(3, handle_tlbs);
 	set_except_vector(4, handle_adel);
 	set_except_vector(5, handle_ades);
 
-	/*
-	 * The Data Bus Error/ Instruction Bus Errors are signaled
-	 * by external hardware.  Therefore these two expection have
-	 * board specific handlers.
-	 */
 	set_except_vector(6, handle_ibe);
 	set_except_vector(7, handle_dbe);
-	ibe_board_handler = default_be_board_handler;
-	dbe_board_handler = default_be_board_handler;
 
 	set_except_vector(8, handle_sys);
 	set_except_vector(9, handle_bp);
@@ -914,7 +979,8 @@
 	set_except_vector(12, handle_ov);
 	set_except_vector(13, handle_tr);
 
-	if (mips_cpu.options & MIPS_CPU_FPU)
+	if ((mips_cpu.options & MIPS_CPU_FPU) &&
+	    !(mips_cpu.options & MIPS_CPU_NOFPUEX))
 		set_except_vector(15, handle_fpe);
 	if (mips_cpu.options & MIPS_CPU_MCHECK)
 		set_except_vector(24, handle_mcheck);
@@ -929,17 +995,6 @@
 		if (mips_cpu.options & MIPS_CPU_VCE) {
 			memcpy((void *)(KSEG0 + 0x180), &except_vec3_r4000,
 			       0x80);
-		} else {
-			memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic,
-			       0x80);
-		}
-
-		if (mips_cpu.options & MIPS_CPU_FPU) {
-		        save_fp_context = _save_fp_context;
-			restore_fp_context = _restore_fp_context;
-		} else {
-		        save_fp_context = fpu_emulator_save_context;
-			restore_fp_context = fpu_emulator_restore_context;
 		}
 	} else switch (mips_cpu.cputype) {
 	case CPU_SB1:
@@ -949,24 +1004,20 @@
 		 */
 		memcpy((void *)(KSEG0 + 0x180), &except_vec3_r4000, 0x80);
 #ifdef CONFIG_SB1_CACHE_ERROR
+		{
 		/* Special cache error handler for SB1 */
 		extern char except_vec2_sb1;
 		memcpy((void *)(KSEG0 + 0x100), &except_vec2_sb1, 0x80);
 		memcpy((void *)(KSEG1 + 0x100), &except_vec2_sb1, 0x80);
+		}
 #endif
 
-		save_fp_context = _save_fp_context;
-		restore_fp_context = _restore_fp_context;
-
 		/* Enable timer interrupt and scd mapped interrupt */
 		clear_cp0_status(0xf000);
 		set_cp0_status(0xc00);
 		break;
 	case CPU_R6000:
 	case CPU_R6000A:
-	        save_fp_context = _save_fp_context;
-		restore_fp_context = _restore_fp_context;
-
 		/*
 		 * The R6000 is the only R-series CPU that features a machine
 		 * check exception (similar to the R4000 cache error) and
@@ -989,8 +1040,6 @@
 	case CPU_TX3922:
 	case CPU_TX3927:
 	case CPU_TX39XX:
-	        save_fp_context = _save_fp_context;
-		restore_fp_context = _restore_fp_context;
 		memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80);
 		break;
 
@@ -998,13 +1047,17 @@
 	default:
 		panic("Unknown CPU type");
 	}
-	if (!(mips_cpu.options & MIPS_CPU_FPU)) {
+
+	flush_icache_range(KSEG0, KSEG0 + 0x400);
+
+	if (mips_cpu.options & MIPS_CPU_FPU) {
+	        save_fp_context = _save_fp_context;
+		restore_fp_context = _restore_fp_context;
+	} else {
 		save_fp_context = fpu_emulator_save_context;
 		restore_fp_context = fpu_emulator_restore_context;
 	}
 
-	flush_icache_range(KSEG0, KSEG0 + 0x200);
-
 	if (mips_cpu.isa_level == MIPS_CPU_ISA_IV)
 		set_cp0_status(ST0_XX);
 
diff -urN linux-2.4.19-rc1/arch/mips/kernel/unaligned.c linux-2.4.19-rc2/arch/mips/kernel/unaligned.c
--- linux-2.4.19-rc1/arch/mips/kernel/unaligned.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/kernel/unaligned.c	Tue Jul 16 16:25:18 2002
@@ -5,7 +5,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1996, 1998 by Ralf Baechle
+ * Copyright (C) 1996, 1998, 2002 by Ralf Baechle
  * Copyright (C) 1999 Silicon Graphics, Inc.
  *
  * This file contains exception handler for address error exception with the
@@ -332,7 +332,7 @@
 
 fault:
 	/* Did we have an exception handler installed? */
-	fixup = search_exception_table(regs->cp0_epc);
+	fixup = search_exception_table(exception_epc(regs));
 	if (fixup) {
 		long new_epc;
 		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
@@ -375,7 +375,8 @@
 	 * in the delay slot of an emulated branch.
 	 */
 	/* Terminate if exception was recognized as a delay slot return */
-	if(do_dsemulret(regs)) return;
+	if (do_dsemulret(regs))
+		return;
 
 	/* Otherwise handle as normal */
 
diff -urN linux-2.4.19-rc1/arch/mips/lib/Makefile linux-2.4.19-rc2/arch/mips/lib/Makefile
--- linux-2.4.19-rc1/arch/mips/lib/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/lib/Makefile	Tue Jul 16 16:25:18 2002
@@ -2,10 +2,7 @@
 # Makefile for MIPS-specific library files..
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 L_TARGET = lib.a
 
diff -urN linux-2.4.19-rc1/arch/mips/lib/kbd-std.c linux-2.4.19-rc2/arch/mips/lib/kbd-std.c
--- linux-2.4.19-rc1/arch/mips/lib/kbd-std.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/lib/kbd-std.c	Tue Jul 16 16:25:18 2002
@@ -7,6 +7,7 @@
  *
  * Copyright (C) 1998, 1999 by Ralf Baechle
  */
+#include <linux/config.h>
 #include <linux/ioport.h>
 #include <linux/sched.h>
 #include <linux/pc_keyb.h>
diff -urN linux-2.4.19-rc1/arch/mips/lib/memcpy.S linux-2.4.19-rc2/arch/mips/lib/memcpy.S
--- linux-2.4.19-rc1/arch/mips/lib/memcpy.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/lib/memcpy.S	Tue Jul 16 16:25:18 2002
@@ -12,10 +12,10 @@
  *
  * Mnemonic names for arguments to memcpy/__copy_user
  */
+#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/offset.h>
 #include <asm/regdef.h>
-#include <linux/autoconf.h>
 
 #define dst a0
 #define src a1
diff -urN linux-2.4.19-rc1/arch/mips/math-emu/Makefile linux-2.4.19-rc2/arch/mips/math-emu/Makefile
--- linux-2.4.19-rc1/arch/mips/math-emu/Makefile	Fri Apr 13 20:26:07 2001
+++ linux-2.4.19-rc2/arch/mips/math-emu/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
-
-EXTRA_ASFLAGS = -mips2 -mcpu=r4000
+USE_STANDARD_AS_RULE := true
 
 O_TARGET:= fpu_emulator.o
 
diff -urN linux-2.4.19-rc1/arch/mips/math-emu/cp1emu.c linux-2.4.19-rc2/arch/mips/math-emu/cp1emu.c
--- linux-2.4.19-rc1/arch/mips/math-emu/cp1emu.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/math-emu/cp1emu.c	Tue Jul 16 16:25:18 2002
@@ -34,6 +34,7 @@
  * Note if you know that you won't have an fpu, then you'll get much 
  * better performance by compiling with -msoft-float!
  */
+#include <linux/compiler.h>
 #include <linux/mm.h>
 #include <linux/signal.h>
 #include <linux/smp.h>
@@ -66,7 +67,7 @@
 
 /* Function which emulates the instruction in a branch delay slot. */
 
-static int mips_dsemul(struct pt_regs *, mips_instruction, vaddr_t);
+static int mips_dsemul(struct pt_regs *, mips_instruction, unsigned long);
 
 /* Function which emulates a floating point instruction. */
 
@@ -167,54 +168,6 @@
 #define REG_TO_VA (vaddr_t)
 #define VA_TO_REG (unsigned long)
 
-static unsigned long mips_get_word(struct pt_regs *xcp, void *va, int *perr)
-{
-	unsigned long temp;
-
-	if (!user_mode(xcp)) {
-		*perr = 0;
-		return *(unsigned long *) va;
-	}
-
-	*perr = (int) get_user(temp, (unsigned long *) va);
-	return temp;
-}
-
-static unsigned long long
-mips_get_dword(struct pt_regs *xcp, void *va, int *perr)
-{
-	unsigned long long temp;
-
-	if (!user_mode(xcp)) {
-		*perr = 0;
-		return *(unsigned long long *) va;
-	}
-
-	*perr = (int) get_user(temp, (unsigned long long *) va);
-	return temp;
-}
-
-static int mips_put_word(struct pt_regs *xcp, void *va, unsigned long val)
-{
-	if (!user_mode(xcp)) {
-		*(unsigned long *) va = val;
-		return 0;
-	}
-
-	return put_user(val, (unsigned long *) va);
-}
-
-static int mips_put_dword(struct pt_regs *xcp, void *va, long long val)
-{
-	if (!user_mode(xcp)) {
-		*(unsigned long long *) va = val;
-		return 0;
-	}
-
-	return put_user(val, (unsigned long long *) va);
-}
-
-
 /*
  * In the Linux kernel, we support selection of FPR format on the
  * basis of the Status.FR bit.  This does imply that, if a full 32
@@ -232,13 +185,12 @@
 
 static int cop1Emulate(struct pt_regs *regs, struct mips_fpu_soft_struct *ctx)
 {
+	vaddr_t emulpc, contpc;
 	mips_instruction ir;
-	vaddr_t emulpc;
-	vaddr_t contpc;
 	unsigned int cond;
 	int err = 0;
 
-	ir = mips_get_word(regs, REG_TO_VA regs->cp0_epc, &err);
+	err = get_user(ir, (mips_instruction *) regs->cp0_epc);
 	if (err) {
 		fpuemuprivate.stats.errors++;
 		return SIGBUS;
@@ -270,7 +222,7 @@
 #endif
 			return SIGILL;
 		}
-		ir = mips_get_word(regs, emulpc, &err);
+		err = get_user(ir, (mips_instruction *) emulpc);
 		if (err) {
 			fpuemuprivate.stats.errors++;
 			return SIGBUS;
@@ -292,12 +244,13 @@
 #ifndef SINGLE_ONLY_FPU
 	case ldc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
-			    + MIPSInst_SIMM(ir);
+			u64 *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)]) +
+			          MIPSInst_SIMM(ir);
 			int ft = MIPSInst_RT(ir);
+
 			if (!(regs->cp0_status & ST0_FR))
 				ft &= ~1;
-			ctx->regs[ft] = mips_get_dword(regs, va, &err);
+			err = get_user(ctx->regs[ft], va);
 			fpuemuprivate.stats.loads++;
 			if (err) {
 				fpuemuprivate.stats.errors++;
@@ -308,13 +261,14 @@
 
 	case sdc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
-			    + MIPSInst_SIMM(ir);
+			fpureg_t *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)]) +
+			               MIPSInst_SIMM(ir);
 			int ft = MIPSInst_RT(ir);
+
 			if (!(regs->cp0_status & ST0_FR))
 				ft &= ~1;
 			fpuemuprivate.stats.stores++;
-			if (mips_put_dword(regs, va, ctx->regs[ft])) {
+			if (put_user(ctx->regs[ft], va)) {
 				fpuemuprivate.stats.errors++;
 				return SIGBUS;
 			}
@@ -324,19 +278,20 @@
 
 	case lwc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
-			    + MIPSInst_SIMM(ir);
-			fpureg_t val;
+			u32 *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)]) +
+			               MIPSInst_SIMM(ir);
 			int ft = MIPSInst_RT(ir);
+			u32 val;
+
 			fpuemuprivate.stats.loads++;
-			val = mips_get_word(regs, va, &err);
+			err = get_user(val, va);
 			if (err) {
 				fpuemuprivate.stats.errors++;
 				return SIGBUS;
 			}
 			if (regs->cp0_status & ST0_FR) {
 				/* load whole register */
-				ctx->regs[ft] = val;
+				ctx->regs[ft] = (s64) val;
 			} else if (ft & 1) {
 				/* load to m.s. 32 bits */
 #ifdef SINGLE_ONLY_FPU
@@ -344,7 +299,7 @@
 				return SIGILL;
 #else
 				ctx->regs[(ft & ~1)] &= 0xffffffff;
-				ctx->regs[(ft & ~1)] |= val << 32;
+				ctx->regs[(ft & ~1)] |= (fpureg_t) val << 32;
 #endif
 			} else {
 				/* load to l.s. 32 bits */
@@ -356,10 +311,11 @@
 
 	case swc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
-			    + MIPSInst_SIMM(ir);
+			u32 *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)]) +
+			          MIPSInst_SIMM(ir);
 			unsigned int val;
 			int ft = MIPSInst_RT(ir);
+
 			fpuemuprivate.stats.stores++;
 			if (regs->cp0_status & ST0_FR) {
 				/* store whole register */
@@ -376,7 +332,7 @@
 				/* store from l.s. 32 bits */
 				val = ctx->regs[ft];
 			}
-			if (mips_put_word(regs, va, val)) {
+			if (put_user(val, va)) {
 				fpuemuprivate.stats.errors++;
 				return SIGBUS;
 			}
@@ -385,10 +341,10 @@
 #else				/* old 32-bit fpu registers */
 	case lwc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
-			    + MIPSInst_SIMM(ir);
-			ctx->regs[MIPSInst_RT(ir)] =
-			    mips_get_word(regs, va, &err);
+			u32 *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)]) +
+			          MIPSInst_SIMM(ir);
+			err = get_user(ctx->regs[MIPSInst_RT(ir)], va);
+
 			fpuemuprivate.stats.loads++;
 			if (err) {
 				fpuemuprivate.stats.errors++;
@@ -399,11 +355,10 @@
 
 	case swc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
-			    + MIPSInst_SIMM(ir);
+			u32 *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)]) +
+			          MIPSInst_SIMM(ir);
 			fpuemuprivate.stats.stores++;
-			if (mips_put_word
-			    (regs, va, ctx->regs[MIPSInst_RT(ir)])) {
+			if (put_user(ctx->regs[MIPSInst_RT(ir)], va)) {
 				fpuemuprivate.stats.errors++;
 				return SIGBUS;
 			}
@@ -411,25 +366,17 @@
 		break;
 	case ldc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
+			u32 *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
 			    + MIPSInst_SIMM(ir);
 			unsigned int rt = MIPSInst_RT(ir) & ~1;
 			int errs = 0;
 			fpuemuprivate.stats.loads++;
 #if (defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN) || defined(__MIPSEB__)
-			ctx->regs[rt + 1] =
-			    mips_get_word(regs, va + 0, &err);
-			errs += err;
-			ctx->regs[rt + 0] =
-			    mips_get_word(regs, va + 4, &err);
-			errs += err;
+			err = get_user(ctx->regs[rt + 1], va + 0);
+			err |= get_user(ctx->regs[rt + 0], va + 1);
 #else
-			ctx->regs[rt + 0] =
-			    mips_get_word(regs, va + 0, &err);
-			errs += err;
-			ctx->regs[rt + 1] =
-			    mips_get_word(regs, va + 4, &err);
-			errs += err;
+			err = get_user(ctx->regs[rt + 0], va + 0);
+			err |= get_user(ctx->regs[rt + 1], va + 1);
 #endif
 			if (err)
 				return SIGBUS;
@@ -438,19 +385,18 @@
 
 	case sdc1_op:
 		{
-			void *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)])
-			    + MIPSInst_SIMM(ir);
+			u32 *va = REG_TO_VA(regs->regs[MIPSInst_RS(ir)]) +
+			          MIPSInst_SIMM(ir);
 			unsigned int rt = MIPSInst_RT(ir) & ~1;
+
 			fpuemuprivate.stats.stores++;
 #if (defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN) || defined(__MIPSEB__)
-			if (mips_put_word(regs, va + 0, ctx->regs[rt + 1]))
-				return SIGBUS;
-			if (mips_put_word(regs, va + 4, ctx->regs[rt + 0]))
+			if (put_user(ctx->regs[rt + 1], va + 0)
+			    || put_user(ctx->regs[rt + 0], va + 1))
 				return SIGBUS;
 #else
-			if (mips_put_word(regs, va + 0, ctx->regs[rt + 0]))
-				return SIGBUS;
-			if (mips_put_word(regs, va + 4, ctx->regs[rt + 1]))
+			if (put_user(ctx->regs[rt + 0], va + 0)
+			    || put_user(ctx->regs[rt + 1], va + 1))
 				return SIGBUS;
 #endif
 		}
@@ -652,10 +598,10 @@
 				/* branch taken: emulate dslot instruction */
 				regs->cp0_epc += 4;
 				contpc = REG_TO_VA regs->cp0_epc +
-				         (MIPSInst_SIMM(ir) << 2);
+				                   (MIPSInst_SIMM(ir) << 2);
 
-				ir = mips_get_word(regs, REG_TO_VA(regs->cp0_epc),
-				      &err);
+				err = get_user(ir,
+					(mips_instruction *)regs->cp0_epc);
 				if (err) {
 					fpuemuprivate.stats.errors++;
 					return SIGBUS;
@@ -767,38 +713,48 @@
  */
 
 /* Instruction inserted following delay slot instruction to force trap */
-#define AdELOAD 0x8c000001    /* lw $0,1($0) */
+#define AdELOAD 0x8c000001	/* lw $0,1($0) */
 
 /* Instruction inserted following the AdELOAD to further tag the sequence */
-#define BD_COOKIE 0x0000bd36 /* tne $0,$0 with baggage */
+#define BD_COOKIE 0x0000bd36	/* tne $0,$0 with baggage */
+
+struct emuframe {
+	mips_instruction	emul;
+	mips_instruction	adel;
+	mips_instruction	cookie;
+	unsigned long	epc;
+};
 
 int do_dsemulret(struct pt_regs *xcp)
 {
-	unsigned long *pinst;
-	unsigned long stackitem;
+	struct emuframe *fr;
+	unsigned long epc;
+	u32 insn, cookie;
 	int err = 0;
 
-	/* See if this trap was deliberate. First check the instruction */
-
-	pinst = (unsigned long *) REG_TO_VA(xcp->cp0_epc);
+	fr = (struct emuframe *) (xcp->cp0_epc - sizeof(mips_instruction));
 
 	/* 
 	 * If we can't even access the area, something is very wrong, but we'll
 	 * leave that to the default handling
 	 */
-	if (verify_area(VERIFY_READ, pinst, sizeof(unsigned long) * 3))
+	if (verify_area(VERIFY_READ, fr, sizeof(struct emuframe)))
 		return 0;
 
-	/* Is the instruction pointed to by the EPC an AdELOAD? */
-	stackitem = mips_get_word(xcp, pinst, &err);
-	if (err || (stackitem != AdELOAD))
-		return 0;
+	/*
+	 * Do some sanity checking on the stackframe:
+	 *
+	 *  - Is the instruction pointed to by the EPC an AdELOAD?
+	 *  - Is the following memory word the BD_COOKIE?
+	 */
+	err = __get_user(insn, &fr->adel);
+	err |= __get_user(cookie, &fr->cookie);
 
-	/* Is the following memory word the BD_COOKIE? */
+	if (unlikely(err || (insn != AdELOAD) || (cookie != BD_COOKIE))) {
+		fpuemuprivate.stats.errors++;
 
-	stackitem = mips_get_word(xcp, pinst+1, &err);
-	if (err || (stackitem != BD_COOKIE))
 		return 0;
+	}
 
 	/* 
 	 * At this point, we are satisfied that it's a BD emulation trap.  Yes,
@@ -813,39 +769,37 @@
 #ifdef DSEMUL_TRACE
 	printk("desemulret\n");
 #endif
-	/* Fetch the Saved EPC to Resume */
-
-	stackitem = mips_get_word(xcp, pinst+2, &err);
-	if (err) {
+	if (__get_user(epc, &fr->epc)) {		/* Saved EPC */
 		/* This is not a good situation to be in */
-		fpuemuprivate.stats.errors++;
 		force_sig(SIGBUS, current);
+
 		return 1;
 	}
 
 	/* Set EPC to return to post-branch instruction */
-	xcp->cp0_epc = stackitem;
+	xcp->cp0_epc = epc;
 
 	return 1;
 }
 
-
-#define AdELOAD 0x8c000001	/* lw $0,1($0) */
-
-static int mips_dsemul(struct pt_regs *regs, mips_instruction ir, vaddr_t cpc)
+static int mips_dsemul(struct pt_regs *regs, mips_instruction ir,
+	unsigned long cpc)
 {
-	mips_instruction *dsemul_insns;
 	extern asmlinkage void handle_dsemulret(void);
+	mips_instruction *dsemul_insns;
+	struct emuframe *fr;
+	int err;
 
 	if (ir == 0) {		/* a nop is easy */
-		regs->cp0_epc = VA_TO_REG(cpc);
+		regs->cp0_epc = cpc;
 		regs->cp0_cause &= ~CAUSEF_BD;
 		return 0;
 	}
 #ifdef DSEMUL_TRACE
-	printk("desemul %p %p\n", REG_TO_VA(regs->cp0_epc), cpc);
-#endif
+	printk("desemul %lx %lx\n", regs->cp0_epc, cpc);
 
+#endif
+ 
 	/* 
 	 * The strategy is to push the instruction onto the user stack 
 	 * and put a trap after it which we can catch and jump to 
@@ -863,36 +817,26 @@
 	/* Ensure that the two instructions are in the same cache line */
 	dsemul_insns = (mips_instruction *) (regs->regs[29] & ~0xf);
 	dsemul_insns -= 4;	/* Retain 16-byte alignment */
+	fr = (struct emuframe *) dsemul_insns;
 
 	/* Verify that the stack pointer is not competely insane */
-	if (verify_area
-	    (VERIFY_WRITE, dsemul_insns, sizeof(mips_instruction) * 4))
+	if (unlikely(verify_area(VERIFY_WRITE, fr, sizeof(struct emuframe))))
 		return SIGBUS;
 
-	if (mips_put_word(regs, &dsemul_insns[0], ir)) {
-		fpuemuprivate.stats.errors++;
-		return (SIGBUS);
-	}
+	err = __put_user(ir, &dsemul_insns[0]);
+	err |= __put_user((mips_instruction)AdELOAD, &fr->adel);
+	err |= __put_user((mips_instruction)BD_COOKIE, &fr->cookie);
+	err |= __put_user(cpc, &fr->epc);
 
-	if (mips_put_word(regs, &dsemul_insns[1], (mips_instruction)AdELOAD)) {
+	if (unlikely(err)) {
 		fpuemuprivate.stats.errors++;
-		return (SIGBUS);
-	}
-	
-	if (mips_put_word(regs, &dsemul_insns[2], 
-			  (mips_instruction)BD_COOKIE)) {
-		fpuemuprivate.stats.errors++;
-		return (SIGBUS);
-	}
-
-	if (mips_put_word(regs, &dsemul_insns[3], (mips_instruction)cpc)) {
-		fpuemuprivate.stats.errors++;
-		return (SIGBUS);
+		return SIGBUS;
 	}
 
 	regs->cp0_epc = VA_TO_REG & dsemul_insns[0];
 
-	flush_cache_sigtramp((unsigned long)dsemul_insns);
+	flush_cache_sigtramp((unsigned long)&fr->adel);
+
 	return SIGILL;		/* force out of emulation loop */
 }
 
@@ -924,15 +868,15 @@
 
 #ifdef CP0_STATUS_FR_SUPPORT
 #define DPFROMREG(dp,x)	((dp).bits = \
-			ctx->regs[(xcp->cp0_status & ST0_FR) ? x : (x & ~1)])
-#define DPTOREG(dp,x)	(ctx->regs[(xcp->cp0_status & ST0_FR) ? x : (x & ~1)]\
-			= (dp).bits)
+	ctx->regs[(xcp->cp0_status & ST0_FR) ? x : (x & ~1)])
+#define DPTOREG(dp,x)	(ctx->regs[(xcp->cp0_status & ST0_FR) ? x : (x & ~1)] \
+	= (dp).bits)
 #else
 /* Beware: MIPS COP1 doubles are always little_word endian in registers */
 #define DPFROMREG(dp,x)	\
-  ((dp).bits = ((unsigned long long)ctx->regs[(x)+1] << 32) | ctx->regs[x])
+	((dp).bits = ((u64)ctx->regs[(x)+1] << 32) | ctx->regs[x])
 #define DPTOREG(dp,x) \
-  (ctx->regs[x] = (dp).bits, ctx->regs[(x)+1] = (dp).bits >> 32)
+	(ctx->regs[x] = (dp).bits, ctx->regs[(x)+1] = (dp).bits >> 32)
 #endif
 
 #if __mips >= 4 && __mips != 32
@@ -1003,25 +947,18 @@
 			switch (MIPSInst_FUNC(ir)) {
 			case lwxc1_op:
 				{
-					void *va =
-					    REG_TO_VA(xcp->
-						      regs[MIPSInst_FR(ir)]
-						      +
-						      xcp->
-						      regs[MIPSInst_FT
-							   (ir)]);
+					u32 *va = REG_TO_VA(
+						xcp->regs[MIPSInst_FR(ir)] +
+						xcp->regs[MIPSInst_FT(ir)]);
 					fpureg_t val;
-					int err = 0;
-					val = mips_get_word(xcp, va, &err);
-					if (err) {
-						fpuemuprivate.stats.
-						    errors++;
+
+					if (get_user(val, va)) {
+						fpuemuprivate.stats.errors++;
 						return SIGBUS;
 					}
 					if (xcp->cp0_status & ST0_FR) {
 						/* load whole register */
-						ctx->
-						    regs[MIPSInst_FD(ir)] =
+						ctx->regs[MIPSInst_FD(ir)] =
 						    val;
 					} else if (MIPSInst_FD(ir) & 1) {
 						/* load to m.s. 32 bits */
@@ -1054,30 +991,21 @@
 
 			case swxc1_op:
 				{
-					void *va =
-					    REG_TO_VA(xcp->
-						      regs[MIPSInst_FR(ir)]
-						      +
-						      xcp->
-						      regs[MIPSInst_FT
-							   (ir)]);
+					u32 *va = REG_TO_VA(
+						xcp->regs[MIPSInst_FR(ir)] +
+						xcp->regs[MIPSInst_FT(ir)]);
 					unsigned int val;
+
 					if (xcp->cp0_status & ST0_FR) {
 						/* store whole register */
-						val =
-						    ctx->
-						    regs[MIPSInst_FS(ir)];
+						val = ctx->regs[MIPSInst_FS(ir)];
 					} else if (MIPSInst_FS(ir) & 1) {
 #if defined(SINGLE_ONLY_FPU)
 						/* illegal register in single-float mode */
 						return SIGILL;
 #else
 						/* store from m.s. 32 bits */
-						val =
-						    ctx->
-						    regs[
-							 (MIPSInst_FS(ir) &
-							  ~1)] >> 32;
+						val = ctx->regs[(MIPSInst_FS(ir) & ~1)] >> 32;
 #endif
 					} else {
 						/* store from l.s. 32 bits */
@@ -1085,9 +1013,8 @@
 						    ctx->
 						    regs[MIPSInst_FS(ir)];
 					}
-					if (mips_put_word(xcp, va, val)) {
-						fpuemuprivate.stats.
-						    errors++;
+					if (put_user(val, va)) {
+						fpuemuprivate.stats.errors++;
 						return SIGBUS;
 					}
 				}
@@ -1155,38 +1082,29 @@
 			switch (MIPSInst_FUNC(ir)) {
 			case ldxc1_op:
 				{
-					void *va =
-					    REG_TO_VA(xcp->
-						      regs[MIPSInst_FR(ir)]
-						      +
-						      xcp->
-						      regs[MIPSInst_FT
-							   (ir)]);
-					int err = 0;
-					ctx->regs[MIPSInst_FD(ir)] =
-					    mips_get_dword(xcp, va, &err);
-					if (err) {
-						fpuemuprivate.stats.
-						    errors++;
+					u64 *va = REG_TO_VA(
+						xcp->regs[MIPSInst_FR(ir)] +
+						xcp->regs[MIPSInst_FT(ir)]);
+					u64 val;
+
+					if (get_user(val, va)) {
+						fpuemuprivate.stats.errors++;
 						return SIGBUS;
 					}
+					ctx->regs[MIPSInst_FD(ir)] = val;
 				}
 				break;
 
 			case sdxc1_op:
 				{
-					void *va =
-					    REG_TO_VA(xcp->
-						      regs[MIPSInst_FR(ir)]
-						      +
-						      xcp->
-						      regs[MIPSInst_FT
-							   (ir)]);
-					if (mips_put_dword
-					    (xcp, va,
-					     ctx->regs[MIPSInst_FS(ir)])) {
-						fpuemuprivate.stats.
-						    errors++;
+					u64 *va = REG_TO_VA(
+						xcp->regs[MIPSInst_FR(ir)] +
+						xcp->regs[MIPSInst_FT(ir)]);
+					u64 val;
+
+					val = ctx->regs[MIPSInst_FS(ir)];
+					if (put_user(val, va)) {
+						fpuemuprivate.stats.errors++;
 						return SIGBUS;
 					}
 				}
@@ -1195,12 +1113,15 @@
 			case madd_d_op:
 				handler = fpemu_dp_madd;
 				goto dcoptop;
+
 			case msub_d_op:
 				handler = fpemu_dp_msub;
 				goto dcoptop;
+
 			case nmadd_d_op:
 				handler = fpemu_dp_nmadd;
 				goto dcoptop;
+
 			case nmsub_d_op:
 				handler = fpemu_dp_nmsub;
 				goto dcoptop;
@@ -1720,22 +1641,26 @@
 {
 	struct mips_fpu_soft_struct *ctx = &current->thread.fpu.soft;
 	unsigned long oldepc, prevepc;
-	unsigned int insn;
+	mips_instruction insn, *insnp;
 	int sig = 0;
-	int err = 0;
 
 	oldepc = xcp->cp0_epc;
 	do {
-		if (current->need_resched)
-			schedule();
-
 		prevepc = xcp->cp0_epc;
-		insn = mips_get_word(xcp, REG_TO_VA(xcp->cp0_epc), &err);
-		if (err) {
+
+		/*
+		 * This is a braindead way to do it but the only sane way I
+		 * found to keep the 64-bit egcs 1.1.2 from crashing.
+		 */
+		insnp = (mips_instruction *) xcp->cp0_epc;
+		if (verify_area(VERIFY_READ, insnp, 4) ||
+		    __get_user(insn, insnp)) {
 			fpuemuprivate.stats.errors++;
 			return SIGBUS;
 		}
-		if (insn != 0) {
+		if (insn == 0)
+			xcp->cp0_epc += 4;	/* skip nops */
+		else {
 			/* Update ieee754_csr. Only relevant if we have a
 			   h/w FPU */
 			ieee754_csr.nod = (ctx->sr & 0x1000000) != 0;
@@ -1743,12 +1668,15 @@
 			ieee754_csr.cx = (ctx->sr >> 12) & 0x1f;
 			sig = cop1Emulate(xcp, ctx);
 		}
-		else
-			xcp->cp0_epc += 4;	/* skip nops */
 
 		if (mips_cpu.options & MIPS_CPU_FPU)
 			break;
-	} while (xcp->cp0_epc > prevepc && sig == 0);
+		if (sig)
+			break;
+
+		if (current->need_resched)
+			schedule();
+	} while (xcp->cp0_epc > prevepc);
 
 	/* SIGILL indicates a non-fpu instruction */
 	if (sig == SIGILL && xcp->cp0_epc != oldepc)
@@ -1757,80 +1685,3 @@
 
 	return sig;
 }
-
-
-#ifdef NOTDEF
-/*
- * Patch up the hardware fpu state when an f.p. exception occurs.  
- */
-static int cop1Patcher(int xcptno, struct pt_regs *xcp)
-{
-	struct mips_fpu_soft_struct *ctx = &current->thread.fpu.soft;
-	unsigned sr;
-	int sig;
-
-	/* reenable Cp1, else fpe_save() will get nested exception */
-	sr = mips_bissr(ST0_CU1);
-
-	/* get fpu registers and status, then clear pending exceptions */
-	fpe_save(ctx);
-	fpe_setsr(ctx->sr &= ~FPU_CSR_ALL_X);
-
-	/* get current rounding mode for IEEE library, and emulate insn */
-	ieee754_csr.rm = ieee_rm[ctx->sr & 0x3];
-	sig = cop1Emulate(xcp, ctx);
-
-	/* don't return with f.p. exceptions pending */
-	ctx->sr &= ~FPU_CSR_ALL_X;
-	fpe_restore(ctx);
-
-	mips_setsr(sr);
-	return sig;
-}
-
-void _cop1_init(int emulate)
-{
-	extern int _nofpu;
-
-	if (emulate) {
-		/* 
-		 * Install cop1 emulator to handle "coprocessor unusable" exception
-		 */
-		xcption(XCPTCPU, cop1Handler);
-		fpuemuactive = 1;	/* tell dbg.c that we are in charge */
-		_nofpu = 0;	/* tell setjmp() it "has" an fpu */
-	} else {
-		/* 
-		 * Install cop1 emulator for floating point exceptions only,
-		 * i.e. denormalised results, underflow, overflow etc, which
-		 * must be emulated in s/w.
-		 */
-#if 1
-		/* r4000 or above use dedicate exception */
-		xcption(XCPTFPE, cop1Patcher);
-#else
-		/* r3000 et al use interrupt */
-		extern int _sbd_getfpuintr(void);
-		int intno = _sbd_getfpuintr();
-		intrupt(intno, cop1Patcher, 0);
-		mips_bissr(SR_IM0 << intno);
-#endif
-
-#if (#cpu(r4640) || #cpu(r4650)) && !defined(SINGLE_ONLY_FPU)
-		/* For R4640/R4650 compiled *without* the -msingle-float flag,
-		   then we share responsibility: the h/w handles the single
-		   precision operations, and the trap emulator handles the
-		   double precision. We set fpuemuactive so that dbg.c first
-		   fetches the s/w state before saving the h/w state. */
-		fpuemuactive = 1;
-		{
-			int i;
-			/* initialise the unused d.p high order words to be NaN */
-			for (i = 0; i < 32; i++)
-				current->thread.fpu.soft.regs[i] =
-				    0x7ff80bad00000000LL;
-		}
-#endif				/* (r4640 || r4650) && !fpu(single) */
-	}
-}
-#endif
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/atlas/Makefile linux-2.4.19-rc2/arch/mips/mips-boards/atlas/Makefile
--- linux-2.4.19-rc1/arch/mips/mips-boards/atlas/Makefile	Fri Apr 13 20:26:07 2001
+++ linux-2.4.19-rc2/arch/mips/mips-boards/atlas/Makefile	Tue Jul 16 16:25:18 2002
@@ -28,10 +28,7 @@
 #
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 all: atlas.o
 
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/atlas/atlas_setup.c linux-2.4.19-rc2/arch/mips/mips-boards/atlas/atlas_setup.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/atlas/atlas_setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mips-boards/atlas/atlas_setup.c	Tue Jul 16 16:25:18 2002
@@ -31,6 +31,7 @@
 #include <asm/mips-boards/atlasint.h>
 #include <asm/gt64120.h>
 #include <asm/time.h>
+#include <asm/traps.h>
 
 #if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE)
 extern void console_setup(char *, int *);
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/generic/Makefile linux-2.4.19-rc2/arch/mips/mips-boards/generic/Makefile
--- linux-2.4.19-rc1/arch/mips/mips-boards/generic/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mips-boards/generic/Makefile	Tue Jul 16 16:25:18 2002
@@ -23,10 +23,7 @@
 #
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := mipsboards.o
 
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/generic/cmdline.c linux-2.4.19-rc2/arch/mips/mips-boards/generic/cmdline.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/generic/cmdline.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mips-boards/generic/cmdline.c	Tue Jul 16 16:25:18 2002
@@ -17,14 +17,19 @@
  *
  * Kernel command line creation using the prom monitor (YAMON) argc/argv.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/string.h>
 
 #include <asm/bootinfo.h>
 
 extern int prom_argc;
-extern char **prom_argv;
+extern int *_prom_argv;
+
+/*
+ * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
+ * This macro take care of sign extension.
+ */
+#define prom_argv(index) ((char *)(((int *)(int)_prom_argv)[(index)]))
 
 char arcs_cmdline[CL_SIZE];
 
@@ -43,8 +48,8 @@
 
 	cp = &(arcs_cmdline[0]);
 	while(actr < prom_argc) {
-	        strcpy(cp, prom_argv[actr]);
-		cp += strlen(prom_argv[actr]);
+	        strcpy(cp, prom_argv(actr));
+		cp += strlen(prom_argv(actr));
 		*cp++ = ' ';
 		actr++;
 	}
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/generic/gdb_hook.c linux-2.4.19-rc2/arch/mips/mips-boards/generic/gdb_hook.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/generic/gdb_hook.c	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/arch/mips/mips-boards/generic/gdb_hook.c	Tue Jul 16 16:25:18 2002
@@ -22,7 +22,7 @@
  * This is the interface to the remote debugger stub.
  *
  */
-
+#include <linux/config.h>
 #include <linux/serialP.h>
 #include <linux/serial_reg.h>
 
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/generic/init.c linux-2.4.19-rc2/arch/mips/mips-boards/generic/init.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/generic/init.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mips-boards/generic/init.c	Tue Jul 16 16:25:18 2002
@@ -27,35 +27,48 @@
 #include <asm/mips-boards/generic.h>
 #include <asm/gt64120.h>
 #include <asm/mips-boards/malta.h>
+#include <asm/mips-boards/msc01_pci.h>
+#include <asm/mips-boards/bonito64.h>
 
 /* Environment variable */
-typedef struct {
+typedef struct
+{
 	char *name;
 	char *val;
 } t_env_var;
 
 int prom_argc;
-char **prom_argv, **prom_envp;
+int *_prom_argv, *_prom_envp;
+
+/*
+ * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
+ * This macro take care of sign extension, if running in 64-bit mode.
+ */
+#define prom_envp(index) ((char *)(((int *)(int)_prom_envp)[(index)]))
 
 int init_debug = 0;
 
+unsigned int mips_revision_corid;
+
 char *prom_getenv(char *envname)
 {
-        /*
+	/*
 	 * Return a pointer to the given environment variable.
+	 * In 64-bit mode: we're using 64-bit pointers, but all pointers 
+	 * in the PROM structures are only 32-bit, so we need some 
+	 * workarounds, if we are running in 64-bit mode.
 	 */
-
-	t_env_var *env = (t_env_var *)prom_envp;
-	int i;
+	int i, index=0;
 
 	i = strlen(envname);
 
-	while(env->name) {
-		if(strncmp(envname, env->name, i) == 0) {
-			return(env->val);
+	while(prom_envp(index)) {
+		if(strncmp(envname, prom_envp(index), i) == 0) {
+			return(prom_envp(index+1));
 		}
-		env++;
+		index += 2;
 	}
+
 	return(NULL);
 }
 
@@ -108,26 +121,83 @@
 int __init prom_init(int argc, char **argv, char **envp)
 {
 	prom_argc = argc;
-	prom_argv = argv;
-	prom_envp = envp;
+	_prom_argv = (int *)argv;
+	_prom_envp = (int *)envp;
 
 	mips_display_message("LINUX");
 
-	/*
-	 * Setup the North bridge to do Master byte-lane swapping when 
-	 * running in bigendian.
-	 */
+#ifdef CONFIG_MIPS_SEAD
+	set_io_port_base(KSEG1);
+#else
+	mips_revision_corid = MIPS_REVISION_CORID;
+	switch(mips_revision_corid) {
+	case MIPS_REVISION_CORID_QED_RM5261:
+	case MIPS_REVISION_CORID_CORE_LV:
+	case MIPS_REVISION_CORID_CORE_FPGA:
+		/*
+		 * Setup the North bridge to do Master byte-lane swapping 
+		 * when running in bigendian.
+		 */
 #if defined(__MIPSEL__)
-	GT_WRITE(GT_PCI0_CMD_OFS, GT_PCI0_CMD_MBYTESWAP_BIT |
-		 GT_PCI0_CMD_SBYTESWAP_BIT);
+		GT_WRITE(GT_PCI0_CMD_OFS, GT_PCI0_CMD_MBYTESWAP_BIT |
+			 GT_PCI0_CMD_SBYTESWAP_BIT);
 #else
-	GT_WRITE(GT_PCI0_CMD_OFS, 0);
+		GT_WRITE(GT_PCI0_CMD_OFS, 0);
 #endif
 
 #if defined(CONFIG_MIPS_MALTA)
-	set_io_port_base(MALTA_PORT_BASE);
+		set_io_port_base(MALTA_GT_PORT_BASE);
 #else
-	set_io_port_base(KSEG1);
+		set_io_port_base(KSEG1);
+#endif		
+
+		break;
+	case MIPS_REVISION_CORID_BONITO64:
+	case MIPS_REVISION_CORID_CORE_20K:
+		/* 
+		 * Disable Bonito IOBC.
+		 */
+		BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG & 
+			~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
+			  BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
+
+		/*
+		 * Setup the North bridge to do Master byte-lane swapping
+		 * when running in bigendian.
+		 */
+#if defined(__MIPSEL__)
+		BONITO_BONGENCFG = BONITO_BONGENCFG & 
+			~(BONITO_BONGENCFG_MSTRBYTESWAP | 
+			  BONITO_BONGENCFG_BYTESWAP);
+#else
+		BONITO_BONGENCFG = BONITO_BONGENCFG | 
+			BONITO_BONGENCFG_MSTRBYTESWAP | 
+			BONITO_BONGENCFG_BYTESWAP;
+#endif
+
+#if defined(CONFIG_MIPS_MALTA)
+                set_io_port_base(MALTA_BONITO_PORT_BASE);
+#else
+                set_io_port_base(KSEG1);
+#endif
+		break;
+
+	case MIPS_REVISION_CORID_CORE_MSC:
+	        set_io_port_base(MALTA_MSC_PORT_BASE);
+#if defined(__MIPSEL__)
+		MSC_WRITE(MSC01_PCI_SWAP, MSC01_PCI_SWAP_NOSWAP);
+#else
+		MSC_WRITE(MSC01_PCI_SWAP, 
+			  MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_IO_SHF |
+			  MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_MEM_SHF |
+			  MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_BAR0_SHF);
+#endif
+		break;
+	default:
+		/* Unknown Core card */
+		mips_display_message("CC Error");
+		while(1);   /* We die here... */
+	}
 #endif
 	setup_prom_printf(0);
 	prom_printf("\nLINUX started...\n");
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/generic/mipsIRQ.S linux-2.4.19-rc2/arch/mips/mips-boards/generic/mipsIRQ.S
--- linux-2.4.19-rc1/arch/mips/mips-boards/generic/mipsIRQ.S	Fri Apr 13 20:26:07 2001
+++ linux-2.4.19-rc2/arch/mips/mips-boards/generic/mipsIRQ.S	Tue Jul 16 16:25:18 2002
@@ -56,6 +56,10 @@
  *             6        Hardware (ignored)
  *             7        R4k timer (what we use)
  *
+ * Note: On the SEAD board thing are a little bit different.
+ *       Here IRQ 2 (hw0) is wired to the UART0 and IRQ 3 (hw1) is wired
+ *       wired to UART1.
+ *	
  * We handle the IRQ according to _our_ priority which is:
  *
  * Highest ----     R4k Timer
@@ -90,14 +94,21 @@
 	 nop
 
 1:
+#if defined(CONFIG_MIPS_SEAD) 	
 	beq	a0, zero, 1f
-	 nop
-
+	 andi	a0, s0, CAUSEF_IP3	# delay slot, check hw1 interrupt
+#else
+	beq	a0, zero, 1f		# delay slot, check hw3 interrupt
+ 	 andi	a0, s0, CAUSEF_IP5	
+#endif
+	
 	/* Wheee, combined hardware level zero interrupt. */
 #if defined(CONFIG_MIPS_ATLAS)
 	jal	atlas_hw0_irqdispatch
 #elif defined(CONFIG_MIPS_MALTA)
 	jal	malta_hw0_irqdispatch
+#elif defined(CONFIG_MIPS_SEAD)
+	jal	sead_hw0_irqdispatch
 #else
 #error "MIPS board not supported\n"	
 #endif
@@ -107,6 +118,24 @@
 	 nop				# delay slot
 
 1:
+#if defined(CONFIG_MIPS_SEAD) 	
+	beq	a0, zero, 1f
+	 andi	a0, s0, CAUSEF_IP5	# delay slot, check hw3 interrupt
+	jal	sead_hw1_irqdispatch
+	 move	a0, sp			# delay slot	
+	j	ret_from_irq
+	 nop				# delay slot
+1:	
+#endif	
+
+	beq	a0, zero, 1f            # check hw3 (coreHI) interrupt
+	 nop
+	jal	corehi_irqdispatch
+	 move	a0, sp			
+	j	ret_from_irq
+	 nop				
+1:	
+
 	/*
 	 * Here by mistake?  This is possible, what can happen is that by the
 	 * time we take the exception the IRQ pin goes low, so just leave if
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/generic/pci.c linux-2.4.19-rc2/arch/mips/mips-boards/generic/pci.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/generic/pci.c	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/arch/mips/mips-boards/generic/pci.c	Tue Jul 16 16:25:18 2002
@@ -29,66 +29,229 @@
 
 #include <asm/mips-boards/generic.h>
 #include <asm/gt64120.h>
+#include <asm/mips-boards/bonito64.h>
 #ifdef CONFIG_MIPS_MALTA
 #include <asm/mips-boards/malta.h>
 #endif
+#include <asm/mips-boards/msc01_pci.h>
 
 #define PCI_ACCESS_READ  0
 #define PCI_ACCESS_WRITE 1
 
+/*
+ *  PCI configuration cycle AD bus definition
+ */
+/* Type 0 */
+#define PCI_CFG_TYPE0_REG_SHF           0
+#define PCI_CFG_TYPE0_FUNC_SHF          8
+
+/* Type 1 */
+#define PCI_CFG_TYPE1_REG_SHF           0
+#define PCI_CFG_TYPE1_FUNC_SHF          8
+#define PCI_CFG_TYPE1_DEV_SHF           11
+#define PCI_CFG_TYPE1_BUS_SHF           16
+
 static int
 mips_pcibios_config_access(unsigned char access_type, struct pci_dev *dev,
                            unsigned char where, u32 *data)
 {
 	unsigned char bus = dev->bus->number;
 	unsigned char dev_fn = dev->devfn;
-        u32 intr;
+	unsigned char type;
+	u32 intr, dummy;
+	u64 pci_addr;
+
+	switch(mips_revision_corid) {
+	case MIPS_REVISION_CORID_QED_RM5261:
+	case MIPS_REVISION_CORID_CORE_LV:
+	case MIPS_REVISION_CORID_CORE_FPGA:
+	        /* Galileo GT64120 system controller. */
+
+		if ((bus == 0) && (dev_fn >= PCI_DEVFN(31,0)))
+			return -1; /* Because of a bug in the galileo (for slot 31). */
+
+		/* Clear cause register bits */
+		GT_READ(GT_INTRCAUSE_OFS, intr);
+		GT_WRITE(GT_INTRCAUSE_OFS, intr & 
+			 ~(GT_INTRCAUSE_MASABORT0_BIT | 
+			   GT_INTRCAUSE_TARABORT0_BIT));
+
+		/* Setup address */
+		GT_WRITE(GT_PCI0_CFGADDR_OFS, 
+			 (bus         << GT_PCI0_CFGADDR_BUSNUM_SHF)   |
+			 (dev_fn      << GT_PCI0_CFGADDR_FUNCTNUM_SHF) |
+			 ((where / 4) << GT_PCI0_CFGADDR_REGNUM_SHF)   |
+			 GT_PCI0_CFGADDR_CONFIGEN_BIT);
+
+		if (access_type == PCI_ACCESS_WRITE) {
+			if (bus == 0 && dev_fn == 0) {
+				/* 
+				 * The Galileo system controller is acting 
+				 * differently than other devices. 
+				 */
+				GT_WRITE(GT_PCI0_CFGDATA_OFS, *data);
+			} else {
+				GT_PCI_WRITE(GT_PCI0_CFGDATA_OFS, *data);
+			}
+		} else {
+			if (bus == 0 && dev_fn == 0) {
+				/* 
+				 * The Galileo system controller is acting 
+				 * differently than other devices. 
+				 */
+				GT_READ(GT_PCI0_CFGDATA_OFS, *data);
+			} else {
+				GT_PCI_READ(GT_PCI0_CFGDATA_OFS, *data);
+			}
+		}
+
+		/* Check for master or target abort */
+		GT_READ(GT_INTRCAUSE_OFS, intr);
+
+		if (intr & (GT_INTRCAUSE_MASABORT0_BIT | 
+			    GT_INTRCAUSE_TARABORT0_BIT))
+		{
+			/* Error occured */
+
+			/* Clear bits */
+			GT_READ(GT_INTRCAUSE_OFS, intr);
+			GT_WRITE(GT_INTRCAUSE_OFS, intr & 
+				 ~(GT_INTRCAUSE_MASABORT0_BIT | 
+				   GT_INTRCAUSE_TARABORT0_BIT));
 
-	if ((bus == 0) && (dev_fn >= PCI_DEVFN(31,0)))
-	        return -1; /* Because of a bug in the galileo (for slot 31). */
+			return -1;
+		}
+
+		break;
 
-	/* Clear cause register bits */
-	GT_WRITE(GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | 
-	                             GT_INTRCAUSE_TARABORT0_BIT));
-
-	/* Setup address */
-	GT_WRITE(GT_PCI0_CFGADDR_OFS, 
-		 (bus         << GT_PCI0_CFGADDR_BUSNUM_SHF)   |
-		 (dev_fn      << GT_PCI0_CFGADDR_FUNCTNUM_SHF) |
-		 ((where / 4) << GT_PCI0_CFGADDR_REGNUM_SHF)   |
-		 GT_PCI0_CFGADDR_CONFIGEN_BIT);
-
-	if (access_type == PCI_ACCESS_WRITE) {
-	        if (bus == 0 && dev_fn == 0) {
-		        /* 
-			 * Galileo is acting differently than other devices. 
-			 */
-		        GT_WRITE(GT_PCI0_CFGDATA_OFS, *data);
+	case MIPS_REVISION_CORID_BONITO64:
+	case MIPS_REVISION_CORID_CORE_20K:
+	        /* Algorithmics Bonito64 system controller. */
+
+	        if ((bus == 0) && (PCI_SLOT(dev_fn) == 0)) {
+		        return -1;
+		}
+
+		/* Clear cause register bits */
+		BONITO_PCICMD |= (BONITO_PCICMD_MABORT_CLR | 
+				  BONITO_PCICMD_MTABORT_CLR);
+
+		/* 
+		 * Setup pattern to be used as PCI "address" for 
+		 * Type 0 cycle 
+		 */
+		if (bus == 0) {
+		        /* IDSEL */
+		        pci_addr = (u64)1 << (PCI_SLOT(dev_fn) + 10);
 		} else {
-		        GT_PCI_WRITE(GT_PCI0_CFGDATA_OFS, *data);
+		        /* Bus number */
+		        pci_addr = bus << PCI_CFG_TYPE1_BUS_SHF;
+
+			/* Device number */
+			pci_addr |= PCI_SLOT(dev_fn) << PCI_CFG_TYPE1_DEV_SHF;
 		}
-	} else {
-	        if (bus == 0 && dev_fn == 0) {
-		        /* 
-			 * Galileo is acting differently than other devices. 
-			 */
-		        GT_READ(GT_PCI0_CFGDATA_OFS, *data);
+
+		/* Function (same for Type 0/1) */
+		pci_addr |= PCI_FUNC(dev_fn) << PCI_CFG_TYPE0_FUNC_SHF;
+		
+		/* Register number (same for Type 0/1) */
+		pci_addr |= (where & ~0x3) << PCI_CFG_TYPE0_REG_SHF;
+		
+		if (bus == 0) {
+		        /* Type 0 */
+		        BONITO_PCIMAP_CFG = pci_addr >> 16;
 		} else {
-		        GT_PCI_READ(GT_PCI0_CFGDATA_OFS, *data);
+		        /* Type 1 */
+		        BONITO_PCIMAP_CFG = (pci_addr >> 16) | 0x10000;
+		}
+	  
+		/* Flush Bonito register block */
+		dummy = BONITO_PCIMAP_CFG;
+		__asm__ __volatile__(
+				     ".set\tnoreorder\n\t"
+				     ".set\tnoat\n\t"
+				     "sync\n\t"
+				     ".set\tat\n\t"
+				     ".set\treorder");
+
+		/* Perform access */
+		if (access_type == PCI_ACCESS_WRITE) {
+		        *(volatile u32 *)(KSEG1ADDR(BONITO_PCICFG_BASE + 
+					  (pci_addr & 0xffff))) = *(u32 *)data;
+
+			/* Wait till done */
+			while (BONITO_PCIMSTAT & 0xF)
+			        ;
+		} else {
+		        *(u32 *)data = 
+			  *(volatile u32 *)(KSEG1ADDR(BONITO_PCICFG_BASE + 
+					    (pci_addr & 0xffff)));
 		}
-	}
 
-	/* Check for master or target abort */
-	GT_READ(GT_INTRCAUSE_OFS, intr);
+		/* Detect Master/Target abort */
+		if (BONITO_PCICMD & (BONITO_PCICMD_MABORT_CLR | 
+				     BONITO_PCICMD_MTABORT_CLR) )
+		{
+		        /* Error occurred */
+
+		        /* Clear bits */
+		        BONITO_PCICMD |= (BONITO_PCICMD_MABORT_CLR | 
+					  BONITO_PCICMD_MTABORT_CLR);
+    
+			return -1;
+		}
+	        break;
 
-	if (intr & (GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT))
-	{
-	        /* Error occured */
-
-	        /* Clear bits */
-	        GT_WRITE( GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | 
-					      GT_INTRCAUSE_TARABORT0_BIT) );
+	case MIPS_REVISION_CORID_CORE_MSC:
+	        /* MIPS system controller. */
 
+	        if ((bus == 0) && (PCI_SLOT(dev_fn) == 0)) {
+		        return -1;
+		}
+
+		/* Clear status register bits. */
+		MSC_WRITE(MSC01_PCI_INTSTAT, 
+			  (MSC01_PCI_INTCFG_MA_BIT | 
+			   MSC01_PCI_INTCFG_TA_BIT));
+
+		/* Setup address */
+		if (bus == 0)
+			type = 0;  /* Type 0 */
+		else
+			type = 1;  /* Type 1 */
+
+		MSC_WRITE(MSC01_PCI_CFGADDR,
+			  ((bus              << MSC01_PCI_CFGADDR_BNUM_SHF) |
+			   (PCI_SLOT(dev_fn) << MSC01_PCI_CFGADDR_DNUM_SHF) |
+			   (PCI_FUNC(dev_fn) << MSC01_PCI_CFGADDR_FNUM_SHF) |
+			   ((where /4 )      << MSC01_PCI_CFGADDR_RNUM_SHF) |
+			   (type)));
+
+		/* Perform access */
+		if (access_type == PCI_ACCESS_WRITE) {
+		        MSC_WRITE(MSC01_PCI_CFGDATA, *data);
+		} else {
+			MSC_READ(MSC01_PCI_CFGDATA, *data);
+		}
+
+		/* Detect Master/Target abort */
+		MSC_READ(MSC01_PCI_INTSTAT, intr);
+		if (intr & (MSC01_PCI_INTCFG_MA_BIT | 
+			    MSC01_PCI_INTCFG_TA_BIT))
+		{
+		        /* Error occurred */
+
+		        /* Clear bits */
+			MSC_READ(MSC01_PCI_INTSTAT, intr);
+			MSC_WRITE(MSC01_PCI_INTSTAT,
+				  (MSC01_PCI_INTCFG_MA_BIT | 
+				   MSC01_PCI_INTCFG_TA_BIT));
+
+			return -1;
+		}
+	        break;
+	default:
+	        printk("Unknown Core card, don't know the system controller.\n");
 		return -1;
 	}
 
@@ -216,21 +379,28 @@
 	printk("PCI: Probing PCI hardware on host bus 0.\n");
 	pci_scan_bus(0, &mips_pci_ops, NULL);
 
-	/* 
-	 * Due to a bug in the Galileo system controller, we need to setup 
-	 * the PCI BAR for the Galileo internal registers.
-	 * This should be done in the bios/bootprom and will be fixed in
-	 * a later revision of YAMON (the MIPS boards boot prom).
-	 */
-	GT_WRITE(GT_PCI0_CFGADDR_OFS,
-		 (0 << GT_PCI0_CFGADDR_BUSNUM_SHF)   |  /* Local bus */
-		 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF)   |  /* GT64120 device */
-		 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) |  /* Function 0 */
-		 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) |  /* BAR 4 */
-		 GT_PCI0_CFGADDR_CONFIGEN_BIT );
-
-	/* Perform the write */
-	GT_WRITE( GT_PCI0_CFGDATA_OFS, PHYSADDR(MIPS_GT_BASE)); 
+	switch(mips_revision_corid) {
+	case MIPS_REVISION_CORID_QED_RM5261:
+	case MIPS_REVISION_CORID_CORE_LV:
+	case MIPS_REVISION_CORID_CORE_FPGA:
+		/* 
+		 * Due to a bug in the Galileo system controller, we need 
+		 * to setup the PCI BAR for the Galileo internal registers.
+		 * This should be done in the bios/bootprom and will be 
+		 * fixed in a later revision of YAMON (the MIPS boards 
+		 * boot prom).
+		 */
+		GT_WRITE(GT_PCI0_CFGADDR_OFS,
+			 (0 << GT_PCI0_CFGADDR_BUSNUM_SHF) | /* Local bus */
+			 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF) | /* GT64120 dev */
+			 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | /* Function 0*/
+			 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) | /* BAR 4*/
+			 GT_PCI0_CFGADDR_CONFIGEN_BIT );
+
+		/* Perform the write */
+		GT_WRITE( GT_PCI0_CFGDATA_OFS, PHYSADDR(MIPS_GT_BASE)); 
+		break;
+	}
 
 #ifdef CONFIG_MIPS_MALTA
 	pci_for_each_dev(pdev) {
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/generic/time.c linux-2.4.19-rc2/arch/mips/mips-boards/generic/time.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/generic/time.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mips-boards/generic/time.c	Tue Jul 16 16:25:18 2002
@@ -34,6 +34,7 @@
 #include <asm/ptrace.h>
 #include <asm/hardirq.h>
 #include <asm/div64.h>
+#include <asm/cpu.h>
 
 #include <linux/interrupt.h>
 #include <linux/mc146818rtc.h>
@@ -42,13 +43,10 @@
 #include <asm/mips-boards/generic.h>
 #include <asm/mips-boards/prom.h>
 
-extern volatile unsigned long wall_jiffies;
-static long last_rtc_update = 0;
-unsigned long missed_heart_beats = 0;
-
-static unsigned long r4k_offset; /* Amount to increment compare reg each time */
-static unsigned long r4k_cur;    /* What counter should be at next timer irq */
-extern rwlock_t xtime_lock;
+static unsigned int r4k_offset; /* Amount to increment compare reg each time */
+static unsigned int r4k_cur;    /* What counter should be at next timer irq */
+
+extern unsigned int mips_counter_frequency;
 
 #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
 
@@ -61,132 +59,36 @@
 static unsigned int display_count = 0;
 #define MAX_DISPLAY_COUNT (sizeof(display_string) - 8) 
 
+#define MIPS_CPU_TIMER_IRQ 7
+
 static unsigned int timer_tick_count=0;
 
 
-static inline void ack_r4ktimer(unsigned long newval)
+static inline void ack_r4ktimer(unsigned int newval)
 {
 	write_32bit_cp0_register(CP0_COMPARE, newval);
 }
 
-
-/*
- * In order to set the CMOS clock precisely, set_rtc_mmss has to be
- * called 500 ms after the second nowtime has started, because when
- * nowtime is written into the registers of the CMOS clock, it will
- * jump to the next second precisely 500 ms later. Check the Motorola
- * MC146818A or Dallas DS12887 data sheet for details.
- *
- * BUG: This routine does not handle hour overflow properly; it just
- *      sets the minutes. Usually you won't notice until after reboot!
- */
-static int set_rtc_mmss(unsigned long nowtime)
-{
-	int retval = 0;
-	int real_seconds, real_minutes, cmos_minutes;
-	unsigned char save_control, save_freq_select;
-
-	save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
-	CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
-
-	save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
-	CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
-
-	cmos_minutes = CMOS_READ(RTC_MINUTES);
-
-	/*
-	 * since we're only adjusting minutes and seconds,
-	 * don't interfere with hour overflow. This avoids
-	 * messing with unknown time zones but requires your
-	 * RTC not to be off by more than 15 minutes
-	 */
-	real_seconds = nowtime % 60;
-	real_minutes = nowtime / 60;
-	if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
-		real_minutes += 30;		/* correct for half hour time zone */
-	real_minutes %= 60;
-
-	if (abs(real_minutes - cmos_minutes) < 30) {
-		CMOS_WRITE(real_seconds,RTC_SECONDS);
-		CMOS_WRITE(real_minutes,RTC_MINUTES);
-	} else {
-		printk(KERN_WARNING
-		       "set_rtc_mmss: can't update from %d to %d\n",
-		       cmos_minutes, real_minutes);
- 		retval = -1;
-	}
-
-	/* The following flags have to be released exactly in this order,
-	 * otherwise the DS12887 (popular MC146818A clone with integrated
-	 * battery and quartz) will not reset the oscillator and will not
-	 * update precisely 500 ms later. You won't find this mentioned in
-	 * the Dallas Semiconductor data sheets, but who believes data
-	 * sheets anyway ...                           -- Markus Kuhn
-	 */
-	CMOS_WRITE(save_control, RTC_CONTROL);
-	CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
-
-	return retval;
-}
-
-/*
- * There are a lot of conceptually broken versions of the MIPS timer interrupt
- * handler floating around.  This one is rather different, but the algorithm
- * is provably more robust.
- */
 void mips_timer_interrupt(struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
-	int irq = 7;
-
-	if (r4k_offset == 0)
-		goto null;
+	int irq = MIPS_CPU_TIMER_IRQ;
 
 	irq_enter(cpu, irq);
-	do {
-		kstat.irqs[cpu][irq]++;
-		do_timer(regs);
-
-		/* Historical comment/code:
- 		 * RTC time of day s updated approx. every 11 
- 		 * minutes.  Because of how the numbers work out 
- 		 * we need to make absolutely sure we do this update
- 		 * within 500ms before the * next second starts, 
- 		 * thus the following code.
- 		 */
-		read_lock(&xtime_lock);
-		if ((time_status & STA_UNSYNC) == 0 
-		    && xtime.tv_sec > last_rtc_update + 660 
-		    && xtime.tv_usec >= 500000 - (tick >> 1) 
-		    && xtime.tv_usec <= 500000 + (tick >> 1)) {
-			if (set_rtc_mmss(xtime.tv_sec) == 0)
-				last_rtc_update = xtime.tv_sec;
-			else
-				/* do it again in 60 s */
-	    			last_rtc_update = xtime.tv_sec - 600; 
-		}
-		read_unlock(&xtime_lock);
-
-		if ((timer_tick_count++ % HZ) == 0) {
-		    mips_display_message(&display_string[display_count++]);
-		    if (display_count == MAX_DISPLAY_COUNT)
+	kstat.irqs[cpu][irq]++;
+	timer_interrupt(irq, NULL, regs);
+
+	if ((timer_tick_count++ % HZ) == 0) {
+		mips_display_message(&display_string[display_count++]);
+		if (display_count == MAX_DISPLAY_COUNT)
 		        display_count = 0;
-		}
 
-		r4k_cur += r4k_offset;
-		ack_r4ktimer(r4k_cur);
+	}
 
-	} while (((unsigned long)read_32bit_cp0_register(CP0_COUNT)
-	         - r4k_cur) < 0x7fffffff);
 	irq_exit(cpu, irq);
 
 	if (softirq_pending(cpu))
 		do_softirq();
-
-	return;
-
-null:
-	ack_r4ktimer(0);
 }
 
 /* 
@@ -194,9 +96,8 @@
  * register for each time tick. 
  * Use the RTC to calculate offset.
  */
-static unsigned long __init cal_r4koff(void)
+static unsigned int __init cal_r4koff(void)
 {
-	unsigned long count;
 	unsigned int flags;
 
 	__save_and_cli(flags);
@@ -212,15 +113,15 @@
 	while (CMOS_READ(RTC_REG_A) & RTC_UIP);
 	while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
 
-	count = read_32bit_cp0_register(CP0_COUNT);
+	mips_counter_frequency = read_32bit_cp0_register(CP0_COUNT);
 
 	/* restore interrupts */
 	__restore_flags(flags);
 
-	return (count / HZ);
+	return (mips_counter_frequency / HZ);
 }
 
-static unsigned long __init get_mips_time(void)
+unsigned long __init mips_rtc_get_time(void)
 {
 	unsigned int year, mon, day, hour, min, sec;
 	unsigned char save_control;
@@ -259,26 +160,37 @@
 {
         unsigned int est_freq, flags;
 
+	__save_and_cli(flags);
+
         /* Set Data mode - binary. */ 
         CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
 
 	printk("calculating r4koff... ");
 	r4k_offset = cal_r4koff();
-	printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
+	printk("%08x(%d)\n", r4k_offset, r4k_offset);
+
+        if ((read_32bit_cp0_register(CP0_PRID) & 0xffff00) == 
+	    (PRID_COMP_MIPS | PRID_IMP_20KC))
+		est_freq = r4k_offset*HZ;
+	else
+		est_freq = 2*r4k_offset*HZ;
 
-	est_freq = 2*r4k_offset*HZ;	
 	est_freq += 5000;    /* round */
 	est_freq -= est_freq%10000;
 	printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, 
 	       (est_freq%1000000)*100/1000000);
-	r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset);
 
-	write_32bit_cp0_register(CP0_COMPARE, r4k_cur);
-	change_cp0_status(ST0_IM, ALLINTS);
+	__restore_flags(flags);
+}
 
-	/* Read time from the RTC chipset. */
-	write_lock_irqsave (&xtime_lock, flags);
-	xtime.tv_sec = get_mips_time();
-	xtime.tv_usec = 0;
-	write_unlock_irqrestore(&xtime_lock, flags);
+void __init mips_timer_setup(struct irqaction *irq)
+{
+	/* we are using the cpu counter for timer interrupts */
+	irq->handler = no_action;     /* we use our own handler */
+	setup_irq(MIPS_CPU_TIMER_IRQ, irq);
+
+        /* to generate the first timer interrupt */
+	r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset);
+	write_32bit_cp0_register(CP0_COMPARE, r4k_cur);
+	set_cp0_status(ALLINTS);
 }
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/malta/Makefile linux-2.4.19-rc2/arch/mips/mips-boards/malta/Makefile
--- linux-2.4.19-rc1/arch/mips/mips-boards/malta/Makefile	Fri Apr 13 20:26:07 2001
+++ linux-2.4.19-rc2/arch/mips/mips-boards/malta/Makefile	Tue Jul 16 16:25:18 2002
@@ -28,10 +28,7 @@
 #
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := malta.o
 
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/malta/malta_int.c linux-2.4.19-rc2/arch/mips/mips-boards/malta/malta_int.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/malta/malta_int.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mips-boards/malta/malta_int.c	Tue Jul 16 16:25:18 2002
@@ -36,28 +36,290 @@
 #include <asm/mips-boards/piix4.h>
 #include <asm/gt64120.h>
 #include <asm/mips-boards/generic.h>
+#include <asm/mips-boards/msc01_pci.h>
 
 extern asmlinkage void mipsIRQ(void);
+extern asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
+extern void init_i8259_irqs (void);
+
+void enable_mips_irq(unsigned int irq);
+void disable_mips_irq(unsigned int irq);
+
+static spinlock_t mips_irq_lock = SPIN_LOCK_UNLOCKED;
+
+static void end_mips_irq (unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+		enable_mips_irq(irq);
+}
+
+#define shutdown_mips_irq	disable_mips_irq
+
+void mask_and_ack_mips_irq(unsigned int irq);
+
+static unsigned int startup_mips_irq(unsigned int irq)
+{ 
+	enable_mips_irq(irq);
+
+	return 0; /* never anything pending */
+}
+
+static struct hw_interrupt_type mips_irq_type = {
+	"XT-PIC",
+	startup_mips_irq,
+	shutdown_mips_irq,
+	enable_mips_irq,
+	disable_mips_irq,
+	mask_and_ack_mips_irq,
+	end_mips_irq,
+	NULL
+};
+
+/*
+ * This contains the interrupt mask for both 82C59 interrupt controllers.
+ */
+static unsigned int cached_int_mask = 0xffff;
+
+void disable_mips_irq(unsigned int irq_nr)
+{
+        unsigned long flags;
+
+	if(irq_nr >= MALTAINT_END) {
+		printk("whee, invalid irq_nr %d\n", irq_nr);
+		panic("IRQ, you lose...");
+	}
+
+	spin_lock_irqsave(&mips_irq_lock, flags);
+	cached_int_mask |= (1 << irq_nr);
+	if (irq_nr & 8) {
+	        outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
+	} else {
+		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+	}
+	spin_unlock_irqrestore(&mips_irq_lock, flags);
+}
+
+void enable_mips_irq(unsigned int irq_nr)
+{
+        unsigned long flags;
+
+	if(irq_nr >= MALTAINT_END) {
+		printk("whee, invalid irq_nr %d\n", irq_nr);
+		panic("IRQ, you lose...");
+	}
+
+	spin_lock_irqsave(&mips_irq_lock, flags);
+	cached_int_mask &= ~(1 << irq_nr);
+	if (irq_nr & 8) {
+		outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
+
+		/* Enable irq 2 (cascade interrupt). */
+	        cached_int_mask &= ~(1 << 2); 
+		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+	} else {
+		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+	}	
+	spin_unlock_irqrestore(&mips_irq_lock, flags);
+}
+
+void mask_and_ack_mips_irq(unsigned int irq)
+{
+        unsigned long flags;
+
+	spin_lock_irqsave(&mips_irq_lock, flags);
+	if (irq & 8) {
+	        /* Non specific EOI to cascade */
+		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI | PIIX4_OCW2_ILS_2, 
+		     PIIX4_ICTLR1_OCW2);
+
+		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR2_OCW2);
+	} else {
+		outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR1_OCW2);
+	}
+	spin_unlock_irqrestore(&mips_irq_lock, flags);
+}
+
+static inline int get_int(int *irq)
+{
+	unsigned char irr;
+	
+	switch(mips_revision_corid) {
+	case MIPS_REVISION_CORID_QED_RM5261:
+	case MIPS_REVISION_CORID_CORE_LV:
+	case MIPS_REVISION_CORID_CORE_FPGA:
+	case MIPS_REVISION_CORID_CORE_MSC:
+		/*  
+		 * Determine highest priority pending interrupt by performing
+		 * a PCI Interrupt Acknowledge cycle.
+		 */
+		if (mips_revision_corid == MIPS_REVISION_CORID_CORE_MSC)
+			MSC_READ(MSC01_PCI_IACK, *irq);
+		else
+			GT_READ(GT_PCI0_IACK_OFS, *irq);
+		*irq &= 0xFF;
+
+		/*  
+		 * IRQ7 is used to detect spurious interrupts.
+		 * The interrupt acknowledge cycle returns IRQ7, if no 
+		 * interrupts is requested.
+		 * We can differentiate between this situation and a
+		 * "Normal" IRQ7 by reading the ISR.
+		 */
+		if (*irq == 7) 
+		{
+			outb(PIIX4_OCW3_SEL | PIIX4_OCW3_ISR, 
+			     PIIX4_ICTLR1_OCW3);
+			if (!(inb(PIIX4_ICTLR1_OCW3) & (1 << 7))) {
+				printk("We got a spurious interrupt from PIIX4.\n");
+				atomic_inc(&irq_err_count);
+				return -1;    /* Spurious interrupt. */
+			}
+		}
+		break;
+
+	case MIPS_REVISION_CORID_BONITO64:
+	case MIPS_REVISION_CORID_CORE_20K:
+	        /*
+		 * Determine highest priority pending interrupt by reading 
+		 * the IRR register of controller 1.
+		 */
+
+		outb(PIIX4_OCW3_SEL | PIIX4_OCW3_IRR, PIIX4_ICTLR1_OCW3);
+		irr = inb(PIIX4_ICTLR1_OCW3) & ~(cached_int_mask & 0xff);
+
+		if (!irr) {
+		        printk("We got a spurious interrupt from PIIX4.\n");
+			atomic_inc(&irq_err_count);
+			return -1;   /* Spurious interrupt. */
+		}
+		*irq = 0;
+		while ((*irq < 7) && !(irr & 0x01)) {
+		        (*irq)++;
+			irr >>= 1;
+		}
+
+		if (*irq == 2)
+		{
+		        /*
+			 * Determine highest priority pending interrupt by 
+			 * reading the IRR register of controller 1.
+			 */
+		        outb(PIIX4_OCW3_SEL | PIIX4_OCW3_IRR, 
+			     PIIX4_ICTLR2_OCW3);
+			irr = inb(PIIX4_ICTLR2_OCW3) & 
+			~((cached_int_mask >> 8) & 0xff);
+
+			*irq = 8;
+			while ((*irq < 15) && !(irr & 0x01)) {
+			        (*irq)++;
+				irr >>= 1;
+			}
+		}
+		break;
+	default:
+	        printk("Unknown Core card, don't know the system controller.\n");
+		return -1;
+	}
+
+	return 0;
+}
 
 void malta_hw0_irqdispatch(struct pt_regs *regs)
 {
 	int irq;
+	struct irqaction *action;
 
-	/*  
-	 * Determine highest priority pending interrupt by performing a PCI
-	 * Interrupt Acknowledge cycle.
-	 */
-	GT_READ(GT_PCI0_IACK_OFS, irq);
-	irq &= 0xFF;
+	if (get_int(&irq))
+	        return;  /* interrupt has already been cleared */
 
+	switch(mips_revision_corid) {
+	case MIPS_REVISION_CORID_BONITO64:
+	case MIPS_REVISION_CORID_CORE_20K:
+		action = irq_desc[irq].action;
+		if (!action)
+			return;
+		action->flags |= SA_INTERRUPT;
+		break;
+	}
+	
 	do_IRQ(irq, regs);
 }
 
+void corehi_irqdispatch(struct pt_regs *regs)
+{
+        unsigned int data,datahi;
+
+        printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n");
+        printk("epc   : %08lx\nStatus: %08lx\nCause : %08lx\nbadVaddr : %08lx\n"
+, regs->cp0_epc, regs->cp0_status, regs->cp0_cause, regs->cp0_badvaddr);
+        switch(mips_revision_corid) {
+        case MIPS_REVISION_CORID_CORE_MSC:
+                break;
+        case MIPS_REVISION_CORID_QED_RM5261:
+        case MIPS_REVISION_CORID_CORE_LV:
+        case MIPS_REVISION_CORID_CORE_FPGA:
+                GT_READ(GT_INTRCAUSE_OFS, data);
+                printk("GT_INTRCAUSE = %08x\n", data);
+                GT_READ(0x70, data);
+                GT_READ(0x78, datahi);
+                printk("GT_CPU_ERR_ADDR = %0x2%08x\n", datahi,data);
+                break;
+        case MIPS_REVISION_CORID_BONITO64:
+        case MIPS_REVISION_CORID_CORE_20K:
+                data = BONITO_INTISR;
+                printk("BONITO_INTISR = %08x\n", data);
+                data = BONITO_INTEN;
+                printk("BONITO_INTEN = %08x\n", data);
+                data = BONITO_INTPOL;
+                printk("BONITO_INTPOL = %08x\n", data);
+                data = BONITO_INTEDGE;
+                printk("BONITO_INTEDGE = %08x\n", data);
+                data = BONITO_INTSTEER;
+                printk("BONITO_INTSTEER = %08x\n", data);
+                data = BONITO_PCICMD;
+                printk("BONITO_PCICMD = %08x\n", data);
+                break;
+        }
+
+        /* We die here*/
+        die("CoreHi interrupt", regs);
+        while (1) ;
+}
+
 void __init init_IRQ(void)
 {
+	unsigned int i;
+
 	set_except_vector(0, mipsIRQ);
 	init_generic_irq();
-	init_i8259_irqs();
+	
+	switch(mips_revision_corid) {
+	case MIPS_REVISION_CORID_QED_RM5261:
+	case MIPS_REVISION_CORID_CORE_LV:
+	case MIPS_REVISION_CORID_CORE_FPGA:
+	case MIPS_REVISION_CORID_CORE_MSC:
+		init_i8259_irqs();
+		break;
+	case MIPS_REVISION_CORID_BONITO64:
+	case MIPS_REVISION_CORID_CORE_20K:
+		/* 
+		 * Mask out all interrupt by writing "1" to all bit position 
+		 * in the IMR register. 
+		 */
+		outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1);
+		outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1);
+
+		for (i = 0; i < 16; i++) {
+			irq_desc[i].status = IRQ_DISABLED;
+			irq_desc[i].action = 0;
+			irq_desc[i].depth = 1;
+			irq_desc[i].handler = &mips_irq_type;
+		}
+		break;
+	default:
+	        printk("Unknown Core card, don't know the system controller.\n");
+		return;
+	}
 
 #ifdef CONFIG_REMOTE_DEBUG
 	if (remote_debug) {
@@ -66,3 +328,5 @@
 	}
 #endif
 }
+
+
diff -urN linux-2.4.19-rc1/arch/mips/mips-boards/malta/malta_setup.c linux-2.4.19-rc2/arch/mips/mips-boards/malta/malta_setup.c
--- linux-2.4.19-rc1/arch/mips/mips-boards/malta/malta_setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mips-boards/malta/malta_setup.c	Tue Jul 16 16:25:18 2002
@@ -37,6 +37,13 @@
 #endif
 #include <asm/dma.h>
 #include <asm/time.h>
+#include <asm/traps.h>
+#ifdef CONFIG_PC_KEYB
+#include <asm/keyboard.h>
+#endif
+#ifdef CONFIG_VT
+#include <linux/console.h>
+#endif
 
 #if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE)
 extern void console_setup(char *, int *);
@@ -57,6 +64,13 @@
 
 extern void mips_reboot_setup(void);
 
+extern void (*board_time_init)(void);
+extern void (*board_timer_setup)(struct irqaction *irq);
+extern unsigned long (*rtc_get_time)(void);
+extern void mips_time_init(void);
+extern void mips_timer_setup(struct irqaction *irq);
+extern unsigned long mips_rtc_get_time(void);
+
 struct resource standard_io_resources[] = {
 	{ "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
 	{ "timer", 0x40, 0x5f, IORESOURCE_BUSY },
@@ -75,15 +89,13 @@
 {
 }
 
-extern void mips_time_init(void);
-
 void __init malta_setup(void)
 {
 #ifdef CONFIG_REMOTE_DEBUG
 	int rs_putDebugChar(char);
 	char rs_getDebugChar(void);
-	extern int (*generic_putDebugChar)(char);
-	extern char (*generic_getDebugChar)(void);
+	extern int (*putDebugChar)(char);
+	extern char (*getDebugChar)(void);
 #endif
 	char *argptr;
 	int i;
@@ -118,8 +130,8 @@
 		       line ? 1 : 0);
 
 		rs_kgdb_hook(line);
-		generic_putDebugChar = rs_putDebugChar;
-		generic_getDebugChar = rs_getDebugChar;
+		putDebugChar = rs_putDebugChar;
+		getDebugChar = rs_getDebugChar;
 
 		prom_printf("KGDB: Using serial line /dev/ttyS%d for session, "
 			    "please connect your debugger\n", line ? 1 : 0);
@@ -132,9 +144,16 @@
 	argptr = prom_getcmdline();
 	if ((argptr = strstr(argptr, "nofpu")) != NULL)
 		mips_cpu.options &= ~MIPS_CPU_FPU;
+
+        /* 
+	 * For some reason the irq probing doesn't work on the 
+	 * Bonito controller.
+	 * For now this work just fine.
+	 */
+	argptr = prom_getcmdline();
+	strcat(argptr, " ide0=0x1f0,0x3f6,14");
 		
 	rtc_ops = &malta_rtc_ops;
-	board_time_init = mips_time_init;
 
 #ifdef CONFIG_BLK_DEV_IDE
         ide_ops = &std_ide_ops;
@@ -145,5 +164,28 @@
 #ifdef CONFIG_PC_KEYB
 	kbd_ops = &std_kbd_ops;
 #endif
+#ifdef CONFIG_VT
+#if defined(CONFIG_VGA_CONSOLE)
+        conswitchp = &vga_con;
+
+	screen_info = (struct screen_info) {
+		0, 25,			/* orig-x, orig-y */
+		0,			/* unused */
+		0,			/* orig-video-page */
+		0,			/* orig-video-mode */
+		80,			/* orig-video-cols */
+		0,0,0,			/* ega_ax, ega_bx, ega_cx */
+		25,			/* orig-video-lines */
+		1,			/* orig-video-isVGA */
+		16			/* orig-video-points */
+	};
+#elif defined(CONFIG_DUMMY_CONSOLE)
+        conswitchp = &dummy_con;
+#endif
+#endif
 	mips_reboot_setup();
+
+	board_time_init = mips_time_init;
+	board_timer_setup = mips_timer_setup;
+	rtc_get_time = mips_rtc_get_time;
 }
diff -urN linux-2.4.19-rc1/arch/mips/mm/Makefile linux-2.4.19-rc2/arch/mips/mm/Makefile
--- linux-2.4.19-rc1/arch/mips/mm/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(AFLAGS) $< -o $@
-.S.o:
-	$(CC) $(AFLAGS) -c $< -o $@
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := mm.o
 
diff -urN linux-2.4.19-rc1/arch/mips/mm/c-mips32.c linux-2.4.19-rc2/arch/mips/mm/c-mips32.c
--- linux-2.4.19-rc1/arch/mips/mm/c-mips32.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/c-mips32.c	Tue Jul 16 16:25:18 2002
@@ -17,6 +17,7 @@
  *
  * MIPS32 CPU variant specific MMU/Cache routines.
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -158,10 +159,6 @@
 	}
 }
 
-
-
-
-
 static void mips32_flush_cache_page_sc(struct vm_area_struct *vma,
 				    unsigned long page)
 {
@@ -413,6 +410,13 @@
 	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 }
 
+static void mips32_flush_icache_all(void)
+{
+	if (mips_cpu.cputype == CPU_20KC) {
+		blast_icache();
+	}
+}
+
 /* Detect and size the various caches. */
 static void __init probe_icache(unsigned long config)
 {
@@ -665,6 +669,7 @@
 
 	_flush_cache_sigtramp = mips32_flush_cache_sigtramp;
 	_flush_icache_range = mips32_flush_icache_range;	/* Ouch */
+	_flush_icache_all = mips32_flush_icache_all;
 
 	__flush_cache_all();
 }
diff -urN linux-2.4.19-rc1/arch/mips/mm/c-r4k.c linux-2.4.19-rc2/arch/mips/mm/c-r4k.c
--- linux-2.4.19-rc1/arch/mips/mm/c-r4k.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/c-r4k.c	Tue Jul 16 16:25:18 2002
@@ -14,6 +14,7 @@
  *  - many of the bug workarounds are not efficient at all, but at
  *    least they are functional ...
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -27,6 +28,7 @@
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/mmu_context.h>
+#include <asm/war.h>
 
 /* Primary cache parameters. */
 static int icache_size, dcache_size; /* Size in bytes */
@@ -75,83 +77,47 @@
 
 static inline void r4k_flush_cache_all_s16d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache16();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s32d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache32();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s64d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache64();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s128d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache128();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s32d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32(); blast_scache32();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s64d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32(); blast_scache64();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s128d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32(); blast_scache128();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32();
-	__restore_flags(flags);
 }
 
 static void
@@ -160,7 +126,6 @@
                                 unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (mm->context == 0)
 		return;
@@ -178,7 +143,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while (start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -188,7 +152,6 @@
 					blast_scache16_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -199,7 +162,6 @@
                                 unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (mm->context == 0)
 		return;
@@ -217,7 +179,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -227,7 +188,6 @@
 					blast_scache32_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -237,7 +197,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (mm->context == 0)
 		return;
@@ -255,7 +214,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -265,7 +223,6 @@
 					blast_scache64_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -275,7 +232,6 @@
 					     unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (mm->context == 0)
 		return;
@@ -293,7 +249,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -303,7 +258,6 @@
 					blast_scache128_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -313,7 +267,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (mm->context == 0)
 		return;
@@ -331,7 +284,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -341,7 +293,6 @@
 					blast_scache32_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -351,7 +302,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (mm->context == 0)
 		return;
@@ -369,7 +319,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -379,7 +328,6 @@
 					blast_scache64_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -389,7 +337,6 @@
 					     unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (mm->context == 0)
 		return;
@@ -407,7 +354,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -417,7 +363,6 @@
 					blast_scache128_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -427,14 +372,10 @@
 					 unsigned long end)
 {
 	if (mm->context != 0) {
-		unsigned long flags;
-
 #ifdef DEBUG_CACHE
 		printk("crange[%d,%08lx,%08lx]", (int)mm->context, start, end);
 #endif
-		__save_and_cli(flags);
 		blast_dcache16(); blast_icache16();
-		__restore_flags(flags);
 	}
 }
 
@@ -443,14 +384,10 @@
 					 unsigned long end)
 {
 	if (mm->context != 0) {
-		unsigned long flags;
-
 #ifdef DEBUG_CACHE
 		printk("crange[%d,%08lx,%08lx]", (int)mm->context, start, end);
 #endif
-		__save_and_cli(flags);
 		blast_dcache32(); blast_icache32();
-		__restore_flags(flags);
 	}
 }
 
@@ -553,7 +490,6 @@
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -568,7 +504,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -598,14 +533,12 @@
 	} else
 		blast_scache16_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s32d16i16(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -620,7 +553,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -649,14 +581,12 @@
 	} else
 		blast_scache32_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s64d16i16(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -671,7 +601,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -700,14 +629,12 @@
 	} else
 		blast_scache64_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s128d16i16(struct vm_area_struct *vma,
 					    unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -722,7 +649,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -752,14 +678,12 @@
 	} else
 		blast_scache128_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s32d32i32(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -774,7 +698,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -804,14 +727,12 @@
 	} else
 		blast_scache32_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s64d32i32(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -826,7 +747,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -856,14 +776,12 @@
 	} else
 		blast_scache64_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s128d32i32(struct vm_area_struct *vma,
 					    unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -878,7 +796,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -907,14 +824,12 @@
 	} else
 		blast_scache128_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_d16i16(struct vm_area_struct *vma,
 					unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -929,7 +844,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -958,14 +872,12 @@
 		blast_dcache16_page_indexed(page);
 	}
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_d32i32(struct vm_area_struct *vma,
 					unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -980,7 +892,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1010,14 +921,12 @@
 		blast_dcache32_page_indexed(page);
 	}
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_d32i32_r4600(struct vm_area_struct *vma,
 					      unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1032,7 +941,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1062,7 +970,6 @@
 		blast_dcache32_page_indexed(page ^ dcache_waybit);
 	}
 out:
-	__restore_flags(flags);
 }
 
 /* If the addresses passed to these routines are valid, they are
@@ -1106,11 +1013,16 @@
 
 static void r4k_flush_page_to_ram_d32_r4600(struct page *page)
 {
+#ifdef R4600_V1_HIT_DCACHE_WAR
 	unsigned long flags;
 
-	__save_and_cli(flags);			/* For R4600 v1.7 bug.  */
+	__save_and_cli(flags);
+	__asm__ __volatile__("nop;nop;nop;nop");
+#endif
 	blast_dcache32_page((unsigned long)page_address(page));
+#ifdef R4600_V1_HIT_DCACHE_WAR
 	__restore_flags(flags);
+#endif
 }
 
 static void
@@ -1141,17 +1053,6 @@
 	flush_cache_all();
 }
 
-/*
- * Writeback and invalidate the primary cache dcache before DMA.
- *
- * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D,
- * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only
- * operate correctly if the internal data cache refill buffer is empty.  These
- * CACHE instructions should be separated from any potential data cache miss
- * by a load instruction to an uncached address to empty the response buffer."
- * (Revision 2.0 device errata from IDT available on http://www.idt.com/
- * in .pdf format.)
- */
 static void
 r4k_dma_cache_wback_inv_pc(unsigned long addr, unsigned long size)
 {
@@ -1161,9 +1062,11 @@
 	if (size >= dcache_size) {
 		flush_cache_all();
 	} else {
-		/* Workaround for R4600 bug.  See comment above. */
+#ifdef R4600_V2_HIT_CACHEOP_WAR
+		/* Workaround for R4600 bug.  See comment in <asm/war>. */
 		__save_and_cli(flags);
 		*(volatile unsigned long *)KSEG1;
+#endif
 
 		a = addr & ~(dc_lsize - 1);
 		end = (addr + size) & ~(dc_lsize - 1);
@@ -1172,7 +1075,9 @@
 			if (a == end) break;
 			a += dc_lsize;
 		}
+#ifdef R4600_V2_HIT_CACHEOP_WAR
 		__restore_flags(flags);
+#endif
 	}
 	bc_wback_inv(addr, size);
 }
@@ -1205,9 +1110,11 @@
 	if (size >= dcache_size) {
 		flush_cache_all();
 	} else {
+#ifdef R4600_V2_HIT_CACHEOP_WAR
 		/* Workaround for R4600 bug.  See comment above. */
 		__save_and_cli(flags);
 		*(volatile unsigned long *)KSEG1;
+#endif
 
 		a = addr & ~(dc_lsize - 1);
 		end = (addr + size) & ~(dc_lsize - 1);
@@ -1216,7 +1123,9 @@
 			if (a == end) break;
 			a += dc_lsize;
 		}
+#ifdef R4600_V2_HIT_CACHEOP_WAR
 		__restore_flags(flags);
+#endif
 	}
 
 	bc_inv(addr, size);
@@ -1254,24 +1163,36 @@
  */
 static void r4k_flush_cache_sigtramp(unsigned long addr)
 {
-	__asm__ __volatile__("nop;nop;nop;nop");	/* R4600 V1.7 */
+#ifdef R4600_V1_HIT_DCACHE_WAR
+	unsigned long flags;
+
+	__save_and_cli(flags);
+	__asm__ __volatile__("nop;nop;nop;nop");
+#endif
 	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
 	protected_flush_icache_line(addr & ~(ic_lsize - 1));
+#ifdef R4600_V1_HIT_DCACHE_WAR
+	__restore_flags(flags);
+#endif
 }
 
 static void r4600v20k_flush_cache_sigtramp(unsigned long addr)
 {
 	unsigned int flags;
 
+#ifdef R4600_V2_HIT_CACHEOP_WAR
 	__save_and_cli(flags);
 
 	/* Clear internal cache refill buffer */
 	*(volatile unsigned int *)KSEG1;
+#endif
 
 	protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
 	protected_flush_icache_line(addr & ~(ic_lsize - 1));
 
+#ifdef R4600_V2_HIT_CACHEOP_WAR
 	__restore_flags(flags);
+#endif
 }
 
 /* Detect and size the various r4k caches. */
diff -urN linux-2.4.19-rc1/arch/mips/mm/c-rm7k.c linux-2.4.19-rc2/arch/mips/mm/c-rm7k.c
--- linux-2.4.19-rc1/arch/mips/mm/c-rm7k.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/c-rm7k.c	Tue Jul 16 16:25:18 2002
@@ -14,6 +14,7 @@
  *  - many of the bug workarounds are not efficient at all, but at
  *    least they are functional ...
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -133,7 +134,6 @@
 	end = (addr + size) & ~(sc_lsize - 1);
 	while (1) {
 		flush_dcache_line(a);	/* Hit_Writeback_Inv_D */
-		flush_icache_line(a);	/* Hit_Invalidate_I */
 		flush_scache_line(a);	/* Hit_Writeback_Inv_SD */
 		if (a == end) break;
 		a += sc_lsize;
@@ -160,7 +160,6 @@
 	end = (addr + size) & ~(sc_lsize - 1);
 	while (1) {
 		invalidate_dcache_line(a);	/* Hit_Invalidate_D */
-		flush_icache_line(a);		/* Hit_Invalidate_I */
 		invalidate_scache_line(a);	/* Hit_Invalidate_SD */
 		if (a == end) break;
 		a += sc_lsize;
diff -urN linux-2.4.19-rc1/arch/mips/mm/c-sb1.c linux-2.4.19-rc2/arch/mips/mm/c-sb1.c
--- linux-2.4.19-rc1/arch/mips/mm/c-sb1.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/c-sb1.c	Tue Jul 16 16:25:18 2002
@@ -17,12 +17,13 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */ 
-
+#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/mmu_context.h>
 #include <asm/bootinfo.h>
 #include <asm/cacheops.h>
 #include <asm/cpu.h>
+#include <asm/uaccess.h>
 
 /* These are probed at ld_mmu time */
 static unsigned int icache_size;
@@ -209,7 +210,7 @@
 		".set pop                   \n"
 		:
 		: "r" (start & ~(icache_line_size - 1)),
-		  "r" ((end - 1) & ~(dcache_line_size - 1)),
+		  "r" ((end - 1) & ~(icache_line_size - 1)),
 		  "r" (icache_line_size),
 		  "i" (Index_Invalidate_I));
 }
@@ -245,11 +246,11 @@
  * If there's no context yet, or the page isn't executable, no icache flush
  * is needed
  */
-static void sb1_flush_icache_page(struct vm_area_struct *vma, struct page *page)
+static void sb1_flush_icache_page(struct vm_area_struct *vma,
+	struct page *page)
 {
-	if ((vma->vm_mm->context == 0) || !(vma->vm_flags & VM_EXEC)) {
+	if (!(vma->vm_flags & VM_EXEC))
 		return;
-	}
 
 	/*
 	 * We're not sure of the virtual address(es) involved here, so
@@ -322,32 +323,43 @@
 }
 
 /*
- * XXX - Still need to really understand this.  This is mostly just
- * derived from the r10k and r4k implementations, and seems to work
- * but things that "seem to work" when I don't understand *why* they
- * "seem to work" disturb me greatly...JDC
+ * A signal trampoline must fit into a single cacheline.
  */
 static void local_sb1_flush_cache_sigtramp(unsigned long addr)
 {
 	unsigned long daddr, iaddr;
-	
+
 	daddr = addr & ~(dcache_line_size - 1);
 	protected_writeback_dcache_line(daddr);
-	protected_writeback_dcache_line(daddr + dcache_line_size);
 	iaddr = addr & ~(icache_line_size - 1);
 	protected_flush_icache_line(iaddr);
-	protected_flush_icache_line(iaddr + icache_line_size);
 }
 
 #ifdef CONFIG_SMP
-extern void sb1_flush_cache_sigtramp_ipi(void *ignored);
-asm("sb1_flush_cache_sigtramp_ipi = local_sb1_flush_cache_sigtramp");
+
+static void sb1_flush_cache_sigtramp_ipi(void *info)
+{
+	unsigned long iaddr = (unsigned long) info;
+
+	iaddr = iaddr & ~(icache_line_size - 1);
+	protected_flush_icache_line(iaddr);
+}
 
 static void sb1_flush_cache_sigtramp(unsigned long addr)
 {
-	smp_call_function(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1);
+	unsigned long tmp;
+
+	/*
+	 * Flush the local dcache, then load the instruction back into a
+	 * register.  That will make sure that any remote CPU also has
+	 * written back it's data cache to memory.
+	 */
 	local_sb1_flush_cache_sigtramp(addr);
+	__get_user(tmp, (unsigned long *)addr);
+
+	smp_call_function(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1);
 }
+
 #else
 void sb1_flush_cache_sigtramp(unsigned long addr);
 asm("sb1_flush_cache_sigtramp = local_sb1_flush_cache_sigtramp");
diff -urN linux-2.4.19-rc1/arch/mips/mm/c-tx49.c linux-2.4.19-rc2/arch/mips/mm/c-tx49.c
--- linux-2.4.19-rc1/arch/mips/mm/c-tx49.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/c-tx49.c	Tue Jul 16 16:25:18 2002
@@ -17,6 +17,7 @@
  *  - many of the bug workarounds are not efficient at all, but at
  *    least they are functional ...
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
diff -urN linux-2.4.19-rc1/arch/mips/mm/fault.c linux-2.4.19-rc2/arch/mips/mm/fault.c
--- linux-2.4.19-rc1/arch/mips/mm/fault.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/fault.c	Tue Jul 16 16:25:18 2002
@@ -5,6 +5,7 @@
  *
  * Copyright (C) 1995 - 2000 by Ralf Baechle
  */
+#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
@@ -19,6 +20,7 @@
 #include <linux/smp_lock.h>
 #include <linux/version.h>
 
+#include <asm/branch.h>
 #include <asm/hardirq.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
@@ -181,7 +183,7 @@
 
 no_context:
 	/* Are we prepared to handle this kernel fault?  */
-	fixup = search_exception_table(regs->cp0_epc);
+	fixup = search_exception_table(exception_epc(regs));
 	if (fixup) {
 		long new_epc;
 
@@ -216,7 +218,7 @@
 		down_read(&mm->mmap_sem);
 		goto survive;
 	}
-	printk("VM: killing process %s\n", tsk->comm);
+	printk(KERN_NOTICE "VM: killing process %s\n", tsk->comm);
 	if (user_mode(regs))
 		do_exit(SIGKILL);
 	goto no_context;
diff -urN linux-2.4.19-rc1/arch/mips/mm/init.c linux-2.4.19-rc2/arch/mips/mm/init.c
--- linux-2.4.19-rc1/arch/mips/mm/init.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/init.c	Tue Jul 16 16:25:18 2002
@@ -206,6 +206,12 @@
 
 #ifdef CONFIG_HIGHMEM
 	/*
+	 * Fixed mappings:
+	 */
+	vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
+	fixrange_init(vaddr, 0, pgd_base);
+
+	/*
 	 * Permanent kmaps:
 	 */
 	vaddr = PKMAP_BASE;
@@ -280,15 +286,17 @@
 	unsigned long codesize, reservedpages, datasize, initsize;
 	unsigned long tmp, ram;
 
+#if defined(CONFIG_DISCONTIGMEM) && defined(CONFIG_HIGHMEM)
+#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
+#endif
+
 #ifdef CONFIG_HIGHMEM
 	highstart_pfn = (KSEG1 - KSEG0) >> PAGE_SHIFT;
 	highmem_start_page = mem_map + highstart_pfn;
-#ifdef CONFIG_DISCONTIGMEM
-#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
-#endif
 	max_mapnr = num_physpages = highend_pfn;
+	num_mappedpages = max_low_pfn;
 #else
-	max_mapnr = num_physpages = max_low_pfn;
+	max_mapnr = num_mappedpages = num_physpages = max_low_pfn;
 #endif
 	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
 
@@ -324,8 +332,8 @@
 	datasize =  (unsigned long) &_edata - (unsigned long) &_fdata;
 	initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
 
-	printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, "
-	       "%ldk data, %ldk init, %ldk highmem)\n",
+	printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
+	       "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
 	       (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
 	       ram << (PAGE_SHIFT-10),
 	       codesize >> 10,
@@ -339,7 +347,7 @@
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
 	if (start < end)
-		printk("Freeing initrd memory: %ldk freed\n",
+		printk(KERN_INFO "Freeing initrd memory: %ldk freed\n",
 		       (end - start) >> 10);
 
 	for (; start < end; start += PAGE_SIZE) {
diff -urN linux-2.4.19-rc1/arch/mips/mm/pg-andes.S linux-2.4.19-rc2/arch/mips/mm/pg-andes.S
--- linux-2.4.19-rc1/arch/mips/mm/pg-andes.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/pg-andes.S	Tue Jul 16 16:25:18 2002
@@ -10,8 +10,7 @@
  */
 #include <asm/asm.h>
 #include <asm/regdef.h>
-
-#define PAGE_SIZE	0x1000
+#include <asm/offset.h>
 
 	.text
 	.set	mips4
@@ -24,7 +23,7 @@
  */
 
 LEAF(andes_clear_page)
-	LONG_ADDIU	AT, a0, PAGE_SIZE
+	LONG_ADDIU	AT, a0, _PAGE_SIZE
 1:	pref		7, 512(a0)
 	LONG_S		zero, 0*SZREG(a0)
 	LONG_S		zero, 1*SZREG(a0)
@@ -41,7 +40,7 @@
 	END(andes_clear_page)
 
 LEAF(andes_copy_page)
-	LONG_ADDIU	AT, a0, PAGE_SIZE
+	LONG_ADDIU	AT, a0, _PAGE_SIZE
 1:	pref		0, 2*128(a1)
 	pref		1, 2*128(a0)
 	LONG_L		a3, 0*SZREG(a1)
diff -urN linux-2.4.19-rc1/arch/mips/mm/pg-r4k.S linux-2.4.19-rc2/arch/mips/mm/pg-r4k.S
--- linux-2.4.19-rc1/arch/mips/mm/pg-r4k.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/pg-r4k.S	Tue Jul 16 16:25:18 2002
@@ -14,8 +14,8 @@
 #include <asm/regdef.h>
 #include <asm/cacheops.h>
 #include <asm/mipsregs.h>
+#include <asm/offset.h>
 
-#define PAGE_SIZE	0x1000
 #ifdef CONFIG_64BIT_PHYS_ADDR
 #define PGD_SIZE	0x2000
 #else
@@ -40,7 +40,7 @@
  */
 
 LEAF(r4k_clear_page_d16)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_D, (a0)
 	sd	zero, (a0)
 	sd	zero, 8(a0)
@@ -59,7 +59,7 @@
 	END(r4k_clear_page_d16)
 
 LEAF(r4k_clear_page_d32)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_D, (a0)
 	sd	zero, (a0)
 	sd	zero, 8(a0)
@@ -104,7 +104,7 @@
  */
 
 LEAF(r4k_clear_page_r4600_v1)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	nop
 	nop
 	nop
@@ -141,7 +141,7 @@
 	lw	zero, (AT)
 	.set	novolatile
 
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_D, (a0)
 	sd	zero, (a0)
 	sd	zero, 8(a0)
@@ -179,7 +179,7 @@
  */
 
 LEAF(r4k_clear_page_s16)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	sd	zero, (a0)
 	sd	zero, 8(a0)
@@ -198,7 +198,7 @@
 	END(r4k_clear_page_s16)
 
 LEAF(r4k_clear_page_s32)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	sd	zero, (a0)
 	sd	zero, 8(a0)
@@ -215,7 +215,7 @@
 	END(r4k_clear_page_s32)
 
 LEAF(r4k_clear_page_s64)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	sd	zero, (a0)
 	sd	zero, 8(a0)
@@ -231,7 +231,7 @@
 	END(r4k_clear_page_s64)
 
 LEAF(r4k_clear_page_s128)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	sd	zero, (a0)
 	sd	zero, 8(a0)
@@ -260,7 +260,7 @@
  */
 
 LEAF(r4k_copy_page_d16)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_D, (a0)
 	lw	a3, (a1)
 	lw	a2, 4(a1)
@@ -304,7 +304,7 @@
 	END(r4k_copy_page_d16)
 
 LEAF(r4k_copy_page_d32)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_D, (a0)
 	lw	a3, (a1)
 	lw	a2, 4(a1)
@@ -350,7 +350,7 @@
  */
 
 LEAF(r4k_copy_page_r4600_v1)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	nop
 	nop
 	nop
@@ -409,7 +409,7 @@
 	nop
 	nop
 
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	nop
 	nop
 	nop
@@ -473,7 +473,7 @@
  */
 
 LEAF(r4k_copy_page_s16)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	lw	a3, (a1)
 	lw	a2, 4(a1)
@@ -517,7 +517,7 @@
 	END(r4k_copy_page_s16)
 
 LEAF(r4k_copy_page_s32)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	lw	a3, (a1)
 	lw	a2, 4(a1)
@@ -559,7 +559,7 @@
 	END(r4k_copy_page_s32)
 
 LEAF(r4k_copy_page_s64)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	lw	a3, (a1)
 	lw	a2, 4(a1)
@@ -600,7 +600,7 @@
 	END(r4k_copy_page_s64)
 
 LEAF(r4k_copy_page_s128)
-	addiu	AT, a0, PAGE_SIZE
+	addiu	AT, a0, _PAGE_SIZE
 1:	cache	Create_Dirty_Excl_SD, (a0)
 	lw	a3, (a1)
 	lw	a2, 4(a1)
diff -urN linux-2.4.19-rc1/arch/mips/mm/tlb-r3k.c linux-2.4.19-rc2/arch/mips/mm/tlb-r3k.c
--- linux-2.4.19-rc1/arch/mips/mm/tlb-r3k.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/tlb-r3k.c	Tue Jul 16 16:25:18 2002
@@ -8,6 +8,7 @@
  * Copyright (C) 1998, 1999, 2000 Harald Koerfgen
  * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
diff -urN linux-2.4.19-rc1/arch/mips/mm/tlb-sb1.c linux-2.4.19-rc2/arch/mips/mm/tlb-sb1.c
--- linux-2.4.19-rc1/arch/mips/mm/tlb-sb1.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/tlb-sb1.c	Tue Jul 16 16:25:18 2002
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */ 
+#include <linux/config.h>
 #include <asm/mmu_context.h>
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
@@ -68,7 +69,7 @@
 	       "--------------------------------------------------------------------\n");
 	dump_cur_tlb_regs();
 	printk(" %08X\n", read_32bit_cp0_register(CP0_INDEX));
-	printk("\n\nFull TLB Dump:"
+	printk("\n\nFull TLB Dump:\n"
 	       "Idx      EntryHi       EntryLo0          EntryLo1     PageMask\n"
 	       "--------------------------------------------------------------\n");
 	for (entry = 0; entry < mips_cpu.tlbsize; entry++) {
diff -urN linux-2.4.19-rc1/arch/mips/mm/tlbex-r3k.S linux-2.4.19-rc2/arch/mips/mm/tlbex-r3k.S
--- linux-2.4.19-rc1/arch/mips/mm/tlbex-r3k.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/tlbex-r3k.S	Tue Jul 16 16:25:18 2002
@@ -19,7 +19,7 @@
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <asm/pgtable-bits.h>
 #include <asm/processor.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
@@ -90,7 +90,7 @@
 	.set	macro; \
 	SAVE_ALL; \
 	mfc0	a2, CP0_BADVADDR; \
-	STI; \
+	KMODE; \
 	.set	at; \
 	move	a0, sp; \
 	jal	do_page_fault; \
diff -urN linux-2.4.19-rc1/arch/mips/mm/tlbex-r4k.S linux-2.4.19-rc2/arch/mips/mm/tlbex-r4k.S
--- linux-2.4.19-rc1/arch/mips/mm/tlbex-r4k.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/mm/tlbex-r4k.S	Tue Jul 16 16:25:18 2002
@@ -9,6 +9,7 @@
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  */
+#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/asm.h>
@@ -18,7 +19,7 @@
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
 #include <asm/page.h>
-#include <asm/pgtable.h>
+#include <asm/pgtable-bits.h>
 #include <asm/processor.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
@@ -77,7 +78,7 @@
 	lw	k1, pgd_current			# get pgd pointer
 #endif	
 	mfc0	k0, CP0_BADVADDR		# Get faulting address
-	srl	k0, k0, PGDIR_SHIFT		# get pgd only bits
+	srl	k0, k0, _PGDIR_SHIFT		# get pgd only bits
 
 	sll	k0, k0, 2
 	addu	k1, k1, k0			# add in pgd offset
@@ -103,7 +104,7 @@
 	LEAF(except_vec0_r4600)
 	.set	mips3
 	mfc0	k0, CP0_BADVADDR
-	srl	k0, k0, PGDIR_SHIFT
+	srl	k0, k0, _PGDIR_SHIFT
 	lw	k1, pgd_current			# get pgd pointer
 	sll	k0, k0, 2			# log2(sizeof(pgd_t)
 	addu	k1, k1, k0
@@ -141,7 +142,7 @@
 	LEAF(except_vec0_nevada)
 	.set	mips3
 	mfc0	k0, CP0_BADVADDR		# Get faulting address
-	srl	k0, k0, PGDIR_SHIFT		# get pgd only bits
+	srl	k0, k0, _PGDIR_SHIFT		# get pgd only bits
 	lw	k1, pgd_current			# get pgd pointer
 	sll	k0, k0, 2			# log2(sizeof(pgd_t)
 	addu	k1, k1, k0			# add in pgd offset
@@ -169,7 +170,7 @@
 	LEAF(except_vec0_r45k_bvahwbug)
 	.set	mips3
 	mfc0	k0, CP0_BADVADDR
-	srl	k0, k0, PGDIR_SHIFT
+	srl	k0, k0, _PGDIR_SHIFT
 	lw	k1, pgd_current			# get pgd pointer
 	sll	k0, k0, 2			# log2(sizeof(pgd_t)
 	addu	k1, k1, k0
@@ -201,7 +202,7 @@
 	LEAF(except_vec0_r4k_mphwbug)
 	.set	mips3
 	mfc0	k0, CP0_BADVADDR
-	srl	k0, k0, PGDIR_SHIFT
+	srl	k0, k0, _PGDIR_SHIFT
 	lw	k1, pgd_current			# get pgd pointer
 	sll	k0, k0, 2			# log2(sizeof(pgd_t)
 	addu	k1, k1, k0
@@ -233,7 +234,7 @@
 	LEAF(except_vec0_r4k_250MHZhwbug)
 	.set	mips3
 	mfc0	k0, CP0_BADVADDR
-	srl	k0, k0, PGDIR_SHIFT
+	srl	k0, k0, _PGDIR_SHIFT
 	lw	k1, pgd_current			# get pgd pointer
 	sll	k0, k0, 2			# log2(sizeof(pgd_t)
 	addu	k1, k1, k0
@@ -264,7 +265,7 @@
 	LEAF(except_vec0_r4k_MP250MHZhwbug)
 	.set	mips3
 	mfc0	k0, CP0_BADVADDR
-	srl	k0, k0, PGDIR_SHIFT
+	srl	k0, k0, _PGDIR_SHIFT
 	lw	k1, pgd_current			# get pgd pointer
 	sll	k0, k0, 2			# log2(sizeof(pgd_t)
 	addu	k1, k1, k0
@@ -302,7 +303,7 @@
 	LEAF(except_vec0_au1000)
 	.set	mips3
 	mfc0	k0, CP0_BADVADDR		# Get faulting address
-	srl	k0, k0, PGDIR_SHIFT		# get pgd only bits
+	srl	k0, k0, _PGDIR_SHIFT		# get pgd only bits
 	lw	k1, pgd_current			# get pgd pointer
 	sll	k0, k0, 2			# log2(sizeof(pgd_t)
 	addu	k1, k1, k0			# add in pgd offset
@@ -345,7 +346,7 @@
 #define LOAD_PTE(pte, ptr) \
 	GET_PGD(pte, ptr)          \
 	mfc0	pte, CP0_BADVADDR; \
-	srl	pte, pte, PGDIR_SHIFT; \
+	srl	pte, pte, _PGDIR_SHIFT; \
 	sll	pte, pte, 2; \
 	addu	ptr, ptr, pte; \
 	mfc0	pte, CP0_BADVADDR; \
@@ -373,7 +374,7 @@
 	.set	noat; \
 	SAVE_ALL; \
 	mfc0	a2, CP0_BADVADDR; \
-	STI; \
+	KMODE; \
 	.set	at; \
 	move	a0, sp; \
 	jal	do_page_fault; \
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/Makefile linux-2.4.19-rc2/arch/mips/sgi-ip22/Makefile
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/Makefile	Tue Jul 16 16:25:18 2002
@@ -8,17 +8,16 @@
 #
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := ip22-kern.o
 
 all: ip22-kern.o ip22-irq.o
 
-obj-y	+= ip22-mc.o ip22-sc.o ip22-hpc.o ip22-int.o ip22-time.o ip22-rtc.o \
-	   ip22-irq.o ip22-system.o ip22-reset.o ip22-setup.o
+obj-y += ip22-mc.o ip22-hpc.o ip22-int.o ip22-irq.o ip22-time.o ip22-berr.o \
+         ip22-gio.o ip22-rtc.o ip22-reset.o ip22-system.o ip22-setup.o
+
+obj-$(CONFIG_BOARD_SCACHE)	+= ip22-sc.o
 
 ip22-irq.o: ip22-irq.S
 
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-berr.c linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-berr.c
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-berr.c	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-berr.c	Tue Jul 16 16:25:18 2002
@@ -0,0 +1,78 @@
+/*
+ * ip22-berr.c: Bus error handling.
+ *
+ * Copyright (C) 2002 Ladislav Michl
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+
+#include <asm/addrspace.h>
+#include <asm/system.h>
+#include <asm/traps.h>
+#include <asm/branch.h>
+#include <asm/sgi/sgimc.h>
+#include <asm/sgi/sgihpc.h>
+
+unsigned int cpu_err_stat;	/* Status reg for CPU */
+unsigned int gio_err_stat;	/* Status reg for GIO */
+unsigned int cpu_err_addr;	/* Error address reg for CPU */
+unsigned int gio_err_addr;	/* Error address reg for GIO */
+
+volatile int nofault;
+
+static void save_and_clear_buserr(void)
+{
+	/* save memory controler's error status registers */ 
+	cpu_err_addr = mcmisc_regs->cerr;
+	cpu_err_stat = mcmisc_regs->cstat;
+	gio_err_addr = mcmisc_regs->gerr;
+	gio_err_stat = mcmisc_regs->gstat;
+
+	mcmisc_regs->cstat = mcmisc_regs->gstat = 0;
+}
+
+/*
+ * MC sends an interrupt whenever bus or parity errors occur. In addition, 
+ * if the error happened during a CPU read, it also asserts the bus error 
+ * pin on the R4K. Code in bus error handler save the MC bus error registers
+ * and then clear the interrupt when this happens.
+ */
+
+void be_ip22_interrupt(int irq, struct pt_regs *regs)
+{
+	save_and_clear_buserr();
+	printk(KERN_ALERT "Bus error, epc == %08lx, ra == %08lx\n",
+	       regs->cp0_epc, regs->regs[31]);
+	die_if_kernel("Oops", regs);
+	force_sig(SIGBUS, current);
+}
+
+int be_ip22_handler(struct pt_regs *regs, int is_fixup)
+{
+	save_and_clear_buserr();
+	if (nofault) {
+		nofault = 0;
+		compute_return_epc(regs);
+		return MIPS_BE_DISCARD;
+	}
+	return MIPS_BE_FIXUP;
+}
+
+int ip22_baddr(unsigned int *val, unsigned long addr)
+{
+	nofault = 1;
+	*val = *(volatile unsigned int *) addr;
+	__asm__ __volatile__("nop;nop;nop;nop");
+	if (nofault) {
+		nofault = 0;
+		return 0;
+	}
+	return -EFAULT;
+}
+
+void __init bus_error_init(void)
+{
+	be_board_handler = be_ip22_handler;
+}
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-gio.c linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-gio.c
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-gio.c	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-gio.c	Tue Jul 16 16:25:18 2002
@@ -0,0 +1,152 @@
+/* 
+ * ip22-gio.c: Support for GIO64 bus (inspired by PCI code)
+ * 
+ * Copyright (C) 2002 Ladislav Michl
+ */
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/proc_fs.h>
+
+#include <asm/sgi/sgimc.h>
+#include <asm/sgi/sgigio.h>
+
+#define GIO_PIO_MAP_BASE	0x1f000000L
+#define GIO_PIO_MAP_SIZE	(16 * 1024*1024)
+
+#define GIO_ADDR_GFX		0x1f000000L
+#define GIO_ADDR_GIO1		0x1f400000L
+#define GIO_ADDR_GIO2		0x1f600000L
+
+#define GIO_GFX_MAP_SIZE	(4 * 1024*1024)
+#define GIO_GIO1_MAP_SIZE	(2 * 1024*1024)
+#define GIO_GIO2_MAP_SIZE	(4 * 1024*1024)
+
+#define GIO_NO_DEVICE		0x80
+
+static struct gio_dev gio_slot[GIO_NUM_SLOTS] = {
+	{
+		0,
+		0,
+		0,
+		GIO_NO_DEVICE,
+		GIO_SLOT_GFX,
+		GIO_ADDR_GFX,
+		GIO_GFX_MAP_SIZE,
+		NULL,
+		"GFX"
+	},
+	{
+		0,
+		0,
+		0,
+		GIO_NO_DEVICE,
+		GIO_SLOT_GIO1,
+		GIO_ADDR_GIO1,
+		GIO_GIO1_MAP_SIZE,
+		NULL,
+		"EXP0"
+	},
+	{
+		0,
+		0,
+		0,
+		GIO_NO_DEVICE,
+		GIO_SLOT_GIO2,
+		GIO_ADDR_GIO2,
+		GIO_GIO2_MAP_SIZE,
+		NULL,
+		"EXP1"
+	}
+};
+
+static int gio_read_proc(char *buf, char **start, off_t off,
+			 int count, int *eof, void *data)
+{
+	int i;
+	char *p = buf;
+	
+	p += sprintf(p, "GIO devices found:\n");
+	for (i = 0; i < GIO_NUM_SLOTS; i++) {
+		if (gio_slot[i].flags & GIO_NO_DEVICE)
+			continue;
+		p += sprintf(p, "  Slot %s, DeviceId 0x%02x\n",
+			     gio_slot[i].slot_name, gio_slot[i].device);
+		p += sprintf(p, "    BaseAddr 0x%08lx, MapSize 0x%08x\n",
+			     gio_slot[i].base_addr, gio_slot[i].map_size);
+	}
+	
+	return p - buf;
+}
+
+void create_gio_proc_entry(void)
+{
+	create_proc_read_entry("gio", 0, NULL, gio_read_proc, NULL);
+}
+
+/**
+ * gio_find_device - begin or continue searching for a GIO device by device id
+ * @device: GIO device id to match, or %GIO_ANY_ID to match all device ids
+ * @from: Previous GIO device found in search, or %NULL for new search.
+ *
+ * Iterates through the list of known GIO devices. If a GIO device is found
+ * with a matching @device, a pointer to its device structure is returned. 
+ * Otherwise, %NULL is returned.
+ * A new search is initiated by passing %NULL to the @from argument.
+ * Otherwise if @from is not %NULL, searches continue from next device.
+ */
+struct gio_dev *
+gio_find_device(unsigned char device, const struct gio_dev *from)
+{
+	int i;
+	
+	for (i = (from) ? from->slot_number : 0; i < GIO_NUM_SLOTS; i++)
+		if (!(gio_slot[i].flags & GIO_NO_DEVICE) && 
+		   (device == GIO_ANY_ID || device == gio_slot[i].device))
+			return &gio_slot[i];
+	
+	return NULL;
+}
+
+#define GIO_IDCODE(x)		(x & 0x7f)
+#define GIO_ALL_BITS_VALID	0x80
+#define GIO_REV(x)		((x >> 8) & 0xff)
+#define GIO_GIO_SIZE_64		0x10000
+#define GIO_ROM_PRESENT		0x20000
+#define GIO_VENDOR_CODE(x)	((x >> 18) & 0x3fff)
+
+extern int ip22_baddr(unsigned int *val, unsigned long addr);
+
+/** 
+ * sgigio_init - scan the GIO space and figure out what hardware is actually
+ * present.
+ */
+void __init sgigio_init(void)
+{
+	unsigned int i, id, found = 0;
+
+	printk("GIO: Scanning for GIO cards...\n");
+	for (i = 0; i < GIO_NUM_SLOTS; i++) {
+		if (ip22_baddr(&id, KSEG1ADDR(gio_slot[i].base_addr)))
+			continue;
+
+		found = 1;
+		gio_slot[i].device = GIO_IDCODE(id);
+		if (id & GIO_ALL_BITS_VALID) {
+			gio_slot[i].revision = GIO_REV(id);
+			gio_slot[i].vendor = GIO_VENDOR_CODE(id);
+			gio_slot[i].flags =
+				(id & GIO_GIO_SIZE_64) ? GIO_IFACE_64 : 0 |
+				(id & GIO_ROM_PRESENT) ? GIO_HAS_ROM : 0;
+		} else
+			gio_slot[i].flags = GIO_VALID_ID_ONLY;
+
+		printk("GIO: Card 0x%02x @ 0x%08lx\n", gio_slot[i].device,
+			gio_slot[i].base_addr);
+	}
+	
+	if (!found)
+		printk("GIO: No GIO cards present.\n");
+}
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-int.c linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-int.c
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-int.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-int.c	Tue Jul 16 16:25:18 2002
@@ -1,6 +1,6 @@
 /*
  * ip22-int.c: Routines for generic manipulation of the INT[23] ASIC
- *             found on INDY and Indigo2 workstations..
+ *             found on INDY and Indigo2 workstations.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
@@ -16,8 +16,8 @@
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
-#include <asm/irq.h>
 #include <asm/mipsregs.h>
 #include <asm/addrspace.h>
 #include <asm/gdb-stub.h>
@@ -279,6 +279,8 @@
 	return;	
 }
 
+extern void be_ip22_interrupt(int irq, struct pt_regs *regs);
+
 void indy_buserror_irq(struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
@@ -286,9 +288,7 @@
 
 	irq_enter(cpu, irq);
 	kstat.irqs[cpu][irq]++;
-	die("Got a bus error IRQ, shouldn't happen yet\n", regs);
-	printk("Spinning...\n");
-	while(1);
+	be_ip22_interrupt(irq, regs);
 	irq_exit(cpu, irq);
 }
 
@@ -305,9 +305,8 @@
 	{ no_action, SA_INTERRUPT, 0, "mappable1 cascade", NULL, NULL };
 #endif
 
-extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
-extern void mips_cpu_irq_init(u32 irq_base);
-	
+extern void mips_cpu_irq_init(unsigned int irq_base);
+
 void __init init_IRQ(void)
 {
 	int i;
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-mc.c linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-mc.c
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-mc.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-mc.c	Tue Jul 16 16:25:18 2002
@@ -4,20 +4,21 @@
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes
  */
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 
 #include <asm/addrspace.h>
 #include <asm/ptrace.h>
+#include <asm/sgialib.h>
 #include <asm/sgi/sgimc.h>
 #include <asm/sgi/sgihpc.h>
-#include <asm/sgialib.h>
 
 /* #define DEBUG_SGIMC */
 
 struct sgimc_misc_ctrl *mcmisc_regs;
-u32 *rpsscounter;
 struct sgimc_dma_ctrl *dmactrlregs;
+u32 *rpsscounter;
 
 static inline char *mconfig_string(unsigned long val)
 {
@@ -42,7 +43,7 @@
 
 	default:
 		return "wheee, unknown";
-	};
+	}
 }
 
 void __init sgimc_init(void)
@@ -50,10 +51,10 @@
 	unsigned long tmpreg;
 
 	mcmisc_regs = (struct sgimc_misc_ctrl *)(KSEG1+0x1fa00000);
-	rpsscounter = (unsigned int *) (KSEG1 + 0x1fa01004);
-	dmactrlregs = (struct sgimc_dma_ctrl *) (KSEG1+0x1fa02000);
+	rpsscounter = (unsigned int *)(KSEG1+0x1fa01004);
+	dmactrlregs = (struct sgimc_dma_ctrl *)(KSEG1+0x1fa02000);
 
-	printk("MC: SGI memory controller Revision %d\n",
+	printk(KERN_INFO "MC: SGI memory controller Revision %d\n",
 	       (int) mcmisc_regs->systemid & SGIMC_SYSID_MASKREV);
 
 #if 0 /* XXX Until I figure out what this bit really indicates XXX */
@@ -81,7 +82,7 @@
 	/* Place the MC into a known state.  This must be done before
 	 * interrupts are first enabled etc.
 	 */
-
+	
 	/* Step 0: Make sure we turn off the watchdog in case it's
 	 *         still running (which might be the case after a
 	 *         soft reboot).
@@ -137,7 +138,7 @@
 	 *       revision on this machine.  You have been warned.
 	 */
 
-	/* First the basic invariants across all gio64 implementations. */
+	/* First the basic invariants across all GIO64 implementations. */
 	tmpreg = SGIMC_GIOPARM_HPC64;    /* All 1st HPC's interface at 64bits. */
 	tmpreg |= SGIMC_GIOPARM_ONEBUS;  /* Only one physical GIO bus exists. */
 
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-setup.c linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-setup.c
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-setup.c	Tue Jul 16 16:25:18 2002
@@ -17,6 +17,7 @@
 
 #include <asm/addrspace.h>
 #include <asm/bcache.h>
+#include <asm/bootinfo.h>
 #include <asm/keyboard.h>
 #include <asm/irq.h>
 #include <asm/reboot.h>
@@ -27,6 +28,7 @@
 #include <asm/sgi/sgint23.h>
 #include <asm/time.h>
 #include <asm/gdb-stub.h>
+#include <asm/traps.h>
 
 #ifdef CONFIG_REMOTE_DEBUG
 extern void rs_kgdb_hook(int);
@@ -40,14 +42,18 @@
 
 extern void sgitime_init(void);
 
+extern struct hpc3_miscregs *hpc3mregs;
 extern struct rtc_ops indy_rtc_ops;
 extern void indy_reboot_setup(void);
 extern void sgi_volume_set(unsigned char);
+extern void create_gio_proc_entry(void);
 
-#define sgi_kh ((struct hpc_keyb *) (KSEG1 + 0x1fbd9800 + 64))
+#define sgi_kh ((struct hpc_keyb *) &(hpc3mregs->kbdmouse0))
 
 #define KBD_STAT_IBF		0x02	/* Keyboard input buffer full */
 
+unsigned long sgi_gfxaddr;
+
 static void sgi_request_region(void)
 {
 	/* No I/O ports are being used on the Indy.  */
@@ -56,12 +62,18 @@
 static int sgi_request_irq(void (*handler)(int, void *, struct pt_regs *))
 {
 	/* Dirty hack, this get's called as a callback from the keyboard
-	   driver.  We piggyback the initialization of the front panel
-	   button handling on it even though they're technically not
-	   related with the keyboard driver in any way.  Doing it from
-	   indy_setup wouldn't work since kmalloc isn't initialized yet.  */
+	 * driver.  We piggyback the initialization of the front panel
+	 * button handling on it even though they're technically not
+	 * related with the keyboard driver in any way.  Doing it from
+	 * ip22_setup wouldn't work since kmalloc isn't initialized yet.
+	 */
 	indy_reboot_setup();
 
+	/* Ehm, well... once David used hack above, let's add yet another.
+	 * Register GIO bus proc entry here.
+	 */
+	create_gio_proc_entry();
+
 	return request_irq(SGI_KEYBD_IRQ, handler, 0, "keyboard", NULL);
 }
 
@@ -119,10 +131,6 @@
 	sgi_read_status
 };
 
-void __init bus_error_init(void)
-{
-}
-
 void __init ip22_setup(void)
 {
 #ifdef CONFIG_SERIAL_CONSOLE
@@ -141,8 +149,11 @@
 	/* Init INDY memory controller. */
 	sgimc_init();
 
+#ifdef CONFIG_BOARD_SCACHE
 	/* Now enable boardcaches, if any. */
 	indy_sc_init();
+#endif
+	conswitchp = NULL;
 
 #ifdef CONFIG_SERIAL_CONSOLE
 	/* ARCS console environment variable is set to "g?" for
@@ -185,21 +196,32 @@
  
 	sgi_volume_set(simple_strtoul(ArcGetEnvironmentVariable("volume"), NULL, 10));
 
+	{
+	  unsigned long *gfxinfo;
+	  long (*__vec)(void) = (void *) *(long *)((PROMBLOCK)->pvector + 0x20);
+	  gfxinfo = (unsigned long *)__vec();
+	  sgi_gfxaddr = gfxinfo[1] >= 0xa0000000 && gfxinfo[1] <= 0xc0000000 ? gfxinfo[1] - 0xa0000000 : 0;
+	}
 #ifdef CONFIG_VT
 #ifdef CONFIG_SGI_NEWPORT_CONSOLE
-	conswitchp = &newport_con;
-
-	screen_info = (struct screen_info) {
-		0, 0,		/* orig-x, orig-y */
-		0,		/* unused */
-		0,		/* orig_video_page */
-		0,		/* orig_video_mode */
-		160,		/* orig_video_cols */
-		0, 0, 0,	/* unused, ega_bx, unused */
-		64,		/* orig_video_lines */
-		0,		/* orig_video_isVGA */
-		16		/* orig_video_points */
-	};
+	/* newport addresses? */
+	if (sgi_gfxaddr == 0x1f0f0000 || sgi_gfxaddr == 0x1f4f0000) {
+		conswitchp = &newport_con;
+
+		screen_info = (struct screen_info) {
+			0, 0,		/* orig-x, orig-y */
+			0,		/* unused */
+			0,		/* orig_video_page */
+			0,		/* orig_video_mode */
+			160,		/* orig_video_cols */
+			0, 0, 0,	/* unused, ega_bx, unused */
+			64,		/* orig_video_lines */
+			0,		/* orig_video_isVGA */
+			16		/* orig_video_points */
+		};
+	} else {
+		conswitchp = &dummy_con;
+	}
 #else
 	conswitchp = &dummy_con;
 #endif
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-system.c linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-system.c
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-system.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-system.c	Tue Jul 16 16:25:18 2002
@@ -28,18 +28,17 @@
 	{ "MIPS-R4600", CPU_R4600 },
 	{ "MIPS-R8000", CPU_R8000 },
 	{ "MIPS-R5000", CPU_R5000 },
-	{ "MIPS-R5000A", CPU_R5000A }
+	{ "MIPS-R5000A", CPU_R5000A },
+	{ "MIPS-R10000", CPU_R10000 }
 };
 
-#define NUM_CPUS 9 /* for now */
-
 static int __init string_to_cpu(char *s)
 {
 	long cnt;
 	char c;
 	int i;
 
-	for(i = 0; i < NUM_CPUS; i++) {
+	for(i = 0; i < (sizeof(sgi_cputable) / sizeof(struct smatch)); i++) {
 		if(!strcmp(s, sgi_cputable[i].name))
 			return sgi_cputable[i].type;
 	}
@@ -68,6 +67,7 @@
 	p = ArcGetChild(PROM_NULL_COMPONENT);
 
 	/* Now scan for cpu(s). */
+	printk(KERN_INFO);
 	toplev = p = ArcGetChild(p);
 	while(p) {
 		int ncpus = 0;
diff -urN linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-time.c linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-time.c
--- linux-2.4.19-rc1/arch/mips/sgi-ip22/ip22-time.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sgi-ip22/ip22-time.c	Tue Jul 16 16:25:18 2002
@@ -8,8 +8,6 @@
  *
  * Copyright (C) 2001 by Ladislav Michl 
  */
-
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
@@ -22,6 +20,7 @@
 #include <asm/ds1286.h>
 #include <asm/sgialib.h>
 #include <asm/sgi/sgint23.h>
+#include <asm/sgi/sgigio.h>
 #include <asm/time.h>
 
 /*
@@ -152,7 +151,7 @@
 	tcwp = &p->tcword;
 	tc2p = &p->tcnt2;
 
-	printk("Calibrating system timer... ");
+	printk(KERN_INFO "Calibrating system timer... ");
 	dosample(tcwp, tc2p);                   /* Prime cache. */
 	dosample(tcwp, tc2p);                   /* Prime cache. */
 	/* Zero is NOT an option. */
@@ -181,6 +180,14 @@
 		(int) (r4k_tick / 5000), (int) (r4k_tick % 5000) / 50);
 
 	mips_counter_frequency = r4k_tick * HZ;	
+	
+	/* HACK ALERT! This get's called after traps initialization
+	 * We piggyback the initialization of GIO bus here even though
+	 * it is technically not related with the timer in any way.
+	 * Doing it from ip22_setup wouldn't work since traps aren't 
+	 * initialized yet.
+	 */
+	sgigio_init();
 }
 
 /* Generic SGI handler for (spurious) 8254 interrupts */
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/sb1/Makefile linux-2.4.19-rc2/arch/mips/sibyte/sb1/Makefile
--- linux-2.4.19-rc1/arch/mips/sibyte/sb1/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/sb1/Makefile	Tue Jul 16 16:25:18 2002
@@ -1,7 +1,4 @@
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 L_TARGET = sb1kern.a
 
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/sb1250/Makefile linux-2.4.19-rc2/arch/mips/sibyte/sb1250/Makefile
--- linux-2.4.19-rc1/arch/mips/sibyte/sb1250/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/sb1250/Makefile	Tue Jul 16 16:25:18 2002
@@ -1,11 +1,8 @@
-.S.s:
-	$(CPP) $(AFLAGS) $< -o $@
-.S.o:
-	$(CC) $(AFLAGS) -c $< -o $@
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := sb1250.o
 
-obj-y := setup.o irq.o irq_handler.o time.o
+obj-y := irq.o irq_handler.o time.o
 
 obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_SMP)		+= smp.o
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/sb1250/pci.c linux-2.4.19-rc2/arch/mips/sibyte/sb1250/pci.c
--- linux-2.4.19-rc1/arch/mips/sibyte/sb1250/pci.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/sb1250/pci.c	Tue Jul 16 16:25:18 2002
@@ -44,7 +44,6 @@
 
 #include <asm/sibyte/sb1250_defs.h>
 #include <asm/sibyte/sb1250_regs.h>
-#include <asm/sibyte/sb1250_pci.h>
 #include <asm/io.h>
 
 #include "lib_hssubr.h"
@@ -238,10 +237,9 @@
 	 * See if the PCI bus has been configured by the firmware.
 	 */
 
-	cmdreg = READCFG32((A_PCI_TYPE00_HEADER | MATCH_BITS) +
-			   R_PCI_TYPE0_CMDSTATUS);
+	cmdreg = READCFG32((A_PCI_TYPE00_HEADER | MATCH_BITS) + PCI_COMMAND);
 
-	if (!(cmdreg & M_PCI_CMD_MASTER_EN)) {
+	if (!(cmdreg & PCI_COMMAND_MASTER)) {
 		printk
 		    ("PCI: Skipping PCI probe.  Bus is not initialized.\n");
 		return;
@@ -262,10 +260,9 @@
 	 * initialize that one.
 	 */
 
-	cmdreg = READCFG32((A_PCI_TYPE01_HEADER | MATCH_BITS) +
-			   R_PCI_TYPE0_CMDSTATUS);
+	cmdreg = READCFG32((A_PCI_TYPE01_HEADER | MATCH_BITS) + PCI_COMMAND);
 
-	if (cmdreg & M_PCI_CMD_MASTER_EN) {
+	if (cmdreg & PCI_COMMAND_MASTER) {
 		sb1250_bus_status |= LDT_BUS_ENABLED;
 	}
 
@@ -276,15 +273,14 @@
 
 }
 
-int __init pcibios_enable_device(struct pci_dev *dev)
+int pcibios_enable_device(struct pci_dev *dev)
 {
 	/* Not needed, since we enable all devices at startup.  */
 	return 0;
 }
 
-void __init
-pcibios_align_resource(void *data, struct resource *res,
-		       unsigned long size)
+void pcibios_align_resource(void *data, struct resource *res,
+                            unsigned long size)
 {
 }
 
@@ -299,8 +295,7 @@
 	{0}
 };
 
-void __init
-pcibios_update_resource(struct pci_dev *dev, struct resource *root,
+void pcibios_update_resource(struct pci_dev *dev, struct resource *root,
 			struct resource *res, int resource)
 {
 	unsigned long where, size;
@@ -317,12 +312,12 @@
  *  Called after each bus is probed, but before its children
  *  are examined.
  */
-void __init pcibios_fixup_bus(struct pci_bus *b)
+void pcibios_fixup_bus(struct pci_bus *b)
 {
 	pci_read_bridge_bases(b);
 }
 
-unsigned __init int pcibios_assign_all_busses(void)
+unsigned int pcibios_assign_all_busses(void)
 {
 	return 1;
 }
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/sb1250/time.c linux-2.4.19-rc2/arch/mips/sibyte/sb1250/time.c
--- linux-2.4.19-rc1/arch/mips/sibyte/sb1250/time.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/sb1250/time.c	Tue Jul 16 16:25:18 2002
@@ -25,7 +25,7 @@
  * code to do general bookkeeping (e.g. update jiffies, run
  * bottom halves, etc.)
  */
-
+#include <linux/config.h>
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
@@ -33,6 +33,8 @@
 #include <asm/irq.h>
 #include <asm/ptrace.h>
 #include <asm/addrspace.h>
+#include <asm/time.h>
+
 #include <asm/sibyte/sb1250.h>
 #include <asm/sibyte/sb1250_regs.h>
 #include <asm/sibyte/sb1250_int.h>
@@ -40,10 +42,6 @@
 #include <asm/sibyte/64bit.h>
 
 
-void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-
-
-
 #define IMR_IP2_VAL	K_INT_MAP_I0
 #define IMR_IP3_VAL	K_INT_MAP_I1
 #define IMR_IP4_VAL	K_INT_MAP_I2
@@ -89,10 +87,6 @@
 	 */
 }
 
-extern int set_rtc_mmss(unsigned long nowtime);
-extern rwlock_t xtime_lock;
-static long last_rtc_update = 0;
-
 void sb1250_timer_interrupt(struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
@@ -102,37 +96,14 @@
 	      KSEG1 + A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));  
 
 	/*
-	 * Need to do some stuff here with xtime, too, but that looks like
-	 * it should be architecture independent...does it really belong here?
+	 * CPU 0 handles the global timer interrupt job
 	 */
-	if (!cpu) {
-		do_timer(regs);
-
-		read_lock(&xtime_lock);
-		if ((time_status & STA_UNSYNC) == 0 
-		    && xtime.tv_sec > last_rtc_update + 660 
-		    && xtime.tv_usec >= 500000 - (tick >> 1) 
-		    && xtime.tv_usec <= 500000 + (tick >> 1)) {
-			if (set_rtc_mmss(xtime.tv_sec) == 0)
-				last_rtc_update = xtime.tv_sec;
-			else
-				/* do it again in 60 s */
-				last_rtc_update = xtime.tv_sec - 600; 
-		}
-		read_unlock(&xtime_lock);
+	if (cpu == 0) {
+		ll_timer_interrupt(0, regs);
 	}
 
-#ifdef CONFIG_SMP
 	/*
-	 * We need to make like a normal interrupt -- otherwise timer
-	 * interrupts ignore the global interrupt lock, which would be
-	 * a Bad Thing.
+	 * every CPU should do profiling and process accouting
 	 */
-	irq_enter(cpu, 0);
-	update_process_times(user_mode(regs));
-	irq_exit(cpu, 0);
-
-	if (softirq_pending(cpu))
-		do_softirq();
-#endif /* CONFIG_SMP */
+	ll_local_timer_interrupt(0, regs);
 }
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/swarm/Makefile linux-2.4.19-rc2/arch/mips/sibyte/swarm/Makefile
--- linux-2.4.19-rc1/arch/mips/sibyte/swarm/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/swarm/Makefile	Tue Jul 16 16:25:18 2002
@@ -1,13 +1,8 @@
-.S.s:
-	$(CPP) $(AFLAGS) $< -o $@
-.S.o:
-	$(CC) $(AFLAGS) -c $< -o $@
-
-EXTRA_AFLAGS = -mips3 -mcpu=r4000
+USE_STANDARD_AS_RULE := true
 
 all: sbswarm.a
 
-OBJS-y                   = setup.o cmdline.o rtc.o time.o memory.o cfe_api.o 
+OBJS-y                   = setup.o cmdline.o memory.o cfe_api.o rtc_xicor1241.o
 
 OBJS-$(CONFIG_SMP)      += smp.o
 
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/swarm/cfe_api.c linux-2.4.19-rc2/arch/mips/sibyte/swarm/cfe_api.c
--- linux-2.4.19-rc1/arch/mips/sibyte/swarm/cfe_api.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/swarm/cfe_api.c	Tue Jul 16 16:25:18 2002
@@ -55,11 +55,10 @@
 	return 0;
 }
 
+int cfe_iocb_dispatch(cfe_xiocb_t *xiocb);
 int cfe_iocb_dispatch(cfe_xiocb_t *xiocb)
 {
-	if (!cfe_dispfunc)
-		return -1;
-
+	if (!cfe_dispfunc) return -1;
 	return (*cfe_dispfunc)(cfe_handle,xiocb);
 }
 
@@ -344,7 +343,7 @@
 int cfe_start_cpu(int cpu, void (*fn)(void), long sp, long gp, long a1)
 {
 	cfe_xiocb_t xiocb;
-
+	
 	xiocb.xiocb_fcode = CFE_CMD_FW_CPUCTL;
 	xiocb.xiocb_status = 0;
 	xiocb.xiocb_handle = 0;
@@ -356,13 +355,30 @@
 	xiocb.plist.xiocb_cpuctl.sp_val = sp;
 	xiocb.plist.xiocb_cpuctl.a1_val = a1;
 	xiocb.plist.xiocb_cpuctl.start_addr = (long)fn;
-
+	
 	cfe_iocb_dispatch(&xiocb);
-
+	
 	return xiocb.xiocb_status;
 }
 
 
+int cfe_stop_cpu(int cpu)
+{
+	cfe_xiocb_t xiocb;
+	
+	xiocb.xiocb_fcode = CFE_CMD_FW_CPUCTL;
+	xiocb.xiocb_status = 0;
+	xiocb.xiocb_handle = 0;
+	xiocb.xiocb_flags  = 0;
+	xiocb.xiocb_psize = sizeof(xiocb_cpuctl_t);
+	xiocb.plist.xiocb_cpuctl.cpu_number = cpu;
+	xiocb.plist.xiocb_cpuctl.cpu_command = CFE_CPU_CMD_STOP;
+	
+	cfe_iocb_dispatch(&xiocb);
+	
+	return xiocb.xiocb_status;
+}
+
 void cfe_open_console()
 {
 	cfe_console_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
@@ -374,7 +390,6 @@
 	int res;
 
 	if (cfe_console_handle != -1) {
-		cfe_write(cfe_console_handle, str, strlen(str));
 		do {
 			res = cfe_writeblk(cfe_console_handle, 0, str, len);
 			if (res < 0)
@@ -384,3 +399,4 @@
 		} while (len);
 	}
 }
+
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/swarm/cfe_api.h linux-2.4.19-rc2/arch/mips/sibyte/swarm/cfe_api.h
--- linux-2.4.19-rc1/arch/mips/sibyte/swarm/cfe_api.h	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/swarm/cfe_api.h	Tue Jul 16 16:25:18 2002
@@ -35,7 +35,7 @@
 #define CFE_APIENTRY 0x9FC00500
 #define CFE_APISEAL  0x9FC00508
 
-#ifndef __ASSEMBLER__
+#ifndef __ASSEMBLY__
 int cfe_init(cfe_xuint_t handle);
 int cfe_open(char *name);
 int cfe_close(int handle);
@@ -54,6 +54,7 @@
 int cfe_flushcache(int flg);
 int cfe_getstdhandle(int flg);
 int cfe_start_cpu(int cpu, void (*fn)(void), long sp, long gp, long a1);
+int cfe_stop_cpu(int cpu);
 
 void cfe_open_console(void);
 void cfe_console_print(char *);
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/swarm/dbg_io.c linux-2.4.19-rc2/arch/mips/sibyte/swarm/dbg_io.c
--- linux-2.4.19-rc1/arch/mips/sibyte/swarm/dbg_io.c	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/arch/mips/sibyte/swarm/dbg_io.c	Tue Jul 16 16:25:18 2002
@@ -0,0 +1,78 @@
+/*
+ * kgdb debug routines for swarm board.
+ *
+ * Copyright (C) 2001 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+/* -------------------- BEGINNING OF CONFIG --------------------- */
+
+#include <linux/delay.h>
+#include <asm/sibyte/sb1250.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/sb1250_uart.h>
+#include <asm/sibyte/sb1250_int.h>
+#include <asm/sibyte/64bit.h>
+#include <asm/addrspace.h>
+
+/*
+ * We use the second serial port for kgdb traffic.
+ * 	115200, 8, N, 1.
+ */
+
+#define	BAUD_RATE		115200
+#define	CLK_DIVISOR		V_DUART_BAUD_RATE(BAUD_RATE)
+#define	DATA_BITS		V_DUART_BITS_PER_CHAR_8		/* or 7    */
+#define	PARITY			V_DUART_PARITY_MODE_NONE	/* or even */
+#define	STOP_BITS		M_DUART_STOP_BIT_LEN_1		/* or 2    */
+
+static int duart_initialized = 0;	/* 0: need to be init'ed by kgdb */
+
+/* -------------------- END OF CONFIG --------------------- */
+
+
+#define	duart_out(reg, val)	out64(val, KSEG1 + A_DUART_CHANREG(1,reg))
+#define duart_in(reg)		in64(KSEG1 + A_DUART_CHANREG(1,reg))
+
+extern void set_async_breakpoint(unsigned int epc);
+
+void putDebugChar(unsigned char c);
+unsigned char getDebugChar(void);
+static void
+duart_init(int clk_divisor, int data, int parity, int stop)
+{
+	duart_out(R_DUART_MODE_REG_1, data | parity);
+	duart_out(R_DUART_MODE_REG_2, stop);
+	duart_out(R_DUART_CLK_SEL, clk_divisor);
+
+	duart_out(R_DUART_CMD, M_DUART_RX_EN | M_DUART_TX_EN);	/* enable rx and tx */
+}
+
+void
+putDebugChar(unsigned char c)
+{
+	if (!duart_initialized) {
+		duart_initialized = 1;
+		duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS);
+	}
+	while ((duart_in(R_DUART_STATUS) & M_DUART_TX_RDY) == 0);
+	duart_out(R_DUART_TX_HOLD, c);
+}
+
+unsigned char
+getDebugChar(void)
+{
+	if (!duart_initialized) {
+		duart_initialized = 1;
+		duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS);
+	}
+	while ((duart_in(R_DUART_STATUS) & M_DUART_RX_RDY) == 0) ;
+	return duart_in(R_DUART_RX_HOLD);
+}
+
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/swarm/rtc_xicor1241.c linux-2.4.19-rc2/arch/mips/sibyte/swarm/rtc_xicor1241.c
--- linux-2.4.19-rc1/arch/mips/sibyte/swarm/rtc_xicor1241.c	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/arch/mips/sibyte/swarm/rtc_xicor1241.c	Tue Jul 16 16:25:18 2002
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2000, 2001 Broadcom Corporation
+ *
+ * Copyright (C) 2002 MontaVista Software Inc.
+ * Author: jsun@mvista.com or jsun@junsun.net
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+#include <linux/types.h>
+#include <linux/time.h>
+
+#include <asm/time.h>
+#include <asm/addrspace.h>
+
+#include <asm/sibyte/64bit.h>
+#include <asm/sibyte/sb1250.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/sb1250_smbus.h>
+
+
+/* Xicor 1241 definitions */
+
+/*
+ * Register bits
+ */
+
+#define X1241REG_SR_BAT	0x80		/* currently on battery power */
+#define X1241REG_SR_RWEL 0x04		/* r/w latch is enabled, can write RTC */
+#define X1241REG_SR_WEL 0x02		/* r/w latch is unlocked, can enable r/w now */
+#define X1241REG_SR_RTCF 0x01		/* clock failed */
+#define X1241REG_BL_BP2 0x80		/* block protect 2 */
+#define X1241REG_BL_BP1 0x40		/* block protect 1 */
+#define X1241REG_BL_BP0 0x20		/* block protect 0 */
+#define X1241REG_BL_WD1	0x10
+#define X1241REG_BL_WD0	0x08
+#define X1241REG_HR_MIL 0x80		/* military time format */
+
+/*
+ * Register numbers
+ */
+
+#define X1241REG_BL	0x10		/* block protect bits */
+#define X1241REG_INT	0x11		/*  */
+#define X1241REG_SC	0x30		/* Seconds */
+#define X1241REG_MN	0x31		/* Minutes */
+#define X1241REG_HR	0x32		/* Hours */
+#define X1241REG_DT	0x33		/* Day of month */
+#define X1241REG_MO	0x34		/* Month */
+#define X1241REG_YR	0x35		/* Year */
+#define X1241REG_DW	0x36		/* Day of Week */
+#define X1241REG_Y2K	0x37		/* Year 2K */
+#define X1241REG_SR	0x3F		/* Status register */
+
+#define X1241_CCR_ADDRESS	0x6F
+
+#define SMB_CSR(reg) (KSEG1 | A_SMB_REGISTER(1, reg))
+
+static int xicor_read(uint8_t addr)
+{
+        while (in64(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
+                ;
+
+	out64((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD));
+	out64((addr & 0xff), SMB_CSR(R_SMB_DATA));
+	out64((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE), SMB_CSR(R_SMB_START));
+
+        while (in64(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
+                ;
+
+	out64((V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE), SMB_CSR(R_SMB_START));
+
+        while (in64(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
+                ;
+
+        if (in64(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
+                /* Clear error bit by writing a 1 */
+                out64(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
+                return -1;
+        }
+
+	return (in64(SMB_CSR(R_SMB_DATA)) & 0xff);
+}
+
+static int xicor_write(uint8_t addr, int b)
+{
+        while (in64(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
+                ;
+
+	out64(addr, SMB_CSR(R_SMB_CMD));
+	out64((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA));
+	out64(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE,
+	      SMB_CSR(R_SMB_START));
+
+        while (in64(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
+                ;
+
+        if (in64(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
+                /* Clear error bit by writing a 1 */
+                out64(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
+                return -1;
+        } else {
+		return 0;
+	}
+}
+
+#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
+#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
+
+int xicor_set_time(unsigned long t)
+{
+	struct rtc_time tm;
+	int tmp;
+
+	to_tm(t, &tm);
+
+	/* unlock writes to the CCR */
+	xicor_write(X1241REG_SR, X1241REG_SR_WEL);
+	xicor_write(X1241REG_SR, X1241REG_SR_WEL | X1241REG_SR_RWEL);
+
+	/* trivial ones */
+	BIN_TO_BCD(tm.tm_sec);
+	xicor_write(X1241REG_SC, tm.tm_sec);
+	
+	BIN_TO_BCD(tm.tm_min);
+	xicor_write(X1241REG_MN, tm.tm_min);
+
+	BIN_TO_BCD(tm.tm_mday);
+	xicor_write(X1241REG_DT, tm.tm_mday);
+
+	/* tm_mon starts from 0, *ick* */
+	tm.tm_mon ++;
+	BIN_TO_BCD(tm.tm_mon);
+	xicor_write(X1241REG_MO, tm.tm_mon);
+
+	/* year is split */
+	tmp = tm.tm_year / 100;
+	tm.tm_year %= 100;
+	xicor_write(X1241REG_YR, tm.tm_year);
+	xicor_write(X1241REG_Y2K, tmp);
+
+	/* hour is the most tricky one */
+	tmp = xicor_read(X1241REG_HR);
+	if (tmp & X1241REG_HR_MIL) {
+		/* 24 hour format */
+		BIN_TO_BCD(tm.tm_hour);
+		tmp = (tmp & ~0x3f) | (tm.tm_hour & 0x3f);
+	} else {
+		/* 12 hour format, with 0x2 for pm */
+		tmp = tmp & ~0x3f;
+		if (tm.tm_hour >= 12) {
+			tmp |= 0x20;
+			tm.tm_hour -= 12;
+		}
+		BIN_TO_BCD(tm.tm_hour);
+		tmp |= tm.tm_hour;
+	}
+	xicor_write(X1241REG_HR, tmp);
+
+	xicor_write(X1241REG_SR, 0);
+
+	return 0;
+}
+
+unsigned long xicor_get_time(void)
+{
+	unsigned int year, mon, day, hour, min, sec, y2k;
+
+	sec = xicor_read(X1241REG_SC);
+	min = xicor_read(X1241REG_MN);
+	hour = xicor_read(X1241REG_HR);
+
+	if (hour & X1241REG_HR_MIL) {
+		hour &= 0x3f;
+	} else {
+		if (hour & 0x20)
+			hour = (hour & 0xf) + 0x12;
+	}
+
+	BCD_TO_BIN(sec);
+	BCD_TO_BIN(min);
+	BCD_TO_BIN(hour);
+
+	day = xicor_read(X1241REG_DT);
+	mon = xicor_read(X1241REG_MO);
+	year = xicor_read(X1241REG_YR);
+	y2k = xicor_read(X1241REG_Y2K);
+ 
+	BCD_TO_BIN(day);
+	BCD_TO_BIN(mon);
+	BCD_TO_BIN(year);
+	BCD_TO_BIN(y2k);
+
+	year += (y2k * 100);
+
+	return mktime(year, mon, day, hour, min, sec);
+}
+
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/swarm/setup.c linux-2.4.19-rc2/arch/mips/sibyte/swarm/setup.c
--- linux-2.4.19-rc1/arch/mips/sibyte/swarm/setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/swarm/setup.c	Tue Jul 16 16:25:18 2002
@@ -19,14 +19,14 @@
 /*
  * Setup code for the SWARM board 
  */
-
+#include <linux/config.h>
 #include <linux/spinlock.h>
-#include <linux/mc146818rtc.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
 #include <linux/blk.h>
 #include <linux/init.h>
 #include <linux/ide.h>
+
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/bootinfo.h>
@@ -43,7 +43,6 @@
 #include "cfe_api.h"
 #include "cfe_error.h"
 
-extern struct rtc_ops swarm_rtc_ops;
 extern int cfe_console_handle;
 
 #ifdef CONFIG_BLK_DEV_IDE_SWARM
@@ -229,14 +228,31 @@
 {
 }
 
-extern void swarm_time_init(void);
+void __init swarm_timer_setup(struct irqaction *irq)
+{
+        /* 
+         * we don't set up irqaction, because we will deliver timer
+         * interrupts through low-level (direct) meachanism.
+         */
+
+        /* We only need to setup the generic timer */
+        sb1250_time_init();
+}
+
+extern int xicor_set_time(unsigned long);
+extern unsigned int xicor_get_time(void);
 
 void __init swarm_setup(void)
 {
 	extern int panic_timeout;
 
-	rtc_ops = &swarm_rtc_ops;
-	panic_timeout = 5;  /* For debug.  This should probably be raised later */
+	panic_timeout = 5;  /* For debug.  */
+
+        board_timer_setup = swarm_timer_setup;
+
+        rtc_get_time = xicor_get_time;
+        rtc_set_time = xicor_set_time;
+
 	_machine_restart   = (void (*)(char *))swarm_linux_exit;
 	_machine_halt      = swarm_linux_exit;
 	_machine_power_off = swarm_linux_exit;
@@ -254,8 +270,6 @@
 #endif
 	       " runs\n");
 
-	board_timer_setup = swarm_time_init;
-
 #ifdef CONFIG_BLK_DEV_IDE_SWARM
 	ide_ops = &swarm_ide_ops;
 #endif
diff -urN linux-2.4.19-rc1/arch/mips/sibyte/swarm/smp.c linux-2.4.19-rc2/arch/mips/sibyte/swarm/smp.c
--- linux-2.4.19-rc1/arch/mips/sibyte/swarm/smp.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/sibyte/swarm/smp.c	Tue Jul 16 16:25:18 2002
@@ -15,8 +15,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -38,13 +36,14 @@
 int prom_boot_secondary(int cpu, unsigned long sp, unsigned long gp)
 {
 	int retval;
-
-	if ((retval = cfe_start_cpu(1, &smp_bootstrap, sp, gp, 0)) != 0) {
-		printk("cfe_start_cpu returned %i\n" , retval);
-		panic("secondary bootstrap failed");
+	
+	retval = cfe_start_cpu(cpu, &smp_bootstrap, sp, gp, 0);
+	if (retval != 0) {
+		printk("cfe_start_cpu(%i) returned %i\n" , cpu, retval);
+		return 0;
+	} else {
+		return 1;
 	}
-
-	return 1;
 }
 
 
@@ -66,23 +65,35 @@
  */
 int prom_setup_smp(void)
 {
-	/* Nothing to do here */
-	return 2;
+	int i;
+	int num_cpus = 1;
+
+	/* Use CFE to find out how many CPUs are available */
+	for (i=1; i<NR_CPUS; i++) {
+		if (cfe_stop_cpu(i) == 0) {
+			num_cpus++;
+		}
+	}
+	printk("Detected %i available CPU(s)\n", num_cpus);
+	return num_cpus;
 }
 
 void prom_smp_finish(void)
 {
+	extern void sb1250_smp_finish(void);
 	sb1250_smp_finish();
 }
 
 /*
  * XXX This is really halfway portable code and halfway system specific code.
+ * XXX Seems like some of this is CPU-specific, too - rather than board/system.
  */
 extern atomic_t cpus_booted;
 
 void __init smp_boot_cpus(void)
 {
 	int i;
+	int cur_cpu = 0;
 
 	smp_num_cpus = prom_setup_smp();
 	init_new_context(current, &init_mm);
@@ -92,10 +103,18 @@
 	CPUMASK_CLRALL(cpu_online_map);
 	CPUMASK_SETB(cpu_online_map, 0);
 	atomic_set(&cpus_booted, 1);  /* Master CPU is already booted... */
+	__cpu_number_map[0] = 0;
+	__cpu_logical_map[0] = 0;
 	init_idle();
-	for (i = 1; i < smp_num_cpus; i++) {
+
+	/* 
+	 * This loop attempts to compensate for "holes" in the CPU
+	 * numbering.  It's overkill, but general.
+	 */
+	for (i = 1; i < smp_num_cpus; ) {
 		struct task_struct *p;
 		struct pt_regs regs;
+		int retval;
 		printk("Starting CPU %d... ", i);
 
 		/* Spawn a new process normally.  Grab a pointer to
@@ -115,9 +134,20 @@
 		del_from_runqueue(p);
 		unhash_process(p);
 
-		prom_boot_secondary(i,
-				    (unsigned long)p + KERNEL_STACK_SIZE - 32,
-				    (unsigned long)p);
+		do {
+			/* Iterate until we find a CPU that comes up */
+			cur_cpu++;
+			retval = prom_boot_secondary(cur_cpu,
+					    (unsigned long)p + KERNEL_STACK_SIZE - 32,
+					    (unsigned long)p);
+			__cpu_number_map[i] = i;
+			__cpu_logical_map[i] = i;
+		} while (!retval && (cur_cpu < NR_CPUS));
+		if (retval) {
+			i++;
+		} else {
+			panic("CPU discovery disaster");
+		}
 
 #if 0
 		/* This is copied from the ip-27 code in the mips64 tree */
diff -urN linux-2.4.19-rc1/arch/mips/tools/Makefile linux-2.4.19-rc2/arch/mips/tools/Makefile
--- linux-2.4.19-rc1/arch/mips/tools/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/tools/Makefile	Tue Jul 16 16:25:18 2002
@@ -5,10 +5,7 @@
 #
 TARGET	:= $(TOPDIR)/include/asm-$(ARCH)/offset.h
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 $(TARGET): offset.h
 	cmp -s $^ $@ || (cp $^ $(TARGET).new && mv $(TARGET).new $(TARGET))
diff -urN linux-2.4.19-rc1/arch/mips/tools/offset.c linux-2.4.19-rc2/arch/mips/tools/offset.c
--- linux-2.4.19-rc1/arch/mips/tools/offset.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/tools/offset.c	Tue Jul 16 16:25:18 2002
@@ -10,6 +10,7 @@
  */
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/mm.h>
 
 #include <asm/ptrace.h>
 #include <asm/processor.h>
@@ -19,6 +20,8 @@
 
 #define offset(string, ptr, member) \
 	__asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)))
+#define constant(string, member) \
+	__asm__("\n@@@" string "%x0" : : "i" (member))
 #define size(string, size) \
 	__asm__("\n@@@" string "%0" : : "i" (sizeof(size)))
 #define linefeed text("")
@@ -86,7 +89,8 @@
 	offset("#define TASK_NICE          ", struct task_struct, nice);
 	offset("#define TASK_MM            ", struct task_struct, mm);
 	offset("#define TASK_PID           ", struct task_struct, pid);
-	size("#define TASK_STRUCT_SIZE   ", struct task_struct);
+	size(  "#define TASK_STRUCT_SIZE   ", struct task_struct);
+	constant("#define PT_TRACESYS        ", PT_TRACESYS);
 	linefeed;
 }
 
@@ -131,6 +135,10 @@
 	offset("#define MM_PGD        ", struct mm_struct, pgd);
 	offset("#define MM_CONTEXT    ", struct mm_struct, context);
 	linefeed;
+	constant("#define _PAGE_SIZE     ", PAGE_SIZE);
+	constant("#define _PGD_ORDER     ", PGD_ORDER);
+	constant("#define _PGDIR_SHIFT   ", PGDIR_SHIFT);
+	linefeed;
 }
 
 void output_sc_defines(void)
@@ -150,4 +158,41 @@
 	linefeed;
 }
 
+void output_signal_defined(void)
+{
+	text("/* Linux signal numbers. */");
+	constant("#define _SIGHUP     ", SIGHUP);
+	constant("#define _SIGINT     ", SIGINT);
+	constant("#define _SIGQUIT    ", SIGQUIT);
+	constant("#define _SIGILL     ", SIGILL);
+	constant("#define _SIGTRAP    ", SIGTRAP);
+	constant("#define _SIGIOT     ", SIGIOT);
+	constant("#define _SIGABRT    ", SIGABRT);
+	constant("#define _SIGEMT     ", SIGEMT);
+	constant("#define _SIGFPE     ", SIGFPE);
+	constant("#define _SIGKILL    ", SIGKILL);
+	constant("#define _SIGBUS     ", SIGBUS);
+	constant("#define _SIGSEGV    ", SIGSEGV);
+	constant("#define _SIGSYS     ", SIGSYS);
+	constant("#define _SIGPIPE    ", SIGPIPE);
+	constant("#define _SIGALRM    ", SIGALRM);
+	constant("#define _SIGTERM    ", SIGTERM);
+	constant("#define _SIGUSR1    ", SIGUSR1);
+	constant("#define _SIGUSR2    ", SIGUSR2);
+	constant("#define _SIGCHLD    ", SIGCHLD);
+	constant("#define _SIGPWR     ", SIGPWR);
+	constant("#define _SIGWINCH   ", SIGWINCH);
+	constant("#define _SIGURG     ", SIGURG);
+	constant("#define _SIGIO      ", SIGIO);
+	constant("#define _SIGSTOP    ", SIGSTOP);
+	constant("#define _SIGTSTP    ", SIGTSTP);
+	constant("#define _SIGCONT    ", SIGCONT);
+	constant("#define _SIGTTIN    ", SIGTTIN);
+	constant("#define _SIGTTOU    ", SIGTTOU);
+	constant("#define _SIGVTALRM  ", SIGVTALRM);
+	constant("#define _SIGPROF    ", SIGPROF);
+	constant("#define _SIGXCPU    ", SIGXCPU);
+	constant("#define _SIGXFSZ    ", SIGXFSZ);
+}
+
 text("#endif /* !(_MIPS_OFFSET_H) */");
diff -urN linux-2.4.19-rc1/arch/mips/vr4181/common/Makefile linux-2.4.19-rc2/arch/mips/vr4181/common/Makefile
--- linux-2.4.19-rc1/arch/mips/vr4181/common/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/vr4181/common/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET:= vr4181.o
 
diff -urN linux-2.4.19-rc1/arch/mips/vr4181/common/irq.c linux-2.4.19-rc2/arch/mips/vr4181/common/irq.c
--- linux-2.4.19-rc1/arch/mips/vr4181/common/irq.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/vr4181/common/irq.c	Tue Jul 16 16:25:18 2002
@@ -13,6 +13,7 @@
  * for more details.
  *
  */
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
diff -urN linux-2.4.19-rc1/arch/mips/vr4181/osprey/Makefile linux-2.4.19-rc2/arch/mips/vr4181/osprey/Makefile
--- linux-2.4.19-rc1/arch/mips/vr4181/osprey/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/vr4181/osprey/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := osprey.o
 
diff -urN linux-2.4.19-rc1/arch/mips/vr4181/osprey/prom.c linux-2.4.19-rc2/arch/mips/vr4181/osprey/prom.c
--- linux-2.4.19-rc1/arch/mips/vr4181/osprey/prom.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips/vr4181/osprey/prom.c	Tue Jul 16 16:25:18 2002
@@ -11,9 +11,7 @@
  * option) any later version.
  *
  */
-
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/mm.h>
diff -urN linux-2.4.19-rc1/arch/mips64/Makefile linux-2.4.19-rc2/arch/mips64/Makefile
--- linux-2.4.19-rc1/arch/mips64/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/Makefile	Tue Jul 16 16:25:18 2002
@@ -3,6 +3,8 @@
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 #
+# Copyright (C) 2002  Maciej W. Rozycki
+#
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
 # for "archclean" and "archdep" for cleaning up and making dependencies for
@@ -12,7 +14,6 @@
 #
 # Select the object file format to substitute into the linker script.
 #
-CPP=$(CC) -E
 ifdef CONFIG_CPU_LITTLE_ENDIAN
 tool-prefix	= mips64el-linux-
 else
@@ -20,7 +21,7 @@
 endif
 
 ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE  = $(tool-prefix)
+CROSS_COMPILE	= $(tool-prefix)
 endif
 
 #
@@ -33,97 +34,123 @@
 # machines may also.  Since BFD is incredibly buggy with respect to
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
-CFLAGS		+= -I $(TOPDIR)/include/asm/gcc $(CFLAGS)
-CFLAGS		+= -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
+GCCFLAGS	:= -I $(TOPDIR)/include/asm/gcc
+GCCFLAGS	+= -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
 LINKFLAGS	+= -G 0 -static # -N
 MODFLAGS	+= -mlong-calls
 
 ifdef CONFIG_REMOTE_DEBUG
-CFLAGS		:= $(CFLAGS) -g
+GCCFLAGS	+= -g
 endif
 
 #
 # CPU-dependent compiler/assembler options for optimization.
 #
 ifdef CONFIG_CPU_R4300
-CFLAGS		+= -mcpu=r4300 -mips3
+GCCFLAGS	+= -mcpu=r4300 -mips3
 endif
 ifdef CONFIG_CPU_R4X00
-CFLAGS		+= -mcpu=r4600 -mips3
+GCCFLAGS	+= -mcpu=r4600 -mips3
 endif
 ifdef CONFIG_CPU_R5000
-CFLAGS		+= -mcpu=r8000 -mips4
+GCCFLAGS	+= -mcpu=r8000 -mips4
 endif
 ifdef CONFIG_CPU_NEVADA
-CFLAGS		+= -mcpu=r8000 -mips3 -mmad
+GCCFLAGS	+= -mcpu=r8000 -mips3 -mmad
 endif
 ifdef CONFIG_CPU_R8000
-CFLAGS		+= -mcpu=r8000 -mips4
+GCCFLAGS	+= -mcpu=r8000 -mips4
 endif
 ifdef CONFIG_CPU_R10000
-CFLAGS		+= -mcpu=r8000 -mips4
+GCCFLAGS	+= -mcpu=r8000 -mips4
 endif
 ifdef CONFIG_CPU_SB1
-CFLAGS		+= -mcpu=r8000 -mips4
+GCCFLAGS	+= -mcpu=r8000 -mips4
 endif
 
-ifdef CONFIG_MIPS_FPU_EMULATOR
-CORE_FILES	+= arch/mips64/math-emu/fpu_emulator.o
-SUBDIRS		+= arch/mips64/math-emu
-endif
+AFLAGS		+= $(GCCFLAGS)
+CFLAGS		+= $(GCCFLAGS)
+
+
+#
+# We unconditionally build the math emulator
+#
+CORE_FILES	+= arch/mips/math-emu/fpu_emulator.o
+SUBDIRS		+= arch/mips/math-emu
+
 
 #
 # Board-dependent options and extra files
 #
+
+#
+# MIPS Atlas board
+#
 ifdef CONFIG_MIPS_ATLAS
-LIBS		+= arch/mips/mips-boards/atlas/atlas.o arch/mips/mips-boards/generic/mipsboards.o
+LIBS		+= arch/mips/mips-boards/atlas/atlas.o \
+		   arch/mips/mips-boards/generic/mipsboards.o
 SUBDIRS		+= arch/mips/mips-boards/generic arch/mips/mips-boards/atlas
-LOADADDR	+= 0x80100000
+LOADADDR	:= 0x80100000
 endif
 
+#
+# MIPS Malta board
+#
 ifdef CONFIG_MIPS_MALTA
-LIBS		+= arch/mips/mips-boards/malta/malta.o arch/mips/mips-boards/generic/mipsboards.o
+LIBS		+= arch/mips/mips-boards/malta/malta.o \
+		   arch/mips/mips-boards/generic/mipsboards.o
 SUBDIRS		+= arch/mips/mips-boards/malta arch/mips/mips-boards/generic
-LOADADDR	+= 0x80100000
+LOADADDR	:= 0x80100000
 endif
 
+#
+# SGI IP22 (Indy/Indigo2)
+#
 ifdef CONFIG_SGI_IP22
-LIBS          += arch/mips/sgi-ip22/ip22-kern.o arch/mips64/arc/arclib.a
-SUBDIRS       += arch/mips/sgi-ip22 arch/mips64/arc
+CORE_FILES	+= arch/mips/sgi-ip22/ip22-kern.o
+LIBS		+= arch/mips64/arc/arclib.a 
+SUBDIRS		+= arch/mips/sgi-ip22 arch/mips64/arc
 #
 # Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
 # 0x88004000 for production kernels.  Note that the value must be
 # 16kb aligned or the handling of the current variable will break.
 #
-LOADADDR      += 0x88004000
+LOADADDR	:= 0x88004000
 endif
 
+#
+# SGI-IP27 (Origin200/2000)
+#
 ifdef CONFIG_SGI_IP27
-CORE_FILES    += arch/mips64/sgi-ip27/ip27.o
-LIBS          += arch/mips64/arc/arclib.a
-SUBDIRS       += arch/mips64/sgi-ip27 arch/mips64/arc
+CORE_FILES	+= arch/mips64/sgi-ip27/ip27.o
+LIBS		+= arch/mips64/arc/arclib.a
+SUBDIRS		+= arch/mips64/sgi-ip27 arch/mips64/arc
 #
 # Set LOADADDR to >= 0xc000000000300000 if you want to leave space for
 # symmon, 0xc00000000001c000 for production kernels.  Note that the value
 # must be 16kb aligned or the handling of the current variable will break.
 #
-#LOADADDR      += 0xa80000000001c000
+#LOADADDR	:= 0xa80000000001c000
 ifdef CONFIG_MAPPED_KERNEL
-LOADADDR      += 0xc001c000
+LOADADDR	:= 0xc001c000
 else
-LOADADDR      += 0x8001c000
+LOADADDR	:= 0x8001c000
 endif
 endif
 
+#
+# SGI-IP32 (O2)
+#
 ifdef CONFIG_SGI_IP32
-LIBS		+= arch/mips64/sgi-ip32/ip32-kern.a arch/mips64/arc/arclib.a
+CORE_FILES	+= arch/mips64/sgi-ip32/ip32-kern.a
+LIBS		+= arch/mips64/arc/arclib.a
 SUBDIRS		+= arch/mips64/sgi-ip32 arch/mips64/arc
 #
 # Set LOADADDR to >= 0x????????? if you want to leave space for symmon,
 # 0x80002000 for production kernels.  Note that the value must be
 # 16kb aligned or the handling of the current variable will break.
 #
-LOADADDR	+= 0x80002000
+LOADADDR	:= 0x80002000
 endif
 
 #
@@ -133,24 +160,28 @@
 # This is a LIB so that it links at the end, and initcalls are later
 # the sequence; but it is built as an object so that modules don't get
 # removed (as happens, even if they have __initcall/module_init)
-LIBS          += arch/mips/sibyte/sb1250/sb1250.o
-SUBDIRS       += arch/mips/sibyte/sb1250 
+LIBS		+= arch/mips/sibyte/sb1250/sb1250.o
+SUBDIRS		+= arch/mips/sibyte/sb1250
 endif
 
 #
 # Sibyte SWARM board
 #
-ifdef CONFIG_SB1_CACHE_ERROR
-LIBS          += arch/mips/sibyte/sb1/sb1kern.a
-SUBDIRS       += arch/mips/sibyte/sb1
+ifdef CONFIG_SIBYTE_SWARM
+LIBS		+= arch/mips/sibyte/swarm/sbswarm.a
+SUBDIRS		+= arch/mips/sibyte/swarm
+LOADADDR	:= 0x80100000
 endif
 
-ifdef CONFIG_SIBYTE_SWARM
-LIBS          += arch/mips/sibyte/swarm/sbswarm.a
-SUBDIRS       += arch/mips/sibyte/swarm
-LOADADDR      += 0x80100000
+#
+# SB1 Cache Error handler
+#
+ifdef CONFIG_SB1_CACHE_ERROR
+LIBS		+= arch/mips/sibyte/sb1/sb1kern.a
+SUBDIRS		+= arch/mips/sibyte/sb1
 endif
 
+
 #
 # Some machines like the Indy need 32-bit ELF binaries for booting purposes.
 # Other need ECOFF, so we build a 32-bit ELF binary for them which we then
@@ -158,6 +189,7 @@
 #
 ifdef CONFIG_BOOT_ELF32
 CFLAGS += -Wa,-32
+AFLAGS += -Wa,-32
 LINKFLAGS += -T arch/mips64/ld.script.elf32
 endif
 #
@@ -166,6 +198,7 @@
 #
 ifdef CONFIG_BOOT_ELF64
 CFLAGS += -Wa,-32
+AFLAGS += -Wa,-32
 LINKFLAGS += -T arch/mips64/ld.script.elf32
 #AS += -64
 #LD += -m elf64bmip
@@ -219,6 +252,6 @@
 
 archdep:
 	if [ ! -f $(TOPDIR)/include/asm-$(ARCH)/offset.h ]; then \
-	 touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
+		touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
 	fi;
 	@$(MAKEBOOT) dep
diff -urN linux-2.4.19-rc1/arch/mips64/arc/identify.c linux-2.4.19-rc2/arch/mips64/arc/identify.c
--- linux-2.4.19-rc1/arch/mips64/arc/identify.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/arc/identify.c	Tue Jul 16 16:25:18 2002
@@ -39,6 +39,11 @@
 		MACH_GROUP_SGI,
 		MACH_SGI_IP27,
 		PROM_FLAG_ARCS
+	}, {	"SGI-IP28",
+		"SGI IP28",
+		MACH_GROUP_SGI,
+		MACH_SGI_IP28,
+		PROM_FLAG_ARCS
 	}, {	"SGI-IP32",
 		"SGI IP32",
 		MACH_GROUP_SGI,
@@ -102,7 +107,7 @@
 	} else
 		iname = (char *) (long) p->iname;
 
-	printk("ARCH: %s\n", iname);
+	printk(KERN_INFO "ARCH: %s\n", iname);
 	mach = string_to_mach(iname);
 	system_type = mach->liname;
 
diff -urN linux-2.4.19-rc1/arch/mips64/arc/init.c linux-2.4.19-rc2/arch/mips64/arc/init.c
--- linux-2.4.19-rc1/arch/mips64/arc/init.c	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/arch/mips64/arc/init.c	Tue Jul 16 16:25:18 2002
@@ -16,45 +16,34 @@
 
 /* Master romvec interface. */
 struct linux_romvec *romvec;
-PSYSTEM_PARAMETER_BLOCK sgi_pblock;
 int prom_argc;
 LONG *_prom_argv, *_prom_envp;
-unsigned short prom_vers, prom_rev;
 
-extern void prom_testtree(void);
-
-int __init
-prom_init(int argc, char **argv, char **envp)
+int __init prom_init(int argc, char **argv, char **envp)
 {
-	PSYSTEM_PARAMETER_BLOCK pb;
-
+	PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
 	romvec = ROMVECTOR;
-	pb = sgi_pblock = PROMBLOCK;
 	prom_argc = argc;
 	_prom_argv = (LONG *) argv;
 	_prom_envp = (LONG *) envp;
 
 	if(pb->magic != 0x53435241) {
-		prom_printf("Aieee, bad prom vector magic %08lx\n", pb->magic);
+		prom_printf("Aieee, bad prom vector magic %08lx\n",
+			    pb->magic);
 		while(1)
 			;
 	}
 
 	prom_init_cmdline();
-
-	prom_vers = pb->ver;
-	prom_rev = pb->rev;
 	prom_identify_arch();
-	printk("PROMLIB: ARC firmware Version %d Revision %d\n",
-		    prom_vers, prom_rev);
+	printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n",
+	       pb->ver, pb->rev);
 	prom_meminit();
 
 #ifdef DEBUG_PROM_INIT
-	{
-		prom_printf("Press a key to reboot\n");
-		(void) prom_getchar();
-		ArcEnterInteractiveMode();
-	}
+	prom_printf("Press a key to reboot\n");
+	prom_getchar();
+	ArcEnterInteractiveMode();
 #endif
 	return 0;
 }
diff -urN linux-2.4.19-rc1/arch/mips64/arc/memory.c linux-2.4.19-rc2/arch/mips64/arc/memory.c
--- linux-2.4.19-rc1/arch/mips64/arc/memory.c	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/arch/mips64/arc/memory.c	Tue Jul 16 16:25:18 2002
@@ -26,8 +26,7 @@
 
 #undef DEBUG
 
-struct linux_mdesc * __init
-ArcGetMemoryDescriptor(struct linux_mdesc *Current)
+struct linux_mdesc* __init ArcGetMemoryDescriptor(struct linux_mdesc *Current)
 {
 	return (struct linux_mdesc *) ARC_CALL1(get_mdesc, Current);
 }
@@ -100,7 +99,7 @@
 
 static int __init prom_memtype_classify (union linux_memtypes type)
 {
-	if (prom_flags & PROM_FLAG_ARCS)	/* SGI is ``different'' ...  */
+	if (prom_flags & PROM_FLAG_ARCS)	/* SGI is ``different'' ... */
 		return memtype_classify_arcs(type);
 
 	return memtype_classify_arc(type);
@@ -114,10 +113,7 @@
 	int i = 0;
 
 	prom_printf("ARCS MEMORY DESCRIPTOR dump:\n");
-	i=0;
-	prom_printf ("i=%d\n", i);
 	p = ArcGetMemoryDescriptor(PROM_NULL_MDESC);
-	prom_printf ("i=%d\n", i);
 	while(p) {
 		prom_printf("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n",
 			    i, p, p->base, p->pages, mtypes(p->type));
diff -urN linux-2.4.19-rc1/arch/mips64/boot/Makefile linux-2.4.19-rc2/arch/mips64/boot/Makefile
--- linux-2.4.19-rc1/arch/mips64/boot/Makefile	Sun Feb  4 21:48:46 2001
+++ linux-2.4.19-rc2/arch/mips64/boot/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,10 +6,7 @@
 # Copyright (C) 1995, 1998, 1999 by Ralf Baechle
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 #
 # Some DECstations need all possible sections of an ECOFF executable
diff -urN linux-2.4.19-rc1/arch/mips64/config.in linux-2.4.19-rc2/arch/mips64/config.in
--- linux-2.4.19-rc1/arch/mips64/config.in	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/config.in	Tue Jul 16 16:25:18 2002
@@ -5,7 +5,7 @@
 define_bool CONFIG_MIPS y
 define_bool CONFIG_MIPS64 y
 
-mainmenu_name "Linux Kernel Configuration"
+mainmenu_name "Linux/MIPS64 Kernel Configuration"
 
 mainmenu_option next_comment
 comment 'Code maturity level options'
@@ -13,16 +13,31 @@
 endmenu
 
 mainmenu_option next_comment
+comment 'Loadable module support'
+bool 'Enable loadable module support' CONFIG_MODULES
+if [ "$CONFIG_MODULES" = "y" ]; then
+   bool '  Set version information on all module symbols' CONFIG_MODVERSIONS
+   bool '  Kernel module loader' CONFIG_KMOD
+fi
+endmenu
+
+mainmenu_option next_comment
 comment 'Machine selection'
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   bool 'Support for MIPS Atlas board' CONFIG_MIPS_ATLAS
-   bool 'Support for MIPS Malta board' CONFIG_MIPS_MALTA
-fi
-bool '  Support for SGI-IP27 (Origin200/2000)' CONFIG_SGI_IP27
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   bool '  Support for SGI-IP22 (Indy/Indigo2)' CONFIG_SGI_IP22
-   bool '  Support for SGI-IP32 (O2)' CONFIG_SGI_IP32
+dep_bool 'Support for MIPS Atlas board (EXPERIMENTAL)' CONFIG_MIPS_ATLAS $CONFIG_EXPERIMENTAL
+dep_bool 'Support for MIPS Malta board (EXPERIMENTAL)' CONFIG_MIPS_MALTA $CONFIG_EXPERIMENTAL
+dep_bool 'Support for SGI-IP22 (Indy/Indigo2) (EXPERIMENTAL)' CONFIG_SGI_IP22 $CONFIG_EXPERIMENTAL
+bool 'Support for SGI-IP27 (Origin200/2000)' CONFIG_SGI_IP27
+if [ "$CONFIG_SGI_IP27" = "y" ]; then
+   bool '  IP27 N-Mode' CONFIG_SGI_SN0_N_MODE
+   bool '  Discontiguous Memory Support' CONFIG_DISCONTIGMEM
+   bool '  NUMA support' CONFIG_NUMA
+   bool '  Mapped kernel support' CONFIG_MAPPED_KERNEL
+   bool '  Kernel text replication support' CONFIG_REPLICATE_KTEXT
+   bool '  Exception handler replication support' CONFIG_REPLICATE_EXHANDLERS
+   bool '  Multi-Processing support' CONFIG_SMP
+   #bool '  IP27 XXL' CONFIG_SGI_SN0_XXL
 fi
+dep_bool 'Support for SGI-IP32 (O2) (EXPERIMENTAL)' CONFIG_SGI_IP32 $CONFIG_EXPERIMENTAL
 bool 'Support for SiByte SB1250 SOC' CONFIG_SIBYTE_SB1250
 if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
    bool '  Support for SB1250 onchip PCI controller' CONFIG_PCI
@@ -33,28 +48,16 @@
    if [ "$CONFIG_SIBYTE_SWARM" = "y" ]; then
       bool '    Running under simulation' CONFIG_SIMULATION
       bool '    Configure for L3proc Demo' CONFIG_L3DEMO
-      int '      Maximum memory chunks' CONFIG_SIBYTE_SWARM_MAX_MEM_REGIONS 16
-      bool '      Multi-Processing support' CONFIG_SMP
+      int '    Maximum memory chunks' CONFIG_SIBYTE_SWARM_MAX_MEM_REGIONS 16
+      bool '    Multi-Processing support' CONFIG_SMP
    fi
 fi
 
-if [ "$CONFIG_SGI_IP27" = "y" ]; then
-   bool '  IP27 N-Mode' CONFIG_SGI_SN0_N_MODE
-   bool '  Discontiguous Memory Support' CONFIG_DISCONTIGMEM
-   bool '  NUMA support' CONFIG_NUMA
-   bool '  Mapped kernel support' CONFIG_MAPPED_KERNEL
-   bool '  Kernel text replication support' CONFIG_REPLICATE_KTEXT
-   bool '  Exception handler replication support' CONFIG_REPLICATE_EXHANDLERS
-   bool '  Multi-Processing support' CONFIG_SMP
-   #bool '  IP27 XXL' CONFIG_SGI_SN0_XXL
-fi
-endmenu
-
 define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
 define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
 
 #
-# Select some configuration options automatically based on user selections
+# Select some configuration options automatically based on user selections.
 #
 
 if [ "$CONFIG_MIPS_ATLAS" = "y" ]; then
@@ -64,7 +67,6 @@
    define_bool CONFIG_PCI y
    define_bool CONFIG_SWAP_IO_SPACE y
 fi
-
 if [ "$CONFIG_MIPS_MALTA" = "y" ]; then
    define_bool CONFIG_BOOT_ELF32 y
    define_bool CONFIG_I8259 y
@@ -73,7 +75,6 @@
    define_bool CONFIG_PCI y
    define_bool CONFIG_SWAP_IO_SPACE y
 fi
-
 if [ "$CONFIG_SGI_IP22" = "y" ]; then
    define_bool CONFIG_ARC32 y
    define_bool CONFIG_ARC_CONSOLE y
@@ -86,7 +87,6 @@
    define_bool CONFIG_SGI y
    define_int CONFIG_L1_CACHE_SHIFT 5
 fi
-
 if [ "$CONFIG_SGI_IP27" = "y" ]; then
    define_bool CONFIG_BOOT_ELF64 y
    define_bool CONFIG_ARC64 y
@@ -95,7 +95,6 @@
    define_bool CONFIG_QL_ISP_A64 y
    define_int CONFIG_L1_CACHE_SHIFT 7
 fi
-
 if [ "$CONFIG_SGI_IP32" = "y" ]; then
    define_bool CONFIG_BOOT_ELF32 y
    define_bool CONFIG_ARC32 y
@@ -107,7 +106,6 @@
    define_bool CONFIG_ARC_MEMORY y
    define_int CONFIG_L1_CACHE_SHIFT 5
 fi
-
 if [ "$CONFIG_SIBYTE_SWARM" = "y" ]; then
    define_bool CONFIG_BOOT_ELF32 y
    define_bool CONFIG_SWAP_IO_SPACE y
@@ -115,32 +113,19 @@
    define_bool CONFIG_SIBYTE_SB1250 y
    define_int CONFIG_L1_CACHE_SHIFT 5
 fi
-
-if [ "$CONFIG_ISA" != "y" ]; then
-   define_bool CONFIG_ISA n
-   define_bool CONFIG_EISA n
-else
-   define_bool CONFIG_EISA y
-fi
-
-if [ "$CONFIG_PCI" != "y" ]; then
-   define_bool CONFIG_PCI n
-fi
-
-define_bool CONFIG_MCA n
-define_bool CONFIG_SBUS n
+endmenu
 
 mainmenu_option next_comment
 comment 'CPU selection'
 
-choice 'CPU type'				\
-	"R4300 CONFIG_CPU_R4300			\
-	 R4x00 CONFIG_CPU_R4X00			\
-	 R5000 CONFIG_CPU_R5000			\
-	 R52x0 CONFIG_CPU_NEVADA		\
-	 R8000 CONFIG_CPU_R8000			\
-	 R10000 CONFIG_CPU_R10000		\
-	 SB1   CONFIG_CPU_SB1" R4x00
+choice 'CPU type' \
+	"R4300	CONFIG_CPU_R4300 \
+	 R4x00	CONFIG_CPU_R4X00 \
+	 R5000	CONFIG_CPU_R5000 \
+	 R52x0	CONFIG_CPU_NEVADA \
+	 R8000	CONFIG_CPU_R8000 \
+	 R10000	CONFIG_CPU_R10000 \
+	 SB1	CONFIG_CPU_SB1" R4x00
 endmenu
 
 if [ "$CONFIG_CPU_SB1" = "y" ]; then
@@ -160,14 +145,28 @@
 fi
 bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN
 
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   bool 'Kernel floating-point emulation' CONFIG_MIPS_FPU_EMULATOR
+if [ "$CONFIG_ARC32" = "y" ]; then
+   bool 'ARC console support' CONFIG_ARC_CONSOLE
 fi
 
 bool 'Networking support' CONFIG_NET
 
+if [ "$CONFIG_PCI" != "y" ]; then
+   define_bool CONFIG_PCI n
+fi
+
 source drivers/pci/Config.in
 
+if [ "$CONFIG_ISA" != "y" ]; then
+   define_bool CONFIG_ISA n
+   define_bool CONFIG_EISA n
+else
+   define_bool CONFIG_EISA y
+fi
+
+define_bool CONFIG_MCA n
+define_bool CONFIG_SBUS n
+
 bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
 
 if [ "$CONFIG_HOTPLUG" = "y" ] ; then
@@ -181,36 +180,20 @@
 bool 'System V IPC' CONFIG_SYSVIPC
 bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
 bool 'Sysctl support' CONFIG_SYSCTL
-
-if [ "$CONFIG_ARC32" = "y" ]; then
-   bool 'ARC console support' CONFIG_ARC_CONSOLE
-fi
-
+define_bool CONFIG_KCORE_ELF y
+define_bool CONFIG_KCORE_AOUT n
 tristate 'Kernel support for 64-bit ELF binaries' CONFIG_BINFMT_ELF
 bool 'Kernel support for Linux/MIPS 32-bit binary compatibility' CONFIG_MIPS32_COMPAT
-if [ "$CONFIG_MIPS32_COMPAT" = "y" ]; then
-   define_bool CONFIG_BINFMT_ELF32 y
-fi
+define_bool CONFIG_BINFMT_ELF32 $CONFIG_MIPS32_COMPAT
 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
-
-endmenu
-
-mainmenu_option next_comment
-comment 'Loadable module support'
-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 module loader' CONFIG_KMOD
-fi
-
-source drivers/pci/Config.in
-
 endmenu
 
 source drivers/mtd/Config.in
 
 source drivers/parport/Config.in
 
+source drivers/pnp/Config.in
+
 source drivers/block/Config.in
 
 source drivers/md/Config.in
@@ -221,18 +204,21 @@
 
 source drivers/telephony/Config.in
 
-mainmenu_option next_comment
-comment 'ATA/IDE/MFM/RLL support'
+if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" ]; then
+
+   mainmenu_option next_comment
+   comment 'ATA/IDE/MFM/RLL support'
 
-tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
+   tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
 
-if [ "$CONFIG_IDE" != "n" ]; then
-  source drivers/ide/Config.in
-else
-  define_bool CONFIG_BLK_DEV_IDE_MODES n
-  define_bool CONFIG_BLK_DEV_HD n
+   if [ "$CONFIG_IDE" != "n" ]; then
+      source drivers/ide/Config.in
+   else
+      define_bool CONFIG_BLK_DEV_IDE_MODES n
+      define_bool CONFIG_BLK_DEV_HD n
+   fi
+   endmenu
 fi
-endmenu
 
 mainmenu_option next_comment
 comment 'SCSI support'
@@ -244,7 +230,9 @@
 fi
 endmenu
 
-#source drivers/message/i2o/Config.in
+if [ "$CONFIG_PCI" = "y" ]; then
+   source drivers/message/i2o/Config.in
+fi
 
 if [ "$CONFIG_NET" = "y" ]; then
    mainmenu_option next_comment
@@ -264,25 +252,27 @@
 
 source net/irda/Config.in
 
-mainmenu_option next_comment
-comment 'ISDN subsystem'
-
 if [ "$CONFIG_NET" != "n" ]; then
+   mainmenu_option next_comment
+   comment 'ISDN subsystem'
+
    tristate 'ISDN support' CONFIG_ISDN
    if [ "$CONFIG_ISDN" != "n" ]; then
       source drivers/isdn/Config.in
    fi
+   endmenu
 fi
-endmenu
 
-mainmenu_option next_comment
-comment 'Old CD-ROM drivers (not SCSI, not IDE)'
+if [ "$CONFIG_ISA" = "y" ]; then
+   mainmenu_option next_comment
+   comment 'Old CD-ROM drivers (not SCSI, not IDE)'
 
-bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
-if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
-   source drivers/cdrom/Config.in
+   bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
+   if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
+      source drivers/cdrom/Config.in
+   fi
+   endmenu
 fi
-endmenu
 
 source drivers/char/Config.in
 
@@ -290,25 +280,30 @@
 
 source drivers/media/Config.in
 
-source fs/Config.in
-
-if [ "$CONFIG_VT" = "y" ]; then
+if [ "$CONFIG_SGI_IP22" = "y" ]; then
    mainmenu_option next_comment
-   comment 'Console drivers'
-   source drivers/video/Config.in
-   if [ "$CONFIG_SGI_IP22" = "y" ]; then
+   comment 'SGI Character devices'
+   if [ "$CONFIG_VT" = "y" ]; then
       tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
-      if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
-	 define_bool CONFIG_DUMMY_CONSOLE y
-      else
-	 define_bool CONFIG_FONT_8x16 y
+      if [ "$CONFIG_SGI_NEWPORT_CONSOLE" = "y" ]; then
+         define_bool CONFIG_FONT_8x16 y
       fi
+      define_bool CONFIG_DUMMY_CONSOLE y
    fi
-  endmenu
+   endmenu
 fi
 
-if [ "$CONFIG_PROC_FS" = "y" ]; then
-   define_bool CONFIG_KCORE_ELF y
+source fs/Config.in
+
+if [ "$CONFIG_VT" = "y" ]; then
+   mainmenu_option next_comment
+   comment 'Console drivers'
+   bool 'VGA text console' CONFIG_VGA_CONSOLE
+   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+      tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE
+      source drivers/video/Config.in
+   fi
+   endmenu
 fi
 
 mainmenu_option next_comment
@@ -325,6 +320,9 @@
 fi
 
 source drivers/usb/Config.in
+
+source net/bluetooth/Config.in
+
 source drivers/input/Config.in
 
 mainmenu_option next_comment
@@ -332,9 +330,6 @@
 
 #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
 bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE
-if [ "$CONFIG_MODULES" = "y" ]; then
-   bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE
-fi
 bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
 if [ "$CONFIG_SMP" != "y" ]; then
diff -urN linux-2.4.19-rc1/arch/mips64/defconfig linux-2.4.19-rc2/arch/mips64/defconfig
--- linux-2.4.19-rc1/arch/mips64/defconfig	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/defconfig	Tue Jul 16 16:25:18 2002
@@ -10,10 +10,17 @@
 # CONFIG_EXPERIMENTAL is not set
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_SGI_IP22 is not set
 CONFIG_SGI_IP27=y
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SGI_SN0_N_MODE is not set
 CONFIG_DISCONTIGMEM=y
 CONFIG_NUMA=y
@@ -21,6 +28,8 @@
 # CONFIG_REPLICATE_KTEXT is not set
 # CONFIG_REPLICATE_EXHANDLERS is not set
 CONFIG_SMP=y
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BOOT_ELF64=y
@@ -29,10 +38,6 @@
 CONFIG_PCI=y
 CONFIG_QL_ISP_A64=y
 CONFIG_L1_CACHE_SHIFT=7
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 
 #
 # CPU selection
@@ -54,24 +59,24 @@
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_BINFMT_ELF32=y
 # CONFIG_BINFMT_MISC is not set
 
 #
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-CONFIG_PCI_NAMES=y
-
-#
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
@@ -82,6 +87,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -89,7 +100,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -128,12 +141,18 @@
 # CONFIG_IP_MROUTE is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
+# CONFIG_VLAN_8021Q is not set
 
 #
 #  
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 
@@ -143,6 +162,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -227,6 +251,16 @@
 # CONFIG_SCSI_U14_34F is not set
 
 #
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -269,6 +303,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_PLIP is not set
 # CONFIG_PPP is not set
@@ -306,11 +341,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -350,7 +380,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -395,7 +424,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -465,7 +494,6 @@
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_SMB_NLS is not set
 # CONFIG_NLS is not set
-CONFIG_KCORE_ELF=y
 
 #
 # Sound
@@ -478,103 +506,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips64/defconfig-atlas linux-2.4.19-rc2/arch/mips64/defconfig-atlas
--- linux-2.4.19-rc1/arch/mips64/defconfig-atlas	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/defconfig-atlas	Tue Jul 16 16:25:18 2002
@@ -10,12 +10,17 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
 CONFIG_MIPS_ATLAS=y
 # CONFIG_MIPS_MALTA is not set
-# CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_SB1250 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -25,10 +30,6 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_PCI=y
 CONFIG_SWAP_IO_SPACE=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 
 #
 # CPU selection
@@ -47,27 +48,26 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-# CONFIG_MIPS_FPU_EMULATOR is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_SYSCTL is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_BINFMT_ELF32=y
 # CONFIG_BINFMT_MISC is not set
 
 #
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-CONFIG_PCI_NAMES=y
-
-#
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
@@ -78,6 +78,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -85,7 +91,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 CONFIG_BLK_DEV_RAM=y
@@ -134,6 +142,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -151,6 +164,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -237,6 +255,16 @@
 # CONFIG_SCSI_DEBUG is not set
 
 #
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -279,6 +307,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -319,11 +348,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -363,7 +387,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -408,7 +431,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -464,7 +487,6 @@
 CONFIG_MSDOS_PARTITION=y
 # CONFIG_SMB_NLS is not set
 # CONFIG_NLS is not set
-CONFIG_KCORE_ELF=y
 
 #
 # Sound
@@ -477,103 +499,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips64/defconfig-ip22 linux-2.4.19-rc2/arch/mips64/defconfig-ip22
--- linux-2.4.19-rc1/arch/mips64/defconfig-ip22	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/defconfig-ip22	Tue Jul 16 16:25:18 2002
@@ -10,12 +10,19 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
 # Machine selection
 #
 # CONFIG_MIPS_ATLAS is not set
 # CONFIG_MIPS_MALTA is not set
-# CONFIG_SGI_IP27 is not set
 CONFIG_SGI_IP22=y
+# CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_SB1250 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -30,11 +37,6 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_SGI=y
 CONFIG_L1_CACHE_SHIFT=5
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_PCI is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 
 #
 # CPU selection
@@ -53,28 +55,27 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-# CONFIG_MIPS_FPU_EMULATOR is not set
+CONFIG_ARC_CONSOLE=y
 CONFIG_NET=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
-CONFIG_ARC_CONSOLE=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_BINFMT_ELF32=y
 # CONFIG_BINFMT_MISC is not set
 
 #
-# Loadable module support
-#
-CONFIG_MODULES=y
-# CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
-
-#
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
@@ -85,6 +86,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -92,7 +99,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -142,6 +151,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -159,6 +173,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -166,13 +185,6 @@
 # CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
 # SCSI support
 #
 CONFIG_SCSI=y
@@ -280,6 +292,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -320,11 +333,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 CONFIG_VT=y
@@ -365,21 +373,25 @@
 #
 CONFIG_WATCHDOG=y
 # CONFIG_WATCHDOG_NOWAYOUT is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_WDT is not set
-# CONFIG_WDTPCI is not set
-# CONFIG_PCWATCHDOG is not set
 # CONFIG_ACQUIRE_WDT is not set
 # CONFIG_ADVANTECH_WDT is not set
+# CONFIG_ALIM7101_WDT is not set
+# CONFIG_SC520_WDT is not set
+# CONFIG_PCWATCHDOG is not set
 # CONFIG_EUROTECH_WDT is not set
 # CONFIG_IB700_WDT is not set
+# CONFIG_WAFER_WDT is not set
+CONFIG_INDYDOG=y
 # CONFIG_I810_TCO is not set
 # CONFIG_MIXCOMWD is not set
 # CONFIG_60XX_WDT is not set
+# CONFIG_SC1200_WDT is not set
+# CONFIG_SOFT_WATCHDOG is not set
 # CONFIG_W83877F_WDT is not set
+# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
 # CONFIG_MACHZ_WDT is not set
 CONFIG_INDYDOG=y
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -399,6 +411,13 @@
 # CONFIG_VIDEO_DEV is not set
 
 #
+# SGI Character devices
+#
+CONFIG_SGI_NEWPORT_CONSOLE=y
+CONFIG_FONT_8x16=y
+CONFIG_DUMMY_CONSOLE=y
+
+#
 # File systems
 #
 # CONFIG_QUOTA is not set
@@ -424,7 +443,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 CONFIG_ISO9660_FS=y
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -497,14 +516,13 @@
 #
 # Console drivers
 #
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
 
 #
 # Frame-buffer support
 #
 # CONFIG_FB is not set
-CONFIG_SGI_NEWPORT_CONSOLE=y
-CONFIG_FONT_8x16=y
-CONFIG_KCORE_ELF=y
 
 #
 # Sound
@@ -525,103 +543,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
@@ -636,7 +560,6 @@
 # Kernel hacking
 #
 CONFIG_CROSSCOMPILE=y
-# CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_REMOTE_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_MIPS_UNCACHED is not set
diff -urN linux-2.4.19-rc1/arch/mips64/defconfig-ip27 linux-2.4.19-rc2/arch/mips64/defconfig-ip27
--- linux-2.4.19-rc1/arch/mips64/defconfig-ip27	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/defconfig-ip27	Tue Jul 16 16:25:18 2002
@@ -10,10 +10,17 @@
 # CONFIG_EXPERIMENTAL is not set
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_SGI_IP22 is not set
 CONFIG_SGI_IP27=y
-# CONFIG_SIBYTE_SB1250 is not set
 # CONFIG_SGI_SN0_N_MODE is not set
 CONFIG_DISCONTIGMEM=y
 CONFIG_NUMA=y
@@ -21,6 +28,8 @@
 # CONFIG_REPLICATE_KTEXT is not set
 # CONFIG_REPLICATE_EXHANDLERS is not set
 CONFIG_SMP=y
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_SB1250 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 CONFIG_BOOT_ELF64=y
@@ -29,10 +38,6 @@
 CONFIG_PCI=y
 CONFIG_QL_ISP_A64=y
 CONFIG_L1_CACHE_SHIFT=7
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 
 #
 # CPU selection
@@ -54,24 +59,24 @@
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_BINFMT_ELF32=y
 # CONFIG_BINFMT_MISC is not set
 
 #
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-CONFIG_PCI_NAMES=y
-
-#
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
@@ -82,6 +87,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -89,7 +100,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -128,12 +141,18 @@
 # CONFIG_IP_MROUTE is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
+# CONFIG_VLAN_8021Q is not set
 
 #
 #  
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 
@@ -143,6 +162,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -227,6 +251,16 @@
 # CONFIG_SCSI_U14_34F is not set
 
 #
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -269,6 +303,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_PLIP is not set
 # CONFIG_PPP is not set
@@ -306,11 +341,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -350,7 +380,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -395,7 +424,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -465,7 +494,6 @@
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_SMB_NLS is not set
 # CONFIG_NLS is not set
-CONFIG_KCORE_ELF=y
 
 #
 # Sound
@@ -478,103 +506,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips64/defconfig-ip32 linux-2.4.19-rc2/arch/mips64/defconfig-ip32
--- linux-2.4.19-rc1/arch/mips64/defconfig-ip32	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/defconfig-ip32	Tue Jul 16 16:25:18 2002
@@ -10,12 +10,17 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
 # CONFIG_MIPS_ATLAS is not set
 # CONFIG_MIPS_MALTA is not set
-# CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
 CONFIG_SGI_IP32=y
 # CONFIG_SIBYTE_SB1250 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -28,10 +33,6 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_ARC_MEMORY=y
 CONFIG_L1_CACHE_SHIFT=5
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 
 #
 # CPU selection
@@ -50,28 +51,27 @@
 # General setup
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-# CONFIG_MIPS_FPU_EMULATOR is not set
+CONFIG_ARC_CONSOLE=y
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
-CONFIG_ARC_CONSOLE=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_BINFMT_ELF32=y
 CONFIG_BINFMT_MISC=y
 
 #
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-CONFIG_PCI_NAMES=y
-
-#
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
@@ -82,6 +82,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -89,7 +95,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -138,6 +146,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -155,6 +168,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -206,6 +224,7 @@
 CONFIG_SCSI_AIC7XXX=y
 CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
 CONFIG_AIC7XXX_RESET_DELAY_MS=15000
+# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
 # CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
@@ -245,6 +264,16 @@
 # CONFIG_SCSI_DEBUG is not set
 
 #
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -288,6 +317,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -328,11 +358,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -356,6 +381,7 @@
 CONFIG_PSMOUSE=y
 # CONFIG_82C710_MOUSE is not set
 # CONFIG_PC110_PAD is not set
+# CONFIG_MK712_MOUSE is not set
 
 #
 # Joysticks
@@ -375,7 +401,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -420,7 +445,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 CONFIG_TMPFS=y
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -486,7 +511,6 @@
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_SMB_NLS is not set
 # CONFIG_NLS is not set
-CONFIG_KCORE_ELF=y
 
 #
 # Sound
@@ -499,103 +523,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips64/defconfig-malta linux-2.4.19-rc2/arch/mips64/defconfig-malta
--- linux-2.4.19-rc1/arch/mips64/defconfig-malta	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/defconfig-malta	Tue Jul 16 16:25:18 2002
@@ -10,12 +10,17 @@
 CONFIG_EXPERIMENTAL=y
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
 # CONFIG_MIPS_ATLAS is not set
 CONFIG_MIPS_MALTA=y
-# CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
 # CONFIG_SGI_IP32 is not set
 # CONFIG_SIBYTE_SB1250 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -26,10 +31,6 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_PCI=y
 CONFIG_SWAP_IO_SPACE=y
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 
 #
 # CPU selection
@@ -48,27 +49,26 @@
 # General setup
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_MIPS_FPU_EMULATOR is not set
 CONFIG_NET=y
 CONFIG_PCI_NAMES=y
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_SYSCTL is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_BINFMT_ELF32=y
 # CONFIG_BINFMT_MISC is not set
 
 #
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-CONFIG_PCI_NAMES=y
-
-#
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
@@ -79,6 +79,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 CONFIG_BLK_DEV_FD=y
@@ -86,7 +92,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 CONFIG_BLK_DEV_RAM=y
@@ -135,6 +143,11 @@
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
@@ -152,6 +165,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -238,6 +256,16 @@
 # CONFIG_SCSI_DEBUG is not set
 
 #
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
 # Network device support
 #
 CONFIG_NETDEVICES=y
@@ -280,6 +308,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PLIP is not set
@@ -320,11 +349,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -364,7 +388,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
@@ -409,7 +432,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -465,7 +488,6 @@
 CONFIG_MSDOS_PARTITION=y
 # CONFIG_SMB_NLS is not set
 # CONFIG_NLS is not set
-CONFIG_KCORE_ELF=y
 
 #
 # Sound
@@ -478,103 +500,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips64/defconfig-sb1250-swarm linux-2.4.19-rc2/arch/mips64/defconfig-sb1250-swarm
--- linux-2.4.19-rc1/arch/mips64/defconfig-sb1250-swarm	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/defconfig-sb1250-swarm	Tue Jul 16 16:25:18 2002
@@ -10,9 +10,18 @@
 # CONFIG_EXPERIMENTAL is not set
 
 #
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
 # Machine selection
 #
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_SGI_IP22 is not set
 # CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
 CONFIG_SIBYTE_SB1250=y
 # CONFIG_PCI is not set
 # CONFIG_SIBYTE_SB1250_PROF is not set
@@ -30,11 +39,6 @@
 CONFIG_CFE=y
 CONFIG_SIBYTE_SB1250=y
 CONFIG_L1_CACHE_SHIFT=5
-# CONFIG_ISA is not set
-# CONFIG_EISA is not set
-# CONFIG_PCI is not set
-# CONFIG_MCA is not set
-# CONFIG_SBUS is not set
 
 #
 # CPU selection
@@ -57,23 +61,25 @@
 #
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_NET=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SBUS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCMCIA is not set
 # CONFIG_HOTPLUG_PCI is not set
 # CONFIG_SYSVIPC is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_SYSCTL is not set
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_BINFMT_ELF32=y
 # CONFIG_BINFMT_MISC is not set
 
 #
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-
-#
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
@@ -84,6 +90,12 @@
 # CONFIG_PARPORT is not set
 
 #
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
@@ -91,7 +103,9 @@
 # CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_CISS_SCSI_TAPE is not set
 # CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
@@ -128,12 +142,18 @@
 # CONFIG_NET_IPGRE is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
+# CONFIG_VLAN_8021Q is not set
 
 #
 #  
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
+
+#
+# Appletalk devices
+#
+# CONFIG_DEV_APPLETALK is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
 
@@ -143,6 +163,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -150,13 +175,6 @@
 # CONFIG_PHONE_IXJ_PCMCIA is not set
 
 #
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
-
-#
 # SCSI support
 #
 # CONFIG_SCSI is not set
@@ -180,6 +198,7 @@
 #
 CONFIG_NET_ETHERNET=y
 CONFIG_NET_SB1250_MAC=y
+CONFIG_NET_SB1250_MAC=y
 # CONFIG_SUNLANCE is not set
 # CONFIG_SUNBMAC is not set
 # CONFIG_SUNQE is not set
@@ -202,6 +221,7 @@
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 # CONFIG_FDDI is not set
 # CONFIG_PLIP is not set
 # CONFIG_PPP is not set
@@ -239,11 +259,6 @@
 # CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
-
-#
 # Character devices
 #
 # CONFIG_VT is not set
@@ -305,7 +320,6 @@
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
 # CONFIG_DTLK is not set
@@ -350,7 +364,7 @@
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
+CONFIG_RAMFS=y
 # CONFIG_ISO9660_FS is not set
 # CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
@@ -420,7 +434,6 @@
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_SMB_NLS is not set
 # CONFIG_NLS is not set
-CONFIG_KCORE_ELF=y
 
 #
 # Sound
@@ -433,107 +446,9 @@
 # CONFIG_USB is not set
 
 #
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-# CONFIG_USB_OHCI is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH is not set
-
-#
-#   SCSI support is needed for USB Storage
-#
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-
-#
-#   Input core support is needed for USB HID
-#
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-
-#
-#   Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_CDCETHER is not set
-# CONFIG_USB_USBNET is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_SERIAL_GENERIC is not set
-# CONFIG_USB_SERIAL_BELKIN is not set
-# CONFIG_USB_SERIAL_WHITEHEAT is not set
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
-# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
+# Bluetooth support
 #
-# CONFIG_USB_RIO500 is not set
+# CONFIG_BLUEZ is not set
 
 #
 # Input core support
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/Makefile linux-2.4.19-rc2/arch/mips64/kernel/Makefile
--- linux-2.4.19-rc1/arch/mips64/kernel/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/Makefile	Tue Jul 16 16:25:18 2002
@@ -6,19 +6,17 @@
 # unless it's something special (ie not a .c file).
 #
 
-.S.o:
-	$(CC) $(CFLAGS) $(CFLAGS_$@) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 all:	kernel.o head.o init_task.o
 
 O_TARGET := kernel.o
 
-export-objs = irq.o mips64_ksyms.o pci-dma.o smp.o
+export-objs = irq.o mips64_ksyms.o pci-dma.o setup.o smp.o
 
 obj-y	:= branch.o entry.o irq.o proc.o process.o ptrace.o r4k_cache.o \
-	   r4k_fpu.o r4k_genex.o r4k_switch.o reset.o scall_64.o \
-	   semaphore.o setup.o signal.o softfp.o syscall.o time.o traps.o \
-	   unaligned.o
+	   r4k_fpu.o r4k_genex.o r4k_switch.o reset.o scall_64.o semaphore.o \
+	   setup.o signal.o syscall.o time.o traps.o unaligned.o
 
 obj-$(CONFIG_I8259)		+= i8259.o
 obj-$(CONFIG_IRQ_CPU)		+= irq_cpu.o
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/binfmt_elf32.c linux-2.4.19-rc2/arch/mips64/kernel/binfmt_elf32.c
--- linux-2.4.19-rc1/arch/mips64/kernel/binfmt_elf32.c	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/arch/mips64/kernel/binfmt_elf32.c	Tue Jul 16 16:25:18 2002
@@ -41,7 +41,7 @@
 
 struct timeval32
 {
-	unsigned int tv_sec, tv_usec;
+	int tv_sec, tv_usec;
 };
 
 #define elf_prstatus elf_prstatus32
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/entry.S linux-2.4.19-rc2/arch/mips64/kernel/entry.S
--- linux-2.4.19-rc1/arch/mips64/kernel/entry.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/entry.S	Tue Jul 16 16:25:18 2002
@@ -9,8 +9,6 @@
  * Copyright (C) 1999, 2000 Silicon Graphics
  * Copyright (C) 2001 MIPS Technologies, Inc.
  */
-#include <linux/config.h>
-
 #include <asm/asm.h>
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
@@ -37,7 +35,7 @@
 
 EXPORT(ret_from_irq)
 EXPORT(ret_from_exception)
-		lw	t0, PT_STATUS(sp)	# returning to kernel mode?
+		ld	t0, PT_STATUS(sp)	# returning to kernel mode?
 		andi	t0, t0, KU_USER
 		bnez	t0, ret_from_sys_call
 		j	restore_all
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/head.S linux-2.4.19-rc2/arch/mips64/kernel/head.S
--- linux-2.4.19-rc1/arch/mips64/kernel/head.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/head.S	Tue Jul 16 16:25:18 2002
@@ -10,7 +10,6 @@
  * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 Ralf Baechle
  * Copyright (C) 1999 Silicon Graphics, Inc.
  */
-#define __ASSEMBLY__
 #include <linux/config.h>
 #include <linux/init.h>
 #include <asm/asm.h>
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/irq.c linux-2.4.19-rc2/arch/mips64/kernel/irq.c
--- linux-2.4.19-rc1/arch/mips64/kernel/irq.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/irq.c	Tue Jul 16 16:25:18 2002
@@ -76,13 +76,13 @@
 
 int get_irq_list(char *buf)
 {
+	int i, j;
 	struct irqaction * action;
 	char *p = buf;
-	int i;
 
 	p += sprintf(p, "           ");
-	for (i=0; i < 1 /*smp_num_cpus*/; i++)
-		p += sprintf(p, "CPU%d       ", i);
+	for (j=0; j<smp_num_cpus; j++)
+		p += sprintf(p, "CPU%d       ",j);
 	*p++ = '\n';
 
 	for (i = 0 ; i < NR_IRQS ; i++) {
@@ -90,7 +90,13 @@
 		if (!action) 
 			continue;
 		p += sprintf(p, "%3d: ",i);
+#ifndef CONFIG_SMP
 		p += sprintf(p, "%10u ", kstat_irqs(i));
+#else
+		for (j = 0; j < smp_num_cpus; j++)
+			p += sprintf(p, "%10u ",
+				kstat.irqs[cpu_logical_map(j)][i]);
+#endif
 		p += sprintf(p, " %14s", irq_desc[i].handler->typename);
 		p += sprintf(p, "  %s", action->name);
 
@@ -98,7 +104,8 @@
 			p += sprintf(p, ", %s", action->name);
 		*p++ = '\n';
 	}
-	p += sprintf(p, "ERR: %10lu\n", irq_err_count);
+	p += sprintf(p, "\n");
+	p += sprintf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
 	return p - buf;
 }
 
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/linux32.c linux-2.4.19-rc2/arch/mips64/kernel/linux32.c
--- linux-2.4.19-rc1/arch/mips64/kernel/linux32.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/linux32.c	Tue Jul 16 16:25:18 2002
@@ -27,6 +27,7 @@
 #include <linux/personality.h>
 #include <linux/timex.h>
 #include <linux/dnotify.h>
+#include <linux/module.h>
 #include <net/sock.h>
 
 #include <asm/uaccess.h>
@@ -1123,7 +1124,6 @@
 static inline int
 get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset)
 {
-#ifdef __MIPSEB__
 	if (ufdset) {
 		unsigned long odd;
 
@@ -1150,9 +1150,6 @@
 		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
 	}
 	return 0;
-#else
-#error little endian support must define this
-#endif
 }
 
 static inline void
@@ -2350,3 +2347,47 @@
 {
 	return sys_readahead(fd, merge_64(a2, a3), count);
 }
+
+#ifdef CONFIG_MODULES
+
+/* From sparc64 */
+
+struct kernel_sym32 {
+        u32 value;
+        char name[60];
+};
+
+extern asmlinkage int sys_get_kernel_syms(struct kernel_sym *table);
+
+asmlinkage int sys32_get_kernel_syms(struct kernel_sym32 *table)
+{
+        int len, i;
+        struct kernel_sym *tbl;
+        mm_segment_t old_fs;
+
+        len = sys_get_kernel_syms(NULL);
+        if (!table) return len;
+        tbl = kmalloc (len * sizeof (struct kernel_sym), GFP_KERNEL);
+        if (!tbl) return -ENOMEM;
+        old_fs = get_fs();
+        set_fs (KERNEL_DS);
+        sys_get_kernel_syms(tbl);
+        set_fs (old_fs);
+        for (i = 0; i < len; i++, table++) {
+                if (put_user (tbl[i].value, &table->value) ||
+                    copy_to_user (table->name, tbl[i].name, 60))
+                        break;
+        }
+        kfree (tbl);
+        return i;
+}
+
+#else
+
+asmlinkage long
+sys32_get_kernel_syms(struct kernel_sym *table)
+{
+	return -ENOSYS;
+}
+
+#endif
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/mips64_ksyms.c linux-2.4.19-rc2/arch/mips64/kernel/mips64_ksyms.c
--- linux-2.4.19-rc1/arch/mips64/kernel/mips64_ksyms.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/mips64_ksyms.c	Tue Jul 16 16:25:18 2002
@@ -105,12 +105,6 @@
 int register_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31));
 int unregister_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31));
 
-#ifdef CONFIG_MIPS_FPE_MODULE
-EXPORT_SYMBOL(__compute_return_epc);
-EXPORT_SYMBOL(register_fpe);
-EXPORT_SYMBOL(unregister_fpe);
-#endif
-
 #ifdef CONFIG_VT
 EXPORT_SYMBOL(screen_info);
 #endif
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/pci-dma.c linux-2.4.19-rc2/arch/mips64/kernel/pci-dma.c
--- linux-2.4.19-rc1/arch/mips64/kernel/pci-dma.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/pci-dma.c	Tue Jul 16 16:25:18 2002
@@ -7,6 +7,7 @@
  * Copyright (C) 2000  Ralf Baechle <ralf@gnu.org>
  * swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
  */
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/string.h>
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/proc.c linux-2.4.19-rc2/arch/mips64/kernel/proc.c
--- linux-2.4.19-rc1/arch/mips64/kernel/proc.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/proc.c	Tue Jul 16 16:25:18 2002
@@ -59,13 +59,15 @@
 	[CPU_TX3912]	"TX3912",
 	[CPU_TX3922]	"TX3922",
 	[CPU_TX3927]	"TX3927",
-        [CPU_AU1000]	"Au1000",
+	[CPU_AU1000]	"Au1000",
+	[CPU_AU1500]	"Au1500",
 	[CPU_4KEC]	"MIPS 4KEc",
 	[CPU_4KSC]	"MIPS 4KSc",
 	[CPU_VR41XX]	"NEC Vr41xx",
 	[CPU_R5500]	"R5500",
 	[CPU_TX49XX]	"TX49xx",
-        [CPU_TX39XX]	"TX39xx"
+	[CPU_TX39XX]	"TX39xx",
+	[CPU_20KC]	"MIPS 20Kc"
 };
 
 
@@ -77,7 +79,7 @@
 	char fmt [64];
 
 #ifdef CONFIG_SMP
-	if (!(cpu_online_map & (1<<n)))
+	if (!CPUMASK_TSTB(cpu_online_map, n))
 		return 0;
 #endif
 
@@ -100,6 +102,7 @@
 	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
 	seq_printf(m, "microsecond timers\t: %s\n",
 	              (mips_cpu.options & MIPS_CPU_COUNTER) ? "yes" : "no");
+	seq_printf(m, "tlb_entries\t\t: %d\n", mips_cpu.tlbsize);
 	seq_printf(m, "extra interrupt vector\t: %s\n",
 	              (mips_cpu.options & MIPS_CPU_DIVEC) ? "yes" : "no");
 	seq_printf(m, "hardware watchpoint\t: %s\n",
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/process.c linux-2.4.19-rc2/arch/mips64/kernel/process.c
--- linux-2.4.19-rc1/arch/mips64/kernel/process.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/process.c	Tue Jul 16 16:25:18 2002
@@ -70,10 +70,10 @@
 }
 
 int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
-		 unsigned long unused,
-                 struct task_struct * p, struct pt_regs * regs)
+		unsigned long unused, struct task_struct *p,
+		struct pt_regs *regs)
 {
-	struct pt_regs * childregs;
+	struct pt_regs *childregs;
 	long childksp;
 
 	childksp = (unsigned long)p + KERNEL_STACK_SIZE - 32;
@@ -85,16 +85,9 @@
 	childregs = (struct pt_regs *) childksp - 1;
 	*childregs = *regs;
 	childregs->regs[7] = 0;	/* Clear error flag */
-	if (current->personality == PER_LINUX) {
-		childregs->regs[2] = 0;	/* Child gets zero as return value */
-		regs->regs[2] = p->pid;
-	} else {
-		/* Under IRIX things are a little different. */
-		childregs->regs[2] = 0;
-		childregs->regs[3] = 1;
-		regs->regs[2] = p->pid;
-		regs->regs[3] = 0;
-	}
+	childregs->regs[2] = 0;	/* Child gets zero as return value */
+	regs->regs[2] = p->pid;
+
 	if (childregs->cp0_status & ST0_CU0) {
 		childregs->regs[28] = (unsigned long) p;
 		childregs->regs[29] = childksp;
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/r4k_genex.S linux-2.4.19-rc2/arch/mips64/kernel/r4k_genex.S
--- linux-2.4.19-rc1/arch/mips64/kernel/r4k_genex.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/r4k_genex.S	Tue Jul 16 16:25:18 2002
@@ -8,7 +8,6 @@
  *
  * Low level exception handling
  */
-#define __ASSEMBLY__
 #include <linux/init.h>
 #include <asm/asm.h>
 #include <asm/regdef.h>
@@ -20,8 +19,8 @@
 
 	BUILD_HANDLER adel ade ade silent		/* #4  */
 	BUILD_HANDLER ades ade ade silent		/* #5  */
-	BUILD_HANDLER ibe ibe cli silent		/* #6  */
-	BUILD_HANDLER dbe dbe cli silent		/* #7  */
+	BUILD_HANDLER ibe be cli silent			/* #6  */
+	BUILD_HANDLER dbe be cli silent			/* #7  */
 	BUILD_HANDLER bp bp sti silent			/* #9  */
 	BUILD_HANDLER ri ri sti silent			/* #10 */
 	BUILD_HANDLER cpu cpu sti silent		/* #11 */
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/r4k_switch.S linux-2.4.19-rc2/arch/mips64/kernel/r4k_switch.S
--- linux-2.4.19-rc1/arch/mips64/kernel/r4k_switch.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/r4k_switch.S	Tue Jul 16 16:25:18 2002
@@ -8,7 +8,6 @@
  * Copyright (C) 1994, 1995, 1996, by Andreas Busse
  * Copyright (C) 1999 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/cachectl.h>
 #include <asm/current.h>
@@ -67,7 +66,7 @@
 
 LEAF(lazy_fpu_switch)
 	mfc0	t0, CP0_STATUS			# enable cp1
-	li	t3, 0x20000000
+	li	t3, ST0_CU1
 	or	t0, t3
 	mtc0	t0, CP0_STATUS
 
@@ -115,6 +114,23 @@
 	END(save_fp)
 
 /*
+ * Restore a thread's fp context.
+ */
+LEAF(restore_fp)
+	mfc0	t0, CP0_STATUS
+	sll	t1, t0, 5
+	bgez	t0, 1f				# 16 register mode?
+	 nop
+
+	fpu_restore_16odd $28
+1:
+	.set	reorder
+	fpu_restore_16even $28, t0		# clobbers t0
+
+	jr	ra
+	END(restore_fp)
+
+/*
  * Load the FPU with signalling NANS.  This bit pattern we're using has
  * the property that no matter whether considered as single or as double
  * precision represents signaling NANS.
@@ -126,7 +142,7 @@
 
 LEAF(init_fpu)
 	mfc0	t0, CP0_STATUS
-	li	t1, 0x20000000
+	li	t1, ST0_CU1
 	or	t0, t1
 	mtc0	t0, CP0_STATUS
 	sll	t0, t0, 5
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/scall_64.S linux-2.4.19-rc2/arch/mips64/kernel/scall_64.S
--- linux-2.4.19-rc1/arch/mips64/kernel/scall_64.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/scall_64.S	Tue Jul 16 16:25:18 2002
@@ -362,4 +362,8 @@
 	PTR	sys_ni_syscall			/* reserved for removexattr */
 	PTR	sys_ni_syscall			/* reserved for lremovexattr */
 	PTR	sys_ni_syscall			/* reserved for fremovexattr */
-	PTR	sys_tkill
+	PTR	sys_tkill, 2
+	PTR	sys_ni_syscall, 0		/* res. for sendfile64 */
+	PTR	sys_ni_syscall, 0		/* res. for futex */
+	PTR	sys_ni_syscall, 0		/* res. for sched_setaffinity */
+	PTR	sys_ni_syscall, 0		/* 4240 res. for sched_getaffinity */
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/scall_o32.S linux-2.4.19-rc2/arch/mips64/kernel/scall_o32.S
--- linux-2.4.19-rc1/arch/mips64/kernel/scall_o32.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/scall_o32.S	Tue Jul 16 16:25:18 2002
@@ -240,10 +240,10 @@
 	jr	ra
 	END(mips_atomic_set)
 
-	LEAF(sys_sysmips)
+	LEAF(sys32_sysmips)
 	beq	a0, MIPS_ATOMIC_SET, mips_atomic_set
-	j	_sys_sysmips
-	END(sys_sysmips)
+	j	sys_sysmips
+	END(sys32_sysmips)
 
 	.macro	syscalltable
 	sys	sys_syscall	0			/* 4000 */
@@ -376,7 +376,7 @@
 	sys	sys_create_module 2
 	sys	sys_init_module	5
 	sys	sys_delete_module 1
-	sys	sys_get_kernel_syms 1			/* 4130 */
+	sys	sys32_get_kernel_syms 1			/* 4130 */
 	sys	sys_quotactl	0
 	sys	sys_getpgid	1
 	sys	sys_fchdir	1
@@ -395,7 +395,7 @@
 	sys	sys32_writev	3
 	sys	sys_cacheflush	3
 	sys	sys_cachectl	3
-	sys	sys_sysmips	4
+	sys	sys32_sysmips	4
 	sys	sys_ni_syscall	0			/* 4150 */
 	sys	sys_getsid	1
 	sys	sys_fdatasync	0
@@ -482,7 +482,11 @@
 	sys	sys_ni_syscall	0		/* reserved for removexattr */
 	sys	sys_ni_syscall	0		/* reserved for lremovexattr */
 	sys	sys_ni_syscall	0		/* 4235 res. for fremovexattr */
-	sys	sys32_tkill	2
+	sys	sys_tkill, 2
+	sys	sys_ni_syscall, 0		/* res. for sendfile64 */
+	sys	sys_ni_syscall, 0		/* res. for futex */
+	sys	sys_ni_syscall, 0		/* res. for sched_setaffinity */
+	sys	sys_ni_syscall, 0		/* 4240 res. for sched_getaffinity */
 
 	.endm
 
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/setup.c linux-2.4.19-rc2/arch/mips64/kernel/setup.c
--- linux-2.4.19-rc1/arch/mips64/kernel/setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/setup.c	Tue Jul 16 16:25:18 2002
@@ -8,6 +8,7 @@
  * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Ralf Baechle
  * Copyright (C) 1996 Stoned Elipot
  * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #include <linux/config.h>
 #include <linux/errno.h>
@@ -15,6 +16,7 @@
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
+#include <linux/module.h>
 #include <linux/stddef.h>
 #include <linux/string.h>
 #include <linux/unistd.h>
@@ -24,6 +26,7 @@
 #include <linux/utsname.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
+#include <linux/bootmem.h>
 #ifdef CONFIG_BLK_DEV_RAM
 #include <linux/blk.h>
 #endif
@@ -140,6 +143,11 @@
 	case CPU_NEVADA:
 	case CPU_RM7000:
 	case CPU_TX49XX:
+	case CPU_4KC:
+	case CPU_4KEC:
+	case CPU_4KSC:
+	case CPU_5KC:
+/*	case CPU_20KC:*/
 		cpu_wait = r4k_wait;
 		printk(" available.\n");
 		break;
@@ -176,6 +184,20 @@
 #endif
 }
 
+/*
+ * Get the FPU Implementation/Revision.
+ */
+static inline unsigned long cpu_get_fpu_id(void)
+{
+	unsigned long tmp, fpu_id;
+
+	tmp = read_32bit_cp0_register(CP0_STATUS);
+	__enable_fpu();
+	fpu_id = read_32bit_cp1_register(CP1_REVISION);
+	write_32bit_cp0_register(CP0_STATUS, tmp);
+	return fpu_id;
+}
+
 /* declaration of the global struct */
 struct mips_cpu mips_cpu = {
     processor_id:	PRID_IMP_UNKNOWN,
@@ -189,9 +211,26 @@
 static inline void cpu_probe(void)
 {
 #ifdef CONFIG_CPU_MIPS32
+	unsigned long config0 = read_32bit_cp0_register(CP0_CONFIG);
 	unsigned long config1;
-#endif
 
+        if (config0 & (1 << 31)) {
+		/* MIPS32 compliant CPU. Read Config 1 register. */
+		mips_cpu.isa_level = MIPS_CPU_ISA_M32;
+		mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
+			MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC;
+		config1 = read_mips32_cp0_config1();
+		if (config1 & (1 << 3))
+			mips_cpu.options |= MIPS_CPU_WATCH;
+		if (config1 & (1 << 2))
+			mips_cpu.options |= MIPS_CPU_MIPS16;
+		if (config1 & (1 << 1))
+			mips_cpu.options |= MIPS_CPU_EJTAG;
+		if (config1 & 1)
+			mips_cpu.options |= MIPS_CPU_FPU;
+		mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
+	}
+#endif
 	mips_cpu.processor_id = read_32bit_cp0_register(CP0_PRID);
 	switch (mips_cpu.processor_id & 0xff0000) {
 	case PRID_COMP_LEGACY:
@@ -371,6 +410,14 @@
 				           MIPS_CPU_COUNTER | MIPS_CPU_WATCH;
 			mips_cpu.tlbsize = 64;
 			break;
+		case PRID_IMP_R12000:
+			mips_cpu.cputype = CPU_R12000;
+			mips_cpu.isa_level = MIPS_CPU_ISA_IV;
+			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
+				           MIPS_CPU_FPU | MIPS_CPU_32FPR | 
+				           MIPS_CPU_COUNTER | MIPS_CPU_WATCH;
+			mips_cpu.tlbsize = 64;
+			break;
 		default:
 			mips_cpu.cputype = CPU_UNKNOWN;
 			break;
@@ -381,48 +428,20 @@
 		switch (mips_cpu.processor_id & 0xff00) {
 		case PRID_IMP_4KC:
 			mips_cpu.cputype = CPU_4KC;
-			goto cpu_4kc;
+			break;
 		case PRID_IMP_4KEC:
 			mips_cpu.cputype = CPU_4KEC;
-			goto cpu_4kc;
+			break;
 		case PRID_IMP_4KSC:
 			mips_cpu.cputype = CPU_4KSC;
-cpu_4kc:
-			/*
-			 * Why do we set all these options by default, THEN
-			 * query them??
-			 */
-			mips_cpu.isa_level = MIPS_CPU_ISA_M32;
-			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
-				           MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | 
-				           MIPS_CPU_DIVEC | MIPS_CPU_WATCH |
-			                   MIPS_CPU_MCHECK;
-			config1 = read_mips32_cp0_config1();
-			if (config1 & (1 << 3))
-				mips_cpu.options |= MIPS_CPU_WATCH;
-			if (config1 & (1 << 2))
-				mips_cpu.options |= MIPS_CPU_MIPS16;
-			if (config1 & 1)
-				mips_cpu.options |= MIPS_CPU_FPU;
-			mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
 			break;
 		case PRID_IMP_5KC:
 			mips_cpu.cputype = CPU_5KC;
 			mips_cpu.isa_level = MIPS_CPU_ISA_M64;
-			/* See comment above about querying options */
-			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
-				           MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | 
-				           MIPS_CPU_DIVEC | MIPS_CPU_WATCH |
-			                   MIPS_CPU_MCHECK;
-			config1 = read_mips32_cp0_config1();
-			if (config1 & (1 << 3))
-				mips_cpu.options |= MIPS_CPU_WATCH;
-			if (config1 & (1 << 2))
-				mips_cpu.options |= MIPS_CPU_MIPS16;
-			if (config1 & 1)
-				mips_cpu.options |= MIPS_CPU_FPU;
-			mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
 			break;
+		case PRID_IMP_20KC:
+			mips_cpu.cputype = CPU_20KC;
+			mips_cpu.isa_level = MIPS_CPU_ISA_M64;
 		default:
 			mips_cpu.cputype = CPU_UNKNOWN;
 			break;
@@ -432,19 +451,10 @@
 		switch (mips_cpu.processor_id & 0xff00) {
 		case PRID_IMP_AU1_REV1:
 		case PRID_IMP_AU1_REV2:
-			mips_cpu.cputype = CPU_AU1000;
-			mips_cpu.isa_level = MIPS_CPU_ISA_M32;
-			mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 
-					   MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | 
-					   MIPS_CPU_DIVEC | MIPS_CPU_WATCH;
-			config1 = read_mips32_cp0_config1();
-			if (config1 & (1 << 3))
-				mips_cpu.options |= MIPS_CPU_WATCH;
-			if (config1 & (1 << 2))
-				mips_cpu.options |= MIPS_CPU_MIPS16;
-			if (config1 & 1)
-				mips_cpu.options |= MIPS_CPU_FPU;
-			mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT;
+			if (mips_cpu.processor_id & 0xff000000)
+				mips_cpu.cputype = CPU_AU1500;
+			else
+				mips_cpu.cputype = CPU_AU1000;
 			break;
 		default:
 			mips_cpu.cputype = CPU_UNKNOWN;
@@ -473,6 +483,8 @@
 	default:
 		mips_cpu.cputype = CPU_UNKNOWN;
 	}
+	if (mips_cpu.options & MIPS_CPU_FPU)
+		mips_cpu.fpu_id = cpu_get_fpu_id();
 }
 
 static inline void cpu_report(void)
@@ -730,16 +742,8 @@
 #ifdef CONFIG_SGI_IP32
 	ip32_setup();
 #endif
-#ifdef CONFIG_SGI_IP32
-	ip32_setup();
-#endif
 #ifdef CONFIG_SIBYTE_SWARM
 	swarm_setup();
-	bootmem_init();		/* XXX */
-#endif
-
-#ifdef CONFIG_ARC_MEMORY
-	bootmem_init();
 #endif
 
 	strncpy(command_line, arcs_cmdline, CL_SIZE);
@@ -750,6 +754,8 @@
 
 	parse_mem_cmdline();
 
+	bootmem_init();
+
 	paging_init();
 }
 
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/signal32.c linux-2.4.19-rc2/arch/mips64/kernel/signal32.c
--- linux-2.4.19-rc1/arch/mips64/kernel/signal32.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/signal32.c	Tue Jul 16 16:25:18 2002
@@ -69,11 +69,12 @@
 	unsigned int fcr0;
 	int err = 0;
 
-	err |= __copy_to_user(&sc->sc_fpregs[0], 
-		&current->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS * 
-						sizeof(unsigned long));
-	err |= __copy_to_user(&sc->sc_fpc_csr, &current->thread.fpu.hard.control,
-						sizeof(unsigned int));
+	err |= __copy_to_user(&sc->sc_fpregs[0],
+			      &current->thread.fpu.hard.fp_regs[0],
+			      NUM_FPU_REGS * sizeof(unsigned long));
+	err |= __copy_to_user(&sc->sc_fpc_csr,
+			      &current->thread.fpu.hard.control,
+			      sizeof(unsigned int));
 	__asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0));
 	err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int));
 
@@ -86,18 +87,18 @@
 
 	if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
 		return -EFAULT;
-	err |= __copy_from_user(&current->thread.fpu.hard.fp_regs[0], 
-			&sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long));
-	err |= __copy_from_user(&current->thread.fpu.hard.control, &sc->sc_fpc_csr,
-							sizeof(unsigned int));
+	err |= __copy_from_user(&current->thread.fpu.hard.fp_regs[0],
+				&sc->sc_fpregs[0],
+				NUM_FPU_REGS * sizeof(unsigned long));
+	err |= __copy_from_user(&current->thread.fpu.hard.control,
+				&sc->sc_fpc_csr, sizeof(unsigned int));
 	return err;
 }
 
 extern void __put_sigset_unknown_nsig(void);
 extern void __get_sigset_unknown_nsig(void);
 
-static inline int
-put_sigset(const sigset_t *kbuf, sigset32_t *ubuf)
+static inline int put_sigset(const sigset_t *kbuf, sigset32_t *ubuf)
 {
 	int err = 0;
 
@@ -118,8 +119,7 @@
 	return err;
 }
 
-static inline int
-get_sigset(sigset_t *kbuf, const sigset32_t *ubuf)
+static inline int get_sigset(sigset_t *kbuf, const sigset32_t *ubuf)
 {
 	int err = 0;
 	unsigned long sig[4];
@@ -146,8 +146,7 @@
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
-asmlinkage inline int
-sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+asmlinkage inline int sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
 {
 	sigset32_t *uset;
 	sigset_t newset, saveset;
@@ -174,8 +173,7 @@
 	}
 }
 
-asmlinkage int
-sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
+asmlinkage int sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
 {
 	sigset32_t *uset;
 	sigset_t newset, saveset;
@@ -253,8 +251,7 @@
 	return ret;
 }
 
-asmlinkage int
-sys32_sigaltstack(abi64_no_regargs, struct pt_regs regs)
+asmlinkage int sys32_sigaltstack(abi64_no_regargs, struct pt_regs regs)
 {
 	const stack32_t *uss = (const stack32_t *) regs.regs[4];
 	stack32_t *uoss = (stack32_t *) regs.regs[5];
@@ -292,8 +289,8 @@
 	return ret;
 }
 
-static asmlinkage int
-restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
+static asmlinkage int restore_sigcontext(struct pt_regs *regs,
+					 struct sigcontext *sc)
 {
 	int owned_fp;
 	int err = 0;
@@ -345,8 +342,7 @@
 	struct ucontext rs_uc;
 };
 
-asmlinkage void
-sys32_sigreturn(abi64_no_regargs, struct pt_regs regs)
+asmlinkage void sys32_sigreturn(abi64_no_regargs, struct pt_regs regs)
 {
 	struct sigframe *frame;
 	sigset_t blocked;
@@ -373,7 +369,7 @@
 		syscall_trace();
 	__asm__ __volatile__(
 		"move\t$29, %0\n\t"
-		"j\tret_from_sys_call"
+		"j\to32_ret_from_sys_call"
 		:/* no outputs */
 		:"r" (&regs));
 	/* Unreached */
@@ -382,8 +378,7 @@
 	force_sig(SIGSEGV, current);
 }
 
-asmlinkage void
-sys32_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
+asmlinkage void sys32_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
 {
 	struct rt_sigframe *frame;
 	sigset_t set;
@@ -415,7 +410,7 @@
 	 */
 	__asm__ __volatile__(
 		"move\t$29, %0\n\t"
-		"j\tret_from_sys_call"
+		"j\to32_ret_from_sys_call"
 		:/* no outputs */
 		:"r" (&regs));
 	/* Unreached */
@@ -424,8 +419,8 @@
 	force_sig(SIGSEGV, current);
 }
 
-static int inline
-setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
+static int inline setup_sigcontext(struct pt_regs *regs,
+				   struct sigcontext *sc)
 {
 	int err = 0;
 
@@ -470,8 +465,8 @@
 /*
  * Determine which stack to use..
  */
-static inline void *
-get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
+static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
+				 size_t frame_size)
 {
 	unsigned long sp;
 
@@ -485,9 +480,8 @@
 	return (void *)((sp - frame_size) & ALMASK);
 }
 
-static void inline
-setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
-            int signr, sigset_t *set)
+static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
+			       int signr, sigset_t *set)
 {
 	struct sigframe *frame;
 	int err = 0;
@@ -537,8 +531,9 @@
 	regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
 #if DEBUG_SIG
-	printk("SIG deliver (%s:%d): sp=0x%p pc=0x%p ra=0x%p\n", current->comm,
-	       current->pid, frame, regs->cp0_epc, frame->sf_code);
+	printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
+	       current->comm, current->pid,
+	       frame, regs->cp0_epc, frame->sf_code);
 #endif
         return;
 
@@ -548,9 +543,9 @@
 	force_sig(SIGSEGV, current);
 }
 
-static void inline
-setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
-               int signr, sigset_t *set, siginfo_t *info)
+static void inline setup_rt_frame(struct k_sigaction * ka,
+				  struct pt_regs *regs, int signr,
+				  sigset_t *set, siginfo_t *info)
 {
 	struct rt_sigframe *frame;
 	int err = 0;
@@ -613,8 +608,9 @@
 	regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
 #if DEBUG_SIG
-	printk("SIG deliver (%s:%d): sp=0x%p pc=0x%p ra=0x%p\n", current->comm,
-	       current->pid, frame, regs->cp0_epc, frame->rs_code);
+	printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
+	       current->comm, current->pid,
+	       frame, regs->cp0_epc, frame->rs_code);
 #endif
 	return;
 
@@ -624,9 +620,9 @@
 	force_sig(SIGSEGV, current);
 }
 
-static inline void
-handle_signal(unsigned long sig, struct k_sigaction *ka,
-	siginfo_t *info, sigset_t *oldset, struct pt_regs * regs)
+static inline void handle_signal(unsigned long sig, struct k_sigaction *ka,
+				 siginfo_t *info, sigset_t *oldset,
+				 struct pt_regs * regs)
 {
 	if (ka->sa.sa_flags & SA_SIGINFO)
 		setup_rt_frame(ka, regs, sig, oldset, info);
@@ -644,8 +640,8 @@
 	}
 }
 
-static inline void
-syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
+static inline void syscall_restart(struct pt_regs *regs,
+				   struct k_sigaction *ka)
 {
 	switch(regs->regs[0]) {
 	case ERESTARTNOHAND:
@@ -733,7 +729,7 @@
 				continue;
 
 			switch (signr) {
-			case SIGCONT: case SIGCHLD: case SIGWINCH:
+			case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG:
 				continue;
 
 			case SIGTSTP: case SIGTTIN: case SIGTTOU:
@@ -912,5 +908,12 @@
 	return ret;
 }
 
-asmlinkage void sys32_rt_sigtimedwait(void) { panic(__FUNCTION__ " called."); }
-asmlinkage void sys32_rt_sigqueueinfo(void) { panic(__FUNCTION__ " called."); }
+asmlinkage void sys32_rt_sigtimedwait(void)
+{
+	panic("%s called.", __FUNCTION__);
+}
+
+asmlinkage void sys32_rt_sigqueueinfo(void)
+{
+	panic("%s called.", __FUNCTION__);
+}
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/smp.c linux-2.4.19-rc2/arch/mips64/kernel/smp.c
--- linux-2.4.19-rc1/arch/mips64/kernel/smp.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/smp.c	Tue Jul 16 16:25:18 2002
@@ -7,6 +7,7 @@
  * Copyright (C) 2000, 2001 Ralf Baechle
  * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
  */
+#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -78,6 +79,7 @@
 	printk("Slave cpu booted successfully\n");
 	CPUMASK_SETB(cpu_online_map, cpu);
 	atomic_inc(&cpus_booted);
+	while (!atomic_read(&smp_commenced));
 	cpu_idle();
 }
 #endif /* CONFIG_SGI_IP27 */
@@ -137,7 +139,7 @@
 	if (wait)
 		atomic_set(&data.finished, 0);
 
-	spin_lock_bh(&call_lock);
+	spin_lock(&call_lock);
 	call_data = &data;
 
 	/* Send a message to all other CPUs and wait for them to respond */
@@ -153,7 +155,7 @@
 	if (wait)
 		while (atomic_read(&data.finished) != cpus)
 			barrier();
-	spin_unlock_bh(&call_lock);
+	spin_unlock(&call_lock);
 
 	return 0;
 }
@@ -299,6 +301,7 @@
 	local_flush_tlb_page(vma, page);
 }
 
+EXPORT_SYMBOL(smp_num_cpus);
 EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(cpu_data);
 EXPORT_SYMBOL(synchronize_irq);
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/syscall.c linux-2.4.19-rc2/arch/mips64/kernel/syscall.c
--- linux-2.4.19-rc1/arch/mips64/kernel/syscall.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/syscall.c	Tue Jul 16 16:25:18 2002
@@ -50,6 +50,59 @@
 	return res;
 }
 
+#define COLOUR_ALIGN(addr,pgoff)		\
+	((((addr)+SHMLBA-1)&~(SHMLBA-1)) +	\
+	 (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1)))
+
+unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
+	unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+	struct vm_area_struct * vmm;
+	int do_color_align;
+
+	if (flags & MAP_FIXED) {
+		/*
+		 * We do not accept a shared mapping if it would violate
+		 * cache aliasing constraints.
+		 */
+		if ((flags & MAP_SHARED) && (addr & (SHMLBA - 1)))
+			return -EINVAL;
+		return addr;
+	}
+
+	if (len > TASK_SIZE)
+		return -ENOMEM;
+	do_color_align = 0;
+	if (filp || (flags & MAP_SHARED))
+		do_color_align = 1;
+	if (addr) {
+		if (do_color_align)
+			addr = COLOUR_ALIGN(addr, pgoff);
+		else
+			addr = PAGE_ALIGN(addr);
+		vmm = find_vma(current->mm, addr);
+		if (TASK_SIZE - len >= addr &&
+		    (!vmm || addr + len <= vmm->vm_start))
+			return addr;
+	}
+	addr = TASK_UNMAPPED_BASE;
+	if (do_color_align)
+		addr = COLOUR_ALIGN(addr, pgoff);
+	else
+		addr = PAGE_ALIGN(addr);
+
+	for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
+		/* At this point:  (!vmm || addr < vmm->vm_end). */
+		if (TASK_SIZE - len < addr)
+			return -ENOMEM;
+		if (!vmm || addr + len <= vmm->vm_start)
+			return addr;
+		addr = vmm->vm_end;
+		if (do_color_align)
+			addr = COLOUR_ALIGN(addr, pgoff);
+	}
+}
+
 asmlinkage unsigned long
 sys_mmap(unsigned long addr, size_t len, unsigned long prot,
          unsigned long flags, unsigned long fd, off_t offset)
@@ -134,7 +187,7 @@
 }
 
 asmlinkage int
-_sys_sysmips(int cmd, long arg1, int arg2, int arg3)
+sys_sysmips(int cmd, long arg1, int arg2, int arg3)
 {
 	int	*p;
 	char	*name;
@@ -155,8 +208,8 @@
 
 		down_write(&uts_sem);
 		strncpy(system_utsname.nodename, name, len);
-		up_write(&uts_sem);
 		system_utsname.nodename[len] = '\0';
+		up_write(&uts_sem);
 		return 0;
 	}
 
@@ -263,8 +316,7 @@
 /*
  * No implemented yet ...
  */
-asmlinkage int
-sys_cachectl(char *addr, int nbytes, int op)
+asmlinkage int sys_cachectl(char *addr, int nbytes, int op)
 {
 	return -ENOSYS;
 }
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/time.c linux-2.4.19-rc2/arch/mips64/kernel/time.c
--- linux-2.4.19-rc1/arch/mips64/kernel/time.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/time.c	Tue Jul 16 16:25:18 2002
@@ -39,6 +39,11 @@
 extern volatile unsigned long wall_jiffies;
 
 /*
+ * whether we emulate local_timer_interrupts for SMP machines.
+ */
+int emulate_local_timer_interrupt;
+
+/*
  * By default we provide the null RTC ops
  */
 static unsigned long null_rtc_get_time(void)
@@ -283,6 +288,42 @@
 
 
 /*
+ * local_timer_interrupt() does profiling and process accounting
+ * on a per-CPU basis.  
+ *
+ * In UP mode, it is invoked from the (global) timer_interrupt.  
+ *
+ * In SMP mode, it might invoked by per-CPU timer interrupt, or
+ * a broadcasted inter-processor interrupt which itself is triggered
+ * by the global timer interrupt.
+ */
+void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	if(!user_mode(regs)) {
+		if (prof_buffer && current->pid) {
+			extern int _stext;
+			unsigned long pc = regs->cp0_epc;
+
+			pc -= (unsigned long) &_stext;
+			pc >>= prof_shift;
+			/*
+			 * Dont ignore out-of-bounds pc values silently,
+			 * put them into the last histogram slot, so if
+			 * present, they will show up as a sharp peak.
+			 */
+			if (pc > prof_len-1)
+			pc = prof_len-1;
+			atomic_inc((atomic_t *)&prof_buffer[pc]);
+		}
+	}
+
+#if defined(CONFIG_SMP)
+	/* in UP mode, update_process_times() is invoked by do_timer() */
+	update_process_times(user_mode(regs));
+#endif
+}
+
+/*
  * high-level timer interrupt service routines.  This function
  * is set as irqaction->handler and is invoked through do_IRQ.
  */
@@ -309,24 +350,6 @@
 
 	}
 
-	if(!user_mode(regs)) {
-		if (prof_buffer && current->pid) {
-			extern int _stext;
-			unsigned long pc = regs->cp0_epc;
-
-			pc -= (unsigned long) &_stext;
-			pc >>= prof_shift;
-			/*
-			 * Dont ignore out-of-bounds pc values silently,
-			 * put them into the last histogram slot, so if
-			 * present, they will show up as a sharp peak.
-			 */
-			if (pc > prof_len-1)
-			pc = prof_len-1;
-			atomic_inc((atomic_t *)&prof_buffer[pc]);
-		}
-	}
-
 	/*
 	 * call the generic timer interrupt handling
 	 */
@@ -359,6 +382,31 @@
 	if (!jiffies) {
 		timerhi = timerlo = 0;
 	}
+
+#if !defined(CONFIG_SMP)
+	/* 
+	 * In UP mode, we call local_timer_interrupt() to do profiling
+	 * and process accouting.  
+	 *
+	 * In SMP mode, local_timer_interrupt() is invoked by appropriate
+	 * low-level local timer interrupt handler.
+	 */
+	local_timer_interrupt(0, NULL, regs);
+
+#else	/* CONFIG_SMP */
+
+	if (emulate_local_timer_interrupt) {
+		/* 
+		 * this is the place where we send out inter-process
+		 * interrupts and let each CPU do its own profiling
+		 * and process accouting.
+		 *
+		 * Obviously we need to call local_timer_interrupt() for
+		 * the current CPU too.
+		 */
+		panic("Not implemented yet!!!");
+	}
+#endif	/* CONFIG_SMP */
 }
 
 asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs)
@@ -377,6 +425,21 @@
 		do_softirq();
 }
 
+asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs)
+{
+	int cpu = smp_processor_id();
+
+	irq_enter(cpu, irq);
+	kstat.irqs[cpu][irq]++;
+
+	/* we keep interrupt disabled all the time */
+	local_timer_interrupt(irq, NULL, regs);
+	
+	irq_exit(cpu, irq);
+
+	if (softirq_pending(cpu))
+		do_softirq();
+}
 
 /*
  * time_init() - it does the following things.
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/traps.c linux-2.4.19-rc2/arch/mips64/kernel/traps.c
--- linux-2.4.19-rc1/arch/mips64/kernel/traps.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/traps.c	Tue Jul 16 16:25:18 2002
@@ -7,6 +7,7 @@
  * Copyright (C) 1995, 1996 Paul M. Antoine
  * Copyright (C) 1998 Ulf Carlsson
  * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -23,10 +24,10 @@
 #include <asm/module.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
-#include <asm/paccess.h>
 #include <asm/ptrace.h>
 #include <asm/watch.h>
 #include <asm/system.h>
+#include <asm/traps.h>
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
 #include <asm/cachectl.h>
@@ -49,9 +50,14 @@
 extern asmlinkage void handle_mcheck(void);
 extern asmlinkage void handle_reserved(void);
 
+extern int fpu_emulator_cop1Handler(struct pt_regs *);
+void fpu_emulator_init_fpu(void);
+
 char watch_available = 0;
 char dedicated_iv_available = 0;
 
+int (*be_board_handler)(struct pt_regs *regs, int is_fixup);
+
 int kstack_depth_to_print = 24;
 
 /*
@@ -111,7 +117,7 @@
 
 	printk("\nCall Trace:");
 
-	while ((unsigned long) stack & (PAGE_SIZE -1)) {
+	while ((unsigned long) stack & (PAGE_SIZE - 1)) {
 		unsigned long addr;
 
 		if (__get_user(addr, stack++)) {
@@ -269,7 +275,8 @@
 
 extern spinlock_t modlist_lock;
 
-unsigned long search_dbe_table(unsigned long addr)
+static inline unsigned long
+search_dbe_table(unsigned long addr)
 {
 	unsigned long ret = 0;
 
@@ -305,26 +312,45 @@
 #endif
 }
 
-/* Default data and instruction bus error handlers.  */
-void do_ibe(struct pt_regs *regs)
+asmlinkage void do_be(struct pt_regs *regs)
 {
-	die("Got ibe\n", regs);
-}
+	unsigned long new_epc;
+	unsigned long fixup = 0;
+	int data = regs->cp0_cause & 4;
+	int action = MIPS_BE_FATAL;
 
-void do_dbe(struct pt_regs *regs)
-{
-	unsigned long fixup;
+	if (data && !user_mode(regs))
+		fixup = search_dbe_table(regs->cp0_epc);
+
+	if (fixup)
+		action = MIPS_BE_FIXUP;
 
-	fixup = search_dbe_table(regs->cp0_epc);
-	if (fixup) {
-		long new_epc;
+	if (be_board_handler)
+		action = be_board_handler(regs, fixup != 0);
 
-		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
-		regs->cp0_epc = new_epc;
+	switch (action) {
+	case MIPS_BE_DISCARD:
 		return;
+	case MIPS_BE_FIXUP:
+		if (fixup) {
+			new_epc = fixup_exception(dpf_reg, fixup,
+						  regs->cp0_epc);
+			regs->cp0_epc = new_epc;
+			return;
+		}
+		break;
+	default:
+		break;
 	}
 
-	die("Got dbe\n", regs);
+	/*
+	 * Assume it would be too dangerous to continue ...
+	 */
+	printk(KERN_ALERT "%s bus error, epc == %08lx, ra == %08lx\n",
+	       data ? "Data" : "Instruction",
+	       regs->cp0_epc, regs->regs[31]);
+	die_if_kernel("Oops", regs);
+	force_sig(SIGBUS, current);
 }
 
 void do_ov(struct pt_regs *regs)
@@ -334,69 +360,55 @@
 	force_sig(SIGFPE, current);
 }
 
-#ifdef CONFIG_MIPS_FPE_MODULE
-static void (*fpe_handler)(struct pt_regs *regs, unsigned int fcr31);
-
 /*
- * Register_fpe/unregister_fpe are for debugging purposes only.  To make
- * this hack work a bit better there is no error checking.
+ * XXX Delayed fp exceptions when doing a lazy ctx switch XXX
  */
-int register_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31))
+asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
 {
-	fpe_handler = handler;
-	return 0;
-}
+	if (fcr31 & FPU_CSR_UNI_X) {
+		int sig;
 
-int unregister_fpe(void (*handler)(struct pt_regs *regs, unsigned int fcr31))
-{
-	fpe_handler = NULL;
-	return 0;
-}
-#endif
+		/*
+	 	 * Unimplemented operation exception.  If we've got the full
+		 * software emulator on-board, let's use it...
+		 *
+		 * Force FPU to dump state into task/thread context.  We're
+		 * moving a lot of data here for what is probably a single
+		 * instruction, but the alternative is to pre-decode the FP
+		 * register operands before invoking the emulator, which seems
+		 * a bit extreme for what should be an infrequent event.
+		 */
+		save_fp(current);
 
-/*
- * XXX Delayed fp exceptions when doing a lazy ctx switch XXX
- */
-void do_fpe(struct pt_regs *regs, unsigned long fcr31)
-{
-	unsigned long pc;
-	unsigned int insn;
-	extern void simfp(unsigned int);
-
-#ifdef CONFIG_MIPS_FPE_MODULE
-	if (fpe_handler != NULL) {
-		fpe_handler(regs, fcr31);
-		return;
-	}
-#endif
-	if (fcr31 & 0x20000) {
-		/* Retry instruction with flush to zero ...  */
-		if (!(fcr31 & (1<<24))) {
-			printk("Setting flush to zero for %s.\n",
-			       current->comm);
-			fcr31 &= ~0x20000;
-			fcr31 |= (1<<24);
-			__asm__ __volatile__(
-				"ctc1\t%0,$31"
-				: /* No outputs */
-				: "r" (fcr31));
-			return;
-		}
-		pc = regs->cp0_epc + ((regs->cp0_cause & CAUSEF_BD) ? 4 : 0);
-		if (get_user(insn, (unsigned int *)pc)) {
-			/* XXX Can this happen?  */
-			force_sig(SIGSEGV, current);
+		/* Run the emulator */
+		sig = fpu_emulator_cop1Handler(regs);
+
+		/* 
+		 * We can't allow the emulated instruction to leave any of 
+		 * the cause bit set in $fcr31.
+		 */
+		current->thread.fpu.soft.sr &= ~FPU_CSR_ALL_X;
+
+		/* Restore the hardware register state */
+		restore_fp(current);
+
+		/* If something went wrong, signal */
+		if (sig)
+		{
+			/* 
+			 * Return EPC is not calculated in the FPU emulator, 
+			 * if a signal is being send. So we calculate it here.
+			 */
+			compute_return_epc(regs);
+			force_sig(sig, current);
 		}
 
-		printk(KERN_DEBUG "Unimplemented exception for insn %08x at 0x%08lx in %s.\n",
-		       insn, regs->cp0_epc, current->comm);
-		simfp(insn);
+		return;
 	}
 
 	if (compute_return_epc(regs))
 		return;
-	//force_sig(SIGFPE, current);
-	printk(KERN_DEBUG "Should send SIGFPE to %s\n", current->comm);
+	force_sig(SIGFPE, current);
 }
 
 void do_bp(struct pt_regs *regs)
@@ -497,11 +509,15 @@
 void do_cpu(struct pt_regs *regs)
 {
 	u32 cpid;
+	int sig;
 
 	cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
 	if (cpid != 1)
 		goto bad_cid;
 
+	if (!(mips_cpu.options & MIPS_CPU_FPU))
+		goto fp_emul;
+
 	regs->cp0_status |= ST0_CU1;
 
 #ifdef CONFIG_SMP
@@ -527,6 +543,23 @@
 #endif
 	return;
 
+fp_emul:
+	if (!current->used_math) {
+		fpu_emulator_init_fpu();
+		current->used_math = 1;
+	}
+	sig = fpu_emulator_cop1Handler(regs);
+	if (sig)
+	{
+		/* 
+		 * Return EPC is not calculated in the FPU emulator, if 
+		 * a signal is being send. So we calculate it here.
+		 */
+		compute_return_epc(regs);
+		force_sig(sig, current);
+	}
+	return;
+
 bad_cid:
 	compute_return_epc(regs);
 	force_sig(SIGILL, current);
@@ -613,7 +646,7 @@
 		set_cp0_cause(CAUSEF_IV);
 
 	cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
-	set_context(cpu << 23);
+	set_context(((long)(&pgd_current[cpu])) << 23);
 	set_wired(0);
 }
 
@@ -621,10 +654,9 @@
 {
 	extern char except_vec0;
 	extern char except_vec1_r10k;
-	extern char except_vec2_generic, except_vec2_sb1;
+	extern char except_vec2_generic;
 	extern char except_vec3_generic, except_vec3_r4000;
 	extern char except_vec4;
-	extern void bus_error_init(void);
 	unsigned long i;
 	int dummy;
 
@@ -656,20 +688,30 @@
 		set_except_vector(24, handle_mcheck);
 
 	/*
+	 * The Data Bus Errors / Instruction Bus Errors are signaled
+	 * by external hardware.  Therefore these two exceptions
+	 * may have board specific handlers.
+	 */
+	bus_error_init();
+
+	/*
 	 * Handling the following exceptions depends mostly of the cpu type
 	 */
 	switch(mips_cpu.cputype) {
         case CPU_SB1:
 #ifdef CONFIG_SB1_CACHE_ERROR
+		{
 		/* Special cache error handler for SB1 */
+		extern char except_vec2_sb1;
 		memcpy((void *)(KSEG0 + 0x100), &except_vec2_sb1, 0x80);
 		memcpy((void *)(KSEG1 + 0x100), &except_vec2_sb1, 0x80);
+		}
 #endif
 		/* Enable timer interrupt and scd mapped interrupt */
 		clear_cp0_status(0xf000);
 		set_cp0_status(0xc00);
-		goto nocache;
 
+		/* Fall through. */
 	case CPU_R10000:
 	case CPU_R4000MC:
 	case CPU_R4400MC:
@@ -682,10 +724,6 @@
 	case CPU_R4600:
 	case CPU_R5000:
 	case CPU_NEVADA:
-		/* Cache error vector  */
-		memcpy((void *)(KSEG0 + 0x100), (void *) KSEG0, 0x80);
-
-nocache:
 		/* Debug TLB refill handler.  */
 		memcpy((void *)KSEG0, &except_vec0, 0x80);
 		memcpy((void *)KSEG0 + 0x080, &except_vec1_r10k, 0x80);
@@ -707,18 +745,6 @@
 		set_except_vector(6, handle_ibe);
 		set_except_vector(7, handle_dbe);
 
-		/*
-		 * If nothing uses the DBE protection mechanism this is
-		 * necessary to get the kernel to link.
-		 */
-		get_dbe(dummy, (int *)KSEG0);
-
-		/*
-		 * DBE / IBE handlers may be overridden by system specific
-		 * handlers.
-		 */
-		bus_error_init();
-
 		set_except_vector(8, handle_sys);
 		set_except_vector(9, handle_bp);
 		set_except_vector(10, handle_ri);
diff -urN linux-2.4.19-rc1/arch/mips64/kernel/unaligned.c linux-2.4.19-rc2/arch/mips64/kernel/unaligned.c
--- linux-2.4.19-rc1/arch/mips64/kernel/unaligned.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/kernel/unaligned.c	Tue Jul 16 16:25:18 2002
@@ -5,7 +5,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1996, 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1996, 1998, 1999, 2002 by Ralf Baechle
  * Copyright (C) 1999 Silicon Graphics, Inc.
  *
  * This file contains exception handler for address error exception with the
@@ -351,7 +351,7 @@
 
 fault:
 	/* Did we have an exception handler installed? */
-	fixup = search_exception_table(regs->cp0_epc);
+	fixup = search_exception_table(exception_epc(regs));
 	if (fixup) {
 		long new_epc;
 		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
@@ -381,12 +381,26 @@
 asmlinkage void do_ade(struct pt_regs *regs)
 {
 	unsigned long pc;
+	extern int do_dsemulret(struct pt_regs *);
+
 #if 0
         printk("ade: Cpu%d[%s:%d:%0lx:%0lx]\n", smp_processor_id(),
                 current->comm, current->pid, regs->cp0_badvaddr, regs->cp0_epc);
 #endif
 
 	/*
+	 * Address errors may be deliberately induced
+	 * by the FPU emulator to take retake control
+	 * of the CPU after executing the instruction
+	 * in the delay slot of an emulated branch.
+	 */
+	/* Terminate if exception was recognized as a delay slot return */
+	if (do_dsemulret(regs))
+		return;
+
+        /* Otherwise handle as normal */
+
+	/*
 	 * Did we catch a fault trying to load an instruction?
 	 * This also catches attempts to activate MIPS16 code on
 	 * CPUs which don't support it.
diff -urN linux-2.4.19-rc1/arch/mips64/ld.script.elf32.S linux-2.4.19-rc2/arch/mips64/ld.script.elf32.S
--- linux-2.4.19-rc1/arch/mips64/ld.script.elf32.S	Mon Jul  2 14:40:58 2001
+++ linux-2.4.19-rc2/arch/mips64/ld.script.elf32.S	Tue Jul 16 16:25:18 2002
@@ -6,6 +6,7 @@
   .init          : { *(.init)		} =0
   .text      :
   {
+    _ftext = .;
     *(.text)
     *(.rodata)
     *(.rodata.*)
@@ -24,6 +25,10 @@
   __dbe_table : { *(__dbe_table) }
   __stop___dbe_table = .;
 
+  __start___ksymtab = .;	/* Kernel symbol table */
+  __ksymtab : { *(__ksymtab) }
+  __stop___ksymtab = .;
+
   _etext = .;
 
   . = ALIGN(16384);
diff -urN linux-2.4.19-rc1/arch/mips64/ld.script.elf64 linux-2.4.19-rc2/arch/mips64/ld.script.elf64
--- linux-2.4.19-rc1/arch/mips64/ld.script.elf64	Mon Jul  2 14:40:58 2001
+++ linux-2.4.19-rc2/arch/mips64/ld.script.elf64	Tue Jul 16 16:25:18 2002
@@ -16,6 +16,7 @@
   /* . = 0xa800000000300000; */
   . = 0xffffffff80300000;
   .text : {
+    _ftext = .;
     *(.text)
     *(.rodata)
     *(.rodata.*)
@@ -34,6 +35,10 @@
   __dbe_table : { *(__dbe_table) }
   __stop___dbe_table = .;
 
+  __start___ksymtab = .;	/* Kernel symbol table */
+  __ksymtab : { *(__ksymtab) }
+  __stop___ksymtab = .;
+
   _etext = .;
 
   . = ALIGN(16384);
diff -urN linux-2.4.19-rc1/arch/mips64/lib/Makefile linux-2.4.19-rc2/arch/mips64/lib/Makefile
--- linux-2.4.19-rc1/arch/mips64/lib/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/lib/Makefile	Tue Jul 16 16:25:18 2002
@@ -2,10 +2,7 @@
 # Makefile for MIPS-specific library files..
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 L_TARGET = lib.a
 
diff -urN linux-2.4.19-rc1/arch/mips64/lib/dump_tlb.c linux-2.4.19-rc2/arch/mips64/lib/dump_tlb.c
--- linux-2.4.19-rc1/arch/mips64/lib/dump_tlb.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/lib/dump_tlb.c	Tue Jul 16 16:25:18 2002
@@ -201,8 +201,7 @@
 {
 	int i;
 
-	for(i=0;i<8;i++)
-	{
+	for(i = 0; i < 8; i++) {
 		printk("*%08lx == %08lx, ",
 		       (unsigned long)p, (unsigned long)*p);
 		p++;
diff -urN linux-2.4.19-rc1/arch/mips64/lib/strnlen_user.S linux-2.4.19-rc2/arch/mips64/lib/strnlen_user.S
--- linux-2.4.19-rc1/arch/mips64/lib/strnlen_user.S	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/arch/mips64/lib/strnlen_user.S	Tue Jul 16 16:25:18 2002
@@ -27,7 +27,7 @@
 	and	v0, ta0
 	bltz	v0, fault
 
-EXPORT(__strnlen_user_nocheck_asm)
+FEXPORT(__strnlen_user_nocheck_asm)
 	move	v0, a0
 	daddu	a1, a0			# stop pointer
 1:	beq	v0, a1, 1f		# limit reached?
diff -urN linux-2.4.19-rc1/arch/mips64/mm/Makefile linux-2.4.19-rc2/arch/mips64/mm/Makefile
--- linux-2.4.19-rc1/arch/mips64/mm/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/Makefile	Tue Jul 16 16:25:18 2002
@@ -2,8 +2,7 @@
 # Makefile for the Linux/MIPS-specific parts of the memory manager.
 #
 
-.S.o:
-	$(CC) $(CFLAGS) $(CFLAGS_$@) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := mm.o
 
diff -urN linux-2.4.19-rc1/arch/mips64/mm/andes.c linux-2.4.19-rc2/arch/mips64/mm/andes.c
--- linux-2.4.19-rc1/arch/mips64/mm/andes.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/andes.c	Tue Jul 16 16:25:18 2002
@@ -96,8 +96,7 @@
  * This is only used during initialization time. vmalloc() also calls
  * this, but that will be changed pretty soon.
  */
-static void
-andes_flush_cache_l2(void)
+static void andes_flush_cache_l2(void)
 {
 	switch (sc_lsize()) {
 		case 64:
@@ -107,7 +106,7 @@
 			blast_scache128();
 			break;
 		default:
-			printk("Unknown L2 line size\n");
+			printk(KERN_EMERG "Unknown L2 line size\n");
 			while(1);
 	}
 }
@@ -143,7 +142,7 @@
 
 	__save_and_cli(flags);
 	/* Save old context and create impossible VPN2 value */
-	old_ctx = get_entryhi() & 0xff;
+	old_ctx = get_entryhi() & ASID_MASK;
 	set_entryhi(CKSEG0);
 	set_entrylo0(0);
 	set_entrylo1(0);
@@ -171,7 +170,8 @@
 		__save_and_cli(flags);
 		get_new_mmu_context(mm, smp_processor_id());
 		if(mm == current->mm)
-			set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) & 0xff);
+			set_entryhi(CPU_CONTEXT(smp_processor_id(), mm)
+				    & ASID_MASK);
 		__restore_flags(flags);
 	}
 }
@@ -184,15 +184,16 @@
 		int size;
 
 #ifdef DEBUG_TLB
-		printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & 0xff),
-		       start, end);
+		printk("[tlbrange<%02x,%08lx,%08lx>]",
+		       (mm->context & ASID_MASK), start, end);
 #endif
 		__save_and_cli(flags);
 		size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
 		size = (size + 1) >> 1;
 		if (size <= NTLB_ENTRIES_HALF) {
-			int oldpid = (get_entryhi() & 0xff);
-			int newpid = (CPU_CONTEXT(smp_processor_id(), mm) & 0xff);
+			int oldpid = (get_entryhi() & ASID_MASK);
+			int newpid = (CPU_CONTEXT(smp_processor_id(), mm)
+				      & ASID_MASK);
 
 			start &= (PAGE_MASK << 1);
 			end += ((PAGE_SIZE << 1) - 1);
@@ -215,8 +216,8 @@
 		} else {
 			get_new_mmu_context(mm, smp_processor_id());
 			if(mm == current->mm)
-				set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) & 
-									0xff);
+				set_entryhi(CPU_CONTEXT(smp_processor_id(), mm)
+					    & ASID_MASK);
 		}
 		__restore_flags(flags);
 	}
@@ -231,10 +232,11 @@
 #ifdef DEBUG_TLB
 		printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page);
 #endif
-		newpid = (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff);
+		newpid = (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) &
+			  ASID_MASK);
 		page &= (PAGE_MASK << 1);
 		__save_and_cli(flags);
-		oldpid = (get_entryhi() & 0xff);
+		oldpid = (get_entryhi() & ASID_MASK);
 		set_entryhi(page | newpid);
 		tlb_probe();
 		idx = get_index();
@@ -269,13 +271,14 @@
 	if (current->active_mm != vma->vm_mm)
 		return;
 
-	pid = get_entryhi() & 0xff;
+	pid = get_entryhi() & ASID_MASK;
 
-	if ((pid != (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff)) ||
-	   (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) == 0)) {
-		printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d "
-			"tlbpid=%d\n", (int) (CPU_CONTEXT(smp_processor_id(),
-			vma->vm_mm) & 0xff), pid);
+	if ((pid != (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & ASID_MASK))
+	    || (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) == 0)) {
+		printk(KERN_WARNING
+		       "%s: Wheee, bogus tlbpid mmpid=%d tlbpid=%d\n",
+		       __FUNCTION__, (int) (CPU_CONTEXT(smp_processor_id(),
+		       vma->vm_mm) & ASID_MASK), pid);
 	}
 
 	__save_and_cli(flags);
@@ -300,8 +303,6 @@
 
 void __init ld_mmu_andes(void)
 {
-	printk("CPU revision is: %08x\n", read_32bit_cp0_register(CP0_PRID));
-
 	printk("Primary instruction cache %dkb, linesize %d bytes\n",
 	       icache_size >> 10, ic_lsize);
 	printk("Primary data cache %dkb, linesize %d bytes\n",
@@ -324,7 +325,7 @@
 			scache_lsz64 = 0;
 			break;
 		default:
-			printk("Unknown L2 line size\n");
+			printk(KERN_EMERG "Unknown L2 line size\n");
 			while(1);
 	}
     
diff -urN linux-2.4.19-rc1/arch/mips64/mm/c-sb1.c linux-2.4.19-rc2/arch/mips64/mm/c-sb1.c
--- linux-2.4.19-rc1/arch/mips64/mm/c-sb1.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/c-sb1.c	Tue Jul 16 16:25:18 2002
@@ -17,12 +17,13 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */ 
-
+#include <linux/config.h>
 #include <linux/init.h>
 #include <asm/mmu_context.h>
 #include <asm/bootinfo.h>
 #include <asm/cacheops.h>
 #include <asm/cpu.h>
+#include <asm/uaccess.h>
 
 /* These are probed at ld_mmu time */
 static unsigned long icache_size;
@@ -202,7 +203,7 @@
 		".set pop                   \n"
 		:
 		: "r" (start & ~(icache_line_size - 1)),
-		  "r" ((end - 1) & ~(dcache_line_size - 1)),
+		  "r" ((end - 1) & ~(icache_line_size - 1)),
 		  "r" (icache_line_size),
 		  "i" (Index_Invalidate_I));
 }
@@ -244,10 +245,7 @@
 static void sb1_flush_icache_page(struct vm_area_struct *vma,
 	struct page *page)
 {
-	unsigned int cpu = smp_processor_id();
-
 	if (!(vma->vm_flags & VM_EXEC)) {
-//		printk("sb1_flush_icache_page(): not exec\n");
 		return;
 	}
 
@@ -258,7 +256,6 @@
 	 *
 	 * Bumping the ASID may well be cheaper, need to experiment ...
 	 */
-//printk("sb1_flush_icache_page(): flushing exec page\n");
 	sb1___flush_cache_all();
 }
 
@@ -329,7 +326,7 @@
 /*
  * A signal trampoline must fit into a single cacheline.
  */
-static inline void local_sb1_flush_cache_sigtramp(unsigned long addr)
+static void local_sb1_flush_cache_sigtramp(unsigned long addr)
 {
 	unsigned long daddr, iaddr;
 
@@ -340,46 +337,27 @@
 }
 
 #ifdef CONFIG_SMP
-struct flush_cache_sigtramp_args {
-	unsigned long addr;
-	struct mm_struct *mm;
-};
-
-static void sb1_flush_icache_range_ipi(void *info)
+static void sb1_flush_cache_sigtramp_ipi(void *info)
 {
-	struct flush_cache_sigtramp_args *args = info;
-	struct mm_struct *mm = args->mm;
-	unsigned long old_context, context = CPU_CONTEXT(cpu, mm);
-
-	if (!context)
-		return;
+	unsigned long iaddr = (unsigned long) info;
 
-	/*
-	 * Urgs...  Briefly switch the MMU context to the flushing process's
-	 * context, do the flush and back to the previous context.
-	 */
-	old_context = get_context();
-	set_context(context);
-	TLBMISS_HANDLER_SETUP_PGD(mm->pgd);
-	local_sb1_flush_cache_sigtramp(args->addr);
-	set_context(old_context);
-	TLBMISS_HANDLER_SETUP_PGD(current->active_mm->pgd);
-
-	XXX This is racing with switch_mm() XXX
+	iaddr = iaddr & ~(icache_line_size - 1);
+	protected_flush_icache_line(iaddr);
 }
 
-extern void sb1_flush_cache_sigtramp_ipi(void *ignored);
-asm("sb1_flush_cache_sigtramp_ipi = local_sb1_flush_cache_sigtramp");
-
 static void sb1_flush_cache_sigtramp(unsigned long addr)
 {
-	struct flush_cache_sigtramp_args args;
+	unsigned long tmp;
 
+	/*
+	 * Flush the local dcache, then load the instruction back into a
+	 * register.  That will make sure that any remote CPU also has
+	 * written back it's data cache to memory.
+	 */
 	local_sb1_flush_cache_sigtramp(addr);
+	__get_user(tmp, (unsigned long *)addr);
 
-	args.mm = current->mm;
-	args.addr = addr;
-	smp_call_function(sb1_flush_cache_sigtramp_ipi, &args, 1, 1);
+	smp_call_function(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1);
 }
 #else
 void sb1_flush_cache_sigtramp(unsigned long addr);
diff -urN linux-2.4.19-rc1/arch/mips64/mm/fault.c linux-2.4.19-rc2/arch/mips64/mm/fault.c
--- linux-2.4.19-rc1/arch/mips64/mm/fault.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/fault.c	Tue Jul 16 16:25:18 2002
@@ -21,6 +21,7 @@
 #include <linux/smp_lock.h>
 #include <linux/version.h>
 
+#include <asm/branch.h>
 #include <asm/hardirq.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
@@ -31,23 +32,19 @@
 
 #define development_version (LINUX_VERSION_CODE & 0x100)
 
-extern void die(char *, struct pt_regs *, unsigned long write)
-	__attribute__((noreturn));
-
 /*
  * Macro for exception fixup code to access integer registers.
  */
 #define dpf_reg(r) (regs->regs[r])
 
-asmlinkage void
-dodebug(abi64_no_regargs, struct pt_regs regs)
+asmlinkage void dodebug(abi64_no_regargs, struct pt_regs regs)
 {
-	printk("Got syscall %ld, cpu %d proc %s:%d epc 0x%lx\n", regs.regs[2],
-	       smp_processor_id(), current->comm, current->pid, regs.cp0_epc);
+	printk(KERN_DEBUG "Got syscall %ld, cpu %d proc %s:%d epc 0x%lx\n",
+	       regs.regs[2], smp_processor_id(), current->comm, current->pid,
+	       regs.cp0_epc);
 }
 
-asmlinkage void
-dodebug2(abi64_no_regargs, struct pt_regs regs)
+asmlinkage void dodebug2(abi64_no_regargs, struct pt_regs regs)
 {
 	unsigned long retaddr;
 
@@ -56,7 +53,8 @@
 		"add %0,$0,$31\n\t"
 		".set reorder"
 		: "=r" (retaddr));
-	printk("Got exception 0x%lx at 0x%lx\n", retaddr, regs.cp0_epc);
+	printk(KERN_DEBUG "Got exception 0x%lx at 0x%lx\n", retaddr,
+	       regs.cp0_epc);
 }
 
 extern spinlock_t timerlist_lock;
@@ -97,8 +95,8 @@
  * and the problem, and then passes it off to one of the appropriate
  * routines.
  */
-asmlinkage void
-do_page_fault(struct pt_regs *regs, unsigned long write, unsigned long address)
+asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
+			      unsigned long address)
 {
 	struct vm_area_struct * vma;
 	struct task_struct *tsk = current;
@@ -208,7 +206,7 @@
 
 no_context:
 	/* Are we prepared to handle this kernel fault?  */
-	fixup = search_exception_table(regs->cp0_epc);
+	fixup = search_exception_table(exception_epc(regs));
 	if (fixup) {
 		long new_epc;
 
@@ -245,7 +243,7 @@
 		down_read(&mm->mmap_sem);
 		goto survive;
 	}
-	printk("VM: killing process %s\n", tsk->comm);
+	printk(KERN_NOTICE "VM: killing process %s\n", tsk->comm);
 	if (user_mode(regs))
 		do_exit(SIGKILL);
 	goto no_context;
diff -urN linux-2.4.19-rc1/arch/mips64/mm/init.c linux-2.4.19-rc2/arch/mips64/mm/init.c
--- linux-2.4.19-rc1/arch/mips64/mm/init.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/init.c	Tue Jul 16 16:25:18 2002
@@ -264,7 +264,7 @@
 	unsigned long codesize, reservedpages, datasize, initsize;
 	unsigned long tmp, ram;
 
-	max_mapnr = num_physpages = max_low_pfn;
+	max_mapnr = num_mappedpages = num_physpages = max_low_pfn;
 	high_memory = (void *) __va(max_mapnr << PAGE_SHIFT);
 
 	totalram_pages += free_all_bootmem();
@@ -282,8 +282,8 @@
 	datasize =  (unsigned long) &_edata - (unsigned long) &_fdata;
 	initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
 
-	printk("Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, "
-	       "%ldk data, %ldk init)\n",
+	printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
+	       "%ldk reserved, %ldk data, %ldk init)\n",
 	       (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
 	       ram << (PAGE_SHIFT-10),
 	       codesize >> 10,
@@ -302,7 +302,8 @@
 		free_page(start);
 		totalram_pages++;
 	}
-	printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
+	printk(KERN_INFO "Freeing initrd memory: %ldk freed\n",
+	       (end - start) >> 10);
 }
 #endif
 
diff -urN linux-2.4.19-rc1/arch/mips64/mm/loadmmu.c linux-2.4.19-rc2/arch/mips64/mm/loadmmu.c
--- linux-2.4.19-rc1/arch/mips64/mm/loadmmu.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/loadmmu.c	Tue Jul 16 16:25:18 2002
@@ -77,19 +77,19 @@
 	case CPU_R5000:
 	case CPU_R5000A:
 	case CPU_NEVADA:
-		printk("Loading R4000 MMU routines.\n");
+		printk(KERN_INFO "Loading R4000 MMU routines.\n");
 		ld_mmu_r4xx0();
 		break;
 #endif
 #ifdef CONFIG_CPU_R10000
 	case CPU_R10000:
-		printk("Loading R10000 MMU routines.\n");
+		printk(KERN_INFO "Loading R10000 MMU routines.\n");
 		ld_mmu_andes();
 		break;
 #endif
 #if defined CONFIG_CPU_SB1
 	case CPU_SB1:
-		printk("Loading SB1 MMU routines.\n");
+		printk(KERN_INFO "Loading SB1 MMU routines.\n");
 		ld_mmu_sb1();
 		sb1_tlb_init();
 		break;
diff -urN linux-2.4.19-rc1/arch/mips64/mm/r4xx0.c linux-2.4.19-rc2/arch/mips64/mm/r4xx0.c
--- linux-2.4.19-rc1/arch/mips64/mm/r4xx0.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/r4xx0.c	Tue Jul 16 16:25:18 2002
@@ -9,6 +9,7 @@
  * Copyright (C) 1997, 1998, 1999, 2000, 2001 Ralf Baechle (ralf@gnu.org)
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -692,83 +693,47 @@
 
 static inline void r4k_flush_cache_all_s16d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache16();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s32d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache32();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s64d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache64();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s128d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16(); blast_scache128();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s32d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32(); blast_scache32();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s64d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32(); blast_scache64();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_s128d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32(); blast_scache128();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_d16i16(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16(); blast_icache16();
-	__restore_flags(flags);
 }
 
 static inline void r4k_flush_cache_all_d32i32(void)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32(); blast_icache32();
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_range_s16d16i16(struct mm_struct *mm,
@@ -776,7 +741,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
 		return;
@@ -795,7 +759,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -805,7 +768,6 @@
 					blast_scache16_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -815,7 +777,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
 		return;
@@ -834,7 +795,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -844,7 +804,6 @@
 					blast_scache32_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -854,7 +813,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
 		return;
@@ -873,7 +831,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -883,7 +840,6 @@
 					blast_scache64_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -893,7 +849,6 @@
 					     unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
 		return;
@@ -912,7 +867,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -922,7 +876,6 @@
 					blast_scache128_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -932,7 +885,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
 		return;
@@ -951,7 +903,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -961,7 +912,6 @@
 					blast_scache32_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -971,7 +921,6 @@
 					    unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (CPU_CONTEXT(smp_processor_id(), mm) == 0)
 		return;
@@ -990,7 +939,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -1000,7 +948,6 @@
 					blast_scache64_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -1010,7 +957,6 @@
 					     unsigned long end)
 {
 	struct vm_area_struct *vma;
-	unsigned long flags;
 
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 0)
 		return;
@@ -1029,7 +975,6 @@
 			pmd_t *pmd;
 			pte_t *pte;
 
-			__save_and_cli(flags);
 			while(start < end) {
 				pgd = pgd_offset(mm, start);
 				pmd = pmd_offset(pgd, start);
@@ -1039,7 +984,6 @@
 					blast_scache128_page(start);
 				start += PAGE_SIZE;
 			}
-			__restore_flags(flags);
 		}
 	}
 }
@@ -1049,14 +993,10 @@
 					 unsigned long end)
 {
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
-		unsigned long flags;
-
 #ifdef DEBUG_CACHE
 		printk("crange[%d,%08lx,%08lx]", (int)mm->context, start, end);
 #endif
-		__save_and_cli(flags);
 		blast_dcache16(); blast_icache16();
-		__restore_flags(flags);
 	}
 }
 
@@ -1065,14 +1005,10 @@
 					 unsigned long end)
 {
 	if (CPU_CONTEXT(smp_processor_id(), mm) != 0) {
-		unsigned long flags;
-
 #ifdef DEBUG_CACHE
 		printk("crange[%d,%08lx,%08lx]", (int)mm->context, start, end);
 #endif
-		__save_and_cli(flags);
 		blast_dcache32(); blast_icache32();
-		__restore_flags(flags);
 	}
 }
 
@@ -1175,7 +1111,6 @@
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1190,7 +1125,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1219,14 +1153,12 @@
 	} else
 		blast_scache16_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s32d16i16(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1241,7 +1173,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1269,14 +1200,12 @@
 	} else
 		blast_scache32_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s64d16i16(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1291,7 +1220,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1320,14 +1248,12 @@
 	} else
 		blast_scache64_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s128d16i16(struct vm_area_struct *vma,
 					    unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1342,7 +1268,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1372,14 +1297,12 @@
 	} else
 		blast_scache128_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s32d32i32(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1394,7 +1317,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1425,14 +1347,12 @@
 	} else
 		blast_scache32_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s64d32i32(struct vm_area_struct *vma,
 					   unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1447,7 +1367,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1478,14 +1397,12 @@
 	} else
 		blast_scache64_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_s128d32i32(struct vm_area_struct *vma,
 					    unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1500,7 +1417,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1529,14 +1445,12 @@
 	} else
 		blast_scache128_page(page);
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_d16i16(struct vm_area_struct *vma,
 					unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1551,7 +1465,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1579,14 +1492,12 @@
 		blast_dcache16_page_indexed(page);
 	}
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_d32i32(struct vm_area_struct *vma,
 					unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1601,7 +1512,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1631,14 +1541,12 @@
 		blast_dcache32_page_indexed(page);
 	}
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_cache_page_d32i32_r4600(struct vm_area_struct *vma,
 					      unsigned long page)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long flags;
 	pgd_t *pgdp;
 	pmd_t *pmdp;
 	pte_t *ptep;
@@ -1653,7 +1561,6 @@
 #ifdef DEBUG_CACHE
 	printk("cpage[%d,%08lx]", (int)mm->context, page);
 #endif
-	__save_and_cli(flags);
 	page &= PAGE_MASK;
 	pgdp = pgd_offset(mm, page);
 	pmdp = pmd_offset(pgdp, page);
@@ -1683,7 +1590,6 @@
 		blast_dcache32_page_indexed(page ^ dcache_waybit);
 	}
 out:
-	__restore_flags(flags);
 }
 
 static void r4k_flush_page_to_ram_s16(struct page *page)
@@ -1708,20 +1614,40 @@
 
 static void r4k_flush_page_to_ram_d16(struct page *page)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache16_page((unsigned long)page_address(page));
-	__restore_flags(flags);
 }
 
 static void r4k_flush_page_to_ram_d32(struct page *page)
 {
-	unsigned long flags;
-
-	__save_and_cli(flags);
 	blast_dcache32_page((unsigned long)page_address(page));
-	__restore_flags(flags);
+}
+
+static void
+r4k_flush_icache_range(unsigned long start, unsigned long end)
+{
+	flush_cache_all();
+}
+
+static void
+r4k_flush_icache_page_s(struct vm_area_struct *vma, struct page *page)
+{
+	/*
+	 * We did an scache flush therefore PI is already clean.
+	 */
+}
+
+/*
+ * Ok, this seriously sucks.  We use them to flush a user page but don't
+ * know the virtual address, so we have to blast away the whole icache
+ * which is significantly more expensive than the real thing.
+ */
+static void
+r4k_flush_icache_page_p(struct vm_area_struct *vma, struct page *page)
+{
+	if (!(vma->vm_flags & VM_EXEC))
+		return;
+
+	flush_cache_all();
 }
 
 /*
@@ -2190,6 +2116,7 @@
 	case 16:
 		_clear_page = r4k_clear_page_d16;
 		_copy_page = r4k_copy_page_d16;
+		_flush_cache_all = r4k_flush_cache_all_d16i16;
 		_flush_cache_l1 = r4k_flush_cache_all_d16i16;
 		_flush_cache_mm = r4k_flush_cache_mm_d16i16;
 		_flush_cache_range = r4k_flush_cache_range_d16i16;
@@ -2207,6 +2134,7 @@
 			_clear_page = r4k_clear_page_d32;
 			_copy_page = r4k_copy_page_d32;
 		}
+		_flush_cache_all = r4k_flush_cache_all_d32i32;
 		_flush_cache_l1 = r4k_flush_cache_all_d32i32;
 		_flush_cache_mm = r4k_flush_cache_mm_d32i32;
 		_flush_cache_range = r4k_flush_cache_range_d32i32;
@@ -2222,7 +2150,7 @@
 		_flush_page_to_ram = r4k_flush_page_to_ram_d32;
 		break;
 	}
-
+	_flush_icache_page = r4k_flush_icache_page_p;
 	_dma_cache_wback_inv = r4k_dma_cache_wback_inv_pc;
 	_dma_cache_wback = r4k_dma_cache_wback;
 	_dma_cache_inv = r4k_dma_cache_inv_pc;
@@ -2234,6 +2162,7 @@
 	case 16:
 		switch(dc_lsize) {
 		case 16:
+			_flush_cache_all = r4k_flush_cache_all_s16d16i16;
 			_flush_cache_l1 = r4k_flush_cache_all_s16d16i16;
 			_flush_cache_mm = r4k_flush_cache_mm_s16d16i16;
 			_flush_cache_range = r4k_flush_cache_range_s16d16i16;
@@ -2249,12 +2178,14 @@
 	case 32:
 		switch(dc_lsize) {
 		case 16:
+			_flush_cache_all = r4k_flush_cache_all_s32d16i16;
 			_flush_cache_l1 = r4k_flush_cache_all_s32d16i16;
 			_flush_cache_mm = r4k_flush_cache_mm_s32d16i16;
 			_flush_cache_range = r4k_flush_cache_range_s32d16i16;
 			_flush_cache_page = r4k_flush_cache_page_s32d16i16;
 			break;
 		case 32:
+			_flush_cache_all = r4k_flush_cache_all_s32d32i32;
 			_flush_cache_l1 = r4k_flush_cache_all_s32d32i32;
 			_flush_cache_mm = r4k_flush_cache_mm_s32d32i32;
 			_flush_cache_range = r4k_flush_cache_range_s32d32i32;
@@ -2268,12 +2199,14 @@
 	case 64:
 		switch(dc_lsize) {
 		case 16:
+			_flush_cache_all = r4k_flush_cache_all_s64d16i16;
 			_flush_cache_l1 = r4k_flush_cache_all_s64d16i16;
 			_flush_cache_mm = r4k_flush_cache_mm_s64d16i16;
 			_flush_cache_range = r4k_flush_cache_range_s64d16i16;
 			_flush_cache_page = r4k_flush_cache_page_s64d16i16;
 			break;
 		case 32:
+			_flush_cache_all = r4k_flush_cache_all_s64d32i32;
 			_flush_cache_l1 = r4k_flush_cache_all_s64d32i32;
 			_flush_cache_mm = r4k_flush_cache_mm_s64d32i32;
 			_flush_cache_range = r4k_flush_cache_range_s64d32i32;
@@ -2287,12 +2220,14 @@
 	case 128:
 		switch(dc_lsize) {
 		case 16:
+			_flush_cache_all = r4k_flush_cache_all_s128d16i16;
 			_flush_cache_l1 = r4k_flush_cache_all_s128d16i16;
 			_flush_cache_mm = r4k_flush_cache_mm_s128d16i16;
 			_flush_cache_range = r4k_flush_cache_range_s128d16i16;
 			_flush_cache_page = r4k_flush_cache_page_s128d16i16;
 			break;
 		case 32:
+			_flush_cache_all = r4k_flush_cache_all_s128d32i32;
 			_flush_cache_l1 = r4k_flush_cache_all_s128d32i32;
 			_flush_cache_mm = r4k_flush_cache_mm_s128d32i32;
 			_flush_cache_range = r4k_flush_cache_range_s128d32i32;
@@ -2304,6 +2239,7 @@
 		_copy_page = r4k_copy_page_s128;
 		break;
 	}
+	_flush_icache_page = r4k_flush_icache_page_s;
 	_dma_cache_wback_inv = r4k_dma_cache_wback_inv_sc;
 	_dma_cache_wback = r4k_dma_cache_wback;
 	_dma_cache_inv = r4k_dma_cache_inv_sc;
@@ -2332,8 +2268,6 @@
 {
 	unsigned long config = read_32bit_cp0_register(CP0_CONFIG);
 
-	printk("CPU revision is: %08x\n", read_32bit_cp0_register(CP0_PRID));
-
 #ifdef CONFIG_MIPS_UNCACHED
 	change_cp0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
 #else
@@ -2356,6 +2290,7 @@
 	if ((read_32bit_cp0_register(CP0_PRID) & 0xfff0) == 0x2020) {
 		_flush_cache_sigtramp = r4600v20k_flush_cache_sigtramp;
 	}
+	_flush_icache_range = r4k_flush_icache_range;	/* Ouch */
 
 	_flush_cache_l2 = r4k_flush_cache_l2;
 
diff -urN linux-2.4.19-rc1/arch/mips64/mm/tlb-glue-r4k.S linux-2.4.19-rc2/arch/mips64/mm/tlb-glue-r4k.S
--- linux-2.4.19-rc1/arch/mips64/mm/tlb-glue-r4k.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/tlb-glue-r4k.S	Tue Jul 16 16:25:18 2002
@@ -6,7 +6,6 @@
  * Copyright (C) 1999 Ralf Baechle
  * Copyright (C) 1999 Silicon Graphics, Inc.
  */
-#define __ASSEMBLY__
 #include <linux/init.h>
 #include <asm/mipsregs.h>
 #include <asm/regdef.h>
diff -urN linux-2.4.19-rc1/arch/mips64/mm/tlb-sb1.c linux-2.4.19-rc2/arch/mips64/mm/tlb-sb1.c
--- linux-2.4.19-rc1/arch/mips64/mm/tlb-sb1.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/tlb-sb1.c	Tue Jul 16 16:25:18 2002
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */ 
+#include <linux/config.h>
 #include <asm/mmu_context.h>
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
@@ -67,7 +68,7 @@
 	       "--------------------------------------------------------------------\n");
 	dump_cur_tlb_regs();
 	printk(" %08X\n", read_32bit_cp0_register(CP0_INDEX));
-	printk("\n\nFull TLB Dump:"
+	printk("\n\nFull TLB Dump:\n"
 	       "Idx      EntryHi       EntryLo0          EntryLo1     PageMask\n"
 	       "--------------------------------------------------------------\n");
 	for (entry = 0; entry < mips_cpu.tlbsize; entry++) {
diff -urN linux-2.4.19-rc1/arch/mips64/mm/tlbex-r4k.S linux-2.4.19-rc2/arch/mips64/mm/tlbex-r4k.S
--- linux-2.4.19-rc1/arch/mips64/mm/tlbex-r4k.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/mm/tlbex-r4k.S	Tue Jul 16 16:25:18 2002
@@ -6,7 +6,6 @@
  * Copyright (C) 2000 Silicon Graphics, Inc.
  * Written by Ulf Carlsson (ulfc@engr.sgi.com)
  */
-#define __ASSEMBLY__
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/threads.h>
@@ -26,17 +25,16 @@
 
 	.macro	LOAD_PTE2, ptr, tmp
 #ifdef CONFIG_SMP
-	dmfc0	\tmp, CP0_CONTEXT
-	dla	\ptr, pgd_current
-	dsrl	\tmp, 23
-	daddu	\ptr, \tmp
+	dmfc0	\ptr, CP0_CONTEXT
+	dmfc0	\tmp, CP0_BADVADDR
+	dsra	\ptr, 23			# get pgd_current[cpu]
 #else
+	dmfc0	\tmp, CP0_BADVADDR
 	dla	\ptr, pgd_current
 #endif
-	dmfc0	\tmp, CP0_BADVADDR
-	ld	\ptr, (\ptr)
 	bltz	\tmp, kaddr
-	 dsrl	\tmp, (PGDIR_SHIFT-3)		# get pgd offset in bytes
+	ld	\ptr, (\ptr)
+	dsrl	\tmp, (PGDIR_SHIFT-3)		# get pgd offset in bytes
 	andi	\tmp, ((PTRS_PER_PGD - 1)<<3)
 	daddu	\ptr, \tmp			# add in pgd offset
 	dmfc0	\tmp, CP0_BADVADDR
diff -urN linux-2.4.19-rc1/arch/mips64/sgi-ip27/Makefile linux-2.4.19-rc2/arch/mips64/sgi-ip27/Makefile
--- linux-2.4.19-rc1/arch/mips64/sgi-ip27/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/sgi-ip27/Makefile	Tue Jul 16 16:25:18 2002
@@ -2,18 +2,14 @@
 # Makefile for the IP27 specific kernel interface routines under Linux.
 #
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET = ip27.o
 
 export-objs		= ip27-rtc.o
 
-obj-y	:= ip27-berr.o ip27-console.o ip27-dbe-glue.o ip27-irq.o ip27-init.o \
-	   ip27-irq-glue.o ip27-klconfig.o ip27-klnuma.o ip27-memory.o \
-	   ip27-nmi.o ip27-pci.o ip27-pci-dma.o ip27-reset.o ip27-setup.o \
-	   ip27-timer.o
+obj-y	:= ip27-berr.o ip27-console.o ip27-irq.o ip27-init.o ip27-irq-glue.o \
+	   ip27-klconfig.o ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-pci.o \
+	   ip27-pci-dma.o ip27-reset.o ip27-setup.o ip27-timer.o
 
 include $(TOPDIR)/Rules.make
diff -urN linux-2.4.19-rc1/arch/mips64/sgi-ip27/ip27-berr.c linux-2.4.19-rc2/arch/mips64/sgi-ip27/ip27-berr.c
--- linux-2.4.19-rc1/arch/mips64/sgi-ip27/ip27-berr.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/sgi-ip27/ip27-berr.c	Tue Jul 16 16:25:18 2002
@@ -5,6 +5,7 @@
  *
  * Copyright (C) 1994, 1995, 1996, 1999, 2000 by Ralf Baechle
  * Copyright (C) 1999, 2000 by Silicon Graphics
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -14,24 +15,12 @@
 #include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/sn0/hub.h>
+#include <asm/traps.h>
 #include <asm/uaccess.h>
-#include <asm/paccess.h>
 
 extern void dump_tlb_addr(unsigned long addr);
 extern void dump_tlb_all(void);
 
-extern asmlinkage void handle_ip27_ibe(void);
-extern asmlinkage void handle_ip27_dbe(void);
-
-void do_ip27_ibe(struct pt_regs *regs)
-{
-	printk("Got ibe at 0x%lx\n", regs->cp0_epc);
-	show_regs(regs);
-	dump_tlb_addr(regs->cp0_epc);
-	force_sig(SIGBUS, current);
-	while(1);
-}
-
 static void dump_hub_information(unsigned long errst0, unsigned long errst1)
 {
 	static char *err_type[2][8] = {
@@ -65,21 +54,17 @@
 		? : "invalid");
 }
 
-void do_ip27_dbe(struct pt_regs *regs)
+int be_ip27_handler(struct pt_regs *regs, int is_fixup)
 {
-	unsigned long fixup, errst0, errst1;
+	unsigned long errst0, errst1;
+	int data = regs->cp0_cause & 4;
 	int cpu = LOCAL_HUB_L(PI_CPU_NUM);
 
-	fixup = search_dbe_table(regs->cp0_epc);
-	if (fixup) {
-		long new_epc;
-
-		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
-		regs->cp0_epc = new_epc;
-		return;
-	}
+	if (is_fixup)
+		return MIPS_BE_FIXUP;
 
-	printk("Slice %c got dbe at 0x%lx\n", 'A' + cpu, regs->cp0_epc);
+	printk("Slice %c got %cbe at 0x%lx\n", 'A' + cpu, data ? 'd' : 'i',
+	       regs->cp0_epc);
 	printk("Hub information:\n");
 	printk("ERR_INT_PEND = 0x%06lx\n", LOCAL_HUB_L(PI_ERR_INT_PEND));
 	errst0 = LOCAL_HUB_L(cpu ? PI_ERR_STATUS0_B : PI_ERR_STATUS0_A);
@@ -97,8 +82,7 @@
 	int cpu = LOCAL_HUB_L(PI_CPU_NUM);
 	int cpuoff = cpu << 8;
 
-	set_except_vector(6, handle_ip27_ibe);
-	set_except_vector(7, handle_ip27_dbe);
+	be_board_handler = be_ip27_handler;
 
 	LOCAL_HUB_S(PI_ERR_INT_PEND,
 	            cpu ? PI_ERR_CLEAR_ALL_B : PI_ERR_CLEAR_ALL_A);
diff -urN linux-2.4.19-rc1/arch/mips64/sgi-ip32/Makefile linux-2.4.19-rc2/arch/mips64/sgi-ip32/Makefile
--- linux-2.4.19-rc1/arch/mips64/sgi-ip32/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/sgi-ip32/Makefile	Tue Jul 16 16:25:18 2002
@@ -8,17 +8,14 @@
 #
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 O_TARGET := ip32-kern.a
 
 all: ip32-kern.a ip32-irq-glue.o
 
-obj-y	+= ip32-rtc.o ip32-setup.o ip32-irq.o ip32-irq-glue.o ip32-timer.o \
-	   crime.o ip32-reset.o
+obj-y	+= ip32-berr.o ip32-rtc.o ip32-setup.o ip32-irq.o ip32-irq-glue.o \
+	   ip32-timer.o crime.o ip32-reset.o
 
 obj-$(CONFIG_PCI)   += ip32-pci.o
 
diff -urN linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-berr.c linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-berr.c
--- linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-berr.c	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-berr.c	Tue Jul 16 16:25:18 2002
@@ -5,78 +5,24 @@
  *
  * Copyright (C) 1994, 1995, 1996, 1999, 2000 by Ralf Baechle
  * Copyright (C) 1999, 2000 by Silicon Graphics
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <asm/traps.h>
 #include <asm/uaccess.h>
-#include <asm/paccess.h>
 #include <asm/addrspace.h>
 #include <asm/ptrace.h>
 
-/* XXX I have no idea what this does --kmw */
-
-extern asmlinkage void handle_ibe(void);
-extern asmlinkage void handle_dbe(void);
-
-extern const struct exception_table_entry __start___dbe_table[];
-extern const struct exception_table_entry __stop___dbe_table[];
-
-static inline unsigned long
-search_one_table(const struct exception_table_entry *first,
-                 const struct exception_table_entry *last,
-                 unsigned long value)
+int
+be_ip32_handler(struct pt_regs *regs, int is_fixup)
 {
-	while (first <= last) {
-		const struct exception_table_entry *mid;
-		long diff;
+	int data = regs->cp0_cause & 4;
 
-		mid = (last - first) / 2 + first;
-		diff = mid->insn - value;
-		if (diff == 0)
-			return mid->nextinsn;
-		else if (diff < 0)
-			first = mid+1;
-		else
-			last = mid-1;
-	}
-	return 0;
-}
-
-static inline unsigned long
-search_dbe_table(unsigned long addr)
-{
-	unsigned long ret;
+	if (is_fixup)
+		return MIPS_BE_FIXUP;
 
-	/* There is only the kernel to search.  */
-	ret = search_one_table(__start___dbe_table, __stop___dbe_table-1, addr);
-	if (ret) return ret;
-
-	return 0;
-}
-
-void do_ibe(struct pt_regs *regs)
-{
-	printk("Got ibe at 0x%lx\n", regs->cp0_epc);
-	show_regs(regs);
-	dump_tlb_addr(regs->cp0_epc);
-	force_sig(SIGBUS, current);
-	while(1);
-}
-
-void do_dbe(struct pt_regs *regs)
-{
-	unsigned long fixup;
-
-	fixup = search_dbe_table(regs->cp0_epc);
-	if (fixup) {
-		long new_epc;
-
-		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
-		regs->cp0_epc = new_epc;
-		return;
-	}
-
-	printk("Got dbe at 0x%lx\n", regs->cp0_epc);
+	printk("Got %cbe at 0x%lx\n", data ? 'd' : 'i', regs->cp0_epc);
 	show_regs(regs);
 	dump_tlb_all();
 	while(1);
@@ -86,12 +32,5 @@
 void __init
 bus_error_init(void)
 {
-	int dummy;
-
-	set_except_vector(6, handle_ibe);
-	set_except_vector(7, handle_dbe);
-
-	/* At this time nothing uses the DBE protection mechanism on the
-	   O2, so this here is needed to make the kernel link.  */
-	get_dbe(dummy, (int *)KSEG0);
+	be_board_handler = be_ip27_handler;
 }
diff -urN linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-pci.c linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-pci.c
--- linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-pci.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-pci.c	Tue Jul 16 16:25:18 2002
@@ -5,7 +5,6 @@
  *
  * Copyright (C) 2000, 2001 Keith M Wesolowski
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/pci.h>
diff -urN linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-setup.c linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-setup.c
--- linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-setup.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-setup.c	Tue Jul 16 16:25:18 2002
@@ -7,6 +7,7 @@
  *
  * Copyright (C) 2000 Harald Koerfgen
  */
+#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/mc146818rtc.h>
@@ -59,10 +60,6 @@
 
 extern void ip32_time_init(void);
 
-void __init bus_error_init(void)
-{
-}
-
 void __init ip32_setup(void)
 {
 #ifdef CONFIG_SERIAL_CONSOLE
diff -urN linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-timer.c linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-timer.c
--- linux-2.4.19-rc1/arch/mips64/sgi-ip32/ip32-timer.c	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/sgi-ip32/ip32-timer.c	Tue Jul 16 16:25:18 2002
@@ -9,7 +9,6 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/param.h>
diff -urN linux-2.4.19-rc1/arch/mips64/tools/Makefile linux-2.4.19-rc2/arch/mips64/tools/Makefile
--- linux-2.4.19-rc1/arch/mips64/tools/Makefile	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/mips64/tools/Makefile	Tue Jul 16 16:25:18 2002
@@ -7,10 +7,7 @@
 #
 TARGET	:= $(TOPDIR)/include/asm-$(ARCH)/offset.h
 
-.S.s:
-	$(CPP) $(CFLAGS) $< -o $*.s
-.S.o:
-	$(CC) $(CFLAGS) -c $< -o $*.o
+USE_STANDARD_AS_RULE := true
 
 $(TARGET): offset.h
 	cmp -s $^ $@ || (cp $^ $(TARGET).new && mv $(TARGET).new $(TARGET))
diff -urN linux-2.4.19-rc1/arch/ppc/kernel/head.S linux-2.4.19-rc2/arch/ppc/kernel/head.S
--- linux-2.4.19-rc1/arch/ppc/kernel/head.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/ppc/kernel/head.S	Tue Jul 16 16:25:18 2002
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.head.S 1.39 05/06/02 01:37:30 benh
+ * BK Id: SCCS/s.head.S 1.43 06/25/02 17:24:29 benh
  */
 /*
  *  PowerPC version 
@@ -325,11 +325,13 @@
 	EXCEPTION_PROLOG
 #endif /* CONFIG_PPC64BRIDGE */
 	mfspr	r20,DSISR
+BEGIN_FTR_SECTION
 	andis.	r0,r20,0xa470		/* weird error? */
 	bne	1f			/* if not, try to put a PTE */
 	mfspr	r4,DAR			/* into the hash table */
 	rlwinm	r3,r20,32-15,21,21	/* DSISR_STORE -> _PAGE_RW */
 	bl	hash_page
+END_FTR_SECTION_IFSET(CPU_FTR_HPTE_TABLE)
 1:	stw	r20,_DSISR(r21)
 	mr	r5,r20
 	mfspr	r4,DAR
@@ -366,11 +368,13 @@
 InstructionAccess:
 	EXCEPTION_PROLOG
 #endif /* CONFIG_PPC64BRIDGE */
+BEGIN_FTR_SECTION
 	andis.	r0,r23,0x4000		/* no pte found? */
 	beq	1f			/* if so, try to put a PTE */
 	li	r3,0			/* into the hash table */
 	mr	r4,r22			/* SRR0 is fault address */
 	bl	hash_page
+END_FTR_SECTION_IFSET(CPU_FTR_HPTE_TABLE)
 1:	addi	r3,r1,STACK_FRAME_OVERHEAD
 	mr	r4,r22
 	mr	r5,r23
diff -urN linux-2.4.19-rc1/arch/ppc/kernel/misc.S linux-2.4.19-rc2/arch/ppc/kernel/misc.S
--- linux-2.4.19-rc1/arch/ppc/kernel/misc.S	Tue Jul 16 16:25:13 2002
+++ linux-2.4.19-rc2/arch/ppc/kernel/misc.S	Tue Jul 16 16:25:18 2002
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.misc.S 1.41 04/09/02 21:01:58 paulus
+ * BK Id: SCCS/s.misc.S 1.44 06/25/02 17:24:30 benh
  */
 /*
  * This file contains miscellaneous low-level functions.
@@ -363,20 +363,15 @@
 	stwcx.	r8,0,r9
 	bne-	10b
 #endif /* CONFIG_SMP */
-	sync
+	isync
 	tlbia
-#ifdef CONFIG_SMP
-BEGIN_FTR_SECTION
-	DSSALL
-END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 	sync
+#ifdef CONFIG_SMP
 	TLBSYNC
 	li	r0,0
 	stw	r0,0(r9)		/* clear hash_table_lock */
 	mtmsr	r10
 	SYNC
-#else /* CONFIG_SMP */
-	sync
 #endif /* CONFIG_SMP */
 	blr	
 
@@ -399,8 +394,8 @@
 	bne-	10b
 	stwcx.	r8,0,r9
 	bne-	10b
-	eieio
 #endif /* CONFIG_SMP */
+	isync
 	tlbie	r3
 	sync
 #ifdef CONFIG_SMP
diff -urN linux-2.4.19-rc1/arch/ppc/mm/ppc_mmu.c linux-2.4.19-rc2/arch/ppc/mm/ppc_mmu.c
--- linux-2.4.19-rc1/arch/ppc/mm/ppc_mmu.c	Mon Feb 25 11:37:55 2002
+++ linux-2.4.19-rc2/arch/ppc/mm/ppc_mmu.c	Tue Jul 16 16:25:18 2002
@@ -163,7 +163,6 @@
 
 	extern unsigned int hash_page_patch_A[];
 	extern unsigned int hash_page_patch_B[], hash_page_patch_C[];
-	extern unsigned int hash_page[];
 	extern unsigned int flush_hash_patch_A[], flush_hash_patch_B[];
 
 #ifdef CONFIG_PPC64BRIDGE
@@ -184,9 +183,15 @@
 #else /* CONFIG_PPC64BRIDGE */
 	unsigned int h;
 
-	if ((cur_cpu_spec[0]->cpu_features & CPU_FTR_HPTE_TABLE) == 0)
+	if ((cur_cpu_spec[0]->cpu_features & CPU_FTR_HPTE_TABLE) == 0) {
+		Hash_size = 0;
+		Hash_end = 0;
+		Hash = 0;
 		return;
+	}
+
 	if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
+
 	/*
 	 * Allow 64k of hash table for every 16MB of memory,
 	 * up to a maximum of 2MB.
@@ -252,18 +257,7 @@
 		flush_icache_range((unsigned long) &flush_hash_patch_A[0],
 				   (unsigned long) &flush_hash_patch_B[1]);
 	}
-	else {
-		Hash_end = 0;
-		/*
-		 * Put a blr (procedure return) instruction at the
-		 * start of hash_page, since we can still get DSI
-		 * exceptions on a 603.
-		 */
-		hash_page[0] = 0x4e800020;
-		flush_icache_range((unsigned long) &hash_page[0],
-				   (unsigned long) &hash_page[1]);
-	}
-
+	
 	if ( ppc_md.progress ) ppc_md.progress("hash:done", 0x205);
 }
 
diff -urN linux-2.4.19-rc1/arch/s390/kernel/entry.S linux-2.4.19-rc2/arch/s390/kernel/entry.S
--- linux-2.4.19-rc1/arch/s390/kernel/entry.S	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/arch/s390/kernel/entry.S	Tue Jul 16 16:25:19 2002
@@ -556,8 +556,8 @@
         .long  sys_madvise
 	.long  sys_getdents64		 /* 220 */
         .long  sys_fcntl64 
-	.long  sys_ni_syscall		 /* 222 - reserved for gettid */
-	.long  sys_ni_syscall		 /* 223 - reserved for tkill */
+	.long  sys_ni_syscall
+	.long  sys_ni_syscall
 	.long  sys_ni_syscall		 /* 224 - reserved for setxattr  */
 	.long  sys_ni_syscall            /* 225 - reserved for lsetxattr */
 	.long  sys_ni_syscall		 /* 226 - reserved for fsetxattr */
@@ -570,10 +570,10 @@
 	.long  sys_ni_syscall		 /* 233 - reserved for removexattr */
 	.long  sys_ni_syscall		 /* 234 - reserved for lremovexattr */
 	.long  sys_ni_syscall		 /* 235 - reserved for fremovexattr */
-	.rept  255-235
+	.long  sys_gettid
+	.long  sys_tkill
+	.rept  255-237
 	.long  sys_ni_syscall
-	.long  sys_gettid		/* 226 */
-	.long  sys_tkill		/* 227 */
 	.endr
 
 /*
diff -urN linux-2.4.19-rc1/arch/s390/mm/fault.c linux-2.4.19-rc2/arch/s390/mm/fault.c
--- linux-2.4.19-rc1/arch/s390/mm/fault.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/arch/s390/mm/fault.c	Tue Jul 16 16:25:19 2002
@@ -222,6 +222,9 @@
 		/* page not present, check vm flags */
 		if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
 			goto bad_area;
+	} else {
+		if (!(vma->vm_flags & VM_WRITE))
+			goto bad_area;
 	}
 
 survive:
diff -urN linux-2.4.19-rc1/arch/s390x/kernel/entry.S linux-2.4.19-rc2/arch/s390x/kernel/entry.S
--- linux-2.4.19-rc1/arch/s390x/kernel/entry.S	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/arch/s390x/kernel/entry.S	Tue Jul 16 16:25:19 2002
@@ -589,8 +589,8 @@
         .long  SYSCALL(sys_madvise,sys32_madvise_wrapper)
 	.long  SYSCALL(sys_getdents64,sys32_getdents64_wrapper)/* 220 */
 	.long  SYSCALL(sys_ni_syscall,sys32_fcntl64_wrapper)
-	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 222 - reserved for gettid */
-	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 223 - reserved for tkill */
+	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall)
+	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall)
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 224 - reserved for setxattr  */
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 225 - reserved for lsetxattr */
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 226 - reserved for fsetxattr */
@@ -603,10 +603,10 @@
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 233 - reserved for removexattr */
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 234 - reserved for lremovexattr */
 	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* 235 - reserved for fremovexattr */
-	.rept  255-235
-	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall)
 	.long  SYSCALL(sys_gettid,sys_gettid)
 	.long  SYSCALL(sys_tkill,sys_tkill)
+	.rept  255-237
+	.long  SYSCALL(sys_ni_syscall,sys_ni_syscall)
 	.endr
 
 /*
diff -urN linux-2.4.19-rc1/arch/s390x/mm/fault.c linux-2.4.19-rc2/arch/s390x/mm/fault.c
--- linux-2.4.19-rc1/arch/s390x/mm/fault.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/arch/s390x/mm/fault.c	Tue Jul 16 16:25:19 2002
@@ -222,6 +222,9 @@
 		/* page not present, check vm flags */
 		if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
 			goto bad_area;
+	} else {
+		if (!(vma->vm_flags & VM_WRITE))
+			goto bad_area;
 	}
 
 survive:
diff -urN linux-2.4.19-rc1/drivers/block/cpqarray.c linux-2.4.19-rc2/drivers/block/cpqarray.c
--- linux-2.4.19-rc1/drivers/block/cpqarray.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/block/cpqarray.c	Tue Jul 16 16:25:19 2002
@@ -602,7 +602,7 @@
 static struct pci_driver cpqarray_pci_driver = {
         name:   "cpqarray",
         probe:  cpqarray_init_one,
-        remove:  cpqarray_remove_one,
+        remove:  __devexit_p(cpqarray_remove_one),
         id_table:  cpqarray_pci_device_id,
 };
 
diff -urN linux-2.4.19-rc1/drivers/block/genhd.c linux-2.4.19-rc2/drivers/block/genhd.c
--- linux-2.4.19-rc1/drivers/block/genhd.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/block/genhd.c	Tue Jul 16 16:25:19 2002
@@ -163,10 +163,7 @@
 	char buf[64];
 	int len, n;
 
-	len = sprintf(page, "major minor  #blocks  name     "
-			"rio rmerge rsect ruse wio wmerge "
-			"wsect wuse running use aveq\n\n");
-		
+	len = sprintf(page, "major minor  #blocks  name\n\n");
 		
 	read_lock(&gendisk_lock);
 	for (gp = gendisk_head; gp; gp = gp->next) {
@@ -176,21 +173,8 @@
 
 			hd = &gp->part[n]; disk_round_stats(hd);
 			len += sprintf(page + len,
-					"%4d  %4d %10d %s "
-					"%d %d %d %d %d %d %d %d %d %d %d\n",
-					gp->major, n, gp->sizes[n],
-					disk_name(gp, n, buf),
-					hd->rd_ios, hd->rd_merges,
-					hd->rd_sectors,
-#define MSEC(x) ((x) * 1000 / HZ)
-					MSEC(hd->rd_ticks),
-					hd->wr_ios, hd->wr_merges,
-					hd->wr_sectors,
-					MSEC(hd->wr_ticks),
-					hd->ios_in_flight,
-					MSEC(hd->io_ticks),
-					MSEC(hd->aveq));
-#undef MSEC
+				"%4d  %4d %10d %s\n", gp->major,
+				n, gp->sizes[n], disk_name(gp, n, buf));
 
 			if (len < offset)
 				offset -= len, len = 0;
diff -urN linux-2.4.19-rc1/drivers/char/agp/agpgart_be.c linux-2.4.19-rc2/drivers/char/agp/agpgart_be.c
--- linux-2.4.19-rc1/drivers/char/agp/agpgart_be.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/char/agp/agpgart_be.c	Tue Jul 16 16:25:19 2002
@@ -1402,6 +1402,12 @@
 	aper_size_info_8 *values;
 
 	pci_read_config_byte(agp_bridge.dev, INTEL_APSIZE, &temp);
+
+        /* Intel 815 chipsets have a _weird_ APSIZE register with only
+         * one non-reserved bit, so mask the others out ... */
+        if (agp_bridge.type == INTEL_I815) 
+          temp &= (1 << 3);
+        
 	values = A_SIZE_8(agp_bridge.aperture_sizes);
 
 	for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {
diff -urN linux-2.4.19-rc1/drivers/char/drm/radeon_state.c linux-2.4.19-rc2/drivers/char/drm/radeon_state.c
--- linux-2.4.19-rc1/drivers/char/drm/radeon_state.c	Wed Aug  8 09:42:15 2001
+++ linux-2.4.19-rc2/drivers/char/drm/radeon_state.c	Tue Jul 16 16:25:19 2002
@@ -1058,7 +1058,7 @@
 			DRM_ERROR( "EFAULT on tex->image\n" );
 			return -EFAULT;
 		}
-	} else if ( size < 4 ) {
+	} else if ( size < 4 && size > 0 ) {
 		size = 4;
 	}
 
diff -urN linux-2.4.19-rc1/drivers/char/ppdev.c linux-2.4.19-rc2/drivers/char/ppdev.c
--- linux-2.4.19-rc1/drivers/char/ppdev.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/char/ppdev.c	Tue Jul 16 16:25:19 2002
@@ -118,6 +118,10 @@
 		return -EINVAL;
 	}
 
+	/* Trivial case. */
+	if (count == 0)
+		return 0;
+
 	kbuffer = kmalloc(min_t(size_t, count, PP_BUFFER_SIZE), GFP_KERNEL);
 	if (!kbuffer) {
 		return -ENOMEM;
diff -urN linux-2.4.19-rc1/drivers/i2c/i2c-keywest.c linux-2.4.19-rc2/drivers/i2c/i2c-keywest.c
--- linux-2.4.19-rc1/drivers/i2c/i2c-keywest.c	Mon Feb 25 11:37:57 2002
+++ linux-2.4.19-rc2/drivers/i2c/i2c-keywest.c	Tue Jul 16 16:25:19 2002
@@ -434,7 +434,7 @@
 			u8 isr = wait_interrupt(iface);
 			handle_interrupt(iface, isr);
 		}
-#else /* POLLED_MODE */88
+#else /* POLLED_MODE */
 		DBG("using interrupt mode...\n");
 		wait_for_completion(&iface->complete);	
 #endif /* POLLED_MODE */	
diff -urN linux-2.4.19-rc1/drivers/ide/ide-features.c linux-2.4.19-rc2/drivers/ide/ide-features.c
--- linux-2.4.19-rc1/drivers/ide/ide-features.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ide/ide-features.c	Tue Jul 16 16:25:19 2002
@@ -245,6 +245,9 @@
  */
 byte eighty_ninty_three (ide_drive_t *drive)
 {
+	if (HWIF(drive)->pci_devid.vid==0x105a)
+	    return(HWIF(drive)->udma_four);
+	/* PDC202XX: that's because some HDD will return wrong info */
 	return ((byte) ((HWIF(drive)->udma_four) &&
 #ifndef CONFIG_IDEDMA_IVB
 			(drive->id->hw_config & 0x4000) &&
diff -urN linux-2.4.19-rc1/drivers/ide/ide-pci.c linux-2.4.19-rc2/drivers/ide/ide-pci.c
--- linux-2.4.19-rc1/drivers/ide/ide-pci.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ide/ide-pci.c	Tue Jul 16 16:25:19 2002
@@ -12,13 +12,6 @@
  *  configuration of all PCI IDE interfaces present in a system.  
  */
 
-/*
- * Chipsets that are on the IDE_IGNORE list because of problems of not being
- * set at compile time.
- *
- * CONFIG_BLK_DEV_PDC202XX
- */
-
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -56,7 +49,7 @@
 #define DEVID_PDC20265	((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20265})
 #define DEVID_PDC20267	((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20267})
 #define DEVID_PDC20268  ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20268})
-#define DEVID_PDC20268R ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20268R})
+#define DEVID_PDC20270  ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20270})
 #define DEVID_PDC20269	((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20269})
 #define DEVID_PDC20275	((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20275})
 #define DEVID_PDC20276	((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20276})
@@ -257,9 +250,9 @@
 #define ATA66_PDC202XX	&ata66_pdc202xx
 #define INIT_PDC202XX	&ide_init_pdc202xx
 #else
-#define PCI_PDC202XX	IDE_IGNORE
-#define ATA66_PDC202XX	IDE_IGNORE
-#define INIT_PDC202XX	IDE_IGNORE
+#define PCI_PDC202XX	NULL
+#define ATA66_PDC202XX	NULL
+#define INIT_PDC202XX	NULL
 #endif
 
 #ifdef CONFIG_BLK_DEV_PIIX
@@ -424,7 +417,7 @@
 	/* Promise used a different PCI ident for the raid card apparently to try and
 	   prevent Linux detecting it and using our own raid code. We want to detect
 	   it for the ataraid drivers, so we have to list both here.. */
-	{DEVID_PDC20268R,"PDC20270",	PCI_PDC202XX,	ATA66_PDC202XX,	INIT_PDC202XX,	NULL,		{{0x00,0x00,0x00}, {0x00,0x00,0x00}},	OFF_BOARD,	0 },
+	{DEVID_PDC20270,"PDC20270",	PCI_PDC202XX,	ATA66_PDC202XX,	INIT_PDC202XX,	NULL,		{{0x00,0x00,0x00}, {0x00,0x00,0x00}},	OFF_BOARD,	0 },
 	{DEVID_PDC20269,"PDC20269",	PCI_PDC202XX,	ATA66_PDC202XX,	 INIT_PDC202XX,	NULL,		{{0x00,0x00,0x00}, {0x00,0x00,0x00}},	OFF_BOARD,	0 },
 	{DEVID_PDC20275,"PDC20275",	PCI_PDC202XX,	ATA66_PDC202XX,	INIT_PDC202XX,	NULL,		{{0x00,0x00,0x00}, {0x00,0x00,0x00}},	OFF_BOARD,	0 },
 	{DEVID_PDC20276,"PDC20276",	PCI_PDC202XX,	ATA66_PDC202XX,	INIT_PDC202XX,	NULL,		{{0x00,0x00,0x00}, {0x00,0x00,0x00}},	OFF_BOARD,	0 },
@@ -486,7 +479,7 @@
 		case PCI_DEVICE_ID_PROMISE_20265:
 		case PCI_DEVICE_ID_PROMISE_20267:
 		case PCI_DEVICE_ID_PROMISE_20268:
-		case PCI_DEVICE_ID_PROMISE_20268R:
+		case PCI_DEVICE_ID_PROMISE_20270:
 		case PCI_DEVICE_ID_PROMISE_20269:
 		case PCI_DEVICE_ID_PROMISE_20275:
 		case PCI_DEVICE_ID_PROMISE_20276:
@@ -676,25 +669,18 @@
 	 */
 	pciirq = dev->irq;
 	
-	if (dev->class >> 8 == PCI_CLASS_STORAGE_RAID)
-	{
-		/* By rights we want to ignore these, but the Promise Fastrak
-		   people have some strange ideas about proprietary so we have
-		   to act otherwise on those. The supertrak however we need
-		   to skip */
-		if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20265))
-		{
-			printk(KERN_INFO "ide: Found promise 20265 in RAID mode.\n");
-			if(dev->bus->self && dev->bus->self->vendor == PCI_VENDOR_ID_INTEL &&
-				dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960)
-			{
-				printk(KERN_INFO "ide: Skipping Promise PDC20265 attached to I2O RAID controller.\n");
-				return;
-			}
+#ifdef CONFIG_PDC202XX_FORCE
+	if (dev->class >> 8 == PCI_CLASS_STORAGE_RAID) {
+		/*
+		 * By rights we want to ignore Promise FastTrak and SuperTrak
+		 * series here, those use own driver.
+		 */
+		if (dev->vendor == PCI_VENDOR_ID_PROMISE) {
+			printk(KERN_INFO "ide: Skipping Promise RAID controller.\n");
+			return;
 		}
-		/* Its attached to something else, just a random bridge. 
-		   Suspect a fastrak and fall through */
 	}
+#endif /* CONFIG_PDC202XX_FORCE */
 	if ((dev->class & ~(0xfa)) != ((PCI_CLASS_STORAGE_IDE << 8) | 5)) {
 		printk("%s: not 100%% native mode: will probe irqs later\n", d->name);
 		/*
@@ -816,7 +802,7 @@
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20265) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20267) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268) ||
-		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268R) ||
+		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20270) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20269) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20275) ||
 		    IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20276) ||
@@ -989,7 +975,7 @@
 		return;	/* UM8886A/BF pair */
 	else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT366))
 		hpt366_device_order_fixup(dev, d);
-	else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268R))
+	else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20270))
 		pdc20270_device_order_fixup(dev, d);
 	else if (!IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL) || (dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
 		if (IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL))
diff -urN linux-2.4.19-rc1/drivers/ide/pdc202xx.c linux-2.4.19-rc2/drivers/ide/pdc202xx.c
--- linux-2.4.19-rc1/drivers/ide/pdc202xx.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ide/pdc202xx.c	Tue Jul 16 16:25:19 2002
@@ -1,34 +1,59 @@
 /*
- *  linux/drivers/ide/pdc202xx.c	Version 0.30	Mar. 18, 2000
+ *  linux/drivers/ide/pdc202xx.c	Version 0.32	Feb. 27, 2002
  *
  *  Copyright (C) 1998-2000	Andre Hedrick <andre@linux-ide.org>
  *  May be copied or modified under the terms of the GNU General Public License
  *
- *  Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
+ *  Promise Ultra66 cards with BIOS v1.11 this
  *  compiled into the kernel if you have more than one card installed.
- *  Note that BIOS v1.29 is reported to fix the problem.  Since this is
- *  safe chipset tuning, including this support is harmless
  *
- *  Promise Ultra66 cards with BIOS v1.11 this
+ *  Promise Ultra100 cards with BIOS v2.01 this
  *  compiled into the kernel if you have more than one card installed.
  *
- *  Promise Ultra100 cards.
+ *  Promise Ultra100TX2 with BIOS v2.10 & Ultra133TX2 with BIOS v2.20
+ *  support 8 hard drives on UDMA mode.
  *
- *  The latest chipset code will support the following ::
- *  Three Ultra33 controllers and 12 drives.
- *  8 are UDMA supported and 4 are limited to DMA mode 2 multi-word.
- *  The 8/4 ratio is a BIOS code limit by promise.
+ *  Linux kernel will misunderstand FastTrak ATA-RAID series as Ultra
+ *  IDE Controller, UNLESS you enable "CONFIG_PDC202XX_FORCE"
+ *  That's you can use FastTrak ATA-RAID controllers as IDE controllers.
  *
- *  UNLESS you enable "CONFIG_PDC202XX_BURST"
+ *  History :
+ *  05/22/01    v1.20 b1
+ *           (1) support PDC20268
+ *           (2) fix cable judge function
+ *  08/22/01    v1.20 b2
+ *           (1) support ATA-133 PDC20269/75
+ *           (2) support UDMA Mode 6
+ *           (3) fix proc report information
+ *           (4) set ATA133 timing
+ *           (5) fix ultra dma bit 14 selectable
+ *           (6) support 32bit LBA
+ *  09/11/01    v1.20 b3 
+ *           (1) fix eighty_ninty_three()
+ *           (2) fix offset address 0x1c~0x1f
+ *  10/30/01    v1.20 b4
+ *           (1) fix 48bit LBA HOB bit
+ *           (2) force rescan drive under PIO modes if need
+ *  11/02/01    v1.20.0.5
+ *           (1) could be patched with ext3 filesystem code
+ *  11/06/01    v1.20.0.6
+ *           (1) fix LBA48 drive running without Promise controllers
+ *           (2) fix LBA48 drive running under PIO modes
+ *  01/28/02    v1.20.0.6
+ *           (1) release for linux IDE Group kernel 2.4.18
+ *           (2) add version and controller info to proc
+ *  05/23/02    v1.20.0.7
+ *           (1) disable PDC20262 running with 48bit
+ *           (2) Add quirk drive lists for PDC20265/67
  *
- */
-
-/*
- *  Portions Copyright (C) 1999 Promise Technology, Inc.
- *  Author: Frank Tiernan (frankt@promise.com)
+ *  Copyright (C) 1999-2002 Promise Technology, Inc.
+ *  Author: Frank Tiernan <frankt@promise.com>
+ *          PROMISE pdc202xx IDE Controller driver MAINTAINERS
  *  Released under terms of General Public License
  */
-
+ 
+#define VERSION	"1.20.0.7"
+#define VERDATE "2002-05-23"
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -65,41 +90,8 @@
 extern int (*pdc202xx_display_info)(char *, char **, off_t, int); /* ide-proc.c */
 extern char *ide_media_verbose(ide_drive_t *);
 static struct pci_dev *bmide_dev;
-
-char *pdc202xx_pio_verbose (u32 drive_pci)
-{
-	if ((drive_pci & 0x000ff000) == 0x000ff000) return("NOTSET");
-	if ((drive_pci & 0x00000401) == 0x00000401) return("PIO 4");
-	if ((drive_pci & 0x00000602) == 0x00000602) return("PIO 3");
-	if ((drive_pci & 0x00000803) == 0x00000803) return("PIO 2");
-	if ((drive_pci & 0x00000C05) == 0x00000C05) return("PIO 1");
-	if ((drive_pci & 0x00001309) == 0x00001309) return("PIO 0");
-	return("PIO ?");
-}
-
-char *pdc202xx_dma_verbose (u32 drive_pci)
-{
-	if ((drive_pci & 0x00036000) == 0x00036000) return("MWDMA 2");
-	if ((drive_pci & 0x00046000) == 0x00046000) return("MWDMA 1");
-	if ((drive_pci & 0x00056000) == 0x00056000) return("MWDMA 0");
-	if ((drive_pci & 0x00056000) == 0x00056000) return("SWDMA 2");
-	if ((drive_pci & 0x00068000) == 0x00068000) return("SWDMA 1");
-	if ((drive_pci & 0x000BC000) == 0x000BC000) return("SWDMA 0");
-	return("PIO---");
-}
-
-char *pdc202xx_ultra_verbose (u32 drive_pci, u16 slow_cable)
-{
-	if ((drive_pci & 0x000ff000) == 0x000ff000)
-		return("NOTSET");
-	if ((drive_pci & 0x00012000) == 0x00012000)
-		return((slow_cable) ? "UDMA 2" : "UDMA 4");
-	if ((drive_pci & 0x00024000) == 0x00024000)
-		return((slow_cable) ? "UDMA 1" : "UDMA 3");
-	if ((drive_pci & 0x00036000) == 0x00036000)
-		return("UDMA 0");
-	return(pdc202xx_dma_verbose(drive_pci));
-}
+static struct hd_driveid *id[4];
+static int speed_rate[4];
 
 static char * pdc202xx_info (char *buf, struct pci_dev *dev)
 {
@@ -107,8 +99,10 @@
 
 	u32 bibma  = pci_resource_start(dev, 4);
 	u32 reg60h = 0, reg64h = 0, reg68h = 0, reg6ch = 0;
-	u16 reg50h = 0, pmask = (1<<10), smask = (1<<11);
-	u8 hi = 0, lo = 0;
+	u16 reg50h = 0;
+	u16 word88 = 0;
+	int udmasel[4] = {0,0,0,0}, piosel[4] = {0,0,0,0};
+	int i = 0, hd = 0;
 
         /*
          * at that point bibma+0x2 et bibma+0xa are byte registers
@@ -120,10 +114,10 @@
 	u8 sc11	= inb_p((unsigned short)bibma + 0x11);
 	u8 sc1a	= inb_p((unsigned short)bibma + 0x1a);
 	u8 sc1b	= inb_p((unsigned short)bibma + 0x1b);
-	u8 sc1c	= inb_p((unsigned short)bibma + 0x1c); 
+	/* u8 sc1c	= inb_p((unsigned short)bibma + 0x1c); 
 	u8 sc1d	= inb_p((unsigned short)bibma + 0x1d);
 	u8 sc1e	= inb_p((unsigned short)bibma + 0x1e);
-	u8 sc1f	= inb_p((unsigned short)bibma + 0x1f);
+	u8 sc1f	= inb_p((unsigned short)bibma + 0x1f); */
 
 	pci_read_config_word(dev, 0x50, &reg50h);
 	pci_read_config_dword(dev, 0x60, &reg60h);
@@ -131,40 +125,35 @@
 	pci_read_config_dword(dev, 0x68, &reg68h);
 	pci_read_config_dword(dev, 0x6c, &reg6ch);
 
+	p+=sprintf(p, "\nPROMISE Ultra series driver Ver %s %s Adapter: ", VERSION, VERDATE);
 	switch(dev->device) {
+		case PCI_DEVICE_ID_PROMISE_20275:
+			p += sprintf(p, "MBUltra133\n");
+			break;
+		case PCI_DEVICE_ID_PROMISE_20269:
+			p += sprintf(p, "Ultra133 TX2\n");
+			break;
+		case PCI_DEVICE_ID_PROMISE_20268:
+			p += sprintf(p, "Ultra100 TX2\n");
+			break;
 		case PCI_DEVICE_ID_PROMISE_20267:
-			p += sprintf(p, "\n                                PDC20267 Chipset.\n");
+			p += sprintf(p, "Ultra100\n");
 			break;
 		case PCI_DEVICE_ID_PROMISE_20265:
-			p += sprintf(p, "\n                                PDC20265 Chipset.\n");
+			p += sprintf(p, "Ultra100 on M/B\n");
 			break;
 		case PCI_DEVICE_ID_PROMISE_20262:
-			p += sprintf(p, "\n                                PDC20262 Chipset.\n");
+			p += sprintf(p, "Ultra66\n");
 			break;
 		case PCI_DEVICE_ID_PROMISE_20246:
-			p += sprintf(p, "\n                                PDC20246 Chipset.\n");
+			p += sprintf(p, "Ultra33\n");
 			reg50h |= 0x0c00;
 			break;
 		default:
-			p += sprintf(p, "\n                                PDC202XX Chipset.\n");
+			p += sprintf(p, "Ultra Series\n");
 			break;
 	}
 
-	p += sprintf(p, "------------------------------- General Status ---------------------------------\n");
-	p += sprintf(p, "Burst Mode                           : %sabled\n", (sc1f & 0x01) ? "en" : "dis");
-	p += sprintf(p, "Host Mode                            : %s\n", (sc1f & 0x08) ? "Tri-Stated" : "Normal");
-	p += sprintf(p, "Bus Clocking                         : %s\n",
-		((sc1f & 0xC0) == 0xC0) ? "100 External" :
-		((sc1f & 0x80) == 0x80) ? "66 External" :
-		((sc1f & 0x40) == 0x40) ? "33 External" : "33 PCI Internal");
-	p += sprintf(p, "IO pad select                        : %s mA\n",
-		((sc1c & 0x03) == 0x03) ? "10" :
-		((sc1c & 0x02) == 0x02) ? "8" :
-		((sc1c & 0x01) == 0x01) ? "6" :
-		((sc1c & 0x00) == 0x00) ? "4" : "??");
-	SPLIT_BYTE(sc1e, hi, lo);
-	p += sprintf(p, "Status Polling Period                : %d\n", hi);
-	p += sprintf(p, "Interrupt Check Status Polling Delay : %d\n", lo);
 	p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n");
 	p += sprintf(p, "                %s                         %s\n",
 		(c0&0x80)?"disabled":"enabled ",
@@ -172,84 +161,39 @@
 	p += sprintf(p, "66 Clocking     %s                         %s\n",
 		(sc11&0x02)?"enabled ":"disabled",
 		(sc11&0x08)?"enabled ":"disabled");
-	p += sprintf(p, "           Mode %s                      Mode %s\n",
+	p += sprintf(p, "Mode            %s                           %s\n",
 		(sc1a & 0x01) ? "MASTER" : "PCI   ",
 		(sc1b & 0x01) ? "MASTER" : "PCI   ");
-	p += sprintf(p, "                %s                     %s\n",
-		(sc1d & 0x08) ? "Error       " :
-		((sc1d & 0x05) == 0x05) ? "Not My INTR " :
-		(sc1d & 0x04) ? "Interrupting" :
-		(sc1d & 0x02) ? "FIFO Full   " :
-		(sc1d & 0x01) ? "FIFO Empty  " : "????????????",
-		(sc1d & 0x80) ? "Error       " :
-		((sc1d & 0x50) == 0x50) ? "Not My INTR " :
-		(sc1d & 0x40) ? "Interrupting" :
-		(sc1d & 0x20) ? "FIFO Full   " :
-		(sc1d & 0x10) ? "FIFO Empty  " : "????????????");
 	p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n");
 	p += sprintf(p, "DMA enabled:    %s              %s             %s               %s\n",
-		(c0&0x20)?"yes":"no ",(c0&0x40)?"yes":"no ",(c1&0x20)?"yes":"no ",(c1&0x40)?"yes":"no ");
-	p += sprintf(p, "DMA Mode:       %s           %s          %s            %s\n",
-		pdc202xx_ultra_verbose(reg60h, (reg50h & pmask)),
-		pdc202xx_ultra_verbose(reg64h, (reg50h & pmask)),
-		pdc202xx_ultra_verbose(reg68h, (reg50h & smask)),
-		pdc202xx_ultra_verbose(reg6ch, (reg50h & smask)));
-	p += sprintf(p, "PIO Mode:       %s            %s           %s            %s\n",
-		pdc202xx_pio_verbose(reg60h),
-		pdc202xx_pio_verbose(reg64h),
-		pdc202xx_pio_verbose(reg68h),
-		pdc202xx_pio_verbose(reg6ch));
+		(id[0]!=NULL && (c0&0x20))?"yes":"no ",(id[1]!=NULL && (c0&0x40))?"yes":"no ",
+		(id[2]!=NULL && (c1&0x20))?"yes":"no ",(id[3]!=NULL && (c1&0x40))?"yes":"no ");
+	for( hd = 0; hd < 4 ; hd++) {
+		if (id[hd] == NULL)
+			continue;
+		word88 = id[hd]->dma_ultra;
+		for ( i = 7 ; i >= 0 ; i--)
+			if (word88 >> (i+8)) {
+				udmasel[hd] = i;	/* get select UDMA mode */
+				break;
+			}
+		piosel[hd] = (id[hd]->eide_pio_modes >= 0x02) ? 4 : 3;
+        }
+	p += sprintf(p, "UDMA Mode:      %d                %d               %d                 %d\n",
+		udmasel[0], udmasel[1], udmasel[2], udmasel[3]);
+	p += sprintf(p, "PIO Mode:       %d                %d               %d                 %d\n",
+		piosel[0], piosel[1], piosel[2], piosel[3]);
 #if 0
 	p += sprintf(p, "--------------- Can ATAPI DMA ---------------\n");
 #endif
 	return (char *)p;
 }
 
-static char * pdc202xx_info_new (char *buf, struct pci_dev *dev)
-{
-	char *p = buf;
-//	u32 bibma = pci_resource_start(dev, 4);
-
-//	u32 reg60h = 0, reg64h = 0, reg68h = 0, reg6ch = 0;
-//	u16 reg50h = 0, word88 = 0;
-//	int udmasel[4]={0,0,0,0}, piosel[4]={0,0,0,0}, i=0, hd=0;
-
-	switch(dev->device) {
-		case PCI_DEVICE_ID_PROMISE_20276:
-			p += sprintf(p, "\n                                PDC20276 Chipset.\n");
-			break;
-		case PCI_DEVICE_ID_PROMISE_20275:
-			p += sprintf(p, "\n                                PDC20275 Chipset.\n");
-			break;
-		case PCI_DEVICE_ID_PROMISE_20269:
-			p += sprintf(p, "\n                                PDC20269 TX2 Chipset.\n");
-			break;
-		case PCI_DEVICE_ID_PROMISE_20268:
-		case PCI_DEVICE_ID_PROMISE_20268R:
-			p += sprintf(p, "\n                                PDC20268 TX2 Chipset.\n");
-			break;
-default:
-			p += sprintf(p, "\n                                PDC202XX Chipset.\n");
-			break;
-	}
-	return (char *)p;
-}
-
 static int pdc202xx_get_info (char *buffer, char **addr, off_t offset, int count)
 {
 	char *p = buffer;
-	switch(bmide_dev->device) {
-		case PCI_DEVICE_ID_PROMISE_20276:
-		case PCI_DEVICE_ID_PROMISE_20275:
-		case PCI_DEVICE_ID_PROMISE_20269:
-		case PCI_DEVICE_ID_PROMISE_20268:
-		case PCI_DEVICE_ID_PROMISE_20268R:
-			p = pdc202xx_info_new(buffer, bmide_dev);
-			break;
-		default:
-			p = pdc202xx_info(buffer, bmide_dev);
-			break;
-	}
+	
+	p = pdc202xx_info(buffer, bmide_dev);
 	return p-buffer;	/* => must be less than 4k! */
 }
 #endif  /* defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) */
@@ -259,7 +203,9 @@
 const char *pdc_quirk_drives[] = {
 	"QUANTUM FIREBALLlct08 08",
 	"QUANTUM FIREBALLP KA6.4",
+	"QUANTUM FIREBALLP KA9.1",
 	"QUANTUM FIREBALLP LM20.4",
+	"QUANTUM FIREBALLP KX13.6",
 	"QUANTUM FIREBALLP KX20.5",
 	"QUANTUM FIREBALLP KX27.3",
 	"QUANTUM FIREBALLP LM20.5",
@@ -404,7 +350,7 @@
 	struct pci_dev *dev	= hwif->pci_dev;
 
 	unsigned int		drive_conf;
-	int			err;
+	int			err = 0, i = 0, j = hwif->channel ? 2 : 0 ;
 	byte			drive_pci, AP, BP, CP, DP;
 	byte			TA = 0, TB = 0, TC = 0;
 
@@ -458,6 +404,10 @@
 	pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
 	pci_read_config_byte(dev, (drive_pci)|0x02, &CP);
 
+	for ( i = 0; i < 2; i++)
+		if (hwif->drives[i].present)
+	  		id[i+j] = hwif->drives[i].id;	/* get identify structs */
+
 	switch(speed) {
 #ifdef CONFIG_BLK_DEV_IDEDMA
 		/* case XFER_UDMA_6: */
@@ -535,142 +485,157 @@
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 	byte thold		= 0x10;
 	byte adj		= (drive->dn%2) ? 0x08 : 0x00;
-
+	int set_speed		= 0, i=0, j=hwif->channel ? 2:0;
 	int                     err;
 
-#ifdef CONFIG_BLK_DEV_IDEDMA
+	/* Setting tHOLD bit to 0 if using UDMA mode 2 */
 	if (speed == XFER_UDMA_2) {
 		OUT_BYTE((thold + adj), indexreg);
 		OUT_BYTE((IN_BYTE(datareg) & 0x7f), datareg);
 	}
-	switch (speed) {
-		case XFER_UDMA_7:
-			speed = XFER_UDMA_6;
-		case XFER_UDMA_6:
-			OUT_BYTE((0x10 + adj), indexreg);
-			OUT_BYTE(0x1a, datareg);
-			OUT_BYTE((0x11 + adj), indexreg);
-			OUT_BYTE(0x01, datareg);
-			OUT_BYTE((0x12 + adj), indexreg);
-			OUT_BYTE(0xcb, datareg);
-			break;
-		case XFER_UDMA_5:
-			OUT_BYTE((0x10 + adj), indexreg);
-			OUT_BYTE(0x1a, datareg);
-			OUT_BYTE((0x11 + adj), indexreg);
-			OUT_BYTE(0x02, datareg);
-			OUT_BYTE((0x12 + adj), indexreg);
-			OUT_BYTE(0xcb, datareg);
-			break;
-		case XFER_UDMA_4:
-			OUT_BYTE((0x10 + adj), indexreg);
-			OUT_BYTE(0x1a, datareg);
-			OUT_BYTE((0x11 + adj), indexreg);
-			OUT_BYTE(0x03, datareg);
-			OUT_BYTE((0x12 + adj), indexreg);
-			OUT_BYTE(0xcd, datareg);
-			break;
-		case XFER_UDMA_3:
-			OUT_BYTE((0x10 + adj), indexreg);
-			OUT_BYTE(0x1a, datareg);
-			OUT_BYTE((0x11 + adj), indexreg);
-			OUT_BYTE(0x05, datareg);
-			OUT_BYTE((0x12 + adj), indexreg);
-			OUT_BYTE(0xcd, datareg);
-			break;
-		case XFER_UDMA_2:
-			OUT_BYTE((0x10 + adj), indexreg);
-			OUT_BYTE(0x2a, datareg);
-			OUT_BYTE((0x11 + adj), indexreg);
-			OUT_BYTE(0x07, datareg);
-			OUT_BYTE((0x12 + adj), indexreg);
-			OUT_BYTE(0xcd, datareg);
-			break;
-		case XFER_UDMA_1:
-			OUT_BYTE((0x10 + adj), indexreg);
-			OUT_BYTE(0x3a, datareg);
-			OUT_BYTE((0x11 + adj), indexreg);
-			OUT_BYTE(0x0a, datareg);
-			OUT_BYTE((0x12 + adj), indexreg);
-			OUT_BYTE(0xd0, datareg);
-			break;
-		case XFER_UDMA_0:
-			OUT_BYTE((0x10 + adj), indexreg);
-			OUT_BYTE(0x4a, datareg);
-			OUT_BYTE((0x11 + adj), indexreg);
-			OUT_BYTE(0x0f, datareg);
-			OUT_BYTE((0x12 + adj), indexreg);
-			OUT_BYTE(0xd5, datareg);
-			break;
-		case XFER_MW_DMA_2:
-			OUT_BYTE((0x0e + adj), indexreg);
-			OUT_BYTE(0x69, datareg);
-			OUT_BYTE((0x0f + adj), indexreg);
-			OUT_BYTE(0x25, datareg);
-			break;
-		case XFER_MW_DMA_1:
-			OUT_BYTE((0x0e + adj), indexreg);
-			OUT_BYTE(0x6b, datareg);
-			OUT_BYTE((0x0f+ adj), indexreg);
-			OUT_BYTE(0x27, datareg);
-			break;
-		case XFER_MW_DMA_0:
-			OUT_BYTE((0x0e + adj), indexreg);
-			OUT_BYTE(0xdf, datareg);
-			OUT_BYTE((0x0f + adj), indexreg);
-			OUT_BYTE(0x5f, datareg);
-			break;
-#else
-	switch (speed) {
-#endif /* CONFIG_BLK_DEV_IDEDMA */
-		case XFER_PIO_4:
-			OUT_BYTE((0x0c + adj), indexreg);
-			OUT_BYTE(0x23, datareg);
-			OUT_BYTE((0x0d + adj), indexreg);
-			OUT_BYTE(0x09, datareg);
-			OUT_BYTE((0x13 + adj), indexreg);
-			OUT_BYTE(0x25, datareg);
-			break;
-		case XFER_PIO_3:
-			OUT_BYTE((0x0c + adj), indexreg);
-			OUT_BYTE(0x27, datareg);
-			OUT_BYTE((0x0d + adj), indexreg);
-			OUT_BYTE(0x0d, datareg);
-			OUT_BYTE((0x13 + adj), indexreg);
-			OUT_BYTE(0x35, datareg);
-			break;
-		case XFER_PIO_2:
-			OUT_BYTE((0x0c + adj), indexreg);
-			OUT_BYTE(0x23, datareg);
-			OUT_BYTE((0x0d + adj), indexreg);
-			OUT_BYTE(0x26, datareg);
-			OUT_BYTE((0x13 + adj), indexreg);
-			OUT_BYTE(0x64, datareg);
-			break;
-		case XFER_PIO_1:
-			OUT_BYTE((0x0c + adj), indexreg);
-			OUT_BYTE(0x46, datareg);
-			OUT_BYTE((0x0d + adj), indexreg);
-			OUT_BYTE(0x29, datareg);
-			OUT_BYTE((0x13 + adj), indexreg);
-			OUT_BYTE(0xa4, datareg);
-			break;
-		case XFER_PIO_0:
-			OUT_BYTE((0x0c + adj), indexreg);
-			OUT_BYTE(0xfb, datareg);
-			OUT_BYTE((0x0d + adj), indexreg);
-			OUT_BYTE(0x2b, datareg);
-			OUT_BYTE((0x13 + adj), indexreg);
-			OUT_BYTE(0xac, datareg);
-			break;
-		default:
-	}
+	
+	/* We need to set ATA133 timing if ATA133 drives exist */
+	if (speed>=XFER_UDMA_6)
+		set_speed=1;
 
 	if (!drive->init_speed)
 		drive->init_speed = speed;
+#if PDC202XX_DEBUG_DRIVE_INFO
+	printk("%s: Before set_feature = %s, word88 = %#x\n",
+		drive->name, ide_xfer_verbose(speed), drive->id->dma_ultra );
+#endif /* PDC202XX_DEBUG_DRIVE_INFO */
 	err = ide_config_drive_speed(drive, speed);
-	drive->current_speed = speed;
-
+	drive->current_speed = speed;	
+	for ( i = 0 ; i < 2 ; i++)
+		if (hwif->drives[i].present) {
+	  		id[i+j] = hwif->drives[i].id;	/* get identify structs */
+	 		speed_rate[i+j] = speed;	/* get current speed */
+	 	}
+	if (set_speed) {
+		for (i=0; i<4; i++) {
+			if (id[i]==NULL)
+				continue;
+			switch(speed_rate[i]) {
+#ifdef CONFIG_BLK_DEV_IDEDMA
+				case XFER_UDMA_6:
+					OUT_BYTE((0x10 + adj), indexreg);
+					OUT_BYTE(0x1a, datareg);
+					OUT_BYTE((0x11 + adj), indexreg);
+					OUT_BYTE(0x01, datareg);
+					OUT_BYTE((0x12 + adj), indexreg);
+					OUT_BYTE(0xcb, datareg);
+					break;
+				case XFER_UDMA_5:
+					OUT_BYTE((0x10 + adj), indexreg);
+					OUT_BYTE(0x1a, datareg);
+					OUT_BYTE((0x11 + adj), indexreg);
+					OUT_BYTE(0x02, datareg);
+					OUT_BYTE((0x12 + adj), indexreg);
+					OUT_BYTE(0xcb, datareg);
+					break;
+				case XFER_UDMA_4:
+					OUT_BYTE((0x10 + adj), indexreg);
+					OUT_BYTE(0x1a, datareg);
+					OUT_BYTE((0x11 + adj), indexreg);
+					OUT_BYTE(0x03, datareg);
+					OUT_BYTE((0x12 + adj), indexreg);
+					OUT_BYTE(0xcd, datareg);
+					break;
+				case XFER_UDMA_3:
+					OUT_BYTE((0x10 + adj), indexreg);
+					OUT_BYTE(0x1a, datareg);
+					OUT_BYTE((0x11 + adj), indexreg);
+					OUT_BYTE(0x05, datareg);
+					OUT_BYTE((0x12 + adj), indexreg);
+					OUT_BYTE(0xcd, datareg);
+					break;
+				case XFER_UDMA_2:
+					OUT_BYTE((0x10 + adj), indexreg);
+					OUT_BYTE(0x2a, datareg);
+					OUT_BYTE((0x11 + adj), indexreg);
+					OUT_BYTE(0x07, datareg);
+					OUT_BYTE((0x12 + adj), indexreg);
+					OUT_BYTE(0xcd, datareg);
+					break;
+				case XFER_UDMA_1:
+					OUT_BYTE((0x10 + adj), indexreg);
+					OUT_BYTE(0x3a, datareg);
+					OUT_BYTE((0x11 + adj), indexreg);
+					OUT_BYTE(0x0a, datareg);
+					OUT_BYTE((0x12 + adj), indexreg);
+					OUT_BYTE(0xd0, datareg);
+					break;
+				case XFER_UDMA_0:
+					OUT_BYTE((0x10 + adj), indexreg);
+					OUT_BYTE(0x4a, datareg);
+					OUT_BYTE((0x11 + adj), indexreg);
+					OUT_BYTE(0x0f, datareg);
+					OUT_BYTE((0x12 + adj), indexreg);
+					OUT_BYTE(0xd5, datareg);
+					break;
+				case XFER_MW_DMA_2:
+					OUT_BYTE((0x0e + adj), indexreg);
+					OUT_BYTE(0x69, datareg);
+					OUT_BYTE((0x0f + adj), indexreg);
+					OUT_BYTE(0x25, datareg);
+					break;
+				case XFER_MW_DMA_1:
+					OUT_BYTE((0x0e + adj), indexreg);
+					OUT_BYTE(0x6b, datareg);
+					OUT_BYTE((0x0f+ adj), indexreg);
+					OUT_BYTE(0x27, datareg);
+					break;
+				case XFER_MW_DMA_0:
+					OUT_BYTE((0x0e + adj), indexreg);
+					OUT_BYTE(0xdf, datareg);
+					OUT_BYTE((0x0f + adj), indexreg);
+					OUT_BYTE(0x5f, datareg);
+					break;
+#endif /* CONFIG_BLK_DEV_IDEDMA */
+				case XFER_PIO_4:
+					OUT_BYTE((0x0c + adj), indexreg);
+					OUT_BYTE(0x23, datareg);
+					OUT_BYTE((0x0d + adj), indexreg);
+					OUT_BYTE(0x09, datareg);
+					OUT_BYTE((0x13 + adj), indexreg);
+					OUT_BYTE(0x25, datareg);
+					break;
+				case XFER_PIO_3:
+					OUT_BYTE((0x0c + adj), indexreg);
+					OUT_BYTE(0x27, datareg);
+					OUT_BYTE((0x0d + adj), indexreg);
+					OUT_BYTE(0x0d, datareg);
+					OUT_BYTE((0x13 + adj), indexreg);
+					OUT_BYTE(0x35, datareg);
+					break;
+				case XFER_PIO_2:
+					OUT_BYTE((0x0c + adj), indexreg);
+					OUT_BYTE(0x23, datareg);
+					OUT_BYTE((0x0d + adj), indexreg);
+					OUT_BYTE(0x26, datareg);
+					OUT_BYTE((0x13 + adj), indexreg);
+					OUT_BYTE(0x64, datareg);
+					break;
+				case XFER_PIO_1:
+					OUT_BYTE((0x0c + adj), indexreg);
+					OUT_BYTE(0x46, datareg);
+					OUT_BYTE((0x0d + adj), indexreg);
+					OUT_BYTE(0x29, datareg);
+					OUT_BYTE((0x13 + adj), indexreg);
+					OUT_BYTE(0xa4, datareg);
+					break;
+				case XFER_PIO_0:
+					OUT_BYTE((0x0c + adj), indexreg);
+					OUT_BYTE(0xfb, datareg);
+					OUT_BYTE((0x0d + adj), indexreg);
+					OUT_BYTE(0x2b, datareg);
+					OUT_BYTE((0x13 + adj), indexreg);
+					OUT_BYTE(0xac, datareg);
+					break;
+				default:
+			}
+		}
+	}
 	return err;
 }
 
@@ -709,7 +674,7 @@
 	byte iordy		= 0x13;
 	byte adj		= (drive->dn%2) ? 0x08 : 0x00;
 	byte cable		= 0;
-	byte jumpbit		= 0;
+	byte new_chip		= 0;
 	byte unit		= (drive->select.b.unit & 0x01);
 	unsigned int		drive_conf;
 	byte			drive_pci = 0;
@@ -717,12 +682,12 @@
 	byte			AP;
 	unsigned short		EP;
 	byte CLKSPD		= 0;
+	byte clockreg		= high_16 + 0x11;
 	byte udma_33		= ultra;
-//	byte udma_33		= ultra ? (IN_BYTE(high_16 + 0x001f) & 1) : 0;
 	byte udma_66		= ((eighty_ninty_three(drive)) && udma_33) ? 1 : 0;
 	byte udma_100		= 0;
 	byte udma_133		= 0;
-	byte mask		= hwif->channel ? 0x08 : 0x02;
+	byte mask			= hwif->channel ? 0x08 : 0x02;
 	unsigned short c_mask	= hwif->channel ? (1<<11) : (1<<10);
 
 	byte ultra_66		= ((id->dma_ultra & 0x0010) ||
@@ -740,40 +705,34 @@
 			udma_100 = (udma_66) ? 1 : 0;
 			OUT_BYTE(0x0b, (hwif->dma_base + 1));
 			cable = ((IN_BYTE((hwif->dma_base + 3)) & 0x04));
-			jumpbit = 1;
-			break;
-		case PCI_DEVICE_ID_PROMISE_20268R:
-			udma_100 = 1;
-			udma_66 = 1;
-			OUT_BYTE(0x0b, (hwif->dma_base + 1));
-			cable = ((IN_BYTE((hwif->dma_base + 3)) & 0x04));
-			jumpbit = 1;
+			new_chip = 1;
 			break;
 		case PCI_DEVICE_ID_PROMISE_20268:
+		case PCI_DEVICE_ID_PROMISE_20270:
 			udma_100 = (udma_66) ? 1 : 0;
 			OUT_BYTE(0x0b, (hwif->dma_base + 1));
 			cable = ((IN_BYTE((hwif->dma_base + 3)) & 0x04));
-			jumpbit = 1;
+			new_chip = 1;
 			break;
 		case PCI_DEVICE_ID_PROMISE_20267:
 		case PCI_DEVICE_ID_PROMISE_20265:
 			udma_100 = (udma_66) ? 1 : 0;
 			pci_read_config_word(dev, 0x50, &EP);
 			cable = (EP & c_mask);
-			jumpbit = 0;
+			new_chip = 0;
+			CLKSPD = IN_BYTE(clockreg);
 			break;
 		case PCI_DEVICE_ID_PROMISE_20262:
 			pci_read_config_word(dev, 0x50, &EP);
 			cable = (EP & c_mask);
-			jumpbit = 0;
+			new_chip = 0;
+			CLKSPD = IN_BYTE(clockreg);
 			break;
 		default:
-			udma_100 = 0; udma_133 = 0; cable = 1; jumpbit = 0;
+			udma_100 = 0; udma_133 = 0; cable = 0; new_chip = 1;
 			break;
 	}
 
-	if (!jumpbit)
-		CLKSPD = IN_BYTE(high_16 + 0x11);
 	/*
 	 * Set the control register to use the 66Mhz system
 	 * clock for UDMA 3/4 mode operation. If one drive on
@@ -794,8 +753,8 @@
 #endif /* DEBUG */
 		/* Primary   : zero out second bit */
 		/* Secondary : zero out fourth bit */
-		if (!jumpbit)
-			OUT_BYTE(CLKSPD & ~mask, (high_16 + 0x11));
+		//if (!new_chip)
+		OUT_BYTE(CLKSPD & ~mask, clockreg);
 		printk("Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary");
 		printk("%s reduced to Ultra33 mode.\n", drive->name);
 		udma_66 = 0; udma_100 = 0; udma_133 = 0;
@@ -811,27 +770,17 @@
 & 0x0020) ||
 				    (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0010) ||
 				    (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0008)) {
-					if (!jumpbit)
-						OUT_BYTE(CLKSPD | mask, (high_16 + 0x11));
+					OUT_BYTE(CLKSPD | mask, clockreg);
 				} else {
-					if (!jumpbit)
-						OUT_BYTE(CLKSPD & ~mask, (high_16 + 0x11));
+					OUT_BYTE(CLKSPD & ~mask, clockreg);
 				}
 			} else { /* udma4 drive by itself */
-				if (!jumpbit)
-					OUT_BYTE(CLKSPD | mask, (high_16 + 0x11));
+				OUT_BYTE(CLKSPD | mask, clockreg);
 			}
 		}
 	}
 
-	if (jumpbit) {
-		if (drive->media != ide_disk)	return ide_dma_off_quietly;
-		if (id->capability & 4) {	/* IORDY_EN & PREFETCH_EN */
-			OUT_BYTE((iordy + adj), indexreg);
-			OUT_BYTE((IN_BYTE(datareg)|0x03), datareg);
-		}
-		goto jumpbit_is_set;
-	}
+	if (new_chip)	goto chipset_is_set;
 
 	switch(drive->dn) {
 		case 0:	drive_pci = 0x60;
@@ -874,16 +823,23 @@
 
 chipset_is_set:
 
-	if (drive->media != ide_disk)	return ide_dma_off_quietly;
-
-	pci_read_config_byte(dev, (drive_pci), &AP);
-	if (id->capability & 4)	/* IORDY_EN */
-		pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN);
-	pci_read_config_byte(dev, (drive_pci), &AP);
-	if (drive->media == ide_disk)	/* PREFETCH_EN */
-		pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN);
-
-jumpbit_is_set:
+	if (drive->media != ide_disk)
+		return ide_dma_off_quietly;
+	
+	if (new_chip) {
+		if (id->capability & 4) {	/* IORDY_EN & PREFETCH_EN */
+			OUT_BYTE((iordy + adj), indexreg);
+			OUT_BYTE((IN_BYTE(datareg)|0x03), datareg);
+		}
+	}
+	else {
+		pci_read_config_byte(dev, (drive_pci), &AP);
+		if (id->capability & 4)	/* IORDY_EN */
+			pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN);
+		pci_read_config_byte(dev, (drive_pci), &AP);
+		if (drive->media == ide_disk)	/* PREFETCH_EN */
+			pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN);
+	}
 
 	if ((id->dma_ultra & 0x0040)&&(udma_133))	speed = XFER_UDMA_6;
 	else if ((id->dma_ultra & 0x0020)&&(udma_100))	speed = XFER_UDMA_5;
@@ -895,12 +851,12 @@
 	else if (id->dma_mword & 0x0004)		speed = XFER_MW_DMA_2;
 	else if (id->dma_mword & 0x0002)		speed = XFER_MW_DMA_1;
 	else if (id->dma_mword & 0x0001)		speed = XFER_MW_DMA_0;
-	else if ((id->dma_1word & 0x0004)&&(!jumpbit))	speed = XFER_SW_DMA_2;
-	else if ((id->dma_1word & 0x0002)&&(!jumpbit))	speed = XFER_SW_DMA_1;
-	else if ((id->dma_1word & 0x0001)&&(!jumpbit))	speed = XFER_SW_DMA_0;
+	else if ((id->dma_1word & 0x0004)&&(!new_chip))	speed = XFER_SW_DMA_2;
+	else if ((id->dma_1word & 0x0002)&&(!new_chip))	speed = XFER_SW_DMA_1;
+	else if ((id->dma_1word & 0x0001)&&(!new_chip))	speed = XFER_SW_DMA_0;
 	else {
 		/* restore original pci-config space */
-		if (!jumpbit)
+		if (!new_chip)
 			pci_write_config_dword(dev, drive_pci, drive_conf);
 		return ide_dma_off_quietly;
 	}
@@ -981,25 +937,24 @@
 	byte sc1d		= 0;
 	byte newchip		= 0;
 	byte clock		= 0;
-	byte hardware48hack	= 0;
+	byte hardware48fix	= 0;
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct pci_dev *dev	= hwif->pci_dev;
 	unsigned long high_16	= pci_resource_start(dev, 4);
-	unsigned long atapi_reg	= high_16 + (hwif->channel ? 0x24 : 0x00);
 	unsigned long dma_base	= hwif->dma_base;
+	unsigned long atapi_port= hwif->channel ? high_16+0x24 : high_16+0x20;
 
 	switch (dev->device) {
 		case PCI_DEVICE_ID_PROMISE_20276:
 		case PCI_DEVICE_ID_PROMISE_20275:
 		case PCI_DEVICE_ID_PROMISE_20269:
-		case PCI_DEVICE_ID_PROMISE_20268R:
 		case PCI_DEVICE_ID_PROMISE_20268:
+		case PCI_DEVICE_ID_PROMISE_20270:
 			newchip = 1;
 			break;
 		case PCI_DEVICE_ID_PROMISE_20267:
 		case PCI_DEVICE_ID_PROMISE_20265:
-		case PCI_DEVICE_ID_PROMISE_20262:
-			hardware48hack = 1;
+			hardware48fix = 1;
 			clock = IN_BYTE(high_16 + 0x11);
 		default:
 			break;
@@ -1014,21 +969,29 @@
 			 * The Promise Ultra33 doesn't work correctly when
 			 * we do this part before issuing the drive cmd.
 			 */
-			if ((drive->addressing) && (hardware48hack)) {
+			/* Enable ATAPI UDMA port for 48bit data on PDC20267 */
+			if ((drive->addressing) && (hardware48fix)) {
 				struct request *rq = HWGROUP(drive)->rq;
 				unsigned long word_count = 0;
-
-				outb(clock|(hwif->channel ? 0x08 : 0x02), high_16 + 0x11);
+				unsigned long hankval = 0;
+				byte	clockreg = high_16 + 0x11;
+				
+				OUT_BYTE(clock|(hwif->channel ? 0x08:0x02), clockreg);
 				word_count = (rq->nr_sectors << 8);
-				word_count = (rq->cmd == READ) ? word_count | 0x05000000 : word_count | 0x06000000;
-				outl(word_count, atapi_reg);
-			}
+				hankval = (rq->cmd == READ) ? 0x05<<24 : 0x06<<24;
+				hankval = hankval | word_count ;
+				outl(hankval, atapi_port);
+			}  
 			break;
 		case ide_dma_end:
-			if ((drive->addressing) && (hardware48hack)) {
-				outl(0, atapi_reg);	/* zero out extra */
-				clock = IN_BYTE(high_16 + 0x11);
-				OUT_BYTE(clock & ~(hwif->channel ? 0x08:0x02), high_16 + 0x11);
+			/* Disable ATAPI UDMA port for 48bit data on PDC20267 */
+			if ((drive->addressing) && (hardware48fix)) {
+				unsigned long hankval = 0;
+				byte	clockreg = high_16 + 0x11;
+				
+			    	outl(hankval, atapi_port);	/* zero out extra */
+				clock = IN_BYTE(clockreg);
+				OUT_BYTE(clock & ~(hwif->channel ? 0x08:0x02), clockreg);
 			}
 			break;
 		case ide_dma_test_irq:	/* returns 1 if dma irq issued, 0 otherwise */
@@ -1059,7 +1022,7 @@
 }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 
-void pdc202xx_new_reset (ide_drive_t *drive)
+void pdc202xx_reset (ide_drive_t *drive)
 {
 	OUT_BYTE(0x04,IDE_CONTROL_REG);
 	mdelay(1000);
@@ -1069,19 +1032,6 @@
 		HWIF(drive)->channel ? "Secondary" : "Primary");
 }
 
-void pdc202xx_reset (ide_drive_t *drive)
-{
-	unsigned long high_16	= pci_resource_start(HWIF(drive)->pci_dev, 4);
-	byte udma_speed_flag	= IN_BYTE(high_16 + 0x001f);
-
-	OUT_BYTE(udma_speed_flag | 0x10, high_16 + 0x001f);
-	mdelay(100);
-	OUT_BYTE(udma_speed_flag & ~0x10, high_16 + 0x001f);
-	mdelay(2000);		/* 2 seconds ?! */
-	printk("PDC202XX: %s channel reset.\n",
-		HWIF(drive)->channel ? "Secondary" : "Primary");
-}
-
 /*
  * Since SUN Cobalt is attempting to do this operation, I should disclose
  * this has been a long time ago Thu Jul 27 16:40:57 2000 was the patch date
@@ -1114,59 +1064,17 @@
 	byte udma_speed_flag	= IN_BYTE(high_16 + 0x001f);
 	byte primary_mode	= IN_BYTE(high_16 + 0x001a);
 	byte secondary_mode	= IN_BYTE(high_16 + 0x001b);
-	byte newchip		= 0;
+
+	OUT_BYTE(udma_speed_flag | 0x10, high_16 + 0x001f);
+	mdelay(100);
+	OUT_BYTE(udma_speed_flag & ~0x10, high_16 + 0x001f);
+	mdelay(2000);	/* 2 seconds ?! */
 
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
 		printk("%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
 	}
-
-	switch (dev->device) {
-		case PCI_DEVICE_ID_PROMISE_20276:
-		case PCI_DEVICE_ID_PROMISE_20275:
-		case PCI_DEVICE_ID_PROMISE_20269:
-		case PCI_DEVICE_ID_PROMISE_20268R:
-		case PCI_DEVICE_ID_PROMISE_20268:
-			newchip = 1;
-			break;
-		case PCI_DEVICE_ID_PROMISE_20267:
-		case PCI_DEVICE_ID_PROMISE_20265:
-			OUT_BYTE(udma_speed_flag | 0x10, high_16 + 0x001f);
-			mdelay(100);
-			OUT_BYTE(udma_speed_flag & ~0x10, high_16 + 0x001f);
-			mdelay(2000);   /* 2 seconds ?! */
-			break;
-		case PCI_DEVICE_ID_PROMISE_20262:
-			/*
-			 * software reset -  this is required because the bios
-			 * will set UDMA timing on if the hdd supports it. The
-			 * user may want to turn udma off. A bug in the pdc20262
-			 * is that it cannot handle a downgrade in timing from
-			 * UDMA to DMA. Disk accesses after issuing a set
-			 * feature command will result in errors. A software
-			 * reset leaves the timing registers intact,
-			 * but resets the drives.
-			 */
-			OUT_BYTE(udma_speed_flag | 0x10, high_16 + 0x001f);
-			mdelay(100);
-			OUT_BYTE(udma_speed_flag & ~0x10, high_16 + 0x001f);
-			mdelay(2000);	/* 2 seconds ?! */
-		default:
-			if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
-				byte irq = 0, irq2 = 0;
-				pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
-				pci_read_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, &irq2);	/* 0xbc */
-				if (irq != irq2) {
-					pci_write_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, irq);	/* 0xbc */
-					printk("%s: pci-config space interrupt mirror fixed.\n", name);
-				}
-			}
-			break;
-	}
-
-	if (newchip)
-		goto fttk_tx_series;
-
+	
 	printk("%s: (U)DMA Burst Bit %sABLED " \
 		"Primary %s Mode " \
 		"Secondary %s Mode.\n",
@@ -1199,8 +1107,6 @@
 	}
 #endif /* CONFIG_PDC202XX_MASTER */
 
-fttk_tx_series:
-
 #if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
 	if (!pdc202xx_proc) {
 		pdc202xx_proc = 1;
@@ -1216,17 +1122,19 @@
 	unsigned short mask = (hwif->channel) ? (1<<11) : (1<<10);
 	unsigned short CIS;
 
-        switch(hwif->pci_dev->device) {
+        	switch(hwif->pci_dev->device) {
 		case PCI_DEVICE_ID_PROMISE_20276:
 		case PCI_DEVICE_ID_PROMISE_20275:
 		case PCI_DEVICE_ID_PROMISE_20269:
 		case PCI_DEVICE_ID_PROMISE_20268:
-		case PCI_DEVICE_ID_PROMISE_20268R:
+		case PCI_DEVICE_ID_PROMISE_20270:
 			OUT_BYTE(0x0b, (hwif->dma_base + 1));
 			return (!(IN_BYTE((hwif->dma_base + 3)) & 0x04));
+			/* check 80pin cable */
 		default:
 			pci_read_config_word(hwif->pci_dev, 0x50, &CIS);
 			return (!(CIS & mask));
+			/* check 80pin cable */
 	}
 }
 
@@ -1234,21 +1142,20 @@
 {
 	hwif->tuneproc  = &pdc202xx_tune_drive;
 	hwif->quirkproc = &pdc202xx_quirkproc;
+	hwif->resetproc = &pdc202xx_reset;
 
         switch(hwif->pci_dev->device) {
 		case PCI_DEVICE_ID_PROMISE_20276:
 		case PCI_DEVICE_ID_PROMISE_20275:
 		case PCI_DEVICE_ID_PROMISE_20269:
 		case PCI_DEVICE_ID_PROMISE_20268:
-		case PCI_DEVICE_ID_PROMISE_20268R:
+		case PCI_DEVICE_ID_PROMISE_20270:
 			hwif->speedproc = &pdc202xx_new_tune_chipset;
-			hwif->resetproc = &pdc202xx_new_reset;
 			break;
 		case PCI_DEVICE_ID_PROMISE_20267:
 		case PCI_DEVICE_ID_PROMISE_20265:
 		case PCI_DEVICE_ID_PROMISE_20262:
 			hwif->busproc   = &pdc202xx_tristate;
-			hwif->resetproc	= &pdc202xx_reset;
 		case PCI_DEVICE_ID_PROMISE_20246:
 			hwif->speedproc = &pdc202xx_tune_chipset;
 		default:
diff -urN linux-2.4.19-rc1/drivers/ieee1394/Config.in linux-2.4.19-rc2/drivers/ieee1394/Config.in
--- linux-2.4.19-rc1/drivers/ieee1394/Config.in	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/Config.in	Tue Jul 16 16:25:19 2002
@@ -9,22 +9,33 @@
     if [ "$CONFIG_IEEE1394" != "n" ]; then
 
 	comment "Device Drivers"
-	dep_tristate '  Texas Instruments PCILynx support' CONFIG_IEEE1394_PCILYNX $CONFIG_IEEE1394
-	if [ "$CONFIG_IEEE1394_PCILYNX" != "n" ]; then
-	    bool '    Use PCILynx local RAM' CONFIG_IEEE1394_PCILYNX_LOCALRAM
-#	    bool '    Support for non-IEEE1394 local ports' CONFIG_IEEE1394_PCILYNX_PORTS
+
+	if [ "$CONFIG_I2C" = "n" -o "$CONFIG_I2C_ALGOBIT" = "n" ]; then
+	    comment '  Texas Instruments PCILynx requires I2C bit-banging'
+	else
+	    dep_tristate '  Texas Instruments PCILynx support' CONFIG_IEEE1394_PCILYNX $CONFIG_IEEE1394 $CONFIG_I2C $CONFIG_I2C_ALGOBIT
 	fi
+
+	# Non-maintained pcilynx options
+	# if [ "$CONFIG_IEEE1394_PCILYNX" != "n" ]; then
+	#     bool '    Use PCILynx local RAM' CONFIG_IEEE1394_PCILYNX_LOCALRAM
+	#     bool '    Support for non-IEEE1394 local ports' CONFIG_IEEE1394_PCILYNX_PORTS
+	# fi
+
 	dep_tristate '  OHCI-1394 support' CONFIG_IEEE1394_OHCI1394 $CONFIG_IEEE1394
 
 	comment "Protocol Drivers"
 	dep_tristate '  OHCI-1394 Video support' CONFIG_IEEE1394_VIDEO1394 $CONFIG_IEEE1394_OHCI1394
 	dep_tristate '  SBP-2 support (Harddisks etc.)' CONFIG_IEEE1394_SBP2 $CONFIG_SCSI $CONFIG_IEEE1394
+	if [ "$CONFIG_IEEE1394_SBP2" != "n" ]; then
+	    bool '    Enable Phys DMA support for SBP2 (Debug)' CONFIG_IEEE1394_SBP2_PHYS_DMA
+	fi
 	dep_tristate '  Ethernet over 1394' CONFIG_IEEE1394_ETH1394 $CONFIG_IEEE1394
 	dep_tristate '  OHCI-DV I/O support' CONFIG_IEEE1394_DV1394 $CONFIG_IEEE1394_OHCI1394
 	dep_tristate '  Raw IEEE1394 I/O support' CONFIG_IEEE1394_RAWIO $CONFIG_IEEE1394
 	dep_tristate '  IEC61883-1 Plug support' CONFIG_IEEE1394_CMP $CONFIG_IEEE1394
 
-	if [ "$CONFIG_IEEE1394_PCILYNX" != "n" ]; then
+	if [ "$CONFIG_IEEE1394_CMP" != "n" ]; then
 	    dep_tristate '    IEC61883-6 (Audio transmission) support' CONFIG_IEEE1394_AMDTP $CONFIG_IEEE1394_OHCI1394 $CONFIG_IEEE1394_CMP
 	fi
 
diff -urN linux-2.4.19-rc1/drivers/ieee1394/amdtp.c linux-2.4.19-rc2/drivers/ieee1394/amdtp.c
--- linux-2.4.19-rc1/drivers/ieee1394/amdtp.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/amdtp.c	Tue Jul 16 16:25:19 2002
@@ -1110,7 +1110,7 @@
 
 static int __init amdtp_init_module (void)
 {
-	if (ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_EXPERIMENTAL,
+	if (ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_AMDTP,
 				      THIS_MODULE, &amdtp_fops)) {
 		HPSB_ERR("amdtp: unable to get minor device block");
  		return -EIO;
@@ -1120,7 +1120,7 @@
 						   &amdtp_highlevel_ops);
 	if (amdtp_highlevel == NULL) {
 		HPSB_ERR("amdtp: unable to register highlevel ops");
-		ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_EXPERIMENTAL);
+		ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_AMDTP);
 		return -EIO;
 	}
 
@@ -1132,7 +1132,7 @@
 static void __exit amdtp_exit_module (void)
 {
         hpsb_unregister_highlevel(amdtp_highlevel);
-        ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_EXPERIMENTAL);
+        ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_AMDTP);
 
 	HPSB_INFO("Unloaded AMDTP driver");
 }
diff -urN linux-2.4.19-rc1/drivers/ieee1394/dv1394-private.h linux-2.4.19-rc2/drivers/ieee1394/dv1394-private.h
--- linux-2.4.19-rc1/drivers/ieee1394/dv1394-private.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/dv1394-private.h	Tue Jul 16 16:25:19 2002
@@ -460,7 +460,7 @@
 	   This is a regular int, but use test_and_set_bit() (on bit zero) 
 	   for atomicity.
 	 */
-	int open;
+	unsigned long open;
 
 	/* 
 	   2) the spinlock - this provides mutual exclusion between the interrupt
diff -urN linux-2.4.19-rc1/drivers/ieee1394/dv1394.c linux-2.4.19-rc2/drivers/ieee1394/dv1394.c
--- linux-2.4.19-rc1/drivers/ieee1394/dv1394.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/dv1394.c	Tue Jul 16 16:25:19 2002
@@ -53,6 +53,7 @@
     via pci_alloc_consistent()
     
   DONE:
+  - restart IT DMA after a bus reset
   - safely obtain and release ISO Tx channels in cooperation with OHCI driver
   - map received DIF blocks to their proper location in DV frame (ensure
     recovery if dropped packet)
@@ -101,7 +102,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 #include <linux/vmalloc.h>
@@ -193,71 +193,19 @@
 /* Memory management functions */
 /*******************************/
 
-#define MDEBUG(x)	do { } while(0)		/* Debug memory management */
-
-/* [DaveM] I've recoded most of this so that:
- * 1) It's easier to tell what is happening
- * 2) It's more portable, especially for translating things
- *    out of vmalloc mapped areas in the kernel.
- * 3) Less unnecessary translations happen.
- *
- * The code used to assume that the kernel vmalloc mappings
- * existed in the page tables of every process, this is simply
- * not guarenteed.  We now use pgd_offset_k which is the
- * defined way to get at the kernel page tables.
- */
-
-/* Given PGD from the address space's page table, return the kernel
- * virtual mapping of the physical memory mapped at ADR.
- */
-static inline struct page *uvirt_to_page(pgd_t *pgd, unsigned long adr)
-{
-	pmd_t *pmd;
-	pte_t *ptep, pte;
-	struct page *ret = NULL;
-	
-	if (!pgd_none(*pgd)) {
-                pmd = pmd_offset(pgd, adr);
-                if (!pmd_none(*pmd)) {
-                        ptep = pte_offset(pmd, adr);
-                        pte = *ptep;
-                        if(pte_present(pte))
-				ret = pte_page(pte);
-                }
-        }
-	return ret;
-}
-
-/* Here we want the physical address of the memory.
- * This is used when initializing the contents of the
- * area and marking the pages as reserved, and for
- * handling page faults on the rvmalloc()ed buffer
- */
-static inline unsigned long kvirt_to_pa(unsigned long adr) 
-{
-        unsigned long va, kva, ret;
-
-        va = VMALLOC_VMADDR(adr);
-	kva = (unsigned long) page_address(uvirt_to_page(pgd_offset_k(va), va));
-	kva |= adr & (PAGE_SIZE-1); /* restore the offset */
-	ret = __pa(kva);
-        MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret));
-        return ret;
-}
-
 static void * rvmalloc(unsigned long size)
 {
 	void * mem;
-	unsigned long adr, page;
-        
+	unsigned long adr;
+
+	size = PAGE_ALIGN(size);
 	mem=vmalloc_32(size);
 	if (mem) {
 		memset(mem, 0, size); /* Clear the ram out, 
 					 no junk to the user */
 	        adr=(unsigned long) mem;
 		while (size > 0) {
-	                page = kvirt_to_pa(adr);
-			mem_map_reserve(virt_to_page(__va(page)));
+			mem_map_reserve(vmalloc_to_page((void *)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
@@ -267,13 +215,12 @@
 
 static void rvfree(void * mem, unsigned long size)
 {
-        unsigned long adr, page;
-        
+        unsigned long adr;
+
 	if (mem) {
 	        adr=(unsigned long) mem;
 		while (size > 0) {
-	                page = kvirt_to_pa(adr);
-			mem_map_unreserve(virt_to_page(__va(page)));
+			mem_map_unreserve(vmalloc_to_page((void *)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
@@ -1167,9 +1114,9 @@
 		
 		/* fill the sglist with the kernel addresses of pages in the non-contiguous buffer */
 		for(i = 0; i < video->user_dma.n_pages; i++) {
-			unsigned long va = VMALLOC_VMADDR( (unsigned long) video->user_buf + i * PAGE_SIZE );
+			unsigned long va = (unsigned long) video->user_buf + i * PAGE_SIZE;
 			
-			video->user_dma.sglist[i].page = uvirt_to_page(pgd_offset_k(va), va);
+			video->user_dma.sglist[i].page = vmalloc_to_page((void *)va);
 			video->user_dma.sglist[i].length = PAGE_SIZE;
 		}
 		
@@ -1493,7 +1440,7 @@
 static struct page * dv1394_nopage(struct vm_area_struct * area, unsigned long address, int write_access)
 {
 	unsigned long offset;
-	unsigned long page, kernel_virt_addr;
+	unsigned long kernel_virt_addr;
 	struct page *ret = NOPAGE_SIGBUS;
 
 	struct video_card *video = (struct video_card*) area->vm_private_data;
@@ -1511,10 +1458,7 @@
 
 	offset = address - area->vm_start;
 	kernel_virt_addr = (unsigned long) video->user_buf + offset;
-
-	page = kvirt_to_pa(kernel_virt_addr);
-	
-	ret = virt_to_page(__va(page));
+	ret = vmalloc_to_page((void *)kernel_virt_addr);
 	get_page(ret);
 
  out:
@@ -2937,9 +2881,129 @@
 	dv1394_init(ohci, DV1394_PAL, MODE_TRANSMIT);
 }
 
+
+/* Bus reset handler. In the event of a bus reset, we may need to
+   re-start the DMA contexts - otherwise the user program would
+   end up waiting forever.
+*/
+
+static void dv1394_host_reset(struct hpsb_host *host)
+{
+	struct ti_ohci *ohci;
+	struct video_card *video = NULL;
+	unsigned long flags;
+	struct list_head *lh;
+	
+	/* We only work with the OHCI-1394 driver */
+	if (strcmp(host->driver->name, OHCI1394_DRIVER_NAME))
+		return;
+
+	ohci = (struct ti_ohci *)host->hostdata;
+
+
+	/* find the corresponding video_cards */
+	spin_lock_irqsave(&dv1394_cards_lock, flags);
+	if(!list_empty(&dv1394_cards)) {
+		list_for_each(lh, &dv1394_cards) {
+			video = list_entry(lh, struct video_card, list);
+			if((video->id >> 2) == ohci->id)
+				break;
+		}
+	}
+	spin_unlock_irqrestore(&dv1394_cards_lock, flags);
+
+	if(!video)
+		return;
+
+	/* check IT context */
+	if(video->ohci_it_ctx != -1) {
+		u32 ctx;
+		
+		spin_lock_irqsave(&video->spinlock, flags);
+		
+		ctx = reg_read(video->ohci, video->ohci_IsoXmitContextControlSet);
+
+		/* if(RUN but not ACTIVE) */
+		if( (ctx & (1<<15)) &&
+		    !(ctx & (1<<10)) ) {
+
+			debug_printk("dv1394: IT context stopped due to bus reset; waking it up\n");
+
+			/* to be safe, assume a frame has been dropped. User-space programs
+			   should handle this condition like an underflow. */
+			video->dropped_frames++;
+			
+			/* for some reason you must clear, then re-set the RUN bit to restart DMA */
+			
+			/* clear RUN */
+			reg_write(video->ohci, video->ohci_IsoXmitContextControlClear, (1 << 15));
+			flush_pci_write(video->ohci);
+			
+			/* set RUN */
+			reg_write(video->ohci, video->ohci_IsoXmitContextControlSet, (1 << 15));
+			flush_pci_write(video->ohci);
+			
+			/* set the WAKE bit (just in case; this isn't strictly necessary) */
+			reg_write(video->ohci, video->ohci_IsoXmitContextControlSet, (1 << 12));
+			flush_pci_write(video->ohci);
+
+			irq_printk("dv1394: AFTER IT restart ctx 0x%08x ptr 0x%08x\n",
+				   reg_read(video->ohci, video->ohci_IsoXmitContextControlSet),
+				   reg_read(video->ohci, video->ohci_IsoXmitCommandPtr));
+		}
+
+		spin_unlock_irqrestore(&video->spinlock, flags);
+	}
+	
+	/* check IR context */
+	if(video->ohci_ir_ctx != -1) {
+		u32 ctx;
+		
+		spin_lock_irqsave(&video->spinlock, flags);
+		
+		ctx = reg_read(video->ohci, video->ohci_IsoRcvContextControlSet);
+
+		/* if(RUN but not ACTIVE) */
+		if( (ctx & (1<<15)) &&
+		    !(ctx & (1<<10)) ) {
+
+			debug_printk("dv1394: IR context stopped due to bus reset; waking it up\n");
+
+			/* to be safe, assume a frame has been dropped. User-space programs
+			   should handle this condition like an overflow. */
+			video->dropped_frames++;
+
+			/* for some reason you must clear, then re-set the RUN bit to restart DMA */
+			/* XXX this doesn't work for me, I can't get IR DMA to restart :[ */
+			
+			/* clear RUN */
+			reg_write(video->ohci, video->ohci_IsoRcvContextControlClear, (1 << 15));
+			flush_pci_write(video->ohci);
+			
+			/* set RUN */
+			reg_write(video->ohci, video->ohci_IsoRcvContextControlSet, (1 << 15));
+			flush_pci_write(video->ohci);
+			
+			/* set the WAKE bit (just in case; this isn't strictly necessary) */
+			reg_write(video->ohci, video->ohci_IsoRcvContextControlSet, (1 << 12));
+			flush_pci_write(video->ohci);
+
+			irq_printk("dv1394: AFTER IR restart ctx 0x%08x ptr 0x%08x\n",
+				   reg_read(video->ohci, video->ohci_IsoRcvContextControlSet),
+				   reg_read(video->ohci, video->ohci_IsoRcvCommandPtr));
+		}
+
+		spin_unlock_irqrestore(&video->spinlock, flags);
+	}
+
+	/* wake readers/writers/ioctl'ers */
+	wake_up_interruptible(&video->waitq);
+}
+
 static struct hpsb_highlevel_ops hl_ops = {
 	add_host:	dv1394_add_host,
 	remove_host:	dv1394_remove_host,
+	host_reset:     dv1394_host_reset,
 };
 
 
diff -urN linux-2.4.19-rc1/drivers/ieee1394/dv1394.h linux-2.4.19-rc2/drivers/ieee1394/dv1394.h
--- linux-2.4.19-rc1/drivers/ieee1394/dv1394.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/dv1394.h	Tue Jul 16 16:25:19 2002
@@ -123,6 +123,67 @@
    frame 0. Then call DV1394_SUBMIT_FRAMES to inform the device that
    it may transmit the new frames.
 
+   ERROR HANDLING
+
+   An error (buffer underflow/overflow or a break in the DV stream due
+   to a 1394 bus reset) can be detected by checking the dropped_frames
+   field of struct dv1394_status (obtained through the
+   DV1394_GET_STATUS ioctl).
+
+   The best way to recover from such an error is to re-initialize
+   dv1394, either by using the DV1394_INIT ioctl call, or closing the
+   file descriptor and opening it again. (note that you must unmap all
+   ringbuffer mappings when closing the file descriptor, or else
+   dv1394 will still be considered 'in use').
+
+   MAIN LOOP
+
+   For maximum efficiency and robustness against bus errors, you are
+   advised to model the main loop of your application after the
+   following pseudo-code example:
+
+   (checks of system call return values omitted for brevity; always
+   check return values in your code!)
+   
+   while( frames left ) {
+   
+    struct pollfd *pfd = ...;
+
+    pfd->fd = dv1394_fd;
+    pfd->revents = 0;
+    pfd->events = POLLOUT | POLLIN; (OUT for transmit, IN for receive)
+
+    (add other sources of I/O here)
+    
+    poll(pfd, 1, -1); (or select(); add a timeout if you want)
+
+    if(pfd->revents) {
+         struct dv1394_status status;
+	 
+         ioctl(dv1394_fd, DV1394_GET_STATUS, &status);
+
+	 if(status.dropped_frames > 0) {
+	      reset_dv1394();
+         } else {
+              for(int i = 0; i < status.n_clear_frames; i++) {
+	          copy_DV_frame();
+              }
+         }
+    }
+   }
+
+   where copy_DV_frame() reads or writes on the dv1394 file descriptor
+   (read/write mode) or copies data to/from the mmap ringbuffer and
+   then calls ioctl(DV1394_SUBMIT_FRAMES) to notify dv1394 that new
+   frames are availble (mmap mode).
+
+   reset_dv1394() is called in the event of a buffer
+   underflow/overflow or a halt in the DV stream (e.g. due to a 1394
+   bus reset). To guarantee recovery from the error, this function
+   should close the dv1394 file descriptor (and munmap() all
+   ringbuffer mappings, if you are using them), then re-open the
+   dv1394 device (and re-map the ringbuffer).
+   
 */
 
 
@@ -218,6 +279,13 @@
 	unsigned int syt_offset;
 };
 
+/* NOTE: you may only allocate the DV frame ringbuffer once each time
+   you open the dv1394 device. DV1394_INIT will fail if you call it a
+   second time with different 'n_frames' or 'format' arguments (which
+   would imply a different size for the ringbuffer). If you need a
+   different buffer size, simply close and re-open the device, then
+   initialize it with your new settings. */
+   
 /* Q: What are cip_n and cip_d? */
 
 /*
@@ -262,8 +330,9 @@
 	   ready to be filled with data */
 	unsigned int n_clear_frames;
 
-	/* how many times the DV output has underflowed
-	   since the last call to DV1394_GET_STATUS */
+	/* how many times the DV stream has underflowed, overflowed,
+	   or otherwise encountered an error, since the previous call
+	   to DV1394_GET_STATUS */
 	unsigned int dropped_frames;
 
 	/* N.B. The dropped_frames counter is only a lower bound on the actual
diff -urN linux-2.4.19-rc1/drivers/ieee1394/hosts.c linux-2.4.19-rc2/drivers/ieee1394/hosts.c
--- linux-2.4.19-rc1/drivers/ieee1394/hosts.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/hosts.c	Tue Jul 16 16:25:19 2002
@@ -124,7 +124,7 @@
 
         h = kmalloc(sizeof(struct hpsb_host) + extra, SLAB_KERNEL);
         if (!h) return NULL;
-        memset(h, 0, sizeof(struct hpsb_host));
+        memset(h, 0, sizeof(struct hpsb_host) + extra);
 
 	h->hostdata = h + 1;
         h->driver = drv;
diff -urN linux-2.4.19-rc1/drivers/ieee1394/hosts.h linux-2.4.19-rc2/drivers/ieee1394/hosts.h
--- linux-2.4.19-rc1/drivers/ieee1394/hosts.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/hosts.h	Tue Jul 16 16:25:19 2002
@@ -31,6 +31,7 @@
         u32 tlabel_pool[2];
         struct semaphore tlabel_count;
         spinlock_t tlabel_lock;
+	u32 tlabel_current;
 
         unsigned char iso_listen_count[64];
 
diff -urN linux-2.4.19-rc1/drivers/ieee1394/ieee1394_core.c linux-2.4.19-rc2/drivers/ieee1394/ieee1394_core.c
--- linux-2.4.19-rc1/drivers/ieee1394/ieee1394_core.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/ieee1394_core.c	Tue Jul 16 16:25:19 2002
@@ -906,17 +906,16 @@
 
 	/* printk("ieee1394_dispatch_open(%d)", blocknum); */
 
-	/* lock the whole kernel here, to prevent a driver from
-	   being unloaded between the file_ops lookup and the open */
-
-	lock_kernel();
-
 	read_lock(&ieee1394_chardevs_lock);
-	file_ops = ieee1394_chardevs[blocknum].file_ops;
 	module = ieee1394_chardevs[blocknum].module;
+	/* bump the reference count of the driver that
+	   will receive the open() */
+	INCREF(module);
+	file_ops = ieee1394_chardevs[blocknum].file_ops;
 	read_unlock(&ieee1394_chardevs_lock);
 
 	if(file_ops == NULL) {
+		DECREF(module);
 		goto out_fail;
 	}
 
@@ -924,10 +923,6 @@
 	   own file_operations */
 	file->f_op = file_ops;
 
-	/* bump the reference count of the driver that
-	   will receive the open() */
-	INCREF(module);
-	
 	/* at this point BOTH ieee1394 and the task-specific driver have
 	   an extra reference */
 
@@ -956,7 +951,6 @@
 		   and will be dropped by the VFS when the file is
 		   released. */
 		
-		unlock_kernel();
 		return 0;
 	}
 	       
@@ -966,7 +960,6 @@
 	   function returns. */
 	
 	file->f_op = &ieee1394_chardev_ops;
-	unlock_kernel();
 	return retval;
 
 #undef INCREF
diff -urN linux-2.4.19-rc1/drivers/ieee1394/ieee1394_core.h linux-2.4.19-rc2/drivers/ieee1394/ieee1394_core.h
--- linux-2.4.19-rc1/drivers/ieee1394/ieee1394_core.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/ieee1394_core.h	Tue Jul 16 16:25:19 2002
@@ -182,6 +182,7 @@
 #define IEEE1394_MINOR_BLOCK_RAW1394       0
 #define IEEE1394_MINOR_BLOCK_VIDEO1394     1
 #define IEEE1394_MINOR_BLOCK_DV1394        2
+#define IEEE1394_MINOR_BLOCK_AMDTP         3
 #define IEEE1394_MINOR_BLOCK_EXPERIMENTAL 15
 
 /* return the index (within a minor number block) of a file */
diff -urN linux-2.4.19-rc1/drivers/ieee1394/ieee1394_transactions.c linux-2.4.19-rc2/drivers/ieee1394/ieee1394_transactions.c
--- linux-2.4.19-rc1/drivers/ieee1394/ieee1394_transactions.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/ieee1394_transactions.c	Tue Jul 16 16:25:19 2002
@@ -169,8 +169,9 @@
  */
 int get_tlabel(struct hpsb_host *host, nodeid_t nodeid, int wait)
 {
-	int tlabel;
+	int tlabel = 0;
 	unsigned long flags;
+	int found_tlabel = 0;
 
 	if (wait) {
 		down(&host->tlabel_count);
@@ -180,15 +181,18 @@
 
 	spin_lock_irqsave(&host->tlabel_lock, flags);
 
-	if (host->tlabel_pool[0] != ~0) {
-		tlabel = ffz(host->tlabel_pool[0]);
-		host->tlabel_pool[0] |= 1 << tlabel;
-	} else {
-		tlabel = ffz(host->tlabel_pool[1]);
-		host->tlabel_pool[1] |= 1 << tlabel;
-		tlabel += 32;
+	while (!found_tlabel) {
+		tlabel = host->tlabel_current;
+		if (tlabel < 32 && !(host->tlabel_pool[0] & 1 << tlabel)) {
+			host->tlabel_pool[0] |= 1 << tlabel;
+			found_tlabel = 1;
+		} else if (!(host->tlabel_pool[1] & 1 << (tlabel - 32))) {
+			host->tlabel_pool[1] |= 1 << (tlabel - 32);
+			found_tlabel = 1;
+		}
+		host->tlabel_current = (host->tlabel_current + 1) % 64;
 	}
-
+	
 	spin_unlock_irqrestore(&host->tlabel_lock, flags);
 
 	return tlabel;
diff -urN linux-2.4.19-rc1/drivers/ieee1394/ieee1394_types.h linux-2.4.19-rc2/drivers/ieee1394/ieee1394_types.h
--- linux-2.4.19-rc1/drivers/ieee1394/ieee1394_types.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/ieee1394_types.h	Tue Jul 16 16:25:19 2002
@@ -46,6 +46,10 @@
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,5)
+#define pte_offset_kernel pte_offset
+#endif
+
 #ifndef MIN
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
diff -urN linux-2.4.19-rc1/drivers/ieee1394/nodemgr.c linux-2.4.19-rc2/drivers/ieee1394/nodemgr.c
--- linux-2.4.19-rc1/drivers/ieee1394/nodemgr.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/nodemgr.c	Tue Jul 16 16:25:19 2002
@@ -177,7 +177,7 @@
 
 	for (i = 0; i < 3; i++) {
 		ret = hpsb_read(host, nodeid, generation, address, quad, 4);
-		if (ret != -EAGAIN)
+		if (!ret)
 			break;
 	}
 	*quad = be32_to_cpu(*quad);
@@ -985,12 +985,26 @@
 	HPSB_INFO("Initiating ConfigROM request for node " NODE_BUS_FMT,
 		  NODE_BUS_ARGS(nodeid));
 #endif
+	/* 
+	 * Must retry a few times if config rom read returns zero (how long?). Will
+	 * not normally occur, but we should do the right thing. For example, with
+	 * some sbp2 devices, the bridge chipset cannot return valid config rom reads
+	 * immediately after power-on, since they need to detect the type of 
+	 * device attached (disk or CD-ROM).
+	 */
+	for (i = 0; i < 4; i++) {
+		if (nodemgr_read_quadlet(host, nodeid, generation,
+					 addr, &buffer[0]) < 0) {
+			HPSB_ERR("ConfigROM quadlet transaction error for node "
+				 NODE_BUS_FMT, NODE_BUS_ARGS(nodeid));
+			return -1;
+		}
+		if (buffer[0])
+			break;
 
-	if (nodemgr_read_quadlet(host, nodeid, generation,
-				 addr, &buffer[0]) < 0) {
-		HPSB_ERR("ConfigROM quadlet transaction error for node "
-			 NODE_BUS_FMT, NODE_BUS_ARGS(nodeid));
-		return -1;
+		set_current_state(TASK_INTERRUPTIBLE);
+		if (schedule_timeout (HZ/4))
+			return -1;
 	}
 
 	header_size = buffer[0] >> 24;
@@ -1051,10 +1065,15 @@
 		return;
 
 	if (buffer[1] != IEEE1394_BUSID_MAGIC) {
-		/* This isn't a 1394 device */
-		HPSB_ERR("Node " NODE_BUS_FMT " isn't an IEEE 1394 device",
-			 NODE_BUS_ARGS(nodeid));
-		return;
+		/* This isn't a 1394 device, but we let it slide. There
+		 * was a report of a device with broken firmware which
+		 * reported '2394' instead of '1394', which is obviously a
+		 * mistake. One would hope that a non-1394 device never
+		 * gets connected to Firewire bus. If someone does, we
+		 * shouldn't be held responsible, so we'll allow it with a
+		 * warning.  */
+		HPSB_WARN("Node " NODE_BUS_FMT " has invalid busID magic [0x%08x]",
+			 NODE_BUS_ARGS(nodeid), buffer[1]);
 	}
 
 	guid = ((u64)buffer[3] << 32) | buffer[4];
@@ -1103,11 +1122,11 @@
 	nodeid_t nodeid = LOCAL_BUS;
 	unsigned int generation;
 
-	/* Pause for 1 second, to make sure things settle down. If
+	/* Pause for 1/4 second, to make sure things settle down. If
 	 * schedule_timeout returns non-zero, it means we caught a signal
 	 * and need to return. */
 	set_current_state(TASK_INTERRUPTIBLE);
-	if (schedule_timeout (HZ))
+	if (schedule_timeout (HZ/4))
 		return;
 
 	/* Now get the generation in which the node ID's we collect
diff -urN linux-2.4.19-rc1/drivers/ieee1394/ohci1394.c linux-2.4.19-rc2/drivers/ieee1394/ohci1394.c
--- linux-2.4.19-rc1/drivers/ieee1394/ohci1394.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/ohci1394.c	Tue Jul 16 16:25:19 2002
@@ -37,7 +37,7 @@
  * . DMA error recovery
  *
  * Known bugs:
- * . Apple PowerBook detected but not working yet (still true?)
+ * . devctl BUS_RESET arg confusion (reset type or root holdoff?)
  */
 
 /* 
@@ -77,12 +77,6 @@
  *  . Config ROM generation
  */
 
-/* Issues:
- *
- * - devctl BUS_RESET should treat arg as reset type
- *
- */
-
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
@@ -96,7 +90,6 @@
 #include <linux/poll.h>
 #include <asm/byteorder.h>
 #include <asm/atomic.h>
-#include <asm/io.h>
 #include <asm/uaccess.h>
 #include <linux/tqueue.h>
 #include <linux/delay.h>
@@ -161,17 +154,21 @@
 printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)
 
 static char version[] __devinitdata =
-	"$Revision: 1.101 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 515 $ Ben Collins <bcollins@debian.org>";
 
 /* Module Parameters */
 MODULE_PARM(attempt_root,"i");
-MODULE_PARM_DESC(attempt_root, "Attempt to make the host root.");
+MODULE_PARM_DESC(attempt_root, "Attempt to make the host root (default = 0).");
 static int attempt_root = 0;
 
+MODULE_PARM(phys_dma,"i");
+MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1).");
+static int phys_dma = 1;
+
 static void dma_trm_tasklet(unsigned long data);
 static void dma_trm_reset(struct dma_trm_ctx *d);
 
-static void __devexit ohci1394_pci_remove(struct pci_dev *pdev);
+static void ohci1394_pci_remove(struct pci_dev *pdev);
 
 static inline void ohci1394_run_irq_hooks(struct ti_ohci *ohci,
 					  quadlet_t isoRecvEvent, 
@@ -225,7 +222,7 @@
 
 	spin_lock_irqsave (&ohci->phy_reg_lock, flags);
 
-	reg_write(ohci, OHCI1394_PhyControl, (((u16)addr << 8) & 0x00000f00) | 0x00008000);
+	reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | 0x00008000);
 
 	for (i = 0; i < OHCI_LOOP_COUNT; i++) {
 		if (reg_read(ohci, OHCI1394_PhyControl) & 0x80000000)
@@ -253,7 +250,7 @@
 
 	spin_lock_irqsave (&ohci->phy_reg_lock, flags);
 
-	reg_write(ohci, OHCI1394_PhyControl, 0x00004000 | (((u16)addr << 8) & 0x00000f00) | data);
+	reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | data | 0x00004000);
 
 	for (i = 0; i < OHCI_LOOP_COUNT; i++) {
 		r = reg_read(ohci, OHCI1394_PhyControl);
@@ -292,8 +289,6 @@
 	size_t size;
 	quadlet_t q0, q1;
 
-	mdelay(10);
-
 	/* Check status of self-id reception */
 
 	if (ohci->selfid_swap)
@@ -364,13 +359,6 @@
 			break;
 		mdelay(1);
 	}
-
-	/* Now reenable LPS, since that's usually what we want after a
-	 * softreset anyway. Wait 50msec to make sure we have full link
-	 * enabled.  */
-	reg_write(ohci, OHCI1394_HCControlSet, 0x00080000);
-	mdelay(50);
-
 	DBGMSG (ohci->id, "Soft reset finished");
 }
 
@@ -489,14 +477,42 @@
 {
 	quadlet_t buf;
 
+	/* Start off with a soft reset, to clear everything to a sane
+	 * state. */
+	ohci_soft_reset(ohci);
+
+	/* Now enable LPS, which we need in order to start accessing
+	 * most of the registers.  In fact, on some cards (ALI M5251),
+	 * accessing registers in the SClk domain without LPS enabled
+	 * will lock up the machine.  Wait 50msec to make sure we have
+	 * full link enabled.  */
+	reg_write(ohci, OHCI1394_HCControlSet, 0x00080000);
+	mdelay(50);
+
+	/* Determine the number of available IR and IT contexts. */
+	ohci->nb_iso_rcv_ctx =
+		get_nb_iso_ctx(ohci, OHCI1394_IsoRecvIntMaskSet);
+	DBGMSG(ohci->id, "%d iso receive contexts available",
+	       ohci->nb_iso_rcv_ctx);
+
+	ohci->nb_iso_xmit_ctx = 
+		get_nb_iso_ctx(ohci, OHCI1394_IsoXmitIntMaskSet);
+	DBGMSG(ohci->id, "%d iso transmit contexts available",
+	       ohci->nb_iso_xmit_ctx);
+
+	/* Set the usage bits for non-existent contexts so they can't
+	 * be allocated */
+	ohci->ir_ctx_usage |= ~0 << ohci->nb_iso_rcv_ctx;
+	ohci->it_ctx_usage |= ~0 << ohci->nb_iso_xmit_ctx;
+	
 	spin_lock_init(&ohci->phy_reg_lock);
 	spin_lock_init(&ohci->event_lock);
   
 	/* Put some defaults to these undefined bus options */
 	buf = reg_read(ohci, OHCI1394_BusOptions);
-	buf |=  0x60000000; /* Enable CMC and ISC */
+	buf |=  0xE0000000; /* Enable IRMC, CMC and ISC */
 	buf &= ~0x00ff0000; /* XXX: Set cyc_clk_acc to zero for now */
-	buf &= ~0x98000000; /* Disable PMC, IRMC and BMC */
+	buf &= ~0x18000000; /* Disable PMC and BMC */
 	reg_write(ohci, OHCI1394_BusOptions, buf);
 
 	/* Set the bus number */
@@ -508,8 +524,10 @@
 	/* Clear link control register */
 	reg_write(ohci, OHCI1394_LinkControlClear, 0xffffffff);
   
-	/* Enable cycle timer and cycle master */
+	/* Enable cycle timer and cycle master and set the IRM
+	 * contender bit in our self ID packets. */
 	reg_write(ohci, OHCI1394_LinkControlSet, 0x00300000);
+	set_phy_reg_mask(ohci, 4, 0xc0);
 
 	/* Clear interrupt registers */
 	reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff);
@@ -611,7 +629,7 @@
 	      ((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10),
 	      ((((buf) >> 4) & 0xf) + ((buf) & 0xf) * 10), ohci->dev->irq,
 	      pci_resource_start(ohci->dev, 0),
-	      pci_resource_start(ohci->dev, 0) + pci_resource_len(ohci->dev, 0),
+	      pci_resource_start(ohci->dev, 0) + OHCI1394_REGISTER_SIZE,
 	      ohci->max_packet_size);
 }
 
@@ -1243,15 +1261,6 @@
 				  0xffffffff);
 			reg_write(ohci,OHCI1394_AsReqFilterLoSet, 
 				  0xffffffff);
-			/* Turn on phys dma reception. We should
-			 * probably manage the filtering somehow, 
-			 * instead of blindly turning it on.  */
-			reg_write(ohci,OHCI1394_PhyReqFilterHiSet,
-				  0xffffffff);
-			reg_write(ohci,OHCI1394_PhyReqFilterLoSet,
-				  0xffffffff);
-                       	reg_write(ohci,OHCI1394_PhyUpperBound,
-				  0xffff0000);
 		} else
 			PRINT(KERN_ERR, ohci->id, 
 			      "SelfID received outside of bus reset sequence");
@@ -1263,6 +1272,31 @@
 		reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); 
 		spin_unlock_irqrestore(&ohci->event_lock, flags);
 		event &= ~OHCI1394_selfIDComplete;	
+
+		/* Turn on phys dma reception. We should
+		 * probably manage the filtering somehow, 
+		 * instead of blindly turning it on.  */
+
+		/*
+		 * CAUTION!
+		 * Some chips (TI TSB43AB22) won't take a value in
+		 * the PhyReqFilter register until after the IntEvent
+		 * is cleared for bus reset, and even then a short
+		 * delay is required.
+		 */
+		if (phys_dma) {
+			mdelay(1);
+			reg_write(ohci,OHCI1394_PhyReqFilterHiSet,
+				  0xffffffff);
+			reg_write(ohci,OHCI1394_PhyReqFilterLoSet,
+				  0xffffffff);
+			reg_write(ohci,OHCI1394_PhyUpperBound,
+				  0xffff0000);
+		}
+
+		DBGMSG(ohci->id, "PhyReqFilter=%08x%08x\n",
+		       reg_read(ohci,OHCI1394_PhyReqFilterHiSet),
+		       reg_read(ohci,OHCI1394_PhyReqFilterLoSet));
 	}
 
 	/* Make sure we handle everything, just in case we accidentally
@@ -1832,7 +1866,7 @@
 
 	crc = 0;
 	for (; length > 0; length--) {
-		data = *ptr++;
+		data = be32_to_cpu(*ptr++);
 		for (shift = 28; shift >= 0; shift -= 4) {
 			sum = ((crc >> 12) ^ (data >> shift)) & 0x000f;
 			crc = (crc << 4) ^ (sum << 12) ^ (sum << 5) ^ sum;
@@ -2024,7 +2058,7 @@
 
 	struct hpsb_host *host;
 	struct ti_ohci *ohci;	/* shortcut to currently handled device */
-	unsigned long ohci_base, ohci_len;
+	unsigned long ohci_base;
 	int i;
 	
 	if (version_printed++ == 0)
@@ -2042,6 +2076,7 @@
 	ohci->id = card_id_counter++;
 	ohci->dev = dev;
 	ohci->host = host;
+	ohci->init_state = OHCI_INIT_ALLOC_HOST;
 	host->pdev = dev;
 	pci_set_drvdata(dev, ohci);
 
@@ -2057,76 +2092,54 @@
 	 * zero. Should this work? Obviously it's not defined what these
 	 * registers will read when they aren't supported. Bleh! */
 	if (dev->vendor == PCI_VENDOR_ID_APPLE && 
-		dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW) {
-			ohci->no_swap_incoming = 1;
-			ohci->selfid_swap = 0;
+	    dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW) {
+		ohci->no_swap_incoming = 1;
+		ohci->selfid_swap = 0;
 	} else
 		ohci->selfid_swap = 1;
 #endif
 
-	/* csr_config rom allocation */
-	ohci->csr_config_rom_cpu = 
-		pci_alloc_consistent(ohci->dev, OHCI_CONFIG_ROM_LEN,
-				     &ohci->csr_config_rom_bus);
-	OHCI_DMA_ALLOC("consistent csr_config_rom");
-	if (ohci->csr_config_rom_cpu == NULL)
-		FAIL(-ENOMEM, "Failed to allocate buffer config rom");
-
-
+	/* We hardwire the MMIO length, since some CardBus adaptors
+	 * fail to report the right length.  Anyway, the ohci spec
+	 * clearly says it's 2kb, so this shouldn't be a problem. */ 
 	ohci_base = pci_resource_start(dev, 0);
-	ohci_len = pci_resource_len(dev, 0);
-
-	if (!request_mem_region (ohci_base, ohci_len, OHCI1394_DRIVER_NAME))
-		FAIL(-ENOMEM, "MMIO resource (0x%lx@0x%lx) unavailable, aborting.",
-		     ohci_base, ohci_len);
-
-	ohci->registers = ioremap(ohci_base, ohci_len);
+	if (pci_resource_len(dev, 0) != OHCI1394_REGISTER_SIZE)
+		PRINT(KERN_WARNING, ohci->id, "Unexpected PCI resource length of %lx!",
+		      pci_resource_len(dev, 0));
+
+	/* Seems PCMCIA handles this internally. Not sure why. Seems
+	 * pretty bogus to force a driver to special case this.  */
+#ifndef PCMCIA
+	if (!request_mem_region (ohci_base, OHCI1394_REGISTER_SIZE, OHCI1394_DRIVER_NAME))
+		FAIL(-ENOMEM, "MMIO resource (0x%lx - 0x%lx) unavailable",
+		     ohci_base, ohci_base + OHCI1394_REGISTER_SIZE);
+#endif
+	ohci->init_state = OHCI_INIT_HAVE_MEM_REGION;
 
+	ohci->registers = ioremap(ohci_base, OHCI1394_REGISTER_SIZE);
 	if (ohci->registers == NULL)
 		FAIL(-ENXIO, "Failed to remap registers - card not accessible");
-
+	ohci->init_state = OHCI_INIT_HAVE_IOMAPPING;
 	DBGMSG(ohci->id, "Remapped memory spaces reg 0x%p", ohci->registers);
 
+	/* csr_config rom allocation */
+	ohci->csr_config_rom_cpu =
+		pci_alloc_consistent(ohci->dev, OHCI_CONFIG_ROM_LEN,
+				     &ohci->csr_config_rom_bus);
+	OHCI_DMA_ALLOC("consistent csr_config_rom");
+	if (ohci->csr_config_rom_cpu == NULL)
+		FAIL(-ENOMEM, "Failed to allocate buffer config rom");
+	ohci->init_state = OHCI_INIT_HAVE_CONFIG_ROM_BUFFER;
 
-	/* Start off with a softreset, to clear everything to a sane
-	 * state.  This will also set Link Power State (LPS), which we
-	 * need in order to start accessing most of the registers.  */
-	ohci_soft_reset(ohci);
-
-	/* determinte the number of available IR and IT contexts right away,
-	   because they need to be known for alloc_dma_*_ctx() */
-	ohci->nb_iso_rcv_ctx = 
-		get_nb_iso_ctx(ohci, OHCI1394_IsoRecvIntMaskSet);
-	DBGMSG(ohci->id, "%d iso receive contexts available",
-	       ohci->nb_iso_rcv_ctx);
-
-	ohci->ir_ctx_usage = 0;
-	
-	/* set the usage bits for non-existent contexts so they can't be allocated */
-	for(i = ohci->nb_iso_rcv_ctx; i < sizeof(ohci->ir_ctx_usage)*8; i++)
-		__set_bit(i, &ohci->ir_ctx_usage);
-	
-	ohci->nb_iso_xmit_ctx = 
-		get_nb_iso_ctx(ohci, OHCI1394_IsoXmitIntMaskSet);
-	DBGMSG(ohci->id, "%d iso transmit contexts available",
-	       ohci->nb_iso_xmit_ctx);
-
-	ohci->it_ctx_usage = 0;
-	
-	/* set the usage bits for non-existent contexts so they can't be allocated */
-	for(i = ohci->nb_iso_xmit_ctx; i < sizeof(ohci->it_ctx_usage)*8; i++)
-		__set_bit(i, &ohci->it_ctx_usage);
-
-	
-	/* 
-	 * self-id dma buffer allocation
-	 */
+	/* self-id dma buffer allocation */
 	ohci->selfid_buf_cpu = 
 		pci_alloc_consistent(ohci->dev, OHCI1394_SI_DMA_BUF_SIZE,
                       &ohci->selfid_buf_bus);
 	OHCI_DMA_ALLOC("consistent selfid_buf");
+	
 	if (ohci->selfid_buf_cpu == NULL)
 		FAIL(-ENOMEM, "Failed to allocate DMA buffer for self-id packets");
+	ohci->init_state = OHCI_INIT_HAVE_SELFID_BUFFER;
 
 	if ((unsigned long)ohci->selfid_buf_cpu & 0x1fff)
 		PRINT(KERN_INFO, ohci->id, "SelfID buffer %p is not aligned on "
@@ -2136,6 +2149,7 @@
 	/* No self-id errors at startup */
 	ohci->self_id_errors = 0;
 
+	ohci->init_state = OHCI_INIT_HAVE_TXRX_BUFFERS__MAYBE;
 	/* AR DMA request context allocation */
 	ohci->ar_req_context = 
 		alloc_dma_rcv_ctx(ohci, DMA_CTX_ASYNC_REQ, 0, AR_REQ_NUM_DESC,
@@ -2170,6 +2184,9 @@
 	if (ohci->at_resp_context == NULL)
 		FAIL(-ENOMEM, "Failed to allocate AT Resp context");
 
+	ohci->ir_ctx_usage = 0;
+	ohci->it_ctx_usage = 0;
+	
 	/* IR DMA context */
 	ohci->ir_context =
 		alloc_dma_rcv_ctx(ohci, DMA_CTX_ISO, 0, IR_NUM_DESC,
@@ -2200,85 +2217,76 @@
 			 OHCI1394_DRIVER_NAME, ohci))
 		FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq);
 
+	ohci->init_state = OHCI_INIT_HAVE_IRQ;
 	ohci_initialize(ohci);
 
 	/* Tell the highlevel this host is ready */
 	hpsb_add_host(host);
+	ohci->init_state = OHCI_INIT_DONE;
 
 	return 0;
 #undef FAIL
 }
 
-static void __devexit ohci1394_pci_remove(struct pci_dev *pdev)
+static void ohci1394_pci_remove(struct pci_dev *pdev)
 {
 	struct ti_ohci *ohci;
-	quadlet_t buf;
 
 	ohci = pci_get_drvdata(pdev);
 	if (!ohci)
 		return;
 
-	if (ohci->host)
+	switch (ohci->init_state) {
+	case OHCI_INIT_DONE:
 		hpsb_remove_host(ohci->host);
 
-	/* Soft reset before we start */
-	ohci_soft_reset(ohci);
-
-	/* Free AR dma */
-	free_dma_rcv_ctx(&ohci->ar_req_context);
-	free_dma_rcv_ctx(&ohci->ar_resp_context);
-
-	/* Free AT dma */
-	free_dma_trm_ctx(&ohci->at_req_context);
-	free_dma_trm_ctx(&ohci->at_resp_context);
-
-	/* Free IR dma */
-	free_dma_rcv_ctx(&ohci->ir_context);
-
-        /* Free IT dma */
-        free_dma_trm_ctx(&ohci->it_context);
-
-	/* Disable all interrupts */
-	reg_write(ohci, OHCI1394_IntMaskClear, 0x80000000);
-	free_irq(ohci->dev->irq, ohci);
+	case OHCI_INIT_HAVE_IRQ:
+		/* Soft reset before we start - this disables
+		 * interrupts and clears linkEnable and LPS. */
+		ohci_soft_reset(ohci);
+		free_irq(ohci->dev->irq, ohci);
+
+	case OHCI_INIT_HAVE_TXRX_BUFFERS__MAYBE:
+		/* Free AR dma */
+		free_dma_rcv_ctx(&ohci->ar_req_context);
+		free_dma_rcv_ctx(&ohci->ar_resp_context);
+
+		/* Free AT dma */
+		free_dma_trm_ctx(&ohci->at_req_context);
+		free_dma_trm_ctx(&ohci->at_resp_context);
 
-	/* Free self-id buffer */
-	if (ohci->selfid_buf_cpu) {
+		/* Free IR dma */
+		free_dma_rcv_ctx(&ohci->ir_context);
+		
+		/* Free IT dma */
+		free_dma_trm_ctx(&ohci->it_context);
+	
+	case OHCI_INIT_HAVE_SELFID_BUFFER:
 		pci_free_consistent(ohci->dev, OHCI1394_SI_DMA_BUF_SIZE, 
 				    ohci->selfid_buf_cpu,
 				    ohci->selfid_buf_bus);
 		OHCI_DMA_FREE("consistent selfid_buf");
-	}
-	
-	/* Free config rom */
-	if (ohci->csr_config_rom_cpu) {
+		
+	case OHCI_INIT_HAVE_CONFIG_ROM_BUFFER:
 		pci_free_consistent(ohci->dev, OHCI_CONFIG_ROM_LEN,
-				    ohci->csr_config_rom_cpu, 
+				    ohci->csr_config_rom_cpu,
 				    ohci->csr_config_rom_bus);
 		OHCI_DMA_FREE("consistent csr_config_rom");
-	}
-
-	/* Disable our bus options */
-	buf = reg_read(ohci, OHCI1394_BusOptions);
-	buf &= ~0xf8000000;
-	buf |=  0x00ff0000;
-	reg_write(ohci, OHCI1394_BusOptions, buf);
-
-	/* Clear LinkEnable and LPS */
-	reg_write(ohci, OHCI1394_HCControlClear, 0x000a0000);
 
-	if (ohci->registers)
+	case OHCI_INIT_HAVE_IOMAPPING:
 		iounmap(ohci->registers);
 
-	release_mem_region (pci_resource_start(ohci->dev, 0),
-			    pci_resource_len(ohci->dev, 0));
+	case OHCI_INIT_HAVE_MEM_REGION:
+#ifndef PCMCIA
+		release_mem_region(pci_resource_start(ohci->dev, 0),
+				   OHCI1394_REGISTER_SIZE);
+#endif
 
 #ifdef CONFIG_ALL_PPC
-	/* On UniNorth, power down the cable and turn off the
-	 * chip clock when the module is removed to save power
-	 * on laptops. Turning it back ON is done by the arch
-	 * code when pci_enable_device() is called
-	 */
+	/* On UniNorth, power down the cable and turn off the chip
+	 * clock when the module is removed to save power on
+	 * laptops. Turning it back ON is done by the arch code when
+	 * pci_enable_device() is called */
 	{
 		struct device_node* of_node;
 
@@ -2290,8 +2298,10 @@
 	}
 #endif /* CONFIG_ALL_PPC */
 
-	pci_set_drvdata(ohci->dev, NULL);
-	hpsb_unref_host(ohci->host);
+	case OHCI_INIT_ALLOC_HOST:
+		pci_set_drvdata(ohci->dev, NULL);
+		hpsb_unref_host(ohci->host);
+	}
 }
 
 #define PCI_CLASS_FIREWIRE_OHCI     ((PCI_CLASS_SERIAL_FIREWIRE << 8) | 0x10)
@@ -2314,7 +2324,7 @@
 	name:		OHCI1394_DRIVER_NAME,
 	id_table:	ohci1394_pci_tbl,
 	probe:		ohci1394_pci_probe,
-	remove:		__devexit_p(ohci1394_pci_remove),
+	remove:		ohci1394_pci_remove,
 };
 
 
diff -urN linux-2.4.19-rc1/drivers/ieee1394/ohci1394.h linux-2.4.19-rc2/drivers/ieee1394/ohci1394.h
--- linux-2.4.19-rc1/drivers/ieee1394/ohci1394.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/ohci1394.h	Tue Jul 16 16:25:19 2002
@@ -24,6 +24,7 @@
 #include <asm/io.h>
 
 #include "ieee1394_types.h"
+#include <asm/io.h>
 
 #define OHCI1394_DRIVER_NAME      "ohci1394"
 
@@ -145,7 +146,16 @@
 
         struct pci_dev *dev;
 
-        u32 state;
+	enum { 
+		OHCI_INIT_ALLOC_HOST,
+		OHCI_INIT_HAVE_MEM_REGION,
+		OHCI_INIT_HAVE_IOMAPPING,
+		OHCI_INIT_HAVE_CONFIG_ROM_BUFFER,
+		OHCI_INIT_HAVE_SELFID_BUFFER,
+		OHCI_INIT_HAVE_TXRX_BUFFERS__MAYBE,
+		OHCI_INIT_HAVE_IRQ,
+		OHCI_INIT_DONE,
+	} init_state;
         
         /* remapped memory spaces */
         void *registers; 
diff -urN linux-2.4.19-rc1/drivers/ieee1394/pcilynx.c linux-2.4.19-rc2/drivers/ieee1394/pcilynx.c
--- linux-2.4.19-rc1/drivers/ieee1394/pcilynx.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/pcilynx.c	Tue Jul 16 16:25:19 2002
@@ -2,6 +2,7 @@
  * ti_pcilynx.c - Texas Instruments PCILynx driver
  * Copyright (C) 1999,2000 Andreas Bombe <andreas.bombe@munich.netsurf.de>,
  *                         Stephan Linz <linz@mazet.de>
+ *                         Manfred Weihs <weihs@ict.tuwien.ac.at>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -41,6 +42,8 @@
 #include "highlevel.h"
 #include "pcilynx.h"
 
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 
 /* print general (card independent) information */
 #define PRINT_G(level, fmt, args...) printk(level "pcilynx: " fmt "\n" , ## args)
@@ -56,9 +59,85 @@
 #endif
 
 
+/* Module Parameters */
+MODULE_PARM(skip_eeprom,"i");
+MODULE_PARM_DESC(skip_eeprom, "Do not try to read bus info block from serial eeprom, but user generic one (default = 0).");
+static int skip_eeprom = 0;
+
+
 static struct hpsb_host_driver *lynx_driver;
 static unsigned int card_id;
 
+
+
+/*
+ * I2C stuff
+ */
+
+/* the i2c stuff was inspired by i2c-philips-par.c */
+
+static void bit_setscl(void *data, int state)
+{
+	if (state) {
+		  ((struct ti_lynx *) data)->i2c_driven_state |= 0x00000040;
+	} else {
+		  ((struct ti_lynx *) data)->i2c_driven_state &= ~0x00000040;
+	}
+	reg_write((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL, ((struct ti_lynx *) data)->i2c_driven_state);
+}
+
+static void bit_setsda(void *data, int state)
+{
+	if (state) {
+		  ((struct ti_lynx *) data)->i2c_driven_state |= 0x00000010;
+	} else {
+		  ((struct ti_lynx *) data)->i2c_driven_state &= ~0x00000010;
+	}
+	reg_write((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL, ((struct ti_lynx *) data)->i2c_driven_state);
+}
+
+static int bit_getscl(void *data)
+{
+	return reg_read((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL) & 0x00000040;
+}
+
+static int bit_getsda(void *data)
+{
+	return reg_read((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL) & 0x00000010;
+}
+
+static int bit_reg(struct i2c_client *client)
+{
+	return 0;
+}
+
+static int bit_unreg(struct i2c_client *client)
+{
+	return 0;
+}
+
+static struct i2c_algo_bit_data bit_data = {
+	NULL,
+	bit_setsda,
+	bit_setscl,
+	bit_getsda,
+	bit_getscl,
+	5, 5, 100,		/*	waits, timeout */
+}; 
+
+static struct i2c_adapter bit_ops = {
+	"PCILynx I2C adapter",
+	0xAA, //FIXME: probably we should get an id in i2c-id.h
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	bit_reg,
+	bit_unreg,
+};
+
+
+
 /*
  * PCL handling functions.
  */
@@ -1232,6 +1311,11 @@
         int i;
         int error;
 
+        /* needed for i2c communication with serial eeprom */
+        struct i2c_adapter i2c_adapter;
+        struct i2c_algo_bit_data i2c_adapter_data;
+
+        int got_valid_bus_info_block = 0; /* set to 1, if we were able to get a valid bus info block from serial eeprom */
 
         error = -ENXIO;
 
@@ -1492,6 +1576,94 @@
                 if (i != -1) set_phy_reg(lynx, 4, i | 0x40);
         }
 
+
+        if (!skip_eeprom)
+        {
+                i2c_adapter = bit_ops;
+                i2c_adapter_data = bit_data;
+                i2c_adapter.algo_data = &i2c_adapter_data;
+                i2c_adapter_data.data = lynx;
+
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+                PRINT(KERN_DEBUG, lynx->id,"original eeprom control: %d",reg_read(lynx,SERIAL_EEPROM_CONTROL));
+#endif
+
+        	/* reset hardware to sane state */
+        	lynx->i2c_driven_state = 0x00000070;
+        	reg_write(lynx, SERIAL_EEPROM_CONTROL, lynx->i2c_driven_state);
+
+        	if (i2c_bit_add_bus(&i2c_adapter) < 0)
+        	{
+	        	PRINT(KERN_ERR, lynx->id,  "unable to register i2c");
+        	}
+        	else
+        	{
+                        /* do i2c stuff */
+                        unsigned char i2c_cmd = 0x10;
+                        struct i2c_msg msg[2] = { { 0x50, 0, 1, &i2c_cmd }, 
+                                                  { 0x50, I2C_M_RD, 20, (unsigned char*) lynx->config_rom }
+                                                };
+
+
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+                        union i2c_smbus_data data;
+
+                        if (i2c_smbus_xfer(&i2c_adapter, 80, 0, I2C_SMBUS_WRITE, 0, I2C_SMBUS_BYTE,NULL))
+                                PRINT(KERN_ERR, lynx->id,"eeprom read start has failed");
+                        else
+                        {
+                                u16 addr;
+                                for (addr=0x00; addr < 0x100; addr++) {
+                                        if (i2c_smbus_xfer(&i2c_adapter, 80, 0, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE,& data)) {
+                                                PRINT(KERN_ERR, lynx->id, "unable to read i2c %x", addr);
+                                                break;
+                                        }
+                                        else
+                                                PRINT(KERN_DEBUG, lynx->id,"got serial eeprom data at %x: %x",addr, data.byte);
+                                }
+                        }
+#endif
+
+                        /* we use i2c_transfer, because i2c_smbus_read_block_data does not work properly and we
+                           do it more efficiently in one transaction rather then using several reads */
+                        if (i2c_transfer(&i2c_adapter, msg, 2) < 0) {
+                                PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c");
+                        } else {
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+                                int i;
+#endif
+                                PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom");
+                                /* FIXME: probably we shoud rewrite the max_rec, max_ROM(1394a), generation(1394a) and link_spd(1394a) field
+                                   and recalculate the CRC */
+
+#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
+                                for (i=0; i < 5 ; i++)
+                                        PRINT(KERN_DEBUG, lynx->id, "Businfo block quadlet %i: %08x",i, be32_to_cpu(lynx->config_rom[i]));
+#endif
+
+                                /* info_length, crc_length and 1394 magic number to check, if it is really a bus info block */
+                                if (((be32_to_cpu(lynx->config_rom[0]) & 0xffff0000) == 0x04040000) &&
+                                    (lynx->config_rom[1] == __constant_cpu_to_be32(0x31333934)))
+                                {
+                                        PRINT(KERN_DEBUG, lynx->id, "read a valid bus info block from");
+                                        got_valid_bus_info_block = 1;
+                                } else {
+                                        PRINT(KERN_WARNING, lynx->id, "read something from serial eeprom, but it does not seem to be a valid bus info block");
+                                }
+
+                        }
+
+                        i2c_bit_del_bus(&i2c_adapter);
+                }
+        }
+
+        if (got_valid_bus_info_block) {
+                memcpy(lynx->config_rom+5,lynx_csr_rom+5,sizeof(lynx_csr_rom)-20);
+        } else {
+                PRINT(KERN_INFO, lynx->id, "since we did not get a bus info block from serial eeprom, we use a generic one with a hard coded GUID");
+                memcpy(lynx->config_rom,lynx_csr_rom,sizeof(lynx_csr_rom));
+        }
+
         hpsb_add_host(host);
         lynx->state = is_host;
 
@@ -1503,7 +1675,8 @@
 
 static size_t get_lynx_rom(struct hpsb_host *host, const quadlet_t **ptr)
 {
-        *ptr = lynx_csr_rom;
+        struct ti_lynx *lynx = host->hostdata;
+        *ptr = lynx->config_rom;
         return sizeof(lynx_csr_rom);
 }
 
diff -urN linux-2.4.19-rc1/drivers/ieee1394/pcilynx.h linux-2.4.19-rc2/drivers/ieee1394/pcilynx.h
--- linux-2.4.19-rc1/drivers/ieee1394/pcilynx.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/pcilynx.h	Tue Jul 16 16:25:19 2002
@@ -25,6 +25,8 @@
 #define CHANNEL_ASYNC_SEND       3
 #define CHANNEL_ISO_SEND         4
 
+#define PCILYNX_CONFIG_ROM_LENGTH   1024
+
 typedef int pcl_t;
 
 struct ti_lynx {
@@ -48,7 +50,7 @@
         void *local_rom;
         void *local_ram;
         void *aux_port;
-
+        quadlet_t config_rom[PCILYNX_CONFIG_ROM_LENGTH/4];
 
 #ifdef CONFIG_IEEE1394_PCILYNX_PORTS
         atomic_t aux_intr_seen;
@@ -109,6 +111,8 @@
                 struct tasklet_struct tq;
                 spinlock_t lock;
         } iso_rcv;
+
+	u32 i2c_driven_state; /* the state we currently drive the Serial EEPROM Control register */
 };
 
 /* the per-file data structure for mem space access */
@@ -156,6 +160,8 @@
 #define MISC_CONTROL                      0x40
 #define MISC_CONTROL_SWRESET              (1<<0)
 
+#define SERIAL_EEPROM_CONTROL             0x44
+
 #define PCI_INT_STATUS                    0x48
 #define PCI_INT_ENABLE                    0x4c               
 /* status and enable have identical bit numbers */
diff -urN linux-2.4.19-rc1/drivers/ieee1394/raw1394.c linux-2.4.19-rc2/drivers/ieee1394/raw1394.c
--- linux-2.4.19-rc1/drivers/ieee1394/raw1394.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/raw1394.c	Tue Jul 16 16:25:19 2002
@@ -189,6 +189,8 @@
         }
 
         kfree(hi);
+
+        atomic_inc(&internal_generation);
 }
 
 static void host_reset(struct hpsb_host *host)
@@ -223,8 +225,6 @@
                 }
         }
         spin_unlock_irqrestore(&host_info_lock, flags);
-
-        atomic_inc(&internal_generation);
 }
 
 static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
diff -urN linux-2.4.19-rc1/drivers/ieee1394/sbp2.c linux-2.4.19-rc2/drivers/ieee1394/sbp2.c
--- linux-2.4.19-rc1/drivers/ieee1394/sbp2.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/sbp2.c	Tue Jul 16 16:25:19 2002
@@ -86,6 +86,9 @@
  * sbp2_max_sectors, 		- Change max sectors per I/O supported (default = 255)
  * sbp2_max_outstanding_cmds	- Change max outstanding concurrent commands (default = 8)
  * sbp2_max_cmds_per_lun	- Change max concurrent commands per sbp2 device (default = 1)
+ * sbp2_exclusive_login		- Set to zero if you'd like to allow multiple hosts the ability
+ *				  to log in at the same time. Sbp2 device must support this,
+ *				  and you must know what you're doing (default = 1)
  *
  * (e.g. insmod sbp2 sbp2_serialize_io = 1)
  *
@@ -135,11 +138,14 @@
  *	- Error Handling: SCSI aborts and bus reset requests are handled somewhat
  *	  but the code needs additional debugging.
  *
- *	- The SBP-2 driver is currently only supported as a module. It would not take
+ *	- Module: The SBP-2 driver is currently only supported as a module. It would not take
  *	  much work to allow it to be compiled into the kernel, but you'd have to 
  *	  add some init code to the kernel to support this... and modules are much
  *	  more flexible anyway.   ;-)
  *
+ *	- Hot-plugging: Interaction with the SCSI stack and support for hot-plugging could
+ *	  stand some improvement.
+ *
  *
  * History:
  *
@@ -265,7 +271,7 @@
  *		     which do not support requests of 128KB or greater. Now use 
  *		     max_sectors scsi host entry to limit transfer sizes.
  *		   * Change status fifo address from a single address to a set of addresses,
- *		     with each sbp2 device having it's own status fifo address. This makes
+ *		     with each sbp2 device having its own status fifo address. This makes
  *		     it easier to match the status write to the sbp2 device instance.
  *		   * Minor change to use lun when logging into sbp2 devices. First step in
  *		     supporting multi-lun devices such as CD/DVD changer devices.
@@ -278,7 +284,20 @@
  *	02/20/02 - Added a couple additional module load options. 
  *		   Needed to bump down max commands per lun because of the !%@&*^# QPS CDRW 
  *		   drive I have, which doesn't seem to get along with other sbp2 devices 
- *		   (or handle linked commands well).  
+ *		   (or handle linked commands well).
+ *	04/21/02 - Added some additional debug capabilities:
+ *		   * Able to handle phys dma requests directly, if host controller has phys
+ *		     dma disabled (e.g. insmod ohci1394 phys_dma=0). Undefine CONFIG_IEEE1394_SBP2_PHYS_DMA
+ *		     if you'd like to disable sbp2 driver from registering for phys address range. 
+ *		   * New packet dump debug define (CONFIG_IEEE1394_SBP2_PACKET_DUMP) which allows
+ *		     dumping of all sbp2 related packets sent and received. Especially effective
+ *		     when phys dma is disabled on ohci controller (e.g. insmod ohci1394 phys_dma=0).
+ *		   * Added new sbp2 module load option (sbp2_exclusive_login) for allowing
+ *		     non-exclusive login to sbp2 device, for special multi-host applications.
+ *	04/23/02 - Fix for Sony CD-ROM drives. Only send fetch agent reset to sbp2 device if it
+ *		   returns the dead bit in status. Thanks to Chandan (chandan@toad.net) for this one.
+ *	04/27/02 - Fix sbp2 login problem on SMP systems, enable real spinlocks by default. (JSG)
+ *	06/09/02 - Don't force 36-bute SCSI inquiry, but leave in a define for badly behaved devices. (JSG)   
  */
 
 
@@ -305,6 +324,7 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
+#include <asm/atomic.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/scatterlist.h>
@@ -329,6 +349,9 @@
 #include "ieee1394_hotplug.h"
 #include "sbp2.h"
 
+static char version[] __devinitdata =
+	"$Rev: 515 $ James Goodwin <jamesg@filanet.com>";
+
 /*
  * Module load parameter definitions
  */
@@ -387,6 +410,18 @@
 MODULE_PARM_DESC(sbp2_max_cmds_per_lun, "Change max concurrent commands per sbp2 device (default = 1)");
 static int sbp2_max_cmds_per_lun = SBP2SCSI_MAX_CMDS_PER_LUN;
 
+/*
+ * Exclusive login to sbp2 device? In most cases, the sbp2 driver should do an exclusive login, as it's
+ * generally unsafe to have two hosts talking to a single sbp2 device at the same time (filesystem
+ * coherency, etc.). If you're running an sbp2 device that supports multiple logins, and you're either
+ * running read-only filesystems or some sort of special filesystem supporting multiple hosts, then
+ * set sbp2_exclusive_login to zero. Note: The Oxsemi OXFW911 sbp2 chipset supports up to four
+ * concurrent logins.
+ */
+MODULE_PARM(sbp2_exclusive_login,"i");
+MODULE_PARM_DESC(sbp2_exclusive_login, "Exclusive login to sbp2 device (default = 1)");
+static int sbp2_exclusive_login = 1;
+
 
 /*
  * Export information about protocols/devices supported by this driver.
@@ -411,6 +446,7 @@
 /* #define CONFIG_IEEE1394_SBP2_DEBUG_DMA */
 /* #define CONFIG_IEEE1394_SBP2_DEBUG 1 */
 /* #define CONFIG_IEEE1394_SBP2_DEBUG 2 */
+/* #define CONFIG_IEEE1394_SBP2_PACKET_DUMP */
 
 #ifdef CONFIG_IEEE1394_SBP2_DEBUG_ORBS
 #define SBP2_ORB_DEBUG(fmt, args...)	HPSB_ERR("sbp2(%s): "fmt, __FUNCTION__, ## args)
@@ -456,10 +492,10 @@
 #define SBP2_ERR(fmt, args...)		HPSB_ERR("sbp2: "fmt, ## args)
 
 /*
- * Spinlock debugging stuff. I'm playing it safe until the driver has been
- * debugged on SMP. (JSG)
+ * Spinlock debugging stuff.
  */
-/* #define SBP2_USE_REAL_SPINLOCKS */
+#define SBP2_USE_REAL_SPINLOCKS
+
 #ifdef SBP2_USE_REAL_SPINLOCKS
 #define sbp2_spin_lock(lock, flags)	spin_lock_irqsave(lock, flags)	
 #define sbp2_spin_unlock(lock, flags)	spin_unlock_irqrestore(lock, flags);
@@ -470,6 +506,14 @@
 #endif
 
 /*
+ * SCSI inquiry hack for really badly behaved sbp2 devices. Turn this on if your sbp2 device
+ * is not properly handling the SCSI inquiry command. This hack makes the inquiry look more 
+ * like a typical MS Windows inquiry.
+ */
+
+/* #define SBP2_FORCE_36_BYTE_INQUIRY */
+
+/*
  * Globals
  */
 
@@ -490,6 +534,13 @@
 	write: sbp2_handle_status_write
 };
 
+#ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
+static struct hpsb_address_ops sbp2_physdma_ops = {
+        read: sbp2_handle_physdma_read,
+        write: sbp2_handle_physdma_write,
+};
+#endif
+
 static struct hpsb_protocol_driver sbp2_driver = {
 	name:		"SBP2 Driver",
 	id_table: 	sbp2_id_table,
@@ -498,7 +549,6 @@
 	update: 	sbp2_update
 };
 
-
 
 /**************************************
  * General utility functions
@@ -537,6 +587,56 @@
 #define sbp2util_cpu_to_be32_buffer(x,y)
 #endif
 
+#ifdef CONFIG_IEEE1394_SBP2_PACKET_DUMP
+/*
+ * Debug packet dump routine. Length is in bytes.
+ */
+static void sbp2util_packet_dump(void *buffer, int length, char *dump_name, u32 dump_phys_addr)
+{
+	int i;
+	unsigned char *dump = buffer;
+
+	if (!dump || !length || !dump_name)
+		return;
+
+	if (dump_phys_addr)
+		printk("[%s, 0x%x]", dump_name, dump_phys_addr);
+	else
+		printk("[%s]", dump_name);
+	for (i = 0; i < length; i++) {
+		if (i > 0x3f) {
+			printk("\n   ...");
+			break;
+		}
+		if ((i & 0x3) == 0)
+			printk("  ");
+		if ((i & 0xf) == 0)
+			printk("\n   ");
+		printk("%02x ", (int) dump[i]);
+	}
+	printk("\n");
+
+	return;
+}
+#else
+#define sbp2util_packet_dump(w,x,y,z)
+#endif
+
+/*
+ * Goofy routine that basically does a down_timeout function.
+ */
+static int sbp2util_down_timeout(atomic_t *done, int timeout)
+{
+	int i;
+
+	for (i = timeout; (i > 0 && atomic_read(done) == 0); i-= HZ/10) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		if (schedule_timeout(HZ/10))	/* 100ms */
+			return(1);
+	}
+	return ((i > 0) ? 0:1);
+}
+
 /*
  * This function is called to initially create a packet pool for use in
  * sbp2 I/O requests. This packet pool is used when sending out sbp2
@@ -665,7 +765,7 @@
 		
 		hpsb_node_fill_packet(ne, packet);
 
-		packet->tlabel = get_tlabel(hi->host, packet->node_id, 1);
+		packet->tlabel = get_tlabel(hi->host, packet->node_id, 0);
 
 		if (!data_size) {
 			fill_async_writequad(packet, addr, data);
@@ -950,6 +1050,13 @@
 				SBP2_STATUS_FIFO_ADDRESS + 
 				SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(SBP2SCSI_MAX_SCSI_IDS+1));
 
+	/*
+	 * Handle data movement if physical dma is not enabled/supported on host controller
+	 */
+#ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
+	hpsb_register_addrspace(sbp2_hl_handle, &sbp2_physdma_ops, 0x0ULL, 0xfffffffcULL);
+#endif
+
 	hpsb_register_protocol(&sbp2_driver);
 
 	return 0;
@@ -1241,7 +1348,7 @@
 	scsi_id->max_payload_size = sbp2_speedto_maxrec[SPEED_100];
 	ud->driver_data = scsi_id;
 
-	init_waitqueue_head(&scsi_id->sbp2_login_wait);
+	atomic_set(&scsi_id->sbp2_login_complete, 0);
 
 	/* 
 	 * Initialize structures needed for the command orb pool.
@@ -1379,20 +1486,62 @@
 	kfree(scsi_id);
 }
 
-
+#ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
+/*
+ * This function deals with physical dma write requests (for adapters that do not support
+ * physical dma in hardware). Mostly just here for debugging...
+ */
+static int sbp2_handle_physdma_write(struct hpsb_host *host, int nodeid, int destid, quadlet_t *data,
+                                     u64 addr, unsigned int length)
+{
+
+        /*
+         * Manually put the data in the right place.
+         */
+        memcpy(bus_to_virt((u32)addr), data, length);
+	sbp2util_packet_dump(data, length, "sbp2 phys dma write by device", (u32)addr);
+        return(RCODE_COMPLETE);
+}
+
+/*
+ * This function deals with physical dma read requests (for adapters that do not support
+ * physical dma in hardware). Mostly just here for debugging...
+ */
+static int sbp2_handle_physdma_read(struct hpsb_host *host, int nodeid, quadlet_t *data,
+                                    u64 addr, unsigned int length)
+{
+
+        /*
+         * Grab data from memory and send a read response.
+         */
+        memcpy(data, bus_to_virt((u32)addr), length);
+	sbp2util_packet_dump(data, length, "sbp2 phys dma read by device", (u32)addr);
+        return(RCODE_COMPLETE);
+}
+#endif
+
 
 /**************************************
  * SBP-2 protocol related section
  **************************************/
 
 /*
+ * This function determines if we should convert scsi commands for a particular sbp2 device type
+ */
+static __inline__ int sbp2_command_conversion_device_type(u8 device_type)
+{
+	return (((device_type == TYPE_DISK) ||
+		 (device_type == TYPE_SDAD) ||
+		 (device_type == TYPE_ROM)) ? 1:0);
+}
+
+/*
  * This function is called in order to login to a particular SBP-2 device,
  * after a bus reset.
  */
 static int sbp2_login_device(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id) 
 {
 	quadlet_t data[2];
-	unsigned long flags;
 
 	SBP2_DEBUG("sbp2_login_device");
 
@@ -1412,7 +1561,7 @@
 
 	scsi_id->login_orb->lun_misc = ORB_SET_FUNCTION(LOGIN_REQUEST);
 	scsi_id->login_orb->lun_misc |= ORB_SET_RECONNECT(0);	/* One second reconnect time */
-	scsi_id->login_orb->lun_misc |= ORB_SET_EXCLUSIVE(1);	/* Exclusive access to device */
+	scsi_id->login_orb->lun_misc |= ORB_SET_EXCLUSIVE(sbp2_exclusive_login);	/* Exclusive access to device */
 	scsi_id->login_orb->lun_misc |= ORB_SET_NOTIFY(1);	/* Notify us of login complete */
 	/* Set the lun if we were able to pull it from the device's unit directory */
 	if (scsi_id->sbp2_device_type_and_lun != SBP2_DEVICE_TYPE_LUN_UNINITIALIZED) {
@@ -1437,6 +1586,9 @@
 
 	SBP2_DEBUG("sbp2_login_device: orb byte-swapped");
 
+	sbp2util_packet_dump(scsi_id->login_orb, sizeof(struct sbp2_login_orb), 
+			     "sbp2 login orb", scsi_id->login_orb_dma);
+
 	/*
 	 * Initialize login response and status fifo
 	 */
@@ -1452,35 +1604,28 @@
 	data[1] = scsi_id->login_orb_dma;
 	sbp2util_cpu_to_be32_buffer(data, 8);
 
+	atomic_set(&scsi_id->sbp2_login_complete, 0);
+
 	SBP2_DEBUG("sbp2_login_device: prepared to write");
 	hpsb_node_write(scsi_id->ne, scsi_id->sbp2_management_agent_addr, data, 8);
 	SBP2_DEBUG("sbp2_login_device: written");
 
 	/*
-	 * Wait for login status... but, only if the device has not
-	 * already logged-in (some devices are fast)
+	 * Wait for login status (up to 20 seconds)... 
 	 */
-
-	save_flags(flags);
-	cli();
-	/* 20 second timeout */
-	if (scsi_id->status_block.ORB_offset_lo != scsi_id->login_orb_dma)
-		sleep_on_timeout(&scsi_id->sbp2_login_wait, 20*HZ);
-	restore_flags(flags);
-
-	SBP2_DEBUG("sbp2_login_device: initial check");
+	if (sbp2util_down_timeout(&scsi_id->sbp2_login_complete, 20*HZ)) {
+		SBP2_ERR("Error logging into SBP-2 device - login timed-out");
+		return(-EIO);
+	}
 
 	/*
-	 * Match status to the login orb. If they do not match, it's
-	 * probably because the login timed-out.
+	 * Sanity. Make sure status returned matches login orb.
 	 */
 	if (scsi_id->status_block.ORB_offset_lo != scsi_id->login_orb_dma) {
 		SBP2_ERR("Error logging into SBP-2 device - login timed-out");
 		return(-EIO);
 	}
 
-	SBP2_DEBUG("sbp2_login_device: second check");
-
 	/*
 	 * Check status
 	 */
@@ -1552,6 +1697,9 @@
 	 */
 	sbp2util_cpu_to_be32_buffer(scsi_id->logout_orb, sizeof(struct sbp2_logout_orb));
 
+	sbp2util_packet_dump(scsi_id->logout_orb, sizeof(struct sbp2_logout_orb), 
+			     "sbp2 logout orb", scsi_id->logout_orb_dma);
+
 	/*
 	 * Ok, let's write to the target's management agent register
 	 */
@@ -1559,10 +1707,12 @@
 	data[1] = scsi_id->logout_orb_dma;
 	sbp2util_cpu_to_be32_buffer(data, 8);
 
+	atomic_set(&scsi_id->sbp2_login_complete, 0);
+
 	hpsb_node_write(scsi_id->ne, scsi_id->sbp2_management_agent_addr, data, 8);
 
 	/* Wait for device to logout...1 second. */
-	sleep_on_timeout(&scsi_id->sbp2_login_wait, HZ);
+	sbp2util_down_timeout(&scsi_id->sbp2_login_complete, HZ);
 
 	SBP2_INFO("Logged out of SBP-2 device");
 
@@ -1577,7 +1727,6 @@
 static int sbp2_reconnect_device(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id) 
 {
 	quadlet_t data[2];
-	unsigned long flags;
 
 	SBP2_DEBUG("sbp2_reconnect_device");
 
@@ -1607,6 +1756,9 @@
 	 */
 	sbp2util_cpu_to_be32_buffer(scsi_id->reconnect_orb, sizeof(struct sbp2_reconnect_orb));
 
+	sbp2util_packet_dump(scsi_id->reconnect_orb, sizeof(struct sbp2_reconnect_orb), 
+			     "sbp2 reconnect orb", scsi_id->reconnect_orb_dma);
+
 	/*
 	 * Initialize status fifo
 	 */
@@ -1619,22 +1771,20 @@
 	data[1] = scsi_id->reconnect_orb_dma;
 	sbp2util_cpu_to_be32_buffer(data, 8);
 
+	atomic_set(&scsi_id->sbp2_login_complete, 0);
+
 	hpsb_node_write(scsi_id->ne, scsi_id->sbp2_management_agent_addr, data, 8);
 
 	/*
-	 * Wait for reconnect status... but, only if the device has not
-	 * already reconnected (some devices are fast).
+	 * Wait for reconnect status (up to 1 second)...
 	 */
-	save_flags(flags);
-	cli();
-	/* One second timout */
-	if (scsi_id->status_block.ORB_offset_lo != scsi_id->reconnect_orb_dma)
-		sleep_on_timeout(&scsi_id->sbp2_login_wait, HZ);
-	restore_flags(flags);
+	if (sbp2util_down_timeout(&scsi_id->sbp2_login_complete, HZ)) {
+		SBP2_ERR("Error reconnecting to SBP-2 device - reconnect timed-out");
+		return(-EIO);
+	}
 
 	/*
-	 * Match status to the reconnect orb. If they do not match, it's
-	 * probably because the reconnect timed-out.
+	 * Sanity. Make sure status returned matches reconnect orb.
 	 */
 	if (scsi_id->status_block.ORB_offset_lo != scsi_id->reconnect_orb_dma) {
 		SBP2_ERR("Error reconnecting to SBP-2 device - reconnect timed-out");
@@ -2002,6 +2152,10 @@
 			/* Number of page table (s/g) elements */
 			command_orb->misc |= ORB_SET_DATA_SIZE(sg_count);
 
+			sbp2util_packet_dump(scatter_gather_element, 
+					     (sizeof(struct sbp2_unrestricted_page_table)) * sg_count, 
+					     "sbp2 s/g list", command->sge_dma);
+
 			/*
 			 * Byte swap page tables if necessary
 			 */
@@ -2081,6 +2235,10 @@
 			/* Number of page table (s/g) elements */
 			command_orb->misc |= ORB_SET_DATA_SIZE(sg_count);
 
+			sbp2util_packet_dump(scatter_gather_element, 
+					     (sizeof(struct sbp2_unrestricted_page_table)) * sg_count, 
+					     "sbp2 s/g list", command->sge_dma);
+
 			/*
 			 * Byte swap page tables if necessary
 			 */
@@ -2219,13 +2377,11 @@
 {
 	unchar *cmd = (unchar *) SCpnt->cmnd;
 	unsigned int request_bufflen = SCpnt->request_bufflen;
-	u8 device_type
-		= SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);
 	struct sbp2_command_info *command;
 
 	SBP2_DEBUG("sbp2_send_command");
-	SBP2_DEBUG("SCSI command:");
-#if CONFIG_IEEE1394_SBP2_DEBUG >= 2
+#if (CONFIG_IEEE1394_SBP2_DEBUG >= 2) || defined(CONFIG_IEEE1394_SBP2_PACKET_DUMP)
+	printk("[scsi command]\n   ");
 	print_command (cmd);
 #endif
 	SBP2_DEBUG("SCSI transfer size = %x", request_bufflen);
@@ -2242,11 +2398,14 @@
 	/*
 	 * The scsi stack sends down a request_bufflen which does not match the
 	 * length field in the scsi cdb. This causes some sbp2 devices to 
-	 * reject this inquiry command. Hack fix is to set both buff length and
-	 * length field in cdb to 36. This gives best compatibility.
+	 * reject this inquiry command. Fix the request_bufflen. 
 	 */
 	if (*cmd == INQUIRY) {
+#ifdef SBP2_FORCE_36_BYTE_INQUIRY
 		request_bufflen = cmd[4] = 0x24;
+#else
+		request_bufflen = cmd[4];
+#endif
 	}
 
 	/*
@@ -2259,11 +2418,10 @@
 	 * Update our cdb if necessary (to handle sbp2 RBC command set
 	 * differences). This is where the command set hacks go!   =)
 	 */
-	if ((device_type == TYPE_DISK) ||
-	    (device_type == TYPE_SDAD) ||
-	    (device_type == TYPE_ROM)) {
-		sbp2_check_sbp2_command(command->command_orb.cdb);
-	}
+	sbp2_check_sbp2_command(scsi_id, command->command_orb.cdb);
+
+	sbp2util_packet_dump(&command->command_orb, sizeof(struct sbp2_command_orb), 
+			     "sbp2 command orb", command->command_orb_dma);
 
 	/*
 	 * Initialize status fifo
@@ -2283,9 +2441,10 @@
  * This function deals with command set differences between Linux scsi
  * command set and sbp2 RBC command set.
  */
-static void sbp2_check_sbp2_command(unchar *cmd)
+static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd)
 {
 	unchar new_cmd[16];
+	u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);
 
 	SBP2_DEBUG("sbp2_check_sbp2_command");
 
@@ -2293,67 +2452,79 @@
 		
 		case READ_6:
 
-			SBP2_DEBUG("Convert READ_6 to READ_10");
+			if (sbp2_command_conversion_device_type(device_type)) {
 
-			/*
-			 * Need to turn read_6 into read_10
-			 */
-			new_cmd[0] = 0x28;
-			new_cmd[1] = (cmd[1] & 0xe0);
-			new_cmd[2] = 0x0;
-			new_cmd[3] = (cmd[1] & 0x1f);
-			new_cmd[4] = cmd[2];
-			new_cmd[5] = cmd[3];
-			new_cmd[6] = 0x0;
-			new_cmd[7] = 0x0;
-			new_cmd[8] = cmd[4];
-			new_cmd[9] = cmd[5];
+				SBP2_DEBUG("Convert READ_6 to READ_10");
+					    
+				/*
+				 * Need to turn read_6 into read_10
+				 */
+				new_cmd[0] = 0x28;
+				new_cmd[1] = (cmd[1] & 0xe0);
+				new_cmd[2] = 0x0;
+				new_cmd[3] = (cmd[1] & 0x1f);
+				new_cmd[4] = cmd[2];
+				new_cmd[5] = cmd[3];
+				new_cmd[6] = 0x0;
+				new_cmd[7] = 0x0;
+				new_cmd[8] = cmd[4];
+				new_cmd[9] = cmd[5];
+	
+				memcpy(cmd, new_cmd, 10);
 
-			memcpy(cmd, new_cmd, 10);
+			}
 
 			break;
 
 		case WRITE_6:
 
-			SBP2_DEBUG("Convert WRITE_6 to WRITE_10");
+			if (sbp2_command_conversion_device_type(device_type)) {
 
-			/*
-			 * Need to turn write_6 into write_10
-			 */
-			new_cmd[0] = 0x2a;
-			new_cmd[1] = (cmd[1] & 0xe0);
-			new_cmd[2] = 0x0;
-			new_cmd[3] = (cmd[1] & 0x1f);
-			new_cmd[4] = cmd[2];
-			new_cmd[5] = cmd[3];
-			new_cmd[6] = 0x0;
-			new_cmd[7] = 0x0;
-			new_cmd[8] = cmd[4];
-			new_cmd[9] = cmd[5];
+				SBP2_DEBUG("Convert WRITE_6 to WRITE_10");
+	
+				/*
+				 * Need to turn write_6 into write_10
+				 */
+				new_cmd[0] = 0x2a;
+				new_cmd[1] = (cmd[1] & 0xe0);
+				new_cmd[2] = 0x0;
+				new_cmd[3] = (cmd[1] & 0x1f);
+				new_cmd[4] = cmd[2];
+				new_cmd[5] = cmd[3];
+				new_cmd[6] = 0x0;
+				new_cmd[7] = 0x0;
+				new_cmd[8] = cmd[4];
+				new_cmd[9] = cmd[5];
+	
+				memcpy(cmd, new_cmd, 10);
 
-			memcpy(cmd, new_cmd, 10);
+			}
 
 			break;
 
 		case MODE_SENSE:
 
-			SBP2_DEBUG("Convert MODE_SENSE_6 to MOSE_SENSE_10");
+			if (sbp2_command_conversion_device_type(device_type)) {
 
-			/*
-			 * Need to turn mode_sense_6 into mode_sense_10
-			 */
-			new_cmd[0] = 0x5a;
-			new_cmd[1] = cmd[1];
-			new_cmd[2] = cmd[2];
-			new_cmd[3] = 0x0;
-			new_cmd[4] = 0x0;
-			new_cmd[5] = 0x0;
-			new_cmd[6] = 0x0;
-			new_cmd[7] = 0x0;
-			new_cmd[8] = cmd[4];
-			new_cmd[9] = cmd[5];
+				SBP2_DEBUG("Convert MODE_SENSE_6 to MODE_SENSE_10");
 
-			memcpy(cmd, new_cmd, 10);
+				/*
+				 * Need to turn mode_sense_6 into mode_sense_10
+				 */
+				new_cmd[0] = 0x5a;
+				new_cmd[1] = cmd[1];
+				new_cmd[2] = cmd[2];
+				new_cmd[3] = 0x0;
+				new_cmd[4] = 0x0;
+				new_cmd[5] = 0x0;
+				new_cmd[6] = 0x0;
+				new_cmd[7] = 0x0;
+				new_cmd[8] = cmd[4];
+				new_cmd[9] = cmd[5];
+	
+				memcpy(cmd, new_cmd, 10);
+
+			}
 
 			break;
 
@@ -2404,8 +2575,7 @@
  * This function is called after a command is completed, in order to do any necessary SBP-2
  * response data translations for the SCSI stack
  */
-static void sbp2_check_sbp2_response(struct sbp2scsi_host_info *hi,
-				     struct scsi_id_instance_data *scsi_id, 
+static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id, 
 				     Scsi_Cmnd *SCpnt)
 {
 	u8 *scsi_buf = SCpnt->request_buffer;
@@ -2451,18 +2621,16 @@
 
 		case MODE_SENSE:
 
-			if ((device_type == TYPE_DISK) ||
-			    (device_type == TYPE_SDAD) ||
-			    (device_type == TYPE_ROM)) {
-
+			if (sbp2_command_conversion_device_type(device_type)) {
+			
 				SBP2_DEBUG("Modify mode sense response (10 byte version)");
-	
+
 				scsi_buf[0] = scsi_buf[1];	/* Mode data length */
 				scsi_buf[1] = scsi_buf[2];	/* Medium type */
 				scsi_buf[2] = scsi_buf[3];	/* Device specific parameter */
 				scsi_buf[3] = scsi_buf[7];	/* Block descriptor length */
 				memcpy(scsi_buf + 4, scsi_buf + 8, scsi_buf[0]);
-
+	
 			}
 
 			break;
@@ -2495,6 +2663,8 @@
 
 	SBP2_DEBUG("sbp2_handle_status_write");
 
+	sbp2util_packet_dump(data, length, "sbp2 status write by device", (u32)addr);
+
 	if (!host) {
 		SBP2_ERR("host is NULL - this is bad!");
 		return(RCODE_ADDRESS_ERROR);
@@ -2566,21 +2736,21 @@
 				/*
 				 * Translate SBP-2 status to SCSI sense data
 				 */
+				SBP2_DEBUG("CHECK CONDITION");
 				scsi_status = sbp2_status_to_sense_data((unchar *)&scsi_id->status_block, SCpnt->sense_buffer);
 			}
 
 			/*
-			 * Handle check conditions. If there is either SBP status or SCSI status
-			 * then we'll do a fetch agent reset and note that a check condition
-			 * occured.
+			 * Check to see if the dead bit is set. If so, we'll have to initiate
+			 * a fetch agent reset.
 			 */
-			if (STATUS_GET_SBP_STATUS(scsi_id->status_block.ORB_offset_hi_misc) ||
-			    scsi_status) {
+			if (STATUS_GET_DEAD_BIT(scsi_id->status_block.ORB_offset_hi_misc)) {
+
 				/*
 				 * Initiate a fetch agent reset. 
 				 */
-				SBP2_DEBUG("CHECK CONDITION");
-				sbp2_agent_reset(hi, scsi_id, SBP2_SEND_NO_WAIT);
+				SBP2_DEBUG("Dead bit set - initiating fetch agent reset");
+                                sbp2_agent_reset(hi, scsi_id, SBP2_SEND_NO_WAIT);
 			}
 
 			SBP2_ORB_DEBUG("completing command orb %p", &command->command_orb);
@@ -2602,10 +2772,19 @@
 			scsi_id->last_orb = NULL;
 		}
 
+	} else {
+		
+		/* 
+		 * It's probably a login/logout/reconnect status.
+		 */
+		if ((scsi_id->login_orb_dma == scsi_id->status_block.ORB_offset_lo) ||
+		    (scsi_id->reconnect_orb_dma == scsi_id->status_block.ORB_offset_lo) ||
+		    (scsi_id->logout_orb_dma == scsi_id->status_block.ORB_offset_lo)) {
+			atomic_set(&scsi_id->sbp2_login_complete, 1);
+		}
 	}
 
 	sbp2_spin_unlock(&hi->sbp2_command_lock, flags);
-	wake_up(&scsi_id->sbp2_login_wait);
 	return(RCODE_COMPLETE);
 }
 
@@ -2805,7 +2984,7 @@
 	 * Take care of any sbp2 response data mucking here (RBC stuff, etc.)
 	 */
 	if (SCpnt->result == DID_OK) {
-		sbp2_check_sbp2_response(hi, scsi_id, SCpnt);
+		sbp2_check_sbp2_response(scsi_id, SCpnt);
 	}
 
 	/*
@@ -2822,10 +3001,13 @@
 	 * retried... it could have happened because of a 1394 bus reset
 	 * or hot-plug...
 	 */
-	if ((scsi_status == SBP2_SCSI_STATUS_CHECK_CONDITION) && (SCpnt->sense_buffer[2] == UNIT_ATTENTION)) {
+#if 0
+	if ((scsi_status == SBP2_SCSI_STATUS_CHECK_CONDITION) && 
+	    (SCpnt->sense_buffer[2] == UNIT_ATTENTION)) {
 		SBP2_DEBUG("UNIT ATTENTION - return busy");
 		SCpnt->result = DID_BUS_BUSY << 16;
 	}
+#endif
 
 	/*
 	 * Tell scsi stack that we're done with this command
@@ -2835,9 +3017,9 @@
 	done (SCpnt);
 	spin_unlock_irq(&io_request_lock);
 #else
-	spin_lock_irq(&hi->scsi_host->host_lock);
+	spin_lock_irq(hi->scsi_host->host_lock);
 	done (SCpnt);
-	spin_unlock_irq(&hi->scsi_host->host_lock);
+	spin_unlock_irq(hi->scsi_host->host_lock);
 #endif
 
 	return;
@@ -2905,7 +3087,7 @@
 	SBP2_ERR("reset requested");
 
 	if (scsi_id) {
-		SBP2_ERR("Generating IEEE-1394 bus reset");
+		SBP2_ERR("Generating sbp2 fetch agent reset");
 		sbp2_agent_reset(hi, scsi_id, SBP2_SEND_NO_WAIT);
 	}
 
@@ -2969,19 +3151,22 @@
 	if (!hi) /* shouldn't happen, but... */
         	return "IEEE-1394 SBP-2 protocol driver";
 
-	sprintf(info, "IEEE-1394 SBP-2 protocol driver (host: %s)\n"
+	sprintf(info, "IEEE-1394 SBP-2 protocol driver (host: %s)\n%s\n"
 		"SBP-2 module load options:\n"
 		"- Max speed supported: %s\n"
 		"- Max sectors per I/O supported: %d\n"
 		"- Max outstanding commands supported: %d\n"
 		"- Max outstanding commands per lun supported: %d\n"
-                "- Serialized I/O (debug): %s",
-		hi->host->driver->name, 
+                "- Serialized I/O (debug): %s\n"
+		"- Exclusive login: %s",
+		hi->host->driver->name,
+		version,
 		hpsb_speedto_str[sbp2_max_speed],
 		sbp2_max_sectors,
 		sbp2_max_outstanding_cmds,
 		sbp2_max_cmds_per_lun,
-		sbp2_serialize_io ? "yes" : "no");
+		sbp2_serialize_io ? "yes" : "no",
+		sbp2_exclusive_login ? "yes" : "no");
 
 	return info;
 }
diff -urN linux-2.4.19-rc1/drivers/ieee1394/sbp2.h linux-2.4.19-rc2/drivers/ieee1394/sbp2.h
--- linux-2.4.19-rc1/drivers/ieee1394/sbp2.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/sbp2.h	Tue Jul 16 16:25:19 2002
@@ -398,9 +398,9 @@
 	u32 sbp2_firmware_revision;
 
 	/* 
-	 * Wait queue used for logins, reconnects, logouts 
+	 * Variable used for logins, reconnects, logouts 
 	 */
-	wait_queue_head_t sbp2_login_wait;
+	atomic_t sbp2_login_complete;
 
 	/* 
 	 * Pool of command orbs, so we can have more than overlapped command per id
@@ -501,6 +501,13 @@
 static void sbp2_remove_device(struct sbp2scsi_host_info *hi, 
 			       struct scsi_id_instance_data *scsi_id);
 
+#ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
+static int sbp2_handle_physdma_write(struct hpsb_host *host, int nodeid, int destid, quadlet_t *data,
+                                     u64 addr, unsigned int length);
+static int sbp2_handle_physdma_read(struct hpsb_host *host, int nodeid, quadlet_t *data,
+                                    u64 addr, unsigned int length);
+#endif
+
 /*
  * SBP-2 protocol related prototypes
  */
@@ -523,9 +530,8 @@
 static int sbp2_send_command(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id,
 			     Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *));
 static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status, unchar *sense_data);
-static void sbp2_check_sbp2_command(unchar *cmd);
-static void sbp2_check_sbp2_response(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id, 
-				     Scsi_Cmnd *SCpnt);
+static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd);
+static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id, Scsi_Cmnd *SCpnt);
 static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id);
 static int sbp2_set_busy_timeout(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id);
 static int sbp2_max_speed_and_size(struct sbp2scsi_host_info *hi, struct scsi_id_instance_data *scsi_id);
diff -urN linux-2.4.19-rc1/drivers/ieee1394/video1394.c linux-2.4.19-rc2/drivers/ieee1394/video1394.c
--- linux-2.4.19-rc1/drivers/ieee1394/video1394.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/ieee1394/video1394.c	Tue Jul 16 16:25:19 2002
@@ -168,86 +168,35 @@
 /* Memory management functions */
 /*******************************/
 
-#define MDEBUG(x)	do { } while(0)		/* Debug memory management */
-
-/* [DaveM] I've recoded most of this so that:
- * 1) It's easier to tell what is happening
- * 2) It's more portable, especially for translating things
- *    out of vmalloc mapped areas in the kernel.
- * 3) Less unnecessary translations happen.
- *
- * The code used to assume that the kernel vmalloc mappings
- * existed in the page tables of every process, this is simply
- * not guaranteed.  We now use pgd_offset_k which is the
- * defined way to get at the kernel page tables.
- */
-
-/* Given PGD from the address space's page table, return the kernel
- * virtual mapping of the physical memory mapped at ADR.
- */
-static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr)
-{
-        unsigned long ret = 0UL;
-	pmd_t *pmd;
-	pte_t *ptep, pte;
-  
-	if (!pgd_none(*pgd)) {
-                pmd = pmd_offset(pgd, adr);
-                if (!pmd_none(*pmd)) {
-                        ptep = pte_offset(pmd, adr);
-                        pte = *ptep;
-                        if(pte_present(pte)) {
-				ret = (unsigned long) 
-					page_address(pte_page(pte));
-                                ret |= (adr & (PAGE_SIZE - 1));
-			}
-                }
-        }
-        MDEBUG(printk("uv2kva(%lx-->%lx)", adr, ret));
-	return ret;
-}
-
-static inline unsigned long uvirt_to_bus(unsigned long adr) 
-{
-        unsigned long kva, ret;
-
-        kva = uvirt_to_kva(pgd_offset(current->mm, adr), adr);
-	ret = virt_to_bus((void *)kva);
-        MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret));
-        return ret;
-}
-
 static inline unsigned long kvirt_to_bus(unsigned long adr) 
 {
-        unsigned long va, kva, ret;
+	unsigned long kva, ret;
 
-        va = VMALLOC_VMADDR(adr);
-        kva = uvirt_to_kva(pgd_offset_k(va), va);
+	kva = (unsigned long) page_address(vmalloc_to_page((void *)adr));
+	kva |= adr & (PAGE_SIZE-1); /* restore the offset */
 	ret = virt_to_bus((void *)kva);
-        MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret));
-        return ret;
+	return ret;
 }
 
 /* Here we want the physical address of the memory.
- * This is used when initializing the contents of the
- * area and marking the pages as reserved.
+ * This is used when initializing the contents of the area.
  */
 static inline unsigned long kvirt_to_pa(unsigned long adr) 
 {
-        unsigned long va, kva, ret;
+        unsigned long kva, ret;
 
-        va = VMALLOC_VMADDR(adr);
-        kva = uvirt_to_kva(pgd_offset_k(va), va);
+	kva = (unsigned long) page_address(vmalloc_to_page((void *)adr));
+	kva |= adr & (PAGE_SIZE-1); /* restore the offset */
 	ret = __pa(kva);
-        MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret));
         return ret;
 }
 
 static void * rvmalloc(unsigned long size)
 {
 	void * mem;
-	unsigned long adr, page;
-        
+	unsigned long adr;
+
+	size=PAGE_ALIGN(size);
 	mem=vmalloc_32(size);
 	if (mem) 
 	{
@@ -256,8 +205,7 @@
 	        adr=(unsigned long) mem;
 		while (size > 0) 
                 {
-	                page = kvirt_to_pa(adr);
-			mem_map_reserve(virt_to_page(__va(page)));
+			mem_map_reserve(vmalloc_to_page((void *)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
@@ -267,15 +215,14 @@
 
 static void rvfree(void * mem, unsigned long size)
 {
-        unsigned long adr, page;
-        
+        unsigned long adr;
+
 	if (mem) 
 	{
 	        adr=(unsigned long) mem;
-		while (size > 0) 
+		while ((long) size > 0) 
                 {
-	                page = kvirt_to_pa(adr);
-			mem_map_unreserve(virt_to_page(__va(page)));
+			mem_map_unreserve(vmalloc_to_page((void *)adr));
 			adr+=PAGE_SIZE;
 			size-=PAGE_SIZE;
 		}
@@ -520,11 +467,11 @@
 static void reset_ir_status(struct dma_iso_ctx *d, int n)
 {
 	int i;
-	d->ir_prg[n][0].status = 4;
-	d->ir_prg[n][1].status = PAGE_SIZE-4;
+	d->ir_prg[n][0].status = cpu_to_le32(4);
+	d->ir_prg[n][1].status = cpu_to_le32(PAGE_SIZE-4);
 	for (i=2;i<d->nb_cmd-1;i++)
-		d->ir_prg[n][i].status = PAGE_SIZE;
-	d->ir_prg[n][i].status = d->left_size;
+		d->ir_prg[n][i].status = cpu_to_le32(PAGE_SIZE);
+	d->ir_prg[n][i].status = cpu_to_le32(d->left_size);
 }
 
 static void initialize_dma_ir_prg(struct dma_iso_ctx *d, int n, int flags)
@@ -534,38 +481,38 @@
 	int i;
 
 	/* the first descriptor will read only 4 bytes */
-	ir_prg[0].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
-		DMA_CTL_BRANCH | 4;
+	ir_prg[0].control = cpu_to_le32(DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
+		DMA_CTL_BRANCH | 4);
 
 	/* set the sync flag */
 	if (flags & VIDEO1394_SYNC_FRAMES)
-		ir_prg[0].control |= DMA_CTL_WAIT;
+		ir_prg[0].control |= cpu_to_le32(DMA_CTL_WAIT);
 
-	ir_prg[0].address = kvirt_to_bus(buf);
-	ir_prg[0].branchAddress =  (virt_to_bus(&(ir_prg[1].control)) 
-				    & 0xfffffff0) | 0x1;
+	ir_prg[0].address = cpu_to_le32(kvirt_to_bus(buf));
+	ir_prg[0].branchAddress =  cpu_to_le32((virt_to_bus(&(ir_prg[1].control)) 
+				    & 0xfffffff0) | 0x1);
 
 	/* the second descriptor will read PAGE_SIZE-4 bytes */
-	ir_prg[1].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
-		DMA_CTL_BRANCH | (PAGE_SIZE-4);
-	ir_prg[1].address = kvirt_to_bus(buf+4);
-	ir_prg[1].branchAddress =  (virt_to_bus(&(ir_prg[2].control)) 
-				    & 0xfffffff0) | 0x1;
+	ir_prg[1].control = cpu_to_le32(DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE |
+		DMA_CTL_BRANCH | (PAGE_SIZE-4));
+	ir_prg[1].address = cpu_to_le32(kvirt_to_bus(buf+4));
+	ir_prg[1].branchAddress =  cpu_to_le32((virt_to_bus(&(ir_prg[2].control)) 
+				    & 0xfffffff0) | 0x1);
 	
 	for (i=2;i<d->nb_cmd-1;i++) {
-		ir_prg[i].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE | 
-			DMA_CTL_BRANCH | PAGE_SIZE;
-		ir_prg[i].address = kvirt_to_bus(buf+(i-1)*PAGE_SIZE);
+		ir_prg[i].control = cpu_to_le32(DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE | 
+			DMA_CTL_BRANCH | PAGE_SIZE);
+		ir_prg[i].address = cpu_to_le32(kvirt_to_bus(buf+(i-1)*PAGE_SIZE));
 
 		ir_prg[i].branchAddress =  
-			(virt_to_bus(&(ir_prg[i+1].control)) 
-			 & 0xfffffff0) | 0x1;
+			cpu_to_le32((virt_to_bus(&(ir_prg[i+1].control)) 
+			 & 0xfffffff0) | 0x1);
 	}
 
 	/* the last descriptor will generate an interrupt */
-	ir_prg[i].control = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE | 
-		DMA_CTL_IRQ | DMA_CTL_BRANCH | d->left_size;
-	ir_prg[i].address = kvirt_to_bus(buf+(i-1)*PAGE_SIZE);
+	ir_prg[i].control = cpu_to_le32(DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE | 
+		DMA_CTL_IRQ | DMA_CTL_BRANCH | d->left_size);
+	ir_prg[i].address = cpu_to_le32(kvirt_to_bus(buf+(i-1)*PAGE_SIZE));
 }
 	
 static void initialize_dma_ir_ctx(struct dma_iso_ctx *d, int tag, int flags)
@@ -628,7 +575,7 @@
 
 	spin_lock(&d->lock);
 	for (i=0;i<d->num_desc;i++) {
-		if (d->ir_prg[i][d->nb_cmd-1].status & 0xFFFF0000) {
+		if (d->ir_prg[i][d->nb_cmd-1].status & cpu_to_le32(0xFFFF0000)) {
 			reset_ir_status(d, i);
 			d->buffer_status[i] = VIDEO1394_BUFFER_READY;
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
@@ -664,7 +611,7 @@
 	buf[7] = timeStamp & 0xff; 
 
     /* if first packet is empty packet, then put timestamp into the next full one too */
-    if ( (d->it_prg[n][0].data[1] >>16) == 0x008) {
+    if ( (le32_to_cpu(d->it_prg[n][0].data[1]) >>16) == 0x008) {
    	    buf += d->packet_size;
     	buf[6] = timeStamp >> 8;
 	    buf[7] = timeStamp & 0xff;
@@ -683,7 +630,7 @@
 	buf[7] = timeStamp & 0xff;
 
     /* if first packet is empty packet, then put timestamp into the next full one too */
-    if ( (d->it_prg[n][0].data[1] >>16) == 0x008) {
+    if ( (le32_to_cpu(d->it_prg[n][0].data[1]) >>16) == 0x008) {
    	    buf += d->packet_size;
     	buf[6] = timeStamp >> 8;
 	    buf[7] = timeStamp & 0xff;
@@ -707,7 +654,8 @@
 
 	spin_lock(&d->lock);
 	for (i=0;i<d->num_desc;i++) {
-		if (d->it_prg[i][d->last_used_cmd[i]].end.status& 0xFFFF0000) {
+		if (d->it_prg[i][d->last_used_cmd[i]].end.status& 
+			cpu_to_le32(0xFFFF0000)) {
 			int next = d->next_buffer[i];
 			put_timestamp(ohci, d, next);
 			d->it_prg[i][d->last_used_cmd[i]].end.status = 0;
@@ -727,39 +675,40 @@
 	d->last_used_cmd[n] = d->nb_cmd - 1;
 	for (i=0;i<d->nb_cmd;i++) {
 				 
-		it_prg[i].begin.control = DMA_CTL_OUTPUT_MORE |
-			DMA_CTL_IMMEDIATE | 8 ;
+		it_prg[i].begin.control = cpu_to_le32(DMA_CTL_OUTPUT_MORE |
+			DMA_CTL_IMMEDIATE | 8) ;
 		it_prg[i].begin.address = 0;
 		
 		it_prg[i].begin.status = 0;
 		
-		it_prg[i].data[0] = 
+		it_prg[i].data[0] = cpu_to_le32(
 			(SPEED_100 << 16) 
 			| (/* tag */ 1 << 14)
 			| (d->channel << 8) 
-			| (TCODE_ISO_DATA << 4);
-		if (i==0) it_prg[i].data[0] |= sync_tag;
-		it_prg[i].data[1] = d->packet_size << 16;
+			| (TCODE_ISO_DATA << 4));
+		if (i==0) it_prg[i].data[0] |= cpu_to_le32(sync_tag);
+		it_prg[i].data[1] = cpu_to_le32(d->packet_size << 16);
 		it_prg[i].data[2] = 0;
 		it_prg[i].data[3] = 0;
 		
-		it_prg[i].end.control = DMA_CTL_OUTPUT_LAST | DMA_CTL_BRANCH;
+		it_prg[i].end.control = cpu_to_le32(DMA_CTL_OUTPUT_LAST |
+			    	    	     DMA_CTL_BRANCH);
 		it_prg[i].end.address =
-			kvirt_to_bus(buf+i*d->packet_size);
+			cpu_to_le32(kvirt_to_bus(buf+i*d->packet_size));
 
 		if (i<d->nb_cmd-1) {
-			it_prg[i].end.control |= d->packet_size;
+			it_prg[i].end.control |= cpu_to_le32(d->packet_size);
 			it_prg[i].begin.branchAddress = 
-				(virt_to_bus(&(it_prg[i+1].begin.control)) 
-				 & 0xfffffff0) | 0x3;
+				cpu_to_le32((virt_to_bus(&(it_prg[i+1].begin.control)) 
+				 & 0xfffffff0) | 0x3);
 			it_prg[i].end.branchAddress = 
-				(virt_to_bus(&(it_prg[i+1].begin.control)) 
-				 & 0xfffffff0) | 0x3;
+				cpu_to_le32((virt_to_bus(&(it_prg[i+1].begin.control)) 
+				 & 0xfffffff0) | 0x3);
 		}
 		else {
 			/* the last prg generates an interrupt */
-			it_prg[i].end.control |= DMA_CTL_UPDATE | 
-				DMA_CTL_IRQ | d->left_size;
+			it_prg[i].end.control |= cpu_to_le32(DMA_CTL_UPDATE | 
+				DMA_CTL_IRQ | d->left_size);
 			/* the last prg doesn't branch */
 			it_prg[i].begin.branchAddress = 0;
 			it_prg[i].end.branchAddress = 0;
@@ -798,21 +747,21 @@
 		} else {
 			size = packet_sizes[i];
 		}
-		it_prg[i].data[1] = size << 16; 
-		it_prg[i].end.control = DMA_CTL_OUTPUT_LAST | DMA_CTL_BRANCH;
+		it_prg[i].data[1] = cpu_to_le32(size << 16); 
+		it_prg[i].end.control = cpu_to_le32(DMA_CTL_OUTPUT_LAST | DMA_CTL_BRANCH);
 
 		if (i < d->nb_cmd-1 && packet_sizes[i+1] != 0) {
-			it_prg[i].end.control |= size;
+			it_prg[i].end.control |= cpu_to_le32(size);
 			it_prg[i].begin.branchAddress = 
-				(virt_to_bus(&(it_prg[i+1].begin.control)) 
-				 & 0xfffffff0) | 0x3;
+				cpu_to_le32((virt_to_bus(&(it_prg[i+1].begin.control)) 
+				 & 0xfffffff0) | 0x3);
 			it_prg[i].end.branchAddress = 
-				(virt_to_bus(&(it_prg[i+1].begin.control)) 
-				 & 0xfffffff0) | 0x3;
+				cpu_to_le32((virt_to_bus(&(it_prg[i+1].begin.control)) 
+				 & 0xfffffff0) | 0x3);
 		} else {
 			/* the last prg generates an interrupt */
-			it_prg[i].end.control |= DMA_CTL_UPDATE | 
-				DMA_CTL_IRQ | size;
+			it_prg[i].end.control |= cpu_to_le32(DMA_CTL_UPDATE | 
+				DMA_CTL_IRQ | size);
 			/* the last prg doesn't branch */
 			it_prg[i].begin.branchAddress = 0;
 			it_prg[i].end.branchAddress = 0;
@@ -1057,8 +1006,8 @@
 
 		if (d->last_buffer>=0) 
 			d->ir_prg[d->last_buffer][d->nb_cmd-1].branchAddress = 
-				(virt_to_bus(&(d->ir_prg[v.buffer][0].control)) 
-				 & 0xfffffff0) | 0x1;
+				cpu_to_le32((virt_to_bus(&(d->ir_prg[v.buffer][0].control)) 
+				 & 0xfffffff0) | 0x1);
 
 		d->last_buffer = v.buffer;
 
@@ -1217,14 +1166,14 @@
 			d->it_prg[d->last_buffer]
 				[ d->last_used_cmd[d->last_buffer]
 					].end.branchAddress = 
-				(virt_to_bus(&(d->it_prg[v.buffer][0].begin.control)) 
-				 & 0xfffffff0) | 0x3;
+				cpu_to_le32((virt_to_bus(&(d->it_prg[v.buffer][0].begin.control)) 
+				 & 0xfffffff0) | 0x3);
 
 			d->it_prg[d->last_buffer]
 				[d->last_used_cmd[d->last_buffer]
 					].begin.branchAddress = 
-				(virt_to_bus(&(d->it_prg[v.buffer][0].begin.control)) 
-				 & 0xfffffff0) | 0x3;
+				cpu_to_le32((virt_to_bus(&(d->it_prg[v.buffer][0].begin.control)) 
+				 & 0xfffffff0) | 0x3);
 			d->next_buffer[d->last_buffer] = v.buffer;
 		}
 		d->last_buffer = v.buffer;
diff -urN linux-2.4.19-rc1/drivers/md/raid1.c linux-2.4.19-rc2/drivers/md/raid1.c
--- linux-2.4.19-rc1/drivers/md/raid1.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/md/raid1.c	Tue Jul 16 16:25:19 2002
@@ -1152,9 +1152,12 @@
 	struct raid1_bh *r1_bh;
 	struct buffer_head *bh;
 	unsigned long flags;
-	mddev_t *mddev;
+	raid1_conf_t *conf = data;
+	mddev_t *mddev = conf->mddev;
 	kdev_t dev;
 
+	if (mddev->sb_dirty)
+		md_update_sb(mddev);
 
 	for (;;) {
 		md_spin_lock_irqsave(&retry_list_lock, flags);
@@ -1165,8 +1168,6 @@
 		md_spin_unlock_irqrestore(&retry_list_lock, flags);
 
 		mddev = r1_bh->mddev;
-		if (mddev->sb_dirty)
-			md_update_sb(mddev);
 		bh = &r1_bh->bh_req;
 		switch(r1_bh->cmd) {
 		case SPECIAL:
@@ -1177,7 +1178,6 @@
 				int i, sum_bhs = 0;
 				int disks = MD_SB_DISKS;
 				struct buffer_head *bhl, *mbh;
-				raid1_conf_t *conf;
 				
 				conf = mddev_to_conf(mddev);
 				bhl = raid1_alloc_bh(conf, conf->raid_disks); /* don't really need this many */
diff -urN linux-2.4.19-rc1/drivers/media/radio/radio-sf16fmi.c linux-2.4.19-rc2/drivers/media/radio/radio-sf16fmi.c
--- linux-2.4.19-rc1/drivers/media/radio/radio-sf16fmi.c	Mon Feb 25 11:37:58 2002
+++ linux-2.4.19-rc2/drivers/media/radio/radio-sf16fmi.c	Tue Jul 16 16:25:19 2002
@@ -85,23 +85,12 @@
 {
         int myport = dev->port;
 	unsigned long freq = dev->curfreq;
-	int i;
 	
 	down(&lock);
-	
 	outbits(16, RSF16_ENCODE(freq), myport);
 	outbits(8, 0xC0, myport);
-	for(i=0; i< 100; i++)
-	{
-		udelay(1400);
-		if(current->need_resched)
-			schedule();
-	}
-/* If this becomes allowed use it ... 	
 	current->state = TASK_UNINTERRUPTIBLE;
 	schedule_timeout(HZ/7);
-*/	
-
 	up(&lock);
 	if (dev->curvol) fmi_unmute(myport);
 	return 0;
@@ -112,22 +101,13 @@
 	int val;
 	int res;
 	int myport = dev->port;
-	int i;
 	
 	down(&lock);
 	val = dev->curvol ? 0x08 : 0x00;	/* unmute/mute */
 	outb(val, myport);
 	outb(val | 0x10, myport);
-	for(i=0; i< 100; i++)
-	{
-		udelay(1400);
-		if(current->need_resched)
-			schedule();
-	}
-/* If this becomes allowed use it ... 	
 	current->state = TASK_UNINTERRUPTIBLE;
 	schedule_timeout(HZ/7);
-*/	
 	res = (int)inb(myport+1);
 	outb(val, myport);
 	
@@ -324,7 +304,7 @@
 	if (io < 0)
 		io = isapnp_fmi_probe();
 	if (io < 0) {
-		printk(KERN_ERR "radio-sf16fmi: No PnP card found.");
+		printk(KERN_ERR "radio-sf16fmi: No PnP card found.\n");
 		return io;
 	}
 	if (!request_region(io, 2, "radio-sf16fmi")) {
diff -urN linux-2.4.19-rc1/drivers/media/video/w9966.c linux-2.4.19-rc2/drivers/media/video/w9966.c
--- linux-2.4.19-rc1/drivers/media/video/w9966.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/media/video/w9966.c	Tue Jul 16 16:25:19 2002
@@ -50,23 +50,23 @@
 #include <linux/types.h>
 #include <linux/slab.h>
 
-//#define DEBUG				// Uncomment for debug output.
+//#define DEBUG				// Define for debug output.
 
 #ifdef DEBUG
 #   define DPRINTF(f, a...)						\
-	do {								\
-		printk ("%s%s, %d (DEBUG) %s(): ",			\
-			KERN_DEBUG, __FILE__, __LINE__, __func__);	\
-		printk (f, ##a);					\
-	} while (0)
+        do {								\
+            printk ("%s%s, %d (DEBUG) %s(): ",				\
+                KERN_DEBUG, __FILE__, __LINE__, __func__);		\
+            printk (f, ##a);						\
+        } while (0)
 #   define DASSERT(x)							\
-	do {								\
-		if (!x)							\
-			DPRINTF("Assertion failed at line %d.\n", __LINE__);\
-	} while (0)
+        do {								\
+            if (!x)							\
+                DPRINTF("Assertion failed at line %d.\n", __LINE__);	\
+        } while (0)
 #else
-#   define DPRINTF(...) do {} while(0)
-#   define DASSERT(...) do {} while(0)
+#   define DPRINTF(f, a...) do {} while(0)
+#   define DASSERT(f, a...) do {} while(0)
 #endif
 
 /*
@@ -1058,7 +1058,7 @@
 
 	// Why would anyone want more than this??
 	if (count > cam->width * cam->height * 2)
-		return -EINVAL;
+		count = cam->width * cam->height * 2;
 
 	w9966_wreg(cam, 0x00, 0x02);	// Reset ECP-FIFO buffer
 	w9966_wreg(cam, 0x00, 0x00);	// Return to normal operation
diff -urN linux-2.4.19-rc1/drivers/mtd/maps/pci.c linux-2.4.19-rc2/drivers/mtd/maps/pci.c
--- linux-2.4.19-rc1/drivers/mtd/maps/pci.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/mtd/maps/pci.c	Tue Jul 16 16:25:19 2002
@@ -361,7 +361,7 @@
 static struct pci_driver mtd_pci_driver = {
 	name:		"MTD PCI",
 	probe:		mtd_pci_probe,
-	remove:		mtd_pci_remove,
+	remove:		__devexit_p(mtd_pci_remove),
 	id_table:	mtd_pci_ids,
 };
 
diff -urN linux-2.4.19-rc1/drivers/net/Config.in linux-2.4.19-rc2/drivers/net/Config.in
--- linux-2.4.19-rc1/drivers/net/Config.in	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/Config.in	Tue Jul 16 16:25:19 2002
@@ -217,13 +217,13 @@
       bool '  SGI Seeq ethernet controller support' CONFIG_SGISEEQ
    fi
    if [ "$CONFIG_DECSTATION" = "y" ]; then
-      bool '  DEC LANCE ethernet controller support' CONFIG_DECLANCE
+      tristate '  DEC LANCE ethernet controller support' CONFIG_DECLANCE
    fi
    if [ "$CONFIG_BAGET_MIPS" = "y" ]; then
       tristate '  Baget AMD LANCE support' CONFIG_BAGETLANCE
    fi
    if [ "$CONFIG_NEC_OSPREY" = "y" ]; then
-      tristate '  Memory-mapped onboard NE2000-compatible ethernet' CONFIG_NE2000
+      bool '  Memory-mapped onboard NE2000-compatible ethernet' CONFIG_NE2000
    fi
 fi
 
diff -urN linux-2.4.19-rc1/drivers/net/au1000_eth.c linux-2.4.19-rc2/drivers/net/au1000_eth.c
--- linux-2.4.19-rc1/drivers/net/au1000_eth.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/au1000_eth.c	Tue Jul 16 16:25:19 2002
@@ -22,15 +22,8 @@
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  *
  * ########################################################################
- *
- * 
  */
-
-#ifndef __mips__
-#error This driver only works with MIPS architectures!
-#endif
-
-
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -47,7 +40,6 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/delay.h>
-#include <linux/crc32.h>
 #include <asm/mipsregs.h>
 #include <asm/irq.h>
 #include <asm/bitops.h>
@@ -89,8 +81,8 @@
 // externs
 extern  void ack_rise_edge_irq(unsigned int);
 extern int get_ethernet_addr(char *ethernet_addr);
-static inline void str2eaddr(unsigned char *ea, unsigned char *str);
-static inline unsigned char str2hexnum(unsigned char c);
+extern inline void str2eaddr(unsigned char *ea, unsigned char *str);
+extern inline unsigned char str2hexnum(unsigned char c);
 extern char * __init prom_getcmdline(void);
 
 /*
@@ -1243,6 +1235,23 @@
 	au1000_init(dev);
 }
 
+
+static unsigned const ethernet_polynomial = 0x04c11db7U;
+static inline u32 ether_crc(int length, unsigned char *data)
+{
+    int crc = -1;
+
+    while(--length >= 0) {
+		unsigned char current_octet = *data++;
+		int bit;
+		for (bit = 0; bit < 8; bit++, current_octet >>= 1)
+			crc = (crc << 1) ^
+				((crc < 0) ^ (current_octet & 1) ? 
+				 ethernet_polynomial : 0);
+    }
+    return crc;
+}
+
 static void set_rx_mode(struct net_device *dev)
 {
 	struct au1000_private *aup = (struct au1000_private *) dev->priv;
diff -urN linux-2.4.19-rc1/drivers/net/au1000_eth.h linux-2.4.19-rc2/drivers/net/au1000_eth.h
--- linux-2.4.19-rc1/drivers/net/au1000_eth.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/au1000_eth.h	Tue Jul 16 16:25:19 2002
@@ -1,13 +1,10 @@
 /*
- *
  * Alchemy Semi Au1000 ethernet driver include file
  *
  * Author: Pete Popov <ppopov@mvista.com>
  *
  * Copyright 2001 MontaVista Software Inc.
  *
- * ########################################################################
- *
  *  This program is free software; you can distribute it and/or modify it
  *  under the terms of the GNU General Public License (Version 2) as
  *  published by the Free Software Foundation.
@@ -20,11 +17,8 @@
  *  You should have received a copy of the GNU General Public License along
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * ########################################################################
- *
- * 
  */
+#include <linux/config.h>
 
 
 #define NUM_INTERFACES 2
diff -urN linux-2.4.19-rc1/drivers/net/declance.c linux-2.4.19-rc2/drivers/net/declance.c
--- linux-2.4.19-rc1/drivers/net/declance.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/declance.c	Tue Jul 16 16:25:19 2002
@@ -5,6 +5,8 @@
  *
  *      adopted from sunlance.c by Richard van den Berg
  *
+ *      Copyright (C) 2002  Maciej W. Rozycki
+ *
  *      additional sources:
  *      - PMAD-AA TURBOchannel Ethernet Module Functional Specification,
  *        Revision 1.2
@@ -16,78 +18,71 @@
  *      v0.002: Removed most sparc stuff, left only some module and dma stuff.
  *
  *      v0.003: Enhanced base address calculation from proposals by
- *      Harald Koerfgen and Thomas Riemer.
+ *              Harald Koerfgen and Thomas Riemer.
  *
  *      v0.004: lance-regs is pointing at the right addresses, added prom
- *      check. First start of address mapping and DMA.
+ *              check. First start of address mapping and DMA.
  *
- *      v0.005: started to play around with LANCE-DMA. This driver will not work
- *      for non IOASIC lances. HK
+ *      v0.005: started to play around with LANCE-DMA. This driver will not
+ *              work for non IOASIC lances. HK
  *
- *      v0.006: added pointer arrays to lance_private and setup routine for them
- *      in dec_lance_init. HK
+ *      v0.006: added pointer arrays to lance_private and setup routine for
+ *              them in dec_lance_init. HK
  *
- *      v0.007: Big shit. The LANCE seems to use a different DMA mechanism to access
- *      the init block. This looks like one (short) word at a time, but the smallest
- *      amount the IOASIC can transfer is a (long) word. So we have a 2-2 padding here.
- *      Changed lance_init_block accordingly. The 16-16 padding for the buffers
- *      seems to be correct. HK
+ *      v0.007: Big shit. The LANCE seems to use a different DMA mechanism to
+ *              access the init block. This looks like one (short) word at a
+ *              time, but the smallest amount the IOASIC can transfer is a
+ *              (long) word. So we have a 2-2 padding here. Changed
+ *              lance_init_block accordingly. The 16-16 padding for the buffers
+ *              seems to be correct. HK
  *
- *     v0.008 - mods to make PMAX_LANCE work. 01/09/1999 triemer
- */
-
-#undef DEBUG_DRIVER
-
-static char *version =
-"declance.c: v0.008 by Linux Mips DECstation task force\n";
-
-static char *lancestr = "LANCE";
-
-/*
- * card types
+ *      v0.008: mods to make PMAX_LANCE work. 01/09/1999 triemer
+ *
+ *      v0.009: Module support fixes, multiple interfaces support, various
+ *              bits. macro
  */
-#define ASIC_LANCE 1
-#define PMAD_LANCE 2
-#define PMAX_LANCE 3
 
+#include <linux/config.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/stddef.h>
+#include <linux/string.h>
 
+#include <asm/addrspace.h>
 #include <asm/dec/interrupts.h>
-#include <asm/dec/ioasic_ints.h>
+#include <asm/dec/ioasic.h>
 #include <asm/dec/ioasic_addrs.h>
+#include <asm/dec/kn01.h>
 #include <asm/dec/machtype.h>
 #include <asm/dec/tc.h>
-#include <asm/dec/kn01.h>
 #include <asm/wbflush.h>
-#include <asm/addrspace.h>
 
-#include <linux/config.h>
-#include <linux/errno.h>
-#include <linux/hdreg.h>
-#include <linux/ioport.h>
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/stddef.h>
-#include <linux/string.h>
-#include <linux/unistd.h>
-#include <linux/ptrace.h>
-#include <linux/slab.h>
-#include <linux/user.h>
-#include <linux/utsname.h>
-#include <linux/a.out.h>
-#include <linux/tty.h>
-#include <linux/delay.h>
-#include <linux/crc32.h>
-#include <asm/io.h>
-#include <linux/etherdevice.h>
+static char version[] __devinitdata =
+"declance.c: v0.009 by Linux MIPS DECstation task force\n";
+
+MODULE_AUTHOR("Linux MIPS DECstation task force");
+MODULE_DESCRIPTION("DEC LANCE (DECstation onboard, PMAD-xx) driver");
+MODULE_LICENSE("GPL");
+
+/*
+ * card types
+ */
+#define ASIC_LANCE 1
+#define PMAD_LANCE 2
+#define PMAX_LANCE 3
 
 #ifndef CONFIG_TC
 unsigned long system_base;
 unsigned long dmaptr;
 #endif
-static int type;
+
+#define CRC_POLYNOMIAL_BE 0x04c11db7UL	/* Ethernet CRC, big endian */
+#define CRC_POLYNOMIAL_LE 0xedb88320UL	/* Ethernet CRC, little endian */
 
 #define LE_CSR0 0
 #define LE_CSR1 1
@@ -162,8 +157,6 @@
 #define TX_BUFF_SIZE            PKT_BUF_SZ
 
 #undef TEST_HITS
-#define DEBUG_DRIVER 1
-
 #define ZERO 0
 
 /* The DS2000/3000 have a linear 64 KB buffer.
@@ -181,26 +174,26 @@
  */
 
 struct lance_rx_desc {
-	unsigned short rmd0;	/* low address of packet */
+	unsigned short rmd0;		/* low address of packet */
 	short gap0;
 	unsigned char rmd1_hadr;	/* high address of packet */
 	unsigned char rmd1_bits;	/* descriptor bits */
 	short gap1;
-	short length;		/* This length is 2s complement (negative)!
-				   * Buffer length
-				 */
+	short length;			/* 2s complement (negative!)
+					   of buffer length */
 	short gap2;
-	unsigned short mblength;	/* This is the actual number of bytes received */
+	unsigned short mblength;	/* actual number of bytes received */
 	short gap3;
 };
 
 struct lance_tx_desc {
-	unsigned short tmd0;	/* low address of packet */
+	unsigned short tmd0;		/* low address of packet */
 	short gap0;
 	unsigned char tmd1_hadr;	/* high address of packet */
 	unsigned char tmd1_bits;	/* descriptor bits */
 	short gap1;
-	short length;		/* Length is 2s complement (negative)! */
+	short length;			/* 2s complement (negative!)
+					   of buffer length */
 	short gap2;
 	unsigned short misc;
 	short gap3;
@@ -209,28 +202,26 @@
 
 /* First part of the LANCE initialization block, described in databook. */
 struct lance_init_block {
-	unsigned short mode;	/* Pre-set mode (reg. 15) */
+	unsigned short mode;		/* pre-set mode (reg. 15) */
 	short gap0;
 
-	unsigned char phys_addr[12];	/* Physical ethernet address
-					   * only 0, 1, 4, 5, 8, 9 are valid
-					   * 2, 3, 6, 7, 10, 11 are gaps
-					 */
-	unsigned short filter[8];	/* Multicast filter.
-					   * only 0, 2, 4, 6 are valid
-					   * 1, 3, 5, 7 are gaps
-					 */
+	unsigned char phys_addr[12];	/* physical ethernet address
+					   only 0, 1, 4, 5, 8, 9 are valid
+					   2, 3, 6, 7, 10, 11 are gaps */
+	unsigned short filter[8];	/* multicast filter
+					   only 0, 2, 4, 6 are valid
+					   1, 3, 5, 7 are gaps */
 
 	/* Receive and transmit ring base, along with extra bits. */
-	unsigned short rx_ptr;	/* receive descriptor addr */
+	unsigned short rx_ptr;		/* receive descriptor addr */
 	short gap1;
-	unsigned short rx_len;	/* receive len and high addr */
+	unsigned short rx_len;		/* receive len and high addr */
 	short gap2;
-	unsigned short tx_ptr;	/* transmit descriptor addr */
+	unsigned short tx_ptr;		/* transmit descriptor addr */
 	short gap3;
-	unsigned short tx_len;	/* transmit len and high addr */
+	unsigned short tx_len;		/* transmit len and high addr */
 	short gap4;
-	char gap5[16];
+	short gap5[8];
 
 	/* The buffer descriptors */
 	struct lance_rx_desc brx_ring[RX_RING_SIZE];
@@ -249,10 +240,12 @@
 #define LANCE_ADDR(x) (PHYSADDR(x) >> 1)
 
 struct lance_private {
-	char *name;
+	struct net_device *next;
+	int type;
+	int slot;
+	int dma_irq;
 	volatile struct lance_regs *ll;
 	volatile struct lance_init_block *init_block;
-	volatile unsigned long *dma_ptr_reg;
 
 	spinlock_t	lock;
 
@@ -263,8 +256,6 @@
 
 	unsigned short busmaster_regval;
 
-	struct net_device *dev;	/* Backpointer        */
-	struct lance_private *next_module;
 	struct timer_list       multicast_timer;
 
 	/* Pointers to the ring buffers as seen from the CPU */
@@ -294,11 +285,7 @@
 
 int dec_lance_debug = 2;
 
-/*
-   #ifdef MODULE
-   static struct lance_private *root_lance_dev = NULL;
-   #endif
- */
+static struct net_device *root_lance_dev;
 
 static inline void writereg(volatile unsigned short *regptr, short value)
 {
@@ -332,7 +319,7 @@
  * Our specialized copy routines
  *
  */
-void cp_to_buf(void *to, const void *from, __kernel_size_t len)
+void cp_to_buf(const int type, void *to, const void *from, int len)
 {
 	unsigned short *tp, *fp, clen;
 	unsigned char *rtp, *rfp;
@@ -386,7 +373,7 @@
 	wbflush();
 }
 
-void cp_from_buf(void *to, unsigned char *from, int len)
+void cp_from_buf(const int type, void *to, const void *from, int len)
 {
 	unsigned short *tp, *fp, clen;
 	unsigned char *rtp, *rfp;
@@ -553,22 +540,21 @@
 
 #ifdef TEST_HITS
 	{
-	int i;
+		int i;
 
-	printk("[");
-	for (i = 0; i < RX_RING_SIZE; i++) {
-		if (i == lp->rx_new)
-			printk("%s",
-			       ib->brx_ring[i].rmd1_bits & LE_R1_OWN ? "_" : "X");
-		else
-			printk("%s",
-			       ib->brx_ring[i].rmd1_bits & LE_R1_OWN ? "." : "1");
-	}
-	printk("]");
+		printk("[");
+		for (i = 0; i < RX_RING_SIZE; i++) {
+			if (i == lp->rx_new)
+				printk("%s", ib->brx_ring[i].rmd1_bits &
+					     LE_R1_OWN ? "_" : "X");
+			else
+				printk("%s", ib->brx_ring[i].rmd1_bits &
+					     LE_R1_OWN ? "." : "1");
+		}
+		printk("]");
 	}
 #endif
 
-
 	for (rd = &ib->brx_ring[lp->rx_new];
 	     !((bits = rd->rmd1_bits) & LE_R1_OWN);
 	     rd = &ib->brx_ring[lp->rx_new]) {
@@ -610,8 +596,8 @@
 			skb_reserve(skb, 2);	/* 16 byte align */
 			skb_put(skb, len);	/* make room */
 
-			cp_from_buf(skb->data,
-				 (char *) lp->rx_buf_ptr_cpu[lp->rx_new],
+			cp_from_buf(lp->type, skb->data,
+				    (char *)lp->rx_buf_ptr_cpu[lp->rx_new],
 				    len);
 
 			skb->protocol = eth_type_trans(skb, dev);
@@ -711,6 +697,14 @@
 	spin_unlock(&lp->lock);
 }
 
+static void lance_dma_merr_int(const int irq, void *dev_id,
+				struct pt_regs *regs)
+{
+	struct net_device *dev = (struct net_device *) dev_id;
+
+	printk("%s: DMA error\n", dev->name);
+}
+
 static void lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
@@ -742,19 +736,8 @@
 		lp->stats.rx_errors++;
 
 	if (csr0 & LE_C0_MERR) {
-		volatile unsigned long int_stat = *(unsigned long *) (system_base + IOCTL + SIR);
-
 		printk("%s: Memory error, status %04x\n", dev->name, csr0);
 
-		if (int_stat & LANCE_DMA_MEMRDERR) {
-			printk("%s: DMA error\n", dev->name);
-			int_stat |= LANCE_DMA_MEMRDERR;
-			/*
-			 * re-enable LANCE DMA
-			 */
-			*(unsigned long *) (system_base + IOCTL + SSR) |= (1 << 16);
-			wbflush();
-		}
 		writereg(&ll->rdp, LE_C0_STOP);
 
 		lance_init_ring(dev);
@@ -800,10 +783,21 @@
 	netif_start_queue(dev);
 
 	/* Associate IRQ with lance_interrupt */
-	if (request_irq(dev->irq, &lance_interrupt, 0, lp->name, dev)) {
-		printk("Lance: Can't get irq %d\n", dev->irq);
+	if (request_irq(dev->irq, &lance_interrupt, 0, "lance", dev)) {
+		printk("lance: Can't get IRQ %d\n", dev->irq);
 		return -EAGAIN;
 	}
+	if (lp->dma_irq >= 0) {
+		if (request_irq(lp->dma_irq, &lance_dma_merr_int, 0,
+				"lance error", dev)) {
+			free_irq(dev->irq, dev);
+			printk("lance: Can't get DMA IRQ %d\n", lp->dma_irq);
+			return -EAGAIN;
+		}
+		/* Enable I/O ASIC LANCE DMA.  */
+		wbflush();
+		ioasic_write(SSR, ioasic_read(SSR) | LANCE_DMA_EN);
+	}
 
 	status = init_restart_lance(lp);
 
@@ -827,7 +821,13 @@
 	writereg(&ll->rap, LE_CSR0);
 	writereg(&ll->rdp, LE_C0_STOP);
 
-	free_irq(dev->irq, (void *) dev);
+	if (lp->dma_irq >= 0) {
+		/* Disable I/O ASIC LANCE DMA.  */
+		ioasic_write(SSR, ioasic_read(SSR) & ~LANCE_DMA_EN);
+		wbflush();
+		free_irq(lp->dma_irq, dev);
+	}
+	free_irq(dev->irq, dev);
 	/*
 	   MOD_DEC_USE_COUNT;
 	 */
@@ -879,7 +879,8 @@
 	ib->btx_ring[entry].length = (-len);
 	ib->btx_ring[entry].misc = 0;
 
-	cp_to_buf((char *) lp->tx_buf_ptr_cpu[entry], skb->data, skblen);
+	cp_to_buf(lp->type, (char *)lp->tx_buf_ptr_cpu[entry], skb->data,
+		  skblen);
 
 	/* Clear the slack of the packet, do I need this? */
 	/* For a firewall its a good idea - AC */
@@ -920,7 +921,7 @@
 	struct dev_mc_list *dmi = dev->mc_list;
 	char *addrs;
 	int i, j, bit, byte;
-	u32 crc;
+	u32 crc, poly = CRC_POLYNOMIAL_LE;
 
 	/* set all multicast bits */
 	if (dev->flags & IFF_ALLMULTI) {
@@ -945,7 +946,19 @@
 		if (!(*addrs & 1))
 			continue;
 
-		crc = ether_crc_le(6, addrs);
+		crc = 0xffffffff;
+		for (byte = 0; byte < 6; byte++)
+			for (bit = *addrs++, j = 0; j < 8; j++, bit >>= 1) {
+				int test;
+
+				test = ((bit ^ crc) & 0x01);
+				crc >>= 1;
+
+				if (test) {
+					crc = crc ^ poly;
+				}
+			}
+
 		crc = crc >> 26;
 		mcast_table[2 * (crc >> 4)] |= 1 << (crc & 0xf);
 	}
@@ -994,7 +1007,7 @@
 	lance_set_multicast(dev);
 }
 
-static int __init dec_lance_init(struct net_device *dev, const int type)
+static int __init dec_lance_init(const int type, const int slot)
 {
 	static unsigned version_printed;
 	struct net_device *dev;
@@ -1006,21 +1019,25 @@
 
 #ifndef CONFIG_TC
 	system_base = KN01_LANCE_BASE;
-#else
-	int slot;
 #endif
 
 	if (dec_lance_debug && version_printed++ == 0)
 		printk(version);
 
-	dev = init_etherdev(0, sizeof(struct lance_private));
+	dev = init_etherdev(NULL, sizeof(struct lance_private));
 	if (!dev)
 		return -ENOMEM;
+	SET_MODULE_OWNER(dev);
 
-	/* init_etherdev ensures the data structures used by the LANCE are aligned. */
+	/*
+	 * init_etherdev ensures the data structures used by the LANCE
+	 * are aligned.
+	 */
 	lp = (struct lance_private *) dev->priv;
 	spin_lock_init(&lp->lock);
 
+	lp->type = type;
+	lp->slot = slot;
 	switch (type) {
 #ifdef CONFIG_TC
 	case ASIC_LANCE:
@@ -1032,78 +1049,100 @@
 		 */
 		dev->mem_start = KSEG1ADDR(0x00020000);
 		dev->mem_end = dev->mem_start + 0x00020000;
-		dev->irq = ETHER;
+		dev->irq = dec_interrupt[DEC_IRQ_LANCE];
 		esar_base = system_base + ESAR;
-	
+
 		/* Workaround crash with booting KN04 2.1k from Disk */
-		memset(dev->mem_start, 0, dev->mem_end - dev->mem_start);
+		memset((void *)dev->mem_start, 0,
+		       dev->mem_end - dev->mem_start);
 
 		/*
 		 * setup the pointer arrays, this sucks [tm] :-(
 		 */
 		for (i = 0; i < RX_RING_SIZE; i++) {
-			lp->rx_buf_ptr_cpu[i] = (char *) (dev->mem_start + BUF_OFFSET_CPU
-						 + 2 * i * RX_BUFF_SIZE);
-			lp->rx_buf_ptr_lnc[i] = (char *) (BUF_OFFSET_LNC
-						     + i * RX_BUFF_SIZE);
+			lp->rx_buf_ptr_cpu[i] =
+				(char *)(dev->mem_start + BUF_OFFSET_CPU +
+					 2 * i * RX_BUFF_SIZE);
+			lp->rx_buf_ptr_lnc[i] =
+				(char *)(BUF_OFFSET_LNC + i * RX_BUFF_SIZE);
 		}
 		for (i = 0; i < TX_RING_SIZE; i++) {
-			lp->tx_buf_ptr_cpu[i] = (char *) (dev->mem_start + BUF_OFFSET_CPU
-					+ 2 * RX_RING_SIZE * RX_BUFF_SIZE
-						 + 2 * i * TX_BUFF_SIZE);
-			lp->tx_buf_ptr_lnc[i] = (char *) (BUF_OFFSET_LNC
-					    + RX_RING_SIZE * RX_BUFF_SIZE
-						     + i * TX_BUFF_SIZE);
+			lp->tx_buf_ptr_cpu[i] =
+				(char *)(dev->mem_start + BUF_OFFSET_CPU +
+					 2 * RX_RING_SIZE * RX_BUFF_SIZE +
+					 2 * i * TX_BUFF_SIZE);
+			lp->tx_buf_ptr_lnc[i] =
+				(char *)(BUF_OFFSET_LNC +
+					 RX_RING_SIZE * RX_BUFF_SIZE +
+					 i * TX_BUFF_SIZE);
 		}
 
-		/*
-		 * setup and enable IOASIC LANCE DMA
-		 */
-		lp->dma_ptr_reg = (unsigned long *) (system_base + IOCTL + LANCE_DMA_P);
-		*(lp->dma_ptr_reg) = PHYSADDR(dev->mem_start) << 3;
-		*(unsigned long *) (system_base + IOCTL + SSR) |= (1 << 16);
-		wbflush();
+		/* Setup I/O ASIC LANCE DMA.  */
+		lp->dma_irq = dec_interrupt[DEC_IRQ_LANCE_MERR];
+		ioasic_write(LANCE_DMA_P, PHYSADDR(dev->mem_start) << 3);
 
 		break;
+
 	case PMAD_LANCE:
-		slot = search_tc_card("PMAD-AA");
 		claim_tc_card(slot);
 
 		dev->mem_start = get_tc_base_addr(slot);
 		dev->base_addr = dev->mem_start + 0x100000;
 		dev->irq = get_tc_irq_nr(slot);
 		esar_base = dev->mem_start + 0x1c0002;
+		lp->dma_irq = -1;
+
+		for (i = 0; i < RX_RING_SIZE; i++) {
+			lp->rx_buf_ptr_cpu[i] =
+				(char *)(dev->mem_start + BUF_OFFSET_CPU +
+					 i * RX_BUFF_SIZE);
+			lp->rx_buf_ptr_lnc[i] =
+				(char *)(BUF_OFFSET_LNC + i * RX_BUFF_SIZE);
+		}
+		for (i = 0; i < TX_RING_SIZE; i++) {
+			lp->tx_buf_ptr_cpu[i] =
+				(char *)(dev->mem_start + BUF_OFFSET_CPU +
+					 RX_RING_SIZE * RX_BUFF_SIZE +
+					 i * TX_BUFF_SIZE);
+			lp->tx_buf_ptr_lnc[i] =
+				(char *)(BUF_OFFSET_LNC +
+					 RX_RING_SIZE * RX_BUFF_SIZE +
+					 i * TX_BUFF_SIZE);
+		}
+
 		break;
 #endif
+
 	case PMAX_LANCE:
-		dev->irq = ETHER;
+		dev->irq = dec_interrupt[DEC_IRQ_LANCE];
 		dev->base_addr = KN01_LANCE_BASE;
 		dev->mem_start = KN01_LANCE_BASE + 0x01000000;
 		esar_base = KN01_RTC_BASE + 1;
+		lp->dma_irq = -1;
+
 		/*
 		 * setup the pointer arrays, this sucks [tm] :-(
 		 */
 		for (i = 0; i < RX_RING_SIZE; i++) {
 			lp->rx_buf_ptr_cpu[i] =
-			    (char *) (dev->mem_start + BUF_OFFSET_CPU
-				      + 2 * i * RX_BUFF_SIZE);
-
+				(char *)(dev->mem_start + BUF_OFFSET_CPU +
+					 2 * i * RX_BUFF_SIZE);
 			lp->rx_buf_ptr_lnc[i] =
-			    (char *) (BUF_OFFSET_LNC
-				      + i * RX_BUFF_SIZE);
-
+				(char *)(BUF_OFFSET_LNC + i * RX_BUFF_SIZE);
 		}
 		for (i = 0; i < TX_RING_SIZE; i++) {
 			lp->tx_buf_ptr_cpu[i] =
-			    (char *) (dev->mem_start + BUF_OFFSET_CPU
-				      + 2 * RX_RING_SIZE * RX_BUFF_SIZE
-				      + 2 * i * TX_BUFF_SIZE);
-			lp->tx_buf_ptr_lnc[i] = (char *) (BUF_OFFSET_LNC
-					    + RX_RING_SIZE * RX_BUFF_SIZE
-						     + i * TX_BUFF_SIZE);
-
+				(char *)(dev->mem_start + BUF_OFFSET_CPU +
+					 2 * RX_RING_SIZE * RX_BUFF_SIZE +
+					 2 * i * TX_BUFF_SIZE);
+			lp->tx_buf_ptr_lnc[i] =
+				(char *)(BUF_OFFSET_LNC +
+					 RX_RING_SIZE * RX_BUFF_SIZE +
+					 i * TX_BUFF_SIZE);
 		}
+
 		break;
+
 	default:
 		printk("declance_init called with unknown type\n");
 		ret = -ENODEV;
@@ -1133,6 +1172,9 @@
 		}
 	}
 
+	lp->next = root_lance_dev;
+	root_lance_dev = dev;
+
 	/* Copy the ethernet address to the device structure, later to the
 	 * lance initialization block so the lance gets it every time it's
 	 * (re)initialized.
@@ -1155,7 +1197,6 @@
 
 	printk(" irq = %d\n", dev->irq);
 
-	lp->dev = dev;
 	dev->open = &lance_open;
 	dev->stop = &lance_close;
 	dev->hard_start_xmit = &lance_start_xmit;
@@ -1167,8 +1208,6 @@
 	/* lp->ll is the location of the registers for lance card */
 	lp->ll = ll;
 
-	lp->name = lancestr;
-
 	/* busmaster_regval (CSR3) should be zero according to the PMAD-AA
 	 * specification.
 	 */
@@ -1176,8 +1215,6 @@
 
 	dev->dma = 0;
 
-	ether_setup(dev);
-
 	/* We cannot sleep if the chip is busy during a
 	 * multicast list update event, because such events
 	 * can occur from interrupts (ex. IPv6).  So we
@@ -1187,11 +1224,6 @@
 	lp->multicast_timer.data = (unsigned long) dev;
 	lp->multicast_timer.function = &lance_set_multicast_retry;
 
-#ifdef MODULE
-	dev->ifindex = dev_new_index();
-	lp->next_module = root_lance_dev;
-	root_lance_dev = lp;
-#endif
 	return 0;
 
 err_out:
@@ -1204,61 +1236,51 @@
 /* Find all the lance cards on the system and initialize them */
 static int __init dec_lance_probe(void)
 {
-	struct net_device *dev = NULL;
-	static int called;
-
-#ifdef MODULE
-	root_lance_dev = NULL;
-#endif
-
+	int count = 0;
 
+	/* Scan slots for PMAD-AA cards first. */
 #ifdef CONFIG_TC
-	int slot = -1;
-
 	if (TURBOCHANNEL) {
-		if (IOASIC && !called) {
-			called = 1;
-			type = ASIC_LANCE;
-		} else {
-			if ((slot = search_tc_card("PMAD-AA")) >= 0) {
-				type = PMAD_LANCE;
-			} else {
-				return -ENODEV;
-			}
-		}
-	} else {
-		if (!called) {
-			called = 1;
-			type = PMAX_LANCE;
-		} else {
-			return -ENODEV;
+		int slot;
+
+		while ((slot = search_tc_card("PMAD-AA")) >= 0) {
+			if (dec_lance_init(PMAD_LANCE, slot) < 0)
+				break;
+			count++;
 		}
 	}
-#else
-	if (!called && !TURBOCHANNEL) {
-		called = 1;
-		type = PMAX_LANCE;
-	} else {
-		return -ENODEV;
-	}
 #endif
 
-	return dec_lance_init(dev, type);
+	/* Then handle onboard devices. */
+	if (dec_interrupt[DEC_IRQ_LANCE] >= 0) {
+		if (dec_interrupt[DEC_IRQ_LANCE_MERR] >= 0) {
+#ifdef CONFIG_TC
+			if (dec_lance_init(ASIC_LANCE, -1) >= 0)
+				count++;
+#endif
+		} else if (!TURBOCHANNEL) {
+			if (dec_lance_init(PMAX_LANCE, -1) >= 0)
+				count++;
+		}
+	}
+
+	return (count > 0) ? 0 : -ENODEV;
 }
 
 static void __exit dec_lance_cleanup(void)
 {
-#ifdef MODULE
-   struct lance_private *lp;
-
-   while (root_lance_dev) {
-   lp = root_lance_dev->next_module;
+	while (root_lance_dev) {
+		struct net_device *dev = root_lance_dev;
+		struct lance_private *lp = (struct lance_private *)dev->priv;
 
-   unregister_netdev(root_lance_dev->dev);
-   kfree(root_lance_dev->dev);
-   root_lance_dev = lp;
-   }
-#endif /* MODULE */
+#ifdef CONFIG_TC
+		if (lp->slot >= 0)
+			release_tc_card(lp->slot);
+#endif
+		root_lance_dev = lp->next;
+		unregister_netdev(dev);
+		kfree(dev);
+	}
 }
 
 module_init(dec_lance_probe);
diff -urN linux-2.4.19-rc1/drivers/net/gt96100eth.c linux-2.4.19-rc2/drivers/net/gt96100eth.c
--- linux-2.4.19-rc1/drivers/net/gt96100eth.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/gt96100eth.c	Tue Jul 16 16:25:19 2002
@@ -32,18 +32,7 @@
  *                gt96100_cleanup_module(), and other general code cleanups
  *                <stevel@mvista.com>.
  */
-
-#ifndef __OPTIMIZE__
-#error You must compile this file with the correct options!
-#error See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
-#ifndef __mips__
-#error This driver only works with MIPS architectures!
-#endif
-
-
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
diff -urN linux-2.4.19-rc1/drivers/net/gt96100eth.h linux-2.4.19-rc2/drivers/net/gt96100eth.h
--- linux-2.4.19-rc1/drivers/net/gt96100eth.h	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/gt96100eth.h	Tue Jul 16 16:25:19 2002
@@ -27,6 +27,7 @@
 #ifndef _GT96100ETH_H
 #define _GT96100ETH_H
 
+#include <linux/config.h>
 #include <asm/galileo-boards/gt96100.h>
 
 #define dbg(lvl, format, arg...) \
diff -urN linux-2.4.19-rc1/drivers/net/ioc3-eth.c linux-2.4.19-rc2/drivers/net/ioc3-eth.c
--- linux-2.4.19-rc1/drivers/net/ioc3-eth.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/ioc3-eth.c	Tue Jul 16 16:25:19 2002
@@ -26,6 +26,7 @@
  *    which workarounds are required for them?  Do we ever have Lucent's?
  *  o For the 2.5 branch kill the mii-tool ioctls.
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
diff -urN linux-2.4.19-rc1/drivers/net/pppoe.c linux-2.4.19-rc2/drivers/net/pppoe.c
--- linux-2.4.19-rc1/drivers/net/pppoe.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/pppoe.c	Tue Jul 16 16:25:19 2002
@@ -5,7 +5,7 @@
  * PPPoE --- PPP over Ethernet (RFC 2516)
  *
  *
- * Version:    0.6.10
+ * Version:    0.6.11
  *
  * 030700 :     Fixed connect logic to allow for disconnect.
  * 270700 :	Fixed potential SMP problems; we must protect against
@@ -34,6 +34,9 @@
  * 121301 :     New ppp channels interface; cannot unregister a channel
  *              from interrupts.  Thus, we mark the socket as a ZOMBIE
  *              and do the unregistration later.
+ * 071502 :     When a connection is being torn down, we must remember that
+ *              ZOMBIE state connections are still connected and thus
+ *              pppox_unbind_sock must unbind them (in pppoe_release).
  *
  * Author:	Michal Ostrowski <mostrows@speakeasy.net>
  * Contributors:
@@ -443,8 +446,10 @@
 		 * what kind of SKB it is during backlog rcv.
 		 */
 		if (sk->lock.users == 0) {
+			/* We're no longer connect at the PPPOE layer,
+			 * and must wait for ppp channel to disconnect us.
+			 */
 			sk->state = PPPOX_ZOMBIE;
-			pppox_unbind_sock(sk);
 		}
 
 		bh_unlock_sock(sk);
diff -urN linux-2.4.19-rc1/drivers/net/pppox.c linux-2.4.19-rc2/drivers/net/pppox.c
--- linux-2.4.19-rc1/drivers/net/pppox.c	Fri Nov  9 14:02:24 2001
+++ linux-2.4.19-rc2/drivers/net/pppox.c	Tue Jul 16 16:25:19 2002
@@ -5,9 +5,9 @@
  * PPPoE --- PPP over Ethernet (RFC 2516)
  *
  *
- * Version:	0.5.1
+ * Version:	0.5.2
  *
- * Author:	Michal Ostrowski <mostrows@styx.uwaterloo.ca>
+ * Author:	Michal Ostrowski <mostrows@speakeasy.net>
  *
  * 051000 :	Initialization cleanup
  *
@@ -67,9 +67,9 @@
 {
 	/* Clear connection to ppp device, if attached. */
 
-	if (sk->state & PPPOX_BOUND) {
+	if (sk->state & (PPPOX_BOUND|PPPOX_ZOMBIE)) {
 		ppp_unregister_channel(&sk->protinfo.pppox->chan);
-		sk->state &= ~PPPOX_BOUND;
+		sk->state = PPPOX_DEAD;
 	}
 }
 
diff -urN linux-2.4.19-rc1/drivers/net/sb1250-mac.c linux-2.4.19-rc2/drivers/net/sb1250-mac.c
--- linux-2.4.19-rc1/drivers/net/sb1250-mac.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/sb1250-mac.c	Tue Jul 16 16:25:19 2002
@@ -53,6 +53,7 @@
 #error  You must compile this driver with "-O".
 #endif
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -65,8 +66,8 @@
 #include <linux/skbuff.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/config.h>
-#include <asm/processor.h>		/* Processor type for cache alignment. */
+#include <linux/compiler.h>
+#include <asm/processor.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/sibyte/sb1250.h>
@@ -207,13 +208,11 @@
  ********************************************************************* */
 
 struct sbmac_softc {
-	
 	/*
 	 * Linux-specific things
 	 */
-	
-	struct net_device *sbm_dev;		/* pointer to linux device */
-	spinlock_t sbm_lock;		/* spin lock */
+	struct net_device *sbm_dev;
+	spinlock_t sbm_lock;
 	struct timer_list sbm_timer;     	/* for monitoring MII */
 	struct net_device_stats sbm_stats; 
 	int sbm_devflags;			/* current device flags */
@@ -223,16 +222,15 @@
         int	     sbm_phy_oldk1stsr;
         int          sbm_phy_oldlinkstat;
 	int sbm_buffersize;
-	
+
 	unsigned char sbm_phys[2];
-	
+
 	/*
 	 * Controller-specific things
 	 */
-	
 	sbmac_port_t     sbm_base;          /* MAC's base address */
 	sbmac_state_t    sbm_state;         /* current state */
-	
+
 	sbmac_port_t     sbm_macenable;	/* MAC Enable Register */
 	sbmac_port_t     sbm_maccfg;	/* MAC Configuration Register */
 	sbmac_port_t     sbm_fifocfg;	/* FIFO configuration register */
@@ -241,16 +239,15 @@
 	sbmac_port_t     sbm_isr;		/* Interrupt status register */
 	sbmac_port_t     sbm_imr;		/* Interrupt mask register */
 	sbmac_port_t     sbm_mdio;		/* MDIO register */
-	
+
 	sbmac_speed_t    sbm_speed;		/* current speed */
 	sbmac_duplex_t   sbm_duplex;	/* current duplex */
 	sbmac_fc_t       sbm_fc;		/* current flow control setting */
 	
 	u_char           sbm_hwaddr[ETHER_ADDR_LEN];
-	
+
 	sbmacdma_t       sbm_txdma;		/* for now, only use channel 0 */
 	sbmacdma_t       sbm_rxdma;
-	
 };
 
 
@@ -438,7 +435,7 @@
 #define M_MAC_MDIO_DIR_OUTPUT	0		/* for clarity */
 
 
-/**********************************************************************
+/*
  *  SBMAC_MII_SYNC(s)
  *  
  *  Synchronize with the MII - send a pattern of bits to the MII
@@ -449,8 +446,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbmac_mii_sync(struct sbmac_softc *s)
 {
 	int cnt;
@@ -466,7 +462,7 @@
 	}
 }
 
-/**********************************************************************
+/*
  *  SBMAC_MII_SENDDATA(s,data,bitcnt)
  *  
  *  Send some bits to the MII.  The bits to be sent are right-
@@ -476,8 +472,7 @@
  *  	   s - sbmac structure
  *  	   data - data to send
  *  	   bitcnt - number of bits to send
- ********************************************************************* */
-
+ */
 static void sbmac_mii_senddata(struct sbmac_softc *s,unsigned int data, int bitcnt)
 {
 	int i;
@@ -499,9 +494,7 @@
 	}
 }
 
-
-
-/**********************************************************************
+/*
  *  SBMAC_MII_READ(s,phyaddr,regidx)
  *  
  *  Read a PHY register.
@@ -513,8 +506,7 @@
  *  	   
  *  Return value:
  *  	   value read, or 0 if an error occured.
- ********************************************************************* */
-
+ */
 static unsigned int sbmac_mii_read(struct sbmac_softc *s,int phyaddr,int regidx)
 {
 	int idx;
@@ -586,7 +578,7 @@
 }
 
 
-/**********************************************************************
+/*
  *  SBMAC_MII_WRITE(s,phyaddr,regidx,regval)
  *  
  *  Write a value to a PHY register.
@@ -599,8 +591,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbmac_mii_write(struct sbmac_softc *s,int phyaddr,int regidx,
 			    unsigned int regval)
 {
@@ -619,7 +610,7 @@
 
 
 
-/**********************************************************************
+/*
  *  SBDMA_INITCTX(d,s,chan,txrx,maxdescr)
  *  
  *  Initialize a DMA channel context.  Since there are potentially
@@ -635,8 +626,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbdma_initctx(sbmacdma_t *d,
 			  struct sbmac_softc *s,
 			  int chan,
@@ -692,7 +682,7 @@
 	
 }
 
-/**********************************************************************
+/*
  *  SBDMA_CHANNEL_START(d)
  *  
  *  Initialize the hardware registers for a DMA channel.
@@ -702,8 +692,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbdma_channel_start(sbmacdma_t *d)
 {
 	/*
@@ -739,8 +728,7 @@
 	skb_reserve(skb,newaddr-addr+offset);
 }
 
-
-/**********************************************************************
+/*
  *  SBDMA_ADD_RCVBUFFER(d,sb)
  *  
  *  Add a buffer to the specified DMA channel.   For receive channels,
@@ -753,9 +741,7 @@
  *  Return value:
  *  	   0 if buffer could not be added (ring is full)
  *  	   1 if buffer added successfully
- ********************************************************************* */
-
-
+ */
 static int sbdma_add_rcvbuffer(sbmacdma_t *d,struct sk_buff *sb)
 {
 	sbdmadscr_t *dsc;
@@ -850,7 +836,7 @@
 	return 0;					/* we did it */
 }
 
-/**********************************************************************
+/*
  *  SBDMA_ADD_TXBUFFER(d,sb)
  *  
  *  Add a transmit buffer to the specified DMA channel, causing a
@@ -863,9 +849,7 @@
  *  Return value:
  *  	   0 transmit queued successfully
  *  	   otherwise error code
- ********************************************************************* */
-
-
+ */
 static int sbdma_add_txbuffer(sbmacdma_t *d,struct sk_buff *sb)
 {
 	sbdmadscr_t *dsc;
@@ -938,9 +922,6 @@
 	return 0;					/* we did it */
 }
 
-
-
-
 /**********************************************************************
  *  SBDMA_EMPTYRING(d)
  *  
@@ -979,19 +960,17 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbdma_fillring(sbmacdma_t *d)
 {
 	int idx;
 	
-	for (idx = 0; idx < SBMAC_MAX_RXDESCR-1; idx++) {
-		if (sbdma_add_rcvbuffer(d,NULL) != 0) break;
-	}
+	for (idx = 0; idx < SBMAC_MAX_RXDESCR-1; idx++)
+		if (sbdma_add_rcvbuffer(d, NULL) != 0)
+			break;
 }
 
-
-/**********************************************************************
+/*
  *  SBDMA_RX_PROCESS(sc,d)
  *  
  *  Process "completed" receive buffers on the specified DMA channel.  
@@ -1005,8 +984,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbdma_rx_process(struct sbmac_softc *sc,sbmacdma_t *d)
 {
 	int curidx;
@@ -1026,83 +1004,72 @@
 		 * just compare the low-order bits of the virtual address
 		 * (sbdma_remptr) and the physical address (sbdma_curdscr CSR)
 		 */
-		
 		curidx = d->sbdma_remptr - d->sbdma_dscrtable;
 		hwidx = (int) (((SBMAC_READCSR(d->sbdma_curdscr) & M_DMA_CURDSCR_ADDR) -
 				d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));
-		
+
 		/*
 		 * If they're the same, that means we've processed all
 		 * of the descriptors up to (but not including) the one that
 		 * the hardware is working on right now.
 		 */
-		
-		if (curidx == hwidx) break;
-		
+		if (curidx == hwidx)
+			break;
+
 		/*
 		 * Otherwise, get the packet's sk_buff ptr back
 		 */
-		
-		dsc = &(d->sbdma_dscrtable[curidx]);
+		dsc = d->sbdma_dscrtable + curidx;
 		sb = d->sbdma_ctxtable[curidx];
 		d->sbdma_ctxtable[curidx] = NULL;
-		
+
 		len = (int)G_DMA_DSCRB_PKT_SIZE(dsc->dscr_b) - 4;
-		
+
 		/*
 		 * Check packet status.  If good, process it.
 		 * If not, silently drop it and put it back on the
 		 * receive ring.
 		 */
-		
 		if (!(dsc->dscr_a & M_DMA_ETHRX_BAD)) {
-			
 			/*
 			 * Set length into the packet
 			 */
 			skb_put(sb,len);
-			
+
        			/*
 			 * Add a new buffer to replace the old one.  If we fail
 			 * to allocate a buffer, we're going to drop this
 			 * packet and put it right back on the receive ring.
 			 */
-			
-			if (sbdma_add_rcvbuffer(d,NULL) == -ENOBUFS) {
-			    sbdma_add_rcvbuffer(d,sb);	/* re-add old buffer */
-			    }
-			else {
-			    /*
-			     * Buffer has been replaced on the receive ring.
-			     * Pass the buffer to the kernel
-			     */
-			    sc->sbm_stats.rx_bytes += len;
-			    sc->sbm_stats.rx_packets++;
-			    sb->protocol = eth_type_trans(sb,d->sbdma_eth->sbm_dev);
-			    netif_rx(sb);
-			    }
-		}
-		else {
+			if (sbdma_add_rcvbuffer(d, NULL) == -ENOBUFS) {
+				sbdma_add_rcvbuffer(d,sb);	/* re-add old buffer */
+			} else {
+				/*
+				 * Buffer has been replaced on the receive ring.
+				 * Pass the buffer to the kernel
+				 */
+				sc->sbm_stats.rx_bytes += len;
+				sc->sbm_stats.rx_packets++;
+				sb->protocol = eth_type_trans(sb,
+							d->sbdma_eth->sbm_dev);
+				netif_rx(sb);
+			}
+		} else {
 			/*
 			 * Packet was mangled somehow.  Just drop it and
 			 * put it back on the receive ring.
 			 */
 			sbdma_add_rcvbuffer(d,sb);
 		}
-		
-		
+
 		/* 
 		 * .. and advance to the next buffer.
 		 */
-		
 		d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);
-		
 	}
 }
 
-
-
-/**********************************************************************
+/*
  *  SBDMA_TX_PROCESS(sc,d)
  *  
  *  Process "completed" transmit buffers on the specified DMA channel.  
@@ -1117,8 +1084,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbdma_tx_process(struct sbmac_softc *sc,sbmacdma_t *d)
 {
 	int curidx;
@@ -1127,8 +1093,8 @@
 	struct sk_buff *sb;
 	unsigned long flags;
 
-	spin_lock_irqsave(&(sc->sbm_lock), flags);
-	
+	spin_lock_irqsave(&sc->sbm_lock, flags);
+
 	for (;;) {
 		/* 
 		 * figure out where we are (as an index) and where
@@ -1159,64 +1125,59 @@
 			*/
 			  
 			uint64_t tmp = SBMAC_READCSR(d->sbdma_curdscr);
-			if (!tmp) {
+			if (!tmp)
 				break;
-			}
+
 			hwidx = (int) (((tmp & M_DMA_CURDSCR_ADDR) -
 					d->sbdma_dscrtable_phys) / sizeof(sbdmadscr_t));
 		}
+
 		/*
 		 * If they're the same, that means we've processed all
 		 * of the descriptors up to (but not including) the one that
 		 * the hardware is working on right now.
 		 */
-		
-		if (curidx == hwidx) break;
+		if (curidx == hwidx)
+			break;
 		
 		/*
 		 * Otherwise, get the packet's sk_buff ptr back
 		 */
-		
-		dsc = &(d->sbdma_dscrtable[curidx]);
+		dsc = d->sbdma_dscrtable + curidx;
 		sb = d->sbdma_ctxtable[curidx];
 		d->sbdma_ctxtable[curidx] = NULL;
-		
+
 		/*
 		 * Stats
 		 */
-		
 		sc->sbm_stats.tx_bytes += sb->len;
 		sc->sbm_stats.tx_packets++;
-		
+
 		/*
 		 * for transmits, we just free buffers.
 		 */
-		
 		dev_kfree_skb_irq(sb);
-		
+
 		/* 
 		 * .. and advance to the next buffer.
 		 */
-
 		d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);
 		
 	}
-	
+
 	/*
 	 * Decide if we should wake up the protocol or not.
 	 * Other drivers seem to do this when we reach a low
 	 * watermark on the transmit queue.
 	 */
-	
 	netif_wake_queue(d->sbdma_eth->sbm_dev);
-	
-	spin_unlock_irqrestore(&(sc->sbm_lock), flags);
-	
+
+	spin_unlock_irqrestore(&sc->sbm_lock, flags);
 }
 
 
 
-/**********************************************************************
+/*
  *  SBMAC_INITCTX(s)
  *  
  *  Initialize an Ethernet context structure - this is called
@@ -1229,8 +1190,7 @@
  *  	   
  *  Return value:
  *  	   0
- ********************************************************************* */
-
+ */
 static int sbmac_initctx(struct sbmac_softc *s)
 {
 	
@@ -1260,8 +1220,8 @@
 	 * Note: Only do this _once_, as it allocates memory from the kernel!
 	 */
 	
-	sbdma_initctx(&(s->sbm_txdma),s,0,DMA_TX,SBMAC_MAX_TXDESCR);
-	sbdma_initctx(&(s->sbm_rxdma),s,0,DMA_RX,SBMAC_MAX_RXDESCR);
+	sbdma_initctx(&s->sbm_txdma, s, 0, DMA_TX,SBMAC_MAX_TXDESCR);
+	sbdma_initctx(&s->sbm_rxdma, s, 0, DMA_RX,SBMAC_MAX_RXDESCR);
 	
 	/*
 	 * initial state is OFF
@@ -1280,7 +1240,6 @@
 	return 0;
 }
 
-
 static void sbdma_uninitctx(struct sbmacdma_s *d)
 {
 	if (d->sbdma_dscrtable) {
@@ -1297,12 +1256,11 @@
 
 static void sbmac_uninitctx(struct sbmac_softc *sc)
 {
-	sbdma_uninitctx(&(sc->sbm_txdma));
-	sbdma_uninitctx(&(sc->sbm_rxdma));
+	sbdma_uninitctx(&sc->sbm_txdma);
+	sbdma_uninitctx(&sc->sbm_rxdma);
 }
 
-
-/**********************************************************************
+/*
  *  SBMAC_CHANNEL_START(s)
  *  
  *  Start packet processing on this MAC.
@@ -1312,8 +1270,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbmac_channel_start(struct sbmac_softc *s)
 {
 	uint64_t reg;
@@ -1438,34 +1395,28 @@
 	/*
 	 * Initialize DMA channels (rings should be ok now)
 	 */
-	
-	sbdma_channel_start(&(s->sbm_rxdma));
-	sbdma_channel_start(&(s->sbm_txdma));
-	
+	sbdma_channel_start(&s->sbm_rxdma);
+	sbdma_channel_start(&s->sbm_txdma);
+
 	/*
 	 * Configure the speed, duplex, and flow control
 	 */
-
 	sbmac_set_speed(s,s->sbm_speed);
 	sbmac_set_duplex(s,s->sbm_duplex,s->sbm_fc);
 	
 	/*
 	 * Fill the receive ring
 	 */
-	
-	sbdma_fillring(&(s->sbm_rxdma));
-	
+	sbdma_fillring(&s->sbm_rxdma);
+
 	/* 
 	 * Turn on the rest of the bits in the enable register
 	 */      
-	
 	SBMAC_WRITECSR(s->sbm_macenable,
 		       M_MAC_RXDMA_EN0 |
 		       M_MAC_TXDMA_EN0 |
 		       M_MAC_RX_ENABLE |
 		       M_MAC_TX_ENABLE);
-	
-	
 
 	/*
 	 * Accept any kind of interrupt on TX and RX DMA channel 0
@@ -1473,37 +1424,30 @@
 	SBMAC_WRITECSR(s->sbm_imr,
 		       (M_MAC_INT_CHANNEL << S_MAC_TX_CH0) |
 		       (M_MAC_INT_CHANNEL << S_MAC_RX_CH0));
-	
+
 	/* 
 	 * Enable receiving unicasts and broadcasts 
 	 */
-	
 	SBMAC_WRITECSR(s->sbm_rxfilter,M_MAC_UCAST_EN | M_MAC_BCAST_EN);
-	
+
 	/*
 	 * we're running now. 
 	 */
-	
 	s->sbm_state = sbmac_state_on;
-	
+
 	/* 
 	 * Program multicast addresses 
 	 */
-	
 	sbmac_setmulti(s);
-	
+
 	/* 
 	 * If channel was in promiscuous mode before, turn that on 
 	 */
-	
-	if (s->sbm_devflags & IFF_PROMISC) {
+	if (s->sbm_devflags & IFF_PROMISC)
 		sbmac_promiscuous_mode(s,1);
-	}
-	
 }
 
-
-/**********************************************************************
+/*
  *  SBMAC_CHANNEL_STOP(s)
  *  
  *  Stop packet processing on this MAC.
@@ -1513,8 +1457,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbmac_channel_stop(struct sbmac_softc *s)
 {
 	uint64_t ctl;
@@ -1545,12 +1488,11 @@
 	
 	/* Empty the receive and transmit rings */
 	
-	sbdma_emptyring(&(s->sbm_rxdma));
-	sbdma_emptyring(&(s->sbm_txdma));
-	
+	sbdma_emptyring(&s->sbm_rxdma);
+	sbdma_emptyring(&s->sbm_txdma);
 }
 
-/**********************************************************************
+/*
  *  SBMAC_SET_CHANNEL_STATE(state)
  *  
  *  Set the channel's state ON or OFF
@@ -1560,7 +1502,7 @@
  *  	   
  *  Return value:
  *  	   old state
- ********************************************************************* */
+ */
 static sbmac_state_t sbmac_set_channel_state(struct sbmac_softc *sc,
 					     sbmac_state_t state)
 {
@@ -1593,7 +1535,7 @@
 }
 
 
-/**********************************************************************
+/*
  *  SBMAC_PROMISCUOUS_MODE(sc,onoff)
  *  
  *  Turn on or off promiscuous mode
@@ -1604,8 +1546,7 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
-
+ */
 static void sbmac_promiscuous_mode(struct sbmac_softc *sc,int onoff)
 {
 	uint64_t reg;
@@ -1641,17 +1582,15 @@
 static void sbmac_init_and_start(struct sbmac_softc *sc)
 {
 	unsigned long flags;
-	
-	spin_lock_irqsave(&(sc->sbm_lock),flags);
-	
-	sbmac_set_channel_state(sc,sbmac_state_on);
-	
-	spin_unlock_irqrestore(&(sc->sbm_lock),flags);
+
+	spin_lock_irqsave(&sc->sbm_lock, flags);
+	sbmac_set_channel_state(sc, sbmac_state_on);
+	spin_unlock_irqrestore(&sc->sbm_lock, flags);
 }
 #endif
 
 
-/**********************************************************************
+/*
  *  SBMAC_ADDR2REG(ptr)
  *  
  *  Convert six bytes into the 64-bit register value that
@@ -1662,14 +1601,13 @@
  *  	   
  *  Return value:
  *  	   register value
- ********************************************************************* */
-
+ */
 static uint64_t sbmac_addr2reg(unsigned char *ptr)
 {
 	uint64_t reg = 0;
-	
+
 	ptr += 6;
-	
+
 	reg |= (uint64_t) *(--ptr); 
 	reg <<= 8;
 	reg |= (uint64_t) *(--ptr); 
@@ -1681,12 +1619,12 @@
 	reg |= (uint64_t) *(--ptr); 
 	reg <<= 8;
 	reg |= (uint64_t) *(--ptr); 
-	
+
 	return reg;
 }
 
 
-/**********************************************************************
+/*
  *  SBMAC_SET_SPEED(s,speed)
  *  
  *  Configure LAN speed for the specified MAC.
@@ -1699,8 +1637,7 @@
  *  Return value:
  *  	   1 if successful
  *      0 indicates invalid parameters
- ********************************************************************* */
-
+ */
 static int sbmac_set_speed(struct sbmac_softc *s,sbmac_speed_t speed)
 {
 	uint64_t cfg;
@@ -1791,7 +1728,8 @@
  *  	   0 if an invalid parameter combination was specified
  ********************************************************************* */
 
-static int sbmac_set_duplex(struct sbmac_softc *s,sbmac_duplex_t duplex,sbmac_fc_t fc)
+static int sbmac_set_duplex(struct sbmac_softc *s, sbmac_duplex_t duplex,
+                            sbmac_fc_t fc)
 {
 	uint64_t cfg;
 	
@@ -1872,57 +1810,37 @@
 	return 1;
 }
 
-
-
-
-/**********************************************************************
- *  SBMAC_INTR()
- *  
- *  Interrupt handler for MAC interrupts
- *  
- *  Input parameters: 
- *  	   MAC structure
- *  	   
- *  Return value:
- *  	   nothing
- ********************************************************************* */
 static void sbmac_intr(int irq,void *dev_instance,struct pt_regs *rgs)
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
-	struct sbmac_softc *sc = (struct sbmac_softc *) (dev->priv);
+	struct sbmac_softc *sc = (struct sbmac_softc *) dev->priv;
 	uint64_t isr;
-	
+
 	for (;;) {
-		
 		/*
 		 * Read the ISR (this clears the bits in the real register)
 		 */
-		
 		isr = SBMAC_READCSR(sc->sbm_isr);
-		
-		if (isr == 0) break;
-		
+
+		if (isr == 0)
+			break;
+
 		/*
 		 * Transmits on channel 0
 		 */
-		
-		if (isr & (M_MAC_INT_CHANNEL << S_MAC_TX_CH0)) {
-			sbdma_tx_process(sc,&(sc->sbm_txdma));
-		}
-		
+		if (isr & (M_MAC_INT_CHANNEL << S_MAC_TX_CH0))
+			sbdma_tx_process(sc, &sc->sbm_txdma);
+
 		/*
 		 * Receives on channel 0
 		 */
-		
-		if (isr & (M_MAC_INT_CHANNEL << S_MAC_RX_CH0)) {
-			sbdma_rx_process(sc,&(sc->sbm_rxdma));
-		}
+		if (isr & (M_MAC_INT_CHANNEL << S_MAC_RX_CH0))
+			sbdma_rx_process(sc, &sc->sbm_rxdma);
 	}
-	
 }
 
 
-/**********************************************************************
+/*
  *  SBMAC_START_TX(skb,dev)
  *  
  *  Start output on the specified interface.  Basically, we 
@@ -1934,28 +1852,29 @@
  *  	   
  *  Return value:
  *  	   nothing
- ********************************************************************* */
+ */
 static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev)
 {
 	struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv;
-	
+
 	/* lock eth irq */
-	spin_lock_irq (&sc->sbm_lock);
-	
+	spin_lock_irq(&sc->sbm_lock);
+
 	/*
 	 * Put the buffer on the transmit ring.  If we 
 	 * don't have room, stop the queue.
 	 */
-	
-	if (sbdma_add_txbuffer(&(sc->sbm_txdma),skb)) {
-		/* XXX save skb that we could not send */
+	if (unlikely(sbdma_add_txbuffer(&sc->sbm_txdma, skb))) {
 		netif_stop_queue(dev);
+		spin_unlock_irq(&sc->sbm_lock);
+
+		return 1;
 	}
-	
+
 	dev->trans_start = jiffies;
-	
-	spin_unlock_irq (&sc->sbm_lock);
-	
+
+	spin_unlock_irq(&sc->sbm_lock);
+
 	return 0;
 }
 
@@ -2049,8 +1968,6 @@
 	}
 }
 
-
-
 #if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR)
 /**********************************************************************
  *  SBMAC_PARSE_XDIGIT(str)
@@ -2076,20 +1993,6 @@
 	return digit;
 }
 
-/**********************************************************************
- *  SBMAC_PARSE_HWADDR(str,hwaddr)
- *  
- *  Convert a string in the form xx:xx:xx:xx:xx:xx into a 6-byte
- *  Ethernet address.
- *  
- *  Input parameters: 
- *  	   str - string
- *  	   hwaddr - pointer to hardware address
- *  	   
- *  Return value:
- *  	   0 if ok, else -1
- ********************************************************************* */
-
 static int sbmac_parse_hwaddr(char *str,u_char *hwaddr)
 {
 	int digit1,digit2;
@@ -2121,18 +2024,6 @@
 }
 #endif
 
-/**********************************************************************
- *  SBMAC_INIT(dev)
- *  
- *  Attach routine - init hardware and hook ourselves into linux
- *  
- *  Input parameters: 
- *  	   dev - net_device structure
- *  	   
- *  Return value:
- *  	   status
- ********************************************************************* */
-
 static int sbmac_init(struct net_device *dev)
 {
 	struct sbmac_softc *sc;
@@ -2195,7 +2086,7 @@
 	 * Set up Linux device callins
 	 */
 	
-	spin_lock_init(&(sc->sbm_lock));
+	spin_lock_init(&sc->sbm_lock);
 	
 	ether_setup(dev);
 	dev->open               = sbmac_open;
@@ -2211,7 +2102,6 @@
 	
 }
 
-
 static int sbmac_open(struct net_device *dev)
 {
 	struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv;
@@ -2264,113 +2154,101 @@
 	return 0;
 }
 
-
-
 static int sbmac_mii_poll(struct sbmac_softc *s,int noisy)
 {
-    int bmsr,bmcr,k1stsr,anlpar;
-    int chg;
-    char buffer[100];
-    char *p = buffer;
+	int bmsr,bmcr,k1stsr,anlpar;
+	int chg;
+	char buffer[100];
+	char *p = buffer;
 
-    /* Read the mode status and mode control registers. */
-    bmsr = sbmac_mii_read(s,s->sbm_phys[0],MII_BMSR);
-    bmcr = sbmac_mii_read(s,s->sbm_phys[0],MII_BMCR);
+	/* Read the mode status and mode control registers. */
+	bmsr = sbmac_mii_read(s,s->sbm_phys[0],MII_BMSR);
+	bmcr = sbmac_mii_read(s,s->sbm_phys[0],MII_BMCR);
 
-    /* get the link partner status */
-    anlpar = sbmac_mii_read(s,s->sbm_phys[0],MII_ANLPAR);
+	/* get the link partner status */
+	anlpar = sbmac_mii_read(s,s->sbm_phys[0],MII_ANLPAR);
 
-    /* if supported, read the 1000baseT register */
-    if (bmsr & BMSR_1000BT_XSR) {
-	k1stsr = sbmac_mii_read(s,s->sbm_phys[0],MII_K1STSR);
-	}
-    else {
-	k1stsr = 0;
+	/* if supported, read the 1000baseT register */
+	if (bmsr & BMSR_1000BT_XSR) {
+		k1stsr = sbmac_mii_read(s,s->sbm_phys[0],MII_K1STSR);
+	} else {
+		k1stsr = 0;
 	}
 
-    chg = 0;
+	chg = 0;
 
-    if ((bmsr & BMSR_LINKSTAT) == 0) {
-	/*
-	 * If link status is down, clear out old info so that when
-	 * it comes back up it will force us to reconfigure speed
-	 */
-	s->sbm_phy_oldbmsr = 0;
-	s->sbm_phy_oldanlpar = 0;
-	s->sbm_phy_oldk1stsr = 0;
-	return 0;
+	if ((bmsr & BMSR_LINKSTAT) == 0) {
+		/*
+		 * If link status is down, clear out old info so that when
+		 * it comes back up it will force us to reconfigure speed
+		 */
+		s->sbm_phy_oldbmsr = 0;
+		s->sbm_phy_oldanlpar = 0;
+		s->sbm_phy_oldk1stsr = 0;
+		return 0;
 	}
 
-    if ((s->sbm_phy_oldbmsr != bmsr) ||
-	(s->sbm_phy_oldanlpar != anlpar) ||
-	(s->sbm_phy_oldk1stsr != k1stsr)) {
-	if (debug > 1) {
-	    printk(KERN_DEBUG "%s: bmsr:%x/%x anlpar:%x/%x  k1stsr:%x/%x\n",
-	       s->sbm_dev->name,
-	       s->sbm_phy_oldbmsr,bmsr,
-	       s->sbm_phy_oldanlpar,anlpar,
-	       s->sbm_phy_oldk1stsr,k1stsr);
-	    }
-	s->sbm_phy_oldbmsr = bmsr;
-	s->sbm_phy_oldanlpar = anlpar;
-	s->sbm_phy_oldk1stsr = k1stsr;
-	chg = 1;
+	if ((s->sbm_phy_oldbmsr != bmsr) ||
+	    (s->sbm_phy_oldanlpar != anlpar) ||
+	    (s->sbm_phy_oldk1stsr != k1stsr)) {
+		if (debug > 1)
+			printk(KERN_DEBUG
+			       "%s: bmsr:%x/%x anlpar:%x/%x  k1stsr:%x/%x\n",
+			       s->sbm_dev->name,
+			       s->sbm_phy_oldbmsr,bmsr,
+			       s->sbm_phy_oldanlpar,anlpar,
+			       s->sbm_phy_oldk1stsr,k1stsr);
+		s->sbm_phy_oldbmsr = bmsr;
+		s->sbm_phy_oldanlpar = anlpar;
+		s->sbm_phy_oldk1stsr = k1stsr;
+		chg = 1;
 	}
 
-    if (chg == 0) return 0;
+	if (chg == 0)
+		return 0;
 
-    p += sprintf(p,"Link speed: ");
+	p += sprintf(p,"Link speed: ");
 
-    if (k1stsr & K1STSR_LP1KFD) {
-	s->sbm_speed = sbmac_speed_1000;
-	s->sbm_duplex = sbmac_duplex_full;
-	s->sbm_fc = sbmac_fc_frame;
-	p += sprintf(p,"1000BaseT FDX");
-	}
-    else if (k1stsr & K1STSR_LP1KHD) {
-	s->sbm_speed = sbmac_speed_1000;
-	s->sbm_duplex = sbmac_duplex_half;
-	s->sbm_fc = sbmac_fc_disabled;
-	p += sprintf(p,"1000BaseT HDX");
-	}
-    else if (anlpar & ANLPAR_TXFD) {
-	s->sbm_speed = sbmac_speed_100;
-	s->sbm_duplex = sbmac_duplex_full;
-	s->sbm_fc = (anlpar & ANLPAR_PAUSE) ? sbmac_fc_frame : sbmac_fc_disabled;
-	p += sprintf(p,"100BaseT FDX");
-	}
-    else if (anlpar & ANLPAR_TXHD) {
-	s->sbm_speed = sbmac_speed_100;
-	s->sbm_duplex = sbmac_duplex_half;
-	s->sbm_fc = sbmac_fc_disabled;
-	p += sprintf(p,"100BaseT HDX");
-	}
-    else if (anlpar & ANLPAR_10FD) {
-	s->sbm_speed = sbmac_speed_10;
-	s->sbm_duplex = sbmac_duplex_full;
-	s->sbm_fc = sbmac_fc_frame;
-	p += sprintf(p,"10BaseT FDX");
-	}
-    else if (anlpar & ANLPAR_10HD) {
-	s->sbm_speed = sbmac_speed_10;
-	s->sbm_duplex = sbmac_duplex_half;
-	s->sbm_fc = sbmac_fc_collision;
-	p += sprintf(p,"10BaseT HDX");
-	}
-    else {
-	p += sprintf(p,"Unknown");
-	}
+	if (k1stsr & K1STSR_LP1KFD) {
+		s->sbm_speed = sbmac_speed_1000;
+		s->sbm_duplex = sbmac_duplex_full;
+		s->sbm_fc = sbmac_fc_frame;
+		p += sprintf(p,"1000BaseT FDX");
+	} else if (k1stsr & K1STSR_LP1KHD) {
+		s->sbm_speed = sbmac_speed_1000;
+		s->sbm_duplex = sbmac_duplex_half;
+		s->sbm_fc = sbmac_fc_disabled;
+		p += sprintf(p,"1000BaseT HDX");
+	} else if (anlpar & ANLPAR_TXFD) {
+		s->sbm_speed = sbmac_speed_100;
+		s->sbm_duplex = sbmac_duplex_full;
+		s->sbm_fc = (anlpar & ANLPAR_PAUSE) ? sbmac_fc_frame
+		                                    : sbmac_fc_disabled;
+		p += sprintf(p,"100BaseT FDX");
+	} else if (anlpar & ANLPAR_TXHD) {
+		s->sbm_speed = sbmac_speed_100;
+		s->sbm_duplex = sbmac_duplex_half;
+		s->sbm_fc = sbmac_fc_disabled;
+		p += sprintf(p,"100BaseT HDX");
+	} else if (anlpar & ANLPAR_10FD) {
+		s->sbm_speed = sbmac_speed_10;
+		s->sbm_duplex = sbmac_duplex_full;
+		s->sbm_fc = sbmac_fc_frame;
+		p += sprintf(p,"10BaseT FDX");
+	} else if (anlpar & ANLPAR_10HD) {
+		s->sbm_speed = sbmac_speed_10;
+		s->sbm_duplex = sbmac_duplex_half;
+		s->sbm_fc = sbmac_fc_collision;
+		p += sprintf(p,"10BaseT HDX");
+	} else
+		p += sprintf(p,"Unknown");
 
-    if (noisy) {
-	    printk(KERN_INFO "%s: %s\n",s->sbm_dev->name,buffer);
-	    }
+	if (noisy)
+		printk(KERN_INFO "%s: %s\n",s->sbm_dev->name,buffer);
 
-    return 1;
+		return 1;
 }
 
-
-
-
 static void sbmac_timer(unsigned long data)
 {
 	struct net_device *dev = (struct net_device *)data;
@@ -2417,7 +2295,6 @@
 	add_timer(&sc->sbm_timer);
 }
 
-
 static void sbmac_tx_timeout (struct net_device *dev)
 {
 	struct sbmac_softc *sc = (struct sbmac_softc *) dev->priv;
@@ -2433,9 +2310,6 @@
 	printk (KERN_WARNING "%s: Transmit timed out\n",dev->name);
 }
 
-
-
-
 static struct net_device_stats *sbmac_get_stats(struct net_device *dev)
 {
 	struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv;
@@ -2450,8 +2324,6 @@
 	return &sc->sbm_stats;
 }
 
-
-
 static void sbmac_set_rx_mode(struct net_device *dev)
 {
 	unsigned long flags;
@@ -2483,7 +2355,6 @@
 	/*
 	 * Program the multicasts.  Do this every time.
 	 */
-	
 	sbmac_setmulti(sc);
 	
 }
@@ -2528,36 +2399,33 @@
 {
 	struct sbmac_softc *sc = (struct sbmac_softc *)dev->priv;
 	unsigned long flags;
-	
+
 	sbmac_set_channel_state(sc,sbmac_state_off);
-	
+
 	del_timer_sync(&sc->sbm_timer);
-	
+
 	spin_lock_irqsave(&sc->sbm_lock, flags);
-	
+
 	netif_stop_queue(dev);
-	
-	if (debug > 1) {
+
+	if (debug > 1)
 		printk(KERN_DEBUG "%s: Shutting down ethercard\n",dev->name);
-	}
-	
+
 	spin_unlock_irqrestore(&sc->sbm_lock, flags);
-	
+
 	/* Make sure there is no irq-handler running on a different CPU. */
 	synchronize_irq();
-	
+
 	free_irq(dev->irq, dev);
-	
-	sbdma_emptyring(&(sc->sbm_txdma));
-	sbdma_emptyring(&(sc->sbm_rxdma));
-	
+
+	sbdma_emptyring(&sc->sbm_txdma);
+	sbdma_emptyring(&sc->sbm_rxdma);
+
 	MOD_DEC_USE_COUNT;
-	
+
 	return 0;
 }
 
-
-
 #if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR)
 static void
 sbmac_setup_hwaddr(int chan,char *addr)
diff -urN linux-2.4.19-rc1/drivers/net/starfire.c linux-2.4.19-rc2/drivers/net/starfire.c
--- linux-2.4.19-rc1/drivers/net/starfire.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/starfire.c	Tue Jul 16 16:25:19 2002
@@ -128,17 +128,14 @@
  * firmware files) does not allow one to redistribute them. Thus, we can't
  * include the firmware with this driver.
  *
- * However, an end-user is allowed to download and use it, after
- * converting it to C header files using starfire_firmware.pl.
+ * However, should a legal-to-use firmware become available,
+ * the driver developer would need only to obtain the firmware in the
+ * form of a C header file.
  * Once that's done, the #undef below must be changed into a #define
  * for this driver to really use the firmware. Note that Rx/Tx
  * hardware TCP checksumming is not possible without the firmware.
  *
- * If Adaptec could allow redistribution of the firmware (even in binary
- * format), life would become a lot easier. Unfortunately, I've lost my
- * Adaptec contacts, so progress on this front is rather unlikely to
- * occur. If anybody from Adaptec reads this and can help with this matter,
- * please let me know...
+ * WANTED: legal firmware to include with this GPL'd driver.
  */
 #undef HAS_FIRMWARE
 /*
diff -urN linux-2.4.19-rc1/drivers/net/starfire_firmware.pl linux-2.4.19-rc2/drivers/net/starfire_firmware.pl
--- linux-2.4.19-rc1/drivers/net/starfire_firmware.pl	Fri Sep  7 09:28:38 2001
+++ linux-2.4.19-rc2/drivers/net/starfire_firmware.pl	Wed Dec 31 16:00:00 1969
@@ -1,31 +0,0 @@
-#!/usr/bin/perl
-
-# This script can be used to generate a new starfire_firmware.h
-# from GFP_RX.DAT and GFP_TX.DAT, files included with the DDK
-# and also with the Novell drivers.
-
-open FW, "GFP_RX.DAT" || die;
-open FWH, ">starfire_firmware.h" || die;
-
-printf(FWH "static u32 firmware_rx[] = {\n");
-$counter = 0;
-while ($foo = <FW>) {
-  chomp;
-  printf(FWH "  0x%s, 0x0000%s,\n", substr($foo, 4, 8), substr($foo, 0, 4));
-  $counter++;
-}
-
-close FW;
-open FW, "GFP_TX.DAT" || die;
-
-printf(FWH "};\t/* %d Rx instructions */\n#define FIRMWARE_RX_SIZE %d\n\nstatic u32 firmware_tx[] = {\n", $counter, $counter);
-$counter = 0;
-while ($foo = <FW>) {
-  chomp;
-  printf(FWH "  0x%s, 0x0000%s,\n", substr($foo, 4, 8), substr($foo, 0, 4));
-  $counter++;
-}
-
-close FW;
-printf(FWH "};\t/* %d Tx instructions */\n#define FIRMWARE_TX_SIZE %d\n", $counter, $counter);
-close(FWH);
diff -urN linux-2.4.19-rc1/drivers/net/tg3.c linux-2.4.19-rc2/drivers/net/tg3.c
--- linux-2.4.19-rc1/drivers/net/tg3.c	Tue Jul 16 16:25:14 2002
+++ linux-2.4.19-rc2/drivers/net/tg3.c	Tue Jul 16 16:25:19 2002
@@ -1678,7 +1678,7 @@
  * tg3_alloc_rx_skb for full details.
  */
 static void tg3_recycle_rx(struct tg3 *tp, u32 opaque_key,
-			   int src_idx, int dest_idx_unmasked)
+			   int src_idx, u32 dest_idx_unmasked)
 {
 	struct tg3_rx_buffer_desc *src_desc, *dest_desc;
 	struct ring_info *src_map, *dest_map;
diff -urN linux-2.4.19-rc1/drivers/net/tulip/media.c linux-2.4.19-rc2/drivers/net/tulip/media.c
--- linux-2.4.19-rc1/drivers/net/tulip/media.c	Tue Jul 17 18:53:55 2001
+++ linux-2.4.19-rc2/drivers/net/tulip/media.c	Tue Jul 16 16:25:19 2002
@@ -389,9 +389,9 @@
 		if (tulip_media_cap[dev->if_port] & MediaIsMII) {
 			new_csr6 = 0x020E0000;
 		} else if (tulip_media_cap[dev->if_port] & MediaIsFx) {
-			new_csr6 = 0x028600000;
+			new_csr6 = 0x02860000;
 		} else
-			new_csr6 = 0x038600000;
+			new_csr6 = 0x03860000;
 		if (tulip_debug > 1)
 			printk(KERN_DEBUG "%s: No media description table, assuming "
 				   "%s transceiver, CSR12 %2.2x.\n",
diff -urN linux-2.4.19-rc1/drivers/net/wireless/orinoco.c linux-2.4.19-rc2/drivers/net/wireless/orinoco.c
--- linux-2.4.19-rc1/drivers/net/wireless/orinoco.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/net/wireless/orinoco.c	Tue Jul 16 16:25:19 2002
@@ -1392,6 +1392,12 @@
 		   802.11 frame which we'll need to de-encapsulate to
 		   the original EthernetII frame. */
 
+		if (length < ENCAPS_OVERHEAD) {
+			stats->rx_length_errors++;
+			stats->rx_dropped++;
+			goto drop;
+		}
+
 		/* Remove SNAP header, reconstruct EthernetII frame */
 		data_len = length - ENCAPS_OVERHEAD;
 		data_off = HERMES_802_3_OFFSET + sizeof(hdr);
diff -urN linux-2.4.19-rc1/drivers/net/wireless/orinoco_pci.c linux-2.4.19-rc2/drivers/net/wireless/orinoco_pci.c
--- linux-2.4.19-rc1/drivers/net/wireless/orinoco_pci.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/net/wireless/orinoco_pci.c	Tue Jul 16 16:25:19 2002
@@ -364,7 +364,7 @@
 	name:"orinoco_pci",
 	id_table:orinoco_pci_pci_id_table,
 	probe:orinoco_pci_init_one,
-	remove:orinoco_pci_remove_one,
+	remove:__devexit_p(orinoco_pci_remove_one),
 	suspend:0,
 	resume:0
 };
diff -urN linux-2.4.19-rc1/drivers/scsi/ips.c linux-2.4.19-rc2/drivers/scsi/ips.c
--- linux-2.4.19-rc1/drivers/scsi/ips.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/scsi/ips.c	Tue Jul 16 16:25:20 2002
@@ -284,7 +284,7 @@
        name:		ips_hot_plug_name,
        id_table:	ips_pci_table,
        probe:		ips_insert_device,
-       remove:		ips_remove_device,
+       remove:		__devexit_p(ips_remove_device),
    };
 #endif
 
diff -urN linux-2.4.19-rc1/drivers/scsi/scsi_scan.c linux-2.4.19-rc2/drivers/scsi/scsi_scan.c
--- linux-2.4.19-rc1/drivers/scsi/scsi_scan.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/scsi/scsi_scan.c	Tue Jul 16 16:25:20 2002
@@ -151,16 +151,16 @@
  	{"TOSHIBA","CDROM","*", BLIST_ISROM},
  	{"TOSHIBA","CD-ROM","*", BLIST_ISROM},
 	{"MegaRAID", "LD", "*", BLIST_FORCELUN},
-	{"DGC",  "RAID",      "*", BLIST_SPARSELUN}, // Dell PV 650F (tgt @ LUN 0)
-	{"DGC",  "DISK",      "*", BLIST_SPARSELUN}, // Dell PV 650F (no tgt @ LUN 0) 
-	{"DELL", "PV660F",   "*", BLIST_SPARSELUN},
-	{"DELL", "PV660F   PSEUDO",   "*", BLIST_SPARSELUN},
-	{"DELL", "PSEUDO DEVICE .",   "*", BLIST_SPARSELUN}, // Dell PV 530F
-	{"DELL", "PV530F",    "*", BLIST_SPARSELUN}, // Dell PV 530F
+	{"DGC",  "RAID",      "*", BLIST_SPARSELUN | BLIST_LARGELUN}, // Dell PV 650F (tgt @ LUN 0)
+	{"DGC",  "DISK",      "*", BLIST_SPARSELUN | BLIST_LARGELUN}, // Dell PV 650F (no tgt @ LUN 0) 
+	{"DELL", "PV660F",   "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+	{"DELL", "PV660F   PSEUDO",   "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+	{"DELL", "PSEUDO DEVICE .",   "*", BLIST_SPARSELUN | BLIST_LARGELUN}, // Dell PV 530F
+	{"DELL", "PV530F",    "*", BLIST_SPARSELUN | BLIST_LARGELUN}, // Dell PV 530F
 	{"EMC", "SYMMETRIX", "*", BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_FORCELUN},
 	{"HP", "A6189A", "*", BLIST_SPARSELUN |  BLIST_LARGELUN}, // HP VA7400, by Alar Aun
-	{"CMD", "CRA-7280", "*", BLIST_SPARSELUN},   // CMD RAID Controller
-	{"CNSI", "G7324", "*", BLIST_SPARSELUN},     // Chaparral G7324 RAID
+	{"CMD", "CRA-7280", "*", BLIST_SPARSELUN | BLIST_LARGELUN},   // CMD RAID Controller
+	{"CNSI", "G7324", "*", BLIST_SPARSELUN | BLIST_LARGELUN},     // Chaparral G7324 RAID
 	{"CNSi", "G8324", "*", BLIST_SPARSELUN},     // Chaparral G8324 RAID
 	{"Zzyzx", "RocketStor 500S", "*", BLIST_SPARSELUN},
 	{"Zzyzx", "RocketStor 2000", "*", BLIST_SPARSELUN},
@@ -172,6 +172,8 @@
 	{"COMPAQ", "MSA1000", "*", BLIST_FORCELUN},
 	{"HP", "C1557A", "*", BLIST_FORCELUN},
 	{"IBM", "AuSaV1S2", "*", BLIST_FORCELUN},
+	{"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+
 
 	/*
 	 * Must be at end of list...
diff -urN linux-2.4.19-rc1/drivers/scsi/sim710.c linux-2.4.19-rc2/drivers/scsi/sim710.c
--- linux-2.4.19-rc1/drivers/scsi/sim710.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/scsi/sim710.c	Tue Jul 16 16:25:20 2002
@@ -44,7 +44,7 @@
  * and insmod parameters similar to
  *	sim710="addr:0x9000 irq:15"
  *
- * Multiple controllers can also be set up by comamnd line, provided the
+ * Multiple controllers can also be set up by command line, provided the
  * addr: parameter is specified first for each controller.  e.g.
  *      sim710="addr:0x9000 irq:15 addr:0x8000 irq:14"
  *
diff -urN linux-2.4.19-rc1/drivers/sgi/char/sgiserial.c linux-2.4.19-rc2/drivers/sgi/char/sgiserial.c
--- linux-2.4.19-rc1/drivers/sgi/char/sgiserial.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/sgi/char/sgiserial.c	Tue Jul 16 16:25:20 2002
@@ -1235,7 +1235,7 @@
 	tmp.close_delay = info->close_delay;
 	tmp.closing_wait = info->closing_wait;
 	tmp.custom_divisor = info->custom_divisor;
-	return copy_to_user(retinfo,&tmp,sizeof(*retinfo)) ? -EFAULT: 0;
+	return copy_to_user(retinfo,&tmp,sizeof(*retinfo)) ? -EFAULT : 0;
 }
 
 static int set_serial_info(struct sgi_serial * info,
@@ -1871,7 +1871,11 @@
 	
 	memset(&serial_driver, 0, sizeof(struct tty_driver));
 	serial_driver.magic = TTY_DRIVER_MAGIC;
+#ifdef CONFIG_DEVFS_FS
+	serial_driver.name = "tts/%d";
+#else
 	serial_driver.name = "ttyS";
+#endif
 	serial_driver.major = TTY_MAJOR;
 	serial_driver.minor_start = 64;
 	serial_driver.num = NUM_CHANNELS;
@@ -1907,7 +1911,11 @@
 	 * major number and the subtype code.
 	 */
 	callout_driver = serial_driver;
+#ifdef CONFIG_DEVFS_FS
+	callout_driver.name = "cua/%d";
+#else
 	callout_driver.name = "cua";
+#endif
 	callout_driver.major = TTYAUX_MAJOR;
 	callout_driver.subtype = SERIAL_TYPE_CALLOUT;
 
diff -urN linux-2.4.19-rc1/drivers/sound/au1000.c linux-2.4.19-rc2/drivers/sound/au1000.c
--- linux-2.4.19-rc1/drivers/sound/au1000.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/sound/au1000.c	Tue Jul 16 16:25:20 2002
@@ -50,7 +50,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/init.h>
 #include <linux/poll.h>
@@ -218,25 +218,25 @@
 	spin_lock_irqsave(&s->lock, flags);
 
 	for (i = 0; i < POLL_COUNT; i++)
-		if (!(inl(AC97C_STATUS) & AC97C_CP))
+		if (!(au_readl(AC97C_STATUS) & AC97C_CP))
 			break;
 	if (i == POLL_COUNT)
 		err("rdcodec: codec cmd pending expired!");
 
 	cmd = (u32) addr & AC97C_INDEX_MASK;
 	cmd |= AC97C_READ;	// read command
-	outl(cmd, AC97C_CMD);
+	au_writel(cmd, AC97C_CMD);
 
 	/* now wait for the data */
 	for (i = 0; i < POLL_COUNT; i++)
-		if (!(inl(AC97C_STATUS) & AC97C_CP))
+		if (!(au_readl(AC97C_STATUS) & AC97C_CP))
 			break;
 	if (i == POLL_COUNT) {
 		err("rdcodec: read poll expired!");
 		return 0;
 	}
 
-	data = inl(AC97C_CMD) & 0xffff;
+	data = au_readl(AC97C_CMD) & 0xffff;
 
 	spin_unlock_irqrestore(&s->lock, flags);
 
@@ -254,7 +254,7 @@
 	spin_lock_irqsave(&s->lock, flags);
 
 	for (i = 0; i < POLL_COUNT; i++)
-		if (!(inl(AC97C_STATUS) & AC97C_CP))
+		if (!(au_readl(AC97C_STATUS) & AC97C_CP))
 			break;
 	if (i == POLL_COUNT)
 		err("wrcodec: codec cmd pending expired!");
@@ -262,7 +262,7 @@
 	cmd = (u32) addr & AC97C_INDEX_MASK;
 	cmd &= ~AC97C_READ;	// write command
 	cmd |= ((u32) data << AC97C_WD_BIT);	// OR in the data word
-	outl(cmd, AC97C_CMD);
+	au_writel(cmd, AC97C_CMD);
 
 	spin_unlock_irqrestore(&s->lock, flags);
 }
@@ -278,7 +278,7 @@
 
 	// first poll the CODEC_READY tag bit
 	for (i = 0; i < POLL_COUNT; i++)
-		if (inl(AC97C_STATUS) & AC97C_READY)
+		if (au_readl(AC97C_STATUS) & AC97C_READY)
 			break;
 	if (i == POLL_COUNT) {
 		err("waitcodec: CODEC_READY poll expired!");
@@ -431,7 +431,7 @@
 
 static void set_xmit_slots(int num_channels)
 {
-	u32 ac97_config = inl(AC97C_CONFIG) & ~AC97C_XMIT_SLOTS_MASK;
+	u32 ac97_config = au_readl(AC97C_CONFIG) & ~AC97C_XMIT_SLOTS_MASK;
 
 	switch (num_channels) {
 	case 1:		// mono
@@ -446,12 +446,12 @@
 		break;
 	}
 
-	outl(ac97_config, AC97C_CONFIG);
+	au_writel(ac97_config, AC97C_CONFIG);
 }
 
 static void     set_recv_slots(int num_channels)
 {
-	u32 ac97_config = inl(AC97C_CONFIG) & ~AC97C_RECV_SLOTS_MASK;
+	u32 ac97_config = au_readl(AC97C_CONFIG) & ~AC97C_RECV_SLOTS_MASK;
 
 	/*
 	 * Always enable slots 3 and 4 (stereo). Slot 6 is
@@ -459,7 +459,7 @@
 	 */
 	ac97_config |= (0x3 << AC97C_RECV_SLOTS_BIT);
 
-	outl(ac97_config, AC97C_CONFIG);
+	au_writel(ac97_config, AC97C_CONFIG);
 }
 
 static void start_dac(struct au1000_state *s)
@@ -473,7 +473,7 @@
 
 	spin_lock_irqsave(&s->lock, flags);
 
-	inl(AC97C_STATUS);	// read status to clear sticky bits
+	au_readl(AC97C_STATUS);	// read status to clear sticky bits
 
 	// reset Buffer 1 and 2 pointers to nextOut and nextOut+dma_fragsize
 	buf1 = virt_to_phys(db->nextOut);
@@ -515,7 +515,7 @@
 
 	spin_lock_irqsave(&s->lock, flags);
 
-	inl(AC97C_STATUS);	// read status to clear sticky bits
+	au_readl(AC97C_STATUS);	// read status to clear sticky bits
 
 	// reset Buffer 1 and 2 pointers to nextIn and nextIn+dma_fragsize
 	buf1 = virt_to_phys(db->nextIn);
@@ -551,7 +551,7 @@
 #define DMABUF_DEFAULTORDER (17-PAGE_SHIFT)
 #define DMABUF_MINORDER 1
 
-static inline void dealloc_dmabuf(struct au1000_state *s, struct dmabuf *db)
+extern inline void dealloc_dmabuf(struct au1000_state *s, struct dmabuf *db)
 {
 	struct page    *page, *pend;
 
@@ -653,14 +653,14 @@
 	return 0;
 }
 
-static inline int prog_dmabuf_adc(struct au1000_state *s)
+extern inline int prog_dmabuf_adc(struct au1000_state *s)
 {
 	stop_adc(s);
 	return prog_dmabuf(s, &s->dma_adc);
 
 }
 
-static inline int prog_dmabuf_dac(struct au1000_state *s)
+extern inline int prog_dmabuf_dac(struct au1000_state *s)
 {
 	stop_dac(s);
 	return prog_dmabuf(s, &s->dma_dac);
@@ -675,7 +675,7 @@
 	unsigned long   newptr;
 	u32 ac97c_stat, buff_done;
 
-	ac97c_stat = inl(AC97C_STATUS);
+	ac97c_stat = au_readl(AC97C_STATUS);
 #ifdef AU1000_VERBOSE_DEBUG
 	if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE))
 		dbg("AC97C status = 0x%08x", ac97c_stat);
@@ -741,7 +741,7 @@
 	unsigned long   newptr;
 	u32 ac97c_stat, buff_done;
 
-	ac97c_stat = inl(AC97C_STATUS);
+	ac97c_stat = au_readl(AC97C_STATUS);
 #ifdef AU1000_VERBOSE_DEBUG
 	if (ac97c_stat & (AC97C_RU | AC97C_RO))
 		dbg("AC97C status = 0x%08x", ac97c_stat);
@@ -812,6 +812,12 @@
 
 /* --------------------------------------------------------------------- */
 
+static loff_t au1000_llseek(struct file *file, loff_t offset, int origin)
+{
+	return -ESPIPE;
+}
+
+
 static int au1000_open_mixdev(struct inode *inode, struct file *file)
 {
 	file->private_data = &au1000_state;
@@ -840,7 +846,7 @@
 
 static /*const */ struct file_operations au1000_mixer_fops = {
 	owner:THIS_MODULE,
-	llseek:no_llseek,
+	llseek:au1000_llseek,
 	ioctl:au1000_ioctl_mixdev,
 	open:au1000_open_mixdev,
 	release:au1000_release_mixdev,
@@ -1659,7 +1665,7 @@
 		if (count < 0)
 			count = 0;
 		cinfo.blocks = count >> s->dma_adc.fragshift;
-		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo));
 
 	case SNDCTL_DSP_GETOPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -1682,7 +1688,7 @@
 		if (count < 0)
 			count = 0;
 		cinfo.blocks = count >> s->dma_dac.fragshift;
-		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo));
 
 	case SNDCTL_DSP_GETBLKSIZE:
 		if (file->f_mode & FMODE_WRITE)
@@ -1866,7 +1872,7 @@
 
 static /*const */ struct file_operations au1000_audio_fops = {
 	owner:		THIS_MODULE,
-	llseek:		no_llseek,
+	llseek:		au1000_llseek,
 	read:		au1000_read,
 	write:		au1000_write,
 	poll:		au1000_poll,
@@ -1900,9 +1906,9 @@
 	// print out digital controller state
 	len += sprintf(buf + len, "AU1000 Audio Controller registers\n");
 	len += sprintf(buf + len, "---------------------------------\n");
-	len += sprintf (buf + len, "AC97C_CONFIG = %08x\n", inl(AC97C_CONFIG));
-	len += sprintf (buf + len, "AC97C_STATUS = %08x\n", inl(AC97C_STATUS));
-	len += sprintf (buf + len, "AC97C_CNTRL  = %08x\n", inl(AC97C_CNTRL));
+	len += sprintf (buf + len, "AC97C_CONFIG = %08x\n", au_readl(AC97C_CONFIG));
+	len += sprintf (buf + len, "AC97C_STATUS = %08x\n", au_readl(AC97C_STATUS));
+	len += sprintf (buf + len, "AC97C_CNTRL  = %08x\n", au_readl(AC97C_CNTRL));
 
 	/* print out CODEC state */
 	len += sprintf(buf + len, "\nAC97 CODEC registers\n");
@@ -2001,26 +2007,26 @@
 #endif /* AU1000_DEBUG */
 
 	// configure pins for AC'97
-	outl(inl(SYS_PINFUNC) & ~0x02, SYS_PINFUNC);
+	au_writel(au_readl(SYS_PINFUNC) & ~0x02, SYS_PINFUNC);
 
 	// Assert reset for 10msec to the AC'97 controller, and enable clock
-	outl(AC97C_RS | AC97C_CE, AC97C_CNTRL);
+	au_writel(AC97C_RS | AC97C_CE, AC97C_CNTRL);
 	au1000_delay(10);
-	outl(AC97C_CE, AC97C_CNTRL);
+	au_writel(AC97C_CE, AC97C_CNTRL);
 	au1000_delay(10);	// wait for clock to stabilize
 
 	/* cold reset the AC'97 */
-	outl(AC97C_RESET, AC97C_CONFIG);
+	au_writel(AC97C_RESET, AC97C_CONFIG);
 	au1000_delay(10);
-	outl(0, AC97C_CONFIG);
+	au_writel(0, AC97C_CONFIG);
 	/* need to delay around 500msec(bleech) to give
 	   some CODECs enough time to wakeup */
 	au1000_delay(500);
 
 	/* warm reset the AC'97 to start the bitclk */
-	outl(AC97C_SG | AC97C_SYNC, AC97C_CONFIG);
+	au_writel(AC97C_SG | AC97C_SYNC, AC97C_CONFIG);
 	udelay(100);
-	outl(0, AC97C_CONFIG);
+	au_writel(0, AC97C_CONFIG);
 
 	/* codec init */
 	if (!ac97_probe_codec(&s->codec))
diff -urN linux-2.4.19-rc1/drivers/sound/hal2.c linux-2.4.19-rc2/drivers/sound/hal2.c
--- linux-2.4.19-rc1/drivers/sound/hal2.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/sound/hal2.c	Tue Jul 16 16:25:20 2002
@@ -21,7 +21,10 @@
  *  /dev/dsp    standard dsp device, (mostly) OSS compatible
  *  /dev/mixer	standard mixer device, (mostly) OSS compatible
  *
- *  Driver currently supports indigo mode only. Recording doesn't work. Why?
+ *  BUGS:
+ *  + Driver currently supports indigo mode only.
+ *  + Recording doesn't work. I guess that it is caused by PBUS channel
+ *    misconfiguration, but until I get relevant info I'm unable to fix it.
  */
 
 #include <linux/module.h>
@@ -691,12 +694,12 @@
 	DECLARE_WAITQUEUE(wait, current);
 	hal2_codec_t *dac = &hal2->dac;
 	int ret = 0;
-	signed long timeout = 1 + 1000 * H2_BUFFER_SIZE * 2 * dac->voices *
+	signed long timeout = 1000 * H2_BUFFER_SIZE * 2 * dac->voices *
 			      HZ / dac->sample_rate / 900;
 
 	down(&dac->sem);
 	
-	while (dac->tail->info.cnt > 0 && ret == 0) {
+	while (dac->pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_ISACT) {
 		add_wait_queue(&dac->dma_wait, &wait);
 		set_current_state(TASK_INTERRUPTIBLE);
 		if (!schedule_timeout(timeout))
@@ -708,15 +711,13 @@
 			}
 		if (signal_pending(current))
 			ret = -ERESTARTSYS;
+		if (ret) {
+			hal2_stop_dac(hal2);
+			hal2_reset_dac_pointer(hal2);
+		}
 		remove_wait_queue(&dac->dma_wait, &wait);
 	}
 
-	/* Make sure that DMA is stopped */
-	if (dac->pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_ISACT) {
-		hal2_stop_dac(hal2);
-		hal2_reset_dac_pointer(hal2);
-	}
-	
 	up(&dac->sem);
 	
 	return ret;
@@ -1108,7 +1109,7 @@
 	} else {
 		do {
 			/* ~10% longer */
-			signed long timeout = 1 + 1000 * H2_BUFFER_SIZE *
+			signed long timeout = 1000 * H2_BUFFER_SIZE *
 				2 * adc->voices * HZ / adc->sample_rate / 900;
 			DECLARE_WAITQUEUE(wait, current);
 			ssize_t cnt = 0;
@@ -1169,7 +1170,7 @@
 	} else {
 		do {
 			/* ~10% longer */
-			signed long timeout = 1 + 1000 * H2_BUFFER_SIZE *
+			signed long timeout = 1000 * H2_BUFFER_SIZE *
 				2 * dac->voices * HZ / dac->sample_rate / 900;
 			DECLARE_WAITQUEUE(wait, current);
 			ssize_t cnt = 0;
diff -urN linux-2.4.19-rc1/drivers/sound/ite8172.c linux-2.4.19-rc2/drivers/sound/ite8172.c
--- linux-2.4.19-rc1/drivers/sound/ite8172.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/sound/ite8172.c	Tue Jul 16 16:25:20 2002
@@ -59,7 +59,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <linux/init.h>
@@ -857,6 +857,12 @@
 
 /* --------------------------------------------------------------------- */
 
+static loff_t it8172_llseek(struct file *file, loff_t offset, int origin)
+{
+	return -ESPIPE;
+}
+
+
 static int it8172_open_mixdev(struct inode *inode, struct file *file)
 {
 	int minor = MINOR(inode->i_rdev);
@@ -998,7 +1004,7 @@
 
 static /*const*/ struct file_operations it8172_mixer_fops = {
 	owner:	THIS_MODULE,
-	llseek:	no_llseek,
+	llseek:	it8172_llseek,
 	ioctl:	it8172_ioctl_mixdev,
 	open:	it8172_open_mixdev,
 	release:	it8172_release_mixdev,
@@ -1647,7 +1653,7 @@
 		if (count < 0)
 			count = 0;
 		cinfo.blocks = count >> s->dma_adc.fragshift;
-		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo));
 
 	case SNDCTL_DSP_GETOPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -1670,7 +1676,7 @@
 		if (count < 0)
 			count = 0;
 		cinfo.blocks = count >> s->dma_dac.fragshift;
-		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo));
 
 	case SNDCTL_DSP_GETBLKSIZE:
 		if (file->f_mode & FMODE_WRITE)
@@ -1867,7 +1873,7 @@
 
 static /*const*/ struct file_operations it8172_audio_fops = {
 	owner:	THIS_MODULE,
-	llseek:	no_llseek,
+	llseek:	it8172_llseek,
 	read:	it8172_read,
 	write:	it8172_write,
 	poll:	it8172_poll,
diff -urN linux-2.4.19-rc1/drivers/sound/nec_vrc5477.c linux-2.4.19-rc2/drivers/sound/nec_vrc5477.c
--- linux-2.4.19-rc1/drivers/sound/nec_vrc5477.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/sound/nec_vrc5477.c	Tue Jul 16 16:25:20 2002
@@ -326,6 +326,43 @@
 	while (inl(s->io + VRC5477_CODEC_WR) & 0x80000000);
 }
 
+static int ac97_codec_not_present(struct ac97_codec *codec)
+{
+	struct vrc5477_ac97_state *s = 
+		(struct vrc5477_ac97_state *)codec->private_data;
+	unsigned long flags;
+	unsigned short count  = 0xffff; 
+
+	spin_lock_irqsave(&s->lock, flags);
+
+	/* wait until we can access codec registers */
+	do {
+	       if (!(inl(s->io + VRC5477_CODEC_WR) & 0x80000000))
+		       break;
+	} while (--count);
+
+	if (count == 0) {
+		spin_unlock_irqrestore(&s->lock, flags);
+		return -1;
+	}
+
+	/* write 0 to reset */
+	outl((AC97_RESET << 16) | 0, s->io + VRC5477_CODEC_WR);
+
+	/* test whether we get a response from ac97 chip */
+	count  = 0xffff; 
+	do { 
+	       if (!(inl(s->io + VRC5477_CODEC_WR) & 0x80000000))
+		       break;
+	} while (--count);
+
+	if (count == 0) {
+		spin_unlock_irqrestore(&s->lock, flags);
+		return -1;
+	}
+	spin_unlock_irqrestore(&s->lock, flags);
+	return 0;
+}
 
 /* --------------------------------------------------------------------- */
 
@@ -719,8 +756,8 @@
 	unsigned temp;
 
 	/* next DMA transfer should already started */
-	ASSERT(inl(s->io + VRC5477_DAC1_CTRL) & VRC5477_DMA_WIP);
-	ASSERT(inl(s->io + VRC5477_DAC2_CTRL) & VRC5477_DMA_WIP);
+	// ASSERT(inl(s->io + VRC5477_DAC1_CTRL) & VRC5477_DMA_WIP);
+	// ASSERT(inl(s->io + VRC5477_DAC2_CTRL) & VRC5477_DMA_WIP);
 
 	/* let us set for next next DMA transfer */
 	temp = dac->nextOut + dac->fragSize*2;
@@ -755,9 +792,9 @@
 	/* adjust count */
 	dac->count -= dac->fragSize;
 	if (dac->count <=0 ) {
-		ASSERT(dac->count == 0);
-		ASSERT(dac->nextIn == dac->nextOut);
 		/* buffer under run */
+		dac->count = 0;
+		dac->nextIn = dac->nextOut;
 		stop_dac(s);
 	}
 
@@ -1114,12 +1151,10 @@
 		}
                 if (copyCount + db->nextIn > db->fragTotalSize) {
                         copyCount = db->fragTotalSize - db->nextIn;
-                        ASSERT((copyCount % db->fragSize) == 0);
                         ASSERT(copyCount > 0);
                 }
 
-		copyFragCount = (copyCount-1) >> db->fragShift;
-		copyFragCount = (copyFragCount+1) << db->fragShift;
+		copyFragCount = copyCount;
 		ASSERT(copyFragCount >= copyCount);
 
 		/* we copy differently based on the number channels */
@@ -1164,7 +1199,6 @@
 			db->nextIn = 0;
 		}
 
-		ASSERT((copyFragCount % db->fragSize) == 0);
 		ASSERT( (count == 0) || (copyCount == copyFragCount));
 	}
 
@@ -1223,7 +1257,6 @@
 			}
 		} while (avail <= 0);
 	
-		ASSERT( (avail % db->fragSize) == 0);
 		copyCount = copy_dac_from_user(s, buffer, count, avail);
 		if (copyCount < 0) {
 			if (!ret) ret = -EFAULT;
@@ -1783,81 +1816,6 @@
 MODULE_DESCRIPTION("NEC Vrc5477 audio (AC97) Driver");
 MODULE_LICENSE("GPL");
 
-/* --------------------------------------------------------------------- */
-extern void jsun_scan_pci_bus(void);
-extern void vrc5477_show_pci_regs(void);
-extern void vrc5477_show_pdar_regs(void);
-
-/* -------------------------------------------------------- */
-#define         AC97_BASE               0xbb000000
-#define         myinl(x)                  *(volatile u32*)(AC97_BASE + (x))
-#define         myoutl(x,y)               *(volatile u32*)(AC97_BASE + (y)) = (x)
-
-u16 myrdcodec(u8 addr)
-{
-        u32 result;
-
-        /* wait until we can access codec registers */
-        // while (inl(VRC5477_CODEC_WR) & 0x80000000);
-
-        /* write the address and "read" command to codec */
-        addr = addr & 0x7f;
-        myoutl((addr << 16) | VRC5477_CODEC_WR_RWC, VRC5477_CODEC_WR);
-
-        /* get the return result */
-        udelay(100); /* workaround hardware bug */
-        // dump_memory(0xbb000000, 48);
-        while ( ((result=myinl(VRC5477_CODEC_RD)) & 0xc0000000) != 0xc0000000);
-        ASSERT(addr == ((result >> 16) & 0x7f) );
-        return result & 0xffff;
-}
-
-void mywrcodec(u8 addr, u16 data)
-{
-        /* wait until we can access codec registers */
-        while (myinl(VRC5477_CODEC_WR) & 0x80000000);
-
-        /* write the address and value to codec */
-        myoutl((addr << 16) | data, VRC5477_CODEC_WR);
-
-}
-
-
-void jsun_ac97_test(struct vrc5477_ac97_state *s)
-{
-        int i;
-
-        /* reset codec */
-	/*
-        wrcodec(&s->codec, 0, 0);
-        while (inl(s->io + VRC5477_CODEC_WR) & 0x80000000);
-	*/
-        mywrcodec(0, 0);
-        while (myinl(VRC5477_CODEC_WR) & 0x80000000);
-
-	for (i=0; i< 0x40; i+=4) {	
-		ASSERT(inl(s->io+i) == myinl(i));
-	}
-
-        printk("codec registers : ");
-        for (i=0; i<= 0x3a; i+=2) {
-                if ( (i%0x10) == 0) {
-                        printk("\n%02x\t", i);
-                }
-                // printk("%04x\t", rdcodec(&s->codec, i));
-                printk("%04x\t", myrdcodec(i));
-        }
-        printk("\n\n");
-        printk("codec registers : ");
-        for (i=0; i<= 0x3a; i+=2) {
-                if ( (i%0x10) == 0) {
-                        printk("\n%02x\t", i);
-                }
-                printk("%04x\t", rdcodec(&s->codec, i));
-        }
-        printk("\n\n");
-}
-
 static int __devinit vrc5477_ac97_probe(struct pci_dev *pcidev,
 					const struct pci_device_id *pciid)
 {
@@ -1896,6 +1854,13 @@
          * no persistent state across file opens.
 	 */
 
+	/* test if get response from ac97, if not return */
+        if (ac97_codec_not_present(&(s->codec))) {
+		printk(KERN_ERR PFX "no ac97 codec\n");
+		goto err_region;
+
+        }
+
 	if (!request_region(s->io, pci_resource_len(pcidev,0),
 			    VRC5477_AC97_MODULE_NAME)) {
 		printk(KERN_ERR PFX "io ports %#lx->%#lx in use\n",
@@ -1957,26 +1922,18 @@
 			s->dacRate);
 	}
 
-#if 0
-	/* What's wrong with the codec chip defaults?
-	 * If at all, shouldn't this be done through ac97_codec.c instead?
-	 * This code just ends up making my system noisey at boot.
-	 * /dev/mixer reaches these anyway.  bdl
-	 */
-
         /* let us get the default volumne louder */
-        wrcodec(&s->codec, 0x2, 0);
-        wrcodec(&s->codec, 0x18, 0x0707);
-	/* mute line in loopback to line out */
-	wrcodec(&s->codec, 0x10, 0x8000);
+        wrcodec(&s->codec, 0x2, 0x1010);	/* master volume, middle */
+        wrcodec(&s->codec, 0xc, 0x10);		/* phone volume, middle */
+        // wrcodec(&s->codec, 0xe, 0x10);		/* misc volume, middle */
+	wrcodec(&s->codec, 0x10, 0x8000);	/* line-in 2 line-out disable */
+        wrcodec(&s->codec, 0x18, 0x0707);	/* PCM out (line out) middle */
+
 
 	/* by default we select line in the input */
 	wrcodec(&s->codec, 0x1a, 0x0404);
-	/* pick middle value for record gain */
-	// wrcodec(&s->codec, 0x1c, 0x0707);
 	wrcodec(&s->codec, 0x1c, 0x0f0f);
 	wrcodec(&s->codec, 0x1e, 0x07);
-#endif
 
 	/* enable the master interrupt but disable all others */
 	outl(VRC5477_INT_MASK_NMASK, s->io + VRC5477_INT_MASK);
@@ -2047,7 +2004,7 @@
 {
 	if (!pci_present())   /* No PCI bus in this machine! */
 		return -ENODEV;
-	printk("Vrc5477 AC97 driver: version v0.1 time " __TIME__ " " __DATE__ " by Jun Sun\n");
+	printk("Vrc5477 AC97 driver: version v0.2 time " __TIME__ " " __DATE__ " by Jun Sun\n");
 	return pci_module_init(&vrc5477_ac97_driver);
 }
 
diff -urN linux-2.4.19-rc1/drivers/sound/swarm_cs4297a.c linux-2.4.19-rc2/drivers/sound/swarm_cs4297a.c
--- linux-2.4.19-rc1/drivers/sound/swarm_cs4297a.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/sound/swarm_cs4297a.c	Tue Jul 16 16:25:20 2002
@@ -66,7 +66,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/ac97_codec.h>
 #include <linux/pci.h>
@@ -1526,6 +1526,15 @@
 	}
 }
 
+
+// --------------------------------------------------------------------- 
+
+static loff_t cs4297a_llseek(struct file *file, loff_t offset, int origin)
+{
+	return -ESPIPE;
+}
+
+
 // --------------------------------------------------------------------- 
 
 static int cs4297a_open_mixdev(struct inode *inode, struct file *file)
@@ -1583,7 +1592,7 @@
 //   Mixer file operations struct.
 // ******************************************************************************************
 static /*const */ struct file_operations cs4297a_mixer_fops = {
-	llseek:no_llseek,
+	llseek:cs4297a_llseek,
 	ioctl:cs4297a_ioctl_mixdev,
 	open:cs4297a_open_mixdev,
 	release:cs4297a_release_mixdev,
@@ -2250,7 +2259,7 @@
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize - 1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo));
 
 	case SNDCTL_DSP_GETOPTR:
 		if (!(file->f_mode & FMODE_WRITE))
@@ -2274,7 +2283,7 @@
 		if (s->dma_dac.mapped)
 			s->dma_dac.count &= s->dma_dac.fragsize - 1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))?-EFAULT:0;
+		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo));
 
 	case SNDCTL_DSP_GETBLKSIZE:
 		if (file->f_mode & FMODE_WRITE) {
@@ -2501,7 +2510,7 @@
 //   Wave (audio) file operations struct.
 // ******************************************************************************************
 static /*const */ struct file_operations cs4297a_audio_fops = {
-	llseek:no_llseek,
+	llseek:cs4297a_llseek,
 	read:cs4297a_read,
 	write:cs4297a_write,
 	poll:cs4297a_poll,
diff -urN linux-2.4.19-rc1/drivers/video/neofb.c linux-2.4.19-rc2/drivers/video/neofb.c
--- linux-2.4.19-rc1/drivers/video/neofb.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/drivers/video/neofb.c	Tue Jul 16 16:25:20 2002
@@ -2330,7 +2330,7 @@
   name:      "neofb",
   id_table:  neofb_devices,
   probe:     neofb_probe,
-  remove:    neofb_remove
+  remove:    __devexit_p(neofb_remove)
 };
 
 /* **************************** init-time only **************************** */
diff -urN linux-2.4.19-rc1/fs/autofs/autofs_i.h linux-2.4.19-rc2/fs/autofs/autofs_i.h
--- linux-2.4.19-rc1/fs/autofs/autofs_i.h	Thu Jul 26 13:43:12 2001
+++ linux-2.4.19-rc2/fs/autofs/autofs_i.h	Tue Jul 16 16:25:20 2002
@@ -141,7 +141,6 @@
 extern struct inode_operations autofs_symlink_inode_operations;
 extern struct inode_operations autofs_dir_inode_operations;
 extern struct file_operations autofs_root_operations;
-extern struct file_operations autofs_dir_operations;
 
 /* Initializing function */
 
diff -urN linux-2.4.19-rc1/fs/autofs/dir.c linux-2.4.19-rc2/fs/autofs/dir.c
--- linux-2.4.19-rc1/fs/autofs/dir.c	Sat May 20 10:55:26 2000
+++ linux-2.4.19-rc2/fs/autofs/dir.c	Tue Jul 16 16:25:20 2002
@@ -23,11 +23,6 @@
 	return NULL;
 }
 
-struct file_operations autofs_dir_operations = {
-	read:		generic_read_dir,
-	readdir:	dcache_readdir,
-};
-
 struct inode_operations autofs_dir_inode_operations = {
 	lookup:		autofs_dir_lookup,
 };
diff -urN linux-2.4.19-rc1/fs/autofs/inode.c linux-2.4.19-rc2/fs/autofs/inode.c
--- linux-2.4.19-rc1/fs/autofs/inode.c	Thu Oct 25 00:02:26 2001
+++ linux-2.4.19-rc2/fs/autofs/inode.c	Tue Jul 16 16:25:20 2002
@@ -208,7 +208,7 @@
 	/* Initialize to the default case (stub directory) */
 
 	inode->i_op = &autofs_dir_inode_operations;
-	inode->i_fop = &autofs_dir_operations;
+	inode->i_fop = &dcache_dir_ops;
 	inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
 	inode->i_nlink = 2;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
diff -urN linux-2.4.19-rc1/fs/autofs4/autofs_i.h linux-2.4.19-rc2/fs/autofs4/autofs_i.h
--- linux-2.4.19-rc1/fs/autofs4/autofs_i.h	Thu Nov 22 11:46:40 2001
+++ linux-2.4.19-rc2/fs/autofs4/autofs_i.h	Tue Jul 16 16:25:20 2002
@@ -139,7 +139,6 @@
 extern struct inode_operations autofs4_symlink_inode_operations;
 extern struct inode_operations autofs4_dir_inode_operations;
 extern struct inode_operations autofs4_root_inode_operations;
-extern struct file_operations autofs4_dir_operations;
 extern struct file_operations autofs4_root_operations;
 
 /* Initializing function */
diff -urN linux-2.4.19-rc1/fs/autofs4/inode.c linux-2.4.19-rc2/fs/autofs4/inode.c
--- linux-2.4.19-rc1/fs/autofs4/inode.c	Fri Nov  9 14:11:14 2001
+++ linux-2.4.19-rc2/fs/autofs4/inode.c	Tue Jul 16 16:25:20 2002
@@ -314,7 +314,7 @@
 	if (S_ISDIR(inf->mode)) {
 		inode->i_nlink = 2;
 		inode->i_op = &autofs4_dir_inode_operations;
-		inode->i_fop = &autofs4_dir_operations;
+		inode->i_fop = &dcache_dir_ops;
 	} else if (S_ISLNK(inf->mode)) {
 		inode->i_size = inf->size;
 		inode->i_op = &autofs4_symlink_inode_operations;
diff -urN linux-2.4.19-rc1/fs/autofs4/root.c linux-2.4.19-rc2/fs/autofs4/root.c
--- linux-2.4.19-rc1/fs/autofs4/root.c	Mon Oct 23 21:57:38 2000
+++ linux-2.4.19-rc2/fs/autofs4/root.c	Tue Jul 16 16:25:20 2002
@@ -27,16 +27,15 @@
 static struct dentry *autofs4_root_lookup(struct inode *,struct dentry *);
 
 struct file_operations autofs4_root_operations = {
+	open:		dcache_dir_open,
+	release:	dcache_dir_close,
+	llseek:		dcache_dir_lseek,
 	read:		generic_read_dir,
 	readdir:	dcache_readdir,
+	fsync:		dcache_dir_fsync,
 	ioctl:		autofs4_root_ioctl,
 };
 
-struct file_operations autofs4_dir_operations = {
-	read:		generic_read_dir,
-	readdir:	dcache_readdir,
-};
-
 struct inode_operations autofs4_root_inode_operations = {
 	lookup:		autofs4_root_lookup,
 	unlink:		autofs4_dir_unlink,
diff -urN linux-2.4.19-rc1/fs/binfmt_misc.c linux-2.4.19-rc2/fs/binfmt_misc.c
--- linux-2.4.19-rc1/fs/binfmt_misc.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/binfmt_misc.c	Tue Jul 16 16:25:20 2002
@@ -600,11 +600,6 @@
 	return NULL;
 }
 
-static struct file_operations bm_dir_operations = {
-	read:		generic_read_dir,
-	readdir:	dcache_readdir,
-};
-
 static struct inode_operations bm_dir_inode_operations = {
 	lookup:		bm_lookup,
 };
@@ -646,7 +641,7 @@
 	if (!inode)
 		return NULL;
 	inode->i_op = &bm_dir_inode_operations;
-	inode->i_fop = &bm_dir_operations;
+	inode->i_fop = &dcache_dir_ops;
 	dentry[0] = d_alloc_root(inode);
 	if (!dentry[0]) {
 		iput(inode);
diff -urN linux-2.4.19-rc1/fs/buffer.c linux-2.4.19-rc2/fs/buffer.c
--- linux-2.4.19-rc1/fs/buffer.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/buffer.c	Tue Jul 16 16:25:20 2002
@@ -850,6 +850,15 @@
 			if (buffer_dirty(bh)) {
 				get_bh(bh);
 				spin_unlock(&lru_list_lock);
+			/*
+			 * Wait I/O completion before submitting
+			 * the buffer, to be sure the write will
+			 * be effective on the latest data in
+			 * the buffer. (otherwise - if there's old
+			 * I/O in flight - write_buffer would become
+			 * a noop)
+			 */
+				wait_on_buffer(bh);
 				ll_rw_block(WRITE, 1, &bh);
 				brelse(bh);
 				spin_lock(&lru_list_lock);
diff -urN linux-2.4.19-rc1/fs/hpfs/hpfs_fn.h linux-2.4.19-rc2/fs/hpfs/hpfs_fn.h
--- linux-2.4.19-rc1/fs/hpfs/hpfs_fn.h	Fri Feb  9 11:29:44 2001
+++ linux-2.4.19-rc2/fs/hpfs/hpfs_fn.h	Tue Jul 16 16:25:20 2002
@@ -156,9 +156,11 @@
 
 extern inline void copy_de(struct hpfs_dirent *dst, struct hpfs_dirent *src)
 {
-	int a = dst->down;
-	int n = dst->not_8x3;
+	int a;
+	int n;
 	if (!dst || !src) return;
+	a = dst->down;
+	n = dst->not_8x3;
 	memcpy((char *)dst + 2, (char *)src + 2, 28);
 	dst->down = a;
 	dst->not_8x3 = n;
diff -urN linux-2.4.19-rc1/fs/jffs2/dir.c linux-2.4.19-rc2/fs/jffs2/dir.c
--- linux-2.4.19-rc1/fs/jffs2/dir.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/jffs2/dir.c	Tue Jul 16 16:25:20 2002
@@ -31,7 +31,7 @@
  * provisions above, a recipient may use your version of this file
  * under either the RHEPL or the GPL.
  *
- * $Id: dir.c,v 1.45.2.5 2002/02/23 14:31:09 dwmw2 Exp $
+ * $Id: dir.c,v 1.45.2.6 2002/06/20 23:54:48 dwmw2 Exp $
  *
  */
 
@@ -939,6 +939,29 @@
                         struct inode *new_dir_i, struct dentry *new_dentry)
 {
 	int ret;
+	struct jffs2_inode_info *victim_f = NULL;
+
+	/* The VFS will check for us and prevent trying to rename a 
+	 * file over a directory and vice versa, but if it's a directory,
+	 * the VFS can't check whether the victim is empty. The filesystem
+	 * needs to do that for itself.
+	 */
+	if (new_dentry->d_inode) {
+		victim_f = JFFS2_INODE_INFO(new_dentry->d_inode);
+		if (S_ISDIR(new_dentry->d_inode->i_mode)) {
+			struct jffs2_full_dirent *fd;
+
+			down(&victim_f->sem);
+			for (fd = victim_f->dents; fd; fd = fd->next) {
+				if (fd->ino) {
+					up(&victim_f->sem);
+					return -ENOTEMPTY;
+				}
+			}
+			up(&victim_f->sem);
+		}
+	}
+
 	/* XXX: We probably ought to alloc enough space for
 	   both nodes at the same time. Writing the new link, 
 	   then getting -ENOSPC, is quite bad :)
@@ -949,6 +972,18 @@
 	if (ret)
 		return ret;
 
+	if (victim_f) {
+		/* There was a victim. Kill it off nicely */
+		new_dentry->d_inode->i_nlink--;
+		/* Don't oops if the victim was a dirent pointing to an
+		   inode which didn't exist. */
+		if (victim_f->inocache) {
+			down(&victim_f->sem);
+			victim_f->inocache->nlink--;
+			up(&victim_f->sem);
+		}
+	}
+
 	/* Unlink the original */
 	ret = jffs2_do_unlink(old_dir_i, old_dentry, 1);
 	
diff -urN linux-2.4.19-rc1/fs/lockd/svc4proc.c linux-2.4.19-rc2/fs/lockd/svc4proc.c
--- linux-2.4.19-rc1/fs/lockd/svc4proc.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/lockd/svc4proc.c	Tue Jul 16 16:25:20 2002
@@ -254,6 +254,8 @@
 
 	dprintk("lockd: TEST_MSG      called\n");
 
+	memset(&res, 0, sizeof(res));
+
 	if ((stat = nlm4svc_proc_test(rqstp, argp, &res)) == 0)
 		stat = nlm4svc_callback(rqstp, NLMPROC_TEST_RES, &res);
 	return stat;
diff -urN linux-2.4.19-rc1/fs/lockd/svcproc.c linux-2.4.19-rc2/fs/lockd/svcproc.c
--- linux-2.4.19-rc1/fs/lockd/svcproc.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/lockd/svcproc.c	Tue Jul 16 16:25:20 2002
@@ -282,6 +282,8 @@
 
 	dprintk("lockd: TEST_MSG      called\n");
 
+	memset(&res, 0, sizeof(res));
+
 	if ((stat = nlmsvc_proc_test(rqstp, argp, &res)) == 0)
 		stat = nlmsvc_callback(rqstp, NLMPROC_TEST_RES, &res);
 	return stat;
diff -urN linux-2.4.19-rc1/fs/nfs/inode.c linux-2.4.19-rc2/fs/nfs/inode.c
--- linux-2.4.19-rc1/fs/nfs/inode.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/nfs/inode.c	Tue Jul 16 16:25:20 2002
@@ -1087,14 +1087,17 @@
  		inode->i_rdev = to_kdev_t(fattr->rdev);
  
 	/* Update attrtimeo value */
-	if (!invalid && time_after(jiffies, NFS_ATTRTIMEO_UPDATE(inode)+NFS_ATTRTIMEO(inode))) {
+	if (invalid) {
+		NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode);
+		NFS_ATTRTIMEO_UPDATE(inode) = jiffies;
+		invalidate_inode_pages(inode);
+		memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode)));
+	} else if (time_after(jiffies, NFS_ATTRTIMEO_UPDATE(inode)+NFS_ATTRTIMEO(inode))) {
 		if ((NFS_ATTRTIMEO(inode) <<= 1) > NFS_MAXATTRTIMEO(inode))
 			NFS_ATTRTIMEO(inode) = NFS_MAXATTRTIMEO(inode);
 		NFS_ATTRTIMEO_UPDATE(inode) = jiffies;
 	}
 
-	if (invalid)
-		nfs_zap_caches(inode);
 	return 0;
  out_nochange:
 	if (new_atime - inode->i_atime > 0)
diff -urN linux-2.4.19-rc1/fs/open.c linux-2.4.19-rc2/fs/open.c
--- linux-2.4.19-rc1/fs/open.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/open.c	Tue Jul 16 16:25:20 2002
@@ -325,7 +325,8 @@
 		newattrs.ia_mtime = times[1].tv_sec;
 		newattrs.ia_valid |= ATTR_ATIME_SET | ATTR_MTIME_SET;
 	} else {
-		if ((error = permission(inode,MAY_WRITE)) != 0)
+		if (current->fsuid != inode->i_uid &&
+		    (error = permission(inode,MAY_WRITE)) != 0)
 			goto dput_and_out;
 	}
 	error = notify_change(nd.dentry, &newattrs);
diff -urN linux-2.4.19-rc1/fs/ramfs/inode.c linux-2.4.19-rc2/fs/ramfs/inode.c
--- linux-2.4.19-rc1/fs/ramfs/inode.c	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/fs/ramfs/inode.c	Tue Jul 16 16:25:20 2002
@@ -37,7 +37,6 @@
 
 static struct super_operations ramfs_ops;
 static struct address_space_operations ramfs_aops;
-static struct file_operations ramfs_dir_operations;
 static struct file_operations ramfs_file_operations;
 static struct inode_operations ramfs_dir_inode_operations;
 
@@ -120,7 +119,7 @@
 			break;
 		case S_IFDIR:
 			inode->i_op = &ramfs_dir_inode_operations;
-			inode->i_fop = &ramfs_dir_operations;
+			inode->i_fop = &dcache_dir_ops;
 			break;
 		case S_IFLNK:
 			inode->i_op = &page_symlink_inode_operations;
@@ -279,12 +278,6 @@
 	fsync:		ramfs_sync_file,
 };
 
-static struct file_operations ramfs_dir_operations = {
-	read:		generic_read_dir,
-	readdir:	dcache_readdir,
-	fsync:		ramfs_sync_file,
-};
-
 static struct inode_operations ramfs_dir_inode_operations = {
 	create:		ramfs_create,
 	lookup:		ramfs_lookup,
diff -urN linux-2.4.19-rc1/fs/readdir.c linux-2.4.19-rc2/fs/readdir.c
--- linux-2.4.19-rc1/fs/readdir.c	Sun Aug 12 14:59:08 2001
+++ linux-2.4.19-rc2/fs/readdir.c	Tue Jul 16 16:25:20 2002
@@ -33,6 +33,64 @@
 	return res;
 }
 
+int dcache_dir_open(struct inode *inode, struct file *file)
+{
+	static struct qstr cursor_name = {len:1, name:"."};
+
+	file->private_data = d_alloc(file->f_dentry, &cursor_name);
+
+	return file->private_data ? 0 : -ENOMEM;
+}
+
+int dcache_dir_close(struct inode *inode, struct file *file)
+{
+	dput(file->private_data);
+	return 0;
+}
+
+loff_t dcache_dir_lseek(struct file *file, loff_t offset, int origin)
+{
+	down(&file->f_dentry->d_inode->i_sem);
+	switch (origin) {
+		case 1:
+			offset += file->f_pos;
+		case 0:
+			if (offset >= 0)
+				break;
+		default:
+			up(&file->f_dentry->d_inode->i_sem);
+			return -EINVAL;
+	}
+	if (offset != file->f_pos) {
+		file->f_pos = offset;
+		if (file->f_pos >= 2) {
+			struct list_head *p;
+			struct dentry *cursor = file->private_data;
+			loff_t n = file->f_pos - 2;
+
+			spin_lock(&dcache_lock);
+			p = file->f_dentry->d_subdirs.next;
+			while (n && p != &file->f_dentry->d_subdirs) {
+				struct dentry *next;
+				next = list_entry(p, struct dentry, d_child);
+				if (!list_empty(&next->d_hash) && next->d_inode)
+					n--;
+				p = p->next;
+			}
+			list_del(&cursor->d_child);
+			list_add_tail(&cursor->d_child, p);
+			spin_unlock(&dcache_lock);
+		}
+	}
+	up(&file->f_dentry->d_inode->i_sem);
+	return offset;
+}
+
+int dcache_dir_fsync(struct file * file, struct dentry *dentry, int datasync)
+{
+	return 0;
+}
+
 /*
  * Directory is locked and all positive dentries in it are safe, since
  * for ramfs-type trees they can't go away without unlink() or rmdir(),
@@ -41,62 +99,65 @@
 
 int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
 {
-	int i;
 	struct dentry *dentry = filp->f_dentry;
+	struct dentry *cursor = filp->private_data;
+	struct list_head *p, *q = &cursor->d_child;
+	ino_t ino;
+	int i = filp->f_pos;
 
-	i = filp->f_pos;
 	switch (i) {
 		case 0:
-			if (filldir(dirent, ".", 1, i, dentry->d_inode->i_ino, DT_DIR) < 0)
+			ino = dentry->d_inode->i_ino;
+			if (filldir(dirent, ".", 1, i, ino, DT_DIR) < 0)
 				break;
-			i++;
 			filp->f_pos++;
+			i++;
 			/* fallthrough */
 		case 1:
-			if (filldir(dirent, "..", 2, i, dentry->d_parent->d_inode->i_ino, DT_DIR) < 0)
+			spin_lock(&dcache_lock);
+			ino = dentry->d_parent->d_inode->i_ino;
+			spin_unlock(&dcache_lock);
+			if (filldir(dirent, "..", 2, i, ino, DT_DIR) < 0)
 				break;
-			i++;
 			filp->f_pos++;
+			i++;
 			/* fallthrough */
-		default: {
-			struct list_head *list;
-			int j = i-2;
-
+		default:
 			spin_lock(&dcache_lock);
-			list = dentry->d_subdirs.next;
-
-			for (;;) {
-				if (list == &dentry->d_subdirs) {
-					spin_unlock(&dcache_lock);
-					return 0;
-				}
-				if (!j)
-					break;
-				j--;
-				list = list->next;
+			if (filp->f_pos == 2) {
+				list_del(q);
+				list_add(q, &dentry->d_subdirs);
 			}
-
-			while(1) {
-				struct dentry *de = list_entry(list, struct dentry, d_child);
-
-				if (!list_empty(&de->d_hash) && de->d_inode) {
-					spin_unlock(&dcache_lock);
-					if (filldir(dirent, de->d_name.name, de->d_name.len, filp->f_pos, de->d_inode->i_ino, DT_UNKNOWN) < 0)
-						break;
-					spin_lock(&dcache_lock);
-				}
-				filp->f_pos++;
-				list = list->next;
-				if (list != &dentry->d_subdirs)
+			for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
+				struct dentry *next;
+				next = list_entry(p, struct dentry, d_child);
+				if (list_empty(&next->d_hash) || !next->d_inode)
 					continue;
+
 				spin_unlock(&dcache_lock);
-				break;
+				if (filldir(dirent, next->d_name.name, next->d_name.len, filp->f_pos, next->d_inode->i_ino, DT_UNKNOWN) < 0)
+					return 0;
+				spin_lock(&dcache_lock);
+				/* next is still alive */
+				list_del(q);
+				list_add(q, p);
+				p = q;
+				filp->f_pos++;
 			}
-		}
+			spin_unlock(&dcache_lock);
 	}
 	return 0;
 }
 
+struct file_operations dcache_dir_ops = {
+	open:		dcache_dir_open,
+	release:	dcache_dir_close,
+	llseek:		dcache_dir_lseek,
+	read:		generic_read_dir,
+	readdir:	dcache_readdir,
+	fsync:		dcache_dir_fsync,
+};
+
 /*
  * Traditional linux readdir() handling..
  *
diff -urN linux-2.4.19-rc1/include/asm-alpha/a.out.h linux-2.4.19-rc2/include/asm-alpha/a.out.h
--- linux-2.4.19-rc1/include/asm-alpha/a.out.h	Fri Nov  2 17:39:20 2001
+++ linux-2.4.19-rc2/include/asm-alpha/a.out.h	Tue Jul 16 16:25:20 2002
@@ -95,8 +95,8 @@
    Worse, we have to notice the start address before swapping to use
    /sbin/loader, which of course is _not_ a TASO application.  */
 #define SET_AOUT_PERSONALITY(BFPM, EX) \
-	set_personality (BFPM->sh_bang || EX.ah.entry < 0x100000000 \
-			 ? PER_LINUX_32BIT : PER_LINUX)
+	set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000 \
+			   ? ADDR_LIMIT_32BIT : 0) | PER_OSF4))
 
 #define STACK_TOP \
   (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
diff -urN linux-2.4.19-rc1/include/asm-generic/tlb.h linux-2.4.19-rc2/include/asm-generic/tlb.h
--- linux-2.4.19-rc1/include/asm-generic/tlb.h	Fri Sep 14 08:41:04 2001
+++ linux-2.4.19-rc2/include/asm-generic/tlb.h	Tue Jul 16 16:25:20 2002
@@ -55,8 +55,9 @@
 #define tlb_remove_page(ctxp, pte, addr) do {\
 		/* Handle the common case fast, first. */\
 		if ((ctxp)->nr == ~0UL) {\
-			__free_pte(*(pte));\
-			pte_clear((pte));\
+			pte_t __pte = *(pte);\
+			pte_clear(pte);\
+			__free_pte(__pte);\
 			break;\
 		}\
 		if (!(ctxp)->nr) \
diff -urN linux-2.4.19-rc1/include/asm-i386/mmu_context.h linux-2.4.19-rc2/include/asm-i386/mmu_context.h
--- linux-2.4.19-rc1/include/asm-i386/mmu_context.h	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/include/asm-i386/mmu_context.h	Tue Jul 16 16:25:20 2002
@@ -42,7 +42,7 @@
 		set_bit(cpu, &next->cpu_vm_mask);
 		set_bit(cpu, &next->context.cpuvalid);
 		/* Re-load page tables */
-		asm volatile("movl %0,%%cr3": :"r" (__pa(next->pgd)));
+		load_cr3(next->pgd);
 	}
 #ifdef CONFIG_SMP
 	else {
@@ -51,9 +51,9 @@
 			out_of_line_bug();
 		if(!test_and_set_bit(cpu, &next->cpu_vm_mask)) {
 			/* We were in lazy tlb mode and leave_mm disabled 
-			 * tlb flush IPI delivery. We must flush our tlb.
+			 * tlb flush IPI delivery. We must reload %cr3.
 			 */
-			local_flush_tlb();
+			load_cr3(next->pgd);
 		}
 		if (!test_and_set_bit(cpu, &next->context.cpuvalid))
 			load_LDT(next);
diff -urN linux-2.4.19-rc1/include/asm-i386/pgalloc.h linux-2.4.19-rc2/include/asm-i386/pgalloc.h
--- linux-2.4.19-rc1/include/asm-i386/pgalloc.h	Fri Dec 21 09:42:03 2001
+++ linux-2.4.19-rc2/include/asm-i386/pgalloc.h	Tue Jul 16 16:25:20 2002
@@ -139,7 +139,7 @@
 	free_page((unsigned long)pte);
 }
 
-#define pte_free(pte)		pte_free_slow(pte)
+#define pte_free(pte)		pte_free_fast(pte)
 #define pgd_free(pgd)		free_pgd_slow(pgd)
 #define pgd_alloc(mm)		get_pgd_fast()
 
@@ -227,13 +227,12 @@
 };
 extern struct tlb_state cpu_tlbstate[NR_CPUS];
 
-
-#endif
+#endif /* CONFIG_SMP */
 
 static inline void flush_tlb_pgtables(struct mm_struct *mm,
 				      unsigned long start, unsigned long end)
 {
-	/* i386 does not keep any page table caches in TLB */
+	flush_tlb_mm(mm);
 }
 
 #endif /* _I386_PGALLOC_H */
diff -urN linux-2.4.19-rc1/include/asm-i386/processor.h linux-2.4.19-rc2/include/asm-i386/processor.h
--- linux-2.4.19-rc1/include/asm-i386/processor.h	Tue Jul 16 16:25:15 2002
+++ linux-2.4.19-rc2/include/asm-i386/processor.h	Tue Jul 16 16:25:20 2002
@@ -191,6 +191,9 @@
 #define X86_CR4_OSFXSR		0x0200	/* enable fast FPU save and restore */
 #define X86_CR4_OSXMMEXCPT	0x0400	/* enable unmasked SSE exceptions */
 
+#define load_cr3(pgdir) \
+	asm volatile("movl %0,%%cr3": :"r" (__pa(pgdir)));
+
 /*
  * Save the cr4 feature set we're using (ie
  * Pentium 4MB enable and PPro Global page
diff -urN linux-2.4.19-rc1/include/asm-mips/addrspace.h linux-2.4.19-rc2/include/asm-mips/addrspace.h
--- linux-2.4.19-rc1/include/asm-mips/addrspace.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/addrspace.h	Tue Jul 16 16:25:21 2002
@@ -4,71 +4,81 @@
  * for more details.
  *
  * Copyright (C) 1996 by Ralf Baechle
- * Copyright (C) 2000 by Maciej W. Rozycki
+ * Copyright (C) 2000, 2002  Maciej W. Rozycki
  *
- * Defitions for the address spaces of the MIPS CPUs.
+ * Definitions for the address spaces of the MIPS CPUs.
  */
-#ifndef __ASM_ADDRSPACE_H
-#define __ASM_ADDRSPACE_H
+#ifndef __ASM_MIPS_ADDRSPACE_H
+#define __ASM_MIPS_ADDRSPACE_H
 
 /*
  *  Configure language
  */
-
-#ifdef __ASSEMBLER__
+#ifdef __ASSEMBLY__
 #define _ATYPE_
 #define _ATYPE32_
 #define _ATYPE64_
 #else
-#define _ATYPE_		(__SIZE_TYPE__)
-#define _ATYPE32_	(int)
-#define _ATYPE64_	(long long)
+#define _ATYPE_		__PTRDIFF_TYPE__
+#define _ATYPE32_	int
+#define _ATYPE64_	long long
 #endif
 
 /*
- *  32-bit MIPS Address Spaces
+ *  32-bit MIPS address spaces
  */
-
-#ifdef __ASSEMBLER__
+#ifdef __ASSEMBLY__
 #define _ACAST32_
 #define _ACAST64_
 #else
-#define _ACAST32_		_ATYPE_ _ATYPE32_	/* widen if necessary */
-#define _ACAST64_		_ATYPE64_		/* do _not_ narrow */
+#define _ACAST32_		(_ATYPE_)(_ATYPE32_)	/* widen if necessary */
+#define _ACAST64_		(_ATYPE64_)		/* do _not_ narrow */
 #endif
 
 /*
  * Memory segments (32bit kernel mode addresses)
  */
-#define KUSEG                   0x00000000
-#define KSEG0                   0x80000000
-#define KSEG1                   0xa0000000
-#define KSEG2                   0xc0000000
-#define KSEG3                   0xe0000000
+#define KUSEG			0x00000000
+#define KSEG0			0x80000000
+#define KSEG1			0xa0000000
+#define KSEG2			0xc0000000
+#define KSEG3			0xe0000000
 
 #define K0BASE			KSEG0
 
 /*
  * Returns the kernel segment base of a given address
  */
-#define KSEGX(a)                ((_ACAST32_ (a)) & 0xe0000000)
-#define PHYSADDR(a)		((_ACAST32_ (a)) & 0x1fffffff)
-#define KSEG0ADDR(a)		(((_ACAST32_ (a)) & 0x1fffffff) | KSEG0)
-#define KSEG1ADDR(a)		(((_ACAST32_ (a)) & 0x1fffffff) | KSEG1)
-#define KSEG2ADDR(a)		(((_ACAST32_ (a)) & 0x1fffffff) | KSEG2)
-#define KSEG3ADDR(a)		(((_ACAST32_ (a)) & 0x1fffffff) | KSEG3)
+#define KSEGX(a)		((_ACAST32_ (a)) & 0xe0000000)
+
+/*
+ * Returns the physical address of a KSEG0/KSEG1 address
+ */
+#define CPHYSADDR(a)		((_ACAST32_ (a)) & 0x1fffffff)
+
+#ifndef __ASSEMBLY__
+#define PHYSADDR(a)		CPHYSADDR(a)
+#endif
+
+/*
+ * Map an address to a certain kernel segment
+ */
+#define KSEG0ADDR(a)		(CPHYSADDR(a) | KSEG0)
+#define KSEG1ADDR(a)		(CPHYSADDR(a) | KSEG1)
+#define KSEG2ADDR(a)		(CPHYSADDR(a) | KSEG2)
+#define KSEG3ADDR(a)		(CPHYSADDR(a) | KSEG3)
 
 /*
  * Memory segments (64bit kernel mode addresses)
  */
-#define XKUSEG                  0x0000000000000000
-#define XKSSEG                  0x4000000000000000
-#define XKPHYS                  0x8000000000000000
-#define XKSEG                   0xc000000000000000
-#define CKSEG0                  0xffffffff80000000
-#define CKSEG1                  0xffffffffa0000000
-#define CKSSEG                  0xffffffffc0000000
-#define CKSEG3                  0xffffffffe0000000
+#define XKUSEG			0x0000000000000000
+#define XKSSEG			0x4000000000000000
+#define XKPHYS			0x8000000000000000
+#define XKSEG			0xc000000000000000
+#define CKSEG0			0xffffffff80000000
+#define CKSEG1			0xffffffffa0000000
+#define CKSSEG			0xffffffffc0000000
+#define CKSEG3			0xffffffffe0000000
 
 /*
  * Cache modes for XKPHYS address conversion macros
@@ -92,4 +102,4 @@
 #define XKPHYS_TO_PHYS(p)		((p) & TO_PHYS_MASK)
 #define PHYS_TO_XKPHYS(cm,a)		(0x8000000000000000 | ((cm)<<59) | (a))
 
-#endif /* __ASM_ADDRSPACE_H */
+#endif /* __ASM_MIPS_ADDRSPACE_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/asm.h linux-2.4.19-rc2/include/asm-mips/asm.h
--- linux-2.4.19-rc1/include/asm-mips/asm.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/asm.h	Tue Jul 16 16:25:21 2002
@@ -4,6 +4,7 @@
  * for more details.
  *
  * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
+ * Copyright (C) 2002  Maciej W. Rozycki
  *
  * Some useful macros for MIPS assembler code
  *
@@ -14,6 +15,7 @@
 #ifndef	__ASM_ASM_H
 #define	__ASM_ASM_H
 
+#include <linux/config.h>
 #include <asm/sgidefs.h>
 
 #ifndef CAT
@@ -26,16 +28,6 @@
 #endif
 
 /*
- * Macros to handle different pointer/register sizes for 32/64-bit code
- *
- * 64 bit address space isn't used yet, so we may use the R3000 32 bit
- * defines for now.
- */
-#define PTR	.word
-#define PTRSIZE	4
-#define PTRLOG	2
-
-/*
  * PIC specific declarations
  * Not used for the kernel but here seems to be the right place.
  */
@@ -134,7 +126,7 @@
 		.word	1f;                             \
 		.popsection				\
 		.pushsection .data;			\
-1:		.asciz	string;                         \
+1:		.asciiz	string;                         \
 		.popsection
 
 /*
@@ -157,6 +149,7 @@
 		.set	mips4;				\
 		prefx	hint,addr;			\
 		.set	pop
+
 #else
 
 #define PREF(hint,addr)
@@ -170,14 +163,14 @@
 #if (_MIPS_ISA == _MIPS_ISA_MIPS1)
 #define MOVN(rd,rs,rt)                                  \
 		.set	push;				\
-		.set	noreorder;			\
+		.set	reorder;			\
 		beqz	rt,9f;                          \
 		move	rd,rs;                          \
 		.set	pop;				\
 9:
 #define MOVZ(rd,rs,rt)                                  \
 		.set	push;				\
-		.set	noreorder;			\
+		.set	reorder;			\
 		bnez	rt,9f;                          \
 		move	rd,rt;                          \
 		.set	pop;				\
@@ -188,24 +181,24 @@
 		.set	push;				\
 		.set	noreorder;			\
 		bnezl	rt,9f;                          \
-		move	rd,rs;                          \
+		 move	rd,rs;                          \
 		.set	pop;				\
 9:
 #define MOVZ(rd,rs,rt)                                  \
 		.set	push;				\
 		.set	noreorder;			\
 		beqzl	rt,9f;                          \
-		movz	rd,rs;                          \
+		 move	rd,rs;                          \
 		.set	pop;				\
 9:
 #endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */
 #if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
-    (_MIPS_ISA == _MIPS_ISA_MIPS64)
+    (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
 #define MOVN(rd,rs,rt)                                  \
 		movn	rd,rs,rt
 #define MOVZ(rd,rs,rt)                                  \
 		movz	rd,rs,rt
-#endif /* MIPS IV, MIPS V or MIPS64 */
+#endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */
 
 /*
  * Stack alignment
@@ -222,6 +215,10 @@
 #endif
 
 /*
+ * Macros to handle different pointer/register sizes for 32/64-bit code
+ */
+
+/*
  * Size of a register
  */
 #ifdef __mips64
@@ -236,59 +233,54 @@
  */
 #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS32)
-#define REG_S sw
-#define REG_L lw
-#define PTR_SUBU subu
-#define PTR_ADDU addu
+#define REG_S		sw
+#define REG_L		lw
+#define REG_SUBU	subu
+#define REG_ADDU	addu
 #endif
 #if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
-#define REG_S sd
-#define REG_L ld
-/* We still live in a 32 bit address space ...  */
-#define PTR_SUBU subu
-#define PTR_ADDU addu
+#define REG_S		sd
+#define REG_L		ld
+#define REG_SUBU	dsubu
+#define REG_ADDU	daddu
 #endif
 
 /*
  * How to add/sub/load/store/shift C int variables.
  */
 #if (_MIPS_SZINT == 32)
-#define INT_ADD	add
-#define INT_ADDI	addi
+#define INT_ADD		add
 #define INT_ADDU	addu
+#define INT_ADDI	addi
 #define INT_ADDIU	addiu
-#define INT_SUB	add
-#define INT_SUBI	subi
+#define INT_SUB		sub
 #define INT_SUBU	subu
-#define INT_SUBIU	subu
 #define INT_L		lw
 #define INT_S		sw
-#define LONG_SLL	sll
-#define LONG_SLLV	sllv
-#define LONG_SRL	srl
-#define LONG_SRLV	srlv
-#define LONG_SRA	sra
-#define LONG_SRAV	srav
+#define INT_SLL		sll
+#define INT_SLLV	sllv
+#define INT_SRL		srl
+#define INT_SRLV	srlv
+#define INT_SRA		sra
+#define INT_SRAV	srav
 #endif
 
 #if (_MIPS_SZINT == 64)
-#define INT_ADD	dadd
-#define INT_ADDI	daddi
+#define INT_ADD		dadd
 #define INT_ADDU	daddu
+#define INT_ADDI	daddi
 #define INT_ADDIU	daddiu
-#define INT_SUB	dadd
-#define INT_SUBI	dsubi
+#define INT_SUB		dsub
 #define INT_SUBU	dsubu
-#define INT_SUBIU	dsubu
 #define INT_L		ld
 #define INT_S		sd
-#define LONG_SLL	dsll
-#define LONG_SLLV	dsllv
-#define LONG_SRL	dsrl
-#define LONG_SRLV	dsrlv
-#define LONG_SRA	dsra
-#define LONG_SRAV	dsrav
+#define INT_SLL		dsll
+#define INT_SLLV	dsllv
+#define INT_SRL		dsrl
+#define INT_SRLV	dsrlv
+#define INT_SRA		dsra
+#define INT_SRAV	dsrav
 #endif
 
 /*
@@ -296,13 +288,11 @@
  */
 #if (_MIPS_SZLONG == 32)
 #define LONG_ADD	add
-#define LONG_ADDI	addi
 #define LONG_ADDU	addu
+#define LONG_ADDI	addi
 #define LONG_ADDIU	addiu
-#define LONG_SUB	add
-#define LONG_SUBI	subi
+#define LONG_SUB	sub
 #define LONG_SUBU	subu
-#define LONG_SUBIU	subu
 #define LONG_L		lw
 #define LONG_S		sw
 #define LONG_SLL	sll
@@ -315,13 +305,11 @@
 
 #if (_MIPS_SZLONG == 64)
 #define LONG_ADD	dadd
-#define LONG_ADDI	daddi
 #define LONG_ADDU	daddu
+#define LONG_ADDI	daddi
 #define LONG_ADDIU	daddiu
-#define LONG_SUB	dadd
-#define LONG_SUBI	dsubi
+#define LONG_SUB	dsub
 #define LONG_SUBU	dsubu
-#define LONG_SUBIU	dsubu
 #define LONG_L		ld
 #define LONG_S		sd
 #define LONG_SLL	dsll
@@ -335,17 +323,16 @@
 /*
  * How to add/sub/load/store/shift pointers.
  */
-#if (_MIPS_SZLONG == 32)
-#define PTR_ADD	add
-#define PTR_ADDI	addi
+#if (_MIPS_SZPTR == 32)
+#define PTR_ADD		add
 #define PTR_ADDU	addu
+#define PTR_ADDI	addi
 #define PTR_ADDIU	addiu
-#define PTR_SUB		add
-#define PTR_SUBI	subi
+#define PTR_SUB		sub
 #define PTR_SUBU	subu
-#define PTR_SUBIU	subu
 #define PTR_L		lw
 #define PTR_S		sw
+#define PTR_LA		la
 #define PTR_SLL		sll
 #define PTR_SLLV	sllv
 #define PTR_SRL		srl
@@ -354,19 +341,22 @@
 #define PTR_SRAV	srav
 
 #define PTR_SCALESHIFT	2
+
+#define PTR		.word
+#define PTRSIZE		4
+#define PTRLOG		2
 #endif
 
-#if (_MIPS_SZLONG == 64)
-#define PTR_ADD	dadd
-#define PTR_ADDI	daddi
+#if (_MIPS_SZPTR == 64)
+#define PTR_ADD		dadd
 #define PTR_ADDU	daddu
+#define PTR_ADDI	daddi
 #define PTR_ADDIU	daddiu
-#define PTR_SUB		dadd
-#define PTR_SUBI	dsubi
+#define PTR_SUB		dsub
 #define PTR_SUBU	dsubu
-#define PTR_SUBIU	dsubu
 #define PTR_L		ld
 #define PTR_S		sd
+#define PTR_LA		dla
 #define PTR_SLL		dsll
 #define PTR_SLLV	dsllv
 #define PTR_SRL		dsrl
@@ -375,6 +365,10 @@
 #define PTR_SRAV	dsrav
 
 #define PTR_SCALESHIFT	3
+
+#define PTR		.dword
+#define PTRSIZE		8
+#define PTRLOG		3
 #endif
 
 /*
@@ -382,15 +376,15 @@
  */
 #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS32)
-#define MFC0	mfc0
-#define MTC0	mtc0
+#define MFC0		mfc0
+#define MTC0		mtc0
 #endif
 #if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
-#define MFC0	dmfc0
-#define MTC0	dmtc0
+#define MFC0		dmfc0
+#define MTC0		dmtc0
 #endif
 
-#define SSNOP	sll zero, zero, 1
+#define SSNOP		sll zero,zero,1
 
 #endif /* __ASM_ASM_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/atomic.h linux-2.4.19-rc2/include/asm-mips/atomic.h
--- linux-2.4.19-rc1/include/asm-mips/atomic.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/atomic.h	Tue Jul 16 16:25:21 2002
@@ -175,6 +175,7 @@
 		"     sc      %0, %2                        \n"
 		"     beqz    %0, 1b                        \n"
 		"     addu    %0, %1, %3                    \n"
+		"     sync                                  \n"
 		".set pop                                   \n"
 		: "=&r" (result), "=&r" (temp), "=m" (v->counter)
 		: "Ir" (i), "m" (v->counter)
@@ -195,6 +196,7 @@
 		"     sc    %0, %2                           \n"
 		"     beqz  %0, 1b                           \n"
 		"     subu  %0, %1, %3                       \n"
+		"     sync                                   \n"
 		".set pop                                    \n"
 		: "=&r" (result), "=&r" (temp), "=m" (v->counter)
 		: "Ir" (i), "m" (v->counter)
@@ -273,10 +275,10 @@
  */
 
 /* Atomic operations are already serializing */
-#define smp_mb__before_atomic_dec()	barrier()
-#define smp_mb__after_atomic_dec()	barrier()
-#define smp_mb__before_atomic_inc()	barrier()
-#define smp_mb__after_atomic_inc()	barrier()
+#define smp_mb__before_atomic_dec()	smp_mb()
+#define smp_mb__after_atomic_dec()	smp_mb()
+#define smp_mb__before_atomic_inc()	smp_mb()
+#define smp_mb__after_atomic_inc()	smp_mb()
 
 #endif /* defined(__KERNEL__) */
 
diff -urN linux-2.4.19-rc1/include/asm-mips/au1000_dma.h linux-2.4.19-rc2/include/asm-mips/au1000_dma.h
--- linux-2.4.19-rc1/include/asm-mips/au1000_dma.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/au1000_dma.h	Tue Jul 16 16:25:21 2002
@@ -31,7 +31,6 @@
 #ifndef __ASM_AU1000_DMA_H
 #define __ASM_AU1000_DMA_H
 
-#include <linux/config.h>
 #include <asm/io.h>		/* need byte IO */
 #include <linux/spinlock.h>	/* And spinlocks */
 #include <linux/delay.h>
@@ -146,21 +145,21 @@
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return;
-	outl_sync(DMA_BE0, chan->io + DMA_MODE_SET);
+	au_writel(DMA_BE0, chan->io + DMA_MODE_SET);
 }
 static __inline__ void enable_dma_buffer1(unsigned int dmanr)
 {
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return;
-	outl_sync(DMA_BE1, chan->io + DMA_MODE_SET);
+	au_writel(DMA_BE1, chan->io + DMA_MODE_SET);
 }
 static __inline__ void enable_dma_buffers(unsigned int dmanr)
 {
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return;
-	outl_sync(DMA_BE0 | DMA_BE1, chan->io + DMA_MODE_SET);
+	au_writel(DMA_BE0 | DMA_BE1, chan->io + DMA_MODE_SET);
 }
 
 /* enable/disable a specific DMA channel */
@@ -171,10 +170,10 @@
 		return;
 
 	// set device FIFO address
-	outl_sync(virt_to_phys((void *) chan->fifo_addr),
+	au_writel(virt_to_phys((void *) chan->fifo_addr),
 		  chan->io + DMA_PERIPHERAL_ADDR);
 
-	outl_sync(chan->
+	au_writel(chan->
 		  mode | (chan->dev_id << DMA_DID_BIT) | DMA_IE | DMA_GO,
 		  chan->io + DMA_MODE_SET);
 }
@@ -188,17 +187,17 @@
 	if (!chan)
 		return;
 
-	outl_sync(DMA_D1 | DMA_D0 | DMA_GO, chan->io + DMA_MODE_CLEAR);
+	au_writel(DMA_D1 | DMA_D0 | DMA_GO, chan->io + DMA_MODE_CLEAR);
 
 	// poll the halt bit
 	for (i = 0; i < DMA_HALT_POLL; i++)
-		if (inl(chan->io + DMA_MODE_SET) & DMA_HALT)
+		if (au_readl(chan->io + DMA_MODE_SET) & DMA_HALT)
 			break;
 	if (i == DMA_HALT_POLL) {
 		printk(KERN_INFO "disable_dma: HALT poll expired!\n");
 	} else {
 		// now we can disable the buffers
-		outl_sync(~DMA_GO, chan->io + DMA_MODE_CLEAR);
+		au_writel(~DMA_GO, chan->io + DMA_MODE_CLEAR);
 	}
 }
 
@@ -225,7 +224,7 @@
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return -1;
-	return (inl(chan->io + DMA_MODE_SET) & DMA_AB) ? 1 : 0;
+	return (au_readl(chan->io + DMA_MODE_SET) & DMA_AB) ? 1 : 0;
 }
 
 
@@ -244,7 +243,7 @@
 	if (chan->dev_id != DMA_ID_GP04 && chan->dev_id != DMA_ID_GP05)
 		return;
 
-	outl_sync(virt_to_phys((void *) a),
+	au_writel(virt_to_phys((void *) a),
 		  chan->io + DMA_PERIPHERAL_ADDR);
 }
 
@@ -256,14 +255,14 @@
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return;
-	outl_sync(DMA_D0, chan->io + DMA_MODE_CLEAR);
+	au_writel(DMA_D0, chan->io + DMA_MODE_CLEAR);
 }
 static __inline__ void clear_dma_done1(unsigned int dmanr)
 {
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return;
-	outl_sync(DMA_D1, chan->io + DMA_MODE_CLEAR);
+	au_writel(DMA_D1, chan->io + DMA_MODE_CLEAR);
 }
 
 /*
@@ -281,7 +280,7 @@
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return;
-	outl_sync(a, chan->io + DMA_BUFFER0_START);
+	au_writel(a, chan->io + DMA_BUFFER0_START);
 }
 
 /*
@@ -292,7 +291,7 @@
 	struct dma_chan *chan = get_dma_chan(dmanr);
 	if (!chan)
 		return;
-	outl_sync(a, chan->io + DMA_BUFFER1_START);
+	au_writel(a, chan->io + DMA_BUFFER1_START);
 }
 
 
@@ -306,7 +305,7 @@
 	if (!chan)
 		return;
 	count &= DMA_COUNT_MASK;
-	outl_sync(count, chan->io + DMA_BUFFER0_COUNT);
+	au_writel(count, chan->io + DMA_BUFFER0_COUNT);
 }
 
 /*
@@ -319,7 +318,7 @@
 	if (!chan)
 		return;
 	count &= DMA_COUNT_MASK;
-	outl_sync(count, chan->io + DMA_BUFFER1_COUNT);
+	au_writel(count, chan->io + DMA_BUFFER1_COUNT);
 }
 
 /*
@@ -332,8 +331,8 @@
 	if (!chan)
 		return;
 	count &= DMA_COUNT_MASK;
-	outl_sync(count, chan->io + DMA_BUFFER0_COUNT);
-	outl_sync(count, chan->io + DMA_BUFFER1_COUNT);
+	au_writel(count, chan->io + DMA_BUFFER0_COUNT);
+	au_writel(count, chan->io + DMA_BUFFER1_COUNT);
 }
 
 /*
@@ -346,7 +345,7 @@
 	if (!chan)
 		return 0;
 
-    return inl(chan->io + DMA_MODE_SET) & (DMA_D0 | DMA_D1);
+    return au_readl(chan->io + DMA_MODE_SET) & (DMA_D0 | DMA_D1);
 }
 
 
@@ -372,10 +371,10 @@
 	if (!chan)
 		return 0;
 
-	curBufCntReg = (inl(chan->io + DMA_MODE_SET) & DMA_AB) ?
+	curBufCntReg = (au_readl(chan->io + DMA_MODE_SET) & DMA_AB) ?
 	    DMA_BUFFER1_COUNT : DMA_BUFFER0_COUNT;
 
-	count = inl(chan->io + curBufCntReg) & DMA_COUNT_MASK;
+	count = au_readl(chan->io + curBufCntReg) & DMA_COUNT_MASK;
 
 	if ((chan->mode & DMA_DW_MASK) == DMA_DW16)
 		count <<= 1;
diff -urN linux-2.4.19-rc1/include/asm-mips/au1000_pcmcia.h linux-2.4.19-rc2/include/asm-mips/au1000_pcmcia.h
--- linux-2.4.19-rc1/include/asm-mips/au1000_pcmcia.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/au1000_pcmcia.h	Tue Jul 16 16:25:21 2002
@@ -25,10 +25,10 @@
  *
  * 
  */
-
 #ifndef __ASM_AU1000_PCMCIA_H
 #define __ASM_AU1000_PCMCIA_H
 
+#include <linux/config.h>
 
 #define AU1000_PCMCIA_POLL_PERIOD    (2*HZ)
 #define AU1000_PCMCIA_IO_SPEED       (255)
diff -urN linux-2.4.19-rc1/include/asm-mips/baget/vac.h linux-2.4.19-rc2/include/asm-mips/baget/vac.h
--- linux-2.4.19-rc1/include/asm-mips/baget/vac.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/baget/vac.h	Tue Jul 16 16:25:21 2002
@@ -196,13 +196,13 @@
 #define VAC_ID               0x2900
 
 
-#ifndef __LANGUAGE_ASSEMBLY__
+#ifndef __ASSEMBLY__
 
 #define vac_inb(p)    (*(volatile unsigned char *)(VAC_BASE + (p)))
 #define vac_outb(v,p) (*((volatile unsigned char *)(VAC_BASE + (p))) = v)
 #define vac_inw(p)    (*(volatile unsigned short*)(VAC_BASE + (p)))
 #define vac_outw(v,p) (*((volatile unsigned short*)(VAC_BASE + (p))) = v)
 
-#endif /* __LANGUAGE_ASSEMBLY__ */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_VAC_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/baget/vic.h linux-2.4.19-rc2/include/asm-mips/baget/vic.h
--- linux-2.4.19-rc1/include/asm-mips/baget/vic.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/baget/vic.h	Tue Jul 16 16:25:21 2002
@@ -182,11 +182,11 @@
 #define VIC_BXFER_LEN_HI    0xDF
 #define VIC_SYS_RESET    0xE3
 
-#ifndef __LANGUAGE_ASSEMBLY__
+#ifndef __ASSEMBLY__
 
 #define vic_inb(p)    (*(volatile unsigned char *)(VIC_BASE + (p)))
 #define vic_outb(v,p) (*((volatile unsigned char *)(VIC_BASE + (p))) = v)
 
-#endif /* __LANGUAGE_ASSEMBLY__ */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_BAGET_VIC_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/bitops.h linux-2.4.19-rc2/include/asm-mips/bitops.h
--- linux-2.4.19-rc1/include/asm-mips/bitops.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/bitops.h	Tue Jul 16 16:25:21 2002
@@ -9,6 +9,7 @@
 #ifndef _ASM_BITOPS_H
 #define _ASM_BITOPS_H
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <asm/byteorder.h>		/* sigh ... */
 
@@ -16,13 +17,12 @@
 
 #include <asm/sgidefs.h>
 #include <asm/system.h>
-#include <linux/config.h>
 
 /*
  * clear_bit() doesn't provide any barrier for the compiler.
  */
-#define smp_mb__before_clear_bit()	barrier()
-#define smp_mb__after_clear_bit()	barrier()
+#define smp_mb__before_clear_bit()	smp_mb()
+#define smp_mb__after_clear_bit()	smp_mb()
 
 /*
  * Only disable interrupt for kernel mode stuff to keep usermode stuff
@@ -175,6 +175,9 @@
 		"sc\t%2, %1\n\t"
 		"beqz\t%2, 1b\n\t"
 		" and\t%2, %0, %3\n\t"
+#ifdef CONFIG_SMP
+		"sync\n\t"
+#endif
 		".set\treorder"
 		: "=&r" (temp), "=m" (*m), "=&r" (res)
 		: "r" (1UL << (nr & 0x1f)), "m" (*m)
@@ -227,6 +230,9 @@
 		"sc\t%2, %1\n\t"
 		"beqz\t%2, 1b\n\t"
 		" and\t%2, %0, %3\n\t"
+#ifdef CONFIG_SMP
+		"sync\n\t"
+#endif
 		".set\treorder"
 		: "=&r" (temp), "=m" (*m), "=&r" (res)
 		: "r" (1UL << (nr & 0x1f)), "m" (*m)
@@ -278,6 +284,9 @@
 		"sc\t%2, %1\n\t"
 		"beqz\t%2, 1b\n\t"
 		" and\t%2, %0, %3\n\t"
+#ifdef CONFIG_SMP
+		"sync\n\t"
+#endif
 		".set\treorder"
 		: "=&r" (temp), "=m" (*m), "=&r" (res)
 		: "r" (1UL << (nr & 0x1f)), "m" (*m)
diff -urN linux-2.4.19-rc1/include/asm-mips/bootinfo.h linux-2.4.19-rc2/include/asm-mips/bootinfo.h
--- linux-2.4.19-rc1/include/asm-mips/bootinfo.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/bootinfo.h	Tue Jul 16 16:25:21 2002
@@ -14,27 +14,27 @@
 /*
  * Values for machgroup
  */
-#define MACH_GROUP_UNKNOWN      0 /* whatever... */
-#define MACH_GROUP_JAZZ     	1 /* Jazz                                     */
-#define MACH_GROUP_DEC          2 /* Digital Equipment                        */
+#define MACH_GROUP_UNKNOWN      0 /* whatever...                            */
+#define MACH_GROUP_JAZZ     	1 /* Jazz                                   */
+#define MACH_GROUP_DEC          2 /* Digital Equipment                      */
 #define MACH_GROUP_ARC		3 /* Wreckstation Tyne, rPC44, possibly other */
-#define MACH_GROUP_SNI_RM	4 /* Siemens Nixdorf RM series                */
+#define MACH_GROUP_SNI_RM	4 /* Siemens Nixdorf RM series              */
 #define MACH_GROUP_ACN		5
-#define MACH_GROUP_SGI          6 /* Silicon Graphics                         */
-#define MACH_GROUP_COBALT       7 /* Cobalt servers		 	      */
-#define MACH_GROUP_NEC_DDB	8 /* NEC DDB                                  */
-#define MACH_GROUP_BAGET	9 /* Baget                                    */
-#define MACH_GROUP_COSINE      10 /* CoSine Orion                             */
-#define MACH_GROUP_GALILEO     11 /* Galileo Eval Boards                      */
-#define MACH_GROUP_MOMENCO     12 /* Momentum Boards                          */
-#define MACH_GROUP_ITE         13 /* ITE Semi Eval Boards                     */
+#define MACH_GROUP_SGI          6 /* Silicon Graphics                       */
+#define MACH_GROUP_COBALT       7 /* Cobalt servers		 	    */
+#define MACH_GROUP_NEC_DDB	8 /* NEC DDB                                */
+#define MACH_GROUP_BAGET	9 /* Baget                                  */
+#define MACH_GROUP_COSINE      10 /* CoSine Orion                           */
+#define MACH_GROUP_GALILEO     11 /* Galileo Eval Boards                    */
+#define MACH_GROUP_MOMENCO     12 /* Momentum Boards                        */
+#define MACH_GROUP_ITE         13 /* ITE Semi Eval Boards                   */
 #define MACH_GROUP_PHILIPS     14
-#define MACH_GROUP_GLOBESPAN   15 /* Globespan PVR Referrence Board           */
-#define MACH_GROUP_SIBYTE      16 /* Sibyte Eval Boards                       */
-#define MACH_GROUP_TOSHIBA     17 /* Toshiba Reference Systems TSBREF         */
-#define MACH_GROUP_ALCHEMY     18 /* Alchemy Semi Eval Boards*/
-#define MACH_GROUP_NEC_VR41XX  19 /* NEC Vr41xx based boards/gadgets          */
-#define MACH_GROUP_HP_LJ	20 /* Hewlett Packard LaserJet */
+#define MACH_GROUP_GLOBESPAN   15 /* Globespan PVR Referrence Board         */
+#define MACH_GROUP_SIBYTE      16 /* Sibyte Eval Boards                     */
+#define MACH_GROUP_TOSHIBA     17 /* Toshiba Reference Systems TSBREF       */
+#define MACH_GROUP_ALCHEMY     18 /* Alchemy Semi Eval Boards               */
+#define MACH_GROUP_NEC_VR41XX  19 /* NEC Vr41xx based boards/gadgets        */
+#define MACH_GROUP_HP_LJ       20 /* Hewlett Packard LaserJet               */
 
 /*
  * Valid machtype values for group unknown (low order halfword of mips_machtype)
@@ -85,7 +85,8 @@
 #define MACH_SGI_CHALLENGE_S	1	/* The Challenge S server */
 #define MACH_SGI_INDIGO2	2	/* The Indigo2 system */
 #define MACH_SGI_IP27		3	/* Origin 200, Origin 2000, Onyx 2 */
-#define MACH_SGI_IP32		4	/* O2 */
+#define MACH_SGI_IP28		4	/* Indigo2 Impact */
+#define MACH_SGI_IP32		5	/* O2 */
 
 /*
  * Valid machtype for group COBALT
@@ -120,8 +121,7 @@
 /*
  * Valid machtype for group MOMENCO
  */
-#define MACH_MOMENCO_OCELOT		0
-
+#define MACH_MOMENCO_OCELOT	0
  
 /*
  * Valid machtype for group ITE
diff -urN linux-2.4.19-rc1/include/asm-mips/branch.h linux-2.4.19-rc2/include/asm-mips/branch.h
--- linux-2.4.19-rc1/include/asm-mips/branch.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/branch.h	Tue Jul 16 16:25:21 2002
@@ -1,12 +1,13 @@
 /*
- * Branch and jump emulation.
- *
  * 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, 1998, 2001 by Ralf Baechle
  */
+#ifndef _ASM_BRANCH_H
+#define _ASM_BRANCH_H
+
 #include <asm/ptrace.h>
 
 static inline int delay_slot(struct pt_regs *regs)
@@ -14,6 +15,14 @@
 	return regs->cp0_cause & CAUSEF_BD;
 }
 
+static inline unsigned long exception_epc(struct pt_regs *regs)
+{
+	if (!delay_slot(regs))
+		return regs->cp0_epc;
+
+	return regs->cp0_epc + 4;
+}
+
 extern int __compute_return_epc(struct pt_regs *regs);
 
 static inline int compute_return_epc(struct pt_regs *regs)
@@ -25,3 +34,5 @@
 
 	return __compute_return_epc(regs);
 }
+
+#endif /* _ASM_BRANCH_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/cache.h linux-2.4.19-rc2/include/asm-mips/cache.h
--- linux-2.4.19-rc1/include/asm-mips/cache.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/cache.h	Tue Jul 16 16:25:21 2002
@@ -11,7 +11,7 @@
 
 #include <linux/config.h>
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 /*
  * Descriptor for a cache
  */
@@ -21,7 +21,7 @@
 	int ways;
 	int flags;	/* Details like write thru/back, coherent, etc. */
 };
-#endif
+#endif /* !__ASSEMBLY__ */
 
 /*
  * Flag definitions
diff -urN linux-2.4.19-rc1/include/asm-mips/cobalt/cobalt.h linux-2.4.19-rc2/include/asm-mips/cobalt/cobalt.h
--- linux-2.4.19-rc1/include/asm-mips/cobalt/cobalt.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/cobalt/cobalt.h	Tue Jul 16 16:25:21 2002
@@ -38,6 +38,7 @@
 #define COBALT_TIMER_IRQ       0
 #define COBALT_KEYBOARD_IRQ    1
 #define COBALT_QUBE_ETH_IRQ    13
+#define COBALT_QUBE_SLOT_IRQ   9
 #define COBALT_RAQ_ETH0_IRQ    4
 #define COBALT_RAQ_ETH1_IRQ    13
 #define COBALT_SCC_IRQ         4
diff -urN linux-2.4.19-rc1/include/asm-mips/cpu.h linux-2.4.19-rc2/include/asm-mips/cpu.h
--- linux-2.4.19-rc1/include/asm-mips/cpu.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/cpu.h	Tue Jul 16 16:25:21 2002
@@ -62,6 +62,7 @@
 #define PRID_IMP_R5500		0x5500
 #define PRID_IMP_4KC		0x8000
 #define PRID_IMP_5KC		0x8100
+#define PRID_IMP_20KC		0x8200
 #define PRID_IMP_4KEC		0x8400
 #define PRID_IMP_4KSC		0x8600
 
@@ -98,7 +99,7 @@
 
 #define FPIR_IMP_NONE		0x0000
 
-#ifndef  _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 /*
  * Capability and feature descriptor structure for MIPS CPU
  */
@@ -120,16 +121,17 @@
 enum cputype {
 	CPU_UNKNOWN,
 	CPU_R2000, CPU_R3000, CPU_R3000A, CPU_R3041, CPU_R3051, CPU_R3052,
-	CPU_R3081, CPU_R3081E, CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200,
-	CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R6000, CPU_R6000A,
-	CPU_R8000, CPU_R10000, CPU_R4300, CPU_R4650, CPU_R4700, CPU_R5000,
-	CPU_R5000A, CPU_R4640, CPU_NEVADA, CPU_RM7000, CPU_R5432, CPU_4KC,
-	CPU_5KC, CPU_R4310, CPU_SB1, CPU_TX3912, CPU_TX3922, CPU_TX3927,
-	CPU_AU1000, CPU_4KEC, CPU_4KSC, CPU_VR41XX, CPU_R5500, CPU_TX49XX,
-	CPU_TX39XX, CPU_AU1500, CPU_LAST
+	CPU_R3081, CPU_R3081E, CPU_R4000PC, CPU_R4000SC, CPU_R4000MC,
+	CPU_R4200, CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600,
+	CPU_R6000, CPU_R6000A, CPU_R8000, CPU_R10000, CPU_R12000, CPU_R4300,
+	CPU_R4650, CPU_R4700, CPU_R5000, CPU_R5000A, CPU_R4640, CPU_NEVADA,
+	CPU_RM7000, CPU_R5432, CPU_4KC, CPU_5KC, CPU_R4310, CPU_SB1,
+	CPU_TX3912, CPU_TX3922, CPU_TX3927, CPU_AU1000, CPU_4KEC, CPU_4KSC,
+	CPU_VR41XX, CPU_R5500, CPU_TX49XX, CPU_TX39XX, CPU_AU1500, CPU_20KC,
+	CPU_LAST
 };
 
-#endif
+#endif /* !__ASSEMBLY__ */
 
 /*
  * ISA Level encodings
@@ -159,5 +161,6 @@
 #define MIPS_CPU_CACHE_CDEX	0x00000800 /* Create_Dirty_Exclusive CACHE op */
 #define MIPS_CPU_MCHECK		0x00001000 /* Machine check exception */
 #define MIPS_CPU_EJTAG		0x00002000 /* EJTAG exception */
+#define MIPS_CPU_NOFPUEX	0x00004000 /* no FPU exception */
 
 #endif /* _ASM_CPU_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/current.h linux-2.4.19-rc2/include/asm-mips/current.h
--- linux-2.4.19-rc1/include/asm-mips/current.h	Mon Jul  2 13:56:40 2001
+++ linux-2.4.19-rc2/include/asm-mips/current.h	Tue Jul 16 16:25:21 2002
@@ -9,11 +9,11 @@
 #ifndef _ASM_CURRENT_H
 #define _ASM_CURRENT_H
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 /* MIPS rules... */
 register struct task_struct *current asm("$28");
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_CURRENT_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/interrupts.h linux-2.4.19-rc2/include/asm-mips/dec/interrupts.h
--- linux-2.4.19-rc1/include/asm-mips/dec/interrupts.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/dec/interrupts.h	Tue Jul 16 16:25:21 2002
@@ -8,6 +8,7 @@
  *
  * Copyright (C) 1997 by Paul M. Antoine.
  * reworked 1998 by Harald Koerfgen.
+ * Copyright (C) 2001, 2002  Maciej W. Rozycki
  */
 
 #ifndef __ASM_DEC_INTERRUPTS_H 
@@ -15,77 +16,110 @@
 
 #include <asm/mipsregs.h>
 
-/*
- * DECstation Interrupts
- */
 
 /*
- * This list reflects the priority of the Interrupts.
- * Exception: on kmins we have to handle Memory Error 
- * Interrupts before the TC Interrupts.
+ * The list of possible system devices which provide an
+ * interrupt.  Not all devices exist on a given system.
  */
-#define CLOCK	 	0
-#define SCSI_DMA_INT 	1
-#define SCSI_INT	2
-#define ETHER		3
-#define SERIAL		4
-#define TC0		5
-#define TC1		6
-#define TC2		7
-#define MEMORY		8
-#define HALT		9
+#define DEC_IRQ_CASCADE		0	/* cascade from CSR or I/O ASIC */
 
-#define NR_INTS		10
+/* Ordinary interrupts */
+#define DEC_IRQ_AB_RECV		1	/* ACCESS.bus receive */
+#define DEC_IRQ_AB_XMIT		2	/* ACCESS.bus transmit */
+#define DEC_IRQ_DZ11		3	/* DZ11 (DC7085) serial */
+#define DEC_IRQ_ASC		4	/* ASC (NCR53C94) SCSI */
+#define DEC_IRQ_FLOPPY		5	/* 82077 FDC */
+#define DEC_IRQ_FPU		6	/* R3k FPU */
+#define DEC_IRQ_HALT		7	/* HALT button or from ACCESS.Bus */
+#define DEC_IRQ_ISDN		8	/* Am79C30A ISDN */
+#define DEC_IRQ_LANCE		9	/* LANCE (Am7990) Ethernet */
+#define DEC_IRQ_MEMORY		10	/* memory, I/O bus write errors */
+#define DEC_IRQ_PSU		11	/* power supply unit warning */
+#define DEC_IRQ_RTC		12	/* DS1287 RTC */
+#define DEC_IRQ_SCC0		13	/* SCC (Z85C30) serial #0 */
+#define DEC_IRQ_SCC1		14	/* SCC (Z85C30) serial #1 */
+#define DEC_IRQ_SII		15	/* SII (DC7061) SCSI */
+#define DEC_IRQ_TC0		16	/* TURBOchannel slot #0 */
+#define DEC_IRQ_TC1		17	/* TURBOchannel slot #1 */
+#define DEC_IRQ_TC2		18	/* TURBOchannel slot #2 */
+#define DEC_IRQ_TIMER		19	/* ARC periodic timer */
+#define DEC_IRQ_VIDEO		20	/* framebuffer */
+
+/* I/O ASIC DMA interrupts */
+#define DEC_IRQ_ASC_MERR	21	/* ASC memory read error */
+#define DEC_IRQ_ASC_ERR		22	/* ASC page overrun */
+#define DEC_IRQ_ASC_DMA		23	/* ASC buffer pointer loaded */
+#define DEC_IRQ_FLOPPY_ERR	24	/* FDC error */
+#define DEC_IRQ_ISDN_ERR	25	/* ISDN memory read/overrun error */
+#define DEC_IRQ_ISDN_RXDMA	26	/* ISDN recv buffer pointer loaded */
+#define DEC_IRQ_ISDN_TXDMA	27	/* ISDN xmit buffer pointer loaded */
+#define DEC_IRQ_LANCE_MERR	28	/* LANCE memory read error */
+#define DEC_IRQ_SCC0A_RXERR	29	/* SCC0A (printer) receive overrun */
+#define DEC_IRQ_SCC0A_RXDMA	30	/* SCC0A receive half page */
+#define DEC_IRQ_SCC0A_TXERR	31	/* SCC0A xmit memory read/overrun */
+#define DEC_IRQ_SCC0A_TXDMA	32	/* SCC0A transmit page end */
+#define DEC_IRQ_SCC0B_RXERR	33	/* SCC0B (ACCESS.bus) receive overrun */
+#define DEC_IRQ_SCC0B_RXDMA	34	/* SCC0B receive half page */
+#define DEC_IRQ_SCC0B_TXERR	35	/* SCC0B xmit memory read/overrun */
+#define DEC_IRQ_SCC0B_TXDMA	36	/* SCC0B transmit page end */
+#define DEC_IRQ_SCC1A_RXERR	37	/* SCC1A (modem) receive overrun */
+#define DEC_IRQ_SCC1A_RXDMA	38	/* SCC1A receive half page */
+#define DEC_IRQ_SCC1A_TXERR	39	/* SCC1A xmit memory read/overrun */
+#define DEC_IRQ_SCC1A_TXDMA	40	/* SCC1A transmit page end */
+
+/* TC5 & TC6 are virtual slots for KN02's onboard devices */
+#define DEC_IRQ_TC5		DEC_IRQ_ASC	/* virtual PMAZ-AA */
+#define DEC_IRQ_TC6		DEC_IRQ_LANCE	/* virtual PMAD-AA */
+
+#define DEC_NR_INTS		41
+
+
+/* Largest of cpu mask_nr tables. */
+#define DEC_MAX_CPU_INTS	6
+/* Largest of asic mask_nr tables. */
+#define DEC_MAX_ASIC_INTS	9
+
+
+/*
+ * CPU interrupt bits common to all systems.
+ */
+#define DEC_CPU_INR_FPU		7	/* R3k FPU */
+#define DEC_CPU_INR_SW1		1	/* software #1 */
+#define DEC_CPU_INR_SW0		0	/* software #0 */
+
+#define DEC_CPU_IRQ_BASE	0	/* first IRQ assigned to CPU */
+
+#define DEC_CPU_IRQ_NR(n)	((n) + DEC_CPU_IRQ_BASE)
+#define DEC_CPU_IRQ_MASK(n)	(1 << ((n) + CAUSEB_IP))
+#define DEC_CPU_IRQ_ALL		(0xff << CAUSEB_IP)
 
-/*
- * The FPU is special.  It must always be handled first.
- * Since it bypasses the regular IRQ handler we define
- * the line it uses here.  All DECstations use the same
- * one.
- */
-#define DEC_IE_FPU	IE_IRQ5
 
 #ifndef __ASSEMBLY__
-/*
- * Data structure to hide the differences between the DECstation Interrupts
- *
- * If asic_mask == NULL, the interrupt is directly handled by the CPU.
- * Otherwise this Interrupt is handled the IRQ Controller.
- */
-
-typedef struct
-{
-	unsigned int	cpu_mask;	/* checking and enabling interrupts in CP0	*/
-	unsigned int	iemask;		/* enabling interrupts in IRQ Controller	*/
-} decint_t;
-
-extern volatile unsigned int *isr;
-				/* address of the interrupt status register  */
-extern volatile unsigned int *imr;
-				/* address of the interrupt mask register    */
-extern decint_t dec_interrupt[NR_INTS];
 
 /*
- * Interrupt table structure to hide differences between different
- * systems such.
+ * Interrupt table structures to hide differences between systems.
  */
-extern void *cpu_ivec_tbl[8];
-extern long cpu_mask_tbl[8];
-extern long cpu_irq_nr[8];
-extern long asic_irq_nr[32];
-extern long asic_mask_tbl[32];
+typedef union { int i; void *p; } int_ptr;
+extern int dec_interrupt[DEC_NR_INTS];
+extern int_ptr cpu_mask_nr_tbl[DEC_MAX_CPU_INTS][2];
+extern int_ptr asic_mask_nr_tbl[DEC_MAX_ASIC_INTS][2];
+extern int cpu_fpu_mask;
+
 
 /*
  * Common interrupt routine prototypes for all DECStations
  */
-extern void	dec_intr_unimplemented(void);
+extern void kn02_io_int(void);
+extern void kn02xa_io_int(void);
+extern void kn03_io_int(void);
+extern void asic_dma_int(void);
+extern void asic_all_int(void);
+extern void kn02_all_int(void);
+extern void cpu_all_int(void);
 
-extern void	kn02_io_int(void);
-extern void	kn02xa_io_int(void);
-extern void	kn03_io_int(void);
+extern void dec_intr_unimplemented(void);
+extern void asic_intr_unimplemented(void);
 
-extern void	asic_intr_unimplemented(void);
+#endif /* __ASSEMBLY__ */
 
-#endif
 #endif 
-
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/ioasic.h linux-2.4.19-rc2/include/asm-mips/dec/ioasic.h
--- linux-2.4.19-rc1/include/asm-mips/dec/ioasic.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/dec/ioasic.h	Tue Jul 16 16:25:21 2002
@@ -1,24 +1,33 @@
 /*
- *  linux/asm-mips/dec/ioasic.h
+ *	include/asm-mips/dec/ioasic.h
  *
- *  Copyright (C) 2000  Maciej W. Rozycki
+ *	DEC I/O ASIC access operations.
  *
- *  DEC I/O ASIC access operations.
+ *	Copyright (C) 2000, 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
  */
 
 #ifndef __ASM_DEC_IOASIC_H
 #define __ASM_DEC_IOASIC_H
 
-extern volatile unsigned int *ioasic_base;
+#include <linux/types.h>
+
+extern volatile u32 *ioasic_base;
 
-static inline void ioasic_write(unsigned int reg, unsigned int v)
+static inline void ioasic_write(unsigned int reg, u32 v)
 {
 	ioasic_base[reg / 4] = v;
 }
 
-static inline unsigned int ioasic_read(unsigned int reg)
+static inline u32 ioasic_read(unsigned int reg)
 {
 	return ioasic_base[reg / 4];
 }
 
+extern void init_ioasic_irqs(int base);
+
 #endif /* __ASM_DEC_IOASIC_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/ioasic_addrs.h linux-2.4.19-rc2/include/asm-mips/dec/ioasic_addrs.h
--- linux-2.4.19-rc1/include/asm-mips/dec/ioasic_addrs.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/dec/ioasic_addrs.h	Tue Jul 16 16:25:21 2002
@@ -17,25 +17,25 @@
 
 #define CHUNK_SIZE 0x00040000
 
-#define SYSTEM_ROM 	(0*CHUNK_SIZE)		/* ??? */
-#define IOCTL 		(1*CHUNK_SIZE)
-#define ESAR 		(2*CHUNK_SIZE)
-#define LANCE 		(3*CHUNK_SIZE)
-#define SCC0 		(4*CHUNK_SIZE)
-#define VDAC_HI		(5*CHUNK_SIZE)		/* maxine only */
-#define SCC1 		(6*CHUNK_SIZE)
-#define VDAC_LO		(7*CHUNK_SIZE)		/* maxine only */
-#define TOY 		(8*CHUNK_SIZE)
-#define ISDN 		(9*CHUNK_SIZE)		/* maxine only */
-#define ERRADDR		(9*CHUNK_SIZE)		/* 3maxplus only */
-#define CHKSYN 		(10*CHUNK_SIZE)		/* 3maxplus only */
-#define ACCESS_BUS	(10*CHUNK_SIZE)		/* maxine only */
-#define MCR 		(11*CHUNK_SIZE)		/* 3maxplus only */
-#define FLOPPY 		(11*CHUNK_SIZE)		/* maxine only */
-#define SCSI 		(12*CHUNK_SIZE)
-#define FLOPPY_DMA 	(13*CHUNK_SIZE)		/* maxine only */
-#define SCSI_DMA 	(14*CHUNK_SIZE)
-#define RESERVED_4 	(15*CHUNK_SIZE)
+#define SYSTEM_ROM 	(0*CHUNK_SIZE)		/* board ROM */
+#define IOCTL 		(1*CHUNK_SIZE)		/* I/O ASIC */
+#define ESAR 		(2*CHUNK_SIZE)		/* LANCE MAC address chip */
+#define LANCE 		(3*CHUNK_SIZE)		/* LANCE Ethernet */
+#define SCC0 		(4*CHUNK_SIZE)		/* SCC #0 */
+#define VDAC_HI		(5*CHUNK_SIZE)		/* VDAC (maxine) */
+#define SCC1 		(6*CHUNK_SIZE)		/* SCC #1 (3min, 3max+) */
+#define VDAC_LO		(7*CHUNK_SIZE)		/* VDAC (maxine) */
+#define TOY 		(8*CHUNK_SIZE)		/* RTC */
+#define ISDN 		(9*CHUNK_SIZE)		/* ISDN (maxine) */
+#define ERRADDR		(9*CHUNK_SIZE)		/* bus error address (3max+) */
+#define CHKSYN 		(10*CHUNK_SIZE)		/* ECC syndrome (3max+) */
+#define ACCESS_BUS	(10*CHUNK_SIZE)		/* Access.Bus (maxine) */
+#define MCR 		(11*CHUNK_SIZE)		/* memory control (3max+) */
+#define FLOPPY 		(11*CHUNK_SIZE)		/* FDC (maxine) */
+#define SCSI 		(12*CHUNK_SIZE)		/* ASC SCSI */
+#define FLOPPY_DMA 	(13*CHUNK_SIZE)		/* FDC DMA (maxine) */
+#define SCSI_DMA 	(14*CHUNK_SIZE)		/* ??? */
+#define RESERVED_4 	(15*CHUNK_SIZE)		/* unused? */
 
 /*
  * Offsets for IOCTL registers (relative to (system_base + IOCTL))
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/ioasic_ints.h linux-2.4.19-rc2/include/asm-mips/dec/ioasic_ints.h
--- linux-2.4.19-rc1/include/asm-mips/dec/ioasic_ints.h	Thu Feb 24 22:52:30 2000
+++ linux-2.4.19-rc2/include/asm-mips/dec/ioasic_ints.h	Tue Jul 16 16:25:21 2002
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Definitions for the interrupt related bits in the JUNKIO Asic
+ * Definitions for the interrupt related bits in the I/O ASIC
  * interrupt status register (and the interrupt mask register, of course)
  *
  * Created with Information from:
@@ -11,99 +11,64 @@
  * "DEC 3000 300/400/500/600/700/800/900 AXP Models System Programmer's Manual"
  *
  * and the Mach Sources
+ *
+ * Copyright (C) 199x  the Anonymous
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 
-/* 
- * the upper 16 bits are common to all JUNKIO machines
- * (except the FLOPPY and ISDN bits, which are Maxine sepcific)
- */
-#define SCC0_TRANS_PAGEEND	0x80000000	/* Serial DMA Errors	*/
-#define SCC0_TRANS_MEMRDERR	0x40000000	/* see below		*/
-#define SCC0_RECV_HALFPAGE	0x20000000
-#define	SCC0_RECV_PAGOVRRUN	0x10000000
-#define SCC1_TRANS_PAGEEND	0x08000000	/* end of page reached	*/
-#define SCC1_TRANS_MEMRDERR	0x04000000	/* SCC1 DMA memory err	*/
-#define SCC1_RECV_HALFPAGE	0x02000000	/* SCC1 half page	*/
-#define	SCC1_RECV_PAGOVRRUN	0x01000000	/* SCC1 receive overrun	*/
-#define FLOPPY_DMA_ERROR	0x00800000	/* FDI DMA error	*/
-#define	ISDN_TRANS_PTR_LOADED	0x00400000	/* xmitbuf ptr loaded	*/
-#define ISDN_RECV_PTR_LOADED	0x00200000	/* rcvbuf ptr loaded	*/
-#define ISDN_DMA_MEMRDERR	0x00100000	/* read or ovrrun error	*/
-#define SCSI_PTR_LOADED		0x00080000
-#define SCSI_PAGOVRRUN		0x00040000	/* page overrun? */
-#define SCSI_DMA_MEMRDERR	0x00020000
-#define LANCE_DMA_MEMRDERR	0x00010000
-
-/*
- * the lower 16 bits are system specific
- */
-
-/*
- * The following three seem to be in common
- */
-#define SCSI_CHIP		0x00000200
-#define LANCE_CHIP		0x00000100
-#define SCC1_CHIP		0x00000080	/* NOT on maxine	*/
-#define SCC0_CHIP		0x00000040
+#ifndef __ASM_DEC_IOASIC_INTS_H
+#define __ASM_DEC_IOASIC_INTS_H
 
-/*
- * The rest is different
- */
+/* 
+ * The upper 16 bits are a part of the I/O ASIC's internal DMA engine
+ * and thus are common to all I/O ASIC machines.  The exception is
+ * the Maxine, which makes use of the FLOPPY and ISDN bits (otherwise
+ * unused) and has a different SCC wiring.
+ */
+					/* all systems */
+#define IO_INR_SCC0A_TXDMA	31	/* SCC0A transmit page end */
+#define IO_INR_SCC0A_TXERR	30	/* SCC0A transmit memory read error */
+#define IO_INR_SCC0A_RXDMA	29	/* SCC0A receive half page */
+#define IO_INR_SCC0A_RXERR	28	/* SCC0A receive overrun */
+#define IO_INR_ASC_DMA		19	/* ASC buffer pointer loaded */
+#define IO_INR_ASC_ERR		18	/* ASC page overrun */
+#define IO_INR_ASC_MERR		17	/* ASC memory read error */
+#define IO_INR_LANCE_MERR	16	/* LANCE memory read error */
+
+					/* except Maxine */
+#define IO_INR_SCC1A_TXDMA	27	/* SCC1A transmit page end */
+#define IO_INR_SCC1A_TXERR	26	/* SCC1A transmit memory read error */
+#define IO_INR_SCC1A_RXDMA	25	/* SCC1A receive half page */
+#define IO_INR_SCC1A_RXERR	24	/* SCC1A receive overrun */
+#define IO_INR_RES_23		23	/* unused */
+#define IO_INR_RES_22		22	/* unused */
+#define IO_INR_RES_21		21	/* unused */
+#define IO_INR_RES_20		20	/* unused */
+
+					/* Maxine */
+#define IO_INR_SCC0B_TXDMA	27	/* SCC0B transmit page end */
+#define IO_INR_SCC0B_TXERR	26	/* SCC0B transmit memory read error */
+#define IO_INR_SCC0B_RXDMA	25	/* SCC0B receive half page */
+#define IO_INR_SCC0B_RXERR	24	/* SCC0B receive overrun */
+#define IO_INR_FLOPPY_ERR	23	/* FDC error */
+#define IO_INR_ISDN_TXDMA	22	/* ISDN xmit buffer pointer loaded */
+#define IO_INR_ISDN_RXDMA	21	/* ISDN recv buffer pointer loaded */
+#define IO_INR_ISDN_ERR		20	/* ISDN memory read/overrun error */
 
-/* kmin aka 3min aka kn02ba aka DS5000_1xx */
-#define KMIN_TIMEOUT		0x00001000	/* CPU IO-Write Timeout	*/
-#define KMIN_CLOCK		0x00000020
-#define KMIN_SCSI_FIFO		0x00000004	/* SCSI Data Ready	*/
-
-/* kn02ca aka maxine */
-#define MAXINE_FLOPPY		0x00008000	/* FDI Interrupt        */
-#define MAXINE_TC0		0x00001000	/* TC Option 0      	*/
-#define MAXINE_ISDN		0x00000800	/* ISDN	Chip		*/
-#define MAXINE_FLOPPY_HDS	0x00000080	/* Floppy Status      	*/
-#define MAXINE_TC1		0x00000020	/* TC Option 1		*/
-#define MAXINE_FLOPPY_XDS	0x00000010	/* Floppy Status      	*/
-#define MAXINE_VINT		0x00000008	/* Video Frame		*/
-#define MAXINE_N_VINT		0x00000004	/* Not Video frame	*/
-#define MAXINE_DTOP_TRANS	0x00000002	/* DTI Xmit-Rdy		*/
-#define MAXINE_DTOP_RECV	0x00000001	/* DTI Recv-Available	*/
-
-/* kn03 aka 3max+ aka DS5000_2x0 */
-#define KN03_TC2		0x00002000
-#define KN03_TC1		0x00001000
-#define KN03_TC0		0x00000800
-#define KN03_SCSI_FIFO		0x00000004	/* ??? Info from Mach	*/
+#define IO_INR_DMA		16	/* first DMA IRQ */
 
 /*
- * Now form groups, i.e. all serial interrupts, all SCSI interrupts and so on. 
+ * The lower 16 bits are system-specific and thus defined in
+ * system-specific headers.
  */
-#define SERIAL_INTS	(SCC0_TRANS_PAGEEND | SCC0_TRANS_MEMRDERR | \
-			SCC0_RECV_HALFPAGE | SCC0_RECV_PAGOVRRUN | \
-			SCC1_TRANS_PAGEEND | SCC1_TRANS_MEMRDERR | \
-			SCC1_RECV_HALFPAGE | SCC1_RECV_PAGOVRRUN | \
-			SCC1_CHIP | SCC0_CHIP)
-
-#define XINE_SERIAL_INTS	(SCC0_TRANS_PAGEEND | SCC0_TRANS_MEMRDERR | \
-			SCC0_RECV_HALFPAGE | SCC0_RECV_PAGOVRRUN | \
-			SCC0_CHIP)
-
-#define SCSI_DMA_INTS	(/* SCSI_PTR_LOADED | */ SCSI_PAGOVRRUN | \
-			SCSI_DMA_MEMRDERR)
 
-#define KMIN_SCSI_INTS	(SCSI_PTR_LOADED | SCSI_PAGOVRRUN | \
-			SCSI_DMA_MEMRDERR | SCSI_CHIP | KMIN_SCSI_FIFO)
-
-#define LANCE_INTS	(LANCE_DMA_MEMRDERR | LANCE_CHIP)
-
-/*
- * For future use ...
- */
-#define XINE_FLOPPY_INTS (MAXINE_FLOPPY | MAXINE_FLOPPY_HDS | \
-			FLOPPY_DMA_ERROR | MAXINE_FLOPPY_XDS)
 
-#define XINE_ISDN_INTS	(MAXINE_ISDN | ISDN_TRANS_PTR_LOADED | \
-			ISDN_RECV_PTR_LOADED | ISDN_DMA_MEMRDERR)
+#define IO_IRQ_BASE		8	/* first IRQ assigned to I/O ASIC */
+#define IO_IRQ_LINES		32	/* number of I/O ASIC interrupts */
 
-#define XINE_DTOP_INTS	(MAXINE_DTOP_TRANS | DTOP_RECV | \
-			ISDN_TRANS_PTR_LOADED | ISDN_RECV_PTR_LOADED | \
-			ISDN_DMA_MEMRDERR)
+#define IO_IRQ_NR(n)		((n) + IO_IRQ_BASE)
+#define IO_IRQ_MASK(n)		(1 << (n))
+#define IO_IRQ_ALL		0x0000ffff
+#define IO_IRQ_DMA		0xffff0000
 
+#endif /* __ASM_DEC_IOASIC_INTS_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn01.h linux-2.4.19-rc2/include/asm-mips/dec/kn01.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn01.h	Fri Jun 25 17:37:53 1999
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn01.h	Tue Jul 16 16:25:21 2002
@@ -1,15 +1,14 @@
 /*
- * Hardware info about DEC DECstation DS2100/3100 systems (otherwise known
- * as pmax or kn01.
+ * Hardware info about DECstation DS2100/3100 systems (otherwise known as
+ * pmin/pmax or KN01).
  *
  * 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,1996 by Paul M. Antoine, some code and definitions
- * are by curteousy of Chris Fraser.
- *
- * This file is under construction - you were warned!
+ * are by courtesy of Chris Fraser.
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #ifndef __ASM_MIPS_DEC_KN01_H 
 #define __ASM_MIPS_DEC_KN01_H 
@@ -18,11 +17,21 @@
 
 /*
  * Some port addresses...
- * FIXME: these addresses are incomplete and need tidying up!
  */
 
 #define KN01_LANCE_BASE (KSEG1ADDR(0x18000000)) /* 0xB8000000 */
 #define KN01_DZ11_BASE	(KSEG1ADDR(0x1c000000)) /* 0xBC000000 */
 #define KN01_RTC_BASE	(KSEG1ADDR(0x1d000000)) /* 0xBD000000 */
 
+
+/*
+ * CPU interrupt bits.
+ */
+#define KN01_CPU_INR_MEMORY	6	/* memory, I/O bus write errors */
+#define KN01_CPU_INR_VIDEO	6	/* framebuffer */
+#define KN01_CPU_INR_RTC	5	/* DS1287 RTC */
+#define KN01_CPU_INR_DZ11	4	/* DZ11 (DC7085) serial */
+#define KN01_CPU_INR_LANCE	3	/* LANCE (Am7990) Ethernet */
+#define KN01_CPU_INR_SII	2	/* SII (DC7061) SCSI */
+
 #endif /* __ASM_MIPS_DEC_KN01_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn02.h linux-2.4.19-rc2/include/asm-mips/dec/kn02.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn02.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn02.h	Tue Jul 16 16:25:21 2002
@@ -1,21 +1,26 @@
 /*
- * Hardware info about DEC DECstation 5000/2xx systems (otherwise known
- * as 3max or kn02.
+ * Hardware info about DECstation 5000/200 systems (otherwise known as
+ * 3max or KN02).
  *
  * 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,1996 by Paul M. Antoine, some code and definitions
- * are by curteousy of Chris Fraser.
- *
- * This file is under construction - you were warned!
+ * are by courtesy of Chris Fraser.
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #ifndef __ASM_MIPS_DEC_KN02_H 
 #define __ASM_MIPS_DEC_KN02_H 
 
+#ifndef __ASSEMBLY__
+#include <linux/spinlock.h>
+#include <linux/types.h>
+#endif
+
 #include <asm/addrspace.h>
 
+
 /*
  * Motherboard regs (kseg1 addresses)
  */
@@ -23,21 +28,47 @@
 
 /*
  * Some port addresses...
- * FIXME: these addresses are incomplete and need tidying up!
  */
 #define KN02_RTC_BASE	KSEG1ADDR(0x1fe80000)
 #define KN02_DZ11_BASE	KSEG1ADDR(0x1fe00000)
 
 #define KN02_CSR_BNK32M	(1<<10)			/* 32M stride */
 
+
+/*
+ * CPU interrupt bits.
+ */
+#define KN02_CPU_INR_RES_6	6	/* unused */
+#define KN02_CPU_INR_MEMORY	5	/* memory, I/O bus write errors */
+#define KN02_CPU_INR_RES_4	4	/* unused */
+#define KN02_CPU_INR_RTC	3	/* DS1287 RTC */
+#define KN02_CPU_INR_CASCADE	2	/* CSR cascade */
+
 /*
- * Interrupt enable Bits
+ * CSR interrupt bits.
  */
-#define KN02_SLOT0	(1<<16)
-#define KN02_SLOT1	(1<<17)
-#define KN02_SLOT2	(1<<18)
-#define KN02_SLOT5	(1<<21)
-#define KN02_SLOT6	(1<<22)
-#define KN02_SLOT7	(1<<23)
+#define KN02_CSR_INR_DZ11	7	/* DZ11 (DC7085) serial */
+#define KN02_CSR_INR_LANCE	6	/* LANCE (Am7990) Ethernet */
+#define KN02_CSR_INR_ASC	5	/* ASC (NCR53C94) SCSI */
+#define KN02_CSR_INR_RES_4	4	/* unused */
+#define KN02_CSR_INR_RES_3	3	/* unused */
+#define KN02_CSR_INR_TC2	2	/* TURBOchannel slot #2 */
+#define KN02_CSR_INR_TC1	1	/* TURBOchannel slot #1 */
+#define KN02_CSR_INR_TC0	0	/* TURBOchannel slot #0 */
+
+
+#define KN02_IRQ_BASE		8	/* first IRQ assigned to CSR */
+#define KN02_IRQ_LINES		8	/* number of CSR interrupts */
+
+#define KN02_IRQ_NR(n)		((n) + KN02_IRQ_BASE)
+#define KN02_IRQ_MASK(n)	(1 << (n))
+#define KN02_IRQ_ALL		0xff
+
+
+#ifndef __ASSEMBLY__
+extern u32 cached_kn02_csr;
+extern spinlock_t kn02_lock;
+extern void init_kn02_irqs(int base);
+#endif
 
 #endif /* __ASM_MIPS_DEC_KN02_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn02ba.h linux-2.4.19-rc2/include/asm-mips/dec/kn02ba.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn02ba.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn02ba.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,53 @@
+/*
+ *	include/asm-mips/dec/kn02ba.h
+ *
+ *	DECstation 5000/1xx (3min or KN02-BA) definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_MIPS_DEC_KN02BA_H 
+#define __ASM_MIPS_DEC_KN02BA_H 
+
+#include <asm/dec/kn02xa.h>		/* For common definitions. */
+
+/*
+ * Some port addresses...
+ */
+#define KN02BA_IOASIC_BASE	KN02XA_IOASIC_BASE	/* I/O ASIC */
+#define KN02BA_RTC_BASE		KN02XA_RTC_BASE		/* RTC */
+
+/*
+ * CPU interrupt bits.
+ */
+#define KN02BA_CPU_INR_HALT	6	/* HALT button */
+#define KN02BA_CPU_INR_CASCADE	5	/* I/O ASIC cascade */
+#define KN02BA_CPU_INR_TC2	4	/* TURBOchannel slot #2 */
+#define KN02BA_CPU_INR_TC1	3	/* TURBOchannel slot #1 */
+#define KN02BA_CPU_INR_TC0	2	/* TURBOchannel slot #0 */
+
+/*
+ * I/O ASIC interrupt bits.  Star marks denote non-IRQ status bits.
+ */
+#define KN02BA_IO_INR_RES_15	15	/* unused */
+#define KN02BA_IO_INR_NVRAM	14	/* (*) NVRAM clear jumper */
+#define KN02BA_IO_INR_RES_13	13	/* unused */
+#define KN02BA_IO_INR_MEMORY	12	/* memory, I/O bus write errors */
+#define KN02BA_IO_INR_RES_11	11	/* unused */
+#define KN02BA_IO_INR_NRMOD	10	/* (*) NRMOD manufacturing jumper */
+#define KN02BA_IO_INR_ASC	9	/* ASC (NCR53C94) SCSI */
+#define KN02BA_IO_INR_LANCE	8	/* LANCE (Am7990) Ethernet */
+#define KN02BA_IO_INR_SCC1	7	/* SCC (Z85C30) serial #1 */
+#define KN02BA_IO_INR_SCC0	6	/* SCC (Z85C30) serial #0 */
+#define KN02BA_IO_INR_RTC	5	/* DS1287 RTC */
+#define KN02BA_IO_INR_PSU	4	/* power supply unit warning */
+#define KN02BA_IO_INR_RES_3	3	/* unused */
+#define KN02BA_IO_INR_ASC_DATA	2	/* SCSI data ready (discouraged?) */
+#define KN02BA_IO_INR_PBNC	1	/* HALT button debouncer */
+#define KN02BA_IO_INR_PBNO	0	/* ~HALT button debouncer */
+
+#endif /* __ASM_MIPS_DEC_KN02BA_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn02ca.h linux-2.4.19-rc2/include/asm-mips/dec/kn02ca.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn02ca.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn02ca.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,53 @@
+/*
+ *	include/asm-mips/dec/kn02ca.h
+ *
+ *	Personal DECstation 5000/xx (Maxine or KN02-CA) definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_MIPS_DEC_KN02CA_H 
+#define __ASM_MIPS_DEC_KN02CA_H 
+
+#include <asm/dec/kn02xa.h>		/* For common definitions. */
+
+/*
+ * Some port addresses...
+ */
+#define KN02CA_IOASIC_BASE	KN02XA_IOASIC_BASE	/* I/O ASIC */
+#define KN02CA_RTC_BASE		KN02XA_RTC_BASE		/* RTC */
+
+/*
+ * CPU interrupt bits.
+ */
+#define KN02CA_CPU_INR_HALT	6	/* HALT from ACCESS.Bus */
+#define KN02CA_CPU_INR_CASCADE	5	/* I/O ASIC cascade */
+#define KN02CA_CPU_INR_MEMORY	4	/* memory, I/O bus write errors */
+#define KN02CA_CPU_INR_RTC	3	/* DS1287 RTC */
+#define KN02CA_CPU_INR_TIMER	2	/* ARC periodic timer */
+
+/*
+ * I/O ASIC interrupt bits.  Star marks denote non-IRQ status bits.
+ */
+#define KN02CA_IO_INR_FLOPPY	15	/* 82077 FDC */
+#define KN02CA_IO_INR_NVRAM	14	/* (*) NVRAM clear jumper */
+#define KN02CA_IO_INR_POWERON	13	/* (*) power-on reset */
+#define KN02CA_IO_INR_TC0	12	/* TURBOchannel slot #0 */
+#define KN02CA_IO_INR_ISDN	11	/* Am79C30A ISDN */
+#define KN02CA_IO_INR_NRMOD	10	/* (*) NRMOD manufacturing jumper */
+#define KN02CA_IO_INR_ASC	9	/* ASC (NCR53C94) SCSI */
+#define KN02CA_IO_INR_LANCE	8	/* LANCE (Am7990) Ethernet */
+#define KN02CA_IO_INR_HDFLOPPY	7	/* (*) HD (1.44MB) floppy status */
+#define KN02CA_IO_INR_SCC0	6	/* SCC (Z85C30) serial #0 */
+#define KN02CA_IO_INR_TC1	5	/* TURBOchannel slot #1 */
+#define KN02CA_IO_INR_XDFLOPPY	4	/* (*) XD (2.88MB) floppy status */
+#define KN02CA_IO_INR_VIDEO	3	/* framebuffer */
+#define KN02CA_IO_INR_XVIDEO	2	/* ~framebuffer */
+#define KN02CA_IO_INR_AB_XMIT	1	/* ACCESS.bus transmit */
+#define KN02CA_IO_INR_AB_RECV	0	/* ACCESS.bus receive */
+
+#endif /* __ASM_MIPS_DEC_KN02CA_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn02xa.h linux-2.4.19-rc2/include/asm-mips/dec/kn02xa.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn02xa.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn02xa.h	Tue Jul 16 16:25:21 2002
@@ -1,18 +1,18 @@
 /*
- * Hardware info about DEC DECstation 5000/1xx systems (otherwise known
- * as 3min or kn02ba. Apllies to the Personal DECstations 5000/xx (otherwise known
- * as maxine or kn02ca) as well.
+ * Hardware info common to DECstation 5000/1xx systems (otherwise
+ * known as 3min or kn02ba) and Personal DECstations 5000/xx ones
+ * (otherwise known as maxine or kn02ca).
  *
  * 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,1996 by Paul M. Antoine, some code and definitions
- * are by curteousy of Chris Fraser.
- * Copyright (C) 2000  Maciej W. Rozycki
+ * are by courtesy of Chris Fraser.
+ * Copyright (C) 2000, 2002  Maciej W. Rozycki
  *
  * These are addresses which have to be known early in the boot process.
- * For other addresses refer to tc.h ioasic_addrs.h and friends.
+ * For other addresses refer to tc.h, ioasic_addrs.h and friends.
  */
 #ifndef __ASM_MIPS_DEC_KN02XA_H 
 #define __ASM_MIPS_DEC_KN02XA_H 
@@ -21,7 +21,6 @@
 
 /*
  * Some port addresses...
- * FIXME: these addresses are incomplete and need tidying up!
  */
 #define KN02XA_IOASIC_BASE	KSEG1ADDR(0x1c040000)	/* I/O ASIC */
 #define KN02XA_RTC_BASE		KSEG1ADDR(0x1c200000)	/* RTC */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn03.h linux-2.4.19-rc2/include/asm-mips/dec/kn03.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn03.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn03.h	Tue Jul 16 16:25:21 2002
@@ -1,14 +1,16 @@
 /*
- * Hardware info about DEC DECstation 5000/2x0 systems (otherwise known
- * as 3max+ or kn03.
+ * Hardware info about DECstation 5000/2x0 systems (otherwise known as
+ * 3max+) and DECsystem 5900 systems (otherwise known as bigmax) which
+ * differ mechanically but are otherwise identical (both are known as
+ * KN03).
  *
  * 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,1996 by Paul M. Antoine, some code and definitions
- * are by curteousy of Chris Fraser.
- * Copyright (C) 2000  Maciej W. Rozycki
+ * are by courtesy of Chris Fraser.
+ * Copyright (C) 2000, 2002  Maciej W. Rozycki
  *
  * These are addresses which have to be known early in the boot process.
  * For other addresses refer to tc.h ioasic_addrs.h and friends.
@@ -20,7 +22,6 @@
 
 /*
  * Some port addresses...
- * FIXME: these addresses are incomplete and need tidying up!
  */
 #define KN03_IOASIC_BASE	KSEG1ADDR(0x1f840000)	/* I/O ASIC */
 #define KN03_RTC_BASE		KSEG1ADDR(0x1fa00000)	/* RTC */
@@ -31,4 +32,34 @@
 
 #define KN03_IOASIC_REG(r)	(KN03_IOASIC_BASE+(r))
 
+
+/*
+ * CPU interrupt bits.
+ */
+#define KN03_CPU_INR_HALT	6	/* HALT button */
+#define KN03_CPU_INR_MEMORY	5	/* memory, I/O bus write errors */
+#define KN03_CPU_INR_RES_4	4	/* unused */
+#define KN03_CPU_INR_RTC	3	/* DS1287 RTC */
+#define KN03_CPU_INR_CASCADE	2	/* I/O ASIC cascade */
+
+/*
+ * I/O ASIC interrupt bits.  Star marks denote non-IRQ status bits.
+ */
+#define KN03_IO_INR_3MAXP	15	/* (*) 3max+/bigmax ID */
+#define KN03_IO_INR_NVRAM	14	/* (*) NVRAM clear jumper */
+#define KN03_IO_INR_TC2		13	/* TURBOchannel slot #2 */
+#define KN03_IO_INR_TC1		12	/* TURBOchannel slot #1 */
+#define KN03_IO_INR_TC0		11	/* TURBOchannel slot #0 */
+#define KN03_IO_INR_NRMOD	10	/* (*) NRMOD manufacturing jumper */
+#define KN03_IO_INR_ASC		9	/* ASC (NCR53C94) SCSI */
+#define KN03_IO_INR_LANCE	8	/* LANCE (Am7990) Ethernet */
+#define KN03_IO_INR_SCC1	7	/* SCC (Z85C30) serial #1 */
+#define KN03_IO_INR_SCC0	6	/* SCC (Z85C30) serial #0 */
+#define KN03_IO_INR_RTC		5	/* DS1287 RTC (?) */
+#define KN03_IO_INR_PSU		4	/* power supply unit warning */
+#define KN03_IO_INR_RES_3	3	/* unused */
+#define KN03_IO_INR_ASC_DATA	2	/* SCSI data ready (discouraged?) (?) */
+#define KN03_IO_INR_PBNC	1	/* HALT button debouncer */
+#define KN03_IO_INR_PBNO	0	/* ~HALT button debouncer */
+
 #endif /* __ASM_MIPS_DEC_KN03_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn05.h linux-2.4.19-rc2/include/asm-mips/dec/kn05.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn05.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn05.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,70 @@
+/*
+ *	include/asm-mips/dec/kn05.h
+ *
+ *	DECstation 5000/260 (4max+ or KN05) and DECsystem 5900-260
+ *	definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ *
+ *	WARNING!  All this information is pure guesswork based on the
+ *	ROM.  It is provided here in hope it will give someone some
+ *	food for thought.  No documentation for the KN05 module has
+ *	been located so far.
+ */
+#ifndef __ASM_MIPS_DEC_KN05_H
+#define __ASM_MIPS_DEC_KN05_H
+
+#include <asm/dec/ioasic_addrs.h>
+
+/*
+ * The oncard MB (Memory Buffer) ASIC provides an additional address
+ * decoder.  Certain address ranges within the "high" 16 slots are
+ * passed to the I/O ASIC's decoder like with the KN03.  Others are
+ * handled locally.  "Low" slots are always passed.
+ */
+#define KN05_MB_ROM	(16*CHUNK_SIZE)		/* KN05 card ROM */
+#define KN05_IOCTL	(17*CHUNK_SIZE)		/* I/O ASIC */
+#define KN05_ESAR	(18*CHUNK_SIZE)		/* LANCE MAC address chip */
+#define KN05_LANCE	(19*CHUNK_SIZE)		/* LANCE Ethernet */
+#define KN05_MB_INT	(20*CHUNK_SIZE)		/* MB interrupt register? */
+#define KN05_MB_UNKN_0	(21*CHUNK_SIZE)		/* MB unknown register */
+#define KN05_MB_UNKN_1	(22*CHUNK_SIZE)		/* MB unknown register */
+#define KN05_MB_CSR	(23*CHUNK_SIZE)		/* MB control & status */
+#define KN05_RESERVED_0	(24*CHUNK_SIZE)		/* unused? */
+#define KN05_RESERVED_1	(25*CHUNK_SIZE)		/* unused? */
+#define KN05_RESERVED_2	(26*CHUNK_SIZE)		/* unused? */
+#define KN05_RESERVED_3	(27*CHUNK_SIZE)		/* unused? */
+#define KN05_SCSI	(28*CHUNK_SIZE)		/* ASC SCSI */
+#define KN05_RESERVED_4	(29*CHUNK_SIZE)		/* unused? */
+#define KN05_RESERVED_5	(30*CHUNK_SIZE)		/* unused? */
+#define KN05_RESERVED_6	(31*CHUNK_SIZE)		/* unused? */
+
+/*
+ * Bits for the MB interrupt (?) register.
+ * The register appears read-only.
+ */
+#define KN05_MB_INT_TC		(1<<0)		/* TURBOchannel? */
+#define KN05_MB_INT_RTC		(1<<1)		/* RTC? */
+
+/*
+ * Bits for the MB control & status register.
+ * Set to 0x00bf8001 on my system by the ROM.
+ */
+#define KN05_MB_CSR_PF		(1<<0)		/* ??? */
+#define KN05_MB_CSR_F		(1<<1)		/* ??? */
+#define KN05_MB_CSR_ECC		(0xff<<2)	/* ??? */
+#define KN05_MB_CSR_OD		(1<<10)		/* ??? */
+#define KN05_MB_CSR_CP		(1<<11)		/* ??? */
+#define KN05_MB_CSR_UNC		(1<<12)		/* ??? */
+#define KN05_MB_CSR_IM		(1<<13)		/* ??? */
+#define KN05_MB_CSR_NC		(1<<14)		/* ??? */
+#define KN05_MB_CSR_EE		(1<<15)		/* (bus) Exception Enable? */
+#define KN05_MB_CSR_MSK		(0x1f<<16)	/* ??? */
+#define KN05_MB_CSR_FW		(1<<21)		/* ??? */
+
+#endif /* __ASM_MIPS_DEC_KN05_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/kn230.h linux-2.4.19-rc2/include/asm-mips/dec/kn230.h
--- linux-2.4.19-rc1/include/asm-mips/dec/kn230.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/dec/kn230.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,26 @@
+/*
+ *	include/asm-mips/dec/kn230.h
+ *
+ *	DECstation 5100 (MIPSmate or KN230) definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_MIPS_DEC_KN230_H 
+#define __ASM_MIPS_DEC_KN230_H 
+
+/*
+ * CPU interrupt bits.
+ */
+#define KN230_CPU_INR_HALT	6	/* HALT button */
+#define KN230_CPU_INR_MEMORY	5	/* memory, I/O bus write errors */
+#define KN230_CPU_INR_RTC	4	/* DS1287 RTC */
+#define KN230_CPU_INR_SII	3	/* SII (DC7061) SCSI */
+#define KN230_CPU_INR_LANCE	3	/* LANCE (Am7990) Ethernet */
+#define KN230_CPU_INR_DZ11	2	/* DZ11 (DC7085) serial */
+
+#endif /* __ASM_MIPS_DEC_KN230_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/dec/tcmodule.h linux-2.4.19-rc2/include/asm-mips/dec/tcmodule.h
--- linux-2.4.19-rc1/include/asm-mips/dec/tcmodule.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/dec/tcmodule.h	Tue Jul 16 16:25:21 2002
@@ -15,10 +15,11 @@
  *
  * Jan.1998 Harald Koerfgen
  */
-#ifndef __ASM_DEC_TCMOULE_H
-#define __ASM_DEC_TCMOULE_H
+#ifndef __ASM_DEC_TCMODULE_H
+#define __ASM_DEC_TCMODULE_H
  
 #define OLDCARD 0x3c0000
+#define NEWCARD 0x000000
 
 #define TC_ROM_WIDTH	0x3e0
 #define TC_ROM_STRIDE	0x3e4
@@ -35,4 +36,4 @@
 #define TC_FLAGS	0x470
 #define TC_ROM_OBJECTS	0x480
 
-#endif /* __ASM_DEC_TCMOULE_H */
+#endif /* __ASM_DEC_TCMODULE_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/elf.h linux-2.4.19-rc2/include/asm-mips/elf.h
--- linux-2.4.19-rc1/include/asm-mips/elf.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/elf.h	Tue Jul 16 16:25:21 2002
@@ -10,6 +10,17 @@
 #define ELF_NGREG	45
 #define ELF_NFPREG	33
 
+/* ELF header e_flags defines. MIPS architecture level. */
+#define EF_MIPS_ARCH_1      0x00000000  /* -mips1 code.  */
+#define EF_MIPS_ARCH_2      0x10000000  /* -mips2 code.  */
+#define EF_MIPS_ARCH_3      0x20000000  /* -mips3 code.  */
+#define EF_MIPS_ARCH_4      0x30000000  /* -mips4 code.  */
+#define EF_MIPS_ARCH_5      0x40000000  /* -mips5 code.  */
+#define EF_MIPS_ARCH_32     0x60000000  /* MIPS32 code.  */
+#define EF_MIPS_ARCH_64     0x70000000  /* MIPS64 code.  */
+#define EF_MIPS_ARCH_32R2   0x80000000  /* MIPS32 code.  */
+#define EF_MIPS_ARCH_64R2   0x90000000  /* MIPS64 code.  */
+
 typedef unsigned long elf_greg_t;
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
@@ -17,8 +28,7 @@
 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 
 /*
- * This is used to ensure we don't load something for the wrong architecture
- * and also rejects IRIX binaries.
+ * This is used to ensure we don't load something for the wrong architecture.
  */
 #define elf_check_arch(hdr)						\
 ({									\
@@ -27,7 +37,10 @@
 									\
 	if (__h->e_machine != EM_MIPS)					\
 		__res = 0;						\
-	if (__h->e_flags & EF_MIPS_ARCH)				\
+	if (((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_1) &&       	\
+	    ((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_2) &&       	\
+	    ((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_32) &&      	\
+	    ((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_32R2))      	\
 		__res = 0;						\
 									\
 	__res;								\
diff -urN linux-2.4.19-rc1/include/asm-mips/errno.h linux-2.4.19-rc2/include/asm-mips/errno.h
--- linux-2.4.19-rc1/include/asm-mips/errno.h	Mon Jul  2 13:56:40 2001
+++ linux-2.4.19-rc2/include/asm-mips/errno.h	Tue Jul 16 16:25:21 2002
@@ -17,7 +17,7 @@
 #define	EINTR		 4	/* Interrupted system call */
 #define	EIO		 5	/* I/O error */
 #define	ENXIO		 6	/* No such device or address */
-#define	E2BIG		 7	/* Arg list too long */
+#define	E2BIG		 7	/* Argument list too long */
 #define	ENOEXEC		 8	/* Exec format error */
 #define	EBADF		 9	/* Bad file number */
 #define	ECHILD		10	/* No child processes */
diff -urN linux-2.4.19-rc1/include/asm-mips/fpu_emulator.h linux-2.4.19-rc2/include/asm-mips/fpu_emulator.h
--- linux-2.4.19-rc1/include/asm-mips/fpu_emulator.h	Mon Jul  2 13:56:40 2001
+++ linux-2.4.19-rc2/include/asm-mips/fpu_emulator.h	Tue Jul 16 16:25:21 2002
@@ -1,15 +1,4 @@
 /*
- * Definitiona for the Algorithmics FPU Emulator port into MIPS Linux
- */
-/**************************************************************************
- *
- *  include/asm-mips/fpu_emulator.h
- *
- *  Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
- *  Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
- *
- * ########################################################################
- *
  *  This program is free software; you can distribute it and/or modify it
  *  under the terms of the GNU General Public License (Version 2) as
  *  published by the Free Software Foundation.
@@ -23,13 +12,16 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  *
- *************************************************************************/
-/* 
  * Further private data for which no space exists in mips_fpu_soft_struct.
  * This should be subsumed into the mips_fpu_soft_struct structure as
  * defined in processor.h as soon as the absurd wired absolute assembler
  * offsets become dynamic at compile time.
+ *
+ * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  */
+#ifndef _ASM_FPU_EMULATOR_H
+#define _ASM_FPU_EMULATOR_H
 
 struct mips_fpu_emulator_private {
 	unsigned int eir;
@@ -42,3 +34,5 @@
 		unsigned int errors;
 	} stats;
 };
+
+#endif /* _ASM_FPU_EMULATOR_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/cntmr.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/cntmr.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/cntmr.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/cntmr.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,42 @@
+/* cntmr.h - Timer/Counter interface header file */
+
+/* Copyright - Galileo technology */
+
+#ifndef __INCtimerCounterDrvh 
+#define __INCtimerCounterDrvh
+
+/* includes */
+
+#include "core.h"
+
+/* defines */
+
+#define FIRST_CNTMR   0
+#define LAST_CNTMR    3
+
+#define CNTMR0_READ(pData)\
+        GT_REG_READ(CNTMR0, pData)
+
+#define CNTMR1_READ(pData)\
+        GT_REG_READ(CNTMR1, pData)
+
+#define CNTMR2_READ(pData)\
+        GT_REG_READ(CNTMR2, pData)
+
+#define CNTMR3_READ(pData)\
+        GT_REG_READ(CNTMR3, pData)
+
+/* typedefs */
+
+typedef enum counterTimer{CNTMR_0,CNTMR_1,CNTMR_2,CNTMR_3} CNTMR_NUM;
+typedef enum cntTmrOpModes{COUNTER, TIMER} CNT_TMR_OP_MODES;
+
+bool    cntTmrLoad(unsigned int countNum, unsigned int value);	
+bool    cntTmrSetMode(CNTMR_NUM countNum, CNT_TMR_OP_MODES opMode);
+bool    cntTmrEnable(CNTMR_NUM countNum);  
+bool    cntTmrStart (CNTMR_NUM countNum,unsigned int countValue,
+                   CNT_TMR_OP_MODES opMode);
+unsigned int    cntTmrDisable(CNTMR_NUM countNum);              
+unsigned int    cntTmrRead(CNTMR_NUM countNum);
+
+#endif /* __INCtimerCounterDrvh */
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/core.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/core.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/core.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/core.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,182 @@
+/*
+ * This header file contains simple Read/Write macros for addressing the SDRAM,
+ * devices, GT`s internal registers and PCI (using the PCI`s address space).
+ *
+ * Copyright Galileo Technology.
+ */
+#ifndef __INCcoreh 
+#define __INCcoreh
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+#include <asm/gt64120.h>
+
+#define INTERNAL_REG_BASE_ADDR 0x14000000
+
+#define NO_BIT          0x00000000
+#define BIT0            0x00000001
+#define BIT1            0x00000002
+#define BIT2            0x00000004
+#define BIT3            0x00000008
+#define BIT4            0x00000010
+#define BIT5            0x00000020
+#define BIT6            0x00000040
+#define BIT7            0x00000080
+#define BIT8            0x00000100
+#define BIT9            0x00000200
+#define BIT10           0x00000400
+#define BIT11           0x00000800
+#define BIT12           0x00001000
+#define BIT13           0x00002000
+#define BIT14           0x00004000
+#define BIT15           0x00008000
+#define BIT16           0x00010000
+#define BIT17           0x00020000
+#define BIT18           0x00040000
+#define BIT19           0x00080000
+#define BIT20           0x00100000
+#define BIT21           0x00200000
+#define BIT22           0x00400000
+#define BIT23           0x00800000
+#define BIT24           0x01000000
+#define BIT25           0x02000000
+#define BIT26           0x04000000
+#define BIT27           0x08000000
+#define BIT28           0x10000000
+#define BIT29           0x20000000
+#define BIT30           0x40000000
+#define BIT31           0x80000000
+
+#define _1K             0x00000400
+#define _2K             0x00000800
+#define _4K             0x00001000
+#define _8K             0x00002000
+#define _16K            0x00004000
+#define _32K            0x00008000
+#define _64K            0x00010000
+#define _128K           0x00020000
+#define _256K           0x00040000
+#define _512K           0x00080000
+
+#define _1M             0x00100000
+#define _2M             0x00200000
+#define _3M             0x00300000
+#define _4M             0x00400000
+#define _5M             0x00500000
+#define _6M             0x00600000
+#define _7M             0x00700000
+#define _8M             0x00800000
+#define _9M             0x00900000
+#define _10M            0x00a00000
+#define _11M            0x00b00000
+#define _12M            0x00c00000
+#define _13M            0x00d00000
+#define _14M            0x00e00000
+#define _15M            0x00f00000
+#define _16M            0x01000000
+
+typedef enum _bool{false,true} bool;
+
+#ifndef NULL
+#define NULL 0                                  
+#endif
+
+/* The two following defines are according to MIPS architecture. */
+#define NONE_CACHEABLE			0xa0000000
+#define MIPS_CACHEABLE			0x80000000
+
+/* Read/Write to/from GT`s internal registers */
+#define GT_REG_READ(offset, pData)					\
+do {									\
+	*pData = (*((u32 *)(NONE_CACHEABLE |				\
+		INTERNAL_REG_BASE_ADDR | (offset))));			\
+	*pData = cpu_to_le32(*pData);					\
+} while(0)
+
+#define GT_REG_WRITE(offset, data)					\
+	(*((u32 *)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR |		\
+		(offset))) = cpu_to_le32(data))
+
+#define VIRTUAL_TO_PHY(y)	((u32)(y) & (u32)0x5fffffff)
+#define PHY_TO_VIRTUAL(y)	((u32)(y) | NONE_CACHEABLE)
+
+/* Write 32/16/8 bit Non-Cache-able */
+#define WRITE_CHAR(address, data)					\
+	(*((u8 *)((address) | NONE_CACHEABLE)) = (data))
+#define WRITE_SHORT(address, data)					\
+	(*((u16 *)((address) | NONE_CACHEABLE)) = (u16) data)
+#define WRITE_WORD(address, data)					\
+	(*((u32 *)((address) | NONE_CACHEABLE)) = (u32) data)
+
+/* Write 32/16/8 bits Cacheable */
+#define WRITE_CHAR_CACHEABLE(address, data)				\
+	(*((u8 *)((address) | MIPS_CACHEABLE)) = (data))
+                
+#define WRITE_SHORT_CACHEABLE(address, data)				\
+	(*((u16 *)((address) | MIPS_CACHEABLE)) = (u16) data)
+
+#define WRITE_WORD_CACHEABLE(address, data)				\
+	(*((u32 *)((address) | MIPS_CACHEABLE )) = (u32) data)
+
+/* Read 32/16/8 bits NonCacheable - returns data in variable. */
+#define READ_CHAR(address,pData)					\
+	(*(pData) = *((u8 *)((address) | NONE_CACHEABLE)))
+
+#define READ_SHORT(address,pData)					\
+	(*(pData) = *((u16 *)((address) | NONE_CACHEABLE)))
+
+#define READ_WORD(address,pData)					\
+	(*(pData) = *((u32 *)((address) | NONE_CACHEABLE)))
+
+/* Read 32/16/8 bit NonCacheable - returns data direct. */
+#define READCHAR(address)						\
+	(*((u8 *)((address) | NONE_CACHEABLE)))
+
+#define READSHORT(address)						\
+	(*((u16 *)((address) | NONE_CACHEABLE)))
+
+#define READWORD(address)						\
+        (*((u32 *)((address) | NONE_CACHEABLE)))
+
+/* Read 32/16/8 bit Cacheable - returns data in variable. */
+#define READ_CHAR_CACHEABLE(address,pData)				\
+        (*(pData) = *((u8 *)((address) | MIPS_CACHEABLE)))
+
+#define READ_SHORT_CACHEABLE(address,pData)				\
+        (*(pData) = *((u16 *)((address) | MIPS_CACHEABLE)))
+#define READ_WORD_CACHEABLE(address,pData)				\
+        (*(pData) = *((u32 *)((address) | MIPS_CACHEABLE)))
+
+/* Read 32/16/8 bit Cacheable - returns data direct. */
+#define READCHAR_CACHEABLE(address)					\
+	(*((u8 *)((address) | MIPS_CACHEABLE)))
+
+#define READSHORT_CACHEABLE(address)					\
+	(*((u16 *)((address) | MIPS_CACHEABLE)))
+
+#define READWORD_CACHEABLE(address)					\
+	(*((u32 *)((address) | MIPS_CACHEABLE)))
+
+/*
+ * SET_REG_BITS(regOffset,bits) - 
+ * gets register offset and bits: a 32bit value. It set to logic '1' in the  
+ * internal register the bits which given as an input example:
+ * SET_REG_BITS(0x840,BIT3 | BIT24 | BIT30) - set bits: 3,24 and 30 to logic
+ * '1' in register 0x840 while the other bits stays as is.
+ */
+#define SET_REG_BITS(regOffset,bits)					\
+	(*(u32*)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR |		\
+		(regOffset)) |= (u32)cpu_to_le32(bits))
+
+/*
+ * RESET_REG_BITS(regOffset,bits) -
+ * gets register offset and bits: a 32bit value. It set to logic '0' in the  
+ * internal register the bits which given as an input example:
+ * RESET_REG_BITS(0x840,BIT3 | BIT24 | BIT30) - set bits: 3,24 and 30 to logic
+ * '0' in register 0x840 while the other bits stays as is.
+ */
+#define RESET_REG_BITS(regOffset,bits)					\
+	(*(u32 *)(NONE_CACHEABLE | INTERNAL_REG_BASE_ADDR |		\
+		(regOffset)) &= ~((u32)cpu_to_le32(bits)))
+
+#endif /* __INCcoreh */
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/dma.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/dma.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/dma.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/dma.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,80 @@
+/* DMA.h - DMA functions and definitions*/
+
+/* Copyright Galileo Technology. */
+
+#ifndef __INCdmah 
+#define __INCdmah
+
+/* includes */
+
+#include "core.h"
+
+/* defines */
+
+#define FIRST_DMA_ENGINE   0
+#define LAST_DMA_ENGINE    3
+
+#define FLY_BY						BIT0
+#define RD_WR_FLY					BIT1
+#define DECREMENT_SOURCE_ADDRESS	BIT2
+#define HOLD_SOURCE_ADDRESS			BIT3
+#define DECREMENT_DEST_ADDRESS		BIT4
+#define HOLD_DEST_ADDRESS			BIT5
+#define DTL_1BYTE					BIT6 | BIT8
+#define DTL_2BYTES					BIT7 | BIT8
+#define DTL_4BYTES					BIT7
+#define DTL_8BYTES					NO_BIT
+#define DTL_16BYTES					BIT6
+#define DTL_32BYTES					BIT6 | BIT7
+#define DTL_64BYTES					BIT6 | BIT7 | BIT8
+#define NON_CHAIN_MOD				BIT9
+#define INT_EVERY_NULL_POINTER		BIT10
+#define BLOCK_TRANSFER_MODE			BIT11
+#define CHANNEL_ENABLE				BIT12
+#define FETCH_NEXT_RECORED			BIT13
+#define DMA_ACTIVITY_STATUS         BIT14
+#define ALIGN_TOWARD_DEST			BIT15
+#define MASK_DMA_REQ				BIT16
+#define ENABLE_DESCRIPTOR			BIT17
+#define ENABLE_EOT					BIT18
+#define ENABLE_EOT_INTERRUPT		BIT19
+#define ABORT_DMA					BIT20
+#define SOURCE_ADDR_IN_PCI0			BIT21
+#define SOURCE_ADDR_IN_PCI1			BIT22
+#define DEST_ADDR_IN_PCI0			BIT23
+#define DEST_ADDR_IN_PCI1			BIT24
+#define REC_ADDR_IN_PCI0			BIT25
+#define REC_ADDR_IN_PCI1			BIT26
+#define REQ_FROM_TIMER_COUNTER		BIT28
+
+/* typedefs */
+
+typedef enum dmaEngine{DMA_ENG_0,DMA_ENG_1,DMA_ENG_2,DMA_ENG_3} DMA_ENGINE;
+
+/* priority definitions */
+typedef enum prioChan01{ROUND_ROBIN01,CH_1,CH_0} PRIO_CHAN_0_1;
+typedef enum prioChan23{ROUND_ROBIN23,CH_3,CH_2} PRIO_CHAN_2_3;
+typedef enum prioGroup{ROUND_ROBIN,CH_2_3,CH_0_1} PRIO_GROUP;
+typedef enum prioOpt{RETURN_BUS,KEEP_BUS} PRIO_OPT; 
+
+typedef struct dmaRecored
+{
+    unsigned int    ByteCnt;                                            
+    unsigned int    SrcAdd;
+    unsigned int    DestAdd;
+    unsigned int    NextRecPtr;
+} DMA_RECORED;
+
+typedef enum __dma_status{CHANNEL_BUSY,NO_SUCH_CHANNEL,DMA_OK,
+                            GENERAL_ERROR} DMA_STATUS;
+
+DMA_STATUS dmaTransfer (DMA_ENGINE engine,unsigned int sourceAddr,
+                        unsigned int destAddr,unsigned int numOfBytes,
+                        unsigned int command,DMA_RECORED * nextRecoredPointer);
+bool	dmaCommand (DMA_ENGINE channel,unsigned int command);
+bool    isDmaChannelActive (DMA_ENGINE channel);
+
+bool    changeDmaPriority(PRIO_CHAN_0_1 prio_01, PRIO_CHAN_2_3 prio_23, 
+                          PRIO_GROUP prioGrp, PRIO_OPT prioOpt);
+
+#endif /* __INCdmah */
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/eeprom_param.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/eeprom_param.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/eeprom_param.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/eeprom_param.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,53 @@
+#ifndef EEPROM_PARAM_
+#define EEPROM_PARAM_
+#define SDRAM_REGS 0xbf000000
+
+unsigned int galileo_dl(void);
+void (*boot_addr)(int argc, char **argv, char **envp);
+
+#define NETWORK_BT_BIN 0
+#define FLASH_BT 1
+#define SERIAL_BT 2
+#define NETWORK_BT_SREC 3
+
+#define LINUX_OS 0
+#define OTHER_OS 1
+
+/********************************************************************
+ *eeprom_parameters -
+ *
+ *This structure holds the eeprom parameters (usually stored on flash
+ *memory)
+ *The structure is all stored in flash memory except memory_size which
+ *is probed each boot time for the real size of memory on the
+ *evaluation board.
+ *
+ *The structure also holds information that is not used by all
+ *evaluation board, such as the eth?_mac, which holds the MAC addresses
+ *of the built in ethernet ports in the EVB96100 for example, but is
+ *never used by EVB64120A.
+ *
+ *********************************************************************/
+
+struct eeprom_parameters {
+  unsigned int boot_source;
+  unsigned int operating_system;
+  
+  /* network loader parametrs */
+  unsigned int host_ip;
+  unsigned int server_ip;
+  char bootimage[64];
+  
+  /* Board parameters */
+  char eth0_mac[6];
+  char eth1_mac[6];
+  char eth2_mac[6];
+  char eth3_mac[6];
+
+  /* Command Line (usually needed for Linux) */
+  char os_command_line[256];
+  unsigned int entry_point;
+  unsigned memory_size;
+};
+
+#endif /* EEPROM_PARAM_ */
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/flashdrv.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/flashdrv.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/flashdrv.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/flashdrv.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,81 @@
+/* flashdrv.h - FLASH memory interface header file */
+
+/* Copyright Galileo Technology. */
+
+#ifndef __INCflashdrvh 
+#define __INCflashdrvh
+
+/* includes */
+
+#include "core.h"
+
+/* defines */
+
+/* Supported Flash Manufactures */ 
+
+#define AMD_FLASH       0x01
+#define ST_FLASH        0x20
+#define INTEL_FLASH     0x89
+#define MICRON_FLASH    0x89
+
+/* Supported Flash Devices */
+
+/* AMD Devices */
+#define AM29F400BT      0x2223    
+#define AM29F400BB      0x22AB
+#define AM29LV800BT     0x22DA
+#define AM29LV400BT     0x22B9
+#define AM29LV400BB     0x22BA
+#define AM29LV040B      0x4f
+/* ST Devices */
+#define M29W040         0xE3
+/* INTEL Devices - We have added I before the name defintion.*/
+#define I28F320J3A      0x16
+#define I28F640J3A      0x17
+#define I28F128J3A      0x18
+#define I28F320B3_B     0x8897
+#define I28F320B3_T     0x8896 
+#define I28F160B3_B     0x8891
+#define I28F160B3_T     0x8890
+
+#define POINTER_TO_FLASH           flashParametrs[0] 
+#define FLASH_BASE_ADDRESS         flashParametrs[1] 
+#define FLASH_WIDTH                flashParametrs[2] /* In Bytes */
+#define FLASH_MODE                 flashParametrs[3] /* In bits  */
+#define MANUFACTOR_ID              POINTER_TO_FLASH + 0
+#define VENDOR_ID                  POINTER_TO_FLASH + 1
+#define NUMBER_OF_SECTORS          POINTER_TO_FLASH + 2
+#define FIRST_SECTOR_SIZE          POINTER_TO_FLASH + 3
+#define NUM_OF_DEVICES             FLASH_WIDTH / (FLASH_MODE / 8)
+ 
+/* typedefs */
+
+typedef enum _FlashMode {PURE8,X8 = 8,X16 = 16} FLASHmode;
+/* PURE8 - when using a flash device whice can be configurated only as  
+            8 bit device. */
+/* X8    - when using a flash device which is 16 bit wide but configured to
+           operate in 8 bit mode.*/
+/* X16   - when using a flash device which is 16 bit wide */
+
+bool    flashErase(void);
+bool    flashEraseSector(unsigned int sectorNumber);
+bool    flashWriteWord(unsigned int offset,unsigned int data);
+bool    flashWriteShort(unsigned int offset,unsigned short sdata);
+bool    flashWriteChar(unsigned int offset,unsigned char cdata);
+void    flashReset(void);
+unsigned int    flashInWhichSector(unsigned int offset);
+unsigned int    flashGetSectorSize(unsigned int sectorNumber);
+unsigned int    flashInit(unsigned int baseAddress,unsigned int flashWidth,
+                          FLASHmode FlashMode);
+unsigned int    flashGetNumOfSectors(void);
+unsigned int    flashGetSize(void);
+unsigned int    flashGetSectorOffset(unsigned int sectorNum);
+unsigned int    flashWriteBlock(unsigned int offset,unsigned int numOfByte,
+                        unsigned char * blockAddress);
+unsigned int    flashReadWord(unsigned int offset);
+unsigned char   flashReadChar(unsigned int offset);
+unsigned short  flashReadShort(unsigned int offset);
+unsigned int    flashReadBlock(unsigned int offset,unsigned int numOfByte,
+                               unsigned char * blockAddress);
+#endif /* __INCflashdrvh */
+
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/i2o.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/i2o.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/i2o.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/i2o.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,61 @@
+/* i2o.h - Header file for the I2O`s interface */
+
+/* Copyright - Galileo technology. */
+
+#ifndef __INCi2oh
+#define __INCi2oh
+
+/* includes */            
+            
+#include "core.h"
+
+/* typedefs */           
+
+typedef enum _i2oMessageReg{MESSAGE_REG_0,MESSAGE_REG_1} I2O_MESSAGE_REG;
+typedef enum _cirQueSize{I20_16K = 0x1,I20_32K = 0x2,I20_64K = 0x4,\
+                  I20_128K = 0x8,I20_256K = 0xc} CIRCULAR_QUEUE_SIZE;
+
+/* Message handle Functions */
+unsigned int    getInBoundMassege(I2O_MESSAGE_REG messageRegNum);
+bool  sendOutBoundMassege(I2O_MESSAGE_REG messageRegNum,unsigned int message);
+bool  checkInBoundIntAndClear(I2O_MESSAGE_REG messageRegNum);
+bool  outBoundMessageAcknowledge(I2O_MESSAGE_REG messageRegNum);
+bool  maskInBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);
+bool  enableInBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);
+bool  maskOutBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);
+bool  enableOutBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);
+
+/* Doorbell handle Functions */
+unsigned int    readInBoundDoorBellInt(void);
+bool  initiateOutBoundDoorBellInt(unsigned int interruptBits);
+bool  clearInBoundDoorBellInt(unsigned int interruptBits);
+bool  isInBoundDoorBellInterruptSet(void);
+bool  isOutBoundDoorBellInterruptSet(void); /* For acknowledge */
+bool  maskInBoundDoorBellInterrupt(void);
+bool  enableInBoundDoorBellInterrupt(void);
+bool  maskOutBoundDoorBellInterrupt(void);
+bool  enableOutBoundDoorBellInterrupt(void);
+
+/* I2O - Circular Queues handle Functions */
+
+/* initialization */
+bool  circularQueueEnable(CIRCULAR_QUEUE_SIZE cirQueSize,
+                          unsigned int queueBaseAddr);
+
+/* Inbound Post Queue */
+unsigned int    inBoundPostQueuePop(void);
+bool    isInBoundPostQueueInterruptSet(void);
+bool  clearInBoundPostQueueInterrupt(void);
+void    maskInBoundPostQueueInterrupt(void);
+void    enableInBoundPostQueueInterrupt(void);
+/* Outbound Post Queue */
+bool  outBoundPostQueuePush(unsigned int data);
+bool    isOutBoundPostQueueEmpty(void);
+/* Inbound Free Queue */
+bool  inBoundFreeQueuePush(unsigned int data);
+bool    isInBoundFreeQueueEmpty(void);
+/* Outbound Free Queue */
+unsigned int    outBoundFreeQueuePop(void);
+
+#endif  /* __INCi2oh */
+
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/memory.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/memory.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/memory.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/memory.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,57 @@
+/* Memory.h - Memory mappings and remapping functions declarations */
+
+/* Copyright - Galileo technology. */
+
+#ifndef __INCmemoryh
+#define __INCmemoryh
+
+/* includes */
+
+#include "core.h"
+
+/* defines */
+
+#define DONT_MODIFY     0xffffffff
+#define PARITY_SUPPORT  0x40000000
+
+#define _8BIT           0x00000000
+#define _16BIT          0x00010000
+#define _32BIT          0x00020000
+#define _64BIT          0x00030000
+
+/* typedefs */
+
+typedef enum __memBank{BANK0,BANK1,BANK2,BANK3} MEMORY_BANK;
+typedef enum __device{DEVICE0,DEVICE1,DEVICE2,DEVICE3,BOOT_DEVICE} DEVICE;
+
+
+unsigned int   getMemoryBankBaseAddress(MEMORY_BANK bank);
+unsigned int   getDeviceBaseAddress(DEVICE device);
+unsigned int   getMemoryBankSize(MEMORY_BANK bank);
+unsigned int   getDeviceSize(DEVICE device);
+unsigned int   getDeviceWidth(DEVICE device);
+
+bool mapMemoryBanks0and1(unsigned int bank0Base,unsigned int bank0Length,
+                         unsigned int bank1Base,unsigned int bank1Length);
+bool mapMemoryBanks2and3(unsigned int bank2Base,unsigned int bank2Length,
+                         unsigned int bank3Base,unsigned int bank3Length);
+bool mapDevices0_1and2MemorySpace(unsigned int device0Base,
+                                  unsigned int device0Length,
+                                  unsigned int device1Base,
+                                  unsigned int device1Length,
+                                  unsigned int device2Base,
+                                  unsigned int device2Length);
+bool mapDevices3andBootMemorySpace(unsigned int device3Base,
+                                   unsigned int device3Length,
+                                   unsigned int bootDeviceBase,
+                                   unsigned int bootDeviceLength);
+bool mapInternalRegistersMemorySpace(unsigned int internalRegBase);
+bool modifyDeviceParameters(DEVICE device,unsigned int TurnOff,
+                            unsigned int AccToFirst,unsigned int AccToNext,
+                            unsigned int ALEtoWr, unsigned int WrActive,
+                            unsigned int WrHigh,unsigned int Width,
+                            bool ParitySupport);
+
+bool remapAddress(unsigned int remapReg, unsigned int remapValue);
+#endif /* __INCmemoryh */
+
diff -urN linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/pci.h linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/pci.h
--- linux-2.4.19-rc1/include/asm-mips/galileo-boards/evb64120A/pci.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/galileo-boards/evb64120A/pci.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,165 @@
+/* PCI.h - PCI functions header file */
+
+/* Copyright - Galileo technology. */
+
+#ifndef  __INCpcih
+#define  __INCpcih
+
+/* includes */
+
+#include"core.h"
+
+/* defines */
+
+#define PCI0_MASTER_ENABLE(deviceNumber) pci0WriteConfigReg(                  \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,MASTER_ENABLE |                \
+          pci0ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI0_MASTER_DISABLE(deviceNumber) pci0WriteConfigReg(                 \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,~MASTER_ENABLE &               \
+          pci0ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI1_MASTER_ENABLE(deviceNumber) pci1WriteConfigReg(                  \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,MASTER_ENABLE |                \
+          pci1ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI1_MASTER_DISABLE(deviceNumber) pci1WriteConfigReg(                 \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,~MASTER_ENABLE &               \
+          pci1ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI0_MEMORY_ENABLE(deviceNumber) pci0WriteConfigReg(                  \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,MEMORY_ENABLE |                \
+          pci0ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )           
+
+#define PCI1_MEMORY_ENABLE(deviceNumber) pci1WriteConfigReg(                  \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,MEMORY_ENABLE |                \
+          pci1ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI0_IO_ENABLE(deviceNumber) pci0WriteConfigReg(                      \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,I_O_ENABLE |                   \
+          pci0ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI1_IO_ENABLE(deviceNumber) pci1WriteConfigReg(                      \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,I_O_ENABLE |                   \
+          pci1ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI0_SLAVE_ENABLE(deviceNumber) pci0WriteConfigReg(                   \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,MEMORY_ENABLE | I_O_ENABLE |   \
+          pci0ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI1_SLAVE_ENABLE(deviceNumber) pci1WriteConfigReg(                   \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,MEMORY_ENABLE | I_O_ENABLE |   \
+          pci1ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber) )
+
+#define PCI0_DISABLE(deviceNumber) pci0WriteConfigReg(                        \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,0xfffffff8  &                  \
+          pci0ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber))
+
+#define PCI1_DISABLE(deviceNumber) pci1WriteConfigReg(                        \
+          PCI_0STATUS_AND_COMMAND,deviceNumber,0xfffffff8  &                  \
+          pci1ReadConfigReg(PCI_0STATUS_AND_COMMAND,deviceNumber))
+
+#define 	MASTER_ENABLE			BIT2  
+#define		MEMORY_ENABLE			BIT1  
+#define		I_O_ENABLE  			BIT0  
+#define     SELF                    0
+/* Agent on the PCI bus may have up to 6 BARS. */
+#define     BAR0                    0x10
+#define     BAR1                    0x14
+#define     BAR2                    0x18
+#define     BAR3                    0x1c
+#define     BAR4                    0x20
+#define     BAR5                    0x24
+   
+
+/* typedefs */
+
+typedef struct pciDevice
+{
+    char            type[20];
+    unsigned int    deviceNum;
+    unsigned int    venID;                                            
+    unsigned int    deviceID;
+    unsigned int    bar0Base;
+    unsigned int    bar0Size;
+    unsigned int    bar0Type;
+    unsigned int    bar1Base;
+    unsigned int    bar1Size;
+    unsigned int    bar1Type;
+    unsigned int    bar2Base;
+    unsigned int    bar2Size;
+    unsigned int    bar2Type;
+    unsigned int    bar3Base;
+    unsigned int    bar3Size;
+    unsigned int    bar3Type;
+    unsigned int    bar4Base;
+    unsigned int    bar4Size;
+    unsigned int    bar4Type;
+    unsigned int    bar5Base;
+    unsigned int    bar5Size;
+    unsigned int    bar5Type;
+} PCI_DEVICE;
+
+void    pci0WriteConfigReg(unsigned int regOffset,unsigned int pciDevNum,
+                           unsigned int data);
+void    pci1WriteConfigReg(unsigned int regOffset,unsigned int pciDevNum,
+                           unsigned int data);
+void    pci0ScanDevices(PCI_DEVICE *pci0Detect,unsigned int numberOfElment);
+void    pci1ScanDevices(PCI_DEVICE *pci1Detect,unsigned int numberOfElment);
+unsigned int    pci0ReadConfigReg (unsigned int regOffset,
+                                   unsigned int pciDevNum);
+unsigned int    pci1ReadConfigReg (unsigned int regOffset,
+                                   unsigned int pciDevNum);
+
+/*      Master`s memory space   */
+
+void    pci0MapIOspace(unsigned int pci0IoBase,unsigned int pci0IoLength);
+void    pci0MapMemory0space(unsigned int pci0Mem0Base,
+                            unsigned int pci0Mem0Length);
+void    pci0MapMemory1space(unsigned int pci0Mem1Base,
+                            unsigned int pci0Mem1Length);
+
+void    pci1MapIOspace(unsigned int pci1IoBase,unsigned int pci1IoLength);
+void    pci1MapMemory0space(unsigned int pci1Mem0Base,
+                            unsigned int pci1Mem0Length);
+void    pci1MapMemory1space(unsigned int pci1Mem1Base,
+                            unsigned int pci1Mem1Length);
+
+unsigned int    pci0GetIOspaceBase(void);
+unsigned int    pci0GetIOspaceSize(void);
+unsigned int    pci0GetMemory0Base(void);
+unsigned int    pci0GetMemory0Size(void);
+unsigned int    pci0GetMemory1Base(void);
+unsigned int    pci0GetMemory1Size(void);
+
+unsigned int    pci1GetIOspaceBase(void);
+unsigned int    pci1GetIOspaceSize(void);
+unsigned int    pci1GetMemory0Base(void);
+unsigned int    pci1GetMemory0Size(void);
+unsigned int    pci1GetMemory1Base(void);
+unsigned int    pci1GetMemory1Size(void);
+
+/*      Slave`s memory space   */
+void    pci0MapInternalRegSpace(unsigned int pci0InternalBase);
+void    pci0MapInternalRegIOSpace(unsigned int pci0InternalBase);
+void    pci0MapMemoryBanks0_1(unsigned int pci0Dram0_1Base,
+                              unsigned int pci0Dram0_1Size);
+void    pci0MapMemoryBanks2_3(unsigned int pci0Dram2_3Base,
+                              unsigned int pci0Dram2_3Size);
+void    pci0MapDevices0_1and2MemorySpace(unsigned int pci0Dev012Base,
+                                         unsigned int pci0Dev012Length);
+void    pci0MapDevices3andBootMemorySpace(unsigned int pci0Dev3andBootBase,
+                                          unsigned int pci0Dev3andBootLength);
+
+void    pci1MapInternalRegSpace(unsigned int pci1InternalBase);
+void    pci1MapInternalRegIOSpace(unsigned int pci1InternalBase);
+void    pci1MapMemoryBanks0_1(unsigned int pci1Dram0_1Base,
+                              unsigned int pci1Dram0_1Size);
+void    pci1MapMemoryBanks2_3(unsigned int pci1Dram2_3Base,
+                              unsigned int pci1Dram2_3Size);
+void    pci1MapDevices0_1and2MemorySpace(unsigned int pci1Dev012Base,
+                                         unsigned int pci1Dev012Length);
+void    pci1MapDevices3andBootMemorySpace(unsigned int pci1Dev3andBootBase,
+                                          unsigned int pci1Dev3andBootLength);
+
+#endif  /* __INCpcih */
diff -urN linux-2.4.19-rc1/include/asm-mips/gdb-stub.h linux-2.4.19-rc2/include/asm-mips/gdb-stub.h
--- linux-2.4.19-rc1/include/asm-mips/gdb-stub.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/gdb-stub.h	Tue Jul 16 16:25:21 2002
@@ -132,7 +132,7 @@
 
 #define GDB_FR_SIZE		((((GDB_FR_CP0_PRID) + 4) + (PTRSIZE-1)) & ~(PTRSIZE-1))
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 /*
  * This is the same as above, but for the high-level
@@ -208,5 +208,5 @@
 
 void set_debug_traps(void);
 
-#endif /* _LANGUAGE_ASSEMBLY */
+#endif /* !__ASSEMBLY__ */
 #endif /* __ASM_MIPS_GDB_STUB_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/highmem.h linux-2.4.19-rc2/include/asm-mips/highmem.h
--- linux-2.4.19-rc1/include/asm-mips/highmem.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/highmem.h	Tue Jul 16 16:25:21 2002
@@ -20,7 +20,6 @@
 
 #ifdef __KERNEL__
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <asm/kmap_types.h>
@@ -53,7 +52,7 @@
 static inline void *kmap(struct page *page)
 {
 	if (in_interrupt())
-		BUG();
+		out_of_line_bug();
 	if (page < highmem_start_page)
 		return page_address(page);
 	return kmap_high(page);
@@ -62,7 +61,7 @@
 static inline void kunmap(struct page *page)
 {
 	if (in_interrupt())
-		BUG();
+		out_of_line_bug();
 	if (page < highmem_start_page)
 		return;
 	kunmap_high(page);
diff -urN linux-2.4.19-rc1/include/asm-mips/hw_irq.h linux-2.4.19-rc2/include/asm-mips/hw_irq.h
--- linux-2.4.19-rc1/include/asm-mips/hw_irq.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/hw_irq.h	Tue Jul 16 16:25:21 2002
@@ -8,6 +8,8 @@
 #ifndef _ASM_HW_IRQ_H
 #define _ASM_HW_IRQ_H
 
+#include <asm/atomic.h>
+
 extern atomic_t irq_err_count;
 
 /* This may not be apropriate for all machines, we'll see ...  */
diff -urN linux-2.4.19-rc1/include/asm-mips/ide.h linux-2.4.19-rc2/include/asm-mips/ide.h
--- linux-2.4.19-rc1/include/asm-mips/ide.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/ide.h	Tue Jul 16 16:25:21 2002
@@ -98,6 +98,7 @@
 #ifdef __MIPSEB__
 		unsigned HOB		: 1;	/* 48-bit address ordering */
 		unsigned reserved456	: 3;
+		unsigned bit3		: 1;	/* ATA-2 thingy */
 		unsigned SRST		: 1;	/* host soft reset bit */
 		unsigned nIEN		: 1;	/* device INTRQ to host */
 		unsigned bit0		: 1;
@@ -145,6 +146,57 @@
 
 #if defined(__MIPSEB__)
 
+/* get rid of defs from io.h - ide has its private and conflicting versions */
+#ifdef insw
+#undef insw
+#endif
+#ifdef outsw
+#undef outsw
+#endif
+#ifdef insl
+#undef insl
+#endif
+#ifdef outsl
+#undef outsl
+#endif
+
+#define insw(port, addr, count) ide_insw(port, addr, count)
+#define insl(port, addr, count) ide_insl(port, addr, count)
+#define outsw(port, addr, count) ide_outsw(port, addr, count)
+#define outsl(port, addr, count) ide_outsl(port, addr, count)
+
+static inline void ide_insw(unsigned long port, void *addr, unsigned int count)
+{
+	while (count--) {
+		*(u16 *)addr = *(volatile u16 *)(mips_io_port_base + port);
+		addr += 2;
+	}
+}
+
+static inline void ide_outsw(unsigned long port, void *addr, unsigned int count)
+{
+	while (count--) {
+		*(volatile u16 *)(mips_io_port_base + (port)) = *(u16 *)addr;
+		addr += 2;
+	}
+}
+
+static inline void ide_insl(unsigned long port, void *addr, unsigned int count)
+{
+	while (count--) {
+		*(u32 *)addr = *(volatile u32 *)(mips_io_port_base + port);
+		addr += 4;
+	}
+}
+
+static inline void ide_outsl(unsigned long port, void *addr, unsigned int count)
+{
+	while (count--) {
+		*(volatile u32 *)(mips_io_port_base + (port)) = *(u32 *)addr;
+		addr += 4;
+	}
+}
+
 #define T_CHAR          (0x0000)        /* char:  don't touch  */
 #define T_SHORT         (0x4000)        /* short: 12 -> 21     */
 #define T_INT           (0x8000)        /* int:   1234 -> 4321 */
diff -urN linux-2.4.19-rc1/include/asm-mips/io.h linux-2.4.19-rc2/include/asm-mips/io.h
--- linux-2.4.19-rc1/include/asm-mips/io.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/io.h	Tue Jul 16 16:25:21 2002
@@ -15,6 +15,7 @@
 #include <linux/pagemap.h>
 #include <linux/types.h>
 #include <asm/addrspace.h>
+#include <asm/pgtable-bits.h>
 #include <asm/byteorder.h>
 
 /*
@@ -93,14 +94,36 @@
 #endif
 
 /*
- * Change virtual addresses to physical addresses and vv.
- * These are trivial on the 1:1 Linux/MIPS mapping
+ *     virt_to_phys    -       map virtual addresses to physical
+ *     @address: address to remap
+ *
+ *     The returned physical address is the physical (CPU) mapping for
+ *     the memory address given. It is only valid to use this function on
+ *     addresses directly mapped or allocated via kmalloc. 
+ *
+ *     This function does not give bus mappings for DMA transfers. In
+ *     almost all conceivable cases a device driver should not be using
+ *     this function
  */
+
 static inline unsigned long virt_to_phys(volatile void * address)
 {
 	return PHYSADDR(address);
 }
 
+/*
+ *     phys_to_virt    -       map physical address to virtual
+ *     @address: address to remap
+ *
+ *     The returned virtual address is a current CPU mapping for
+ *     the memory address given. It is only valid to use this function on
+ *     addresses that have a kernel mapping
+ *
+ *     This function does not handle bus mappings for DMA transfers. In
+ *     almost all conceivable cases a device driver should not be using
+ *     this function
+ */
+
 static inline void * phys_to_virt(unsigned long address)
 {
 	return (void *)KSEG0ADDR(address);
@@ -130,19 +153,55 @@
 /*
  * Change "struct page" to physical address.
  */
+#ifdef CONFIG_64BIT_PHYS_ADDR
+#define page_to_phys(page)	((u64)(page - mem_map) << PAGE_SHIFT)
+#else
 #define page_to_phys(page)	((page - mem_map) << PAGE_SHIFT)
+#endif
+
 
 extern void * __ioremap(phys_t offset, phys_t size, unsigned long flags);
 
-static inline void *ioremap(phys_t offset, unsigned long size)
-{
-	return __ioremap(offset, size, _CACHE_UNCACHED);
-}
+/*
+ *     ioremap         -       map bus memory into CPU space
+ *     @offset:        bus address of the memory
+ *     @size:          size of the resource to map
+ *
+ *     ioremap performs a platform specific sequence of operations to
+ *     make bus memory CPU accessible via the readb/readw/readl/writeb/
+ *     writew/writel functions and the other mmio helpers. The returned
+ *     address is not guaranteed to be usable directly as a virtual
+ *     address. 
+ */
 
-static inline void *ioremap_nocache(phys_t offset, unsigned long size)
-{
-	return __ioremap(offset, size, _CACHE_UNCACHED);
-}
+#define ioremap(offset, size)						\
+	__ioremap((offset), (size), _CACHE_UNCACHED)
+
+/*
+ *     ioremap_nocache         -       map bus memory into CPU space
+ *     @offset:        bus address of the memory
+ *     @size:          size of the resource to map
+ *
+ *     ioremap_nocache performs a platform specific sequence of operations to
+ *     make bus memory CPU accessible via the readb/readw/readl/writeb/
+ *     writew/writel functions and the other mmio helpers. The returned
+ *     address is not guaranteed to be usable directly as a virtual
+ *     address. 
+ *
+ *     This version of ioremap ensures that the memory is marked uncachable
+ *     on the CPU as well as honouring existing caching rules from things like
+ *     the PCI bus. Note that there are other caches and buffers on many 
+ *     busses. In paticular driver authors should read up on PCI writes
+ *
+ *     It's useful if some control registers are in such an area and
+ *     write combining or read caching is not desirable:
+ */
+#define ioremap_nocache(offset, size)					\
+	__ioremap((offset), (size), _CACHE_UNCACHED)
+#define ioremap_cacheable_cow(offset, size)				\
+	__ioremap((offset), (size), _CACHE_CACHABLE_COW)
+#define ioremap_uncached_accelerated(offset, size)			\
+	__ioremap((offset), (size), _CACHE_UNCACHED_ACCELERATED)
 
 extern void iounmap(void *addr);
 
@@ -198,6 +257,16 @@
 #define eth_io_copy_and_sum(skb,src,len,unused) memcpy_fromio((skb)->data,(src),(len))
 #define isa_eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(b),(c),(d))
 
+/*
+ *     check_signature         -       find BIOS signatures
+ *     @io_addr: mmio address to check 
+ *     @signature:  signature block
+ *     @length: length of signature
+ *
+ *     Perform a signature comparison with the mmio address io_addr. This
+ *     address should have been obtained by ioremap.
+ *     Returns 1 on a match.
+ */
 static inline int check_signature(unsigned long io_addr,
                                   const unsigned char *signature, int length)
 {
@@ -213,7 +282,37 @@
 out:
 	return retval;
 }
-#define isa_check_signature(io, s, l) check_signature(i,s,l)
+
+/*
+ *     isa_check_signature             -       find BIOS signatures
+ *     @io_addr: mmio address to check 
+ *     @signature:  signature block
+ *     @length: length of signature
+ *
+ *     Perform a signature comparison with the ISA mmio address io_addr.
+ *     Returns 1 on a match.
+ *
+ *     This function is deprecated. New drivers should use ioremap and
+ *     check_signature.
+ */
+
+static inline int isa_check_signature(unsigned long io_addr,
+	const unsigned char *signature, int length)
+{
+	int retval = 0;
+	do {
+		if (isa_readb(io_addr) != *signature)
+			goto out;
+		io_addr++;
+		signature++;
+		length--;
+	} while (length);
+	retval = 1;
+out:
+	return retval;
+}
+
+
 
 
 #define outb(val,port)							\
@@ -249,22 +348,29 @@
 	SLOW_DOWN_IO;							\
 } while(0)
 
-static inline unsigned char inb(unsigned long port)
+#define inb(port) __inb(port)
+#define inw(port) __inw(port)
+#define inl(port) __inl(port)
+#define inb_p(port) __inb_p(port)
+#define inw_p(port) __inw_p(port)
+#define inl_p(port) __inl_p(port)
+
+static inline unsigned char __inb(unsigned long port)
 {
 	return __ioswab8(*(volatile u8 *)(mips_io_port_base + port));
 }
 
-static inline unsigned short inw(unsigned long port)
+static inline unsigned short __inw(unsigned long port)
 {
 	return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
 }
 
-static inline unsigned int inl(unsigned long port)
+static inline unsigned int __inl(unsigned long port)
 {
 	return __ioswab32(*(volatile u32 *)(mips_io_port_base + port));
 }
 
-static inline unsigned char inb_p(unsigned long port)
+static inline unsigned char __inb_p(unsigned long port)
 {
 	u8 __val;
 
@@ -274,7 +380,7 @@
 	return __ioswab8(__val);
 }
 
-static inline unsigned short inw_p(unsigned long port)
+static inline unsigned short __inw_p(unsigned long port)
 {
 	u16 __val;
 
@@ -284,7 +390,7 @@
 	return __ioswab16(__val);
 }
 
-static inline unsigned int inl_p(unsigned long port)
+static inline unsigned int __inl_p(unsigned long port)
 {
 	u32 __val;
 
@@ -293,7 +399,14 @@
 	return __ioswab32(__val);
 }
 
-static inline void outsb(unsigned long port, void *addr, unsigned int count)
+#define outsb(port, addr, count) __outsb(port, addr, count)
+#define insb(port, addr, count) __insb(port, addr, count)
+#define outsw(port, addr, count) __outsw(port, addr, count)
+#define insw(port, addr, count) __insw(port, addr, count)
+#define outsl(port, addr, count) __outsl(port, addr, count)
+#define insl(port, addr, count) __insl(port, addr, count)
+
+static inline void __outsb(unsigned long port, void *addr, unsigned int count)
 {
 	while (count--) {
 		outb(*(u8 *)addr, port);
@@ -301,7 +414,7 @@
 	}
 }
 
-static inline void insb(unsigned long port, void *addr, unsigned int count)
+static inline void __insb(unsigned long port, void *addr, unsigned int count)
 {
 	while (count--) {
 		*(u8 *)addr = inb(port);
@@ -309,7 +422,7 @@
 	}
 }
 
-static inline void outsw(unsigned long port, void *addr, unsigned int count)
+static inline void __outsw(unsigned long port, void *addr, unsigned int count)
 {
 	while (count--) {
 		outw(*(u16 *)addr, port);
@@ -317,7 +430,7 @@
 	}
 }
 
-static inline void insw(unsigned long port, void *addr, unsigned int count)
+static inline void __insw(unsigned long port, void *addr, unsigned int count)
 {
 	while (count--) {
 		*(u16 *)addr = inw(port);
@@ -325,7 +438,7 @@
 	}
 }
 
-static inline void outsl(unsigned long port, void *addr, unsigned int count)
+static inline void __outsl(unsigned long port, void *addr, unsigned int count)
 {
 	while (count--) {
 		outl(*(u32 *)addr, port);
@@ -333,7 +446,7 @@
 	}
 }
 
-static inline void insl(unsigned long port, void *addr, unsigned int count)
+static inline void __insl(unsigned long port, void *addr, unsigned int count)
 {
 	while (count--) {
 		*(u32 *)addr = inl(port);
diff -urN linux-2.4.19-rc1/include/asm-mips/irq_cpu.h linux-2.4.19-rc2/include/asm-mips/irq_cpu.h
--- linux-2.4.19-rc1/include/asm-mips/irq_cpu.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/irq_cpu.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,18 @@
+/*
+ *	include/asm-mips/irq_cpu.h
+ *
+ *	MIPS CPU interrupt definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_MIPS_IRQ_CPU_H
+#define __ASM_MIPS_IRQ_CPU_H
+
+extern void mips_cpu_irq_init(int irq_base);
+
+#endif /* __ASM_MIPS_IRQ_CPU_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/jazz.h linux-2.4.19-rc2/include/asm-mips/jazz.h
--- linux-2.4.19-rc1/include/asm-mips/jazz.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/jazz.h	Tue Jul 16 16:25:21 2002
@@ -70,7 +70,7 @@
 #define LED_E                   0x9e
 #define LED_F                   0x8e
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 extern __inline__ void pica_set_led(unsigned int bits)
 {
@@ -79,7 +79,7 @@
 	*led_register = bits;
 }
 
-#endif
+#endif /* !__ASSEMBLY__ */
 
 /*
  * Base address of the Sonic Ethernet adapter in Jazz machines.
@@ -100,7 +100,7 @@
 #define JAZZ_KEYBOARD_DATA      0xe0005000
 #define JAZZ_KEYBOARD_COMMAND   0xe0005001
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 typedef struct {
 	unsigned char data;
@@ -119,7 +119,7 @@
  */
 #define keyboard_hardware       jazz_keyboard_hardware
 
-#endif
+#endif /* !__ASSEMBLY__ */
 
 /*
  * i8042 keyboard controller for most other Mips machines.
@@ -152,7 +152,7 @@
 /*
  * DRAM configuration register
  */
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 #ifdef __MIPSEL__
 typedef struct {
 	unsigned int bank2 : 3;
@@ -172,7 +172,7 @@
 	unsigned int bank2 : 3;
 } dram_configuration;
 #endif
-#endif /* _LANGUAGE_ASSEMBLY */
+#endif /* !__ASSEMBLY__ */
 
 #define PICA_DRAM_CONFIG        0xe00fffe0
 
@@ -270,7 +270,7 @@
 /*
  * Access the R4030 DMA and I/O Controller
  */
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 static inline void r4030_delay(void)
 {
@@ -309,7 +309,7 @@
 	r4030_delay();
 }
 
-#endif /* !LANGUAGE_ASSEMBLY__ */
+#endif /* !__ASSEMBLY__ */
 
 #define JAZZ_FDC_BASE	0xe0003000
 #define JAZZ_RTC_BASE	0xe0004000
diff -urN linux-2.4.19-rc1/include/asm-mips/linux_logo_dec.h linux-2.4.19-rc2/include/asm-mips/linux_logo_dec.h
--- linux-2.4.19-rc1/include/asm-mips/linux_logo_dec.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/linux_logo_dec.h	Tue Jul 16 16:25:21 2002
@@ -11,7 +11,6 @@
  
 #include <linux/init.h>
 #include <linux/version.h>
-#include <linux/config.h>
 
 #define linux_logo_banner "Linux/MIPSel version " UTS_RELEASE
 #define LINUX_LOGO_COLORS 183
diff -urN linux-2.4.19-rc1/include/asm-mips/linux_logo_sgi.h linux-2.4.19-rc2/include/asm-mips/linux_logo_sgi.h
--- linux-2.4.19-rc1/include/asm-mips/linux_logo_sgi.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/linux_logo_sgi.h	Tue Jul 16 16:25:21 2002
@@ -8,10 +8,8 @@
  * Copyright (C) 2001 Jan-Benedict Glaw <jbglaw@lug-owl.de>
  *
  */
- 
 #include <linux/init.h>
 #include <linux/version.h>
-#include <linux/config.h>
 
 #define linux_logo_banner "Linux/MIPS version " UTS_RELEASE
 #define LINUX_LOGO_COLORS 212
diff -urN linux-2.4.19-rc1/include/asm-mips/mips-boards/bonito64.h linux-2.4.19-rc2/include/asm-mips/mips-boards/bonito64.h
--- linux-2.4.19-rc1/include/asm-mips/mips-boards/bonito64.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/mips-boards/bonito64.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,432 @@
+/*
+ * bonito.h
+ *
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2001 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ * This file is the original bonito.h from Algorithmics with minor changes
+ * to fit into linux.
+ */
+
+/*
+ * Bonito Register Map 
+ * Copyright (c) 1999 Algorithmics Ltd
+ *
+ * Algorithmics gives permission for anyone to use and modify this file
+ * without any obligation or license condition except that you retain
+ * this copyright message in any source redistribution in whole or part.
+ *
+ * Updated copies of this and other files can be found at
+ * ftp://ftp.algor.co.uk/pub/bonito/
+ * 
+ * Users of the Bonito controller are warmly recommended to contribute
+ * any useful changes back to Algorithmics (mail to bonito@algor.co.uk).
+ */
+
+/* Revision 1.48 autogenerated on 08/17/99 15:20:01 */
+/* This bonito64 version editted from bonito.h Revision 1.48 on 11/09/00 */
+
+#ifndef _ASM_MIPS_BOARDS_BONITO64_H
+#define _ASM_MIPS_BOARDS_BONITO64_H
+
+#ifdef __ASSEMBLY__
+
+/* offsets from base register */
+#define BONITO(x)	(x)
+
+#else /* !__ASSEMBLY__ */
+
+/* offsets from base pointer, this construct allows optimisation */
+/* static char * const _bonito = PA_TO_KVA1(BONITO_BASE); */
+#define BONITO(x)		*(volatile u32 *)(_bonito + (x))
+
+#endif /* __ASSEMBLY__ */
+
+
+#define BONITO_BOOT_BASE		0x1fc00000
+#define BONITO_BOOT_SIZE		0x00100000
+#define BONITO_BOOT_TOP 		(BONITO_BOOT_BASE+BONITO_BOOT_SIZE-1)
+#define BONITO_FLASH_BASE		0x1c000000
+#define BONITO_FLASH_SIZE		0x03000000
+#define BONITO_FLASH_TOP		(BONITO_FLASH_BASE+BONITO_FLASH_SIZE-1)
+#define BONITO_SOCKET_BASE		0x1f800000
+#define BONITO_SOCKET_SIZE		0x00400000
+#define BONITO_SOCKET_TOP		(BONITO_SOCKET_BASE+BONITO_SOCKET_SIZE-1)
+#define BONITO_REG_BASE 		0x1fe00000
+#define BONITO_REG_SIZE 		0x00040000
+#define BONITO_REG_TOP			(BONITO_REG_BASE+BONITO_REG_SIZE-1)
+#define BONITO_DEV_BASE 		0x1ff00000
+#define BONITO_DEV_SIZE 		0x00100000
+#define BONITO_DEV_TOP			(BONITO_DEV_BASE+BONITO_DEV_SIZE-1)
+#define BONITO_PCILO_BASE		0x10000000
+#define BONITO_PCILO_SIZE		0x0c000000
+#define BONITO_PCILO_TOP		(BONITO_PCILO_BASE+BONITO_PCILO_SIZE-1)
+#define BONITO_PCILO0_BASE		0x10000000
+#define BONITO_PCILO1_BASE		0x14000000
+#define BONITO_PCILO2_BASE		0x18000000
+#define BONITO_PCIHI_BASE		0x20000000
+#define BONITO_PCIHI_SIZE		0x20000000
+#define BONITO_PCIHI_TOP		(BONITO_PCIHI_BASE+BONITO_PCIHI_SIZE-1)
+#define BONITO_PCIIO_BASE		0x1fd00000
+#define BONITO_PCIIO_SIZE		0x00100000
+#define BONITO_PCIIO_TOP		(BONITO_PCIIO_BASE+BONITO_PCIIO_SIZE-1)
+#define BONITO_PCICFG_BASE		0x1fe80000
+#define BONITO_PCICFG_SIZE		0x00080000
+#define BONITO_PCICFG_TOP		(BONITO_PCICFG_BASE+BONITO_PCICFG_SIZE-1)
+ 
+
+/* Bonito Register Bases */
+
+#define BONITO_PCICONFIGBASE		0x00
+#define BONITO_REGBASE			0x100
+
+
+/* PCI Configuration  Registers */
+
+#define BONITO_PCI_REG(x)               BONITO(BONITO_PCICONFIGBASE + (x))
+#define BONITO_PCIDID			BONITO_PCI_REG(0x00)
+#define BONITO_PCICMD			BONITO_PCI_REG(0x04)
+#define BONITO_PCICLASS 		BONITO_PCI_REG(0x08)
+#define BONITO_PCILTIMER		BONITO_PCI_REG(0x0c)
+#define BONITO_PCIBASE0 		BONITO_PCI_REG(0x10)
+#define BONITO_PCIBASE1 		BONITO_PCI_REG(0x14)
+#define BONITO_PCIBASE2 		BONITO_PCI_REG(0x18)
+#define BONITO_PCIEXPRBASE		BONITO_PCI_REG(0x30)
+#define BONITO_PCIINT			BONITO_PCI_REG(0x3c)
+
+#define BONITO_PCICMD_PERR_CLR		0x80000000
+#define BONITO_PCICMD_SERR_CLR		0x40000000
+#define BONITO_PCICMD_MABORT_CLR	0x20000000
+#define BONITO_PCICMD_MTABORT_CLR	0x10000000
+#define BONITO_PCICMD_TABORT_CLR	0x08000000
+#define BONITO_PCICMD_MPERR_CLR 	0x01000000
+#define BONITO_PCICMD_PERRRESPEN	0x00000040
+#define BONITO_PCICMD_ASTEPEN		0x00000080
+#define BONITO_PCICMD_SERREN		0x00000100
+#define BONITO_PCILTIMER_BUSLATENCY	0x0000ff00
+#define BONITO_PCILTIMER_BUSLATENCY_SHIFT	8
+
+
+
+
+/* 1. Bonito h/w Configuration */
+/* Power on register */
+
+#define BONITO_BONPONCFG		BONITO(BONITO_REGBASE + 0x00)
+
+#define BONITO_BONPONCFG_SYSCONTROLLERRD	0x00040000
+#define BONITO_BONPONCFG_ROMCS1SAMP	0x00020000
+#define BONITO_BONPONCFG_ROMCS0SAMP	0x00010000
+#define BONITO_BONPONCFG_CPUBIGEND	0x00004000
+/* Added by RPF 11-9-00 */
+#define BONITO_BONPONCFG_BURSTORDER	0x00001000
+/* --- */
+#define BONITO_BONPONCFG_CPUPARITY	0x00002000
+#define BONITO_BONPONCFG_CPUTYPE	0x00000007
+#define BONITO_BONPONCFG_CPUTYPE_SHIFT	0
+#define BONITO_BONPONCFG_PCIRESET_OUT	0x00000008
+#define BONITO_BONPONCFG_IS_ARBITER	0x00000010
+#define BONITO_BONPONCFG_ROMBOOT	0x000000c0
+#define BONITO_BONPONCFG_ROMBOOT_SHIFT	6
+
+#define BONITO_BONPONCFG_ROMBOOT_FLASH	(0x0<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+#define BONITO_BONPONCFG_ROMBOOT_SOCKET (0x1<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+#define BONITO_BONPONCFG_ROMBOOT_SDRAM	(0x2<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+#define BONITO_BONPONCFG_ROMBOOT_CPURESET	(0x3<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+
+#define BONITO_BONPONCFG_ROMCS0WIDTH	0x00000100
+#define BONITO_BONPONCFG_ROMCS1WIDTH	0x00000200
+#define BONITO_BONPONCFG_ROMCS0FAST	0x00000400
+#define BONITO_BONPONCFG_ROMCS1FAST	0x00000800
+#define BONITO_BONPONCFG_CONFIG_DIS	0x00000020
+
+
+/* Other Bonito configuration */
+
+#define BONITO_BONGENCFG_OFFSET         0x4
+#define BONITO_BONGENCFG		BONITO(BONITO_REGBASE + BONITO_BONGENCFG_OFFSET)
+
+#define BONITO_BONGENCFG_DEBUGMODE	0x00000001
+#define BONITO_BONGENCFG_SNOOPEN	0x00000002
+#define BONITO_BONGENCFG_CPUSELFRESET	0x00000004
+
+#define BONITO_BONGENCFG_FORCE_IRQA	0x00000008
+#define BONITO_BONGENCFG_IRQA_ISOUT	0x00000010
+#define BONITO_BONGENCFG_IRQA_FROM_INT1 0x00000020
+#define BONITO_BONGENCFG_BYTESWAP	0x00000040
+
+#define BONITO_BONGENCFG_UNCACHED	0x00000080
+#define BONITO_BONGENCFG_PREFETCHEN	0x00000100
+#define BONITO_BONGENCFG_WBEHINDEN	0x00000200
+#define BONITO_BONGENCFG_CACHEALG	0x00000c00
+#define BONITO_BONGENCFG_CACHEALG_SHIFT 10
+#define BONITO_BONGENCFG_PCIQUEUE	0x00001000
+#define BONITO_BONGENCFG_CACHESTOP	0x00002000
+#define BONITO_BONGENCFG_MSTRBYTESWAP	0x00004000
+#define BONITO_BONGENCFG_BUSERREN	0x00008000
+#define BONITO_BONGENCFG_NORETRYTIMEOUT 0x00010000
+#define BONITO_BONGENCFG_SHORTCOPYTIMEOUT	0x00020000
+
+/* 2. IO & IDE configuration */
+
+#define BONITO_IODEVCFG 		BONITO(BONITO_REGBASE + 0x08)
+
+/* 3. IO & IDE configuration */
+
+#define BONITO_SDCFG			BONITO(BONITO_REGBASE + 0x0c)
+
+/* 4. PCI address map control */
+
+#define BONITO_PCIMAP			BONITO(BONITO_REGBASE + 0x10)
+#define BONITO_PCIMEMBASECFG		BONITO(BONITO_REGBASE + 0x14)
+#define BONITO_PCIMAP_CFG		BONITO(BONITO_REGBASE + 0x18)
+
+/* 5. ICU & GPIO regs */
+ 
+/* GPIO Regs - r/w */
+
+#define BONITO_GPIODATA_OFFSET          0x1c
+#define BONITO_GPIODATA 		BONITO(BONITO_REGBASE + BONITO_GPIODATA_OFFSET)
+#define BONITO_GPIOIE			BONITO(BONITO_REGBASE + 0x20)
+
+/* ICU Configuration Regs - r/w */
+
+#define BONITO_INTEDGE			BONITO(BONITO_REGBASE + 0x24)
+#define BONITO_INTSTEER 		BONITO(BONITO_REGBASE + 0x28)
+#define BONITO_INTPOL			BONITO(BONITO_REGBASE + 0x2c)
+
+/* ICU Enable Regs - IntEn & IntISR are r/o. */
+
+#define BONITO_INTENSET 		BONITO(BONITO_REGBASE + 0x30)
+#define BONITO_INTENCLR 		BONITO(BONITO_REGBASE + 0x34)
+#define BONITO_INTEN			BONITO(BONITO_REGBASE + 0x38)
+#define BONITO_INTISR			BONITO(BONITO_REGBASE + 0x3c)
+
+/* PCI mail boxes */
+
+#define BONITO_PCIMAIL0_OFFSET          0x40
+#define BONITO_PCIMAIL1_OFFSET          0x44
+#define BONITO_PCIMAIL2_OFFSET          0x48
+#define BONITO_PCIMAIL3_OFFSET          0x4c
+#define BONITO_PCIMAIL0 		BONITO(BONITO_REGBASE + 0x40)
+#define BONITO_PCIMAIL1 		BONITO(BONITO_REGBASE + 0x44)
+#define BONITO_PCIMAIL2 		BONITO(BONITO_REGBASE + 0x48)
+#define BONITO_PCIMAIL3 		BONITO(BONITO_REGBASE + 0x4c)
+
+
+/* 6. PCI cache */
+
+#define BONITO_PCICACHECTRL		BONITO(BONITO_REGBASE + 0x50)
+#define BONITO_PCICACHETAG		BONITO(BONITO_REGBASE + 0x54)
+
+#define BONITO_PCIBADADDR		BONITO(BONITO_REGBASE + 0x58)
+#define BONITO_PCIMSTAT 		BONITO(BONITO_REGBASE + 0x5c)
+
+
+/*
+#define BONITO_PCIRDPOST		BONITO(BONITO_REGBASE + 0x60)
+#define BONITO_PCIDATA			BONITO(BONITO_REGBASE + 0x64)
+*/
+
+/* 7. IDE DMA & Copier */
+ 
+#define BONITO_CONFIGBASE		0x000
+#define BONITO_BONITOBASE		0x100
+#define BONITO_LDMABASE 		0x200
+#define BONITO_COPBASE			0x300
+#define BONITO_REG_BLOCKMASK		0x300
+
+#define BONITO_LDMACTRL 		BONITO(BONITO_LDMABASE + 0x0)
+#define BONITO_LDMASTAT 		BONITO(BONITO_LDMABASE + 0x0)
+#define BONITO_LDMAADDR 		BONITO(BONITO_LDMABASE + 0x4)
+#define BONITO_LDMAGO			BONITO(BONITO_LDMABASE + 0x8)
+#define BONITO_LDMADATA 		BONITO(BONITO_LDMABASE + 0xc)
+
+#define BONITO_COPCTRL			BONITO(BONITO_COPBASE + 0x0)
+#define BONITO_COPSTAT			BONITO(BONITO_COPBASE + 0x0)
+#define BONITO_COPPADDR 		BONITO(BONITO_COPBASE + 0x4)
+#define BONITO_COPDADDR 		BONITO(BONITO_COPBASE + 0x8)
+#define BONITO_COPGO			BONITO(BONITO_COPBASE + 0xc)
+
+
+/* ###### Bit Definitions for individual Registers #### */
+
+/* Gen DMA. */
+
+#define BONITO_IDECOPDADDR_DMA_DADDR	0x0ffffffc
+#define BONITO_IDECOPDADDR_DMA_DADDR_SHIFT	2
+#define BONITO_IDECOPPADDR_DMA_PADDR	0xfffffffc
+#define BONITO_IDECOPPADDR_DMA_PADDR_SHIFT	2
+#define BONITO_IDECOPGO_DMA_SIZE	0x0000fffe
+#define BONITO_IDECOPGO_DMA_SIZE_SHIFT	0
+#define BONITO_IDECOPGO_DMA_WRITE	0x00010000
+#define BONITO_IDECOPGO_DMAWCOUNT	0x000f0000
+#define BONITO_IDECOPGO_DMAWCOUNT_SHIFT	16
+
+#define BONITO_IDECOPCTRL_DMA_STARTBIT	0x80000000
+#define BONITO_IDECOPCTRL_DMA_RSTBIT	0x40000000
+
+/* DRAM - sdCfg */
+
+#define BONITO_SDCFG_AROWBITS		0x00000003
+#define BONITO_SDCFG_AROWBITS_SHIFT	0
+#define BONITO_SDCFG_ACOLBITS		0x0000000c
+#define BONITO_SDCFG_ACOLBITS_SHIFT	2
+#define BONITO_SDCFG_ABANKBIT		0x00000010
+#define BONITO_SDCFG_ASIDES		0x00000020
+#define BONITO_SDCFG_AABSENT		0x00000040
+#define BONITO_SDCFG_AWIDTH64		0x00000080
+
+#define BONITO_SDCFG_BROWBITS		0x00000300
+#define BONITO_SDCFG_BROWBITS_SHIFT	8
+#define BONITO_SDCFG_BCOLBITS		0x00000c00
+#define BONITO_SDCFG_BCOLBITS_SHIFT	10
+#define BONITO_SDCFG_BBANKBIT		0x00001000
+#define BONITO_SDCFG_BSIDES		0x00002000
+#define BONITO_SDCFG_BABSENT		0x00004000
+#define BONITO_SDCFG_BWIDTH64		0x00008000
+
+#define BONITO_SDCFG_EXTRDDATA		0x00010000
+#define BONITO_SDCFG_EXTRASCAS		0x00020000
+#define BONITO_SDCFG_EXTPRECH		0x00040000
+#define BONITO_SDCFG_EXTRASWIDTH	0x00180000
+#define BONITO_SDCFG_EXTRASWIDTH_SHIFT	19
+/* Changed by RPF 11-9-00 */
+#define BONITO_SDCFG_DRAMMODESET	0x00200000
+/* --- */
+#define BONITO_SDCFG_DRAMEXTREGS	0x00400000
+#define BONITO_SDCFG_DRAMPARITY 	0x00800000
+/* Added by RPF 11-9-00 */
+#define BONITO_SDCFG_DRAMBURSTLEN 	0x03000000
+#define BONITO_SDCFG_DRAMBURSTLEN_SHIFT	24
+#define BONITO_SDCFG_DRAMMODESET_DONE 	0x80000000
+/* --- */
+
+/* PCI Cache - pciCacheCtrl */
+
+#define BONITO_PCICACHECTRL_CACHECMD	0x00000007
+#define BONITO_PCICACHECTRL_CACHECMD_SHIFT	0
+#define BONITO_PCICACHECTRL_CACHECMDLINE	0x00000018
+#define BONITO_PCICACHECTRL_CACHECMDLINE_SHIFT	3
+#define BONITO_PCICACHECTRL_CMDEXEC	0x00000020
+
+#define BONITO_IODEVCFG_BUFFBIT_CS0	0x00000001
+#define BONITO_IODEVCFG_SPEEDBIT_CS0	0x00000002
+#define BONITO_IODEVCFG_MOREABITS_CS0	0x00000004
+
+#define BONITO_IODEVCFG_BUFFBIT_CS1	0x00000008
+#define BONITO_IODEVCFG_SPEEDBIT_CS1	0x00000010
+#define BONITO_IODEVCFG_MOREABITS_CS1	0x00000020
+
+#define BONITO_IODEVCFG_BUFFBIT_CS2	0x00000040
+#define BONITO_IODEVCFG_SPEEDBIT_CS2	0x00000080
+#define BONITO_IODEVCFG_MOREABITS_CS2	0x00000100
+
+#define BONITO_IODEVCFG_BUFFBIT_CS3	0x00000200
+#define BONITO_IODEVCFG_SPEEDBIT_CS3	0x00000400
+#define BONITO_IODEVCFG_MOREABITS_CS3	0x00000800
+
+#define BONITO_IODEVCFG_BUFFBIT_IDE	0x00001000
+#define BONITO_IODEVCFG_SPEEDBIT_IDE	0x00002000
+#define BONITO_IODEVCFG_WORDSWAPBIT_IDE 0x00004000
+#define BONITO_IODEVCFG_MODEBIT_IDE	0x00008000
+#define BONITO_IODEVCFG_DMAON_IDE	0x001f0000
+#define BONITO_IODEVCFG_DMAON_IDE_SHIFT 16
+#define BONITO_IODEVCFG_DMAOFF_IDE	0x01e00000
+#define BONITO_IODEVCFG_DMAOFF_IDE_SHIFT	21
+#define BONITO_IODEVCFG_EPROMSPLIT	0x02000000
+/* Added by RPF 11-9-00 */
+#define BONITO_IODEVCFG_CPUCLOCKPERIOD	0xfc000000
+#define BONITO_IODEVCFG_CPUCLOCKPERIOD_SHIFT 26
+/* --- */
+
+/* gpio */
+#define BONITO_GPIO_GPIOW		0x000003ff
+#define BONITO_GPIO_GPIOW_SHIFT 	0
+#define BONITO_GPIO_GPIOR		0x01ff0000
+#define BONITO_GPIO_GPIOR_SHIFT 	16
+#define BONITO_GPIO_GPINR		0xfe000000
+#define BONITO_GPIO_GPINR_SHIFT 	25
+#define BONITO_GPIO_IOW(N)		(1<<(BONITO_GPIO_GPIOW_SHIFT+(N)))
+#define BONITO_GPIO_IOR(N)		(1<<(BONITO_GPIO_GPIOR_SHIFT+(N)))
+#define BONITO_GPIO_INR(N)		(1<<(BONITO_GPIO_GPINR_SHIFT+(N)))
+
+/* ICU */
+#define BONITO_ICU_MBOXES		0x0000000f
+#define BONITO_ICU_MBOXES_SHIFT 	0
+#define BONITO_ICU_DMARDY		0x00000010
+#define BONITO_ICU_DMAEMPTY		0x00000020
+#define BONITO_ICU_COPYRDY		0x00000040
+#define BONITO_ICU_COPYEMPTY		0x00000080
+#define BONITO_ICU_COPYERR		0x00000100
+#define BONITO_ICU_PCIIRQ		0x00000200
+#define BONITO_ICU_MASTERERR		0x00000400
+#define BONITO_ICU_SYSTEMERR		0x00000800
+#define BONITO_ICU_DRAMPERR		0x00001000
+#define BONITO_ICU_RETRYERR		0x00002000
+#define BONITO_ICU_GPIOS		0x01ff0000
+#define BONITO_ICU_GPIOS_SHIFT		16
+#define BONITO_ICU_GPINS		0x7e000000
+#define BONITO_ICU_GPINS_SHIFT		25
+#define BONITO_ICU_MBOX(N)		(1<<(BONITO_ICU_MBOXES_SHIFT+(N)))
+#define BONITO_ICU_GPIO(N)		(1<<(BONITO_ICU_GPIOS_SHIFT+(N)))
+#define BONITO_ICU_GPIN(N)		(1<<(BONITO_ICU_GPINS_SHIFT+(N)))
+
+/* pcimap */
+
+#define BONITO_PCIMAP_PCIMAP_LO0	0x0000003f
+#define BONITO_PCIMAP_PCIMAP_LO0_SHIFT	0
+#define BONITO_PCIMAP_PCIMAP_LO1	0x00000fc0
+#define BONITO_PCIMAP_PCIMAP_LO1_SHIFT	6
+#define BONITO_PCIMAP_PCIMAP_LO2	0x0003f000
+#define BONITO_PCIMAP_PCIMAP_LO2_SHIFT	12
+#define BONITO_PCIMAP_PCIMAP_2		0x00040000
+#define BONITO_PCIMAP_WIN(WIN,ADDR)	((((ADDR)>>26) & BONITO_PCIMAP_PCIMAP_LO0) << ((WIN)*6))
+
+#define BONITO_PCIMAP_WINSIZE           (1<<26)
+#define BONITO_PCIMAP_WINOFFSET(ADDR)	((ADDR) & (BONITO_PCIMAP_WINSIZE - 1))
+#define BONITO_PCIMAP_WINBASE(ADDR)	((ADDR) << 26)
+
+/* pcimembaseCfg */
+
+#define BONITO_PCIMEMBASECFG_MASK               0xf0000000
+#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK	0x0000001f
+#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK_SHIFT	0
+#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS	0x000003e0
+#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS_SHIFT	5
+#define BONITO_PCIMEMBASECFG_MEMBASE0_CACHED	0x00000400
+#define BONITO_PCIMEMBASECFG_MEMBASE0_IO	0x00000800
+
+#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK	0x0001f000
+#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK_SHIFT	12
+#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS	0x003e0000
+#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS_SHIFT	17
+#define BONITO_PCIMEMBASECFG_MEMBASE1_CACHED	0x00400000
+#define BONITO_PCIMEMBASECFG_MEMBASE1_IO	0x00800000
+
+#define BONITO_PCIMEMBASECFG_ASHIFT	23
+#define BONITO_PCIMEMBASECFG_AMASK              0x007fffff
+#define BONITO_PCIMEMBASECFGSIZE(WIN,SIZE)	(((~((SIZE)-1))>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)
+#define BONITO_PCIMEMBASECFGBASE(WIN,BASE)	(((BASE)>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS)
+
+#define BONITO_PCIMEMBASECFG_SIZE(WIN,CFG)  (((((~(CFG)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)) << (BONITO_PCIMEMBASECFG_ASHIFT - BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) | BONITO_PCIMEMBASECFG_AMASK)
+
+
+#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG)  ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
+#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG)  ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
+#define BONITO_PCIMEMBASECFG_ADDRTRANS(WIN,CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
+
+#define BONITO_PCITOPHYS(WIN,ADDR,CFG)          ( \
+                                                  (((ADDR) & (~(BONITO_PCIMEMBASECFG_MASK))) & (~(BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG)))) | \
+                                                  (BONITO_PCIMEMBASECFG_ADDRTRANS(WIN,CFG)) \
+                                                )
+
+/* PCICmd */
+
+#define BONITO_PCICMD_MEMEN		0x00000002
+#define BONITO_PCICMD_MSTREN		0x00000004
+
+
+#endif /* _ASM_MIPS_BOARDS_BONITO64_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/mips-boards/generic.h linux-2.4.19-rc2/include/asm-mips/mips-boards/generic.h
--- linux-2.4.19-rc1/include/asm-mips/mips-boards/generic.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips/mips-boards/generic.h	Tue Jul 16 16:25:21 2002
@@ -25,14 +25,20 @@
 #ifndef _MIPS_GENERIC_H
 #define _MIPS_GENERIC_H
 
+#include <linux/config.h>
 #include <asm/addrspace.h>
 #include <asm/byteorder.h>
+#include <asm/mips-boards/bonito64.h>
 
 /*
  * Display register base.
  */
+#if defined(CONFIG_MIPS_SEAD)
+#define ASCII_DISPLAY_POS_BASE     (KSEG1ADDR(0x1f0005c0))
+#else
 #define ASCII_DISPLAY_WORD_BASE    (KSEG1ADDR(0x1f000410))
 #define ASCII_DISPLAY_POS_BASE     (KSEG1ADDR(0x1f000418))
+#endif
 
 
 /*
@@ -44,8 +50,28 @@
 /*
  * Reset register.
  */
+#if defined(CONFIG_MIPS_SEAD)
+#define SOFTRES_REG       (KSEG1ADDR(0x1e800050))
+#define GORESET           0x4d
+#else
 #define SOFTRES_REG       (KSEG1ADDR(0x1f000500))
 #define GORESET           0x42
+#endif
+
+/*
+ * Revision register.
+ */
+#define MIPS_REVISION_REG                  (KSEG1ADDR(0x1fc00010))
+#define MIPS_REVISION_CORID_QED_RM5261     0
+#define MIPS_REVISION_CORID_CORE_LV        1
+#define MIPS_REVISION_CORID_BONITO64       2
+#define MIPS_REVISION_CORID_CORE_20K       3
+#define MIPS_REVISION_CORID_CORE_FPGA      4
+#define MIPS_REVISION_CORID_CORE_MSC       5
+
+#define MIPS_REVISION_CORID (((*(volatile u32 *)(MIPS_REVISION_REG)) >> 10) & 0x3f)
+
+extern unsigned int mips_revision_corid;
 
 
 /*
@@ -67,4 +93,19 @@
 #define GT_PCI_READ(ofs, data)   \
 	data = *(volatile u32 *)(MIPS_GT_BASE+ofs)
 
+/*
+ * Algorithmics Bonito64 system controller register base.
+ */
+static char * const _bonito = (char *)KSEG1ADDR(BONITO_REG_BASE);
+
+/*
+ * MIPS System controller PCI register base.
+ */
+#define MSC01_PCI_REG_BASE  (KSEG1ADDR(0x1bd00000))
+
+#define MSC_WRITE(reg, data)  \
+	*(volatile u32 *)(reg) = data
+#define MSC_READ(reg, data)   \
+	data = *(volatile u32 *)(reg)
+
 #endif  /* !(_MIPS_GENERIC_H) */
diff -urN linux-2.4.19-rc1/include/asm-mips/mips-boards/malta.h linux-2.4.19-rc2/include/asm-mips/mips-boards/malta.h
--- linux-2.4.19-rc1/include/asm-mips/mips-boards/malta.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips/mips-boards/malta.h	Tue Jul 16 16:25:21 2002
@@ -29,9 +29,12 @@
 #include <asm/io.h>
 
 /* 
- * Malta I/O ports base address. 
-*/
-#define MALTA_PORT_BASE      (KSEG1ADDR(0x18000000))
+ * Malta I/O ports base address for the Galileo GT64120 and Algorithmics
+ * Bonito system controllers. 
+ */
+#define MALTA_GT_PORT_BASE      (KSEG1ADDR(0x18000000))
+#define MALTA_BONITO_PORT_BASE  (KSEG1ADDR(0x1fd00000))
+#define MALTA_MSC_PORT_BASE     (KSEG1ADDR(0x18000000))
 
 /* 
  * Malta RTC-device indirect register access.
diff -urN linux-2.4.19-rc1/include/asm-mips/mips-boards/msc01_pci.h linux-2.4.19-rc2/include/asm-mips/mips-boards/msc01_pci.h
--- linux-2.4.19-rc1/include/asm-mips/mips-boards/msc01_pci.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/mips-boards/msc01_pci.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,244 @@
+/*
+ * mcs01_pci.h
+ *
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2002 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ * PCI Register definitions for the MIPS System Controller.
+ */
+#ifndef MSC01_PCI_H
+#define MSC01_PCI_H
+
+/*****************************************************************************
+ * Register offset addresses
+ ****************************************************************************/
+
+#define MSC01_PCI_ID_OFS		0x0000
+#define MSC01_PCI_SC2PMBASL_OFS		0x0208
+#define MSC01_PCI_SC2PMMSKL_OFS		0x0218
+#define MSC01_PCI_SC2PMMAPL_OFS		0x0228
+#define MSC01_PCI_SC2PIOBASL_OFS	0x0248
+#define MSC01_PCI_SC2PIOMSKL_OFS	0x0258
+#define MSC01_PCI_SC2PIOMAPL_OFS	0x0268
+#define MSC01_PCI_P2SCMSKL_OFS		0x0308
+#define MSC01_PCI_P2SCMAPL_OFS		0x0318
+#define MSC01_PCI_INTCFG_OFS		0x0600
+#define MSC01_PCI_INTSTAT_OFS		0x0608
+#define MSC01_PCI_CFGADDR_OFS		0x0610
+#define MSC01_PCI_CFGDATA_OFS		0x0618
+#define MSC01_PCI_IACK_OFS		0x0620
+#define MSC01_PCI_HEAD0_OFS		0x2000  /* DevID, VendorID */
+#define MSC01_PCI_HEAD1_OFS		0x2008  /* Status, Command */
+#define MSC01_PCI_HEAD2_OFS		0x2010  /* Class code, RevID */
+#define MSC01_PCI_HEAD3_OFS		0x2018  /* bist, header, latency */
+#define MSC01_PCI_HEAD4_OFS		0x2020  /* BAR 0 */
+#define MSC01_PCI_HEAD5_OFS		0x2028  /* BAR 1 */
+#define MSC01_PCI_HEAD6_OFS		0x2030  /* BAR 2 */
+#define MSC01_PCI_HEAD7_OFS		0x2038  /* BAR 3 */
+#define MSC01_PCI_HEAD8_OFS		0x2040  /* BAR 4 */
+#define MSC01_PCI_HEAD9_OFS		0x2048  /* BAR 5 */
+#define MSC01_PCI_HEAD10_OFS		0x2050  /* CardBus CIS Ptr */
+#define MSC01_PCI_HEAD11_OFS		0x2058  /* SubSystem ID, -VendorID */
+#define MSC01_PCI_HEAD12_OFS		0x2060  /* ROM BAR */
+#define MSC01_PCI_HEAD13_OFS		0x2068  /* Capabilities ptr */
+#define MSC01_PCI_HEAD14_OFS		0x2070  /* reserved */
+#define MSC01_PCI_HEAD15_OFS		0x2078  /* Maxl, ming, intpin, int */
+#define MSC01_PCI_BAR0_OFS		0x2220
+#define MSC01_PCI_CFG_OFS		0x2380
+#define MSC01_PCI_SWAP_OFS		0x2388
+
+
+/*****************************************************************************
+ * Register encodings
+ ****************************************************************************/
+
+#define MSC01_PCI_ID_ID_SHF		16
+#define MSC01_PCI_ID_ID_MSK		0x00ff0000
+#define MSC01_PCI_ID_ID_HOSTBRIDGE	82
+#define MSC01_PCI_ID_MAR_SHF		8
+#define MSC01_PCI_ID_MAR_MSK		0x0000ff00
+#define MSC01_PCI_ID_MIR_SHF		0
+#define MSC01_PCI_ID_MIR_MSK		0x000000ff
+
+#define MSC01_PCI_SC2PMBASL_BAS_SHF	24
+#define MSC01_PCI_SC2PMBASL_BAS_MSK	0xff000000
+
+#define MSC01_PCI_SC2PMMSKL_MSK_SHF	24
+#define MSC01_PCI_SC2PMMSKL_MSK_MSK	0xff000000
+
+#define MSC01_PCI_SC2PMMAPL_MAP_SHF	24
+#define MSC01_PCI_SC2PMMAPL_MAP_MSK	0xff000000
+
+#define MSC01_PCI_SC2PIOBASL_BAS_SHF	24
+#define MSC01_PCI_SC2PIOBASL_BAS_MSK	0xff000000
+
+#define MSC01_PCI_SC2PIOMSKL_MSK_SHF	24
+#define MSC01_PCI_SC2PIOMSKL_MSK_MSK	0xff000000
+
+#define MSC01_PCI_SC2PIOMAPL_MAP_SHF	24
+#define MSC01_PCI_SC2PIOMAPL_MAP_MSK	0xff000000
+
+#define MSC01_PCI_P2SCMSKL_MSK_SHF	24
+#define MSC01_PCI_P2SCMSKL_MSK_MSK	0xff000000
+
+#define MSC01_PCI_P2SCMAPL_MAP_SHF	24
+#define MSC01_PCI_P2SCMAPL_MAP_MSK	0xff000000
+
+#define MSC01_PCI_INTCFG_RST_SHF        10
+#define MSC01_PCI_INTCFG_RST_MSK        0x00000400
+#define MSC01_PCI_INTCFG_RST_BIT        0x00000400
+#define MSC01_PCI_INTCFG_MWE_SHF        9
+#define MSC01_PCI_INTCFG_MWE_MSK        0x00000200
+#define MSC01_PCI_INTCFG_MWE_BIT        0x00000200
+#define MSC01_PCI_INTCFG_DTO_SHF        8
+#define MSC01_PCI_INTCFG_DTO_MSK        0x00000100
+#define MSC01_PCI_INTCFG_DTO_BIT        0x00000100 
+#define MSC01_PCI_INTCFG_MA_SHF         7
+#define MSC01_PCI_INTCFG_MA_MSK         0x00000080
+#define MSC01_PCI_INTCFG_MA_BIT         0x00000080
+#define MSC01_PCI_INTCFG_TA_SHF         6
+#define MSC01_PCI_INTCFG_TA_MSK         0x00000040
+#define MSC01_PCI_INTCFG_TA_BIT         0x00000040
+#define MSC01_PCI_INTCFG_RTY_SHF        5
+#define MSC01_PCI_INTCFG_RTY_MSK        0x00000020
+#define MSC01_PCI_INTCFG_RTY_BIT        0x00000020
+#define MSC01_PCI_INTCFG_MWP_SHF        4
+#define MSC01_PCI_INTCFG_MWP_MSK        0x00000010
+#define MSC01_PCI_INTCFG_MWP_BIT        0x00000010
+#define MSC01_PCI_INTCFG_MRP_SHF        3
+#define MSC01_PCI_INTCFG_MRP_MSK        0x00000008
+#define MSC01_PCI_INTCFG_MRP_BIT        0x00000008
+#define MSC01_PCI_INTCFG_SWP_SHF        2
+#define MSC01_PCI_INTCFG_SWP_MSK        0x00000004
+#define MSC01_PCI_INTCFG_SWP_BIT        0x00000004
+#define MSC01_PCI_INTCFG_SRP_SHF        1
+#define MSC01_PCI_INTCFG_SRP_MSK        0x00000002
+#define MSC01_PCI_INTCFG_SRP_BIT        0x00000002
+#define MSC01_PCI_INTCFG_SE_SHF         0
+#define MSC01_PCI_INTCFG_SE_MSK         0x00000001
+#define MSC01_PCI_INTCFG_SE_BIT         0x00000001
+
+#define MSC01_PCI_INTSTAT_RST_SHF       10
+#define MSC01_PCI_INTSTAT_RST_MSK       0x00000400
+#define MSC01_PCI_INTSTAT_RST_BIT       0x00000400
+#define MSC01_PCI_INTSTAT_MWE_SHF       9
+#define MSC01_PCI_INTSTAT_MWE_MSK       0x00000200
+#define MSC01_PCI_INTSTAT_MWE_BIT       0x00000200
+#define MSC01_PCI_INTSTAT_DTO_SHF       8
+#define MSC01_PCI_INTSTAT_DTO_MSK       0x00000100
+#define MSC01_PCI_INTSTAT_DTO_BIT       0x00000100 
+#define MSC01_PCI_INTSTAT_MA_SHF        7
+#define MSC01_PCI_INTSTAT_MA_MSK        0x00000080
+#define MSC01_PCI_INTSTAT_MA_BIT        0x00000080
+#define MSC01_PCI_INTSTAT_TA_SHF        6
+#define MSC01_PCI_INTSTAT_TA_MSK        0x00000040
+#define MSC01_PCI_INTSTAT_TA_BIT        0x00000040
+#define MSC01_PCI_INTSTAT_RTY_SHF       5
+#define MSC01_PCI_INTSTAT_RTY_MSK       0x00000020
+#define MSC01_PCI_INTSTAT_RTY_BIT       0x00000020
+#define MSC01_PCI_INTSTAT_MWP_SHF       4
+#define MSC01_PCI_INTSTAT_MWP_MSK       0x00000010
+#define MSC01_PCI_INTSTAT_MWP_BIT       0x00000010
+#define MSC01_PCI_INTSTAT_MRP_SHF       3
+#define MSC01_PCI_INTSTAT_MRP_MSK       0x00000008
+#define MSC01_PCI_INTSTAT_MRP_BIT       0x00000008
+#define MSC01_PCI_INTSTAT_SWP_SHF       2
+#define MSC01_PCI_INTSTAT_SWP_MSK       0x00000004
+#define MSC01_PCI_INTSTAT_SWP_BIT       0x00000004
+#define MSC01_PCI_INTSTAT_SRP_SHF       1
+#define MSC01_PCI_INTSTAT_SRP_MSK       0x00000002
+#define MSC01_PCI_INTSTAT_SRP_BIT       0x00000002
+#define MSC01_PCI_INTSTAT_SE_SHF        0
+#define MSC01_PCI_INTSTAT_SE_MSK        0x00000001
+#define MSC01_PCI_INTSTAT_SE_BIT        0x00000001
+
+#define MSC01_PCI_CFGADDR_BNUM_SHF	16
+#define MSC01_PCI_CFGADDR_BNUM_MSK	0x00ff0000
+#define MSC01_PCI_CFGADDR_DNUM_SHF	11
+#define MSC01_PCI_CFGADDR_DNUM_MSK	0x0000f800
+#define MSC01_PCI_CFGADDR_FNUM_SHF	8
+#define MSC01_PCI_CFGADDR_FNUM_MSK	0x00000700
+#define MSC01_PCI_CFGADDR_RNUM_SHF	2
+#define MSC01_PCI_CFGADDR_RNUM_MSK	0x000000fc
+
+#define MSC01_PCI_CFGDATA_DATA_SHF	0
+#define MSC01_PCI_CFGDATA_DATA_MSK	0xffffffff
+
+/* The defines below are ONLY valid for a MEM bar! */
+#define MSC01_PCI_BAR0_SIZE_SHF	        4
+#define MSC01_PCI_BAR0_SIZE_MSK	        0xfffffff0
+#define MSC01_PCI_BAR0_P_SHF	        3
+#define MSC01_PCI_BAR0_P_MSK	        0x00000008
+#define MSC01_PCI_BAR0_P_BIT	        MSC01_PCI_BAR0_P_MSK
+#define MSC01_PCI_BAR0_D_SHF	        1
+#define MSC01_PCI_BAR0_D_MSK	        0x00000006
+#define MSC01_PCI_BAR0_T_SHF	        0
+#define MSC01_PCI_BAR0_T_MSK	        0x00000001
+#define MSC01_PCI_BAR0_T_BIT	        MSC01_PCI_BAR0_T_MSK
+
+
+#define MSC01_PCI_CFG_RA_SHF	        17
+#define MSC01_PCI_CFG_RA_MSK	        0x00020000
+#define MSC01_PCI_CFG_RA_BIT	        MSC01_PCI_CFG_RA_MSK
+#define MSC01_PCI_CFG_G_SHF	        16
+#define MSC01_PCI_CFG_G_MSK	        0x00010000
+#define MSC01_PCI_CFG_G_BIT	        MSC01_PCI_CFG_G_MSK
+#define MSC01_PCI_CFG_EN_SHF	        15
+#define MSC01_PCI_CFG_EN_MSK	        0x00008000
+#define MSC01_PCI_CFG_EN_BIT	        MSC01_PCI_CFG_EN_MSK
+#define MSC01_PCI_CFG_MAXRTRY_SHF       0
+#define MSC01_PCI_CFG_MAXRTRY_MSK       0x000000ff
+
+#define MSC01_PCI_SWAP_IO_SHF		18
+#define MSC01_PCI_SWAP_IO_MSK		0x000c0000
+#define MSC01_PCI_SWAP_MEM_SHF		16
+#define MSC01_PCI_SWAP_MEM_MSK		0x00030000
+#define MSC01_PCI_SWAP_BAR0_SHF		0
+#define MSC01_PCI_SWAP_BAR0_MSK		0x00000003
+#define MSC01_PCI_SWAP_NOSWAP		0
+#define MSC01_PCI_SWAP_BYTESWAP		1
+
+/*****************************************************************************
+ * Registers absolute addresses
+ ****************************************************************************/
+
+#define MSC01_PCI_ID            (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS)
+#define MSC01_PCI_SC2PMBASL     (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS)
+#define MSC01_PCI_SC2PMMSKL     (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS)
+#define MSC01_PCI_SC2PMMAPL     (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS)
+#define MSC01_PCI_SC2PIOBASL    (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS)
+#define MSC01_PCI_SC2PIOMSKL    (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS)
+#define MSC01_PCI_SC2PIOMAPL    (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS)
+#define MSC01_PCI_P2SCMSKL      (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS)
+#define MSC01_PCI_P2SCMAPL      (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS)
+#define MSC01_PCI_INTCFG        (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS)
+#define MSC01_PCI_INTSTAT       (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS)
+#define MSC01_PCI_CFGADDR       (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS)
+#define MSC01_PCI_CFGDATA       (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS)
+#define MSC01_PCI_IACK		(MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS)
+#define MSC01_PCI_HEAD0		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS)
+#define MSC01_PCI_HEAD1		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS)
+#define MSC01_PCI_HEAD2		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD2_OFS)
+#define MSC01_PCI_HEAD3		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD3_OFS)
+#define MSC01_PCI_HEAD4		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD4_OFS)
+#define MSC01_PCI_HEAD5		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD5_OFS)
+#define MSC01_PCI_HEAD6		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD6_OFS)
+#define MSC01_PCI_HEAD7		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD7_OFS)
+#define MSC01_PCI_HEAD8		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD8_OFS)
+#define MSC01_PCI_HEAD9		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD9_OFS)
+#define MSC01_PCI_HEAD10	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD10_OFS)
+#define MSC01_PCI_HEAD11	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD12	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD13	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD14	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD15        (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_BAR0		(MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS)
+#define MSC01_PCI_CFG		(MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS)
+#define MSC01_PCI_SWAP		(MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS)
+
+#endif
+/*****************************************************************************
+ *  End of msc01_pci.h
+ *****************************************************************************/
diff -urN linux-2.4.19-rc1/include/asm-mips/mipsregs.h linux-2.4.19-rc2/include/asm-mips/mipsregs.h
--- linux-2.4.19-rc1/include/asm-mips/mipsregs.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/mipsregs.h	Tue Jul 16 16:25:21 2002
@@ -12,6 +12,7 @@
 #ifndef _ASM_MIPSREGS_H
 #define _ASM_MIPSREGS_H
 
+#include <linux/config.h>
 #include <linux/linkage.h>
 
 /*
@@ -52,12 +53,15 @@
 #define CP0_XCONTEXT $20
 #define CP0_FRAMEMASK $21
 #define CP0_DIAGNOSTIC $22
+#define CP0_DEBUG $23
+#define CP0_DEPC $24
 #define CP0_PERFORMANCE $25
 #define CP0_ECC $26
 #define CP0_CACHEERR $27
 #define CP0_TAGLO $28
 #define CP0_TAGHI $29
 #define CP0_ERROREPC $30
+#define CP0_DESAVE $31
 
 /*
  * R4640/R4650 cp0 register names.  These registers are listed
@@ -146,7 +150,6 @@
 /*
  * Values for PageMask register
  */
-#include <linux/config.h>
 #ifdef CONFIG_CPU_VR41XX
 
 /* Why doesn't stupidity hurt ... */
@@ -441,9 +444,34 @@
 #define CEB_KERNEL	2	/* Count events in kernel mode EXL = ERL = 0 */
 #define CEB_EXL		1	/* Count events with EXL = 1, ERL = 0 */
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
+
+/*
+ * Functions to access the r10k performance counter and control registers
+ */
+#define read_r10k_perf_cntr(counter)                            \
+({ unsigned int __res;                                          \
+        __asm__ __volatile__(                                   \
+        "mfpc\t%0, "STR(counter)                                \
+        : "=r" (__res));                                        \
+        __res;})
 
-#include <asm/system.h>
+#define write_r10k_perf_cntr(counter,val)                       \
+        __asm__ __volatile__(                                   \
+        "mtpc\t%0, "STR(counter)                                \
+        : : "r" (val));
+
+#define read_r10k_perf_cntl(counter)                            \
+({ unsigned int __res;                                          \
+        __asm__ __volatile__(                                   \
+        "mfps\t%0, "STR(counter)                                \
+        : "=r" (__res));                                        \
+        __res;})
+
+#define write_r10k_perf_cntl(counter,val)                       \
+        __asm__ __volatile__(                                   \
+        "mtps\t%0, "STR(counter)                                \
+        : : "r" (val));
 
 /*
  * Macros to access the system control coprocessor
@@ -994,6 +1022,6 @@
 		__disable_fpu();					\
 } while (0)
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_MIPSREGS_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/page.h linux-2.4.19-rc2/include/asm-mips/page.h
--- linux-2.4.19-rc1/include/asm-mips/page.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/page.h	Tue Jul 16 16:25:21 2002
@@ -10,6 +10,8 @@
 #ifndef __ASM_PAGE_H
 #define __ASM_PAGE_H
 
+#include <linux/config.h>
+
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT	12
 #define PAGE_SIZE	(1L << PAGE_SHIFT)
@@ -17,7 +19,7 @@
 
 #ifdef __KERNEL__
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
 #define PAGE_BUG(page) do {  BUG(); } while (0)
@@ -82,6 +84,8 @@
 #define pgd_val(x)	((x).pgd)
 #define pgprot_val(x)	((x).pgprot)
 
+#define ptep_buddy(x)	((pte_t *)((unsigned long)(x) ^ sizeof(pte_t)))
+
 #define __pte(x)	((pte_t) { (x) } )
 #define __pmd(x)	((pmd_t) { (x) } )
 #define __pgd(x)	((pgd_t) { (x) } )
@@ -101,7 +105,7 @@
 	return order;
 }
 
-#endif /* _LANGUAGE_ASSEMBLY */
+#endif /* !__ASSEMBLY__ */
 
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)	(((addr) + PAGE_SIZE - 1) & PAGE_MASK)
@@ -116,14 +120,14 @@
 #define virt_to_page(kaddr)	(mem_map + (__pa(kaddr) >> PAGE_SHIFT))
 #define VALID_PAGE(page)	((page - mem_map) < max_mapnr)
 
+#define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | VM_EXEC | \
+				VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+
 /*
  * Memory above this physical address will be considered highmem.
  */
 #define HIGHMEM_START	(0x20000000)
 
-#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
-				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-
 #endif /* defined (__KERNEL__) */
 
 #endif /* __ASM_PAGE_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/pci.h linux-2.4.19-rc2/include/asm-mips/pci.h
--- linux-2.4.19-rc1/include/asm-mips/pci.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/pci.h	Tue Jul 16 16:25:21 2002
@@ -90,7 +90,7 @@
 					size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 #ifdef CONFIG_NONCOHERENT_IO
 	dma_cache_wback_inv((unsigned long)ptr, size);
@@ -111,7 +111,7 @@
 				    size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	/* Nothing to do */
 }
@@ -127,7 +127,7 @@
 	unsigned long addr;
 
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	addr = (unsigned long) page_address(page);
 	addr += offset;
@@ -142,7 +142,7 @@
 				  size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 	/* Nothing to do */
 }
 
@@ -178,7 +178,7 @@
 #endif
 
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 #ifdef CONFIG_NONCOHERENT_IO
 	/* Make sure that gcc doesn't leave the empty loop body.  */
@@ -198,7 +198,7 @@
 				int nents, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	/* Nothing to do */
 }
@@ -218,7 +218,7 @@
 				       size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 #ifdef CONFIG_NONCOHERENT_IO
 	dma_cache_wback_inv((unsigned long)bus_to_virt(dma_handle), size);
@@ -241,7 +241,7 @@
 #endif
 
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	/* Make sure that gcc doesn't leave the empty loop body.  */
 #ifdef CONFIG_NONCOHERENT_IO
diff -urN linux-2.4.19-rc1/include/asm-mips/pgtable-bits.h linux-2.4.19-rc2/include/asm-mips/pgtable-bits.h
--- linux-2.4.19-rc1/include/asm-mips/pgtable-bits.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/pgtable-bits.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,98 @@
+/*
+ * 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) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle at alii
+ * Copyright (C) 2001, 2002 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_CACHINGMODES_H
+#define _ASM_CACHINGMODES_H
+
+#include <linux/config.h>
+
+/* Note that we shift the lower 32bits of each EntryLo[01] entry
+ * 6 bits to the left. That way we can convert the PFN into the
+ * physical address by a single 'and' operation and gain 6 additional
+ * bits for storing information which isn't present in a normal
+ * MIPS page table.
+ *
+ * Similar to the Alpha port, we need to keep track of the ref
+ * and mod bits in software.  We have a software "yeah you can read
+ * from this page" bit, and a hardware one which actually lets the
+ * process read from the page.  On the same token we have a software
+ * writable bit and the real hardware one which actually lets the
+ * process write to the page, this keeps a mod bit via the hardware
+ * dirty bit.
+ *
+ * Certain revisions of the R4000 and R5000 have a bug where if a
+ * certain sequence occurs in the last 3 instructions of an executable
+ * page, and the following page is not mapped, the cpu can do
+ * unpredictable things.  The code (when it is written) to deal with
+ * this problem will be in the update_mmu_cache() code for the r4k.
+ */
+#define _PAGE_PRESENT               (1<<0)  /* implemented in software */
+#define _PAGE_READ                  (1<<1)  /* implemented in software */
+#define _PAGE_WRITE                 (1<<2)  /* implemented in software */
+#define _PAGE_ACCESSED              (1<<3)  /* implemented in software */
+#define _PAGE_MODIFIED              (1<<4)  /* implemented in software */
+
+#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
+
+#define _PAGE_GLOBAL                (1<<8)
+#define _PAGE_VALID                 (1<<9)
+#define _PAGE_SILENT_READ           (1<<9)  /* synonym                 */
+#define _PAGE_DIRTY                 (1<<10) /* The MIPS dirty bit      */
+#define _PAGE_SILENT_WRITE          (1<<10)
+#define _CACHE_UNCACHED             (1<<11)
+#define _CACHE_MASK                 (1<<11)
+#define _CACHE_CACHABLE_NONCOHERENT 0
+
+#else
+#define _PAGE_R4KBUG                (1<<5)  /* workaround for r4k bug  */
+#define _PAGE_GLOBAL                (1<<6)
+#define _PAGE_VALID                 (1<<7)
+#define _PAGE_SILENT_READ           (1<<7)  /* synonym                 */
+#define _PAGE_DIRTY                 (1<<8)  /* The MIPS dirty bit      */
+#define _PAGE_SILENT_WRITE          (1<<8)
+#define _CACHE_MASK                 (7<<9)
+
+#if defined(CONFIG_CPU_SB1)
+
+/* No penalty for being coherent on the SB1, so just
+   use it for "noncoherent" spaces, too.  Shouldn't hurt. */
+
+#define _CACHE_UNCACHED             (2<<9)  
+#define _CACHE_CACHABLE_COW         (5<<9)  
+#define _CACHE_CACHABLE_NONCOHERENT (5<<9)  
+#define _CACHE_UNCACHED_ACCELERATED (7<<9)  
+
+#else
+
+#define _CACHE_CACHABLE_NO_WA       (0<<9)  /* R4600 only              */
+#define _CACHE_CACHABLE_WA          (1<<9)  /* R4600 only              */
+#define _CACHE_UNCACHED             (2<<9)  /* R4[0246]00              */
+#define _CACHE_CACHABLE_NONCOHERENT (3<<9)  /* R4[0246]00              */
+#define _CACHE_CACHABLE_CE          (4<<9)  /* R4[04]00 only           */
+#define _CACHE_CACHABLE_COW         (5<<9)  /* R4[04]00 only           */
+#define _CACHE_CACHABLE_CUW         (6<<9)  /* R4[04]00 only           */
+#define _CACHE_UNCACHED_ACCELERATED (7<<9)  /* R10000 only             */
+
+#endif
+#endif
+
+#define __READABLE	(_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED)
+#define __WRITEABLE	(_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
+
+#define _PAGE_CHG_MASK  (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK)
+
+#ifdef CONFIG_MIPS_UNCACHED
+#define PAGE_CACHABLE_DEFAULT	_CACHE_UNCACHED
+#elif CONFIG_CPU_SB1
+#define PAGE_CACHABLE_DEFAULT	_CACHE_CACHABLE_COW
+#else
+#define PAGE_CACHABLE_DEFAULT	_CACHE_CACHABLE_NONCOHERENT
+#endif
+
+#endif /* _ASM_CACHINGMODES_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/pgtable.h linux-2.4.19-rc2/include/asm-mips/pgtable.h
--- linux-2.4.19-rc1/include/asm-mips/pgtable.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/pgtable.h	Tue Jul 16 16:25:21 2002
@@ -13,8 +13,6 @@
 #include <asm/addrspace.h>
 #include <asm/page.h>
 
-#ifndef _LANGUAGE_ASSEMBLY
-
 #include <linux/linkage.h>
 #include <asm/cachectl.h>
 #include <asm/fixmap.h>
@@ -55,9 +53,9 @@
 #define flush_page_to_ram(page)		_flush_page_to_ram(page)
 
 #define flush_icache_range(start, end)	_flush_icache_range(start,end)
-#define flush_icache_page(vma, page) 	_flush_icache_page(vma, page)
-#define flush_icache_user_range(vma, page, addr, len)	\
+#define flush_icache_user_range(vma, page, addr, len) \
 					_flush_icache_page((vma), (page))
+#define flush_icache_page(vma, page) 	_flush_icache_page(vma, page)
 
 #define flush_cache_sigtramp(addr)	_flush_cache_sigtramp(addr)
 #ifdef CONFIG_VTAG_ICACHE
@@ -90,8 +88,6 @@
  * works even with the cache aliasing problem the R4k and above have.
  */
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
-
 /* PMD_SHIFT determines the size of the area a second-level page table can map */
 #ifdef CONFIG_64BIT_PHYS_ADDR
 #define PMD_SHIFT	21
@@ -134,87 +130,7 @@
 # define VMALLOC_END	(FIXADDR_START-2*PAGE_SIZE)
 #endif
 
-/* Note that we shift the lower 32bits of each EntryLo[01] entry
- * 6 bits to the left. That way we can convert the PFN into the
- * physical address by a single 'and' operation and gain 6 additional
- * bits for storing information which isn't present in a normal
- * MIPS page table.
- *
- * Similar to the Alpha port, we need to keep track of the ref
- * and mod bits in software.  We have a software "yeah you can read
- * from this page" bit, and a hardware one which actually lets the
- * process read from the page.  On the same token we have a software
- * writable bit and the real hardware one which actually lets the
- * process write to the page, this keeps a mod bit via the hardware
- * dirty bit.
- *
- * Certain revisions of the R4000 and R5000 have a bug where if a
- * certain sequence occurs in the last 3 instructions of an executable
- * page, and the following page is not mapped, the cpu can do
- * unpredictable things.  The code (when it is written) to deal with
- * this problem will be in the update_mmu_cache() code for the r4k.
- */
-#define _PAGE_PRESENT               (1<<0)  /* implemented in software */
-#define _PAGE_READ                  (1<<1)  /* implemented in software */
-#define _PAGE_WRITE                 (1<<2)  /* implemented in software */
-#define _PAGE_ACCESSED              (1<<3)  /* implemented in software */
-#define _PAGE_MODIFIED              (1<<4)  /* implemented in software */
-
-#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
-
-#define _PAGE_GLOBAL                (1<<8)
-#define _PAGE_VALID                 (1<<9)
-#define _PAGE_SILENT_READ           (1<<9)  /* synonym                 */
-#define _PAGE_DIRTY                 (1<<10) /* The MIPS dirty bit      */
-#define _PAGE_SILENT_WRITE          (1<<10)
-#define _CACHE_UNCACHED             (1<<11) /* R4[0246]00              */
-#define _CACHE_MASK                 (1<<11)
-#define _CACHE_CACHABLE_NONCOHERENT 0
-
-#else
-#define _PAGE_R4KBUG                (1<<5)  /* workaround for r4k bug  */
-#define _PAGE_GLOBAL                (1<<6)
-#define _PAGE_VALID                 (1<<7)
-#define _PAGE_SILENT_READ           (1<<7)  /* synonym                 */
-#define _PAGE_DIRTY                 (1<<8)  /* The MIPS dirty bit      */
-#define _PAGE_SILENT_WRITE          (1<<8)
-#define _CACHE_MASK                 (7<<9)
-
-#if defined(CONFIG_CPU_SB1)
-
-/* No penalty for being coherent on the SB1, so just
-   use it for "noncoherent" spaces, too.  Shouldn't hurt. */
-
-#define _CACHE_UNCACHED             (2<<9)  
-#define _CACHE_CACHABLE_COW         (5<<9)  
-#define _CACHE_CACHABLE_NONCOHERENT (5<<9)  
-
-#else
-
-#define _CACHE_CACHABLE_NO_WA       (0<<9)  /* R4600 only              */
-#define _CACHE_CACHABLE_WA          (1<<9)  /* R4600 only              */
-#define _CACHE_UNCACHED             (2<<9)  /* R4[0246]00              */
-#define _CACHE_CACHABLE_NONCOHERENT (3<<9)  /* R4[0246]00              */
-#define _CACHE_CACHABLE_CE          (4<<9)  /* R4[04]00 only           */
-#define _CACHE_CACHABLE_COW         (5<<9)  /* R4[04]00 only           */
-#define _CACHE_CACHABLE_CUW         (6<<9)  /* R4[04]00 only           */
-#define _CACHE_CACHABLE_ACCELERATED (7<<9)  /* R10000 only             */
-
-#endif
-#endif
-
-#define __READABLE	(_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED)
-#define __WRITEABLE	(_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
-
-#define _PAGE_CHG_MASK  (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK)
-
-#ifdef CONFIG_MIPS_UNCACHED
-#define PAGE_CACHABLE_DEFAULT	_CACHE_UNCACHED
-#elif CONFIG_CPU_SB1
-#define PAGE_CACHABLE_DEFAULT	_CACHE_CACHABLE_COW
-#else
-#define PAGE_CACHABLE_DEFAULT	_CACHE_CACHABLE_NONCOHERENT
-#endif
+#include <asm/pgtable-bits.h>
 
 #define PAGE_NONE	__pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
 #define PAGE_SHARED     __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
@@ -253,8 +169,6 @@
 #define __S110	PAGE_SHARED
 #define __S111	PAGE_SHARED
 
-#if !defined (_LANGUAGE_ASSEMBLY)
-
 #ifdef CONFIG_64BIT_PHYS_ADDR
 #define pte_ERROR(e) \
 	printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e))
@@ -291,7 +205,7 @@
 	pmd_val(*pmdp) = (((unsigned long) ptep) & PAGE_MASK);
 }
 
-static inline int pte_none(pte_t pte)    { return !pte_val(pte); }
+static inline int pte_none(pte_t pte)    { return !(pte_val(pte) & ~_PAGE_GLOBAL); }
 static inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; }
 
 /* Certain architectures need to do special things when pte's
@@ -301,11 +215,28 @@
 static inline void set_pte(pte_t *ptep, pte_t pteval)
 {
 	*ptep = pteval;
+#if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
+	if (pte_val(pteval) & _PAGE_GLOBAL) {
+		pte_t *buddy = ptep_buddy(ptep);
+		/*
+		 * Make sure the buddy is global too (if it's !none,
+		 * it better already be global)
+		 */
+		if (pte_none(*buddy))
+			pte_val(*buddy) = pte_val(*buddy) | _PAGE_GLOBAL;
+	}
+#endif
 }
 
 static inline void pte_clear(pte_t *ptep)
 {
-	set_pte(ptep, __pte(0));
+#if !defined(CONFIG_CPU_R3000) && !defined(CONFIG_CPU_TX39XX)
+	/* Preserve global status for the pair */
+	if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL)
+		set_pte(ptep, __pte(_PAGE_GLOBAL));
+	else
+#endif
+		set_pte(ptep, __pte(0));
 }
 
 /*
@@ -349,6 +280,10 @@
 static inline int pgd_present(pgd_t pgd)	{ return 1; }
 static inline void pgd_clear(pgd_t *pgdp)	{ }
 
+/*
+ * Permanent address of a page.  Obviously must never be called on a highmem
+ * page.
+ */
 #ifdef CONFIG_CPU_VR41XX
 #define pte_page(x)             (mem_map+(unsigned long)((pte_val(x) >> (PAGE_SHIFT + 2))))
 #else
@@ -516,9 +451,19 @@
 extern void update_mmu_cache(struct vm_area_struct *vma,
 				unsigned long address, pte_t pte);
 
-#define SWP_TYPE(x)		(((x).val >> 1) & 0x3f)
+/* Swap entries must have VALID and GLOBAL bits cleared. */
+#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
+
+#define SWP_TYPE(x)		(((x).val >> 1) & 0x7f)
+#define SWP_OFFSET(x)		((x).val >> 10)
+#define SWP_ENTRY(type,offset)	((swp_entry_t) { ((type) << 1) | ((offset) << 10) })
+#else
+
+#define SWP_TYPE(x)		(((x).val >> 1) & 0x1f)
 #define SWP_OFFSET(x)		((x).val >> 8)
 #define SWP_ENTRY(type,offset)	((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
+#endif
+
 #define pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
 #define swp_entry_to_pte(x)	((pte_t) { (x).val })
 
@@ -529,7 +474,11 @@
 
 #include <asm-generic/pgtable.h>
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+/*
+ * We provide our own get_unmapped area to cope with the virtual aliasing
+ * constraints placed on us by the cache architecture.
+ */
+#define HAVE_ARCH_UNMAPPED_AREA
 
 #define io_remap_page_range remap_page_range
 
diff -urN linux-2.4.19-rc1/include/asm-mips/processor.h linux-2.4.19-rc2/include/asm-mips/processor.h
--- linux-2.4.19-rc1/include/asm-mips/processor.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/processor.h	Tue Jul 16 16:25:21 2002
@@ -21,7 +21,7 @@
  */
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
-#if !defined (_LANGUAGE_ASSEMBLY)
+#ifndef __ASSEMBLY__
 #include <linux/threads.h>
 #include <asm/cachectl.h>
 #include <asm/mipsregs.h>
@@ -151,7 +151,7 @@
 	unsigned long irix_oldctx;
 };
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 
 #define INIT_THREAD  { \
         /* \
@@ -181,7 +181,7 @@
 
 #define KERNEL_STACK_SIZE 8192
 
-#if !defined (_LANGUAGE_ASSEMBLY)
+#ifndef __ASSEMBLY__
 
 /* Free all resources held by a thread. */
 #define release_thread(thread) do { } while(0)
@@ -203,7 +203,7 @@
 	if (t->reg31 == (unsigned long) ret_from_fork)
 		return t->reg31;
 
-	return ((unsigned long *)t->reg29)[10];
+	return ((unsigned long *)t->reg29)[13];
 }
 
 /*
@@ -239,7 +239,7 @@
 
 #define cpu_relax()	do { } while (0)
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 #endif /* __KERNEL__ */
 
 /*
diff -urN linux-2.4.19-rc1/include/asm-mips/ptrace.h linux-2.4.19-rc2/include/asm-mips/ptrace.h
--- linux-2.4.19-rc1/include/asm-mips/ptrace.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/ptrace.h	Tue Jul 16 16:25:21 2002
@@ -23,7 +23,7 @@
 #define FPC_CSR		69
 #define FPC_EIR		70
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 /*
  * This struct defines the way the registers are stored on the stack during a
  * system call/exception. As usual the registers k0/k1 aren't being saved.
@@ -48,7 +48,33 @@
 	unsigned long cp0_cause;
 };
 
-#endif /* !(_LANGUAGE_ASSEMBLY) */
+#define __str2(x) #x
+#define __str(x) __str2(x)
+
+#define save_static_function(symbol)                                    \
+__asm__ (                                                               \
+        ".globl\t" #symbol "\n\t"                                       \
+        ".align\t2\n\t"                                                 \
+        ".type\t" #symbol ", @function\n\t"                             \
+        ".ent\t" #symbol ", 0\n"                                        \
+        #symbol":\n\t"                                                  \
+        ".frame\t$29, 0, $31\n\t"                                       \
+        "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t"  \
+        "sw\t$17,"__str(PT_R17)"($29)\n\t"                              \
+        "sw\t$18,"__str(PT_R18)"($29)\n\t"                              \
+        "sw\t$19,"__str(PT_R19)"($29)\n\t"                              \
+        "sw\t$20,"__str(PT_R20)"($29)\n\t"                              \
+        "sw\t$21,"__str(PT_R21)"($29)\n\t"                              \
+        "sw\t$22,"__str(PT_R22)"($29)\n\t"                              \
+        "sw\t$23,"__str(PT_R23)"($29)\n\t"                              \
+        "sw\t$30,"__str(PT_R30)"($29)\n\t"                              \
+        ".end\t" #symbol "\n\t"                                         \
+        ".size\t" #symbol",. - " #symbol)
+
+/* Used in declaration of save_static functions.  */
+#define static_unused static __attribute__((unused))
+
+#endif /* !__ASSEMBLY__ */
 
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 /* #define PTRACE_GETREGS		12 */
@@ -63,13 +89,13 @@
 /* options set using PTRACE_SETOPTIONS */
 #define PTRACE_O_TRACESYSGOOD	0x00000001
 
-#ifdef _LANGUAGE_ASSEMBLY
+#ifdef __ASSEMBLY__
 #include <asm/offset.h>
 #endif
 
 #ifdef __KERNEL__
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 /*
  * Does the process account for user or for system time?
  */
@@ -78,7 +104,7 @@
 #define instruction_pointer(regs) ((regs)->cp0_epc)
 
 extern void show_regs(struct pt_regs *);
-#endif /* !(_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 
 #endif
 
diff -urN linux-2.4.19-rc1/include/asm-mips/sgi/sgigio.h linux-2.4.19-rc2/include/asm-mips/sgi/sgigio.h
--- linux-2.4.19-rc1/include/asm-mips/sgi/sgigio.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/sgi/sgigio.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ *
+ * sgigio.h: Definitions for GIO bus found on SGI IP22 (and others by linux
+ *           unsupported) machines.
+ *
+ * Copyright (C) 2002 Ladislav Michl
+ */
+#ifndef _ASM_SGI_SGIGIO_H
+#define _ASM_SGI_SGIGIO_H
+
+/*
+ * There is 10MB of GIO address space for GIO64 slot devices
+ * slot#   slot type address range            size
+ * -----   --------- ----------------------- -----
+ *   0     GFX       0x1f000000 - 0x1f3fffff   4MB
+ *   1     EXP0      0x1f400000 - 0x1f5fffff   2MB
+ *   2     EXP1      0x1f600000 - 0x1f9fffff   4MB
+ *
+ * There are un-slotted devices, HPC, I/O and misc devices, which are grouped 
+ * into the HPC address space.
+ *   -     MISC      0x1fb00000 - 0x1fbfffff   1MB
+ *      
+ * Following space is reserved and unused
+ *   -     RESERVED  0x18000000 - 0x1effffff 112MB
+ *
+ * The GIO specification tends to use slot numbers while the MC specification 
+ * tends to use slot types.
+ *
+ * slot0  - the "graphics" (GFX) slot but there is no requirement that 
+ *          a graphics dev may only use this slot
+ * slot1  - this is the "expansion"-slot 0 (EXP0), do not confuse with 
+ *          slot 0 (GFX).
+ * slot2  - this is the "expansion"-slot 1 (EXP1), do not confuse with 
+ *          slot 1 (EXP0).
+ */
+
+#define GIO_SLOT_GFX	0
+#define GIO_SLOT_GIO1	1
+#define GIO_SLOT_GIO2	2
+#define GIO_NUM_SLOTS	3
+
+#define GIO_ANY_ID	0xff
+
+#define GIO_VALID_ID_ONLY	0x01
+#define GIO_IFACE_64		0x02
+#define GIO_HAS_ROM		0x04
+
+struct gio_dev {
+	unsigned char	device;
+	unsigned char	revision;
+	unsigned short	vendor;
+	unsigned char	flags;
+
+	unsigned char	slot_number;
+	unsigned long	base_addr;
+	unsigned int	map_size;
+	
+	char		*name;
+	char		slot_name[5];
+};
+
+extern struct gio_dev* gio_find_device(unsigned char device, const struct gio_dev *from);
+
+extern void sgigio_init(void);
+
+#endif /* _ASM_SGI_SGIGIO_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/sibyte/sb1250_defs.h linux-2.4.19-rc2/include/asm-mips/sibyte/sb1250_defs.h
--- linux-2.4.19-rc1/include/asm-mips/sibyte/sb1250_defs.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/sibyte/sb1250_defs.h	Tue Jul 16 16:25:21 2002
@@ -80,7 +80,7 @@
  * Note: you'll need to define uint32_t and uint64_t in your headers.
  */
 
-#if !defined(__ASSEMBLER__)
+#if !defined(__ASSEMBLY__)
 #define _SB_MAKE64(x) ((uint64_t)(x))
 #define _SB_MAKE32(x) ((uint32_t)(x))
 #else
@@ -119,9 +119,9 @@
  */
 
 
-#if !defined(__ASSEMBLER__)
+#if !defined(__ASSEMBLY__)
 #define SBWRITECSR(csr,val) *((volatile uint64_t *) PHYS_TO_K1(csr)) = (val)
 #define SBREADCSR(csr) (*((volatile uint64_t *) PHYS_TO_K1(csr)))
-#endif /* __ASSEMBLER__ */
+#endif /* __ASSEMBLY__ */
 
 #endif
diff -urN linux-2.4.19-rc1/include/asm-mips/smp.h linux-2.4.19-rc2/include/asm-mips/smp.h
--- linux-2.4.19-rc1/include/asm-mips/smp.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/smp.h	Tue Jul 16 16:25:21 2002
@@ -24,22 +24,23 @@
 #ifdef CONFIG_SMP
 
 #include <asm/spinlock.h>
+#include <linux/threads.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
 
-
-/* Mappings are straight across.  If we want
-   to add support for disabling cpus and such,
-   we'll have to do what the mips64 port does here */
-#define cpu_logical_map(cpu)	(cpu)
-#define cpu_number_map(cpu)     (cpu)
-
 #define smp_processor_id()  (current->processor)
 
-
-/* I've no idea what the real meaning of this is */
 #define PROC_CHANGE_PENALTY	20
 
+/* Map from cpu id to sequential logical cpu number.  This will only
+   not be idempotent when cpus failed to come on-line.  */
+extern int __cpu_number_map[NR_CPUS];
+#define cpu_number_map(cpu)  __cpu_number_map[cpu]
+
+/* The reverse map from sequential logical cpu number to cpu id.  */
+extern int __cpu_logical_map[NR_CPUS];
+#define cpu_logical_map(cpu)  __cpu_logical_map[cpu]
+
 #define NO_PROC_ID	(-1)
 
 struct call_data_struct {
diff -urN linux-2.4.19-rc1/include/asm-mips/spinlock.h linux-2.4.19-rc2/include/asm-mips/spinlock.h
--- linux-2.4.19-rc1/include/asm-mips/spinlock.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/spinlock.h	Tue Jul 16 16:25:21 2002
@@ -22,7 +22,7 @@
 #define spin_lock_init(x)	do { (x)->lock = 0; } while(0)
 
 #define spin_is_locked(x)	((x)->lock != 0)
-#define spin_unlock_wait(x)	do { barrier(); } while ((x)->lock);
+#define spin_unlock_wait(x)	do { barrier(); } while ((x)->lock)
 
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
diff -urN linux-2.4.19-rc1/include/asm-mips/stackframe.h linux-2.4.19-rc2/include/asm-mips/stackframe.h
--- linux-2.4.19-rc1/include/asm-mips/stackframe.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/stackframe.h	Tue Jul 16 16:25:21 2002
@@ -9,12 +9,12 @@
 #ifndef __ASM_STACKFRAME_H
 #define __ASM_STACKFRAME_H
 
+#include <linux/config.h>
 #include <asm/addrspace.h>
 #include <asm/mipsregs.h>
 #include <asm/processor.h>
 #include <asm/asm.h>
 #include <asm/offset.h>
-#include <linux/config.h>
 
 #define SAVE_AT                                          \
 		.set	push;                            \
@@ -48,33 +48,6 @@
 		sw	$23, PT_R23(sp);                 \
 		sw	$30, PT_R30(sp)
 
-#define __str2(x) #x
-#define __str(x) __str2(x)
-
-#define save_static_function(symbol)                                    \
-__asm__ (                                                               \
-        ".globl\t" #symbol "\n\t"                                       \
-        ".align\t2\n\t"                                                 \
-        ".type\t" #symbol ", @function\n\t"                             \
-        ".ent\t" #symbol ", 0\n"                                        \
-        #symbol":\n\t"                                                  \
-        ".frame\t$29, 0, $31\n\t"                                       \
-        "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t"  \
-        "sw\t$17,"__str(PT_R17)"($29)\n\t"                              \
-        "sw\t$18,"__str(PT_R18)"($29)\n\t"                              \
-        "sw\t$19,"__str(PT_R19)"($29)\n\t"                              \
-        "sw\t$20,"__str(PT_R20)"($29)\n\t"                              \
-        "sw\t$21,"__str(PT_R21)"($29)\n\t"                              \
-        "sw\t$22,"__str(PT_R22)"($29)\n\t"                              \
-        "sw\t$23,"__str(PT_R23)"($29)\n\t"                              \
-        "sw\t$30,"__str(PT_R30)"($29)\n\t"                              \
-        ".end\t" #symbol "\n\t"                                         \
-        ".size\t" #symbol",. - " #symbol)
-
-/* Used in declaration of save_static functions.  */
-#define static_unused static __attribute__((unused))
-
-
 #ifdef CONFIG_SMP
 #  define GET_SAVED_SP                                   \
                 mfc0    k0, CP0_CONTEXT;                 \
diff -urN linux-2.4.19-rc1/include/asm-mips/system.h linux-2.4.19-rc2/include/asm-mips/system.h
--- linux-2.4.19-rc1/include/asm-mips/system.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/system.h	Tue Jul 16 16:25:21 2002
@@ -120,9 +120,9 @@
 	"xori\t$1, 1\n\t"
 	"or\t\\flags, $1\n\t"
 	"mtc0\t\\flags, $12\n\t"
-	"nop\n\t"
-	"nop\n\t"
-	"nop\n\t"
+	"sll\t$0, $0, 1\t\t\t# nop\n\t"
+	"sll\t$0, $0, 1\t\t\t# nop\n\t"
+	"sll\t$0, $0, 1\t\t\t# nop\n\t"
 	".set\tat\n\t"
 	".set\treorder\n\t"
 	".endm");
@@ -209,13 +209,13 @@
 #define set_wmb(var, value) \
 do { var = value; wmb(); } while (0)
 
-#if !defined (_LANGUAGE_ASSEMBLY)
+#ifndef __ASSEMBLY__
 /*
  * switch_to(n) should switch tasks to task nr n, first
  * checking that n isn't the current task, in which case it does nothing.
  */
 extern asmlinkage void *resume(void *last, void *next);
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 
 #define prepare_to_switch()	do { } while(0)
 #define switch_to(prev,next,last) \
diff -urN linux-2.4.19-rc1/include/asm-mips/time.h linux-2.4.19-rc2/include/asm-mips/time.h
--- linux-2.4.19-rc1/include/asm-mips/time.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips/time.h	Tue Jul 16 16:25:21 2002
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001 MontaVista Software Inc.
+ * Copyright (C) 2001, 2002, MontaVista Software Inc.
  * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  *
  * include/asm-mips/time.h
@@ -61,6 +61,12 @@
 asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs);
 
 /*
+ * profiling and process accouting is done separately in local_timer_interrupt
+ */
+void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
+
+/*
  * board specific routines required by time_init().
  * board_time_init is defaulted to NULL and can remains so.
  * board_timer_setup must be setup properly in machine setup routine.
diff -urN linux-2.4.19-rc1/include/asm-mips/traps.h linux-2.4.19-rc2/include/asm-mips/traps.h
--- linux-2.4.19-rc1/include/asm-mips/traps.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/traps.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,27 @@
+/*
+ *	include/asm-mips/traps.h
+ *
+ *	Trap handling definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_MIPS_TRAPS_H
+#define __ASM_MIPS_TRAPS_H
+
+/*
+ * Possible status responses for a be_board_handler backend.
+ */
+#define MIPS_BE_DISCARD	0		/* return with no action */
+#define MIPS_BE_FIXUP	1		/* return to the fixup code */
+#define MIPS_BE_FATAL	2		/* treat as an unrecoverable error */
+
+extern int (*be_board_handler)(struct pt_regs *regs, int is_fixup);
+
+extern void bus_error_init(void);
+
+#endif /* __ASM_MIPS_TRAPS_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/types.h linux-2.4.19-rc2/include/asm-mips/types.h
--- linux-2.4.19-rc1/include/asm-mips/types.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/types.h	Tue Jul 16 16:25:21 2002
@@ -9,6 +9,8 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#include <linux/config.h>
+
 typedef unsigned short umode_t;
 
 /*
@@ -69,7 +71,11 @@
 
 #define BITS_PER_LONG _MIPS_SZLONG
 
+#ifdef CONFIG_64BIT_PHYS_ADDR
 typedef u32 dma_addr_t;
+#else
+typedef u64 dma_addr_t;
+#endif
 typedef u64 dma64_addr_t;
 
 #ifdef CONFIG_64BIT_PHYS_ADDR
diff -urN linux-2.4.19-rc1/include/asm-mips/unistd.h linux-2.4.19-rc2/include/asm-mips/unistd.h
--- linux-2.4.19-rc1/include/asm-mips/unistd.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/unistd.h	Tue Jul 16 16:25:21 2002
@@ -246,13 +246,17 @@
 #define __NR_lremovexattr		(__NR_Linux + 234)
 #define __NR_fremovexattr		(__NR_Linux + 235)
 #define __NR_tkill			(__NR_Linux + 236)
+#define __NR_sendfile64			(__NR_Linux + 237)
+#define __NR_futex			(__NR_Linux + 238)
+#define __NR_sched_setaffinity		(__NR_Linux + 239)
+#define __NR_sched_getaffinity		(__NR_Linux + 240)
 
 /*
  * Offset of the last Linux flavoured syscall
  */
-#define __NR_Linux_syscalls		236
+#define __NR_Linux_syscalls		240
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
 #define _syscall0(type,name) \
@@ -505,7 +509,7 @@
 	return waitpid(-1,wait_stat,0);
 }
 
-#endif /* !defined (__KERNEL_SYSCALLS__) */
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* __KERNEL_SYSCALLS__ */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_UNISTD_H */
diff -urN linux-2.4.19-rc1/include/asm-mips/vr4181/vr4181.h linux-2.4.19-rc2/include/asm-mips/vr4181/vr4181.h
--- linux-2.4.19-rc1/include/asm-mips/vr4181/vr4181.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips/vr4181/vr4181.h	Tue Jul 16 16:25:21 2002
@@ -16,7 +16,7 @@
 
 #include <asm/vr4181/irq.h>
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 #define __preg8		(volatile unsigned char*)
 #define __preg16	(volatile unsigned short*)
 #define __preg32	(volatile unsigned int*)
diff -urN linux-2.4.19-rc1/include/asm-mips/war.h linux-2.4.19-rc2/include/asm-mips/war.h
--- linux-2.4.19-rc1/include/asm-mips/war.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips/war.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,53 @@
+/*
+ * 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) 2002 by Ralf Baechle
+ */
+#ifndef _ASM_WAR_H
+#define _ASM_WAR_H
+
+/*
+ * Pleassures of the R4600 V1.x.  Cite from the IDT R4600 V1.7 errata:
+ *
+ *  18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D,
+ *      Hit_Invalidate_D and Create_Dirty_Excl_D should only be
+ *      executed if there is no other dcache activity. If the dcache is
+ *      accessed for another instruction immeidately preceding when these
+ *      cache instructions are executing, it is possible that the dcache 
+ *      tag match outputs used by these cache instructions will be 
+ *      incorrect. These cache instructions should be preceded by at least
+ *      four instructions that are not any kind of load or store 
+ *      instruction.
+ *
+ *      This is not allowed:    lw
+ *                              nop
+ *                              nop
+ *                              nop
+ *                              cache       Hit_Writeback_Invalidate_D
+ *
+ *      This is allowed:        lw
+ *                              nop
+ *                              nop
+ *                              nop
+ *                              nop
+ *                              cache       Hit_Writeback_Invalidate_D
+ */
+#define R4600_V1_HIT_DCACHE_WAR
+
+
+/*
+ * Writeback and invalidate the primary cache dcache before DMA.
+ *
+ * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D,
+ * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only
+ * operate correctly if the internal data cache refill buffer is empty.  These
+ * CACHE instructions should be separated from any potential data cache miss
+ * by a load instruction to an uncached address to empty the response buffer."
+ * (Revision 2.0 device errata from IDT available on http://www.idt.com/
+ * in .pdf format.)
+ */
+#define R4600_V2_HIT_CACHEOP_WAR
+
+#endif /* _ASM_WAR_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/addrspace.h linux-2.4.19-rc2/include/asm-mips64/addrspace.h
--- linux-2.4.19-rc1/include/asm-mips64/addrspace.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/addrspace.h	Tue Jul 16 16:25:21 2002
@@ -5,110 +5,143 @@
  *
  * Copyright (C) 1996, 1999 by Ralf Baechle
  * Copyright (C) 1990, 1999 by Silicon Graphics, Inc.
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
-#ifndef _ASM_ADDRSPACE_H
-#define _ASM_ADDRSPACE_H
+#ifndef __ASM_MIPS64_ADDRSPACE_H
+#define __ASM_MIPS64_ADDRSPACE_H
 
 #include <linux/config.h>
 
 /*
+ *  Configure language
+ */
+#ifdef __ASSEMBLY__
+#define _ATYPE_
+#define _ATYPE32_
+#define _ATYPE64_
+#else
+#define _ATYPE_		__PTRDIFF_TYPE__
+#define _ATYPE32_	int
+#define _ATYPE64_	long long
+#endif
+
+/*
+ *  32-bit MIPS address spaces
+ */
+#ifdef __ASSEMBLY__
+#define _ACAST32_
+#define _ACAST64_
+#else
+#define _ACAST32_		(_ATYPE_)(_ATYPE32_)	/* widen if necessary */
+#define _ACAST64_		(_ATYPE64_)		/* do _not_ narrow */
+#endif
+
+/*
  * Memory segments (32bit kernel mode addresses)
  */
-#define KUSEG                   0x0000000000000000
-#define KSEG0                   0xffffffff80000000
-#define KSEG1                   0xffffffffa0000000
-#define KSEG2                   0xffffffffc0000000
-#define KSEG3                   0xffffffffe0000000
+#define KUSEG			0x0000000000000000
+#define KSEG0			0xffffffff80000000
+#define KSEG1			0xffffffffa0000000
+#define KSEG2			0xffffffffc0000000
+#define KSEG3			0xffffffffe0000000
 
 /*
  * Returns the kernel segment base of a given address
  */
-#define KSEGX(a)                (((unsigned long)(a)) & 0xe0000000)
+#define KSEGX(a)		((_ACAST64_ (a)) & 0xffffffffe0000000)
 
 /*
  * Returns the physical address of a KSEG0/KSEG1 address
  */
-#define CPHYSADDR(a)		(((unsigned long)(a)) & 0x000000001fffffffUL)
-#define PHYSADDR(a)		(((unsigned long)(a)) & 0x000000ffffffffffUL)
+#define XPHYSADDR(a)		((_ACAST64_ (a)) & 0x000000ffffffffff)
+#define CPHYSADDR(a)		((_ACAST64_ (a)) & 0x000000001fffffff)
+
+#ifndef __ASSEMBLY__
+#define PHYSADDR(a) ({						\
+	const _ATYPE64_ _a = (a);				\
+	_a == _ACAST32_ _a ? CPHYSADDR(_a) : XPHYSADDR(_a); })
+#endif
 
 /*
  * Map an address to a certain kernel segment
  */
-#define KSEG0ADDR(a)		((__typeof__(a))(((unsigned long)(a) & 0x000000ffffffffffUL) | KSEG0))
-#define KSEG1ADDR(a)		((__typeof__(a))(((unsigned long)(a) & 0x000000ffffffffffUL) | KSEG1))
-#define KSEG2ADDR(a)		((__typeof__(a))(((unsigned long)(a) & 0x000000ffffffffffUL) | KSEG2))
-#define KSEG3ADDR(a)		((__typeof__(a))(((unsigned long)(a) & 0x000000ffffffffffUL) | KSEG3))
+#define KSEG0ADDR(a)		(CPHYSADDR(a) | KSEG0)
+#define KSEG1ADDR(a)		(CPHYSADDR(a) | KSEG1)
+#define KSEG2ADDR(a)		(CPHYSADDR(a) | KSEG2)
+#define KSEG3ADDR(a)		(CPHYSADDR(a) | KSEG3)
 
 /*
  * Memory segments (64bit kernel mode addresses)
  */
-#define XKUSEG                  0x0000000000000000
-#define XKSSEG                  0x4000000000000000
-#define XKPHYS                  0x8000000000000000
-#define XKSEG                   0xc000000000000000
-#define CKSEG0                  0xffffffff80000000
-#define CKSEG1                  0xffffffffa0000000
-#define CKSSEG                  0xffffffffc0000000
-#define CKSEG3                  0xffffffffe0000000
+#define XKUSEG			0x0000000000000000
+#define XKSSEG			0x4000000000000000
+#define XKPHYS			0x8000000000000000
+#define XKSEG			0xc000000000000000
+#define CKSEG0			0xffffffff80000000
+#define CKSEG1			0xffffffffa0000000
+#define CKSSEG			0xffffffffc0000000
+#define CKSEG3			0xffffffffe0000000
 
 #if defined (CONFIG_CPU_R4300)						\
     || defined (CONFIG_CPU_R4X00)					\
     || defined (CONFIG_CPU_R5000)					\
     || defined (CONFIG_CPU_NEVADA)
-#define	KUSIZE		0x0000010000000000		/* 2^^40 */
-#define	KUSIZE_64	0x0000010000000000		/* 2^^40 */
-#define	K0SIZE		0x0000001000000000		/* 2^^36 */
-#define	K1SIZE		0x0000001000000000		/* 2^^36 */
-#define	K2SIZE		0x000000ff80000000
-#define	KSEGSIZE	0x000000ff80000000		/* max syssegsz */
-#define TO_PHYS_MASK	0x0000000fffffffff		/* 2^^36 - 1 */
+#define	KUSIZE			0x0000010000000000	/* 2^^40 */
+#define	KUSIZE_64		0x0000010000000000	/* 2^^40 */
+#define	K0SIZE			0x0000001000000000	/* 2^^36 */
+#define	K1SIZE			0x0000001000000000	/* 2^^36 */
+#define	K2SIZE			0x000000ff80000000
+#define	KSEGSIZE		0x000000ff80000000	/* max syssegsz */
+#define TO_PHYS_MASK		0x0000000fffffffff	/* 2^^36 - 1 */
 #endif
 
 #if defined (CONFIG_CPU_R8000)
 /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */
-#define	KUSIZE		0x0000010000000000		/* 2^^40 */
-#define	KUSIZE_64	0x0000010000000000		/* 2^^40 */
-#define	K0SIZE		0x0000010000000000		/* 2^^40 */
-#define	K1SIZE		0x0000010000000000		/* 2^^40 */
-#define	K2SIZE		0x0001000000000000
-#define	KSEGSIZE	0x0000010000000000		/* max syssegsz */
-#define TO_PHYS_MASK	0x000000ffffffffff		/* 2^^40 - 1 */
+#define	KUSIZE			0x0000010000000000	/* 2^^40 */
+#define	KUSIZE_64		0x0000010000000000	/* 2^^40 */
+#define	K0SIZE			0x0000010000000000	/* 2^^40 */
+#define	K1SIZE			0x0000010000000000	/* 2^^40 */
+#define	K2SIZE			0x0001000000000000
+#define	KSEGSIZE		0x0000010000000000	/* max syssegsz */
+#define TO_PHYS_MASK		0x000000ffffffffff	/* 2^^40 - 1 */
 #endif
 
 #if defined (CONFIG_CPU_R10000)
-#define	KUSIZE		0x0000010000000000		/* 2^^40 */
-#define	KUSIZE_64	0x0000010000000000		/* 2^^40 */
-#define	K0SIZE		0x0000010000000000		/* 2^^40 */
-#define	K1SIZE		0x0000010000000000		/* 2^^40 */
-#define	K2SIZE		0x00000fff80000000
-#define	KSEGSIZE	0x00000fff80000000		/* max syssegsz */
-#define TO_PHYS_MASK	0x000000ffffffffff		/* 2^^40 - 1 */
+#define	KUSIZE			0x0000010000000000	/* 2^^40 */
+#define	KUSIZE_64		0x0000010000000000	/* 2^^40 */
+#define	K0SIZE			0x0000010000000000	/* 2^^40 */
+#define	K1SIZE			0x0000010000000000	/* 2^^40 */
+#define	K2SIZE			0x00000fff80000000
+#define	KSEGSIZE		0x00000fff80000000	/* max syssegsz */
+#define TO_PHYS_MASK		0x000000ffffffffff	/* 2^^40 - 1 */
 #endif
 
 /*
  * Further names for SGI source compatibility.  These are stolen from
  * IRIX's <sys/mips_addrspace.h>.
  */
-#define KUBASE		0
-#define KUSIZE_32	0x0000000080000000	/* KUSIZE for a 32 bit proc */
-#define K0BASE		0xa800000000000000
-#define K0BASE_EXL_WR	K0BASE			/* exclusive on write */
-#define K0BASE_NONCOH	0x9800000000000000	/* noncoherent */
-#define K0BASE_EXL	0xa000000000000000	/* exclusive */
+#define KUBASE			0
+#define KUSIZE_32		0x0000000080000000	/* KUSIZE
+							   for a 32 bit proc */
+#define K0BASE			0xa800000000000000
+#define K0BASE_EXL_WR		K0BASE			/* exclusive on write */
+#define K0BASE_NONCOH		0x9800000000000000	/* noncoherent */
+#define K0BASE_EXL		0xa000000000000000	/* exclusive */
 
 #ifdef CONFIG_SGI_IP27
-#define K1BASE		0x9600000000000000	/* Uncached attr 3, uncac */
+#define K1BASE			0x9600000000000000	/* uncached attr 3,
+							   uncac */
 #else
-#define K1BASE		0x9000000000000000
+#define K1BASE			0x9000000000000000
 #endif
-#define K2BASE		0xc000000000000000
+#define K2BASE			0xc000000000000000
 
 #if !defined (CONFIG_CPU_R8000)
 #define COMPAT_K1BASE32		0xffffffffa0000000
 #define PHYS_TO_COMPATK1(x)	((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */
 #endif
 
-#define KDM_TO_PHYS(x)	((unsigned long)(x) & TO_PHYS_MASK)
-#define PHYS_TO_K0(x)	((unsigned long)(x) | K0BASE)
+#define KDM_TO_PHYS(x)		(_ACAST64_ (x) & TO_PHYS_MASK)
+#define PHYS_TO_K0(x)		(_ACAST64_ (x) | K0BASE)
 
-#endif /* _ASM_ADDRSPACE_H */
+#endif /* __ASM_MIPS64_ADDRSPACE_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/asm.h linux-2.4.19-rc2/include/asm-mips64/asm.h
--- linux-2.4.19-rc1/include/asm-mips64/asm.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/asm.h	Tue Jul 16 16:25:21 2002
@@ -6,6 +6,7 @@
  * Copyright (C) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle
  * Copyright (C) 1999 by Silicon Graphics, Inc.
  * Copyright (C) 2001 MIPS Technologies, Inc.
+ * Copyright (C) 2002  Maciej W. Rozycki
  *
  * Some useful macros for MIPS assembler code
  *
@@ -117,7 +118,7 @@
 		.word	1f;                             \
 		.popsection				\
 		.pushsection .data;			\
-1:		.asciz	string;                         \
+1:		.asciiz	string;                         \
 		.popsection
 
 /*
@@ -129,19 +130,30 @@
  */
 #if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS64)
+
 #define PREF(hint,addr)                                 \
-		pref	hint,addr
+		.set	push;				\
+		.set	mips4;				\
+		pref	hint,addr;			\
+		.set	pop
+
 #define PREFX(hint,addr)                                \
-		prefx	hint,addr
+		.set	push;				\
+		.set	mips4;				\
+		prefx	hint,addr;			\
+		.set	pop
+
 #else
+
 #define PREF(hint,addr)
 #define PREFX(hint,addr)
+
 #endif
 
 /*
  * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs.
  */
-#if _MIPS_ISA == _MIPS_ISA_MIPS1
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1)
 #define MOVN(rd,rs,rt)                                  \
 		.set	push;				\
 		.set	reorder;			\
@@ -162,24 +174,24 @@
 		.set	push;				\
 		.set	noreorder;			\
 		bnezl	rt,9f;                          \
-		move	rd,rs;                          \
+		 move	rd,rs;                          \
 		.set	pop;				\
 9:
 #define MOVZ(rd,rs,rt)                                  \
 		.set	push;				\
 		.set	noreorder;			\
 		beqzl	rt,9f;                          \
-		movz	rd,rs;                          \
+		 move	rd,rs;                          \
 		.set	pop;				\
 9:
 #endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */
 #if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
-    (_MIPS_ISA == _MIPS_ISA_MIPS64)
+    (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
 #define MOVN(rd,rs,rt)                                  \
 		movn	rd,rs,rt
 #define MOVZ(rd,rs,rt)                                  \
 		movz	rd,rs,rt
-#endif /* MIPS IV, MIPS V or MIPS64 */
+#endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */
 
 /*
  * Stack alignment
@@ -196,6 +208,10 @@
 #endif
 
 /*
+ * Macros to handle different pointer/register sizes for 32/64-bit code
+ */
+
+/*
  * Size of a register
  */
 #ifdef __mips64
@@ -210,47 +226,54 @@
  */
 #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS32)
-#define REG_S sw
-#define REG_L lw
-#define PTR_SUBU dsubu
-#define PTR_ADDU daddu
+#define REG_S		sw
+#define REG_L		lw
+#define REG_SUBU	subu
+#define REG_ADDU	addu
 #endif
 #if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
-#define REG_S sd
-#define REG_L ld
-/* We still live in a 32 bit address space ...  */
-#define PTR_SUBU dsubu
-#define PTR_ADDU daddu
+#define REG_S		sd
+#define REG_L		ld
+#define REG_SUBU	dsubu
+#define REG_ADDU	daddu
 #endif
 
 /*
  * How to add/sub/load/store/shift C int variables.
  */
 #if (_MIPS_SZINT == 32)
-#define INT_ADD	add
-#define INT_ADDI	addi
+#define INT_ADD		add
 #define INT_ADDU	addu
+#define INT_ADDI	addi
 #define INT_ADDIU	addiu
-#define INT_SUB		add
-#define INT_SUBI	subi
+#define INT_SUB		sub
 #define INT_SUBU	subu
-#define INT_SUBIU	subu
 #define INT_L		lw
 #define INT_S		sw
+#define INT_SLL		sll
+#define INT_SLLV	sllv
+#define INT_SRL		srl
+#define INT_SRLV	srlv
+#define INT_SRA		sra
+#define INT_SRAV	srav
 #endif
 
 #if (_MIPS_SZINT == 64)
-#define INT_ADD	dadd
-#define INT_ADDI	daddi
+#define INT_ADD		dadd
 #define INT_ADDU	daddu
+#define INT_ADDI	daddi
 #define INT_ADDIU	daddiu
-#define INT_SUB		dadd
-#define INT_SUBI	dsubi
+#define INT_SUB		dsub
 #define INT_SUBU	dsubu
-#define INT_SUBIU	dsubu
 #define INT_L		ld
 #define INT_S		sd
+#define INT_SLL		dsll
+#define INT_SLLV	dsllv
+#define INT_SRL		dsrl
+#define INT_SRLV	dsrlv
+#define INT_SRA		dsra
+#define INT_SRAV	dsrav
 #endif
 
 /*
@@ -258,13 +281,11 @@
  */
 #if (_MIPS_SZLONG == 32)
 #define LONG_ADD	add
-#define LONG_ADDI	addi
 #define LONG_ADDU	addu
+#define LONG_ADDI	addi
 #define LONG_ADDIU	addiu
-#define LONG_SUB	add
-#define LONG_SUBI	subi
+#define LONG_SUB	sub
 #define LONG_SUBU	subu
-#define LONG_SUBIU	subu
 #define LONG_L		lw
 #define LONG_S		sw
 #define LONG_SLL	sll
@@ -277,13 +298,11 @@
 
 #if (_MIPS_SZLONG == 64)
 #define LONG_ADD	dadd
-#define LONG_ADDI	daddi
 #define LONG_ADDU	daddu
+#define LONG_ADDI	daddi
 #define LONG_ADDIU	daddiu
-#define LONG_SUB	dadd
-#define LONG_SUBI	dsubi
+#define LONG_SUB	dsub
 #define LONG_SUBU	dsubu
-#define LONG_SUBIU	dsubu
 #define LONG_L		ld
 #define LONG_S		sd
 #define LONG_SLL	dsll
@@ -298,16 +317,15 @@
  * How to add/sub/load/store/shift pointers.
  */
 #if (_MIPS_SZPTR == 32)
-#define PTR_ADD	add
-#define PTR_ADDI	addi
+#define PTR_ADD		add
 #define PTR_ADDU	addu
+#define PTR_ADDI	addi
 #define PTR_ADDIU	addiu
-#define PTR_SUB		add
-#define PTR_SUBI	subi
+#define PTR_SUB		sub
 #define PTR_SUBU	subu
-#define PTR_SUBIU	subu
 #define PTR_L		lw
 #define PTR_S		sw
+#define PTR_LA		la
 #define PTR_SLL		sll
 #define PTR_SLLV	sllv
 #define PTR_SRL		srl
@@ -323,16 +341,15 @@
 #endif
 
 #if (_MIPS_SZPTR == 64)
-#define PTR_ADD	dadd
-#define PTR_ADDI	daddi
+#define PTR_ADD		dadd
 #define PTR_ADDU	daddu
+#define PTR_ADDI	daddi
 #define PTR_ADDIU	daddiu
-#define PTR_SUB		dadd
-#define PTR_SUBI	dsubi
+#define PTR_SUB		dsub
 #define PTR_SUBU	dsubu
-#define PTR_SUBIU	dsubu
 #define PTR_L		ld
 #define PTR_S		sd
+#define PTR_LA		dla
 #define PTR_SLL		dsll
 #define PTR_SLLV	dsllv
 #define PTR_SRL		dsrl
@@ -352,15 +369,15 @@
  */
 #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS32)
-#define MFC0	mfc0
-#define MTC0	mtc0
+#define MFC0		mfc0
+#define MTC0		mtc0
 #endif
 #if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
     (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
-#define MFC0	dmfc0
-#define MTC0	dmtc0
+#define MFC0		dmfc0
+#define MTC0		dmtc0
 #endif
 
-#define SSNOP	sll zero, zero, 1
+#define SSNOP		sll zero,zero,1
 
 #endif /* __ASM_ASM_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/atomic.h linux-2.4.19-rc2/include/asm-mips64/atomic.h
--- linux-2.4.19-rc1/include/asm-mips64/atomic.h	Mon Jul  9 21:30:19 2001
+++ linux-2.4.19-rc2/include/asm-mips64/atomic.h	Tue Jul 16 16:25:21 2002
@@ -88,6 +88,7 @@
 		"sc\t%0,%2\n\t"
 		"beqz\t%0,1b\n\t"
 		"addu\t%0,%1,%3\n\t"
+		"sync\n\t"
 		".set\treorder"
 		: "=&r" (result), "=&r" (temp), "=m" (v->counter)
 		: "Ir" (i), "m" (v->counter)
@@ -107,6 +108,7 @@
 		"sc\t%0,%2\n\t"
 		"beqz\t%0,1b\n\t"
 		"subu\t%0,%1,%3\n\t"
+		"sync\n\t"
 		".set\treorder"
 		: "=&r" (result), "=&r" (temp), "=m" (v->counter)
 		: "Ir" (i), "m" (v->counter)
@@ -184,10 +186,10 @@
  */
 
 /* Atomic operations are already serializing */
-#define smp_mb__before_atomic_dec()	barrier()
-#define smp_mb__after_atomic_dec()	barrier()
-#define smp_mb__before_atomic_inc()	barrier()
-#define smp_mb__after_atomic_inc()	barrier()
+#define smp_mb__before_atomic_dec()	smp_mb()
+#define smp_mb__after_atomic_dec()	smp_mb()
+#define smp_mb__before_atomic_inc()	smp_mb()
+#define smp_mb__after_atomic_inc()	smp_mb()
 
 #endif /* defined(__KERNEL__) */
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/bitops.h linux-2.4.19-rc2/include/asm-mips64/bitops.h
--- linux-2.4.19-rc1/include/asm-mips64/bitops.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/bitops.h	Tue Jul 16 16:25:21 2002
@@ -9,8 +9,9 @@
 #ifndef _ASM_BITOPS_H
 #define _ASM_BITOPS_H
 
+#include <linux/config.h>
 #include <linux/types.h>
-#include <linux/byteorder/swab.h>		/* sigh ... */
+#include <asm/byteorder.h>		/* sigh ... */
 
 #ifndef __KERNEL__
 #error "Don't do this, sucker ..."
@@ -84,8 +85,8 @@
 		: "ir" (~(1UL << (nr & 0x3f))), "m" (*m));
 }
 
-#define smp_mb__before_clear_bit()	barrier()
-#define smp_mb__after_clear_bit()	barrier()
+#define smp_mb__before_clear_bit()	smp_mb()
+#define smp_mb__after_clear_bit()	smp_mb()
 
 /*
  * change_bit - Toggle a bit in memory
@@ -147,6 +148,9 @@
 		"scd\t%2, %1\n\t"
 		"beqz\t%2, 1b\n\t"
 		" and\t%2, %0, %3\n\t"
+#ifdef CONFIG_SMP
+		"sync\n\t"
+#endif
 		".set\treorder"
 		: "=&r" (temp), "=m" (*m), "=&r" (res)
 		: "r" (1UL << (nr & 0x3f)), "m" (*m)
@@ -199,6 +203,9 @@
 		"scd\t%2, %1\n\t"
 		"beqz\t%2, 1b\n\t"
 		" and\t%2, %0, %3\n\t"
+#ifdef CONFIG_SMP
+		"sync\n\t"
+#endif
 		".set\treorder"
 		: "=&r" (temp), "=m" (*m), "=&r" (res)
 		: "r" (1UL << (nr & 0x3f)), "m" (*m)
@@ -250,6 +257,9 @@
 		"scd\t%2, %1\n\t"
 		"beqz\t%2, 1b\n\t"
 		" and\t%2, %0, %3\n\t"
+#ifdef CONFIG_SMP
+		"sync\n\t"
+#endif
 		".set\treorder"
 		: "=&r" (temp), "=m" (*m), "=&r" (res)
 		: "r" (1UL << (nr & 0x3f)), "m" (*m)
diff -urN linux-2.4.19-rc1/include/asm-mips64/bootinfo.h linux-2.4.19-rc2/include/asm-mips64/bootinfo.h
--- linux-2.4.19-rc1/include/asm-mips64/bootinfo.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/bootinfo.h	Tue Jul 16 16:25:21 2002
@@ -14,27 +14,27 @@
 /*
  * Values for machgroup
  */
-#define MACH_GROUP_UNKNOWN      0 /* whatever... */
-#define MACH_GROUP_JAZZ     	1 /* Jazz                                     */
-#define MACH_GROUP_DEC          2 /* Digital Equipment                        */
+#define MACH_GROUP_UNKNOWN      0 /* whatever...                            */
+#define MACH_GROUP_JAZZ     	1 /* Jazz                                   */
+#define MACH_GROUP_DEC          2 /* Digital Equipment                      */
 #define MACH_GROUP_ARC		3 /* Wreckstation Tyne, rPC44, possibly other */
-#define MACH_GROUP_SNI_RM	4 /* Siemens Nixdorf RM series                */
+#define MACH_GROUP_SNI_RM	4 /* Siemens Nixdorf RM series              */
 #define MACH_GROUP_ACN		5
-#define MACH_GROUP_SGI          6 /* Silicon Graphics                         */
-#define MACH_GROUP_COBALT       7 /* Cobalt servers		 	      */
-#define MACH_GROUP_NEC_DDB	8 /* NEC DDB                                  */
-#define MACH_GROUP_BAGET	9 /* Baget                                    */
-#define MACH_GROUP_COSINE      10 /* CoSine Orion                             */
-#define MACH_GROUP_GALILEO     11 /* Galileo Eval Boards                      */
-#define MACH_GROUP_MOMENCO     12 /* Momentum Boards                          */
-#define MACH_GROUP_ITE         13 /* ITE Semi Eval Boards                     */
+#define MACH_GROUP_SGI          6 /* Silicon Graphics                       */
+#define MACH_GROUP_COBALT       7 /* Cobalt servers		 	    */
+#define MACH_GROUP_NEC_DDB	8 /* NEC DDB                                */
+#define MACH_GROUP_BAGET	9 /* Baget                                  */
+#define MACH_GROUP_COSINE      10 /* CoSine Orion                           */
+#define MACH_GROUP_GALILEO     11 /* Galileo Eval Boards                    */
+#define MACH_GROUP_MOMENCO     12 /* Momentum Boards                        */
+#define MACH_GROUP_ITE         13 /* ITE Semi Eval Boards                   */
 #define MACH_GROUP_PHILIPS     14
-#define MACH_GROUP_GLOBESPAN   15 /* Globespan PVR Referrence Board           */
-#define MACH_GROUP_SIBYTE      16 /* Sibyte Eval Boards                       */
-#define MACH_GROUP_TOSHIBA     17 /* Toshiba Reference Systems TSBREF         */
-#define MACH_GROUP_ALCHEMY     18 /* Alchemy Semi Eval Boards*/
-#define MACH_GROUP_NEC_VR41XX  19 /* NEC Vr41xx based boards/gadgets          */
-#define MACH_GROUP_HP_LJ	20 /* Hewlett Packard LaserJet */
+#define MACH_GROUP_GLOBESPAN   15 /* Globespan PVR Referrence Board         */
+#define MACH_GROUP_SIBYTE      16 /* Sibyte Eval Boards                     */
+#define MACH_GROUP_TOSHIBA     17 /* Toshiba Reference Systems TSBREF       */
+#define MACH_GROUP_ALCHEMY     18 /* Alchemy Semi Eval Boards               */
+#define MACH_GROUP_NEC_VR41XX  19 /* NEC Vr41xx based boards/gadgets        */
+#define MACH_GROUP_HP_LJ       20 /* Hewlett Packard LaserJet               */
 
 /*
  * Valid machtype values for group unknown (low order halfword of mips_machtype)
@@ -85,7 +85,8 @@
 #define MACH_SGI_CHALLENGE_S	1	/* The Challenge S server */
 #define MACH_SGI_INDIGO2	2	/* The Indigo2 system */
 #define MACH_SGI_IP27		3	/* Origin 200, Origin 2000, Onyx 2 */
-#define MACH_SGI_IP32		4	/* O2 */
+#define MACH_SGI_IP28		4	/* Indigo2 Impact */
+#define MACH_SGI_IP32		5	/* O2 */
 
 /*
  * Valid machtype for group COBALT
@@ -120,8 +121,7 @@
 /*
  * Valid machtype for group MOMENCO
  */
-#define MACH_MOMENCO_OCELOT		0
-
+#define MACH_MOMENCO_OCELOT	0
  
 /*
  * Valid machtype for group ITE
@@ -156,6 +156,7 @@
  * Valid machtype for group Alchemy
  */
 #define MACH_PB1000	0	         /* Au1000-based eval board */
+#define MACH_PB1500	1	         /* Au1500-based eval board */
  
 /*
  * Valid machtype for group NEC_VR41XX
diff -urN linux-2.4.19-rc1/include/asm-mips64/branch.h linux-2.4.19-rc2/include/asm-mips64/branch.h
--- linux-2.4.19-rc1/include/asm-mips64/branch.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/branch.h	Tue Jul 16 16:25:21 2002
@@ -3,10 +3,11 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Branch and jump emulation.
- *
- * Copyright (C) 1996, 1997, 1998, 1999 by Ralf Baechle
+ * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
  */
+#ifndef _ASM_BRANCH_H
+#define _ASM_BRANCH_H
+
 #include <asm/ptrace.h>
 
 static inline int delay_slot(struct pt_regs *regs)
@@ -14,6 +15,14 @@
 	return regs->cp0_cause & CAUSEF_BD;
 }
 
+static inline unsigned long exception_epc(struct pt_regs *regs)
+{
+	if (!delay_slot(regs))
+		return regs->cp0_epc;
+
+	return regs->cp0_epc + 4;
+}
+
 extern int __compute_return_epc(struct pt_regs *regs);
 
 static inline int compute_return_epc(struct pt_regs *regs)
@@ -25,3 +34,5 @@
 
 	return __compute_return_epc(regs);
 }
+
+#endif /* _ASM_BRANCH_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/cache.h linux-2.4.19-rc2/include/asm-mips64/cache.h
--- linux-2.4.19-rc1/include/asm-mips64/cache.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/cache.h	Tue Jul 16 16:25:21 2002
@@ -9,7 +9,9 @@
 #ifndef _ASM_CACHE_H
 #define _ASM_CACHE_H
 
-#ifndef _LANGUAGE_ASSEMBLY
+#include <linux/config.h>
+
+#ifndef __ASSEMBLY__
 /*
  * Descriptor for a cache
  */
@@ -19,7 +21,7 @@
 	int ways;
 	int flags;	/* Details like write thru/back, coherent, etc. */
 };
-#endif
+#endif /* !__ASSEMBLY__ */
 
 /* bytes per L1 cache line */
 #define L1_CACHE_BYTES		(1 << CONFIG_L1_CACHE_SHIFT)
diff -urN linux-2.4.19-rc1/include/asm-mips64/checksum.h linux-2.4.19-rc2/include/asm-mips64/checksum.h
--- linux-2.4.19-rc1/include/asm-mips64/checksum.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/checksum.h	Tue Jul 16 16:25:21 2002
@@ -6,6 +6,7 @@
  * Copyright (C) 1995, 1996, 1997, 1998, 1999 by Ralf Baechle
  * Copyright (C) 1999 Silicon Graphics, Inc.
  * Copyright (C) 2001 Thiemo Seufer.
+ * Copyright (C) 2002  Maciej W. Rozycki
  */
 #ifndef _ASM_CHECKSUM_H
 #define _ASM_CHECKSUM_H
@@ -142,6 +143,10 @@
 /*
  * computes the checksum of the TCP/UDP pseudo-header
  * returns a 16-bit checksum, already complemented
+ *
+ * Cast unsigned short expressions to unsigned long explicitly
+ * to avoid surprises resulting from implicit promotions to
+ * signed int.  --macro
  */
 static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
 					       unsigned long daddr,
@@ -158,12 +163,12 @@
 	"daddu\t%0, $1\n\t"
 	"dsrl32\t%0, %0, 0\n\t"
 	".set\tat"
-	: "=r" (sum)
+	: "=&r" (sum)
 	: "0" (daddr), "r"(saddr),
 #ifdef __MIPSEL__
-	  "r" ((ntohs(len)<<16)+proto*256),
+	  "r" (((unsigned long)ntohs(len)<<16)+proto*256),
 #else
-	  "r" (((proto)<<16)+len),
+	  "r" (((unsigned long)(proto)<<16)+len),
 #endif
 	  "r" (sum));
 
@@ -251,7 +256,7 @@
 	"addu\t%0, $1\t\t\t# Add final carry\n\t"
 	".set\tnoat\n\t"
 	".set\tnoreorder"
-	: "=r" (sum), "=r" (proto)
+	: "=&r" (sum), "=&r" (proto)
 	: "r" (saddr), "r" (daddr),
 	  "0" (htonl(len)), "1" (htonl(proto)), "r" (sum));
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/cpu.h linux-2.4.19-rc2/include/asm-mips64/cpu.h
--- linux-2.4.19-rc1/include/asm-mips64/cpu.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/cpu.h	Tue Jul 16 16:25:21 2002
@@ -62,6 +62,7 @@
 #define PRID_IMP_R5500		0x5500
 #define PRID_IMP_4KC		0x8000
 #define PRID_IMP_5KC		0x8100
+#define PRID_IMP_20KC		0x8200
 #define PRID_IMP_4KEC		0x8400
 #define PRID_IMP_4KSC		0x8600
 
@@ -98,7 +99,7 @@
 
 #define FPIR_IMP_NONE		0x0000
 
-#ifndef  _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 /*
  * Capability and feature descriptor structure for MIPS CPU
  */
@@ -120,16 +121,17 @@
 enum cputype {
 	CPU_UNKNOWN,
 	CPU_R2000, CPU_R3000, CPU_R3000A, CPU_R3041, CPU_R3051, CPU_R3052,
-	CPU_R3081, CPU_R3081E, CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200,
-	CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R6000, CPU_R6000A,
-	CPU_R8000, CPU_R10000, CPU_R4300, CPU_R4650, CPU_R4700, CPU_R5000,
-	CPU_R5000A, CPU_R4640, CPU_NEVADA, CPU_RM7000, CPU_R5432, CPU_4KC,
-	CPU_5KC, CPU_R4310, CPU_SB1, CPU_TX3912, CPU_TX3922, CPU_TX3927,
-	CPU_AU1000, CPU_4KEC, CPU_4KSC, CPU_VR41XX, CPU_R5500, CPU_TX49XX,
-	CPU_TX39XX, CPU_LAST
+	CPU_R3081, CPU_R3081E, CPU_R4000PC, CPU_R4000SC, CPU_R4000MC,
+	CPU_R4200, CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600,
+	CPU_R6000, CPU_R6000A, CPU_R8000, CPU_R10000, CPU_R12000, CPU_R4300,
+	CPU_R4650, CPU_R4700, CPU_R5000, CPU_R5000A, CPU_R4640, CPU_NEVADA,
+	CPU_RM7000, CPU_R5432, CPU_4KC, CPU_5KC, CPU_R4310, CPU_SB1,
+	CPU_TX3912, CPU_TX3922, CPU_TX3927, CPU_AU1000, CPU_4KEC, CPU_4KSC,
+	CPU_VR41XX, CPU_R5500, CPU_TX49XX, CPU_TX39XX, CPU_AU1500, CPU_20KC,
+	CPU_LAST
 };
 
-#endif
+#endif /* !__ASSEMBLY__ */
 
 /*
  * ISA Level encodings
@@ -159,5 +161,6 @@
 #define MIPS_CPU_CACHE_CDEX	0x00000800 /* Create_Dirty_Exclusive CACHE op */
 #define MIPS_CPU_MCHECK		0x00001000 /* Machine check exception */
 #define MIPS_CPU_EJTAG		0x00002000 /* EJTAG exception */
+#define MIPS_CPU_NOFPUEX	0x00000000 /* no FPU exception; never set */
 
 #endif /* _ASM_CPU_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/current.h linux-2.4.19-rc2/include/asm-mips64/current.h
--- linux-2.4.19-rc1/include/asm-mips64/current.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/current.h	Tue Jul 16 16:25:21 2002
@@ -8,10 +8,11 @@
 #ifndef _ASM_CURRENT_H
 #define _ASM_CURRENT_H
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 /* MIPS rules... */
 register struct task_struct *current asm("$28");
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
+
 #endif /* _ASM_CURRENT_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/elf.h linux-2.4.19-rc2/include/asm-mips64/elf.h
--- linux-2.4.19-rc1/include/asm-mips64/elf.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/elf.h	Tue Jul 16 16:25:21 2002
@@ -14,6 +14,17 @@
 #define ELF_NGREG	45
 #define ELF_NFPREG	33
 
+/* ELF header e_flags defines. MIPS architecture level. */
+#define EF_MIPS_ARCH_1      0x00000000  /* -mips1 code.  */
+#define EF_MIPS_ARCH_2      0x10000000  /* -mips2 code.  */
+#define EF_MIPS_ARCH_3      0x20000000  /* -mips3 code.  */
+#define EF_MIPS_ARCH_4      0x30000000  /* -mips4 code.  */
+#define EF_MIPS_ARCH_5      0x40000000  /* -mips5 code.  */
+#define EF_MIPS_ARCH_32     0x60000000  /* MIPS32 code.  */
+#define EF_MIPS_ARCH_64     0x70000000  /* MIPS64 code.  */
+#define EF_MIPS_ARCH_32R2   0x80000000  /* MIPS32 code.  */
+#define EF_MIPS_ARCH_64R2   0x90000000  /* MIPS64 code.  */
+
 typedef unsigned long elf_greg_t;
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
@@ -21,8 +32,7 @@
 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 
 /*
- * This is used to ensure we don't load something for the wrong 
- * architecture or OS.
+ * This is used to ensure we don't load something for the wrong architecture.
  */
 #define elf_check_arch(hdr)						\
 ({									\
@@ -34,6 +44,11 @@
 	if (sizeof(elf_caddr_t) == 8 &&					\
 	    __h->e_ident[EI_CLASS] == ELFCLASS32)			\
 	        __res = 0;						\
+	if (((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_1) &&	\
+	    ((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_2) &&	\
+	    ((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_32) &&	\
+	    ((__h->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_32R2))	\
+                __res = 0;						\
 									\
 	__res;								\
 })
diff -urN linux-2.4.19-rc1/include/asm-mips64/errno.h linux-2.4.19-rc2/include/asm-mips64/errno.h
--- linux-2.4.19-rc1/include/asm-mips64/errno.h	Fri Apr 13 20:26:07 2001
+++ linux-2.4.19-rc2/include/asm-mips64/errno.h	Tue Jul 16 16:25:21 2002
@@ -18,7 +18,7 @@
 #define	EINTR		 4	/* Interrupted system call */
 #define	EIO		 5	/* I/O error */
 #define	ENXIO		 6	/* No such device or address */
-#define	E2BIG		 7	/* Arg list too long */
+#define	E2BIG		 7	/* Argument list too long */
 #define	ENOEXEC		 8	/* Exec format error */
 #define	EBADF		 9	/* Bad file number */
 #define	ECHILD		10	/* No child processes */
diff -urN linux-2.4.19-rc1/include/asm-mips64/exception.h linux-2.4.19-rc2/include/asm-mips64/exception.h
--- linux-2.4.19-rc1/include/asm-mips64/exception.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/exception.h	Tue Jul 16 16:25:21 2002
@@ -8,7 +8,6 @@
  *
  * Low level exception handling
  */
-#define __ASSEMBLY__
 #include <asm/asm.h>
 #include <asm/regdef.h>
 #include <asm/fpregdef.h>
@@ -28,7 +27,7 @@
 
 	.macro	__build_clear_fpe
 	cfc1	a1, fcr31
-	li	a2, ~(0x3f << 13)
+	li	a2, ~(0x3f << 12)
 	and	a2, a1
 	ctc1	a2, fcr31
 	STI
diff -urN linux-2.4.19-rc1/include/asm-mips64/fpu_emulator.h linux-2.4.19-rc2/include/asm-mips64/fpu_emulator.h
--- linux-2.4.19-rc1/include/asm-mips64/fpu_emulator.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips64/fpu_emulator.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,38 @@
+/*
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope it will be useful, but WITHOUT
+ *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Further private data for which no space exists in mips_fpu_soft_struct.
+ * This should be subsumed into the mips_fpu_soft_struct structure as
+ * defined in processor.h as soon as the absurd wired absolute assembler
+ * offsets become dynamic at compile time.
+ *
+ * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ */
+#ifndef _ASM_FPU_EMULATOR_H
+#define _ASM_FPU_EMULATOR_H
+
+struct mips_fpu_emulator_private {
+	unsigned int eir;
+	struct {
+		unsigned int emulated;
+		unsigned int loads;
+		unsigned int stores;
+		unsigned int cp1ops;
+		unsigned int cp1xops;
+		unsigned int errors;
+	} stats;
+};
+
+#endif /* _ASM_FPU_EMULATOR_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/gdb-stub.h linux-2.4.19-rc2/include/asm-mips64/gdb-stub.h
--- linux-2.4.19-rc1/include/asm-mips64/gdb-stub.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/gdb-stub.h	Tue Jul 16 16:25:21 2002
@@ -132,7 +132,7 @@
 
 #define GDB_FR_SIZE		((((GDB_FR_CP0_PRID) + 4) + (PTRSIZE-1)) & ~(PTRSIZE-1))
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 /*
  * This is the same as above, but for the high-level
@@ -208,5 +208,5 @@
 
 void set_debug_traps(void);
 
-#endif /* _LANGUAGE_ASSEMBLY */
+#endif /* !__ASSEMBLY__ */
 #endif /* __ASM_MIPS_GDB_STUB_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/ide.h linux-2.4.19-rc2/include/asm-mips64/ide.h
--- linux-2.4.19-rc1/include/asm-mips64/ide.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/ide.h	Tue Jul 16 16:25:21 2002
@@ -90,12 +90,21 @@
 typedef union {
 	unsigned all			: 8;	/* all of the bits together */
 	struct {
+#ifdef __MIPSEB__
+		unsigned HOB		: 1;	/* 48-bit address ordering */
+		unsigned reserved456	: 3;
+		unsigned bit3		: 1;	/* ATA-2 thingy */
+		unsigned SRST		: 1;	/* host soft reset bit */
+		unsigned nIEN		: 1;	/* device INTRQ to host */
+		unsigned bit0		: 1;
+#else
 		unsigned bit0		: 1;
 		unsigned nIEN		: 1;	/* device INTRQ to host */
 		unsigned SRST		: 1;	/* host soft reset bit */
 		unsigned bit3		: 1;	/* ATA-2 thingy */
 		unsigned reserved456	: 3;
 		unsigned HOB		: 1;	/* 48-bit address ordering */
+#endif
 	} b;
 } control_t;
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/inst.h linux-2.4.19-rc2/include/asm-mips64/inst.h
--- linux-2.4.19-rc1/include/asm-mips64/inst.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/inst.h	Tue Jul 16 16:25:21 2002
@@ -1,11 +1,11 @@
 /*
+ * Format of an instruction in memory.
+ *
  * 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.
  *
- * Format of an instruction in memory.
- *
- * Copyright (C) 1996 by Ralf Baechle
+ * Copyright (C) 1996, 2000 by Ralf Baechle
  */
 #ifndef _ASM_INST_H
 #define _ASM_INST_H
@@ -21,7 +21,7 @@
 	cop0_op, cop1_op, cop2_op, cop1x_op,
 	beql_op, bnel_op, blezl_op, bgtzl_op,
 	daddi_op, daddiu_op, ldl_op, ldr_op,
-	major_1c_op, major_1d_op, major_1e_op, major_1f_op,
+	major_1c_op, jalx_op, major_1e_op, major_1f_op,
 	lb_op, lh_op, lwl_op, lw_op,
 	lbu_op, lhu_op, lwr_op, lwu_op,
 	sb_op, sh_op, swl_op, sw_op,
@@ -80,6 +80,13 @@
 };
 
 /*
+ * rt field of cop.bc_op opcodes
+ */
+enum bcop_op {
+	bcf_op, bct_op, bcfl_op, bctl_op
+};
+
+/*
  * func field of cop0 coi opcodes.
  */
 enum cop0_coi_func {
@@ -301,4 +308,64 @@
         struct ma_format ma_format;
 };
 
+/* HACHACHAHCAHC ...  */
+
+/* In case some other massaging is needed, keep MIPSInst as wrapper */
+
+#define MIPSInst(x) x
+
+#define I_OPCODE_SFT	26
+#define MIPSInst_OPCODE(x) (MIPSInst(x) >> I_OPCODE_SFT)
+
+#define I_JTARGET_SFT	0
+#define MIPSInst_JTARGET(x) (MIPSInst(x) & 0x03ffffff)
+
+#define I_RS_SFT	21
+#define MIPSInst_RS(x) ((MIPSInst(x) & 0x03e00000) >> I_RS_SFT)
+
+#define I_RT_SFT	16
+#define MIPSInst_RT(x) ((MIPSInst(x) & 0x001f0000) >> I_RT_SFT)
+
+#define I_IMM_SFT	0
+#define MIPSInst_SIMM(x) ((int)((short)(MIPSInst(x) & 0xffff)))
+#define MIPSInst_UIMM(x) (MIPSInst(x) & 0xffff)
+
+#define I_CACHEOP_SFT	18
+#define MIPSInst_CACHEOP(x) ((MIPSInst(x) & 0x001c0000) >> I_CACHEOP_SFT)
+
+#define I_CACHESEL_SFT	16
+#define MIPSInst_CACHESEL(x) ((MIPSInst(x) & 0x00030000) >> I_CACHESEL_SFT)
+
+#define I_RD_SFT	11
+#define MIPSInst_RD(x) ((MIPSInst(x) & 0x0000f800) >> I_RD_SFT)
+
+#define I_RE_SFT	6
+#define MIPSInst_RE(x) ((MIPSInst(x) & 0x000007c0) >> I_RE_SFT)
+
+#define I_FUNC_SFT	0
+#define MIPSInst_FUNC(x) (MIPSInst(x) & 0x0000003f)
+
+#define I_FFMT_SFT	21
+#define MIPSInst_FFMT(x) ((MIPSInst(x) & 0x01e00000) >> I_FFMT_SFT)
+
+#define I_FT_SFT	16
+#define MIPSInst_FT(x) ((MIPSInst(x) & 0x001f0000) >> I_FT_SFT)
+
+#define I_FS_SFT	11
+#define MIPSInst_FS(x) ((MIPSInst(x) & 0x0000f800) >> I_FS_SFT)
+
+#define I_FD_SFT	6
+#define MIPSInst_FD(x) ((MIPSInst(x) & 0x000007c0) >> I_FD_SFT)
+
+#define I_FR_SFT	21
+#define MIPSInst_FR(x) ((MIPSInst(x) & 0x03e00000) >> I_FR_SFT)
+
+#define I_FMA_FUNC_SFT	2
+#define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x0000003c) >> I_FMA_FUNC_SFT)
+
+#define I_FMA_FFMT_SFT	0
+#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000003)
+
+typedef unsigned int mips_instruction;
+
 #endif /* _ASM_INST_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/io.h linux-2.4.19-rc2/include/asm-mips64/io.h
--- linux-2.4.19-rc1/include/asm-mips64/io.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/io.h	Tue Jul 16 16:25:21 2002
@@ -66,27 +66,44 @@
 /*
  * Change "struct page" to physical address.
  */
-#define page_to_phys(page)	PHYSADDR(page_address(page))
+#define page_to_phys(page)	PAGE_TO_PA(page)
 
 /*
- * On MIPS, we have the whole physical address space mapped at all
- * times, so "ioremap()" and "iounmap()" do not need to do anything.
+ *     ioremap         -       map bus memory into CPU space
+ *     @offset:        bus address of the memory
+ *     @size:          size of the resource to map
  *
- * We cheat a bit and always return uncachable areas until we've fixed
- * the drivers to handle caching properly.
+ *     ioremap performs a platform specific sequence of operations to
+ *     make bus memory CPU accessible via the readb/readw/readl/writeb/
+ *     writew/writel functions and the other mmio helpers. The returned
+ *     address is not guaranteed to be usable directly as a virtual
+ *     address. 
  */
-static inline void *
-ioremap(unsigned long offset, unsigned long size)
+static inline void * ioremap(unsigned long offset, unsigned long size)
 {
 	return (void *) (IO_SPACE_BASE | offset);
 }
 
-/* This one maps high address device memory and turns off caching for that
- *  area.  It's useful if some control registers are in such an area and write
- * combining or read caching is not desirable.
+/*
+ *     ioremap_nocache         -       map bus memory into CPU space
+ *     @offset:        bus address of the memory
+ *     @size:          size of the resource to map
+ *
+ *     ioremap_nocache performs a platform specific sequence of operations to
+ *     make bus memory CPU accessible via the readb/readw/readl/writeb/
+ *     writew/writel functions and the other mmio helpers. The returned
+ *     address is not guaranteed to be usable directly as a virtual
+ *     address. 
+ *
+ *     This version of ioremap ensures that the memory is marked uncachable
+ *     on the CPU as well as honouring existing caching rules from things like
+ *     the PCI bus. Note that there are other caches and buffers on many 
+ *     busses. In paticular driver authors should read up on PCI writes
+ *
+ *     It's useful if some control registers are in such an area and
+ *     write combining or read caching is not desirable:
  */
-static inline void *
-ioremap_nocache (unsigned long offset, unsigned long size)
+static inline void * ioremap_nocache (unsigned long offset, unsigned long size)
 {
 	return (void *) (IO_SPACE_BASE | offset);
 }
@@ -149,14 +166,36 @@
 #endif
 
 /*
- * Change virtual addresses to physical addresses and vv.
- * These are trivial on the 1:1 Linux/MIPS mapping
+ *     virt_to_phys    -       map virtual addresses to physical
+ *     @address: address to remap
+ *
+ *     The returned physical address is the physical (CPU) mapping for
+ *     the memory address given. It is only valid to use this function on
+ *     addresses directly mapped or allocated via kmalloc. 
+ *
+ *     This function does not give bus mappings for DMA transfers. In
+ *     almost all conceivable cases a device driver should not be using
+ *     this function
  */
+
 static inline unsigned long virt_to_phys(volatile void * address)
 {
 	return (unsigned long)address - PAGE_OFFSET;
 }
 
+/*
+ *     phys_to_virt    -       map physical address to virtual
+ *     @address: address to remap
+ *
+ *     The returned virtual address is a current CPU mapping for
+ *     the memory address given. It is only valid to use this function on
+ *     addresses that have a kernel mapping
+ *
+ *     This function does not handle bus mappings for DMA transfers. In
+ *     almost all conceivable cases a device driver should not be using
+ *     this function
+ */
+
 static inline void * phys_to_virt(unsigned long address)
 {
 	return (void *)(address + PAGE_OFFSET);
@@ -212,6 +251,16 @@
  */
 #define eth_io_copy_and_sum(skb,src,len,unused) memcpy_fromio((skb)->data,(src),(len))
 
+/*
+ *     check_signature         -       find BIOS signatures
+ *     @io_addr: mmio address to check 
+ *     @signature:  signature block
+ *     @length: length of signature
+ *
+ *     Perform a signature comparison with the mmio address io_addr. This
+ *     address should have been obtained by ioremap.
+ *     Returns 1 on a match.
+ */
 static inline int
 check_signature(unsigned long io_addr, const unsigned char *signature,
                 int length)
@@ -230,6 +279,36 @@
 }
 
 /*
+ *     isa_check_signature             -       find BIOS signatures
+ *     @io_addr: mmio address to check 
+ *     @signature:  signature block
+ *     @length: length of signature
+ *
+ *     Perform a signature comparison with the ISA mmio address io_addr.
+ *     Returns 1 on a match.
+ *
+ *     This function is deprecated. New drivers should use ioremap and
+ *     check_signature.
+ */
+
+static inline int isa_check_signature(unsigned long io_addr,
+	const unsigned char *signature, int length)
+{
+	int retval = 0;
+	do {
+		if (isa_readb(io_addr) != *signature)
+			goto out;
+		io_addr++;
+		signature++;
+		length--;
+	} while (length);
+	retval = 1;
+out:
+	return retval;
+}
+
+
+/*
  * Talk about misusing macros..
  */
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/ip32/crime.h linux-2.4.19-rc2/include/asm-mips64/ip32/crime.h
--- linux-2.4.19-rc1/include/asm-mips64/ip32/crime.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/ip32/crime.h	Tue Jul 16 16:25:21 2002
@@ -16,13 +16,13 @@
 /*
  * Address map
  */
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 #define CRIME_BASE	KSEG1ADDR(0x14000000)
 #else
 #define CRIME_BASE	0xffffffffb4000000
 #endif
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 static inline u64 crime_read_64 (unsigned long __offset) {
         return *((volatile u64 *) (CRIME_BASE + __offset));
 }
diff -urN linux-2.4.19-rc1/include/asm-mips64/ip32/mace.h linux-2.4.19-rc2/include/asm-mips64/ip32/mace.h
--- linux-2.4.19-rc1/include/asm-mips64/ip32/mace.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/ip32/mace.h	Tue Jul 16 16:25:21 2002
@@ -197,7 +197,7 @@
 #define MACEISA_SERIAL2_RDMAT_INT	BIT (30)
 #define MACEISA_SERIAL2_RDMAOR_INT	BIT (31)
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 #include <asm/types.h>
 
 /*
@@ -248,7 +248,7 @@
 {
 /*	mace_write_32(MACEPCI_WFLUSH,0xffffffff);*/
 }
-#endif
+#endif /* !__ASSEMBLY__ */
 
 
 #endif /* __ASM_MACE_H__ */
diff -urN linux-2.4.19-rc1/include/asm-mips64/ip32/machine.h linux-2.4.19-rc2/include/asm-mips64/ip32/machine.h
--- linux-2.4.19-rc1/include/asm-mips64/ip32/machine.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/ip32/machine.h	Tue Jul 16 16:25:21 2002
@@ -9,9 +9,13 @@
  */
 #ifndef _ASM_IP32_MACHINE_H
 #define _ASM_IP32_MACHINE_H
+
+#include <linux/config.h>
+
 #ifdef CONFIG_SGI_IP32
 
 #define SGI_MACH_O2		0x3201
 
 #endif /* CONFIG_SGI_IP32 */
+
 #endif /* _ASM_SGI_MACHINE_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/irq_cpu.h linux-2.4.19-rc2/include/asm-mips64/irq_cpu.h
--- linux-2.4.19-rc1/include/asm-mips64/irq_cpu.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips64/irq_cpu.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,18 @@
+/*
+ *	include/asm-mips/irq_cpu.h
+ *
+ *	MIPS CPU interrupt definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_MIPS64_IRQ_CPU_H
+#define __ASM_MIPS64_IRQ_CPU_H
+
+extern void mips_cpu_irq_init(int irq_base);
+
+#endif /* __ASM_MIPS64_IRQ_CPU_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/mips-boards/bonito64.h linux-2.4.19-rc2/include/asm-mips64/mips-boards/bonito64.h
--- linux-2.4.19-rc1/include/asm-mips64/mips-boards/bonito64.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips64/mips-boards/bonito64.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,432 @@
+/*
+ * bonito.h
+ *
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2001 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ * This file is the original bonito.h from Algorithmics with minor changes
+ * to fit into linux.
+ */
+
+/*
+ * Bonito Register Map 
+ * Copyright (c) 1999 Algorithmics Ltd
+ *
+ * Algorithmics gives permission for anyone to use and modify this file
+ * without any obligation or license condition except that you retain
+ * this copyright message in any source redistribution in whole or part.
+ *
+ * Updated copies of this and other files can be found at
+ * ftp://ftp.algor.co.uk/pub/bonito/
+ * 
+ * Users of the Bonito controller are warmly recommended to contribute
+ * any useful changes back to Algorithmics (mail to bonito@algor.co.uk).
+ */
+
+/* Revision 1.48 autogenerated on 08/17/99 15:20:01 */
+/* This bonito64 version editted from bonito.h Revision 1.48 on 11/09/00 */
+
+#ifndef _ASM_MIPS_BOARDS_BONITO64_H
+#define _ASM_MIPS_BOARDS_BONITO64_H
+
+#ifdef __ASSEMBLY__
+
+/* offsets from base register */
+#define BONITO(x)	(x)
+
+#else /* !__ASSEMBLY__ */
+
+/* offsets from base pointer, this construct allows optimisation */
+/* static char * const _bonito = PA_TO_KVA1(BONITO_BASE); */
+#define BONITO(x)		*(volatile u32 *)(_bonito + (x))
+
+#endif /* __ASSEMBLY__ */
+
+
+#define BONITO_BOOT_BASE		0x1fc00000
+#define BONITO_BOOT_SIZE		0x00100000
+#define BONITO_BOOT_TOP 		(BONITO_BOOT_BASE+BONITO_BOOT_SIZE-1)
+#define BONITO_FLASH_BASE		0x1c000000
+#define BONITO_FLASH_SIZE		0x03000000
+#define BONITO_FLASH_TOP		(BONITO_FLASH_BASE+BONITO_FLASH_SIZE-1)
+#define BONITO_SOCKET_BASE		0x1f800000
+#define BONITO_SOCKET_SIZE		0x00400000
+#define BONITO_SOCKET_TOP		(BONITO_SOCKET_BASE+BONITO_SOCKET_SIZE-1)
+#define BONITO_REG_BASE 		0x1fe00000
+#define BONITO_REG_SIZE 		0x00040000
+#define BONITO_REG_TOP			(BONITO_REG_BASE+BONITO_REG_SIZE-1)
+#define BONITO_DEV_BASE 		0x1ff00000
+#define BONITO_DEV_SIZE 		0x00100000
+#define BONITO_DEV_TOP			(BONITO_DEV_BASE+BONITO_DEV_SIZE-1)
+#define BONITO_PCILO_BASE		0x10000000
+#define BONITO_PCILO_SIZE		0x0c000000
+#define BONITO_PCILO_TOP		(BONITO_PCILO_BASE+BONITO_PCILO_SIZE-1)
+#define BONITO_PCILO0_BASE		0x10000000
+#define BONITO_PCILO1_BASE		0x14000000
+#define BONITO_PCILO2_BASE		0x18000000
+#define BONITO_PCIHI_BASE		0x20000000
+#define BONITO_PCIHI_SIZE		0x20000000
+#define BONITO_PCIHI_TOP		(BONITO_PCIHI_BASE+BONITO_PCIHI_SIZE-1)
+#define BONITO_PCIIO_BASE		0x1fd00000
+#define BONITO_PCIIO_SIZE		0x00100000
+#define BONITO_PCIIO_TOP		(BONITO_PCIIO_BASE+BONITO_PCIIO_SIZE-1)
+#define BONITO_PCICFG_BASE		0x1fe80000
+#define BONITO_PCICFG_SIZE		0x00080000
+#define BONITO_PCICFG_TOP		(BONITO_PCICFG_BASE+BONITO_PCICFG_SIZE-1)
+ 
+
+/* Bonito Register Bases */
+
+#define BONITO_PCICONFIGBASE		0x00
+#define BONITO_REGBASE			0x100
+
+
+/* PCI Configuration  Registers */
+
+#define BONITO_PCI_REG(x)               BONITO(BONITO_PCICONFIGBASE + (x))
+#define BONITO_PCIDID			BONITO_PCI_REG(0x00)
+#define BONITO_PCICMD			BONITO_PCI_REG(0x04)
+#define BONITO_PCICLASS 		BONITO_PCI_REG(0x08)
+#define BONITO_PCILTIMER		BONITO_PCI_REG(0x0c)
+#define BONITO_PCIBASE0 		BONITO_PCI_REG(0x10)
+#define BONITO_PCIBASE1 		BONITO_PCI_REG(0x14)
+#define BONITO_PCIBASE2 		BONITO_PCI_REG(0x18)
+#define BONITO_PCIEXPRBASE		BONITO_PCI_REG(0x30)
+#define BONITO_PCIINT			BONITO_PCI_REG(0x3c)
+
+#define BONITO_PCICMD_PERR_CLR		0x80000000
+#define BONITO_PCICMD_SERR_CLR		0x40000000
+#define BONITO_PCICMD_MABORT_CLR	0x20000000
+#define BONITO_PCICMD_MTABORT_CLR	0x10000000
+#define BONITO_PCICMD_TABORT_CLR	0x08000000
+#define BONITO_PCICMD_MPERR_CLR 	0x01000000
+#define BONITO_PCICMD_PERRRESPEN	0x00000040
+#define BONITO_PCICMD_ASTEPEN		0x00000080
+#define BONITO_PCICMD_SERREN		0x00000100
+#define BONITO_PCILTIMER_BUSLATENCY	0x0000ff00
+#define BONITO_PCILTIMER_BUSLATENCY_SHIFT	8
+
+
+
+
+/* 1. Bonito h/w Configuration */
+/* Power on register */
+
+#define BONITO_BONPONCFG		BONITO(BONITO_REGBASE + 0x00)
+
+#define BONITO_BONPONCFG_SYSCONTROLLERRD	0x00040000
+#define BONITO_BONPONCFG_ROMCS1SAMP	0x00020000
+#define BONITO_BONPONCFG_ROMCS0SAMP	0x00010000
+#define BONITO_BONPONCFG_CPUBIGEND	0x00004000
+/* Added by RPF 11-9-00 */
+#define BONITO_BONPONCFG_BURSTORDER	0x00001000
+/* --- */
+#define BONITO_BONPONCFG_CPUPARITY	0x00002000
+#define BONITO_BONPONCFG_CPUTYPE	0x00000007
+#define BONITO_BONPONCFG_CPUTYPE_SHIFT	0
+#define BONITO_BONPONCFG_PCIRESET_OUT	0x00000008
+#define BONITO_BONPONCFG_IS_ARBITER	0x00000010
+#define BONITO_BONPONCFG_ROMBOOT	0x000000c0
+#define BONITO_BONPONCFG_ROMBOOT_SHIFT	6
+
+#define BONITO_BONPONCFG_ROMBOOT_FLASH	(0x0<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+#define BONITO_BONPONCFG_ROMBOOT_SOCKET (0x1<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+#define BONITO_BONPONCFG_ROMBOOT_SDRAM	(0x2<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+#define BONITO_BONPONCFG_ROMBOOT_CPURESET	(0x3<<BONITO_BONPONCFG_ROMBOOT_SHIFT)
+
+#define BONITO_BONPONCFG_ROMCS0WIDTH	0x00000100
+#define BONITO_BONPONCFG_ROMCS1WIDTH	0x00000200
+#define BONITO_BONPONCFG_ROMCS0FAST	0x00000400
+#define BONITO_BONPONCFG_ROMCS1FAST	0x00000800
+#define BONITO_BONPONCFG_CONFIG_DIS	0x00000020
+
+
+/* Other Bonito configuration */
+
+#define BONITO_BONGENCFG_OFFSET         0x4
+#define BONITO_BONGENCFG		BONITO(BONITO_REGBASE + BONITO_BONGENCFG_OFFSET)
+
+#define BONITO_BONGENCFG_DEBUGMODE	0x00000001
+#define BONITO_BONGENCFG_SNOOPEN	0x00000002
+#define BONITO_BONGENCFG_CPUSELFRESET	0x00000004
+
+#define BONITO_BONGENCFG_FORCE_IRQA	0x00000008
+#define BONITO_BONGENCFG_IRQA_ISOUT	0x00000010
+#define BONITO_BONGENCFG_IRQA_FROM_INT1 0x00000020
+#define BONITO_BONGENCFG_BYTESWAP	0x00000040
+
+#define BONITO_BONGENCFG_UNCACHED	0x00000080
+#define BONITO_BONGENCFG_PREFETCHEN	0x00000100
+#define BONITO_BONGENCFG_WBEHINDEN	0x00000200
+#define BONITO_BONGENCFG_CACHEALG	0x00000c00
+#define BONITO_BONGENCFG_CACHEALG_SHIFT 10
+#define BONITO_BONGENCFG_PCIQUEUE	0x00001000
+#define BONITO_BONGENCFG_CACHESTOP	0x00002000
+#define BONITO_BONGENCFG_MSTRBYTESWAP	0x00004000
+#define BONITO_BONGENCFG_BUSERREN	0x00008000
+#define BONITO_BONGENCFG_NORETRYTIMEOUT 0x00010000
+#define BONITO_BONGENCFG_SHORTCOPYTIMEOUT	0x00020000
+
+/* 2. IO & IDE configuration */
+
+#define BONITO_IODEVCFG 		BONITO(BONITO_REGBASE + 0x08)
+
+/* 3. IO & IDE configuration */
+
+#define BONITO_SDCFG			BONITO(BONITO_REGBASE + 0x0c)
+
+/* 4. PCI address map control */
+
+#define BONITO_PCIMAP			BONITO(BONITO_REGBASE + 0x10)
+#define BONITO_PCIMEMBASECFG		BONITO(BONITO_REGBASE + 0x14)
+#define BONITO_PCIMAP_CFG		BONITO(BONITO_REGBASE + 0x18)
+
+/* 5. ICU & GPIO regs */
+ 
+/* GPIO Regs - r/w */
+
+#define BONITO_GPIODATA_OFFSET          0x1c
+#define BONITO_GPIODATA 		BONITO(BONITO_REGBASE + BONITO_GPIODATA_OFFSET)
+#define BONITO_GPIOIE			BONITO(BONITO_REGBASE + 0x20)
+
+/* ICU Configuration Regs - r/w */
+
+#define BONITO_INTEDGE			BONITO(BONITO_REGBASE + 0x24)
+#define BONITO_INTSTEER 		BONITO(BONITO_REGBASE + 0x28)
+#define BONITO_INTPOL			BONITO(BONITO_REGBASE + 0x2c)
+
+/* ICU Enable Regs - IntEn & IntISR are r/o. */
+
+#define BONITO_INTENSET 		BONITO(BONITO_REGBASE + 0x30)
+#define BONITO_INTENCLR 		BONITO(BONITO_REGBASE + 0x34)
+#define BONITO_INTEN			BONITO(BONITO_REGBASE + 0x38)
+#define BONITO_INTISR			BONITO(BONITO_REGBASE + 0x3c)
+
+/* PCI mail boxes */
+
+#define BONITO_PCIMAIL0_OFFSET          0x40
+#define BONITO_PCIMAIL1_OFFSET          0x44
+#define BONITO_PCIMAIL2_OFFSET          0x48
+#define BONITO_PCIMAIL3_OFFSET          0x4c
+#define BONITO_PCIMAIL0 		BONITO(BONITO_REGBASE + 0x40)
+#define BONITO_PCIMAIL1 		BONITO(BONITO_REGBASE + 0x44)
+#define BONITO_PCIMAIL2 		BONITO(BONITO_REGBASE + 0x48)
+#define BONITO_PCIMAIL3 		BONITO(BONITO_REGBASE + 0x4c)
+
+
+/* 6. PCI cache */
+
+#define BONITO_PCICACHECTRL		BONITO(BONITO_REGBASE + 0x50)
+#define BONITO_PCICACHETAG		BONITO(BONITO_REGBASE + 0x54)
+
+#define BONITO_PCIBADADDR		BONITO(BONITO_REGBASE + 0x58)
+#define BONITO_PCIMSTAT 		BONITO(BONITO_REGBASE + 0x5c)
+
+
+/*
+#define BONITO_PCIRDPOST		BONITO(BONITO_REGBASE + 0x60)
+#define BONITO_PCIDATA			BONITO(BONITO_REGBASE + 0x64)
+*/
+
+/* 7. IDE DMA & Copier */
+ 
+#define BONITO_CONFIGBASE		0x000
+#define BONITO_BONITOBASE		0x100
+#define BONITO_LDMABASE 		0x200
+#define BONITO_COPBASE			0x300
+#define BONITO_REG_BLOCKMASK		0x300
+
+#define BONITO_LDMACTRL 		BONITO(BONITO_LDMABASE + 0x0)
+#define BONITO_LDMASTAT 		BONITO(BONITO_LDMABASE + 0x0)
+#define BONITO_LDMAADDR 		BONITO(BONITO_LDMABASE + 0x4)
+#define BONITO_LDMAGO			BONITO(BONITO_LDMABASE + 0x8)
+#define BONITO_LDMADATA 		BONITO(BONITO_LDMABASE + 0xc)
+
+#define BONITO_COPCTRL			BONITO(BONITO_COPBASE + 0x0)
+#define BONITO_COPSTAT			BONITO(BONITO_COPBASE + 0x0)
+#define BONITO_COPPADDR 		BONITO(BONITO_COPBASE + 0x4)
+#define BONITO_COPDADDR 		BONITO(BONITO_COPBASE + 0x8)
+#define BONITO_COPGO			BONITO(BONITO_COPBASE + 0xc)
+
+
+/* ###### Bit Definitions for individual Registers #### */
+
+/* Gen DMA. */
+
+#define BONITO_IDECOPDADDR_DMA_DADDR	0x0ffffffc
+#define BONITO_IDECOPDADDR_DMA_DADDR_SHIFT	2
+#define BONITO_IDECOPPADDR_DMA_PADDR	0xfffffffc
+#define BONITO_IDECOPPADDR_DMA_PADDR_SHIFT	2
+#define BONITO_IDECOPGO_DMA_SIZE	0x0000fffe
+#define BONITO_IDECOPGO_DMA_SIZE_SHIFT	0
+#define BONITO_IDECOPGO_DMA_WRITE	0x00010000
+#define BONITO_IDECOPGO_DMAWCOUNT	0x000f0000
+#define BONITO_IDECOPGO_DMAWCOUNT_SHIFT	16
+
+#define BONITO_IDECOPCTRL_DMA_STARTBIT	0x80000000
+#define BONITO_IDECOPCTRL_DMA_RSTBIT	0x40000000
+
+/* DRAM - sdCfg */
+
+#define BONITO_SDCFG_AROWBITS		0x00000003
+#define BONITO_SDCFG_AROWBITS_SHIFT	0
+#define BONITO_SDCFG_ACOLBITS		0x0000000c
+#define BONITO_SDCFG_ACOLBITS_SHIFT	2
+#define BONITO_SDCFG_ABANKBIT		0x00000010
+#define BONITO_SDCFG_ASIDES		0x00000020
+#define BONITO_SDCFG_AABSENT		0x00000040
+#define BONITO_SDCFG_AWIDTH64		0x00000080
+
+#define BONITO_SDCFG_BROWBITS		0x00000300
+#define BONITO_SDCFG_BROWBITS_SHIFT	8
+#define BONITO_SDCFG_BCOLBITS		0x00000c00
+#define BONITO_SDCFG_BCOLBITS_SHIFT	10
+#define BONITO_SDCFG_BBANKBIT		0x00001000
+#define BONITO_SDCFG_BSIDES		0x00002000
+#define BONITO_SDCFG_BABSENT		0x00004000
+#define BONITO_SDCFG_BWIDTH64		0x00008000
+
+#define BONITO_SDCFG_EXTRDDATA		0x00010000
+#define BONITO_SDCFG_EXTRASCAS		0x00020000
+#define BONITO_SDCFG_EXTPRECH		0x00040000
+#define BONITO_SDCFG_EXTRASWIDTH	0x00180000
+#define BONITO_SDCFG_EXTRASWIDTH_SHIFT	19
+/* Changed by RPF 11-9-00 */
+#define BONITO_SDCFG_DRAMMODESET	0x00200000
+/* --- */
+#define BONITO_SDCFG_DRAMEXTREGS	0x00400000
+#define BONITO_SDCFG_DRAMPARITY 	0x00800000
+/* Added by RPF 11-9-00 */
+#define BONITO_SDCFG_DRAMBURSTLEN 	0x03000000
+#define BONITO_SDCFG_DRAMBURSTLEN_SHIFT	24
+#define BONITO_SDCFG_DRAMMODESET_DONE 	0x80000000
+/* --- */
+
+/* PCI Cache - pciCacheCtrl */
+
+#define BONITO_PCICACHECTRL_CACHECMD	0x00000007
+#define BONITO_PCICACHECTRL_CACHECMD_SHIFT	0
+#define BONITO_PCICACHECTRL_CACHECMDLINE	0x00000018
+#define BONITO_PCICACHECTRL_CACHECMDLINE_SHIFT	3
+#define BONITO_PCICACHECTRL_CMDEXEC	0x00000020
+
+#define BONITO_IODEVCFG_BUFFBIT_CS0	0x00000001
+#define BONITO_IODEVCFG_SPEEDBIT_CS0	0x00000002
+#define BONITO_IODEVCFG_MOREABITS_CS0	0x00000004
+
+#define BONITO_IODEVCFG_BUFFBIT_CS1	0x00000008
+#define BONITO_IODEVCFG_SPEEDBIT_CS1	0x00000010
+#define BONITO_IODEVCFG_MOREABITS_CS1	0x00000020
+
+#define BONITO_IODEVCFG_BUFFBIT_CS2	0x00000040
+#define BONITO_IODEVCFG_SPEEDBIT_CS2	0x00000080
+#define BONITO_IODEVCFG_MOREABITS_CS2	0x00000100
+
+#define BONITO_IODEVCFG_BUFFBIT_CS3	0x00000200
+#define BONITO_IODEVCFG_SPEEDBIT_CS3	0x00000400
+#define BONITO_IODEVCFG_MOREABITS_CS3	0x00000800
+
+#define BONITO_IODEVCFG_BUFFBIT_IDE	0x00001000
+#define BONITO_IODEVCFG_SPEEDBIT_IDE	0x00002000
+#define BONITO_IODEVCFG_WORDSWAPBIT_IDE 0x00004000
+#define BONITO_IODEVCFG_MODEBIT_IDE	0x00008000
+#define BONITO_IODEVCFG_DMAON_IDE	0x001f0000
+#define BONITO_IODEVCFG_DMAON_IDE_SHIFT 16
+#define BONITO_IODEVCFG_DMAOFF_IDE	0x01e00000
+#define BONITO_IODEVCFG_DMAOFF_IDE_SHIFT	21
+#define BONITO_IODEVCFG_EPROMSPLIT	0x02000000
+/* Added by RPF 11-9-00 */
+#define BONITO_IODEVCFG_CPUCLOCKPERIOD	0xfc000000
+#define BONITO_IODEVCFG_CPUCLOCKPERIOD_SHIFT 26
+/* --- */
+
+/* gpio */
+#define BONITO_GPIO_GPIOW		0x000003ff
+#define BONITO_GPIO_GPIOW_SHIFT 	0
+#define BONITO_GPIO_GPIOR		0x01ff0000
+#define BONITO_GPIO_GPIOR_SHIFT 	16
+#define BONITO_GPIO_GPINR		0xfe000000
+#define BONITO_GPIO_GPINR_SHIFT 	25
+#define BONITO_GPIO_IOW(N)		(1<<(BONITO_GPIO_GPIOW_SHIFT+(N)))
+#define BONITO_GPIO_IOR(N)		(1<<(BONITO_GPIO_GPIOR_SHIFT+(N)))
+#define BONITO_GPIO_INR(N)		(1<<(BONITO_GPIO_GPINR_SHIFT+(N)))
+
+/* ICU */
+#define BONITO_ICU_MBOXES		0x0000000f
+#define BONITO_ICU_MBOXES_SHIFT 	0
+#define BONITO_ICU_DMARDY		0x00000010
+#define BONITO_ICU_DMAEMPTY		0x00000020
+#define BONITO_ICU_COPYRDY		0x00000040
+#define BONITO_ICU_COPYEMPTY		0x00000080
+#define BONITO_ICU_COPYERR		0x00000100
+#define BONITO_ICU_PCIIRQ		0x00000200
+#define BONITO_ICU_MASTERERR		0x00000400
+#define BONITO_ICU_SYSTEMERR		0x00000800
+#define BONITO_ICU_DRAMPERR		0x00001000
+#define BONITO_ICU_RETRYERR		0x00002000
+#define BONITO_ICU_GPIOS		0x01ff0000
+#define BONITO_ICU_GPIOS_SHIFT		16
+#define BONITO_ICU_GPINS		0x7e000000
+#define BONITO_ICU_GPINS_SHIFT		25
+#define BONITO_ICU_MBOX(N)		(1<<(BONITO_ICU_MBOXES_SHIFT+(N)))
+#define BONITO_ICU_GPIO(N)		(1<<(BONITO_ICU_GPIOS_SHIFT+(N)))
+#define BONITO_ICU_GPIN(N)		(1<<(BONITO_ICU_GPINS_SHIFT+(N)))
+
+/* pcimap */
+
+#define BONITO_PCIMAP_PCIMAP_LO0	0x0000003f
+#define BONITO_PCIMAP_PCIMAP_LO0_SHIFT	0
+#define BONITO_PCIMAP_PCIMAP_LO1	0x00000fc0
+#define BONITO_PCIMAP_PCIMAP_LO1_SHIFT	6
+#define BONITO_PCIMAP_PCIMAP_LO2	0x0003f000
+#define BONITO_PCIMAP_PCIMAP_LO2_SHIFT	12
+#define BONITO_PCIMAP_PCIMAP_2		0x00040000
+#define BONITO_PCIMAP_WIN(WIN,ADDR)	((((ADDR)>>26) & BONITO_PCIMAP_PCIMAP_LO0) << ((WIN)*6))
+
+#define BONITO_PCIMAP_WINSIZE           (1<<26)
+#define BONITO_PCIMAP_WINOFFSET(ADDR)	((ADDR) & (BONITO_PCIMAP_WINSIZE - 1))
+#define BONITO_PCIMAP_WINBASE(ADDR)	((ADDR) << 26)
+
+/* pcimembaseCfg */
+
+#define BONITO_PCIMEMBASECFG_MASK               0xf0000000
+#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK	0x0000001f
+#define BONITO_PCIMEMBASECFG_MEMBASE0_MASK_SHIFT	0
+#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS	0x000003e0
+#define BONITO_PCIMEMBASECFG_MEMBASE0_TRANS_SHIFT	5
+#define BONITO_PCIMEMBASECFG_MEMBASE0_CACHED	0x00000400
+#define BONITO_PCIMEMBASECFG_MEMBASE0_IO	0x00000800
+
+#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK	0x0001f000
+#define BONITO_PCIMEMBASECFG_MEMBASE1_MASK_SHIFT	12
+#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS	0x003e0000
+#define BONITO_PCIMEMBASECFG_MEMBASE1_TRANS_SHIFT	17
+#define BONITO_PCIMEMBASECFG_MEMBASE1_CACHED	0x00400000
+#define BONITO_PCIMEMBASECFG_MEMBASE1_IO	0x00800000
+
+#define BONITO_PCIMEMBASECFG_ASHIFT	23
+#define BONITO_PCIMEMBASECFG_AMASK              0x007fffff
+#define BONITO_PCIMEMBASECFGSIZE(WIN,SIZE)	(((~((SIZE)-1))>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)
+#define BONITO_PCIMEMBASECFGBASE(WIN,BASE)	(((BASE)>>(BONITO_PCIMEMBASECFG_ASHIFT-BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS)
+
+#define BONITO_PCIMEMBASECFG_SIZE(WIN,CFG)  (((((~(CFG)) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK)) << (BONITO_PCIMEMBASECFG_ASHIFT - BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT)) | BONITO_PCIMEMBASECFG_AMASK)
+
+
+#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG)  ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
+#define BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG)  ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_MASK_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
+#define BONITO_PCIMEMBASECFG_ADDRTRANS(WIN,CFG) ((((CFG) & BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS) >> BONITO_PCIMEMBASECFG_MEMBASE##WIN##_TRANS_SHIFT) << BONITO_PCIMEMBASECFG_ASHIFT)
+
+#define BONITO_PCITOPHYS(WIN,ADDR,CFG)          ( \
+                                                  (((ADDR) & (~(BONITO_PCIMEMBASECFG_MASK))) & (~(BONITO_PCIMEMBASECFG_ADDRMASK(WIN,CFG)))) | \
+                                                  (BONITO_PCIMEMBASECFG_ADDRTRANS(WIN,CFG)) \
+                                                )
+
+/* PCICmd */
+
+#define BONITO_PCICMD_MEMEN		0x00000002
+#define BONITO_PCICMD_MSTREN		0x00000004
+
+
+#endif /* _ASM_MIPS_BOARDS_BONITO64_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/mips-boards/generic.h linux-2.4.19-rc2/include/asm-mips64/mips-boards/generic.h
--- linux-2.4.19-rc1/include/asm-mips64/mips-boards/generic.h	Sun Sep  9 10:43:01 2001
+++ linux-2.4.19-rc2/include/asm-mips64/mips-boards/generic.h	Tue Jul 16 16:25:21 2002
@@ -25,14 +25,20 @@
 #ifndef _MIPS_GENERIC_H
 #define _MIPS_GENERIC_H
 
+#include <linux/config.h>
 #include <asm/addrspace.h>
 #include <asm/byteorder.h>
+#include <asm/mips-boards/bonito64.h>
 
 /*
  * Display register base.
  */
+#if defined(CONFIG_MIPS_SEAD)
+#define ASCII_DISPLAY_POS_BASE     (KSEG1ADDR(0x1f0005c0))
+#else
 #define ASCII_DISPLAY_WORD_BASE    (KSEG1ADDR(0x1f000410))
 #define ASCII_DISPLAY_POS_BASE     (KSEG1ADDR(0x1f000418))
+#endif
 
 
 /*
@@ -44,8 +50,28 @@
 /*
  * Reset register.
  */
+#if defined(CONFIG_MIPS_SEAD)
+#define SOFTRES_REG       (KSEG1ADDR(0x1e800050))
+#define GORESET           0x4d
+#else
 #define SOFTRES_REG       (KSEG1ADDR(0x1f000500))
 #define GORESET           0x42
+#endif
+
+/*
+ * Revision register.
+ */
+#define MIPS_REVISION_REG                  (KSEG1ADDR(0x1fc00010))
+#define MIPS_REVISION_CORID_QED_RM5261     0
+#define MIPS_REVISION_CORID_CORE_LV        1
+#define MIPS_REVISION_CORID_BONITO64       2
+#define MIPS_REVISION_CORID_CORE_20K       3
+#define MIPS_REVISION_CORID_CORE_FPGA      4
+#define MIPS_REVISION_CORID_CORE_MSC       5
+
+#define MIPS_REVISION_CORID (((*(volatile u32 *)(MIPS_REVISION_REG)) >> 10) & 0x3f)
+
+extern unsigned int mips_revision_corid;
 
 
 /*
@@ -67,4 +93,19 @@
 #define GT_PCI_READ(ofs, data)   \
 	data = *(volatile u32 *)(MIPS_GT_BASE+ofs)
 
+/*
+ * Algorithmics Bonito64 system controller register base.
+ */
+static char * const _bonito = (char *)KSEG1ADDR(BONITO_REG_BASE);
+
+/*
+ * MIPS System controller PCI register base.
+ */
+#define MSC01_PCI_REG_BASE  (KSEG1ADDR(0x1bd00000))
+
+#define MSC_WRITE(reg, data)  \
+	*(volatile u32 *)(reg) = data
+#define MSC_READ(reg, data)   \
+	data = *(volatile u32 *)(reg)
+
 #endif  /* !(_MIPS_GENERIC_H) */
diff -urN linux-2.4.19-rc1/include/asm-mips64/mips-boards/malta.h linux-2.4.19-rc2/include/asm-mips64/mips-boards/malta.h
--- linux-2.4.19-rc1/include/asm-mips64/mips-boards/malta.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/mips-boards/malta.h	Tue Jul 16 16:25:21 2002
@@ -29,9 +29,12 @@
 #include <asm/io.h>
 
 /* 
- * Malta I/O ports base address. 
-*/
-#define MALTA_PORT_BASE      (KSEG1ADDR(0x18000000))
+ * Malta I/O ports base address for the Galileo GT64120 and Algorithmics
+ * Bonito system controllers. 
+ */
+#define MALTA_GT_PORT_BASE      (KSEG1ADDR(0x18000000))
+#define MALTA_BONITO_PORT_BASE  (KSEG1ADDR(0x1fd00000))
+#define MALTA_MSC_PORT_BASE     (KSEG1ADDR(0x18000000))
 
 /* 
  * Malta RTC-device indirect register access.
diff -urN linux-2.4.19-rc1/include/asm-mips64/mips-boards/msc01_pci.h linux-2.4.19-rc2/include/asm-mips64/mips-boards/msc01_pci.h
--- linux-2.4.19-rc1/include/asm-mips64/mips-boards/msc01_pci.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips64/mips-boards/msc01_pci.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,244 @@
+/*
+ * mcs01_pci.h
+ *
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2002 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ * PCI Register definitions for the MIPS System Controller.
+ */
+#ifndef MSC01_PCI_H
+#define MSC01_PCI_H
+
+/*****************************************************************************
+ * Register offset addresses
+ ****************************************************************************/
+
+#define MSC01_PCI_ID_OFS		0x0000
+#define MSC01_PCI_SC2PMBASL_OFS		0x0208
+#define MSC01_PCI_SC2PMMSKL_OFS		0x0218
+#define MSC01_PCI_SC2PMMAPL_OFS		0x0228
+#define MSC01_PCI_SC2PIOBASL_OFS	0x0248
+#define MSC01_PCI_SC2PIOMSKL_OFS	0x0258
+#define MSC01_PCI_SC2PIOMAPL_OFS	0x0268
+#define MSC01_PCI_P2SCMSKL_OFS		0x0308
+#define MSC01_PCI_P2SCMAPL_OFS		0x0318
+#define MSC01_PCI_INTCFG_OFS		0x0600
+#define MSC01_PCI_INTSTAT_OFS		0x0608
+#define MSC01_PCI_CFGADDR_OFS		0x0610
+#define MSC01_PCI_CFGDATA_OFS		0x0618
+#define MSC01_PCI_IACK_OFS		0x0620
+#define MSC01_PCI_HEAD0_OFS		0x2000  /* DevID, VendorID */
+#define MSC01_PCI_HEAD1_OFS		0x2008  /* Status, Command */
+#define MSC01_PCI_HEAD2_OFS		0x2010  /* Class code, RevID */
+#define MSC01_PCI_HEAD3_OFS		0x2018  /* bist, header, latency */
+#define MSC01_PCI_HEAD4_OFS		0x2020  /* BAR 0 */
+#define MSC01_PCI_HEAD5_OFS		0x2028  /* BAR 1 */
+#define MSC01_PCI_HEAD6_OFS		0x2030  /* BAR 2 */
+#define MSC01_PCI_HEAD7_OFS		0x2038  /* BAR 3 */
+#define MSC01_PCI_HEAD8_OFS		0x2040  /* BAR 4 */
+#define MSC01_PCI_HEAD9_OFS		0x2048  /* BAR 5 */
+#define MSC01_PCI_HEAD10_OFS		0x2050  /* CardBus CIS Ptr */
+#define MSC01_PCI_HEAD11_OFS		0x2058  /* SubSystem ID, -VendorID */
+#define MSC01_PCI_HEAD12_OFS		0x2060  /* ROM BAR */
+#define MSC01_PCI_HEAD13_OFS		0x2068  /* Capabilities ptr */
+#define MSC01_PCI_HEAD14_OFS		0x2070  /* reserved */
+#define MSC01_PCI_HEAD15_OFS		0x2078  /* Maxl, ming, intpin, int */
+#define MSC01_PCI_BAR0_OFS		0x2220
+#define MSC01_PCI_CFG_OFS		0x2380
+#define MSC01_PCI_SWAP_OFS		0x2388
+
+
+/*****************************************************************************
+ * Register encodings
+ ****************************************************************************/
+
+#define MSC01_PCI_ID_ID_SHF		16
+#define MSC01_PCI_ID_ID_MSK		0x00ff0000
+#define MSC01_PCI_ID_ID_HOSTBRIDGE	82
+#define MSC01_PCI_ID_MAR_SHF		8
+#define MSC01_PCI_ID_MAR_MSK		0x0000ff00
+#define MSC01_PCI_ID_MIR_SHF		0
+#define MSC01_PCI_ID_MIR_MSK		0x000000ff
+
+#define MSC01_PCI_SC2PMBASL_BAS_SHF	24
+#define MSC01_PCI_SC2PMBASL_BAS_MSK	0xff000000
+
+#define MSC01_PCI_SC2PMMSKL_MSK_SHF	24
+#define MSC01_PCI_SC2PMMSKL_MSK_MSK	0xff000000
+
+#define MSC01_PCI_SC2PMMAPL_MAP_SHF	24
+#define MSC01_PCI_SC2PMMAPL_MAP_MSK	0xff000000
+
+#define MSC01_PCI_SC2PIOBASL_BAS_SHF	24
+#define MSC01_PCI_SC2PIOBASL_BAS_MSK	0xff000000
+
+#define MSC01_PCI_SC2PIOMSKL_MSK_SHF	24
+#define MSC01_PCI_SC2PIOMSKL_MSK_MSK	0xff000000
+
+#define MSC01_PCI_SC2PIOMAPL_MAP_SHF	24
+#define MSC01_PCI_SC2PIOMAPL_MAP_MSK	0xff000000
+
+#define MSC01_PCI_P2SCMSKL_MSK_SHF	24
+#define MSC01_PCI_P2SCMSKL_MSK_MSK	0xff000000
+
+#define MSC01_PCI_P2SCMAPL_MAP_SHF	24
+#define MSC01_PCI_P2SCMAPL_MAP_MSK	0xff000000
+
+#define MSC01_PCI_INTCFG_RST_SHF        10
+#define MSC01_PCI_INTCFG_RST_MSK        0x00000400
+#define MSC01_PCI_INTCFG_RST_BIT        0x00000400
+#define MSC01_PCI_INTCFG_MWE_SHF        9
+#define MSC01_PCI_INTCFG_MWE_MSK        0x00000200
+#define MSC01_PCI_INTCFG_MWE_BIT        0x00000200
+#define MSC01_PCI_INTCFG_DTO_SHF        8
+#define MSC01_PCI_INTCFG_DTO_MSK        0x00000100
+#define MSC01_PCI_INTCFG_DTO_BIT        0x00000100 
+#define MSC01_PCI_INTCFG_MA_SHF         7
+#define MSC01_PCI_INTCFG_MA_MSK         0x00000080
+#define MSC01_PCI_INTCFG_MA_BIT         0x00000080
+#define MSC01_PCI_INTCFG_TA_SHF         6
+#define MSC01_PCI_INTCFG_TA_MSK         0x00000040
+#define MSC01_PCI_INTCFG_TA_BIT         0x00000040
+#define MSC01_PCI_INTCFG_RTY_SHF        5
+#define MSC01_PCI_INTCFG_RTY_MSK        0x00000020
+#define MSC01_PCI_INTCFG_RTY_BIT        0x00000020
+#define MSC01_PCI_INTCFG_MWP_SHF        4
+#define MSC01_PCI_INTCFG_MWP_MSK        0x00000010
+#define MSC01_PCI_INTCFG_MWP_BIT        0x00000010
+#define MSC01_PCI_INTCFG_MRP_SHF        3
+#define MSC01_PCI_INTCFG_MRP_MSK        0x00000008
+#define MSC01_PCI_INTCFG_MRP_BIT        0x00000008
+#define MSC01_PCI_INTCFG_SWP_SHF        2
+#define MSC01_PCI_INTCFG_SWP_MSK        0x00000004
+#define MSC01_PCI_INTCFG_SWP_BIT        0x00000004
+#define MSC01_PCI_INTCFG_SRP_SHF        1
+#define MSC01_PCI_INTCFG_SRP_MSK        0x00000002
+#define MSC01_PCI_INTCFG_SRP_BIT        0x00000002
+#define MSC01_PCI_INTCFG_SE_SHF         0
+#define MSC01_PCI_INTCFG_SE_MSK         0x00000001
+#define MSC01_PCI_INTCFG_SE_BIT         0x00000001
+
+#define MSC01_PCI_INTSTAT_RST_SHF       10
+#define MSC01_PCI_INTSTAT_RST_MSK       0x00000400
+#define MSC01_PCI_INTSTAT_RST_BIT       0x00000400
+#define MSC01_PCI_INTSTAT_MWE_SHF       9
+#define MSC01_PCI_INTSTAT_MWE_MSK       0x00000200
+#define MSC01_PCI_INTSTAT_MWE_BIT       0x00000200
+#define MSC01_PCI_INTSTAT_DTO_SHF       8
+#define MSC01_PCI_INTSTAT_DTO_MSK       0x00000100
+#define MSC01_PCI_INTSTAT_DTO_BIT       0x00000100 
+#define MSC01_PCI_INTSTAT_MA_SHF        7
+#define MSC01_PCI_INTSTAT_MA_MSK        0x00000080
+#define MSC01_PCI_INTSTAT_MA_BIT        0x00000080
+#define MSC01_PCI_INTSTAT_TA_SHF        6
+#define MSC01_PCI_INTSTAT_TA_MSK        0x00000040
+#define MSC01_PCI_INTSTAT_TA_BIT        0x00000040
+#define MSC01_PCI_INTSTAT_RTY_SHF       5
+#define MSC01_PCI_INTSTAT_RTY_MSK       0x00000020
+#define MSC01_PCI_INTSTAT_RTY_BIT       0x00000020
+#define MSC01_PCI_INTSTAT_MWP_SHF       4
+#define MSC01_PCI_INTSTAT_MWP_MSK       0x00000010
+#define MSC01_PCI_INTSTAT_MWP_BIT       0x00000010
+#define MSC01_PCI_INTSTAT_MRP_SHF       3
+#define MSC01_PCI_INTSTAT_MRP_MSK       0x00000008
+#define MSC01_PCI_INTSTAT_MRP_BIT       0x00000008
+#define MSC01_PCI_INTSTAT_SWP_SHF       2
+#define MSC01_PCI_INTSTAT_SWP_MSK       0x00000004
+#define MSC01_PCI_INTSTAT_SWP_BIT       0x00000004
+#define MSC01_PCI_INTSTAT_SRP_SHF       1
+#define MSC01_PCI_INTSTAT_SRP_MSK       0x00000002
+#define MSC01_PCI_INTSTAT_SRP_BIT       0x00000002
+#define MSC01_PCI_INTSTAT_SE_SHF        0
+#define MSC01_PCI_INTSTAT_SE_MSK        0x00000001
+#define MSC01_PCI_INTSTAT_SE_BIT        0x00000001
+
+#define MSC01_PCI_CFGADDR_BNUM_SHF	16
+#define MSC01_PCI_CFGADDR_BNUM_MSK	0x00ff0000
+#define MSC01_PCI_CFGADDR_DNUM_SHF	11
+#define MSC01_PCI_CFGADDR_DNUM_MSK	0x0000f800
+#define MSC01_PCI_CFGADDR_FNUM_SHF	8
+#define MSC01_PCI_CFGADDR_FNUM_MSK	0x00000700
+#define MSC01_PCI_CFGADDR_RNUM_SHF	2
+#define MSC01_PCI_CFGADDR_RNUM_MSK	0x000000fc
+
+#define MSC01_PCI_CFGDATA_DATA_SHF	0
+#define MSC01_PCI_CFGDATA_DATA_MSK	0xffffffff
+
+/* The defines below are ONLY valid for a MEM bar! */
+#define MSC01_PCI_BAR0_SIZE_SHF	        4
+#define MSC01_PCI_BAR0_SIZE_MSK	        0xfffffff0
+#define MSC01_PCI_BAR0_P_SHF	        3
+#define MSC01_PCI_BAR0_P_MSK	        0x00000008
+#define MSC01_PCI_BAR0_P_BIT	        MSC01_PCI_BAR0_P_MSK
+#define MSC01_PCI_BAR0_D_SHF	        1
+#define MSC01_PCI_BAR0_D_MSK	        0x00000006
+#define MSC01_PCI_BAR0_T_SHF	        0
+#define MSC01_PCI_BAR0_T_MSK	        0x00000001
+#define MSC01_PCI_BAR0_T_BIT	        MSC01_PCI_BAR0_T_MSK
+
+
+#define MSC01_PCI_CFG_RA_SHF	        17
+#define MSC01_PCI_CFG_RA_MSK	        0x00020000
+#define MSC01_PCI_CFG_RA_BIT	        MSC01_PCI_CFG_RA_MSK
+#define MSC01_PCI_CFG_G_SHF	        16
+#define MSC01_PCI_CFG_G_MSK	        0x00010000
+#define MSC01_PCI_CFG_G_BIT	        MSC01_PCI_CFG_G_MSK
+#define MSC01_PCI_CFG_EN_SHF	        15
+#define MSC01_PCI_CFG_EN_MSK	        0x00008000
+#define MSC01_PCI_CFG_EN_BIT	        MSC01_PCI_CFG_EN_MSK
+#define MSC01_PCI_CFG_MAXRTRY_SHF       0
+#define MSC01_PCI_CFG_MAXRTRY_MSK       0x000000ff
+
+#define MSC01_PCI_SWAP_IO_SHF		18
+#define MSC01_PCI_SWAP_IO_MSK		0x000c0000
+#define MSC01_PCI_SWAP_MEM_SHF		16
+#define MSC01_PCI_SWAP_MEM_MSK		0x00030000
+#define MSC01_PCI_SWAP_BAR0_SHF		0
+#define MSC01_PCI_SWAP_BAR0_MSK		0x00000003
+#define MSC01_PCI_SWAP_NOSWAP		0
+#define MSC01_PCI_SWAP_BYTESWAP		1
+
+/*****************************************************************************
+ * Registers absolute addresses
+ ****************************************************************************/
+
+#define MSC01_PCI_ID            (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS)
+#define MSC01_PCI_SC2PMBASL     (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS)
+#define MSC01_PCI_SC2PMMSKL     (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS)
+#define MSC01_PCI_SC2PMMAPL     (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS)
+#define MSC01_PCI_SC2PIOBASL    (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS)
+#define MSC01_PCI_SC2PIOMSKL    (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS)
+#define MSC01_PCI_SC2PIOMAPL    (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS)
+#define MSC01_PCI_P2SCMSKL      (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS)
+#define MSC01_PCI_P2SCMAPL      (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS)
+#define MSC01_PCI_INTCFG        (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS)
+#define MSC01_PCI_INTSTAT       (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS)
+#define MSC01_PCI_CFGADDR       (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS)
+#define MSC01_PCI_CFGDATA       (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS)
+#define MSC01_PCI_IACK		(MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS)
+#define MSC01_PCI_HEAD0		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS)
+#define MSC01_PCI_HEAD1		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS)
+#define MSC01_PCI_HEAD2		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD2_OFS)
+#define MSC01_PCI_HEAD3		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD3_OFS)
+#define MSC01_PCI_HEAD4		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD4_OFS)
+#define MSC01_PCI_HEAD5		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD5_OFS)
+#define MSC01_PCI_HEAD6		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD6_OFS)
+#define MSC01_PCI_HEAD7		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD7_OFS)
+#define MSC01_PCI_HEAD8		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD8_OFS)
+#define MSC01_PCI_HEAD9		(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD9_OFS)
+#define MSC01_PCI_HEAD10	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD10_OFS)
+#define MSC01_PCI_HEAD11	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD12	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD13	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD14	(MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_HEAD15        (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS)
+#define MSC01_PCI_BAR0		(MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS)
+#define MSC01_PCI_CFG		(MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS)
+#define MSC01_PCI_SWAP		(MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS)
+
+#endif
+/*****************************************************************************
+ *  End of msc01_pci.h
+ *****************************************************************************/
diff -urN linux-2.4.19-rc1/include/asm-mips64/mipsregs.h linux-2.4.19-rc2/include/asm-mips64/mipsregs.h
--- linux-2.4.19-rc1/include/asm-mips64/mipsregs.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/mipsregs.h	Tue Jul 16 16:25:21 2002
@@ -12,6 +12,7 @@
 #ifndef _ASM_MIPSREGS_H
 #define _ASM_MIPSREGS_H
 
+#include <linux/config.h>
 #include <linux/linkage.h>
 
 /*
@@ -52,12 +53,15 @@
 #define CP0_XCONTEXT $20
 #define CP0_FRAMEMASK $21
 #define CP0_DIAGNOSTIC $22
+#define CP0_DEBUG $23
+#define CP0_DEPC $24
 #define CP0_PERFORMANCE $25
 #define CP0_ECC $26
 #define CP0_CACHEERR $27
 #define CP0_TAGLO $28
 #define CP0_TAGHI $29
 #define CP0_ERROREPC $30
+#define CP0_DESAVE $31
 
 /*
  * R4640/R4650 cp0 register names.  These registers are listed
@@ -146,7 +150,6 @@
 /*
  * Values for PageMask register
  */
-#include <linux/config.h>
 #ifdef CONFIG_CPU_VR41XX
 
 /* Why doesn't stupidity hurt ... */
@@ -441,7 +444,34 @@
 #define CEB_KERNEL	2	/* Count events in kernel mode EXL = ERL = 0 */
 #define CEB_EXL		1	/* Count events with EXL = 1, ERL = 0 */
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
+
+/*
+ * Functions to access the r10k performance counter and control registers
+ */
+#define read_r10k_perf_cntr(counter)                            \
+({ unsigned int __res;                                          \
+        __asm__ __volatile__(                                   \
+        "mfpc\t%0, "STR(counter)                                \
+        : "=r" (__res));                                        \
+        __res;})
+
+#define write_r10k_perf_cntr(counter,val)                       \
+        __asm__ __volatile__(                                   \
+        "mtpc\t%0, "STR(counter)                                \
+        : : "r" (val));
+
+#define read_r10k_perf_cntl(counter)                            \
+({ unsigned int __res;                                          \
+        __asm__ __volatile__(                                   \
+        "mfps\t%0, "STR(counter)                                \
+        : "=r" (__res));                                        \
+        __res;})
+
+#define write_r10k_perf_cntl(counter,val)                       \
+        __asm__ __volatile__(                                   \
+        "mtps\t%0, "STR(counter)                                \
+        : : "r" (val));
 
 /*
  * Macros to access the system control coprocessor
@@ -887,6 +917,6 @@
 	if (mips_cpu.options & MIPS_CPU_FPU)				\
 		__disable_fpu();					\
 } while (0)
-#endif /* defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_MIPSREGS_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/mmu_context.h linux-2.4.19-rc2/include/asm-mips64/mmu_context.h
--- linux-2.4.19-rc1/include/asm-mips64/mmu_context.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/mmu_context.h	Tue Jul 16 16:25:21 2002
@@ -27,7 +27,7 @@
 #define TLBMISS_HANDLER_SETUP_PGD(pgd) \
 	pgd_current[smp_processor_id()] = (unsigned long)(pgd)
 #define TLBMISS_HANDLER_SETUP() \
-	set_context((unsigned long) smp_processor_id() << (23 + 3)); \
+	set_context(((long)(&pgd_current[smp_processor_id()])) << 23); \
 	TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
 extern unsigned long pgd_current[];
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/page.h linux-2.4.19-rc2/include/asm-mips64/page.h
--- linux-2.4.19-rc1/include/asm-mips64/page.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/page.h	Tue Jul 16 16:25:21 2002
@@ -18,7 +18,7 @@
 
 #ifdef __KERNEL__
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
 #define PAGE_BUG(page) do {  BUG(); } while (0)
@@ -70,7 +70,7 @@
 	return order;
 }
 
-#endif /* _LANGUAGE_ASSEMBLY */
+#endif /* !__ASSEMBLY__ */
 
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
diff -urN linux-2.4.19-rc1/include/asm-mips64/pci/bridge.h linux-2.4.19-rc2/include/asm-mips64/pci/bridge.h
--- linux-2.4.19-rc1/include/asm-mips64/pci/bridge.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/pci/bridge.h	Tue Jul 16 16:25:21 2002
@@ -41,7 +41,7 @@
  *    Bridge address map
  */
 
-#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#ifndef __ASSEMBLY__
 
 /*
  * All accesses to bridge hardware registers must be done
@@ -283,7 +283,7 @@
 } bridge_err_cmdword_t;
 
 #define berr_field	berr_un.berr_st
-#endif	/* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /*
  * The values of these macros can and should be crosschecked
@@ -793,7 +793,7 @@
 #define PCI64_ATTR_RMF_MASK	0x00ff000000000000
 #define PCI64_ATTR_RMF_SHFT	48
 
-#if LANGUAGE_C
+#ifndef __ASSEMBLY__
 /* Address translation entry for mapped pci32 accesses */
 typedef union ate_u {
 	u64	ent;
@@ -809,7 +809,7 @@
 		u64	valid:1;
 	} field;
 } ate_t;
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #define ATE_V		0x01
 #define ATE_CO		0x02
diff -urN linux-2.4.19-rc1/include/asm-mips64/pci.h linux-2.4.19-rc2/include/asm-mips64/pci.h
--- linux-2.4.19-rc1/include/asm-mips64/pci.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/pci.h	Tue Jul 16 16:25:21 2002
@@ -122,7 +122,7 @@
 					size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 #ifdef CONFIG_NONCOHERENT_IO
 	dma_cache_wback_inv((unsigned long)ptr, size);
@@ -142,7 +142,7 @@
 				    size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	/* Nothing to do */
 }
@@ -166,7 +166,7 @@
 	unsigned long addr;
 
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	addr = (unsigned long) page_address(page) + offset;
 #ifdef CONFIG_NONCOHERENT_IO
@@ -180,7 +180,7 @@
 				  size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 	/* Nothing to do */
 }
 
@@ -206,7 +206,7 @@
 	int i;
 
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	/* Make sure that gcc doesn't leave the empty loop body.  */
 	for (i = 0; i < nents; i++, sg++) {
@@ -228,7 +228,7 @@
 				int nents, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	/* Nothing to do */
 }
@@ -248,7 +248,7 @@
 				       size_t size, int direction)
 {
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 #ifdef CONFIG_NONCOHERENT_IO
 	dma_cache_wback_inv((unsigned long)__va(dma_handle - bus_to_baddr[hwdev->bus->number]), size);
 #endif
@@ -270,7 +270,7 @@
 #endif
 
 	if (direction == PCI_DMA_NONE)
-		BUG();
+		out_of_line_bug();
 
 	/*  Make sure that gcc doesn't leave the empty loop body.  */
 #ifdef CONFIG_NONCOHERENT_IO
diff -urN linux-2.4.19-rc1/include/asm-mips64/pgtable.h linux-2.4.19-rc2/include/asm-mips64/pgtable.h
--- linux-2.4.19-rc1/include/asm-mips64/pgtable.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/pgtable.h	Tue Jul 16 16:25:21 2002
@@ -13,11 +13,12 @@
 #include <asm/addrspace.h>
 #include <asm/page.h>
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 #include <linux/linkage.h>
 #include <linux/mmzone.h>
 #include <asm/cachectl.h>
+#include <asm/io.h>
 
 /* Cache flushing:
  *
@@ -66,24 +67,34 @@
 #define flush_cache_page(vma,page)	do { } while(0)
 #define flush_page_to_ram(page)		do { } while(0)
 #define flush_icache_range(start, end)	_flush_cache_l1()
-#define flush_icache_user_range(vma, page, addr, len)	\
-					flush_icache_page((vma), (page))
+#define flush_icache_user_range(vma, page, addr, len) \
+	flush_icache_page((vma), (page))
 #define flush_icache_page(vma, page)					\
 do {									\
 	if ((vma)->vm_flags & VM_EXEC)					\
-		andes_flush_icache_page(page_address(page));		\
+		andes_flush_icache_page(phys_to_virt(page_to_phys(page))); \
 } while (0)
 
 #else
 
+extern void (*_flush_icache_all)(void);
+extern void (*_flush_icache_range)(unsigned long start, unsigned long end);
+extern void (*_flush_icache_page)(struct vm_area_struct *vma, struct page *page);
+
 #define flush_cache_mm(mm)		_flush_cache_mm(mm)
 #define flush_cache_range(mm,start,end)	_flush_cache_range(mm,start,end)
 #define flush_cache_page(vma,page)	_flush_cache_page(vma, page)
 #define flush_page_to_ram(page)		_flush_page_to_ram(page)
 #define flush_icache_range(start, end)	_flush_icache_range(start, end)
-#define flush_icache_user_range(vma, page, addr, len)	\
-					flush_icache_page((vma), (page))
+#define flush_icache_user_range(vma, page, addr, len) \
+	flush_icache_page((vma), (page))
 #define flush_icache_page(vma, page)	_flush_icache_page(vma, page)
+#ifdef CONFIG_VTAG_ICACHE
+#define flush_icache_all()		_flush_icache_all()
+#else
+#define flush_icache_all()		do { } while(0)
+#endif
+
 
 #endif /* !CONFIG_CPU_R10000 */
 
@@ -117,7 +128,7 @@
  * vmalloc range translations, which the fault handler looks at.
  */
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 
 /* PMD_SHIFT determines the size of the area a second-level page table can map */
 #define PMD_SHIFT	(PAGE_SHIFT + (PAGE_SHIFT - 3))
@@ -181,7 +192,7 @@
 #define _CACHE_CACHABLE_CE          (4<<9)  /* R4[04]00 only           */
 #define _CACHE_CACHABLE_COW         (5<<9)  /* R4[04]00 only           */
 #define _CACHE_CACHABLE_CUW         (6<<9)  /* R4[04]00 only           */
-#define _CACHE_CACHABLE_ACCELERATED (7<<9)  /* R10000 only             */
+#define _CACHE_UNCACHED_ACCELERATED (7<<9)  /* R10000 only             */
 #define _CACHE_MASK                 (7<<9)
 
 #define __READABLE	(_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED)
@@ -236,7 +247,7 @@
 #define __S110	PAGE_SHARED
 #define __S111	PAGE_SHARED
 
-#if !defined (_LANGUAGE_ASSEMBLY)
+#ifndef __ASSEMBLY__
 
 #define pte_ERROR(e) \
 	printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
@@ -477,8 +488,8 @@
 #define PAGE_TO_PA(page)	((page - mem_map) << PAGE_SHIFT)
 #else
 #define PAGE_TO_PA(page) \
-		((((page)-(page)->zone->zone_mem_map) << PAGE_SHIFT) \
-		+ ((page)->zone->zone_start_paddr))
+		((((page) - page_zone(page)->zone_mem_map) << PAGE_SHIFT) \
+		  + (page_zone(page)->zone_start_paddr))
 #endif
 #define mk_pte(page, pgprot)						\
 ({									\
@@ -566,6 +577,12 @@
 
 #include <asm-generic/pgtable.h>
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+/*
+ * We provide our own get_unmapped area to cope with the virtual aliasing
+ * constraints placed on us by the cache architecture.
+ */
+#define HAVE_ARCH_UNMAPPED_AREA
+
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_PGTABLE_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/posix_types.h linux-2.4.19-rc2/include/asm-mips64/posix_types.h
--- linux-2.4.19-rc1/include/asm-mips64/posix_types.h	Sun Jul  9 22:18:15 2000
+++ linux-2.4.19-rc2/include/asm-mips64/posix_types.h	Tue Jul 16 16:25:21 2002
@@ -26,7 +26,7 @@
 typedef int		__kernel_gid_t;
 typedef unsigned long	__kernel_size_t;
 typedef long		__kernel_ssize_t;
-typedef long		 __kernel_ptrdiff_t;
+typedef long		__kernel_ptrdiff_t;
 typedef long		__kernel_time_t;
 typedef long		__kernel_suseconds_t;
 typedef long		__kernel_clock_t;
diff -urN linux-2.4.19-rc1/include/asm-mips64/processor.h linux-2.4.19-rc2/include/asm-mips64/processor.h
--- linux-2.4.19-rc1/include/asm-mips64/processor.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/processor.h	Tue Jul 16 16:25:21 2002
@@ -15,43 +15,27 @@
 
 /*
  * Return current * instruction pointer ("program counter").
- *
- * Two implementations.  The ``la'' version results in shorter code for
- * the kernel which we assume to reside in the 32-bit compat address space.
- * The  ``jal'' version is for use by modules which live in outer space.
- * This is just a single instruction unlike the long dla macro expansion.
  */
-#ifdef MODULE
 #define current_text_addr()						\
 ({									\
 	void *_a;							\
 									\
-	__asm__ ("jal\t1f, %0\n\t"					\
-		"1:"							\
-		: "=r" (_a));						\
+	__asm__ ("bal\t1f\t\t\t# current_text_addr\n"			\
+		"1:\tmove\t%0, $31"					\
+		: "=r" (_a)						\
+		:							\
+		: "$31");						\
 									\
 	_a;								\
 })
-#else
-#define current_text_addr()						\
-({									\
-	void *_a;							\
-									\
-	__asm__ ("dla\t%0, 1f\n\t"					\
-		"1:"							\
-		: "=r" (_a));						\
-									\
-	_a;								\
-})
-#endif
 
-#if !defined (_LANGUAGE_ASSEMBLY)
+#ifndef __ASSEMBLY__
 #include <asm/cachectl.h>
 #include <asm/mipsregs.h>
 #include <asm/reg.h>
 #include <asm/system.h>
 
-#if (defined(CONFIG_SGI_IP27))
+#if defined(CONFIG_SGI_IP27)
 #include <asm/sn/types.h>
 #include <asm/sn/intr_public.h>
 #endif
@@ -210,7 +194,7 @@
 	unsigned long irix_oldctx;
 };
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 
 #define INIT_THREAD  { \
         /* \
@@ -240,7 +224,7 @@
 
 #define KERNEL_STACK_SIZE 0x4000
 
-#if !defined (_LANGUAGE_ASSEMBLY)
+#ifndef __ASSEMBLY__
 
 /* Free all resources held by a thread. */
 #define release_thread(thread) do { } while(0)
@@ -306,7 +290,7 @@
 
 #define cpu_relax()	do { } while (0)
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* !__ASSEMBLY__ */
 #endif /* __KERNEL__ */
 
 /*
diff -urN linux-2.4.19-rc1/include/asm-mips64/ptrace.h linux-2.4.19-rc2/include/asm-mips64/ptrace.h
--- linux-2.4.19-rc1/include/asm-mips64/ptrace.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/ptrace.h	Tue Jul 16 16:25:21 2002
@@ -19,7 +19,7 @@
 #define FPC_CSR		69
 #define FPC_EIR		70
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 #define abi64_no_regargs						\
 	unsigned long __dummy0,						\
@@ -52,7 +52,7 @@
 	unsigned long cp0_cause;
 };
 
-#endif /* !(_LANGUAGE_ASSEMBLY__) */
+#endif /* !__ASSEMBLY__ */
 
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 /* #define PTRACE_GETREGS		12 */
@@ -67,16 +67,16 @@
 /* options set using PTRACE_SETOPTIONS */
 #define PTRACE_O_TRACESYSGOOD	0x00000001
 
-#ifdef _LANGUAGE_ASSEMBLY
+#ifdef __ASSEMBLY__
 #include <asm/offset.h>
-#endif /* (_LANGUAGE_ASSEMBLY__) */
+#endif /* !__ASSEMBLY__ */
 
 #ifdef __KERNEL__
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 #define instruction_pointer(regs) ((regs)->cp0_epc)
 
-#endif /* !(_LANGUAGE_ASSEMBLY__) */
+#endif /* !__ASSEMBLY__ */
 
 #endif
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/serial.h linux-2.4.19-rc2/include/asm-mips64/serial.h
--- linux-2.4.19-rc1/include/asm-mips64/serial.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/serial.h	Tue Jul 16 16:25:21 2002
@@ -9,6 +9,8 @@
 #ifndef _ASM_SERIAL_H
 #define _ASM_SERIAL_H
 
+#include <linux/config.h>
+
 /*
  * This assumes you have a 1.8432 MHz clock for your UART.
  *
diff -urN linux-2.4.19-rc1/include/asm-mips64/sibyte/sb1250_defs.h linux-2.4.19-rc2/include/asm-mips64/sibyte/sb1250_defs.h
--- linux-2.4.19-rc1/include/asm-mips64/sibyte/sb1250_defs.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/sibyte/sb1250_defs.h	Tue Jul 16 16:25:21 2002
@@ -80,7 +80,7 @@
  * Note: you'll need to define uint32_t and uint64_t in your headers.
  */
 
-#if !defined(__ASSEMBLER__)
+#if !defined(__ASSEMBLY__)
 #define _SB_MAKE64(x) ((uint64_t)(x))
 #define _SB_MAKE32(x) ((uint32_t)(x))
 #else
@@ -119,9 +119,9 @@
  */
 
 
-#if !defined(__ASSEMBLER__)
+#if !defined(__ASSEMBLY__)
 #define SBWRITECSR(csr,val) *((volatile uint64_t *) PHYS_TO_K1(csr)) = (val)
 #define SBREADCSR(csr) (*((volatile uint64_t *) PHYS_TO_K1(csr)))
-#endif /* __ASSEMBLER__ */
+#endif /* __ASSEMBLY__ */
 
 #endif
diff -urN linux-2.4.19-rc1/include/asm-mips64/sibyte/sbmips.h linux-2.4.19-rc2/include/asm-mips64/sibyte/sbmips.h
--- linux-2.4.19-rc1/include/asm-mips64/sibyte/sbmips.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/sibyte/sbmips.h	Tue Jul 16 16:25:21 2002
@@ -36,7 +36,7 @@
     *  Configure language
     ********************************************************************* */
 
-#if defined(__ASSEMBLER__)
+#if defined(__ASSEMBLY__)
 #define _ATYPE_
 #define _ATYPE32_
 #define _ATYPE64_
@@ -81,7 +81,7 @@
     *  32-bit MIPS Address Spaces
     ********************************************************************* */
 
-#ifdef __ASSEMBLER__
+#ifdef __ASSEMBLY__
 #define _ACAST32_
 #define _ACAST64_
 #else
@@ -133,7 +133,7 @@
 #define XKPHYS_TO_PHYS(p) ((p) & _SB_MAKEMASK(0,59))
 
 
-#if !defined(__ASSEMBLER__)
+#if !defined(__ASSEMBLY__)
 #define mips_wbflush()  __asm__ __volatile__ ("sync" : : : "memory")
 #define	ISK0SEG(va)	((va) >= K0BASE && (va) <= (K0BASE + K0SIZE - 1))
 #define	ISK1SEG(va)	((va) >= K1BASE && (va) <= (K1BASE + K1SIZE - 1))
@@ -143,7 +143,7 @@
     *  Register aliases
     ********************************************************************* */
 
-#if defined(__ASSEMBLER__)
+#if defined(__ASSEMBLY__)
 #define zero		$0
 #define	AT		$1		/* assembler temporaries */
 #define	v0		$2		/* value holders */
@@ -187,7 +187,7 @@
     *  CP0 Registers 
     ********************************************************************* */
 
-#if defined(__ASSEMBLER__)
+#if defined(__ASSEMBLY__)
 #define C0_INX		$0		/* CP0: TLB Index */
 #define C0_RAND		$1		/* CP0: TLB Random */
 #define C0_TLBLO0	$2		/* CP0: TLB EntryLo0 */
@@ -256,7 +256,7 @@
     *  Macros for generating assembly language routines
     ********************************************************************* */
 
-#if defined(__ASSEMBLER__)
+#if defined(__ASSEMBLY__)
 
 /* global leaf function (does not call other functions) */
 #define LEAF(name)		\
@@ -442,7 +442,7 @@
 
 /* FPU stuff */
 
-#if defined(__ASSEMBLER__)
+#if defined(__ASSEMBLY__)
 #define C1_CSR		$31
 #define C1_FRID		$0
 #else
diff -urN linux-2.4.19-rc1/include/asm-mips64/smp.h linux-2.4.19-rc2/include/asm-mips64/smp.h
--- linux-2.4.19-rc1/include/asm-mips64/smp.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/smp.h	Tue Jul 16 16:25:21 2002
@@ -6,7 +6,6 @@
  * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
  * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
  */
-
 #ifndef __ASM_SMP_H
 #define __ASM_SMP_H
 
@@ -42,7 +41,7 @@
 typedef unsigned long   cpumask_t;
 
 #define CPUMASK_CLRALL(p)	(p) = 0
-#define CPUMASK_SETB(p, bit)	(p) |= 1 << (bit)
+#define CPUMASK_SETB(p, bit)	(p) |= 1UL << (bit)
 #define CPUMASK_CLRB(p, bit)	(p) &= ~(1ULL << (bit))
 #define CPUMASK_TSTB(p, bit)	((p) & (1ULL << (bit)))
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/addrs.h linux-2.4.19-rc2/include/asm-mips64/sn/addrs.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/addrs.h	Wed Jul 12 15:15:10 2000
+++ linux-2.4.19-rc2/include/asm-mips64/sn/addrs.h	Tue Jul 16 16:25:21 2002
@@ -11,9 +11,9 @@
 
 #include <linux/config.h>
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 #include <linux/types.h>
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #include <asm/addrspace.h>
 #include <asm/reg.h>
@@ -26,7 +26,7 @@
 #endif
 
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 #if defined(CONFIG_SGI_IO)	/* FIXME */
 #define PS_UINT_CAST		(__psunsigned_t)
@@ -38,13 +38,13 @@
 
 #define HUBREG_CAST		(volatile hubreg_t *)
 
-#elif _LANGUAGE_ASSEMBLY
+#else /* __ASSEMBLY__ */
 
 #define PS_UINT_CAST
 #define UINT64_CAST
 #define HUBREG_CAST
 
-#endif
+#endif /* __ASSEMBLY__ */
 
 
 #define NASID_GET_META(_n)	((_n) >> NASID_LOCAL_BITS)
@@ -278,7 +278,7 @@
 					      0x800000 + (_x)))
 #endif /* CONFIG_SGI_IP27 */
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 #define HUB_L(_a)			*(_a)
 #define	HUB_S(_a, _d)			*(_a) = (_d)
@@ -290,7 +290,7 @@
 #define REMOTE_HUB_PI_L(_n, _sn, _r)	HUB_L(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)))
 #define REMOTE_HUB_PI_S(_n, _sn, _r, _d) HUB_S(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)), (_d))
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /*
  * The following macros are used to get to a hub/bridge register, given
@@ -367,7 +367,7 @@
 #define	KLI_KERN_XP		8
 #define	KLI_KERN_PARTID		9
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 #define KLD_BASE(nasid)		((kldir_ent_t *) KLDIR_ADDR(nasid))
 #define KLD_LAUNCH(nasid)	(KLD_BASE(nasid) + KLI_LAUNCH)
@@ -453,7 +453,7 @@
 
 #define GPDA_ADDR(nasid)	TO_NODE_CAC(nasid, GPDA_OFFSET)
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 
 #endif /* _ASM_SN_ADDRS_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/arch.h linux-2.4.19-rc2/include/asm-mips64/sn/arch.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/arch.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/arch.h	Tue Jul 16 16:25:21 2002
@@ -20,7 +20,7 @@
 #endif
 
 
-#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#ifndef __ASSEMBLY__
 #if !defined(CONFIG_SGI_IO)
 typedef u64	hubreg_t;
 typedef u64	nic_t;
@@ -44,7 +44,7 @@
 #define makespnum(_nasid, _slice)					\
 		(((_nasid) << CPUS_PER_NODE_SHFT) | (_slice))
 
-#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#ifndef __ASSEMBLY__
 
 #define INVALID_NASID		(nasid_t)-1
 #define INVALID_CNODEID		(cnodeid_t)-1
@@ -102,7 +102,7 @@
 
 extern int node_getlastslot(cnodeid_t);
 
-#endif /* _LANGUAGE_C || _LANGUAGE_C_PLUS_PLUS */
+#endif /* !__ASSEMBLY__ */
 
 #define SLOT_BITMASK    	(MAX_MEM_SLOTS - 1)
 #define SLOT_SIZE		(1LL<<SLOT_SHIFT)
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/gda.h linux-2.4.19-rc2/include/asm-mips64/sn/gda.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/gda.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/gda.h	Tue Jul 16 16:25:21 2002
@@ -41,7 +41,7 @@
 #define G_PARTIDOFF	40
 #define G_TABLEOFF	128
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 typedef struct gda {
 	u32	g_magic;	/* GDA magic number */
@@ -67,7 +67,7 @@
 
 #define GDA ((gda_t*) GDA_ADDR(get_nasid()))
 
-#endif /* __LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 /*
  * Define:	PART_GDA_VERSION
  * Purpose:	Define the minimum version of the GDA required, lower 
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/intr.h linux-2.4.19-rc2/include/asm-mips64/sn/intr.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/intr.h	Mon May 15 12:55:26 2000
+++ linux-2.4.19-rc2/include/asm-mips64/sn/intr.h	Tue Jul 16 16:25:21 2002
@@ -19,7 +19,7 @@
 
 #include <asm/sn/intr_public.h>
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 /*
  * Macros to manipulate the interrupt register on the calling hub chip.
@@ -43,9 +43,9 @@
 		REMOTE_HUB_S((_hub), PI_INT_PEND_MOD, (_level)),	\
                 REMOTE_HUB_L((_hub), PI_INT_PEND0)
 
-#else /* LANGUAGE_ASSEMBLY */
+#else /* __ASSEMBLY__ */
 
-#endif /* LANGUAGE_C */
+#endif /* __ASSEMBLY__ */
 
 /*
  * Hard-coded interrupt levels:
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/intr_public.h linux-2.4.19-rc2/include/asm-mips64/sn/intr_public.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/intr_public.h	Mon May 15 12:55:26 2000
+++ linux-2.4.19-rc2/include/asm-mips64/sn/intr_public.h	Tue Jul 16 16:25:21 2002
@@ -20,7 +20,7 @@
 #define INTPEND0_MAXMASK	(N_INTPEND0_MASKS - 1)
 #define INTPEND1_MAXMASK	(N_INTPEND1_MASKS - 1)
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 #include <asm/sn/arch.h>
 
 struct intr_vecblk_s;	/* defined in asm/sn/intr.h */
@@ -49,5 +49,5 @@
 	struct intr_vecblk_s	*dispatch1;
 } hub_intmasks_t;
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 #endif /* __ASM_SN_INTR_PUBLIC_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/kldir.h linux-2.4.19-rc2/include/asm-mips64/sn/kldir.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/kldir.h	Wed Jul 12 15:15:10 2000
+++ linux-2.4.19-rc2/include/asm-mips64/sn/kldir.h	Tue Jul 16 16:25:21 2002
@@ -127,14 +127,14 @@
  * 0x0   (0K)              +-----------------------------------------+
  */
 
-#ifdef LANGUAGE_ASSEMBLY
+#ifdef __ASSEMBLY__
 #define KLDIR_OFF_MAGIC			0x00
 #define KLDIR_OFF_OFFSET		0x08
 #define KLDIR_OFF_POINTER		0x10
 #define KLDIR_OFF_SIZE			0x18
 #define KLDIR_OFF_COUNT			0x20
 #define KLDIR_OFF_STRIDE		0x28
-#endif /* LANGUAGE_ASSEMBLY */
+#endif /* __ASSEMBLY__ */
 
 #if !defined(CONFIG_SGI_IO)
 
@@ -209,7 +209,7 @@
 
 #endif	/* !CONFIG_SGI_IO */
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 typedef struct kldir_ent_s {
 	u64		magic;		/* Indicates validity of entry      */
 	off_t		offset;		/* Offset from start of node space  */
@@ -225,7 +225,7 @@
 	/* NOTE: These 16 bytes are used in the Partition KLDIR
 	   entry to store partition info. Refer to klpart.h for this. */
 } kldir_ent_t;
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #if defined(CONFIG_SGI_IO)
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/klkernvars.h linux-2.4.19-rc2/include/asm-mips64/sn/klkernvars.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/klkernvars.h	Sun Jul  9 22:18:15 2000
+++ linux-2.4.19-rc2/include/asm-mips64/sn/klkernvars.h	Tue Jul 16 16:25:21 2002
@@ -11,7 +11,7 @@
 
 #define KV_MAGIC		0x5f4b565f
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 #include <asm/sn/types.h>
 
@@ -23,7 +23,7 @@
 	unsigned long	kv_rw_baseaddr;
 } kern_vars_t;
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_SN_KLKERNVARS_H */
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/launch.h linux-2.4.19-rc2/include/asm-mips64/sn/launch.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/launch.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/launch.h	Tue Jul 16 16:25:21 2002
@@ -60,7 +60,7 @@
  * clears the BUSY flag after control is returned to it.
  */
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 typedef int launch_state_t;
 typedef void (*launch_proc_t)(u64 call_parm);
@@ -117,6 +117,6 @@
 
 #endif /* _STANDALONE */
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_SN_LAUNCH_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/nmi.h linux-2.4.19-rc2/include/asm-mips64/sn/nmi.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/nmi.h	Sun Jul  9 22:18:15 2000
+++ linux-2.4.19-rc2/include/asm-mips64/sn/nmi.h	Tue Jul 16 16:25:21 2002
@@ -8,7 +8,7 @@
 #ifndef __ASM_SN_NMI_H
 #define __ASM_SN_NMI_H
 
-#ident "$Revision: 1.2 $"
+#ident "$Revision: 1.2.4.1 $"
 
 #include <asm/sn/addrs.h>
 
@@ -48,7 +48,7 @@
  *
  */
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 typedef struct nmi_s {
 	volatile unsigned long	 magic;		/* Magic number */
@@ -59,13 +59,13 @@
 	volatile unsigned long	 gmaster;	/* Flag true only on global master*/
 } nmi_t;
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /* Following definitions are needed both in the prom & the kernel
  * to identify the format of the nmi cpu register save area in the
  * low memory on each node.
  */
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 struct reg_struct {
 	unsigned long	gpr[32];
@@ -78,7 +78,7 @@
 	unsigned long	nmi_sr;
 };
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /* These are the assembly language offsets into the reg_struct structure */
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/sn0/addrs.h linux-2.4.19-rc2/include/asm-mips64/sn/sn0/addrs.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/sn0/addrs.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/sn0/addrs.h	Tue Jul 16 16:25:21 2002
@@ -99,14 +99,14 @@
 #define NASID_GET(_pa)		(int) ((UINT64_CAST (_pa) >>		\
 					NASID_SHFT) & NASID_BITMASK)
 
-#if _LANGUAGE_C && !defined(_STANDALONE)
+#if !defined(__ASSEMBLY__) && !defined(_STANDALONE)
 #define NODE_SWIN_BASE(nasid, widget)					\
 	((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN)		\
 	: RAW_NODE_SWIN_BASE(nasid, widget))
-#else
+#else /* __ASSEMBLY__ || _STANDALONE */
 #define NODE_SWIN_BASE(nasid, widget) \
      (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS))
-#endif /* _LANGUAGE_C */
+#endif /* __ASSEMBLY__ || _STANDALONE */
 
 /*
  * The following definitions pertain to the IO special address
@@ -163,11 +163,11 @@
 #define SABLE_LOG_TRIGGER(_map)
 #endif /* SABLE */
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 #define KERN_NMI_ADDR(nasid, slice)					\
                     TO_NODE_UNCAC((nasid), IP27_NMI_KREGS_OFFSET + 	\
 				  (IP27_NMI_KREGS_CPU_SIZE * (slice)))
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #ifdef PROM
 
@@ -272,7 +272,7 @@
 #define KL_UART_DATA	LOCAL_HUB_ADDR(MD_UREG0_1)	/* UART data reg */
 #define KL_I2C_REG	MD_UREG0_0			/* I2C reg */
 
-#if !_LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 /* Address 0x400 to 0x1000 ualias points to cache error eframe + misc
  * CACHE_ERR_SP_PTR could either contain an address to the stack, or
  * the stack could start at CACHE_ERR_SP_PTR
@@ -289,7 +289,7 @@
 #define CACHE_ERR_SP		(CACHE_ERR_SP_PTR - 16)
 #define CACHE_ERR_AREA_SIZE	(ARCS_SPB_OFFSET - CACHE_ERR_EFRAME)
 
-#endif	/* !_LANGUAGE_ASSEMBLY */
+#endif	/* !__ASSEMBLY__ */
 
 #define _ARCSPROM
 
@@ -314,7 +314,7 @@
  * is in place.
  */
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 #define uchar unsigned char
 
@@ -359,7 +359,7 @@
 #define PUT_INSTALL_STATUS(c,s)		c->Revision = s
 #define GET_INSTALL_STATUS(c)		c->Revision
 
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _STANDALONE */
 
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubio.h linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubio.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubio.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubio.h	Tue Jul 16 16:25:21 2002
@@ -169,7 +169,7 @@
 /*
  * The IO LLP control status register and widget control register
  */
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 typedef union hubii_wid_u {
 	u64	wid_reg_value;
@@ -292,7 +292,7 @@
 	} perf_cnt_bits;
 } io_perf_cnt_t;
 
-#endif
+#endif /* !__ASSEMBLY__ */
 
 
 #define LNK_STAT_WORKING	0x2
@@ -440,7 +440,7 @@
 /*
  * Fields in CRB Register A
  */
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 typedef union icrba_u {
 	u64	reg_value;
 	struct {
@@ -500,7 +500,7 @@
 #define	a_valid		icrba_fields_s.valid
 #define	a_iow		icrba_fields_s.iow
 
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #define	IIO_ICRB_ADDR_SHFT	2	/* Shift to get proper address */
 
@@ -523,7 +523,7 @@
 /*
  * Fields in CRB Register B
  */
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 typedef union icrbb_u {
 	u64	reg_value;
 	struct {
@@ -622,7 +622,7 @@
 #define	b_imsg		icrbb_field_s.imsg
 #define	b_initiator	icrbb_field_s.initiator
 
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /*
  * values for field xtsize
@@ -680,7 +680,7 @@
  * Fields in CRB Register C 
  */
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 typedef union icrbc_s {
 	u64	reg_value;
@@ -712,13 +712,13 @@
 #define	c_barrop	icrbc_field_s.barrop
 #define	c_doresp	icrbc_field_s.doresp
 #define	c_gbr	icrbc_field_s.gbr
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /*
  * Fields in CRB Register D
  */
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 typedef union icrbd_s {
 	u64	reg_value;
 	struct {
@@ -751,7 +751,7 @@
 	} hi_ifdr_fields;
 } hubii_ifdr_t;
 
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /*
  * Hardware designed names for the BTE control registers.
@@ -798,7 +798,7 @@
  * IO PIO Read Table Entry format 
  */
 
-#ifdef	_LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 typedef union iprte_a {
 	u64	entry;
@@ -820,7 +820,7 @@
 #define	iprte_init	iprte_fields.initiator
 #define	iprte_addr	iprte_fields.addr
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #define	IPRTE_ADDRSHFT	3
 
@@ -828,7 +828,7 @@
  * Hub IIO PRB Register format.
  */
 
-#ifdef	_LANGUAGE_C
+#ifndef __ASSEMBLY__
 /*
  * Note: Fields bnakctr, anakctr, xtalkctrmode, ovflow fields are 
  * "Status" fields, and should only be used in case of clean up after errors.
@@ -860,7 +860,7 @@
 #define	iprb_anakctr	iprb_fields_s.anakctr
 #define	iprb_xtalkctr	iprb_fields_s.xtalkctr
 
-#endif	/* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /*
  * values for mode field in iprb_t.
@@ -875,7 +875,7 @@
 /*
  * IO CRB entry C_A to E_A : Partial (cache) CRBS
  */
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 typedef union icrbp_a {
 	u64   ip_reg;	    /* the entire register value	*/
 	struct {
@@ -909,7 +909,7 @@
 	} ip_fmt;
 } icrbp_a_t;
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 /*
  * A couple of defines to go with the above structure.
@@ -917,7 +917,7 @@
 #define ICRBP_A_CERR_SHFT	54
 #define ICRBP_A_ERR_MASK	0x3ff
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 typedef union hubii_idsr {
 	u64 iin_reg;
 	struct {
@@ -931,7 +931,7 @@
 	            level : 7;
 	} iin_fmt;
 } hubii_idsr_t;
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 	
 /* 
  * IO BTE Length/Status (IIO_IBLS) register bit field definitions
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubmd.h linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubmd.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubmd.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubmd.h	Tue Jul 16 16:25:21 2002
@@ -424,7 +424,7 @@
  * Operations on page migration threshold register
  */
 
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 #ifndef _STANDALONE
 
 /*
@@ -739,7 +739,7 @@
 } md_perf_cnt_t;
 
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 
 #define DIR_ERROR_VALID_MASK	0xe000000000000000
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubni.h linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubni.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubni.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubni.h	Tue Jul 16 16:25:21 2002
@@ -11,7 +11,7 @@
 #ifndef _ASM_SGI_SN0_HUBNI_H
 #define _ASM_SGI_SN0_HUBNI_H
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 #include <linux/types.h>
 #endif
 
@@ -226,7 +226,7 @@
 
 #define NLT_EXIT_PORT_MASK (UINT64_CAST 0xf)
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 typedef union	hubni_port_error_u {
 	u64	nipe_reg_value;
@@ -250,6 +250,6 @@
 #define NI_LLP_CB_MAX		0xff
 #define NI_LLP_SN_MAX		0xff
 
-#endif /* LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_SGI_SN0_HUBNI_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubpi.h linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubpi.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/sn0/hubpi.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/sn0/hubpi.h	Tue Jul 16 16:25:21 2002
@@ -306,7 +306,7 @@
 #define ERR_STACK_SIZE_BYTES(_sz) \
        ((_sz) ? (PI_MIN_STACK_SIZE << ((_sz) - 1)) : 0)
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 /*
  * format of error stack and error status registers.
  */
@@ -359,7 +359,7 @@
 
 typedef u64	rtc_time_t;
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 
 /* Bits in PI_SYSAD_ERRCHK_EN */
diff -urN linux-2.4.19-rc1/include/asm-mips64/sn/sn0/ip27.h linux-2.4.19-rc2/include/asm-mips64/sn/sn0/ip27.h
--- linux-2.4.19-rc1/include/asm-mips64/sn/sn0/ip27.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/sn/sn0/ip27.h	Tue Jul 16 16:25:21 2002
@@ -19,7 +19,7 @@
 
 #define TLBLO_HWBITSHIFT	0		/* Shift value, for masking */
 
-#if !_LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 #define CAUSE_BERRINTR 		IE_IRQ5
 
@@ -30,9 +30,9 @@
 #define ECCF_PADDR      4
 #define ECCF_SIZE       (5 * sizeof(long))
 
-#endif /* !_LANGUAGE_ASSEMBLY */
+#endif /* !__ASSEMBLY__ */
 
-#if _LANGUAGE_ASSEMBLY
+#ifdef __ASSEMBLY__
 
 /*
  * KL_GET_CPUNUM (similar to EV_GET_SPNUM for EVEREST platform) reads
@@ -43,7 +43,7 @@
 	dli	proc, LOCAL_HUB(0); 			\
 	ld	proc, PI_CPU_NUM(proc)
 
-#endif /* _LANGUAGE_ASSEMBLY */
+#endif /* __ASSEMBLY__ */
 
 /*
  * R10000 status register interrupt bit mask usage for IP27.
diff -urN linux-2.4.19-rc1/include/asm-mips64/spinlock.h linux-2.4.19-rc2/include/asm-mips64/spinlock.h
--- linux-2.4.19-rc1/include/asm-mips64/spinlock.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/spinlock.h	Tue Jul 16 16:25:21 2002
@@ -22,7 +22,7 @@
 #define spin_lock_init(x)	do { (x)->lock = 0; } while(0)
 
 #define spin_is_locked(x)	((x)->lock != 0)
-#define spin_unlock_wait(x)	do { barrier(); } while ((x)->lock);
+#define spin_unlock_wait(x)	do { barrier(); } while ((x)->lock)
 
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
diff -urN linux-2.4.19-rc1/include/asm-mips64/stackframe.h linux-2.4.19-rc2/include/asm-mips64/stackframe.h
--- linux-2.4.19-rc1/include/asm-mips64/stackframe.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/stackframe.h	Tue Jul 16 16:25:21 2002
@@ -17,7 +17,7 @@
 #include <asm/processor.h>
 #include <asm/addrspace.h>
 
-#ifdef _LANGUAGE_C
+#ifndef __ASSEMBLY__
 
 #define __str2(x) #x
 #define __str(x) __str2(x)
@@ -36,9 +36,9 @@
 		: /* No outputs */                       \
 		: "r" (frame))
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
-#ifdef _LANGUAGE_ASSEMBLY
+#ifdef __ASSEMBLY__
 
 		.macro	SAVE_AT
 		.set	push
@@ -264,6 +264,6 @@
 		mtc0	t0, CP0_STATUS
 		.endm
 
-#endif /* _LANGUAGE_ASSEMBLY */
+#endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_STACKFRAME_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/system.h linux-2.4.19-rc2/include/asm-mips64/system.h
--- linux-2.4.19-rc1/include/asm-mips64/system.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/system.h	Tue Jul 16 16:25:21 2002
@@ -11,10 +11,8 @@
 #define _ASM_SYSTEM_H
 
 #include <linux/config.h>
-
 #include <asm/sgidefs.h>
 #include <asm/ptrace.h>
-
 #include <linux/kernel.h>
 
 __asm__ (
@@ -117,9 +115,9 @@
 	"xori\t$1, 1\n\t"
 	"or\t\\flags, $1\n\t"
 	"mtc0\t\\flags, $12\n\t"
-	"nop\n\t"
-	"nop\n\t"
-	"nop\n\t"
+	"sll\t$0, $0, 1\t\t\t# nop\n\t"
+	"sll\t$0, $0, 1\t\t\t# nop\n\t"
+	"sll\t$0, $0, 1\t\t\t# nop\n\t"
 	".set\tat\n\t"
 	".set\treorder\n\t"
 	".endm");
@@ -194,19 +192,18 @@
 #define set_wmb(var, value) \
 do { var = value; wmb(); } while (0)
 
-#if !defined (_LANGUAGE_ASSEMBLY)
 /*
  * switch_to(n) should switch tasks to task nr n, first
  * checking that n isn't the current task, in which case it does nothing.
  */
 extern asmlinkage void *resume(void *last, void *next);
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
 
 #define prepare_to_switch()	do { } while(0)
 
 extern asmlinkage void lazy_fpu_switch(void *, void *);
 extern asmlinkage void init_fpu(void);
-extern asmlinkage void save_fp(void *);
+extern asmlinkage void save_fp(struct task_struct *);
+extern asmlinkage void restore_fp(struct task_struct *);
 
 #ifdef CONFIG_SMP
 #define SWITCH_DO_LAZY_FPU \
diff -urN linux-2.4.19-rc1/include/asm-mips64/time.h linux-2.4.19-rc2/include/asm-mips64/time.h
--- linux-2.4.19-rc1/include/asm-mips64/time.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/time.h	Tue Jul 16 16:25:21 2002
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001 MontaVista Software Inc.
+ * Copyright (C) 2001, 2002, MontaVista Software Inc.
  * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  *
  * include/asm-mips/time.h
@@ -61,6 +61,12 @@
 asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs);
 
 /*
+ * profiling and process accouting is done separately in local_timer_interrupt
+ */
+void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
+
+/*
  * board specific routines required by time_init().
  * board_time_init is defaulted to NULL and can remains so.
  * board_timer_setup must be setup properly in machine setup routine.
diff -urN linux-2.4.19-rc1/include/asm-mips64/traps.h linux-2.4.19-rc2/include/asm-mips64/traps.h
--- linux-2.4.19-rc1/include/asm-mips64/traps.h	Wed Dec 31 16:00:00 1969
+++ linux-2.4.19-rc2/include/asm-mips64/traps.h	Tue Jul 16 16:25:21 2002
@@ -0,0 +1,27 @@
+/*
+ *	include/asm-mips64/traps.h
+ *
+ *	Trap handling definitions.
+ *
+ *	Copyright (C) 2002  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+#ifndef __ASM_MIPS64_TRAPS_H
+#define __ASM_MIPS64_TRAPS_H
+
+/*
+ * Possible status responses for a be_board_handler backend.
+ */
+#define MIPS_BE_DISCARD	0		/* return with no action */
+#define MIPS_BE_FIXUP	1		/* return to the fixup code */
+#define MIPS_BE_FATAL	2		/* treat as an unrecoverable error */
+
+extern int (*be_board_handler)(struct pt_regs *regs, int is_fixup);
+
+extern void bus_error_init(void);
+
+#endif /* __ASM_MIPS64_TRAPS_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/unistd.h linux-2.4.19-rc2/include/asm-mips64/unistd.h
--- linux-2.4.19-rc1/include/asm-mips64/unistd.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-mips64/unistd.h	Tue Jul 16 16:25:21 2002
@@ -253,11 +253,15 @@
 #define __NR_Linux32_lremovexattr	(__NR_Linux32 + 234)
 #define __NR_Linux32_fremovexattr	(__NR_Linux32 + 235)
 #define __NR_Linux32_tkill		(__NR_Linux32 + 236)
+#define __NR_Linux32_sendfile64		(__NR_Linux32 + 237)
+#define __NR_Linux32_futex		(__NR_Linux32 + 238)
+#define __NR_Linux32_sched_setaffinity	(__NR_Linux32 + 239)
+#define __NR_Linux32_sched_getaffinity	(__NR_Linux32 + 240)
 
 /*
  * Offset of the last Linux o32 flavoured syscall
  */
-#define __NR_Linux32_syscalls		236
+#define __NR_Linux32_syscalls		240
 
 /*
  * Linux 64-bit syscalls are in the range from 5000 to 5999.
@@ -493,13 +497,17 @@
 #define __NR_lremovexattr		(__NR_Linux + 227)
 #define __NR_fremovexattr		(__NR_Linux + 228)
 #define __NR_tkill			(__NR_Linux + 229)
+#define __NR_sendfile64			(__NR_Linux + 230)
+#define __NR_futex			(__NR_Linux + 231)
+#define __NR_sched_setaffinity		(__NR_Linux + 232)
+#define __NR_sched_getaffinity		(__NR_Linux + 233)
 
 /*
  * Offset of the last Linux flavoured syscall
  */
-#define __NR_Linux_syscalls		229
+#define __NR_Linux_syscalls		233
 
-#ifndef _LANGUAGE_ASSEMBLY
+#ifndef __ASSEMBLY__
 
 /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
 #define _syscall0(type,name) \
@@ -845,7 +853,7 @@
 	return waitpid(-1,wait_stat,0);
 }
 
-#endif /* !defined (__KERNEL_SYSCALLS__) */
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+#endif /* __KERNEL_SYSCALLS__ */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_UNISTD_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/xtalk/xtalk.h linux-2.4.19-rc2/include/asm-mips64/xtalk/xtalk.h
--- linux-2.4.19-rc1/include/asm-mips64/xtalk/xtalk.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/xtalk/xtalk.h	Tue Jul 16 16:25:21 2002
@@ -12,7 +12,7 @@
 #ifndef _ASM_XTALK_XTALK_H
 #define _ASM_XTALK_XTALK_H
 
-#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#ifndef __ASSEMBLY__
 /*
  * User-level device driver visible types
  */
@@ -47,6 +47,6 @@
 #define	XIO_PORT(x)	((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT))
 #define	XIO_PACK(p,o)	((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS))
 
-#endif /* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_XTALK_XTALK_H */
diff -urN linux-2.4.19-rc1/include/asm-mips64/xtalk/xwidget.h linux-2.4.19-rc2/include/asm-mips64/xtalk/xwidget.h
--- linux-2.4.19-rc1/include/asm-mips64/xtalk/xwidget.h	Sun Sep  9 10:43:02 2001
+++ linux-2.4.19-rc2/include/asm-mips64/xtalk/xwidget.h	Tue Jul 16 16:25:21 2002
@@ -91,7 +91,7 @@
  * widget target flush register are widget dependent thus will not be
  * defined here
  */
-#if _LANGUAGE_C
+#ifndef __ASSEMBLY__
 typedef u32 widgetreg_t;
 
 /* widget configuration registers */
@@ -162,6 +162,6 @@
 	((hwid2)->mfg_num == XWIDGET_MFG_NUM_NONE) || \
 	((hwid1)->mfg_num == (hwid2)->mfg_num)))
 
-#endif				/* _LANGUAGE_C */
+#endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_XTALK_XWIDGET_H */
diff -urN linux-2.4.19-rc1/include/asm-s390/spinlock.h linux-2.4.19-rc2/include/asm-s390/spinlock.h
--- linux-2.4.19-rc1/include/asm-s390/spinlock.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-s390/spinlock.h	Tue Jul 16 16:25:21 2002
@@ -84,7 +84,7 @@
                      "   la    3,1(2)\n"     /* one more reader */ \
                      "   cs    2,3,0(%0)\n"  /* try to write new value */ \
                      "   jl    0b"       \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #define read_unlock(rw) \
         asm volatile("   l     2,0(%0)\n"   \
@@ -94,7 +94,7 @@
                      "   ahi   3,-1\n"    /* one less reader */ \
                      "   cs    2,3,0(%0)\n" \
                      "   jl    0b"       \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #define write_lock(rw) \
         asm volatile("   lhi   3,1\n"    \
@@ -104,7 +104,7 @@
                      "1: slr   2,2\n"     /* old lock value must be 0 */ \
                      "   cs    2,3,0(%0)\n" \
                      "   jl    0b"       \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #define write_unlock(rw) \
         asm volatile("   slr   3,3\n"     /* new lock value = 0 */ \
@@ -114,6 +114,6 @@
                      "   sll   2,31\n"    /* old lock value must be 0x80000000 */ \
                      "   cs    2,3,0(%0)\n" \
                      "   jl    0b"       \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #endif /* __ASM_SPINLOCK_H */
diff -urN linux-2.4.19-rc1/include/asm-s390/uaccess.h linux-2.4.19-rc2/include/asm-s390/uaccess.h
--- linux-2.4.19-rc1/include/asm-s390/uaccess.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-s390/uaccess.h	Tue Jul 16 16:25:21 2002
@@ -197,38 +197,34 @@
  */
 #define __put_user(x, ptr)                                      \
 ({                                                              \
+        __typeof__(*(ptr)) *__pu_addr = (ptr);                  \
+        __typeof__(*(ptr)) __x = (x);                           \
         int __pu_err;                                           \
         switch (sizeof (*(ptr))) {                              \
-                case 1:                                         \
-                        __pu_err = __put_user_asm_1((__u8)(__u32)x,(ptr));\
-                        break;                                  \
-                case 2:                                         \
-                        __pu_err = __put_user_asm_2((__u16)(__u32)x,(ptr));\
-                        break;                                  \
-                case 4:                                         \
-                        __pu_err = __put_user_asm_4((__u32) x,(ptr));\
-                        break;                                  \
-		case 8:						\
-			__pu_err = __put_user_asm_8((__u64) x,(ptr));\
-			break;					\
-                default:                                        \
+        case 1:                                                 \
+                __pu_err = __put_user_asm_1((__u8)(__u32) __x,  \
+                                            __pu_addr);         \
+                break;                                          \
+        case 2:                                                 \
+                __pu_err = __put_user_asm_2((__u16)(__u32) __x, \
+                                            __pu_addr);         \
+                break;                                          \
+        case 4:                                                 \
+                __pu_err = __put_user_asm_4((__u32) __x,        \
+                                            __pu_addr);         \
+                break;                                          \
+        case 8:                                                 \
+                __pu_err = __put_user_asm_8((__u64) __x,        \
+                                            __pu_addr);         \
+                break;                                          \
+        default:                                                \
                 __pu_err = __put_user_bad();                    \
                 break;                                          \
          }                                                      \
         __pu_err;                                               \
 })
 
-#define put_user(x, ptr)                                        \
-({                                                              \
-        long __pu_err = -EFAULT;                                \
-        __typeof__(*(ptr)) *__pu_addr = (ptr);                  \
-        __typeof__(*(ptr)) __x = (x);                           \
-        if (__access_ok((long)__pu_addr,sizeof(*(ptr)))) {      \
-                __pu_err = 0;                                   \
-                __put_user((__x), (__pu_addr));                 \
-        }                                                       \
-        __pu_err;                                               \
-})
+#define put_user(x, ptr) __put_user(x, ptr)
 
 extern int __put_user_bad(void);
 
@@ -336,42 +332,32 @@
 
 #define __get_user(x, ptr)                                      \
 ({                                                              \
+        __typeof__(ptr) __gu_addr = (ptr);                      \
+        __typeof__(*(ptr)) __x;                                 \
         int __gu_err;                                           \
-        switch (sizeof(*(ptr))) {                               \
-                case 1:                                         \
-                        __get_user_asm_1(x,ptr,__gu_err);       \
-                        break;                                  \
-                case 2:                                         \
-                        __get_user_asm_2(x,ptr,__gu_err);       \
-                        break;                                  \
-                case 4:                                         \
-                        __get_user_asm_4(x,ptr,__gu_err);       \
-                        break;                                  \
-                case 8:                                         \
-                        __get_user_asm_8(x,ptr,__gu_err);       \
-                        break;                                  \
-                default:                                        \
-                        (x) = 0;                                \
-                        __gu_err = __get_user_bad();            \
+        switch (sizeof(*(__gu_addr))) {                         \
+        case 1:                                                 \
+                __get_user_asm_1(__x, __gu_addr, __gu_err);     \
+                break;                                          \
+        case 2:                                                 \
+                __get_user_asm_2(__x, __gu_addr, __gu_err);     \
+                break;                                          \
+        case 4:                                                 \
+                __get_user_asm_4(__x, __gu_addr, __gu_err);     \
+                break;                                          \
+        case 8:                                                 \
+                __get_user_asm_8(__x, __gu_addr, __gu_err);     \
+                break;                                          \
+        default:                                                \
+                __x = 0;                                        \
+                __gu_err = __get_user_bad();                    \
                 break;                                          \
         }                                                       \
+        (x) = __x;                                              \
         __gu_err;                                               \
 })
 
-#define get_user(x, ptr)                                        \
-({                                                              \
-        long __gu_err = -EFAULT;                                \
-        __typeof__(ptr) __gu_addr = (ptr);                      \
-        __typeof__(*(ptr)) __x;                                 \
-        if (__access_ok((long)__gu_addr,sizeof(*(ptr)))) {      \
-                __gu_err = 0;                                   \
-                __get_user((__x), (__gu_addr));                 \
-                (x) = __x;                                      \
-        }                                                       \
-        else                                                    \
-                (x) = 0;                                        \
-        __gu_err;                                               \
-})
+#define get_user(x, ptr) __get_user(x, ptr)
 
 extern int __get_user_bad(void);
 
diff -urN linux-2.4.19-rc1/include/asm-s390/unistd.h linux-2.4.19-rc2/include/asm-s390/unistd.h
--- linux-2.4.19-rc1/include/asm-s390/unistd.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-s390/unistd.h	Tue Jul 16 16:25:21 2002
@@ -211,9 +211,12 @@
 #define __NR_mincore            218
 #define __NR_madvise            219
 #define __NR_getdents64		220
-#define __NR_gettid		226
-#define __NR_tkill		227
-
+#define __NR_fcntl64		221
+/*
+ * Numbers 224-235 are reserved for posix acl
+ */
+#define __NR_gettid		236
+#define __NR_tkill		237
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
 
diff -urN linux-2.4.19-rc1/include/asm-s390x/spinlock.h linux-2.4.19-rc2/include/asm-s390x/spinlock.h
--- linux-2.4.19-rc1/include/asm-s390x/spinlock.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-s390x/spinlock.h	Tue Jul 16 16:25:21 2002
@@ -84,7 +84,7 @@
                      "   la    3,1(2)\n"   /* one more reader */  \
                      "   csg   2,3,0(%0)\n" /* try to write new value */ \
                      "   jl    0b"       \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #define read_unlock(rw) \
         asm volatile("   lg    2,0(%0)\n"   \
@@ -94,7 +94,7 @@
                      "   bctgr 3,0\n"    /* one less reader */ \
                      "   csg   2,3,0(%0)\n" \
                      "   jl    0b"       \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #define write_lock(rw) \
         asm volatile("   llihh 3,0x8000\n" /* new lock value = 0x80...0 */ \
@@ -103,7 +103,7 @@
                      "1: slgr  2,2\n"      /* old lock value must be 0 */ \
                      "   csg   2,3,0(%0)\n" \
                      "   jl    0b"         \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #define write_unlock(rw) \
         asm volatile("   slgr  3,3\n"      /* new lock value = 0 */ \
@@ -112,7 +112,7 @@
                      "1: llihh 2,0x8000\n" /* old lock value must be 0x8..0 */\
                      "   csg   2,3,0(%0)\n"   \
                      "   jl    0b"         \
-                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" );
+                     : : "a" (&(rw)->lock) : "2", "3", "cc", "memory" )
 
 #endif /* __ASM_SPINLOCK_H */
 
diff -urN linux-2.4.19-rc1/include/asm-s390x/uaccess.h linux-2.4.19-rc2/include/asm-s390x/uaccess.h
--- linux-2.4.19-rc1/include/asm-s390x/uaccess.h	Mon Feb 25 11:38:13 2002
+++ linux-2.4.19-rc2/include/asm-s390x/uaccess.h	Tue Jul 16 16:25:21 2002
@@ -175,42 +175,37 @@
  */
 #define __put_user(x, ptr)                                      \
 ({                                                              \
+        __typeof__(*(ptr)) *__pu_addr = (ptr);                  \
+        __typeof__(*(ptr)) __x = (x);                           \
         int __pu_err;                                           \
-        switch (sizeof (*(ptr))) {                              \
-                case 1:                                         \
-                        __pu_err = __put_user_asm_1((__u8)(__u64)(x),(ptr));\
-                        break;                                  \
-                case 2:                                         \
-                        __pu_err = __put_user_asm_2((__u16)(__u64)(x),(ptr));\
-                        break;                                  \
-                case 4:                                         \
-                        __pu_err = __put_user_asm_4((__u32)(__u64)(x),(ptr));\
-                        break;                                  \
-                case 8:                                         \
-                        __pu_err = __put_user_asm_8((__u64)(x),(ptr));\
-                        break;                                  \
-                default:                                        \
+        switch (sizeof (*(__pu_addr))) {                        \
+        case 1:                                                 \
+                __pu_err = __put_user_asm_1((__u8)(__u64)(__x), \
+                                            __pu_addr);         \
+                break;                                          \
+        case 2:                                                 \
+                __pu_err = __put_user_asm_2((__u16)(__u64)(__x),\
+                                            __pu_addr);         \
+                break;                                          \
+        case 4:                                                 \
+                __pu_err = __put_user_asm_4((__u32)(__u64)(__x),\
+                                            __pu_addr);         \
+                break;                                          \
+        case 8:                                                 \
+                __pu_err = __put_user_asm_8((__u64)(__x),       \
+                                            __pu_addr);         \
+                break;                                          \
+        default:                                                \
                 __pu_err = __put_user_bad();                    \
                 break;                                          \
          }                                                      \
         __pu_err;                                               \
 })
 
-#define put_user(x, ptr)                                        \
-({                                                              \
-        long __pu_err = -EFAULT;                                \
-        __typeof__(*(ptr)) *__pu_addr = (ptr);                  \
-        __typeof__(*(ptr)) __x = (x);                           \
-        if (__access_ok((long)__pu_addr,sizeof(*(ptr)))) {      \
-                __pu_err = 0;                                   \
-                __put_user((__x), (__pu_addr));                 \
-        }                                                       \
-        __pu_err;                                               \
-})
+#define put_user(x, ptr) __put_user(x, ptr)
 
 extern int __put_user_bad(void);
 
-
 #define __get_user_asm_8(x, ptr, err)                                      \
 ({                                                                         \
         __asm__ __volatile__ (  "   sr    %1,%1\n"                         \
@@ -293,42 +288,32 @@
 
 #define __get_user(x, ptr)                                      \
 ({                                                              \
+        __typeof__(ptr) __gu_addr = (ptr);                      \
+        __typeof__(*(ptr)) __x;                                 \
         int __gu_err;                                           \
         switch (sizeof(*(ptr))) {                               \
-                case 1:                                         \
-                        __get_user_asm_1(x,ptr,__gu_err);       \
-                        break;                                  \
-                case 2:                                         \
-                        __get_user_asm_2(x,ptr,__gu_err);       \
-                        break;                                  \
-                case 4:                                         \
-                        __get_user_asm_4(x,ptr,__gu_err);       \
-                        break;                                  \
-                case 8:                                         \
-                        __get_user_asm_8(x,ptr,__gu_err);       \
-                        break;                                  \
-                default:                                        \
-                        (x) = 0;                                \
-                        __gu_err = __get_user_bad();            \
+        case 1:                                                 \
+                __get_user_asm_1(__x,__gu_addr,__gu_err);       \
+                break;                                          \
+        case 2:                                                 \
+                __get_user_asm_2(__x,__gu_addr,__gu_err);       \
+                break;                                          \
+        case 4:                                                 \
+                __get_user_asm_4(__x,__gu_addr,__gu_err);       \
+                break;                                          \
+        case 8:                                                 \
+                __get_user_asm_8(__x,__gu_addr,__gu_err);       \
+                break;                                          \
+        default:                                                \
+                __x = 0;                                        \
+                __gu_err = __get_user_bad();                    \
                 break;                                          \
         }                                                       \
+        (x) = __x;                                              \
         __gu_err;                                               \
 })
 
-#define get_user(x, ptr)                                        \
-({                                                              \
-        long __gu_err = -EFAULT;                                \
-        __typeof__(ptr) __gu_addr = (ptr);                      \
-        __typeof__(*(ptr)) __x;                                 \
-        if (__access_ok((long)__gu_addr,sizeof(*(ptr)))) {      \
-                __gu_err = 0;                                   \
-                __get_user((__x), (__gu_addr));                 \
-                (x) = __x;                                      \
-        }                                                       \
-        else                                                    \
-                (x) = 0;                                        \
-        __gu_err;                                               \
-})
+#define get_user(x, ptr) __get_user(x, ptr)
 
 extern int __get_user_bad(void);
 
diff -urN linux-2.4.19-rc1/include/asm-s390x/unistd.h linux-2.4.19-rc2/include/asm-s390x/unistd.h
--- linux-2.4.19-rc1/include/asm-s390x/unistd.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/asm-s390x/unistd.h	Tue Jul 16 16:25:21 2002
@@ -180,9 +180,11 @@
 #define __NR_pivot_root         217
 #define __NR_mincore            218
 #define __NR_madvise            219
-#define __NR_getdents64         220
-#define __NR_gettid		226
-#define __NR_tkill 	        227
+/*
+ * Numbers 224-235 are reserved for posix acl
+ */
+#define __NR_gettid		236
+#define __NR_tkill		237
 
 
 /* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
diff -urN linux-2.4.19-rc1/include/linux/fs.h linux-2.4.19-rc2/include/linux/fs.h
--- linux-2.4.19-rc1/include/linux/fs.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/linux/fs.h	Tue Jul 16 16:25:21 2002
@@ -1449,7 +1449,12 @@
 extern struct inode_operations page_symlink_inode_operations;
 
 extern int vfs_readdir(struct file *, filldir_t, void *);
+extern int dcache_dir_open(struct inode *, struct file *);
+extern int dcache_dir_close(struct inode *, struct file *);
+extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
+extern int dcache_dir_fsync(struct file *, struct dentry *, int);
 extern int dcache_readdir(struct file *, void *, filldir_t);
+extern struct file_operations dcache_dir_ops;
 
 extern struct file_system_type *get_fs_type(const char *name);
 extern struct super_block *get_super(kdev_t);
diff -urN linux-2.4.19-rc1/include/linux/kdev_t.h linux-2.4.19-rc2/include/linux/kdev_t.h
--- linux-2.4.19-rc1/include/linux/kdev_t.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/linux/kdev_t.h	Tue Jul 16 16:25:21 2002
@@ -81,8 +81,8 @@
 #define minor(d)	MINOR(d)
 #define kdev_same(a,b)	((a) == (b))
 #define kdev_none(d)	(!(d))
-#define kdev_val(d)	((unsigned int)(d)
-#define val_to_kdev(d)	((kdev_t(d))
+#define kdev_val(d)	((unsigned int)(d))
+#define val_to_kdev(d)	((kdev_t)(d))
 
 /*
 As long as device numbers in the outside world have 16 bits only,
diff -urN linux-2.4.19-rc1/include/linux/pci_ids.h linux-2.4.19-rc2/include/linux/pci_ids.h
--- linux-2.4.19-rc1/include/linux/pci_ids.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/linux/pci_ids.h	Tue Jul 16 16:25:21 2002
@@ -608,7 +608,7 @@
 #define PCI_DEVICE_ID_PROMISE_20262	0x4d38
 #define PCI_DEVICE_ID_PROMISE_20263	0x0D38
 #define PCI_DEVICE_ID_PROMISE_20268	0x4d68
-#define PCI_DEVICE_ID_PROMISE_20268R	0x6268
+#define PCI_DEVICE_ID_PROMISE_20270	0x6268
 #define PCI_DEVICE_ID_PROMISE_20269	0x4d69
 #define PCI_DEVICE_ID_PROMISE_20271	0x6269
 #define PCI_DEVICE_ID_PROMISE_20275	0x1275
diff -urN linux-2.4.19-rc1/include/linux/personality.h linux-2.4.19-rc2/include/linux/personality.h
--- linux-2.4.19-rc1/include/linux/personality.h	Mon Sep 10 13:04:33 2001
+++ linux-2.4.19-rc2/include/linux/personality.h	Tue Jul 16 16:25:21 2002
@@ -62,6 +62,7 @@
 	PER_RISCOS =		0x000c,
 	PER_SOLARIS =		0x000d | STICKY_TIMEOUTS,
 	PER_UW7 =		0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+	PER_OSF4 =		0x000f,			 /* OSF/1 v4 */
 	PER_MASK =		0x00ff,
 };
 
diff -urN linux-2.4.19-rc1/include/net/bluetooth/bluetooth.h linux-2.4.19-rc2/include/net/bluetooth/bluetooth.h
--- linux-2.4.19-rc1/include/net/bluetooth/bluetooth.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/net/bluetooth/bluetooth.h	Tue Jul 16 16:25:21 2002
@@ -23,7 +23,7 @@
 */
 
 /*
- *  $Id: bluetooth.h,v 1.8 2002/04/17 17:37:20 maxk Exp $
+ *  $Id: bluetooth.h,v 1.9 2002/05/06 21:11:55 maxk Exp $
  */
 
 #ifndef __BLUETOOTH_H
@@ -50,6 +50,7 @@
 #define BTPROTO_HCI     1
 #define BTPROTO_SCO   	2
 #define BTPROTO_RFCOMM	3
+#define BTPROTO_BNEP	4
 
 #define SOL_HCI     0
 #define SOL_L2CAP   6
diff -urN linux-2.4.19-rc1/include/net/bluetooth/hci_core.h linux-2.4.19-rc2/include/net/bluetooth/hci_core.h
--- linux-2.4.19-rc1/include/net/bluetooth/hci_core.h	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/include/net/bluetooth/hci_core.h	Tue Jul 16 16:25:21 2002
@@ -23,7 +23,7 @@
 */
 
 /* 
- * $Id: hci_core.h,v 1.3 2002/04/17 18:55:21 maxk Exp $ 
+ * $Id: hci_core.h,v 1.4 2002/06/25 22:04:43 maxk Exp $ 
  */
 
 #ifndef __HCI_CORE_H
@@ -339,8 +339,8 @@
 /* ----- HCI protocols ----- */
 struct hci_proto {
 	char 		*name;
-	__u32		id;
-	__u32		flags;
+	unsigned int 	id;
+	unsigned long	flags;
 
 	void		*priv;
 
diff -urN linux-2.4.19-rc1/init/do_mounts.c linux-2.4.19-rc2/init/do_mounts.c
--- linux-2.4.19-rc1/init/do_mounts.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/init/do_mounts.c	Tue Jul 16 16:25:21 2002
@@ -378,7 +378,7 @@
 	return sys_symlink(path + n + 5, name);
 }
 
-#if defined(CONFIG_BLOCK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD)
+#if defined(CONFIG_BLK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD)
 static void __init change_floppy(char *fmt, ...)
 {
 	struct termios termios;
diff -urN linux-2.4.19-rc1/ipc/shm.c linux-2.4.19-rc2/ipc/shm.c
--- linux-2.4.19-rc1/ipc/shm.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/ipc/shm.c	Tue Jul 16 16:25:21 2002
@@ -117,12 +117,14 @@
  *
  * @shp: struct to free
  *
- * It has to be called with shp and shm_ids.sem locked
+ * It has to be called with shp and shm_ids.sem locked,
+ * but returns with shp unlocked and freed.
  */
 static void shm_destroy (struct shmid_kernel *shp)
 {
 	shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
 	shm_rmid (shp->id);
+	shm_unlock(shp->id);
 	shmem_lock(shp->shm_file, 0);
 	fput (shp->shm_file);
 	kfree (shp);
@@ -150,8 +152,8 @@
 	if(shp->shm_nattch == 0 &&
 	   shp->shm_flags & SHM_DEST)
 		shm_destroy (shp);
-
-	shm_unlock(id);
+	else
+		shm_unlock(id);
 	up (&shm_ids.sem);
 }
 
@@ -511,11 +513,9 @@
 			shp->shm_flags |= SHM_DEST;
 			/* Do not find it any more */
 			shp->shm_perm.key = IPC_PRIVATE;
+			shm_unlock(shmid);
 		} else
 			shm_destroy (shp);
-
-		/* Unlock */
-		shm_unlock(shmid);
 		up(&shm_ids.sem);
 		return err;
 	}
@@ -653,7 +653,8 @@
 	if(shp->shm_nattch == 0 &&
 	   shp->shm_flags & SHM_DEST)
 		shm_destroy (shp);
-	shm_unlock(shmid);
+	else
+		shm_unlock(shmid);
 	up (&shm_ids.sem);
 
 	*raddr = (unsigned long) user_addr;
diff -urN linux-2.4.19-rc1/kernel/ksyms.c linux-2.4.19-rc2/kernel/ksyms.c
--- linux-2.4.19-rc1/kernel/ksyms.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/kernel/ksyms.c	Tue Jul 16 16:25:21 2002
@@ -273,7 +273,12 @@
 EXPORT_SYMBOL(lease_get_mtime);
 EXPORT_SYMBOL(lock_may_read);
 EXPORT_SYMBOL(lock_may_write);
+EXPORT_SYMBOL(dcache_dir_open);
+EXPORT_SYMBOL(dcache_dir_close);
+EXPORT_SYMBOL(dcache_dir_lseek);
+EXPORT_SYMBOL(dcache_dir_fsync);
 EXPORT_SYMBOL(dcache_readdir);
+EXPORT_SYMBOL(dcache_dir_ops);
 
 /* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */
 EXPORT_SYMBOL(default_llseek);
diff -urN linux-2.4.19-rc1/kernel/sysctl.c linux-2.4.19-rc2/kernel/sysctl.c
--- linux-2.4.19-rc1/kernel/sysctl.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/kernel/sysctl.c	Tue Jul 16 16:25:21 2002
@@ -986,7 +986,7 @@
 	vleft = table->maxlen / sizeof(int);
 	left = *lenp;
 	
-	for (; left && vleft--; i++, first=0) {
+	for (; left && vleft--; i++, min++, max++, first=0) {
 		if (write) {
 			while (left) {
 				char c;
@@ -1022,9 +1022,7 @@
 			buffer += len;
 			left -= len;
 
-			if (min && val < *min++)
-				continue;
-			if (max && val > *max++)
+			if ((min && val < *min) || (max && val > *max))
 				continue;
 			*i = val;
 		} else {
diff -urN linux-2.4.19-rc1/mm/memory.c linux-2.4.19-rc2/mm/memory.c
--- linux-2.4.19-rc1/mm/memory.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/mm/memory.c	Tue Jul 16 16:25:21 2002
@@ -146,6 +146,7 @@
 void clear_page_tables(struct mm_struct *mm, unsigned long first, int nr)
 {
 	pgd_t * page_dir = mm->pgd;
+	unsigned long	last = first + nr;
 
 	spin_lock(&mm->page_table_lock);
 	page_dir += first;
@@ -155,6 +156,8 @@
 	} while (--nr);
 	spin_unlock(&mm->page_table_lock);
 
+	flush_tlb_pgtables(mm, first * PGDIR_SIZE, last * PGDIR_SIZE);
+	
 	/* keep the page table cache within bounds */
 	check_pgt_cache();
 }
diff -urN linux-2.4.19-rc1/mm/mmap.c linux-2.4.19-rc2/mm/mmap.c
--- linux-2.4.19-rc1/mm/mmap.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/mm/mmap.c	Tue Jul 16 16:25:21 2002
@@ -908,7 +908,6 @@
 	end_index = pgd_index(last);
 	if (end_index > start_index) {
 		clear_page_tables(mm, start_index, end_index - start_index);
-		flush_tlb_pgtables(mm, first & PGDIR_MASK, last & PGDIR_MASK);
 	}
 }
 
diff -urN linux-2.4.19-rc1/mm/shmem.c linux-2.4.19-rc2/mm/shmem.c
--- linux-2.4.19-rc1/mm/shmem.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/mm/shmem.c	Tue Jul 16 16:25:21 2002
@@ -41,7 +41,6 @@
 static struct address_space_operations shmem_aops;
 static struct file_operations shmem_file_operations;
 static struct inode_operations shmem_inode_operations;
-static struct file_operations shmem_dir_operations;
 static struct inode_operations shmem_dir_inode_operations;
 static struct vm_operations_struct shmem_vm_ops;
 
@@ -738,7 +737,7 @@
 		case S_IFDIR:
 			inode->i_nlink++;
 			inode->i_op = &shmem_dir_inode_operations;
-			inode->i_fop = &shmem_dir_operations;
+			inode->i_fop = &dcache_dir_ops;
 			break;
 		case S_IFLNK:
 			break;
@@ -1396,14 +1395,6 @@
 	truncate:	shmem_truncate,
 };
 
-static struct file_operations shmem_dir_operations = {
-	read:		generic_read_dir,
-	readdir:	dcache_readdir,
-#ifdef CONFIG_TMPFS
-	fsync:		shmem_sync_file,
-#endif
-};
-
 static struct inode_operations shmem_dir_inode_operations = {
 #ifdef CONFIG_TMPFS
 	create:		shmem_create,
diff -urN linux-2.4.19-rc1/net/802/cl2llc.pre linux-2.4.19-rc2/net/802/cl2llc.pre
--- linux-2.4.19-rc1/net/802/cl2llc.pre	Fri Nov  9 14:11:15 2001
+++ linux-2.4.19-rc2/net/802/cl2llc.pre	Tue Jul 16 16:25:21 2002
@@ -96,7 +96,7 @@
 				else
 					llc_interpret_pseudo_code(lp, REJECT1, skb, NO_FRAME);
 				break;
-			default:
+			default:;
 		}
 		if(lp->llc_callbacks)
 		{
@@ -497,7 +497,7 @@
 				else
 					lp->f_flag = fr->i_hdr.i_pflag;
 				break;
-			default:
+			default:;
 		}
 		pc++;	
 	}
diff -urN linux-2.4.19-rc1/net/bluetooth/af_bluetooth.c linux-2.4.19-rc2/net/bluetooth/af_bluetooth.c
--- linux-2.4.19-rc1/net/bluetooth/af_bluetooth.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/net/bluetooth/af_bluetooth.c	Tue Jul 16 16:25:21 2002
@@ -25,9 +25,9 @@
 /*
  * BlueZ Bluetooth address family and sockets.
  *
- * $Id: af_bluetooth.c,v 1.3 2002/04/17 17:37:15 maxk Exp $
+ * $Id: af_bluetooth.c,v 1.6 2002/06/25 22:03:39 maxk Exp $
  */
-#define VERSION "2.0"
+#define VERSION "2.1"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -57,7 +57,7 @@
 #endif
 
 /* Bluetooth sockets */
-#define BLUEZ_MAX_PROTO	4
+#define BLUEZ_MAX_PROTO	5
 static struct net_proto_family *bluez_proto[BLUEZ_MAX_PROTO];
 
 int bluez_sock_register(int proto, struct net_proto_family *ops)
@@ -86,7 +86,7 @@
 
 static int bluez_sock_create(struct socket *sock, int proto)
 {
-	if (proto > BLUEZ_MAX_PROTO)
+	if (proto >= BLUEZ_MAX_PROTO)
 		return -EINVAL;
 
 #if defined(CONFIG_KMOD)
diff -urN linux-2.4.19-rc1/net/bluetooth/hci_conn.c linux-2.4.19-rc2/net/bluetooth/hci_conn.c
--- linux-2.4.19-rc1/net/bluetooth/hci_conn.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/net/bluetooth/hci_conn.c	Tue Jul 16 16:25:21 2002
@@ -25,7 +25,7 @@
 /*
  * HCI Connection handling.
  *
- * $Id: hci_conn.c,v 1.2 2002/04/17 17:37:16 maxk Exp $
+ * $Id: hci_conn.c,v 1.3 2002/06/25 22:03:39 maxk Exp $
  */
 
 #include <linux/config.h>
@@ -188,9 +188,6 @@
 			acl->link = NULL;
 			hci_conn_put(acl);
 		}
-
-		/* Unacked frames */
-		hdev->sco_cnt += conn->sent;
 	} else {
 		struct hci_conn *sco = conn->link;
 		if (sco)
diff -urN linux-2.4.19-rc1/net/bluetooth/hci_core.c linux-2.4.19-rc2/net/bluetooth/hci_core.c
--- linux-2.4.19-rc1/net/bluetooth/hci_core.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/net/bluetooth/hci_core.c	Tue Jul 16 16:25:21 2002
@@ -25,7 +25,7 @@
 /*
  * BlueZ HCI Core.
  *
- * $Id: hci_core.c,v 1.6 2002/04/17 17:37:16 maxk Exp $
+ * $Id: hci_core.c,v 1.7 2002/06/25 22:03:39 maxk Exp $
  */
 
 #include <linux/config.h>
@@ -1103,14 +1103,13 @@
 {
 	struct conn_hash *h = &hdev->conn_hash;
 	struct hci_conn  *conn = NULL;
-	int num = 0, min = 0xffff;
+	int num = 0, min = ~0;
         struct list_head *p;
 
 	/* We don't have to lock device here. Connections are always 
 	 * added and removed with TX task disabled. */
 	list_for_each(p, &h->list) {
 		struct hci_conn *c;
-
 		c = list_entry(p, struct hci_conn, list);
 
 		if (c->type != type || c->state != BT_CONNECTED
@@ -1118,14 +1117,15 @@
 			continue;
 		num++;
 
-		if (c->sent < min || type == SCO_LINK) {
+		if (c->sent < min) {
 			min  = c->sent;
 			conn = c;
 		}
 	}
 
 	if (conn) {
-		int q = hdev->acl_cnt / num;
+		int cnt = (type == ACL_LINK ? hdev->acl_cnt : hdev->sco_cnt);
+		int q = cnt / num;
 		*quote = q ? q : 1;
 	} else
 		*quote = 0;
@@ -1142,21 +1142,21 @@
 
 	BT_DBG("%s", hdev->name);
 
-	if (!hdev->acl_cnt && (jiffies - hdev->acl_last_tx) > HZ*5) {
+	/* ACL tx timeout must be longer than maximum
+	 * link supervision timeout (40.9 seconds) */
+	if (!hdev->acl_cnt && (jiffies - hdev->acl_last_tx) > (HZ * 45)) {
 		BT_ERR("%s ACL tx timeout", hdev->name);
 		hdev->acl_cnt++;
 	}
-	
+
 	while (hdev->acl_cnt && (conn = hci_low_sent(hdev, ACL_LINK, &quote))) {
-		while (quote && (skb = skb_dequeue(&conn->data_q))) {
+		while (quote-- && (skb = skb_dequeue(&conn->data_q))) {
 			BT_DBG("skb %p len %d", skb, skb->len);
-
 			hci_send_frame(skb);
 			hdev->acl_last_tx = jiffies;
 
-			conn->sent++;
 			hdev->acl_cnt--;
-			quote--;
+			conn->sent++;
 		}
 	}
 }
@@ -1170,15 +1170,14 @@
 
 	BT_DBG("%s", hdev->name);
 
-	while ((conn = hci_low_sent(hdev, SCO_LINK, &quote))) {
-		while (quote && (skb = skb_dequeue(&conn->data_q))) {
+	while (hdev->sco_cnt && (conn = hci_low_sent(hdev, SCO_LINK, &quote))) {
+		while (quote-- && (skb = skb_dequeue(&conn->data_q))) {
 			BT_DBG("skb %p len %d", skb, skb->len);
-
 			hci_send_frame(skb);
 
-			//conn->sent++;
-			//hdev->sco_cnt--;
-			quote--;
+			conn->sent++;
+			if (conn->sent == ~0)
+				conn->sent = 0;
 		}
 	}
 }
diff -urN linux-2.4.19-rc1/net/bluetooth/lib.c linux-2.4.19-rc2/net/bluetooth/lib.c
--- linux-2.4.19-rc1/net/bluetooth/lib.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/net/bluetooth/lib.c	Tue Jul 16 16:25:21 2002
@@ -25,7 +25,7 @@
 /*
  * BlueZ kernel library.
  *
- * $Id: lib.c,v 1.1 2002/03/08 21:06:59 maxk Exp $
+ * $Id: lib.c,v 1.2 2002/06/20 19:55:08 maxk Exp $
  */
 
 #include <linux/kernel.h>
@@ -105,7 +105,7 @@
 		return EACCES;
 
 	case 0x06:
-		return EINVAL;
+		return EBADE;
 
 	case 0x07:
 		return ENOMEM;
diff -urN linux-2.4.19-rc1/net/ipv4/netfilter/ip_conntrack_core.c linux-2.4.19-rc2/net/ipv4/netfilter/ip_conntrack_core.c
--- linux-2.4.19-rc1/net/ipv4/netfilter/ip_conntrack_core.c	Tue Jul 16 16:25:16 2002
+++ linux-2.4.19-rc2/net/ipv4/netfilter/ip_conntrack_core.c	Tue Jul 16 16:25:21 2002
@@ -497,9 +497,11 @@
 		/* Try dropping from random chain, or else from the
                    chain about to put into (in case they're trying to
                    bomb one hash chain). */
-		if (drop_next >= ip_conntrack_htable_size)
+		if (drop_next == ip_conntrack_htable_size-1)
 			drop_next = 0;
-		if (!early_drop(&ip_conntrack_hash[drop_next++])
+		else
+			drop_next++;
+		if (!early_drop(&ip_conntrack_hash[drop_next])
 		    && !early_drop(&ip_conntrack_hash[hash])) {
 			if (net_ratelimit())
 				printk(KERN_WARNING
