Changeset e89ec63


Ignore:
Timestamp:
Nov 29, 2006, 8:12:03 PM (18 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
c08883a
Parents:
c5d783f
Message:

Updated to Linux and Linux Headers 2.6.19

Files:
1 added
1 deleted
3 edited
4 moved

Legend:

Unmodified
Added
Removed
  • BOOK/introduction/common/changelog.xml

    rc5d783f re89ec63  
    3838
    3939    <listitem>
     40      <para>November 29, 2006</para>
     41      <itemizedlist>
     42        <listitem>
     43          <para>[jim] - Updated to Linux 2.6.19.</para>
     44        </listitem>
     45        <listitem>
     46          <para>[jim] - Updated to Linux Headers 2.6.19-11292006.</para>
     47        </listitem>
     48      </itemizedlist>
     49    </listitem>
     50
     51    <listitem>
    4052      <para>November 27, 2006</para>
    4153      <itemizedlist>
  • BOOK/packages.ent

    rc5d783f re89ec63  
    245245<!ENTITY linux-dl-version "2.6">
    246246
    247 <!ENTITY linux-version "2.6.18.3">
    248 <!ENTITY linux-size "41,034 KB">
     247<!ENTITY linux-version "2.6.19">
     248<!ENTITY linux-size "41,896 KB">
    249249<!ENTITY linux-url "&kernel;linux/kernel/v&linux-dl-version;/linux-&linux-version;.tar.bz2">
    250 <!ENTITY linux-md5 "fb10bd4918f22f349131af0b5121b70e ">
     250<!ENTITY linux-md5 "443c265b57e87eadc0c677c3acc37e20">
    251251<!ENTITY linux-home "http://www.kernel.org/">
    252252
    253 <!ENTITY linux-headers-version "&linux-version;-11202006">
    254 <!ENTITY linux-headers-size "1,571 KB">
     253<!ENTITY linux-headers-version "&linux-version;-11292006">
     254<!ENTITY linux-headers-size "1,596 KB">
    255255<!ENTITY linux-headers-url "&packages-root;linux-headers-&linux-headers-version;.tar.bz2">
    256 <!ENTITY linux-headers-md5 "04a523fbe7726fc8014fcf6030d3a6e5">
     256<!ENTITY linux-headers-md5 "4e88ef01af8731ef87ed104455923eb7">
    257257<!ENTITY linux-headers-home "http://headers.cross-lfs.org/">
    258258
  • BOOK/patches.ent

    rc5d783f re89ec63  
    7474
    7575<!ENTITY linux-tulip-patch "linux-&linux-version;-tulip-1.patch">
    76 <!ENTITY linux-tulip-patch-md5 "0dd7027a8cb8e59c74c24ff0a8f45f3b">
     76<!ENTITY linux-tulip-patch-md5 "a5b2576d50c8b9b4121265deec5d6ef6">
    7777<!ENTITY linux-tulip-patch-size "8 KB">
    7878
     
    188188
    189189<!ENTITY linux-io_fix-patch "linux-&linux-version;-alpha_io_fix-1.patch">
    190 <!ENTITY linux-io_fix-patch-md5 "67f66a5d252e5b82f4aeb3b06f4e5735">
    191 <!ENTITY linux-io_fix-patch-size "4 KB">
     190<!ENTITY linux-io_fix-patch-md5 "9fb551c7dbcac22e8331538222e841cc">
     191<!ENTITY linux-io_fix-patch-size "8 KB">
    192192
    193193<!-- Start of mips/mips64 patches -->
     
    210210
    211211<!ENTITY linux-mips-patch "linux-&linux-version;-mips-1.patch">
    212 <!ENTITY linux-mips-patch-md5 "8261e9561077aef57f8dbe7806c186f5">
    213 <!ENTITY linux-mips-patch-size "640 KB">
     212<!ENTITY linux-mips-patch-md5 "4c75e5302a334649f126a0de3295b883">
     213<!ENTITY linux-mips-patch-size "464 KB">
    214214
    215215<!ENTITY linux-mips_fixes-patch "linux-&linux-version;-mips_fixes-1.patch">
    216 <!ENTITY linux-mips_fixes-patch-md5 "288d4be61922aaae85142ae55dc7ede3">
     216<!ENTITY linux-mips_fixes-patch-md5 "447226a5e1585de8c57ab4f64a348d21">
    217217<!ENTITY linux-mips_fixes-patch-size "12 KB">
    218218
  • patches/linux-2.6.19-cobalt_x86-1.patch

    rc5d783f re89ec63  
    11Submitted By: Jim Gifford (patches at jg555 dot com)
    2 Date: 2006-11-15
    3 Initial Package Version: 2.6.18.2
     2Date: 2006-11-29
     3Initial Package Version: 2.6.19
    44Origin: Gentoo - Jeff Waters
    55Upstream Status: N/A
    66Description: Adds Support for the x86 Cobalt Series
    77
    8 diff -Naur linux-2.6.18.2.orig/Makefile linux-2.6.18.2/Makefile
    9 --- linux-2.6.18.2.orig/Makefile        2006-11-03 17:33:58.000000000 -0800
    10 +++ linux-2.6.18.2/Makefile     2006-11-15 21:20:19.730033585 -0800
    11 @@ -197,6 +197,7 @@
     8diff -Naur linux-2.6.19.orig/Makefile linux-2.6.19/Makefile
     9--- linux-2.6.19.orig/Makefile  2006-11-29 13:57:37.000000000 -0800
     10+++ linux-2.6.19/Makefile       2006-11-29 19:13:54.000000000 -0800
     11@@ -203,6 +203,7 @@
    1212 KBUILD_MODULES :=
    1313 KBUILD_BUILTIN := 1
     
    1717 #      When we're building modules with modversions, we need to consider
    1818 #      the built-in objects during the descend as well, in order to
    19 @@ -702,6 +703,11 @@
     19@@ -709,6 +710,11 @@
    2020       cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \
    2121                      $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
     
    2929        $(call if_changed_dep,as_o_S)
    3030 
    31 diff -Naur linux-2.6.18.2.orig/arch/i386/kernel/Makefile linux-2.6.18.2/arch/i386/kernel/Makefile
    32 --- linux-2.6.18.2.orig/arch/i386/kernel/Makefile       2006-11-03 17:33:58.000000000 -0800
    33 +++ linux-2.6.18.2/arch/i386/kernel/Makefile    2006-11-15 21:20:19.730033585 -0800
     31diff -Naur linux-2.6.19.orig/arch/i386/kernel/Makefile linux-2.6.19/arch/i386/kernel/Makefile
     32--- linux-2.6.19.orig/arch/i386/kernel/Makefile 2006-11-29 13:57:37.000000000 -0800
     33+++ linux-2.6.19/arch/i386/kernel/Makefile      2006-11-29 19:13:54.000000000 -0800
    3434@@ -52,6 +52,7 @@
    3535 targets += vsyscall-note.o vsyscall.lds
     
    4040       cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
    4141                          -Wl,-T,$(filter-out FORCE,$^) -o $@
    42 diff -Naur linux-2.6.18.2.orig/arch/i386/kernel/cobalt.c linux-2.6.18.2/arch/i386/kernel/cobalt.c
    43 --- linux-2.6.18.2.orig/arch/i386/kernel/cobalt.c       1969-12-31 16:00:00.000000000 -0800
    44 +++ linux-2.6.18.2/arch/i386/kernel/cobalt.c    2006-11-15 21:20:19.730033585 -0800
     42diff -Naur linux-2.6.19.orig/arch/i386/kernel/cobalt.c linux-2.6.19/arch/i386/kernel/cobalt.c
     43--- linux-2.6.19.orig/arch/i386/kernel/cobalt.c 1969-12-31 16:00:00.000000000 -0800
     44+++ linux-2.6.19/arch/i386/kernel/cobalt.c      2006-11-29 19:13:54.000000000 -0800
    4545@@ -0,0 +1,281 @@
    4646+/* $Id: cobalt.c,v 1.34 2002/11/04 17:54:14 thockin Exp $ */
     
    325325+}
    326326+module_init(cobalt_arch_init);
    327 diff -Naur linux-2.6.18.2.orig/arch/i386/kernel/process.c linux-2.6.18.2/arch/i386/kernel/process.c
    328 --- linux-2.6.18.2.orig/arch/i386/kernel/process.c      2006-11-03 17:33:58.000000000 -0800
    329 +++ linux-2.6.18.2/arch/i386/kernel/process.c   2006-11-15 21:28:11.450334183 -0800
    330 @@ -51,6 +51,11 @@
     327diff -Naur linux-2.6.19.orig/arch/i386/kernel/process.c linux-2.6.19/arch/i386/kernel/process.c
     328--- linux-2.6.19.orig/arch/i386/kernel/process.c        2006-11-29 13:57:37.000000000 -0800
     329+++ linux-2.6.19/arch/i386/kernel/process.c     2006-11-29 19:13:54.000000000 -0800
     330@@ -52,6 +52,11 @@
    331331 #include <asm/math_emu.h>
    332332 #endif
     
    340340 
    341341 #include <asm/tlbflush.h>
    342 @@ -482,6 +487,12 @@
     342@@ -483,6 +488,12 @@
    343343 void dump_thread(struct pt_regs * regs, struct user * dump)
    344344 {
     
    353353 /* changed the size calculations - should hopefully work better. lbt */
    354354        dump->magic = CMAGIC;
    355 diff -Naur linux-2.6.18.2.orig/arch/i386/kernel/reboot.c linux-2.6.18.2/arch/i386/kernel/reboot.c
    356 --- linux-2.6.18.2.orig/arch/i386/kernel/reboot.c       2006-11-03 17:33:58.000000000 -0800
    357 +++ linux-2.6.18.2/arch/i386/kernel/reboot.c    2006-11-15 21:26:57.096812163 -0800
     355diff -Naur linux-2.6.19.orig/arch/i386/kernel/reboot.c linux-2.6.19/arch/i386/kernel/reboot.c
     356--- linux-2.6.19.orig/arch/i386/kernel/reboot.c 2006-11-29 13:57:37.000000000 -0800
     357+++ linux-2.6.19/arch/i386/kernel/reboot.c      2006-11-29 19:13:54.000000000 -0800
    358358@@ -18,6 +18,11 @@
    359359 #include "mach_reboot.h"
     
    368368  * Power off function, if any
    369369  */
    370 @@ -283,8 +288,38 @@
     370@@ -279,8 +284,38 @@
    371371 EXPORT_SYMBOL(machine_real_restart);
    372372 #endif
     
    407407        int reboot_cpu_id;
    408408 
    409 @@ -321,6 +356,9 @@
     409@@ -317,6 +352,9 @@
    410410 
    411411 void machine_emergency_restart(void)
     
    417417                if (efi_enabled) {
    418418                        efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL);
    419 @@ -345,6 +383,10 @@
     419@@ -341,6 +379,10 @@
    420420 
    421421 void machine_restart(char * __unused)
     
    428428        machine_emergency_restart();
    429429 }
    430 diff -Naur linux-2.6.18.2.orig/arch/i386/kernel/traps.c linux-2.6.18.2/arch/i386/kernel/traps.c
    431 --- linux-2.6.18.2.orig/arch/i386/kernel/traps.c        2006-11-03 17:33:58.000000000 -0800
    432 +++ linux-2.6.18.2/arch/i386/kernel/traps.c     2006-11-15 21:20:19.734033452 -0800
    433 @@ -56,6 +56,10 @@
     430diff -Naur linux-2.6.19.orig/arch/i386/kernel/traps.c linux-2.6.19/arch/i386/kernel/traps.c
     431--- linux-2.6.19.orig/arch/i386/kernel/traps.c  2006-11-29 13:57:37.000000000 -0800
     432+++ linux-2.6.19/arch/i386/kernel/traps.c       2006-11-29 19:15:56.000000000 -0800
     433@@ -59,6 +59,10 @@
    434434 
    435  #include "mach_traps.h"
     435 int panic_on_unrecovered_nmi;
    436436 
    437437+#ifdef CONFIG_COBALT_RAQ
     
    442442 
    443443 struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
    444 @@ -631,11 +635,14 @@
    445  
    446  static void mem_parity_error(unsigned char reason, struct pt_regs * regs)
     444@@ -705,6 +709,9 @@
     445 static __kprobes void
     446 mem_parity_error(unsigned char reason, struct pt_regs * regs)
    447447 {
    448448+#ifdef CONFIG_COBALT_RAQ
    449449+       cobalt_nmi(reason, regs);
    450450+#else
    451         printk(KERN_EMERG "Uhhuh. NMI received. Dazed and confused, but trying "
    452                         "to continue\n");
     451        printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x on "
     452                "CPU %d.\n", reason, smp_processor_id());
    453453        printk(KERN_EMERG "You probably have a hardware problem with your RAM "
    454                         "chips\n");
     454@@ -713,7 +720,7 @@
     455                 panic("NMI: Not continuing");
     456 
     457        printk(KERN_EMERG "Dazed and confused, but trying to continue\n");
    455458-
    456459+#endif
     
    458461        clear_mem_error(reason);
    459462 }
    460 diff -Naur linux-2.6.18.2.orig/drivers/Kconfig linux-2.6.18.2/drivers/Kconfig
    461 --- linux-2.6.18.2.orig/drivers/Kconfig 2006-11-03 17:33:58.000000000 -0800
    462 +++ linux-2.6.18.2/drivers/Kconfig      2006-11-15 21:20:19.734033452 -0800
    463 @@ -74,4 +74,6 @@
     463diff -Naur linux-2.6.19.orig/drivers/Kconfig linux-2.6.19/drivers/Kconfig
     464--- linux-2.6.19.orig/drivers/Kconfig   2006-11-29 13:57:37.000000000 -0800
     465+++ linux-2.6.19/drivers/Kconfig        2006-11-29 19:13:54.000000000 -0800
     466@@ -78,4 +78,6 @@
    464467 
    465468 source "drivers/dma/Kconfig"
     
    468471+
    469472 endmenu
    470 diff -Naur linux-2.6.18.2.orig/drivers/Makefile linux-2.6.18.2/drivers/Makefile
    471 --- linux-2.6.18.2.orig/drivers/Makefile        2006-11-03 17:33:58.000000000 -0800
    472 +++ linux-2.6.18.2/drivers/Makefile     2006-11-15 21:20:19.734033452 -0800
    473 @@ -65,6 +65,8 @@
     473diff -Naur linux-2.6.19.orig/drivers/Makefile linux-2.6.19/drivers/Makefile
     474--- linux-2.6.19.orig/drivers/Makefile  2006-11-29 13:57:37.000000000 -0800
     475+++ linux-2.6.19/drivers/Makefile       2006-11-29 19:13:54.000000000 -0800
     476@@ -66,6 +66,8 @@
    474477 obj-$(CONFIG_EDAC)             += edac/
    475478 obj-$(CONFIG_MCA)              += mca/
     
    480483 obj-$(CONFIG_MMC)              += mmc/
    481484 obj-$(CONFIG_NEW_LEDS)         += leds/
    482 diff -Naur linux-2.6.18.2.orig/drivers/char/Kconfig linux-2.6.18.2/drivers/char/Kconfig
    483 --- linux-2.6.18.2.orig/drivers/char/Kconfig    2006-11-03 17:33:58.000000000 -0800
    484 +++ linux-2.6.18.2/drivers/char/Kconfig 2006-11-15 21:20:19.734033452 -0800
    485 @@ -809,7 +809,7 @@
    486           Samsung S3C2410. This can provide periodic interrupt rates
    487           from 1Hz to 64Hz for user programs, and wakeup from Alarm.
     485diff -Naur linux-2.6.19.orig/drivers/char/Kconfig linux-2.6.19/drivers/char/Kconfig
     486--- linux-2.6.19.orig/drivers/char/Kconfig      2006-11-29 13:57:37.000000000 -0800
     487+++ linux-2.6.19/drivers/char/Kconfig   2006-11-29 19:13:54.000000000 -0800
     488@@ -793,7 +793,7 @@
     489          will get access to the real time clock (or hardware clock) built
     490          into your computer.
    488491 
    489492-config COBALT_LCD
     
    492495        depends on MIPS_COBALT
    493496        help
    494 diff -Naur linux-2.6.18.2.orig/drivers/char/Makefile linux-2.6.18.2/drivers/char/Makefile
    495 --- linux-2.6.18.2.orig/drivers/char/Makefile   2006-11-03 17:33:58.000000000 -0800
    496 +++ linux-2.6.18.2/drivers/char/Makefile        2006-11-15 21:20:19.734033452 -0800
    497 @@ -77,7 +77,7 @@
     497diff -Naur linux-2.6.19.orig/drivers/char/Makefile linux-2.6.19/drivers/char/Makefile
     498--- linux-2.6.19.orig/drivers/char/Makefile     2006-11-29 13:57:37.000000000 -0800
     499+++ linux-2.6.19/drivers/char/Makefile  2006-11-29 19:13:54.000000000 -0800
     500@@ -79,7 +79,7 @@
    498501 obj-$(CONFIG_DS1620)           += ds1620.o
    499502 obj-$(CONFIG_HW_RANDOM)                += hw_random/
     
    504507 obj-$(CONFIG_NWBUTTON)         += nwbutton.o
    505508 obj-$(CONFIG_NWFLASH)          += nwflash.o
    506 diff -Naur linux-2.6.18.2.orig/drivers/char/misc.c linux-2.6.18.2/drivers/char/misc.c
    507 --- linux-2.6.18.2.orig/drivers/char/misc.c     2006-11-03 17:33:58.000000000 -0800
    508 +++ linux-2.6.18.2/drivers/char/misc.c  2006-11-15 21:20:19.734033452 -0800
     509diff -Naur linux-2.6.19.orig/drivers/char/misc.c linux-2.6.19/drivers/char/misc.c
     510--- linux-2.6.19.orig/drivers/char/misc.c       2006-11-29 13:57:37.000000000 -0800
     511+++ linux-2.6.19/drivers/char/misc.c    2006-11-29 19:13:54.000000000 -0800
    509512@@ -49,6 +49,17 @@
    510513 #include <linux/tty.h>
     
    539542 static void *misc_seq_start(struct seq_file *seq, loff_t *pos)
    540543 {
    541 diff -Naur linux-2.6.18.2.orig/drivers/char/nvram.c linux-2.6.18.2/drivers/char/nvram.c
    542 --- linux-2.6.18.2.orig/drivers/char/nvram.c    2006-11-03 17:33:58.000000000 -0800
    543 +++ linux-2.6.18.2/drivers/char/nvram.c 2006-11-15 21:20:19.734033452 -0800
     544diff -Naur linux-2.6.19.orig/drivers/char/nvram.c linux-2.6.19/drivers/char/nvram.c
     545--- linux-2.6.19.orig/drivers/char/nvram.c      2006-11-29 13:57:37.000000000 -0800
     546+++ linux-2.6.19/drivers/char/nvram.c   2006-11-29 19:13:54.000000000 -0800
    544547@@ -49,8 +49,7 @@
    545548 #if defined(CONFIG_ATARI)
     
    552555 #    define MACH COBALT
    553556 #  else
    554 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/Kconfig linux-2.6.18.2/drivers/cobalt/Kconfig
    555 --- linux-2.6.18.2.orig/drivers/cobalt/Kconfig  1969-12-31 16:00:00.000000000 -0800
    556 +++ linux-2.6.18.2/drivers/cobalt/Kconfig       2006-11-15 21:20:19.734033452 -0800
     557diff -Naur linux-2.6.19.orig/drivers/cobalt/Kconfig linux-2.6.19/drivers/cobalt/Kconfig
     558--- linux-2.6.19.orig/drivers/cobalt/Kconfig    1969-12-31 16:00:00.000000000 -0800
     559+++ linux-2.6.19/drivers/cobalt/Kconfig 2006-11-29 19:13:54.000000000 -0800
    557560@@ -0,0 +1,133 @@
    558561+#
     
    689692+
    690693+endmenu
    691 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/Makefile linux-2.6.18.2/drivers/cobalt/Makefile
    692 --- linux-2.6.18.2.orig/drivers/cobalt/Makefile 1969-12-31 16:00:00.000000000 -0800
    693 +++ linux-2.6.18.2/drivers/cobalt/Makefile      2006-11-15 21:20:19.734033452 -0800
     694diff -Naur linux-2.6.19.orig/drivers/cobalt/Makefile linux-2.6.19/drivers/cobalt/Makefile
     695--- linux-2.6.19.orig/drivers/cobalt/Makefile   1969-12-31 16:00:00.000000000 -0800
     696+++ linux-2.6.19/drivers/cobalt/Makefile        2006-11-29 19:13:54.000000000 -0800
    694697@@ -0,0 +1,18 @@
    695698+#
     
    711714+obj-$(CONFIG_COBALT_RULER)     += ruler.o
    712715+
    713 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/README linux-2.6.18.2/drivers/cobalt/README
    714 --- linux-2.6.18.2.orig/drivers/cobalt/README   1969-12-31 16:00:00.000000000 -0800
    715 +++ linux-2.6.18.2/drivers/cobalt/README        2006-11-15 21:20:19.734033452 -0800
     716diff -Naur linux-2.6.19.orig/drivers/cobalt/README linux-2.6.19/drivers/cobalt/README
     717--- linux-2.6.19.orig/drivers/cobalt/README     1969-12-31 16:00:00.000000000 -0800
     718+++ linux-2.6.19/drivers/cobalt/README  2006-11-29 19:13:54.000000000 -0800
    716719@@ -0,0 +1,19 @@
    717720+Notes on Cobalt's drivers:
     
    734737+
    735738+--
    736 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/acpi.c linux-2.6.18.2/drivers/cobalt/acpi.c
    737 --- linux-2.6.18.2.orig/drivers/cobalt/acpi.c   1969-12-31 16:00:00.000000000 -0800
    738 +++ linux-2.6.18.2/drivers/cobalt/acpi.c        2006-11-15 21:20:19.734033452 -0800
     739diff -Naur linux-2.6.19.orig/drivers/cobalt/acpi.c linux-2.6.19/drivers/cobalt/acpi.c
     740--- linux-2.6.19.orig/drivers/cobalt/acpi.c     1969-12-31 16:00:00.000000000 -0800
     741+++ linux-2.6.19/drivers/cobalt/acpi.c  2006-11-29 19:13:54.000000000 -0800
    739742@@ -0,0 +1,1994 @@
    740743+ /*
     
    27322735+
    27332736+#endif /* CONFIG_COBALT_EMU_ACPI */
    2734 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/fans.c linux-2.6.18.2/drivers/cobalt/fans.c
    2735 --- linux-2.6.18.2.orig/drivers/cobalt/fans.c   1969-12-31 16:00:00.000000000 -0800
    2736 +++ linux-2.6.18.2/drivers/cobalt/fans.c        2006-11-15 21:20:19.738033319 -0800
     2737diff -Naur linux-2.6.19.orig/drivers/cobalt/fans.c linux-2.6.19/drivers/cobalt/fans.c
     2738--- linux-2.6.19.orig/drivers/cobalt/fans.c     1969-12-31 16:00:00.000000000 -0800
     2739+++ linux-2.6.19/drivers/cobalt/fans.c  2006-11-29 19:13:54.000000000 -0800
    27372740@@ -0,0 +1,419 @@
    27382741+/* $Id: fans.c,v 1.18 2002/03/16 21:33:02 duncan Exp $
     
    31553158+
    31563159+#endif /* CONFIG_COBALT_FANS || CONFIG_COBALT_FANS_MODULE */
    3157 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/i2c.c linux-2.6.18.2/drivers/cobalt/i2c.c
    3158 --- linux-2.6.18.2.orig/drivers/cobalt/i2c.c    1969-12-31 16:00:00.000000000 -0800
    3159 +++ linux-2.6.18.2/drivers/cobalt/i2c.c 2006-11-15 21:20:19.738033319 -0800
     3160diff -Naur linux-2.6.19.orig/drivers/cobalt/i2c.c linux-2.6.19/drivers/cobalt/i2c.c
     3161--- linux-2.6.19.orig/drivers/cobalt/i2c.c      1969-12-31 16:00:00.000000000 -0800
     3162+++ linux-2.6.19/drivers/cobalt/i2c.c   2006-11-29 19:13:54.000000000 -0800
    31603163@@ -0,0 +1,519 @@
    31613164+/*
     
    36783681+EXPORT_SYMBOL(cobalt_i2c_write_word);
    36793682+EXPORT_SYMBOL(cobalt_i2c_write_block);
    3680 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/init.c linux-2.6.18.2/drivers/cobalt/init.c
    3681 --- linux-2.6.18.2.orig/drivers/cobalt/init.c   1969-12-31 16:00:00.000000000 -0800
    3682 +++ linux-2.6.18.2/drivers/cobalt/init.c        2006-11-15 21:20:19.738033319 -0800
     3683diff -Naur linux-2.6.19.orig/drivers/cobalt/init.c linux-2.6.19/drivers/cobalt/init.c
     3684--- linux-2.6.19.orig/drivers/cobalt/init.c     1969-12-31 16:00:00.000000000 -0800
     3685+++ linux-2.6.19/drivers/cobalt/init.c  2006-11-29 19:13:54.000000000 -0800
    36833686@@ -0,0 +1,114 @@
    36843687+/* $Id: init.c,v 1.22 2002/11/04 17:54:15 thockin Exp $ */
     
    37963799+}
    37973800+EXPORT_SYMBOL(cobalt_gen_proc_read);
    3798 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/lcd.c linux-2.6.18.2/drivers/cobalt/lcd.c
    3799 --- linux-2.6.18.2.orig/drivers/cobalt/lcd.c    1969-12-31 16:00:00.000000000 -0800
    3800 +++ linux-2.6.18.2/drivers/cobalt/lcd.c 2006-11-15 21:20:19.738033319 -0800
     3801diff -Naur linux-2.6.19.orig/drivers/cobalt/lcd.c linux-2.6.19/drivers/cobalt/lcd.c
     3802--- linux-2.6.19.orig/drivers/cobalt/lcd.c      1969-12-31 16:00:00.000000000 -0800
     3803+++ linux-2.6.19/drivers/cobalt/lcd.c   2006-11-29 19:13:54.000000000 -0800
    38013804@@ -0,0 +1,835 @@
    38023805+/*
     
    46354638+
    46364639+#endif /* CONFIG_COBALT_LCD */
    4637 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/led.c linux-2.6.18.2/drivers/cobalt/led.c
    4638 --- linux-2.6.18.2.orig/drivers/cobalt/led.c    1969-12-31 16:00:00.000000000 -0800
    4639 +++ linux-2.6.18.2/drivers/cobalt/led.c 2006-11-15 21:20:19.738033319 -0800
     4640diff -Naur linux-2.6.19.orig/drivers/cobalt/led.c linux-2.6.19/drivers/cobalt/led.c
     4641--- linux-2.6.19.orig/drivers/cobalt/led.c      1969-12-31 16:00:00.000000000 -0800
     4642+++ linux-2.6.19/drivers/cobalt/led.c   2006-11-29 19:13:54.000000000 -0800
    46404643@@ -0,0 +1,504 @@
    46414644+ /*
     
    51435146+
    51445147+#endif /* CONFIG_COBALT_LED */
    5145 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/net.c linux-2.6.18.2/drivers/cobalt/net.c
    5146 --- linux-2.6.18.2.orig/drivers/cobalt/net.c    1969-12-31 16:00:00.000000000 -0800
    5147 +++ linux-2.6.18.2/drivers/cobalt/net.c 2006-11-15 21:20:19.738033319 -0800
     5148diff -Naur linux-2.6.19.orig/drivers/cobalt/net.c linux-2.6.19/drivers/cobalt/net.c
     5149--- linux-2.6.19.orig/drivers/cobalt/net.c      1969-12-31 16:00:00.000000000 -0800
     5150+++ linux-2.6.19/drivers/cobalt/net.c   2006-11-29 19:13:54.000000000 -0800
    51485151@@ -0,0 +1,133 @@
    51495152+/*
     
    52805283+       return 0;
    52815284+}
    5282 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/raminfo.c linux-2.6.18.2/drivers/cobalt/raminfo.c
    5283 --- linux-2.6.18.2.orig/drivers/cobalt/raminfo.c        1969-12-31 16:00:00.000000000 -0800
    5284 +++ linux-2.6.18.2/drivers/cobalt/raminfo.c     2006-11-15 21:20:19.738033319 -0800
     5285diff -Naur linux-2.6.19.orig/drivers/cobalt/raminfo.c linux-2.6.19/drivers/cobalt/raminfo.c
     5286--- linux-2.6.19.orig/drivers/cobalt/raminfo.c  1969-12-31 16:00:00.000000000 -0800
     5287+++ linux-2.6.19/drivers/cobalt/raminfo.c       2006-11-29 19:13:54.000000000 -0800
    52855288@@ -0,0 +1,320 @@
    52865289+/* $Id: raminfo.c,v 1.7 2001/10/29 22:21:36 thockin Exp $
     
    56045607+
    56055608+#endif /* CONFIG_COBALT_RAMINFO || CONFIG_COBALT_RAMINFO_MODULE */
    5606 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/ruler.c linux-2.6.18.2/drivers/cobalt/ruler.c
    5607 --- linux-2.6.18.2.orig/drivers/cobalt/ruler.c  1969-12-31 16:00:00.000000000 -0800
    5608 +++ linux-2.6.18.2/drivers/cobalt/ruler.c       2006-11-15 21:20:19.738033319 -0800
     5609diff -Naur linux-2.6.19.orig/drivers/cobalt/ruler.c linux-2.6.19/drivers/cobalt/ruler.c
     5610--- linux-2.6.19.orig/drivers/cobalt/ruler.c    1969-12-31 16:00:00.000000000 -0800
     5611+++ linux-2.6.19/drivers/cobalt/ruler.c 2006-11-29 19:13:54.000000000 -0800
    56095612@@ -0,0 +1,419 @@
    56105613+/*
     
    60276030+       return 0;
    60286031+}
    6029 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/sensors.c linux-2.6.18.2/drivers/cobalt/sensors.c
    6030 --- linux-2.6.18.2.orig/drivers/cobalt/sensors.c        1969-12-31 16:00:00.000000000 -0800
    6031 +++ linux-2.6.18.2/drivers/cobalt/sensors.c     2006-11-15 21:20:19.738033319 -0800
     6032diff -Naur linux-2.6.19.orig/drivers/cobalt/sensors.c linux-2.6.19/drivers/cobalt/sensors.c
     6033--- linux-2.6.19.orig/drivers/cobalt/sensors.c  1969-12-31 16:00:00.000000000 -0800
     6034+++ linux-2.6.19/drivers/cobalt/sensors.c       2006-11-29 19:13:54.000000000 -0800
    60326035@@ -0,0 +1,525 @@
    60336036+/* $Id: sensors.c,v 1.31 2002/08/29 00:33:01 uzi Exp $
     
    65566559+
    65576560+#endif /* CONFIG_COBALT_SENSORS */
    6558 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/serialnum.c linux-2.6.18.2/drivers/cobalt/serialnum.c
    6559 --- linux-2.6.18.2.orig/drivers/cobalt/serialnum.c      1969-12-31 16:00:00.000000000 -0800
    6560 +++ linux-2.6.18.2/drivers/cobalt/serialnum.c   2006-11-15 21:20:19.742033186 -0800
     6561diff -Naur linux-2.6.19.orig/drivers/cobalt/serialnum.c linux-2.6.19/drivers/cobalt/serialnum.c
     6562--- linux-2.6.19.orig/drivers/cobalt/serialnum.c        1969-12-31 16:00:00.000000000 -0800
     6563+++ linux-2.6.19/drivers/cobalt/serialnum.c     2006-11-29 19:13:54.000000000 -0800
    65616564@@ -0,0 +1,453 @@
    65626565+/* $Id: serialnum.c,v 1.15 2001/10/23 20:15:27 thockin Exp $ */
     
    70137016+
    70147017+#endif /* CONFIG_COBALT_SERNUM */
    7015 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/systype.c linux-2.6.18.2/drivers/cobalt/systype.c
    7016 --- linux-2.6.18.2.orig/drivers/cobalt/systype.c        1969-12-31 16:00:00.000000000 -0800
    7017 +++ linux-2.6.18.2/drivers/cobalt/systype.c     2006-11-15 21:20:19.742033186 -0800
     7018diff -Naur linux-2.6.19.orig/drivers/cobalt/systype.c linux-2.6.19/drivers/cobalt/systype.c
     7019--- linux-2.6.19.orig/drivers/cobalt/systype.c  1969-12-31 16:00:00.000000000 -0800
     7020+++ linux-2.6.19/drivers/cobalt/systype.c       2006-11-29 19:13:54.000000000 -0800
    70187021@@ -0,0 +1,280 @@
    70197022+/*
     
    72977300+       return 0;
    72987301+}
    7299 diff -Naur linux-2.6.18.2.orig/drivers/cobalt/wdt.c linux-2.6.18.2/drivers/cobalt/wdt.c
    7300 --- linux-2.6.18.2.orig/drivers/cobalt/wdt.c    1969-12-31 16:00:00.000000000 -0800
    7301 +++ linux-2.6.18.2/drivers/cobalt/wdt.c 2006-11-15 21:20:19.742033186 -0800
     7302diff -Naur linux-2.6.19.orig/drivers/cobalt/wdt.c linux-2.6.19/drivers/cobalt/wdt.c
     7303--- linux-2.6.19.orig/drivers/cobalt/wdt.c      1969-12-31 16:00:00.000000000 -0800
     7304+++ linux-2.6.19/drivers/cobalt/wdt.c   2006-11-29 19:13:54.000000000 -0800
    73027305@@ -0,0 +1,424 @@
    73037306+/* $Id: wdt.c,v 1.21 2002/07/02 00:38:17 asun Exp $ */
     
    77257728+#endif
    77267729+}
    7727 diff -Naur linux-2.6.18.2.orig/drivers/net/Kconfig linux-2.6.18.2/drivers/net/Kconfig
    7728 --- linux-2.6.18.2.orig/drivers/net/Kconfig     2006-11-03 17:33:58.000000000 -0800
    7729 +++ linux-2.6.18.2/drivers/net/Kconfig  2006-11-15 21:20:19.742033186 -0800
    7730 @@ -1486,6 +1486,16 @@
     7730diff -Naur linux-2.6.19.orig/drivers/net/Kconfig linux-2.6.19/drivers/net/Kconfig
     7731--- linux-2.6.19.orig/drivers/net/Kconfig       2006-11-29 13:57:37.000000000 -0800
     7732+++ linux-2.6.19/drivers/net/Kconfig    2006-11-29 19:13:54.000000000 -0800
     7733@@ -1516,6 +1516,16 @@
    77317734          <file:Documentation/networking/net-modules.txt>.  The module
    77327735          will be called e100.
     
    77457748        tristate "Mylex EISA LNE390A/B support (EXPERIMENTAL)"
    77467749        depends on NET_PCI && EISA && EXPERIMENTAL
    7747 diff -Naur linux-2.6.18.2.orig/drivers/net/e100.c linux-2.6.18.2/drivers/net/e100.c
    7748 --- linux-2.6.18.2.orig/drivers/net/e100.c      2006-11-03 17:33:58.000000000 -0800
    7749 +++ linux-2.6.18.2/drivers/net/e100.c   2006-11-15 21:20:19.742033186 -0800
     7750diff -Naur linux-2.6.19.orig/drivers/net/e100.c linux-2.6.19/drivers/net/e100.c
     7751--- linux-2.6.19.orig/drivers/net/e100.c        2006-11-29 13:57:37.000000000 -0800
     7752+++ linux-2.6.19/drivers/net/e100.c     2006-11-29 19:17:22.000000000 -0800
    77507753@@ -162,6 +162,7 @@
    7751  #define DRV_VERSION            "3.5.10-k2"DRV_EXT
     7754 #define DRV_VERSION            "3.5.17-k2"DRV_EXT
    77527755 #define DRV_DESCRIPTION                "Intel(R) PRO/100 Network Driver"
    7753  #define DRV_COPYRIGHT          "Copyright(c) 1999-2005 Intel Corporation"
     7756 #define DRV_COPYRIGHT          "Copyright(c) 1999-2006 Intel Corporation"
    77547757+#define DRV_MODIFIED           "Modified by <jeff@404ster.com> to ignore bad EEPROM checksums"
    77557758 #define PFX                    DRV_NAME ": "
     
    77727775 
    77737776        return 0;
    7774 @@ -2876,6 +2883,9 @@
     7777@@ -2880,6 +2887,9 @@
    77757778        if(((1 << debug) - 1) & NETIF_MSG_DRV) {
    77767779                printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
     
    77807783+#endif
    77817784        }
    7782         return pci_module_init(&e100_driver);
     7785        return pci_register_driver(&e100_driver);
    77837786 }
    7784 diff -Naur linux-2.6.18.2.orig/include/cobalt/acpi.h linux-2.6.18.2/include/cobalt/acpi.h
    7785 --- linux-2.6.18.2.orig/include/cobalt/acpi.h   1969-12-31 16:00:00.000000000 -0800
    7786 +++ linux-2.6.18.2/include/cobalt/acpi.h        2006-11-15 21:20:19.742033186 -0800
     7787diff -Naur linux-2.6.19.orig/include/cobalt/acpi.h linux-2.6.19/include/cobalt/acpi.h
     7788--- linux-2.6.19.orig/include/cobalt/acpi.h     1969-12-31 16:00:00.000000000 -0800
     7789+++ linux-2.6.19/include/cobalt/acpi.h  2006-11-29 19:13:54.000000000 -0800
    77877790@@ -0,0 +1,82 @@
    77887791+/*
     
    78687871+
    78697872+#endif /* COBALT_ACPI_H */
    7870 diff -Naur linux-2.6.18.2.orig/include/cobalt/cobalt.h linux-2.6.18.2/include/cobalt/cobalt.h
    7871 --- linux-2.6.18.2.orig/include/cobalt/cobalt.h 1969-12-31 16:00:00.000000000 -0800
    7872 +++ linux-2.6.18.2/include/cobalt/cobalt.h      2006-11-15 21:20:19.742033186 -0800
     7873diff -Naur linux-2.6.19.orig/include/cobalt/cobalt.h linux-2.6.19/include/cobalt/cobalt.h
     7874--- linux-2.6.19.orig/include/cobalt/cobalt.h   1969-12-31 16:00:00.000000000 -0800
     7875+++ linux-2.6.19/include/cobalt/cobalt.h        2006-11-29 19:13:54.000000000 -0800
    78737876@@ -0,0 +1,58 @@
    78747877+/* $Id: cobalt.h,v 1.16 2002/11/04 17:54:15 thockin Exp $ */
     
    79307933+
    79317934+#endif /* !defined(COBALT_H) && defined(CONFIG_COBALT_RAQ) */
    7932 diff -Naur linux-2.6.18.2.orig/include/cobalt/i2c.h linux-2.6.18.2/include/cobalt/i2c.h
    7933 --- linux-2.6.18.2.orig/include/cobalt/i2c.h    1969-12-31 16:00:00.000000000 -0800
    7934 +++ linux-2.6.18.2/include/cobalt/i2c.h 2006-11-15 21:20:19.742033186 -0800
     7935diff -Naur linux-2.6.19.orig/include/cobalt/i2c.h linux-2.6.19/include/cobalt/i2c.h
     7936--- linux-2.6.19.orig/include/cobalt/i2c.h      1969-12-31 16:00:00.000000000 -0800
     7937+++ linux-2.6.19/include/cobalt/i2c.h   2006-11-29 19:13:54.000000000 -0800
    79357938@@ -0,0 +1,40 @@
    79367939+/*
     
    79747977+
    79757978+#endif /* COBALT_I2C_H */
    7976 diff -Naur linux-2.6.18.2.orig/include/cobalt/lcd.h linux-2.6.18.2/include/cobalt/lcd.h
    7977 --- linux-2.6.18.2.orig/include/cobalt/lcd.h    1969-12-31 16:00:00.000000000 -0800
    7978 +++ linux-2.6.18.2/include/cobalt/lcd.h 2006-11-15 21:20:19.742033186 -0800
     7979diff -Naur linux-2.6.19.orig/include/cobalt/lcd.h linux-2.6.19/include/cobalt/lcd.h
     7980--- linux-2.6.19.orig/include/cobalt/lcd.h      1969-12-31 16:00:00.000000000 -0800
     7981+++ linux-2.6.19/include/cobalt/lcd.h   2006-11-29 19:13:54.000000000 -0800
    79797982@@ -0,0 +1,95 @@
    79807983+/*
     
    80738076+
    80748077+#endif /* COBALT_LCD_H */
    8075 diff -Naur linux-2.6.18.2.orig/include/cobalt/led.h linux-2.6.18.2/include/cobalt/led.h
    8076 --- linux-2.6.18.2.orig/include/cobalt/led.h    1969-12-31 16:00:00.000000000 -0800
    8077 +++ linux-2.6.18.2/include/cobalt/led.h 2006-11-15 21:20:19.742033186 -0800
     8078diff -Naur linux-2.6.19.orig/include/cobalt/led.h linux-2.6.19/include/cobalt/led.h
     8079--- linux-2.6.19.orig/include/cobalt/led.h      1969-12-31 16:00:00.000000000 -0800
     8080+++ linux-2.6.19/include/cobalt/led.h   2006-11-29 19:13:54.000000000 -0800
    80788081@@ -0,0 +1,59 @@
    80798082+/*
     
    81368139+#endif /* COBALT_LED_H */
    81378140+
    8138 diff -Naur linux-2.6.18.2.orig/include/cobalt/misc.h linux-2.6.18.2/include/cobalt/misc.h
    8139 --- linux-2.6.18.2.orig/include/cobalt/misc.h   1969-12-31 16:00:00.000000000 -0800
    8140 +++ linux-2.6.18.2/include/cobalt/misc.h        2006-11-15 21:27:17.024148165 -0800
     8141diff -Naur linux-2.6.19.orig/include/cobalt/misc.h linux-2.6.19/include/cobalt/misc.h
     8142--- linux-2.6.19.orig/include/cobalt/misc.h     1969-12-31 16:00:00.000000000 -0800
     8143+++ linux-2.6.19/include/cobalt/misc.h  2006-11-29 19:13:54.000000000 -0800
    81418144@@ -0,0 +1,12 @@
    81428145+/* $Id: cobalt-misc.h,v 1.1 2001/04/04 03:36:43 thockin Exp $ */
     
    81528155+
    81538156+#endif
    8154 diff -Naur linux-2.6.18.2.orig/include/cobalt/net.h linux-2.6.18.2/include/cobalt/net.h
    8155 --- linux-2.6.18.2.orig/include/cobalt/net.h    1969-12-31 16:00:00.000000000 -0800
    8156 +++ linux-2.6.18.2/include/cobalt/net.h 2006-11-15 21:20:19.746033053 -0800
     8157diff -Naur linux-2.6.19.orig/include/cobalt/net.h linux-2.6.19/include/cobalt/net.h
     8158--- linux-2.6.19.orig/include/cobalt/net.h      1969-12-31 16:00:00.000000000 -0800
     8159+++ linux-2.6.19/include/cobalt/net.h   2006-11-29 19:13:54.000000000 -0800
    81578160@@ -0,0 +1,12 @@
    81588161+/* $Id: cobalt-net.h,v 1.3 2002/10/25 01:02:42 thockin Exp $ */
     
    81688171+
    81698172+#endif
    8170 diff -Naur linux-2.6.18.2.orig/include/cobalt/nvram.h linux-2.6.18.2/include/cobalt/nvram.h
    8171 --- linux-2.6.18.2.orig/include/cobalt/nvram.h  1969-12-31 16:00:00.000000000 -0800
    8172 +++ linux-2.6.18.2/include/cobalt/nvram.h       2006-11-15 21:20:19.746033053 -0800
     8173diff -Naur linux-2.6.19.orig/include/cobalt/nvram.h linux-2.6.19/include/cobalt/nvram.h
     8174--- linux-2.6.19.orig/include/cobalt/nvram.h    1969-12-31 16:00:00.000000000 -0800
     8175+++ linux-2.6.19/include/cobalt/nvram.h 2006-11-29 19:13:54.000000000 -0800
    81738176@@ -0,0 +1,125 @@
    81748177+/*
     
    82978300+
    82988301+#endif /* COBALT_NVRAM_H */
    8299 diff -Naur linux-2.6.18.2.orig/include/cobalt/ruler.h linux-2.6.18.2/include/cobalt/ruler.h
    8300 --- linux-2.6.18.2.orig/include/cobalt/ruler.h  1969-12-31 16:00:00.000000000 -0800
    8301 +++ linux-2.6.18.2/include/cobalt/ruler.h       2006-11-15 21:20:19.746033053 -0800
     8302diff -Naur linux-2.6.19.orig/include/cobalt/ruler.h linux-2.6.19/include/cobalt/ruler.h
     8303--- linux-2.6.19.orig/include/cobalt/ruler.h    1969-12-31 16:00:00.000000000 -0800
     8304+++ linux-2.6.19/include/cobalt/ruler.h 2006-11-29 19:13:54.000000000 -0800
    83028305@@ -0,0 +1,15 @@
    83038306+/* $Id: cobalt-ruler.h,v 1.4 2001/06/08 20:46:44 thockin Exp $ */
     
    83168319+
    83178320+#endif
    8318 diff -Naur linux-2.6.18.2.orig/include/cobalt/sensors.h linux-2.6.18.2/include/cobalt/sensors.h
    8319 --- linux-2.6.18.2.orig/include/cobalt/sensors.h        1969-12-31 16:00:00.000000000 -0800
    8320 +++ linux-2.6.18.2/include/cobalt/sensors.h     2006-11-15 21:20:19.746033053 -0800
     8321diff -Naur linux-2.6.19.orig/include/cobalt/sensors.h linux-2.6.19/include/cobalt/sensors.h
     8322--- linux-2.6.19.orig/include/cobalt/sensors.h  1969-12-31 16:00:00.000000000 -0800
     8323+++ linux-2.6.19/include/cobalt/sensors.h       2006-11-29 19:13:54.000000000 -0800
    83218324@@ -0,0 +1,29 @@
    83228325+/* $Id: cobalt-sensors.h,v 1.2 2001/09/25 18:10:29 thockin Exp $ */
     
    83498352+
    83508353+#endif
    8351 diff -Naur linux-2.6.18.2.orig/include/cobalt/serialnum.h linux-2.6.18.2/include/cobalt/serialnum.h
    8352 --- linux-2.6.18.2.orig/include/cobalt/serialnum.h      1969-12-31 16:00:00.000000000 -0800
    8353 +++ linux-2.6.18.2/include/cobalt/serialnum.h   2006-11-15 21:20:19.746033053 -0800
     8354diff -Naur linux-2.6.19.orig/include/cobalt/serialnum.h linux-2.6.19/include/cobalt/serialnum.h
     8355--- linux-2.6.19.orig/include/cobalt/serialnum.h        1969-12-31 16:00:00.000000000 -0800
     8356+++ linux-2.6.19/include/cobalt/serialnum.h     2006-11-29 19:13:54.000000000 -0800
    83548357@@ -0,0 +1,16 @@
    83558358+/*
     
    83698372+
    83708373+#endif /* COBALT_SERIALNUM_H */
    8371 diff -Naur linux-2.6.18.2.orig/include/cobalt/superio.h linux-2.6.18.2/include/cobalt/superio.h
    8372 --- linux-2.6.18.2.orig/include/cobalt/superio.h        1969-12-31 16:00:00.000000000 -0800
    8373 +++ linux-2.6.18.2/include/cobalt/superio.h     2006-11-15 21:20:19.766032388 -0800
     8374diff -Naur linux-2.6.19.orig/include/cobalt/superio.h linux-2.6.19/include/cobalt/superio.h
     8375--- linux-2.6.19.orig/include/cobalt/superio.h  1969-12-31 16:00:00.000000000 -0800
     8376+++ linux-2.6.19/include/cobalt/superio.h       2006-11-29 19:13:54.000000000 -0800
    83748377@@ -0,0 +1,225 @@
    83758378+/*
     
    85988601+
    85998602+#endif /* COBALT_SUPERIO_H */
    8600 diff -Naur linux-2.6.18.2.orig/include/cobalt/systype.h linux-2.6.18.2/include/cobalt/systype.h
    8601 --- linux-2.6.18.2.orig/include/cobalt/systype.h        1969-12-31 16:00:00.000000000 -0800
    8602 +++ linux-2.6.18.2/include/cobalt/systype.h     2006-11-15 21:20:19.766032388 -0800
     8603diff -Naur linux-2.6.19.orig/include/cobalt/systype.h linux-2.6.19/include/cobalt/systype.h
     8604--- linux-2.6.19.orig/include/cobalt/systype.h  1969-12-31 16:00:00.000000000 -0800
     8605+++ linux-2.6.19/include/cobalt/systype.h       2006-11-29 19:13:54.000000000 -0800
    86038606@@ -0,0 +1,99 @@
    86048607+/*
     
    87018704+
    87028705+#endif
    8703 diff -Naur linux-2.6.18.2.orig/include/cobalt/wdt.h linux-2.6.18.2/include/cobalt/wdt.h
    8704 --- linux-2.6.18.2.orig/include/cobalt/wdt.h    1969-12-31 16:00:00.000000000 -0800
    8705 +++ linux-2.6.18.2/include/cobalt/wdt.h 2006-11-15 21:20:19.766032388 -0800
     8706diff -Naur linux-2.6.19.orig/include/cobalt/wdt.h linux-2.6.19/include/cobalt/wdt.h
     8707--- linux-2.6.19.orig/include/cobalt/wdt.h      1969-12-31 16:00:00.000000000 -0800
     8708+++ linux-2.6.19/include/cobalt/wdt.h   2006-11-29 19:13:54.000000000 -0800
    87068709@@ -0,0 +1,16 @@
    87078710+/* $Id: cobalt-wdt.h,v 1.1 2001/03/07 01:58:24 thockin Exp $ */
     
    87218724+
    87228725+#endif
    8723 diff -Naur linux-2.6.18.2.orig/init/main.c linux-2.6.18.2/init/main.c
    8724 --- linux-2.6.18.2.orig/init/main.c     2006-11-03 17:33:58.000000000 -0800
    8725 +++ linux-2.6.18.2/init/main.c  2006-11-15 21:20:19.770032256 -0800
    8726 @@ -650,6 +650,10 @@
     8726diff -Naur linux-2.6.19.orig/init/main.c linux-2.6.19/init/main.c
     8727--- linux-2.6.19.orig/init/main.c       2006-11-29 13:57:37.000000000 -0800
     8728+++ linux-2.6.19/init/main.c    2006-11-29 19:13:54.000000000 -0800
     8729@@ -673,6 +673,10 @@
    87278730  *
    87288731  * Now we can finally start doing some real work..
     
    87358738 {
    87368739        /* drivers will send hotplug events */
    8737 @@ -662,6 +666,10 @@
     8740@@ -685,6 +689,10 @@
    87388741 #endif
    87398742 
  • patches/linux-2.6.19-mips-1.patch

    rc5d783f re89ec63  
    11Submitted By: Jim Gifford (patches at jg555 dot com)
    2 Date: 2006-11-20
    3 Initial Package Version: 2.6.18.3
     2Date: 2006-11-29
     3Initial Package Version: 2.6.19
    44Origin: Linux-MIPS
    55Upstream Status: http://www.linux-mips.org/pub/linux/mips/kernel/v2.6/
    66
    7 diff -Naur linux-2.6.18.3/Documentation/mips/time.README linux-mips-2.6.18.3/Documentation/mips/time.README
    8 --- linux-2.6.18.3/Documentation/mips/time.README       2006-11-18 19:28:22.000000000 -0800
    9 +++ linux-mips-2.6.18.3/Documentation/mips/time.README  2006-11-20 10:09:08.000000000 -0800
    10 @@ -63,7 +63,7 @@
    11    a) board_time_init - a function pointer.  Invoked at the beginnig of
    12       time_init().  It is optional.
    13         1. (optional) set up RTC routines
    14 -       2. (optional) calibrate and set the mips_counter_frequency
    15 +       2. (optional) calibrate and set the mips_hpt_frequency
    16  
    17    b) plat_timer_setup - a function pointer.  Invoked at the end of time_init()
    18         1. (optional) over-ride any decisions made in time_init()
    19 @@ -72,7 +72,7 @@
    20  
    21    c) (optional) board-specific RTC routines.
    22  
    23 -  d) (optional) mips_counter_frequency - It must be definied if the board
    24 +  d) (optional) mips_hpt_frequency - It must be definied if the board
    25       is using CPU counter for timer interrupt or it is using fixed rate
    26       gettimeoffset().
    27  
    28 @@ -104,7 +104,7 @@
    29       or use an exnternal timer?
    30  
    31       In order to use CPU counter register as the timer interrupt source, you
    32 -     must know the counter speed (mips_counter_frequency).  It is usually the
    33 +     must know the counter speed (mips_hpt_frequency).  It is usually the
    34       same as the CPU speed or an integral divisor of it.
    35  
    36    d) decide on whether you want to use high-level or low-level timer
    37 @@ -122,7 +122,7 @@
    38  
    39    board_time_init() -
    40         a) (optional) set up RTC routines,
    41 -        b) (optional) calibrate and set the mips_counter_frequency
    42 +        b) (optional) calibrate and set the mips_hpt_frequency
    43             (only needed if you intended to use fixed_rate_gettimeoffset
    44              or use cpu counter as timer interrupt source)
    45  
    46 diff -Naur linux-2.6.18.3/Makefile linux-mips-2.6.18.3/Makefile
    47 --- linux-2.6.18.3/Makefile     2006-11-18 19:28:22.000000000 -0800
    48 +++ linux-mips-2.6.18.3/Makefile        2006-11-20 10:09:08.000000000 -0800
    49 @@ -149,10 +149,7 @@
    50  # then ARCH is assigned, getting whatever value it gets normally, and
    51  # SUBARCH is subsequently ignored.
    52  
    53 -SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
    54 -                                 -e s/arm.*/arm/ -e s/sa110/arm/ \
    55 -                                 -e s/s390x/s390/ -e s/parisc64/parisc/ \
    56 -                                 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
    57 +SUBARCH := mips
    58  
    59  # Cross compiling and selecting different set of gcc/bin-utils
    60  # ---------------------------------------------------------------------------
    61 diff -Naur linux-2.6.18.3/arch/mips/Kconfig linux-mips-2.6.18.3/arch/mips/Kconfig
    62 --- linux-2.6.18.3/arch/mips/Kconfig    2006-11-18 19:28:22.000000000 -0800
    63 +++ linux-mips-2.6.18.3/arch/mips/Kconfig       2006-11-20 10:09:08.000000000 -0800
    64 @@ -126,7 +126,6 @@
    65         select IRQ_CPU
    66         select IRQ_CPU_RM7K
    67         select IRQ_CPU_RM9K
    68 -       select SERIAL_RM9000
    69         select SYS_HAS_CPU_RM9000
    70         select SYS_SUPPORTS_32BIT_KERNEL
    71         select SYS_SUPPORTS_64BIT_KERNEL
    72 @@ -478,9 +477,8 @@
    73         select SWAP_IO_SPACE
    74         select SYS_HAS_CPU_RM7000
    75         select SYS_SUPPORTS_32BIT_KERNEL
    76 -       select SYS_SUPPORTS_64BIT_KERNEL
    77 +       select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
    78         select SYS_SUPPORTS_BIG_ENDIAN
    79 -       select ARCH_SPARSEMEM_ENABLE
    80         help
    81           The Ocelot is a MIPS-based Single Board Computer (SBC) made by
    82           Momentum Computer <http://www.momenco.com/>.
    83 @@ -524,8 +522,6 @@
     7diff -Naur linux-2.6.19/arch/mips/Kconfig linux-mips-2.6.19/arch/mips/Kconfig
     8--- linux-2.6.19/arch/mips/Kconfig      2006-11-29 13:57:37.000000000 -0800
     9+++ linux-mips-2.6.19/arch/mips/Kconfig 2006-11-29 15:23:09.000000000 -0800
     10@@ -468,8 +468,6 @@
    8411 config MACH_VR41XX
    8512        bool "NEC VR41XX-based machines"
     
    9017 config PMC_YOSEMITE
    9118        bool "PMC-Sierra Yosemite eval board"
    92 @@ -614,6 +610,7 @@
    93         select SYS_SUPPORTS_64BIT_KERNEL
    94         select SYS_SUPPORTS_BIG_ENDIAN
    95         select SYS_SUPPORTS_NUMA
    96 +       select SYS_SUPPORTS_SMP
    97         help
    98           This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
    99           workstations.  To compile a Linux kernel that runs on these, say Y
    100 @@ -1200,7 +1197,7 @@
     19@@ -1142,7 +1140,7 @@
    10120        select CPU_SUPPORTS_32BIT_KERNEL
    10221        select CPU_SUPPORTS_64BIT_KERNEL
     
    10726          kernel built with this option will not run on any other type of
    10827          processor or vice versa.
    109 @@ -1527,6 +1524,7 @@
    110         select CPU_MIPSR2_SRS
    111         select MIPS_MT
    112         select SMP
    113 +       select SYS_SUPPORTS_SMP
    114         help
    115           This is a kernel model which is known a SMTC or lately has been
    116           marketesed into SMVP.
    117 @@ -1538,6 +1536,7 @@
    118         select CPU_MIPSR2_SRS
    119         select MIPS_MT
    120         select SMP
    121 +       select SYS_SUPPORTS_SMP
    122         help
    123           This is a kernel model which is also known a VSMP or lately
    124           has been marketesed into SMVP.
    125 @@ -1649,9 +1648,7 @@
    126         default y
    127  
    128  config IRQ_PER_CPU
    129 -       depends on SMP
    130         bool
    131 -       default y
    132  
    133  #
    134  # - Highmem only makes sense for the 32-bit kernel.
    135 @@ -1691,9 +1688,6 @@
    136  
    137  config ARCH_SPARSEMEM_ENABLE
    138         bool
    139 -
    140 -config ARCH_SPARSEMEM_ENABLE
    141 -       bool
    142         select SPARSEMEM_STATIC
    143  
    144  config NUMA
    145 @@ -1719,6 +1713,7 @@
    146  config SMP
    147         bool "Multi-Processing support"
    148         depends on SYS_SUPPORTS_SMP
    149 +       select IRQ_PER_CPU
    150         help
    151           This enables support for systems with more than one CPU. If you have
    152           a system with only one CPU, like most personal computers, say N. If
    153 @@ -1973,6 +1968,11 @@
     28@@ -1922,6 +1920,11 @@
    15429        depends on MIPS32_COMPAT
    15530        default y
     
    16338        bool "Kernel support for o32 binaries"
    16439        depends on MIPS32_COMPAT
    165 diff -Naur linux-2.6.18.3/arch/mips/Makefile linux-mips-2.6.18.3/arch/mips/Makefile
    166 --- linux-2.6.18.3/arch/mips/Makefile   2006-11-18 19:28:22.000000000 -0800
    167 +++ linux-mips-2.6.18.3/arch/mips/Makefile      2006-11-20 10:09:08.000000000 -0800
    168 @@ -63,7 +63,9 @@
    169  ifdef CONFIG_BUILD_ELF64
    170  cflags-y               += $(call cc-option,-mno-explicit-relocs)
    171  else
    172 -cflags-y               += $(call cc-option,-msym32)
    173 +# -msym32 can not be used for modules since they are loaded into XKSEG
    174 +CFLAGS_MODULE          += $(call cc-option,-mno-explicit-relocs)
    175 +CFLAGS_KERNEL          += $(call cc-option,-msym32)
    176  endif
    177  endif
    178  
    179 @@ -91,8 +93,17 @@
    180  # carefully avoid to add it redundantly because gcc 3.3/3.4 complains
    181  # when fed the toolchain default!
    182  #
    183 -cflags-$(CONFIG_CPU_BIG_ENDIAN)                += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB -D__MIPSEB__)
    184 -cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL -D__MIPSEL__)
    185 +# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
    186 +# 2006-10-10 don't properly change the the predefined symbols if -EB / -EL
    187 +# are used, so we kludge that here.  A bug has been filed at
    188 +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
    189 +#
    190 +undef-all += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
    191 +undef-all += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
    192 +predef-be += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
    193 +predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
    194 +cflags-$(CONFIG_CPU_BIG_ENDIAN)                += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
    195 +cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
    196  
    197  cflags-$(CONFIG_SB1XXX_CORELIS)        += $(call cc-option,-mno-sched-prolog) \
    198                                    -fno-omit-frame-pointer
    199 @@ -330,6 +341,7 @@
    200  # MIPS SEAD board
    201  #
    202  core-$(CONFIG_MIPS_SEAD)       += arch/mips/mips-boards/sead/
    203 +cflags-$(CONFIG_MIPS_SEAD)     += -Iinclude/asm-mips/mach-mips
    204  load-$(CONFIG_MIPS_SEAD)       += 0xffffffff80100000
    205  
    206  #
    207 diff -Naur linux-2.6.18.3/arch/mips/au1000/common/pci.c linux-mips-2.6.18.3/arch/mips/au1000/common/pci.c
    208 --- linux-2.6.18.3/arch/mips/au1000/common/pci.c        2006-11-18 19:28:22.000000000 -0800
    209 +++ linux-mips-2.6.18.3/arch/mips/au1000/common/pci.c   2006-11-20 10:09:08.000000000 -0800
     40diff -Naur linux-2.6.19/arch/mips/au1000/common/pci.c linux-mips-2.6.19/arch/mips/au1000/common/pci.c
     41--- linux-2.6.19/arch/mips/au1000/common/pci.c  2006-11-29 13:57:37.000000000 -0800
     42+++ linux-mips-2.6.19/arch/mips/au1000/common/pci.c     2006-11-29 15:23:09.000000000 -0800
    21043@@ -76,13 +76,17 @@
    21144        }
     
    23366 #endif
    23467 
    235 diff -Naur linux-2.6.18.3/arch/mips/au1000/common/setup.c linux-mips-2.6.18.3/arch/mips/au1000/common/setup.c
    236 --- linux-2.6.18.3/arch/mips/au1000/common/setup.c      2006-11-18 19:28:22.000000000 -0800
    237 +++ linux-mips-2.6.18.3/arch/mips/au1000/common/setup.c 2006-11-20 10:09:08.000000000 -0800
     68diff -Naur linux-2.6.19/arch/mips/au1000/common/setup.c linux-mips-2.6.19/arch/mips/au1000/common/setup.c
     69--- linux-2.6.19/arch/mips/au1000/common/setup.c        2006-11-29 13:57:37.000000000 -0800
     70+++ linux-mips-2.6.19/arch/mips/au1000/common/setup.c   2006-11-29 15:23:09.000000000 -0800
    23871@@ -141,17 +141,20 @@
    23972 /* This routine should be valid for all Au1x based boards */
     
    26598 #endif
    26699 
    267 diff -Naur linux-2.6.18.3/arch/mips/au1000/db1x00/Makefile linux-mips-2.6.18.3/arch/mips/au1000/db1x00/Makefile
    268 --- linux-2.6.18.3/arch/mips/au1000/db1x00/Makefile     2006-11-18 19:28:22.000000000 -0800
    269 +++ linux-mips-2.6.18.3/arch/mips/au1000/db1x00/Makefile        2006-11-20 10:09:08.000000000 -0800
    270 @@ -6,4 +6,3 @@
    271  # Makefile for the Alchemy Semiconductor Db1x00 board.
    272  
    273  lib-y := init.o board_setup.o irqmap.o
    274 -obj-$(CONFIG_WM97XX_COMODULE) += mirage_ts.o
    275 diff -Naur linux-2.6.18.3/arch/mips/au1000/db1x00/mirage_ts.c linux-mips-2.6.18.3/arch/mips/au1000/db1x00/mirage_ts.c
    276 --- linux-2.6.18.3/arch/mips/au1000/db1x00/mirage_ts.c  2006-11-18 19:28:22.000000000 -0800
    277 +++ linux-mips-2.6.18.3/arch/mips/au1000/db1x00/mirage_ts.c     1969-12-31 16:00:00.000000000 -0800
    278 @@ -1,260 +0,0 @@
    279 -/*
    280 - * linux/arch/mips/au1000/db1x00/mirage_ts.c
    281 - *
    282 - * BRIEF MODULE DESCRIPTION
    283 - *     Glue between Mirage board-specific touchscreen pieces
    284 - *     and generic Wolfson Codec touchscreen support.
    285 - *
    286 - *     Based on pb1100_ts.c used in Hydrogen II.
    287 - *
    288 - * Copyright (c) 2003 Embedded Edge, LLC
    289 - *             dan@embeddededge.com
    290 - *
    291 - *  This program is free software; you can redistribute         it and/or modify it
    292 - *  under  the terms of         the GNU General  Public License as published by the
    293 - *  Free Software Foundation;  either version 2 of the License, or (at your
    294 - *  option) any later version.
    295 - *
    296 - *  THIS  SOFTWARE  IS PROVIDED          ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
    297 - *  WARRANTIES,          INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
    298 - *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
    299 - *  NO EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
    300 - *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    301 - *  NOT LIMITED          TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
    302 - *  USE, DATA, OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
    303 - *  ANY THEORY OF LIABILITY, WHETHER IN         CONTRACT, STRICT LIABILITY, OR TORT
    304 - *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    305 - *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    306 - *
    307 - *  You should have received a copy of the  GNU General Public License along
    308 - *  with this program; if not, write  to the Free Software Foundation, Inc.,
    309 - *  675 Mass Ave, Cambridge, MA 02139, USA.
    310 - */
    311 -
    312 -#include <linux/types.h>
    313 -#include <linux/module.h>
    314 -#include <linux/sched.h>
    315 -#include <linux/kernel.h>
    316 -#include <linux/init.h>
    317 -#include <linux/fs.h>
    318 -#include <linux/poll.h>
    319 -#include <linux/proc_fs.h>
    320 -#include <linux/smp.h>
    321 -#include <linux/smp_lock.h>
    322 -#include <linux/wait.h>
    323 -
    324 -#include <asm/segment.h>
    325 -#include <asm/irq.h>
    326 -#include <asm/uaccess.h>
    327 -#include <asm/delay.h>
    328 -#include <asm/au1000.h>
    329 -
    330 -/*
    331 - *  Imported interface to Wolfson Codec driver.
    332 - */
    333 -extern void *wm97xx_ts_get_handle(int which);
    334 -extern int wm97xx_ts_ready(void* ts_handle);
    335 -extern void wm97xx_ts_set_cal(void* ts_handle, int xscale, int xtrans, int yscale, int ytrans);
    336 -extern u16 wm97xx_ts_get_ac97(void* ts_handle, u8 reg);
    337 -extern void wm97xx_ts_set_ac97(void* ts_handle, u8 reg, u16 val);
    338 -extern int wm97xx_ts_read_data(void* ts_handle, long* x, long* y, long* pressure);
    339 -extern void wm97xx_ts_send_data(void* ts_handle, long x, long y, long z);
    340 -
    341 -int wm97xx_comodule_present = 1;
    342 -
    343 -
    344 -#define TS_NAME "mirage_ts"
    345 -
    346 -#define err(format, arg...) printk(KERN_ERR TS_NAME ": " format "\n" , ## arg)
    347 -#define info(format, arg...) printk(KERN_INFO TS_NAME ": " format "\n" , ## arg)
    348 -#define warn(format, arg...) printk(KERN_WARNING TS_NAME ": " format "\n" , ## arg)
    349 -#define DPRINTK(format, arg...) printk("%s: " format "\n", __FUNCTION__ , ## arg)
    350 -
    351 -
    352 -#define PEN_DOWN_IRQ   AU1000_GPIO_7
    353 -
    354 -static struct task_struct *ts_task = 0;
    355 -static DECLARE_COMPLETION(ts_complete);
    356 -static DECLARE_WAIT_QUEUE_HEAD(pendown_wait);
    357 -
    358 -#ifdef CONFIG_WM97XX_FIVEWIRETS
    359 -static int release_pressure = 1;
    360 -#else
    361 -static int release_pressure = 50;
    362 -#endif
    363 -
    364 -typedef struct {
    365 -   long x;
    366 -   long y;
    367 -} DOWN_EVENT;
    368 -
    369 -#define SAMPLE_RATE    50      /* samples per second */
    370 -#define PEN_DEBOUNCE   5       /* samples for settling - fn of SAMPLE_RATE */
    371 -#define PEN_UP_TIMEOUT 10      /* in seconds */
    372 -#define PEN_UP_SETTLE  5       /* samples per second */
    373 -
    374 -static struct {
    375 -       int xscale;
    376 -       int xtrans;
    377 -       int yscale;
    378 -       int ytrans;
    379 -} mirage_ts_cal =
    380 -{
    381 -#if 0
    382 -       .xscale   = 84,
    383 -       .xtrans = -157,
    384 -       .yscale   = 66,
    385 -       .ytrans = -150,
    386 -#else
    387 -       .xscale   = 84,
    388 -       .xtrans = -150,
    389 -       .yscale   = 66,
    390 -       .ytrans = -146,
    391 -#endif
    392 -};
    393 -
    394 -
    395 -static void pendown_irq(int irqnr, void *devid, struct pt_regs *regs)
    396 -{
    397 -//DPRINTK("got one 0x%x", au_readl(SYS_PINSTATERD));
    398 -       wake_up(&pendown_wait);
    399 -}
    400 -
    401 -static int ts_thread(void *id)
    402 -{
    403 -       static int pen_was_down = 0;
    404 -       static DOWN_EVENT pen_xy;
    405 -       long x, y, z;
    406 -       void *ts;       /* handle */
    407 -       struct task_struct *tsk = current;
    408 -       int timeout = HZ / SAMPLE_RATE;
    409 -
    410 -       ts_task = tsk;
    411 -
    412 -       daemonize();
    413 -       tsk->tty = NULL;
    414 -       tsk->policy = SCHED_FIFO;
    415 -       tsk->rt_priority = 1;
    416 -       strcpy(tsk->comm, "touchscreen");
    417 -
    418 -       /* only want to receive SIGKILL */
    419 -       spin_lock_irq(&tsk->sigmask_lock);
    420 -       siginitsetinv(&tsk->blocked, sigmask(SIGKILL));
    421 -       recalc_sigpending(tsk);
    422 -       spin_unlock_irq(&tsk->sigmask_lock);
    423 -
    424 -       /* get handle for codec */
    425 -       ts = wm97xx_ts_get_handle(0);
    426 -
    427 -       /* proceed only after everybody is ready */
    428 -       wait_event_timeout(pendown_wait, wm97xx_ts_ready(ts), HZ/4);
    429 -
    430 -       /* board-specific calibration */
    431 -       wm97xx_ts_set_cal(ts,
    432 -                       mirage_ts_cal.xscale,
    433 -                       mirage_ts_cal.xtrans,
    434 -                       mirage_ts_cal.yscale,
    435 -                       mirage_ts_cal.ytrans);
    436 -
    437 -       /* route Wolfson pendown interrupts to our GPIO */
    438 -       au_sync();
    439 -       wm97xx_ts_set_ac97(ts, 0x4c, wm97xx_ts_get_ac97(ts, 0x4c) & ~0x0008);
    440 -       au_sync();
    441 -       wm97xx_ts_set_ac97(ts, 0x56, wm97xx_ts_get_ac97(ts, 0x56) & ~0x0008);
    442 -       au_sync();
    443 -       wm97xx_ts_set_ac97(ts, 0x52, wm97xx_ts_get_ac97(ts, 0x52) | 0x2008);
    444 -       au_sync();
    445 -
    446 -       for (;;) {
    447 -               interruptible_sleep_on_timeout(&pendown_wait, timeout);
    448 -               disable_irq(PEN_DOWN_IRQ);
    449 -               if (signal_pending(tsk)) {
    450 -                       break;
    451 -               }
    452 -
    453 -               /* read codec */
    454 -               if (!wm97xx_ts_read_data(ts, &x, &y, &z))
    455 -                       z = 0;  /* treat no-data and pen-up the same */
    456 -
    457 -               if (signal_pending(tsk)) {
    458 -                       break;
    459 -               }
    460 -
    461 -               if (z >= release_pressure) {
    462 -                       y = ~y; /* top to bottom */
    463 -                       if (pen_was_down > 1 /*&& pen_was_down < PEN_DEBOUNCE*/) {//THXXX
    464 -                               /* bounce ? */
    465 -                               x = pen_xy.x;
    466 -                               y = pen_xy.y;
    467 -                               --pen_was_down;
    468 -                       } else if (pen_was_down <= 1) {
    469 -                               pen_xy.x = x;
    470 -                               pen_xy.y = y;
    471 -                               if (pen_was_down)
    472 -                                       wm97xx_ts_send_data(ts, x, y, z);
    473 -                               pen_was_down = PEN_DEBOUNCE;
    474 -                       }
    475 -                       //wm97xx_ts_send_data(ts, x, y, z);
    476 -                       timeout = HZ / SAMPLE_RATE;
    477 -               } else {
    478 -                       if (pen_was_down) {
    479 -                               if (--pen_was_down)
    480 -                                       z = release_pressure;
    481 -                               else //THXXX
    482 -                               wm97xx_ts_send_data(ts, pen_xy.x, pen_xy.y, z);
    483 -                       }
    484 -                       /* The pendown signal takes some time to settle after
    485 -                        * reading the pen pressure so wait a little
    486 -                        * before enabling the pen.
    487 -                        */
    488 -                       if (! pen_was_down) {
    489 -//                             interruptible_sleep_on_timeout(&pendown_wait, HZ / PEN_UP_SETTLE);
    490 -                               timeout = HZ * PEN_UP_TIMEOUT;
    491 -                       }
    492 -               }
    493 -               enable_irq(PEN_DOWN_IRQ);
    494 -       }
    495 -       enable_irq(PEN_DOWN_IRQ);
    496 -       ts_task = NULL;
    497 -       complete(&ts_complete);
    498 -       return 0;
    499 -}
    500 -
    501 -static int __init ts_mirage_init(void)
    502 -{
    503 -       int ret;
    504 -
    505 -       /* pen down signal is connected to GPIO 7 */
    506 -
    507 -       ret = request_irq(PEN_DOWN_IRQ, pendown_irq, 0, "ts-pendown", NULL);
    508 -       if (ret) {
    509 -               err("unable to get pendown irq%d: [%d]", PEN_DOWN_IRQ, ret);
    510 -               return ret;
    511 -       }
    512 -
    513 -       lock_kernel();
    514 -       ret = kernel_thread(ts_thread, NULL, CLONE_FS | CLONE_FILES);
    515 -       if (ret < 0) {
    516 -               unlock_kernel();
    517 -               return ret;
    518 -       }
    519 -       unlock_kernel();
    520 -
    521 -       info("Mirage touchscreen IRQ initialized.");
    522 -
    523 -       return 0;
    524 -}
    525 -
    526 -static void __exit ts_mirage_exit(void)
    527 -{
    528 -       if (ts_task) {
    529 -               send_sig(SIGKILL, ts_task, 1);
    530 -               wait_for_completion(&ts_complete);
    531 -       }
    532 -
    533 -       free_irq(PEN_DOWN_IRQ, NULL);
    534 -}
    535 -
    536 -module_init(ts_mirage_init);
    537 -module_exit(ts_mirage_exit);
    538 -
    539 diff -Naur linux-2.6.18.3/arch/mips/au1000/pb1100/board_setup.c linux-mips-2.6.18.3/arch/mips/au1000/pb1100/board_setup.c
    540 --- linux-2.6.18.3/arch/mips/au1000/pb1100/board_setup.c        2006-11-18 19:28:22.000000000 -0800
    541 +++ linux-mips-2.6.18.3/arch/mips/au1000/pb1100/board_setup.c   2006-11-20 10:09:08.000000000 -0800
     100diff -Naur linux-2.6.19/arch/mips/au1000/pb1100/board_setup.c linux-mips-2.6.19/arch/mips/au1000/pb1100/board_setup.c
     101--- linux-2.6.19/arch/mips/au1000/pb1100/board_setup.c  2006-11-29 13:57:37.000000000 -0800
     102+++ linux-mips-2.6.19/arch/mips/au1000/pb1100/board_setup.c     2006-11-29 15:23:09.000000000 -0800
    542103@@ -47,8 +47,7 @@
    543104 
     
    550111        // set AUX clock to 12MHz * 8 = 96 MHz
    551112        au_writel(8, SYS_AUXPLL);
    552 @@ -56,60 +55,64 @@
     113@@ -56,58 +55,62 @@
    553114        udelay(100);
    554115 
    555  #if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
     116 #ifdef CONFIG_USB_OHCI
    556117-       // configure pins GPIO[14:9] as GPIO
    557118-       pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x80);
     
    589150-       au_writel(0x280E3D07, MEM_STTIME3); /* 250ns cycle time */
    590151-       au_writel(0x10000000, MEM_STADDR3); /* any PCMCIA select */
     152-
     153-       // get USB Functionality pin state (device vs host drive pins)
     154-       pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
     155-       // 2nd USB port is USB host
     156-       pin_func |= 0x8000;
     157-       au_writel(pin_func, SYS_PINFUNC);
    591158+               // configure pins GPIO[14:9] as GPIO
    592159+               pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x80);
    593  
    594 -       // get USB Functionality pin state (device vs host drive pins)
    595 -       pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
     160+
    596161+               /* zero and disable FREQ2 */
    597162+               sys_freqctrl = au_readl(SYS_FREQCTRL0);
     
    627192+               // get USB Functionality pin state (device vs host drive pins)
    628193+               pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
    629  #ifndef CONFIG_AU1X00_USB_DEVICE
    630 -       // 2nd USB port is USB host
    631 -       pin_func |= 0x8000;
    632194+               // 2nd USB port is USB host
    633195+               pin_func |= 0x8000;
    634  #endif
    635 -       au_writel(pin_func, SYS_PINFUNC);
    636196+               au_writel(pin_func, SYS_PINFUNC);
    637197+       }
    638  #endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
     198 #endif // defined (CONFIG_USB_OHCI)
    639199 
    640200        /* Enable sys bus clock divider when IDLE state or no bus activity. */
     
    656216        }
    657217 }
    658 diff -Naur linux-2.6.18.3/arch/mips/cobalt/setup.c linux-mips-2.6.18.3/arch/mips/cobalt/setup.c
    659 --- linux-2.6.18.3/arch/mips/cobalt/setup.c     2006-11-18 19:28:22.000000000 -0800
    660 +++ linux-mips-2.6.18.3/arch/mips/cobalt/setup.c        2006-11-20 10:09:08.000000000 -0800
    661 @@ -51,8 +51,8 @@
    662  
    663  void __init plat_timer_setup(struct irqaction *irq)
    664  {
    665 -       /* Load timer value for 1KHz (TCLK is 50MHz) */
    666 -       GALILEO_OUTL(50*1000*1000 / 1000, GT_TC0_OFS);
    667 +       /* Load timer value for HZ (TCLK is 50MHz) */
    668 +       GALILEO_OUTL(50*1000*1000 / HZ, GT_TC0_OFS);
    669  
    670         /* Enable timer */
    671         GALILEO_OUTL(GALILEO_ENTC0 | GALILEO_SELTC0, GT_TC_CONTROL_OFS);
    672 diff -Naur linux-2.6.18.3/arch/mips/configs/e55_defconfig linux-mips-2.6.18.3/arch/mips/configs/e55_defconfig
    673 --- linux-2.6.18.3/arch/mips/configs/e55_defconfig      2006-11-18 19:28:22.000000000 -0800
    674 +++ linux-mips-2.6.18.3/arch/mips/configs/e55_defconfig 2006-11-20 10:09:08.000000000 -0800
    675 @@ -1,7 +1,7 @@
    676  #
    677  # Automatically generated make config: don't edit
    678 -# Linux kernel version: 2.6.18-rc1
    679 -# Thu Jul  6 10:04:02 2006
    680 +# Linux kernel version: 2.6.18-rc2
    681 +# Tue Jul 25 23:15:03 2006
    682  #
    683  CONFIG_MIPS=y
    684  
    685 @@ -227,7 +227,6 @@
    686  #
    687  # PCCARD (PCMCIA/CardBus) support
    688  #
    689 -# CONFIG_PCCARD is not set
    690  
    691  #
    692  # PCI Hotplug Support
    693 @@ -254,7 +253,6 @@
    694  #
    695  CONFIG_STANDALONE=y
    696  CONFIG_PREVENT_FIRMWARE_BUILD=y
    697 -# CONFIG_FW_LOADER is not set
    698  # CONFIG_SYS_HYPERVISOR is not set
    699  
    700  #
    701 @@ -284,6 +282,7 @@
    702  CONFIG_BLK_DEV_RAM=m
    703  CONFIG_BLK_DEV_RAM_COUNT=16
    704  CONFIG_BLK_DEV_RAM_SIZE=4096
    705 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
    706  # CONFIG_BLK_DEV_INITRD is not set
    707  # CONFIG_CDROM_PKTCDVD is not set
    708  
    709 @@ -643,6 +642,7 @@
    710  #
    711  # Kernel hacking
    712  #
    713 +CONFIG_TRACE_IRQFLAGS_SUPPORT=y
    714  # CONFIG_PRINTK_TIME is not set
    715  # CONFIG_MAGIC_SYSRQ is not set
    716  # CONFIG_UNUSED_SYMBOLS is not set
    717 @@ -650,7 +650,7 @@
    718  CONFIG_LOG_BUF_SHIFT=14
    719  # CONFIG_DEBUG_FS is not set
    720  CONFIG_CROSSCOMPILE=y
    721 -CONFIG_CMDLINE="console=ttyVR0,19200 mem=8M"
    722 +CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x1f0,0x3f6,40 mem=8M"
    723  
    724  #
    725  # Security options
    726 diff -Naur linux-2.6.18.3/arch/mips/configs/mpc30x_defconfig linux-mips-2.6.18.3/arch/mips/configs/mpc30x_defconfig
    727 --- linux-2.6.18.3/arch/mips/configs/mpc30x_defconfig   2006-11-18 19:28:22.000000000 -0800
    728 +++ linux-mips-2.6.18.3/arch/mips/configs/mpc30x_defconfig      2006-11-20 10:09:08.000000000 -0800
    729 @@ -1,7 +1,7 @@
    730  #
    731  # Automatically generated make config: don't edit
    732 -# Linux kernel version: 2.6.18-rc1
    733 -# Thu Jul  6 10:04:15 2006
    734 +# Linux kernel version: 2.6.18-rc2
    735 +# Tue Jul 25 23:16:46 2006
    736  #
    737  CONFIG_MIPS=y
    738  
    739 @@ -71,7 +71,6 @@
    740  CONFIG_VICTOR_MPC30X=y
    741  # CONFIG_ZAO_CAPCELLA is not set
    742  CONFIG_PCI_VR41XX=y
    743 -CONFIG_VRC4173=y
    744  CONFIG_RWSEM_GENERIC_SPINLOCK=y
    745  CONFIG_GENERIC_FIND_NEXT_BIT=y
    746  CONFIG_GENERIC_HWEIGHT=y
    747 @@ -168,6 +167,7 @@
    748  CONFIG_SYSVIPC=y
    749  # CONFIG_POSIX_MQUEUE is not set
    750  # CONFIG_BSD_PROCESS_ACCT is not set
    751 +# CONFIG_TASKSTATS is not set
    752  CONFIG_SYSCTL=y
    753  # CONFIG_AUDIT is not set
    754  # CONFIG_IKCONFIG is not set
    755 @@ -841,7 +841,7 @@
    756  # CONFIG_USB_LEGOTOWER is not set
    757  # CONFIG_USB_LCD is not set
    758  # CONFIG_USB_LED is not set
    759 -# CONFIG_USB_CY7C63 is not set
    760 +# CONFIG_USB_CYPRESS_CY7C63 is not set
    761  # CONFIG_USB_CYTHERM is not set
    762  # CONFIG_USB_PHIDGETKIT is not set
    763  # CONFIG_USB_PHIDGETSERVO is not set
    764 @@ -982,7 +982,6 @@
    765  # CONFIG_RPCSEC_GSS_SPKM3 is not set
    766  # CONFIG_SMB_FS is not set
    767  # CONFIG_CIFS is not set
    768 -# CONFIG_CIFS_DEBUG2 is not set
    769  # CONFIG_NCP_FS is not set
    770  # CONFIG_CODA_FS is not set
    771  # CONFIG_AFS_FS is not set
    772 @@ -1007,6 +1006,7 @@
    773  #
    774  # Kernel hacking
    775  #
    776 +CONFIG_TRACE_IRQFLAGS_SUPPORT=y
    777  # CONFIG_PRINTK_TIME is not set
    778  # CONFIG_MAGIC_SYSRQ is not set
    779  # CONFIG_UNUSED_SYMBOLS is not set
    780 @@ -1014,7 +1014,7 @@
    781  CONFIG_LOG_BUF_SHIFT=14
    782  # CONFIG_DEBUG_FS is not set
    783  CONFIG_CROSSCOMPILE=y
    784 -CONFIG_CMDLINE="mem=32M console=ttyVR0,19200"
    785 +CONFIG_CMDLINE="mem=32M console=ttyVR0,19200 ide0=0x170,0x376,73"
    786  
    787  #
    788  # Security options
    789 diff -Naur linux-2.6.18.3/arch/mips/configs/workpad_defconfig linux-mips-2.6.18.3/arch/mips/configs/workpad_defconfig
    790 --- linux-2.6.18.3/arch/mips/configs/workpad_defconfig  2006-11-18 19:28:22.000000000 -0800
    791 +++ linux-mips-2.6.18.3/arch/mips/configs/workpad_defconfig     2006-11-20 10:09:08.000000000 -0800
    792 @@ -1,7 +1,7 @@
    793  #
    794  # Automatically generated make config: don't edit
    795 -# Linux kernel version: 2.6.18-rc1
    796 -# Thu Jul  6 10:04:21 2006
    797 +# Linux kernel version: 2.6.18-rc2
    798 +# Tue Jul 25 23:13:04 2006
    799  #
    800  CONFIG_MIPS=y
    801  
    802 @@ -166,6 +166,7 @@
    803  CONFIG_SYSVIPC=y
    804  # CONFIG_POSIX_MQUEUE is not set
    805  # CONFIG_BSD_PROCESS_ACCT is not set
    806 +# CONFIG_TASKSTATS is not set
    807  CONFIG_SYSCTL=y
    808  # CONFIG_AUDIT is not set
    809  # CONFIG_IKCONFIG is not set
    810 @@ -379,6 +380,7 @@
    811  CONFIG_BLK_DEV_RAM=m
    812  CONFIG_BLK_DEV_RAM_COUNT=16
    813  CONFIG_BLK_DEV_RAM_SIZE=4096
    814 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
    815  # CONFIG_BLK_DEV_INITRD is not set
    816  # CONFIG_CDROM_PKTCDVD is not set
    817  # CONFIG_ATA_OVER_ETH is not set
    818 @@ -855,7 +857,6 @@
    819  # CONFIG_RPCSEC_GSS_SPKM3 is not set
    820  # CONFIG_SMB_FS is not set
    821  # CONFIG_CIFS is not set
    822 -# CONFIG_CIFS_DEBUG2 is not set
    823  # CONFIG_NCP_FS is not set
    824  # CONFIG_CODA_FS is not set
    825  # CONFIG_AFS_FS is not set
    826 @@ -880,6 +881,7 @@
    827  #
    828  # Kernel hacking
    829  #
    830 +CONFIG_TRACE_IRQFLAGS_SUPPORT=y
    831  # CONFIG_PRINTK_TIME is not set
    832  # CONFIG_MAGIC_SYSRQ is not set
    833  # CONFIG_UNUSED_SYMBOLS is not set
    834 @@ -887,7 +889,7 @@
    835  CONFIG_LOG_BUF_SHIFT=14
    836  # CONFIG_DEBUG_FS is not set
    837  CONFIG_CROSSCOMPILE=y
    838 -CONFIG_CMDLINE="console=ttyVR0,19200 mem=16M"
    839 +CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x170,0x376,49 mem=16M"
    840  
    841  #
    842  # Security options
    843 diff -Naur linux-2.6.18.3/arch/mips/gt64120/common/time.c linux-mips-2.6.18.3/arch/mips/gt64120/common/time.c
    844 --- linux-2.6.18.3/arch/mips/gt64120/common/time.c      2006-11-18 19:28:22.000000000 -0800
    845 +++ linux-mips-2.6.18.3/arch/mips/gt64120/common/time.c 2006-11-20 10:09:08.000000000 -0800
    846 @@ -62,14 +62,14 @@
    847   * as *irq (=irq0 in ../kernel/time.c).  We will do our own timer interrupt
    848   * handling.
    849   */
    850 -void gt64120_time_init(void)
    851 +void __init plat_timer_setup(struct irqaction *irq)
    852  {
    853         static struct irqaction timer;
    854  
    855         /* Disable timer first */
    856         GT_WRITE(GT_TC_CONTROL_OFS, 0);
    857         /* Load timer value for 100 Hz */
    858 -       GT_WRITE(GT_TC3_OFS, Sys_clock / 100);
    859 +       GT_WRITE(GT_TC3_OFS, Sys_clock / HZ);
    860  
    861         /*
    862          * Create the IRQ structure entry for the timer.  Since we're too early
    863 diff -Naur linux-2.6.18.3/arch/mips/gt64120/ev64120/setup.c linux-mips-2.6.18.3/arch/mips/gt64120/ev64120/setup.c
    864 --- linux-2.6.18.3/arch/mips/gt64120/ev64120/setup.c    2006-11-18 19:28:22.000000000 -0800
    865 +++ linux-mips-2.6.18.3/arch/mips/gt64120/ev64120/setup.c       2006-11-20 10:09:08.000000000 -0800
    866 @@ -69,7 +69,6 @@
    867   * Initializes basic routines and structures pointers, memory size (as
    868   * given by the bios and saves the command line.
    869   */
    870 -extern void gt64120_time_init(void);
    871  
    872  void __init plat_mem_setup(void)
    873  {
    874 @@ -77,7 +76,6 @@
    875         _machine_halt = galileo_machine_halt;
    876         pm_power_off = galileo_machine_power_off;
    877  
    878 -       board_time_init = gt64120_time_init;
    879         set_io_port_base(KSEG1);
    880  }
    881  
    882 diff -Naur linux-2.6.18.3/arch/mips/gt64120/momenco_ocelot/setup.c linux-mips-2.6.18.3/arch/mips/gt64120/momenco_ocelot/setup.c
    883 --- linux-2.6.18.3/arch/mips/gt64120/momenco_ocelot/setup.c     2006-11-18 19:28:22.000000000 -0800
    884 +++ linux-mips-2.6.18.3/arch/mips/gt64120/momenco_ocelot/setup.c        2006-11-20 10:09:08.000000000 -0800
    885 @@ -71,7 +71,6 @@
    886  extern void momenco_ocelot_halt(void);
    887  extern void momenco_ocelot_power_off(void);
    888  
    889 -extern void gt64120_time_init(void);
    890  extern void momenco_ocelot_irq_setup(void);
    891  
    892  static char reset_reason;
    893 @@ -157,8 +156,6 @@
    894         void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache);
    895         unsigned int tmpword;
    896  
    897 -       board_time_init = gt64120_time_init;
    898 -
    899         _machine_restart = momenco_ocelot_restart;
    900         _machine_halt = momenco_ocelot_halt;
    901         pm_power_off = momenco_ocelot_power_off;
    902 diff -Naur linux-2.6.18.3/arch/mips/kernel/asm-offsets.c linux-mips-2.6.18.3/arch/mips/kernel/asm-offsets.c
    903 --- linux-2.6.18.3/arch/mips/kernel/asm-offsets.c       2006-11-18 19:28:22.000000000 -0800
    904 +++ linux-mips-2.6.18.3/arch/mips/kernel/asm-offsets.c  2006-11-20 10:09:08.000000000 -0800
    905 @@ -22,7 +22,7 @@
    906  #define offset(string, ptr, member) \
    907         __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)))
    908  #define constant(string, member) \
    909 -       __asm__("\n@@@" string "%x0" : : "ri" (member))
    910 +       __asm__("\n@@@" string "%X0" : : "ri" (member))
    911  #define size(string, size) \
    912         __asm__("\n@@@" string "%0" : : "i" (sizeof(size)))
    913  #define linefeed text("")
    914 diff -Naur linux-2.6.18.3/arch/mips/kernel/cpu-probe.c linux-mips-2.6.18.3/arch/mips/kernel/cpu-probe.c
    915 --- linux-2.6.18.3/arch/mips/kernel/cpu-probe.c 2006-11-18 19:28:22.000000000 -0800
    916 +++ linux-mips-2.6.18.3/arch/mips/kernel/cpu-probe.c    2006-11-20 10:09:08.000000000 -0800
    917 @@ -38,15 +38,40 @@
    918  
    919  static void r39xx_wait(void)
    920  {
    921 -       unsigned long cfg = read_c0_conf();
    922 -       write_c0_conf(cfg | TX39_CONF_HALT);
    923 +       local_irq_disable();
    924 +       if (!need_resched())
    925 +               write_c0_conf(read_c0_conf() | TX39_CONF_HALT);
    926 +       local_irq_enable();
    927  }
    928  
    929 +/*
    930 + * There is a race when WAIT instruction executed with interrupt
    931 + * enabled.
    932 + * But it is implementation-dependent wheter the pipelie restarts when
    933 + * a non-enabled interrupt is requested.
    934 + */
    935  static void r4k_wait(void)
    936  {
    937 -       __asm__(".set\tmips3\n\t"
    938 -               "wait\n\t"
    939 -               ".set\tmips0");
    940 +       __asm__("       .set    mips3                   \n"
    941 +               "       wait                            \n"
    942 +               "       .set    mips0                   \n");
    943 +}
    944 +
    945 +/*
    946 + * This variant is preferable as it allows testing need_resched and going to
    947 + * sleep depending on the outcome atomically.  Unfortunately the "It is
    948 + * implementation-dependent whether the pipeline restarts when a non-enabled
    949 + * interrupt is requested" restriction in the MIPS32/MIPS64 architecture makes
    950 + * using this version a gamble.
    951 + */
    952 +static void r4k_wait_irqoff(void)
    953 +{
    954 +       local_irq_disable();
    955 +       if (!need_resched())
    956 +               __asm__("       .set    mips3           \n"
    957 +                       "       wait                    \n"
    958 +                       "       .set    mips0           \n");
    959 +       local_irq_enable();
    960  }
    961  
    962  /* The Au1xxx wait is available only if using 32khz counter or
    963 @@ -56,17 +81,17 @@
    964  static void au1k_wait(void)
    965  {
    966         /* using the wait instruction makes CP0 counter unusable */
    967 -       __asm__(".set mips3\n\t"
    968 -               "cache 0x14, 0(%0)\n\t"
    969 -               "cache 0x14, 32(%0)\n\t"
    970 -               "sync\n\t"
    971 -               "nop\n\t"
    972 -               "wait\n\t"
    973 -               "nop\n\t"
    974 -               "nop\n\t"
    975 -               "nop\n\t"
    976 -               "nop\n\t"
    977 -               ".set mips0\n\t"
    978 +       __asm__("       .set    mips3                   \n"
    979 +               "       cache   0x14, 0(%0)             \n"
    980 +               "       cache   0x14, 32(%0)            \n"
    981 +               "       sync                            \n"
    982 +               "       nop                             \n"
    983 +               "       wait                            \n"
    984 +               "       nop                             \n"
    985 +               "       nop                             \n"
    986 +               "       nop                             \n"
    987 +               "       nop                             \n"
    988 +               "       .set    mips0                   \n"
    989                 : : "r" (au1k_wait));
    990  }
    991  
    992 @@ -110,8 +135,6 @@
    993         case CPU_R5000:
    994         case CPU_NEVADA:
    995         case CPU_RM7000:
    996 -       case CPU_RM9000:
    997 -       case CPU_TX49XX:
    998         case CPU_4KC:
    999         case CPU_4KEC:
    1000         case CPU_4KSC:
    1001 @@ -125,6 +148,10 @@
    1002                 cpu_wait = r4k_wait;
    1003                 printk(" available.\n");
    1004                 break;
    1005 +       case CPU_TX49XX:
    1006 +               cpu_wait = r4k_wait_irqoff;
    1007 +               printk(" available.\n");
    1008 +               break;
    1009         case CPU_AU1000:
    1010         case CPU_AU1100:
    1011         case CPU_AU1500:
    1012 @@ -136,6 +163,14 @@
    1013                 } else
    1014                         printk(" unavailable.\n");
    1015                 break;
    1016 +       case CPU_RM9000:
    1017 +               if ((c->processor_id & 0x00ff) >= 0x40) {
    1018 +                       cpu_wait = r4k_wait;
    1019 +                       printk(" available.\n");
    1020 +               } else {
    1021 +                       printk(" unavailable.\n");
    1022 +               }
    1023 +               break;
    1024         default:
    1025                 printk(" unavailable.\n");
    1026                 break;
    1027 diff -Naur linux-2.6.18.3/arch/mips/kernel/head.S linux-mips-2.6.18.3/arch/mips/kernel/head.S
    1028 --- linux-2.6.18.3/arch/mips/kernel/head.S      2006-11-18 19:28:22.000000000 -0800
    1029 +++ linux-mips-2.6.18.3/arch/mips/kernel/head.S 2006-11-20 10:09:08.000000000 -0800
    1030 @@ -189,7 +189,8 @@
    1031  
    1032         MTC0            zero, CP0_CONTEXT       # clear context register
    1033         PTR_LA          $28, init_thread_union
    1034 -       PTR_ADDIU       sp, $28, _THREAD_SIZE - 32
    1035 +       PTR_LI          sp, _THREAD_SIZE - 32
    1036 +       PTR_ADDU        sp, $28
    1037         set_saved_sp    sp, t0, t1
    1038         PTR_SUBU        sp, 4 * SZREG           # init stack pointer
    1039  
    1040 diff -Naur linux-2.6.18.3/arch/mips/kernel/irixsig.c linux-mips-2.6.18.3/arch/mips/kernel/irixsig.c
    1041 --- linux-2.6.18.3/arch/mips/kernel/irixsig.c   2006-11-18 19:28:22.000000000 -0800
    1042 +++ linux-mips-2.6.18.3/arch/mips/kernel/irixsig.c      2006-11-20 10:09:08.000000000 -0800
    1043 @@ -17,6 +17,7 @@
    1044  
    1045  #include <asm/ptrace.h>
    1046  #include <asm/uaccess.h>
    1047 +#include <asm/unistd.h>
    1048  
    1049  #undef DEBUG_SIG
    1050  
    1051 @@ -172,11 +173,12 @@
    1052         return ret;
    1053  }
    1054  
    1055 -asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
    1056 +void do_irix_signal(struct pt_regs *regs)
    1057  {
    1058         struct k_sigaction ka;
    1059         siginfo_t info;
    1060         int signr;
    1061 +       sigset_t *oldset;
    1062  
    1063         /*
    1064          * We want the common case to go fast, which is why we may in certain
    1065 @@ -184,19 +186,28 @@
    1066          * if so.
    1067          */
    1068         if (!user_mode(regs))
    1069 -               return 1;
    1070 +               return;
    1071  
    1072 -       if (try_to_freeze())
    1073 -               goto no_signal;
    1074 -
    1075 -       if (!oldset)
    1076 +       if (test_thread_flag(TIF_RESTORE_SIGMASK))
    1077 +               oldset = &current->saved_sigmask;
    1078 +       else
    1079                 oldset = &current->blocked;
    1080  
    1081         signr = get_signal_to_deliver(&info, &ka, regs, NULL);
    1082 -       if (signr > 0)
    1083 -               return handle_signal(signr, &info, &ka, oldset, regs);
    1084 +       if (signr > 0) {
    1085 +               /* Whee!  Actually deliver the signal.  */
    1086 +               if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
    1087 +                       /* a signal was successfully delivered; the saved
    1088 +                        * sigmask will have been stored in the signal frame,
    1089 +                        * and will be restored by sigreturn, so we can simply
    1090 +                        * clear the TIF_RESTORE_SIGMASK flag */
    1091 +                       if (test_thread_flag(TIF_RESTORE_SIGMASK))
    1092 +                               clear_thread_flag(TIF_RESTORE_SIGMASK);
    1093 +               }
    1094 +
    1095 +               return;
    1096 +       }
    1097  
    1098 -no_signal:
    1099         /*
    1100          * Who's code doesn't conform to the restartable syscall convention
    1101          * dies here!!!  The li instruction, a single machine instruction,
    1102 @@ -208,8 +219,22 @@
    1103                     regs->regs[2] == ERESTARTNOINTR) {
    1104                         regs->cp0_epc -= 8;
    1105                 }
    1106 +               if (regs->regs[2] == ERESTART_RESTARTBLOCK) {
    1107 +                       regs->regs[2] = __NR_restart_syscall;
    1108 +                       regs->regs[7] = regs->regs[26];
    1109 +                       regs->cp0_epc -= 4;
    1110 +               }
    1111 +               regs->regs[0] = 0;      /* Don't deal with this again.  */
    1112 +       }
    1113 +
    1114 +       /*
    1115 +       * If there's no signal to deliver, we just put the saved sigmask
    1116 +       * back
    1117 +       */
    1118 +       if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
    1119 +               clear_thread_flag(TIF_RESTORE_SIGMASK);
    1120 +               sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
    1121         }
    1122 -       return 0;
    1123  }
    1124  
    1125  asmlinkage void
    1126 @@ -413,7 +438,7 @@
    1127  
    1128  asmlinkage int irix_sigsuspend(struct pt_regs *regs)
    1129  {
    1130 -       sigset_t saveset, newset;
    1131 +       sigset_t newset;
    1132         sigset_t __user *uset;
    1133  
    1134         uset = (sigset_t __user *) regs->regs[4];
    1135 @@ -422,18 +447,15 @@
    1136         sigdelsetmask(&newset, ~_BLOCKABLE);
    1137  
    1138         spin_lock_irq(&current->sighand->siglock);
    1139 -       saveset = current->blocked;
    1140 +       current->saved_sigmask = current->blocked;
    1141         current->blocked = newset;
    1142         recalc_sigpending();
    1143         spin_unlock_irq(&current->sighand->siglock);
    1144  
    1145 -       regs->regs[2] = -EINTR;
    1146 -       while (1) {
    1147 -               current->state = TASK_INTERRUPTIBLE;
    1148 -               schedule();
    1149 -               if (do_irix_signal(&saveset, regs))
    1150 -                       return -EINTR;
    1151 -       }
    1152 +       current->state = TASK_INTERRUPTIBLE;
    1153 +       schedule();
    1154 +       set_thread_flag(TIF_RESTORE_SIGMASK);
    1155 +       return -ERESTARTNOHAND;
    1156  }
    1157  
    1158  /* hate hate hate... */
    1159 diff -Naur linux-2.6.18.3/arch/mips/kernel/irq.c linux-mips-2.6.18.3/arch/mips/kernel/irq.c
    1160 --- linux-2.6.18.3/arch/mips/kernel/irq.c       2006-11-18 19:28:22.000000000 -0800
    1161 +++ linux-mips-2.6.18.3/arch/mips/kernel/irq.c  2006-11-20 10:09:08.000000000 -0800
    1162 @@ -26,6 +26,48 @@
    1163  #include <asm/system.h>
    1164  #include <asm/uaccess.h>
    1165  
    1166 +static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
    1167 +
    1168 +int __devinit allocate_irqno(void)
    1169 +{
    1170 +       int irq;
    1171 +
    1172 +again:
    1173 +       irq = find_first_zero_bit(irq_map, NR_IRQS);
    1174 +
    1175 +       if (irq >= NR_IRQS)
    1176 +               return -ENOSPC;
    1177 +
    1178 +       if (test_and_set_bit(irq, irq_map))
    1179 +               goto again;
    1180 +
    1181 +       return irq;
    1182 +}
    1183 +
    1184 +EXPORT_SYMBOL_GPL(allocate_irqno);
    1185 +
    1186 +/*
    1187 + * Allocate the 16 legacy interrupts for i8259 devices.  This happens early
    1188 + * in the kernel initialization so treating allocation failure as BUG() is
    1189 + * ok.
    1190 + */
    1191 +void __init alloc_legacy_irqno(void)
    1192 +{
    1193 +       int i;
    1194 +
    1195 +       for (i = 0; i <= 16; i++)
    1196 +               BUG_ON(test_and_set_bit(i, irq_map));
    1197 +}
    1198 +
    1199 +void __devinit free_irqno(unsigned int irq)
    1200 +{
    1201 +       smp_mb__before_clear_bit();
    1202 +       clear_bit(irq, irq_map);
    1203 +       smp_mb__after_clear_bit();
    1204 +}
    1205 +
    1206 +EXPORT_SYMBOL_GPL(free_irqno);
    1207 +
    1208  /*
    1209   * 'what should we do if we get a hw irq event on an illegal vector'.
    1210   * each architecture has to answer this themselves.
    1211 diff -Naur linux-2.6.18.3/arch/mips/kernel/linux32.c linux-mips-2.6.18.3/arch/mips/kernel/linux32.c
    1212 --- linux-2.6.18.3/arch/mips/kernel/linux32.c   2006-11-18 19:28:22.000000000 -0800
    1213 +++ linux-mips-2.6.18.3/arch/mips/kernel/linux32.c      2006-11-20 10:09:08.000000000 -0800
    1214 @@ -380,531 +380,6 @@
     218diff -Naur linux-2.6.19/arch/mips/kernel/linux32.c linux-mips-2.6.19/arch/mips/kernel/linux32.c
     219--- linux-2.6.19/arch/mips/kernel/linux32.c     2006-11-29 13:57:37.000000000 -0800
     220+++ linux-mips-2.6.19/arch/mips/kernel/linux32.c        2006-11-29 15:23:09.000000000 -0800
     221@@ -382,531 +382,6 @@
    1215222        return ret;
    1216223 }
     
    1744751 sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
    1745752 {
    1746 @@ -916,48 +391,43 @@
     753@@ -918,48 +393,43 @@
    1747754        switch (call) {
    1748755        case SEMOP:
     
    1808815        default:
    1809816                err = -EINVAL;
    1810 @@ -967,18 +437,16 @@
     817@@ -969,18 +439,16 @@
    1811818        return err;
    1812819 }
     
    1835842 struct sysctl_args32
    1836843 {
    1837 @@ -1053,7 +521,9 @@
    1838  asmlinkage int sys32_personality(unsigned long personality)
    1839  {
    1840         int ret;
    1841 -       if (current->personality == PER_LINUX32 && personality == PER_LINUX)
    1842 +       personality &= 0xffffffff;
    1843 +       if (personality(current->personality) == PER_LINUX32 &&
    1844 +           personality == PER_LINUX)
    1845                 personality = PER_LINUX32;
    1846         ret = sys_personality(personality);
    1847         if (ret == PER_LINUX32)
    1848 @@ -1296,9 +766,3 @@
    1849         return do_fork(clone_flags, newsp, &regs, 0,
    1850                        parent_tidptr, child_tidptr);
    1851  }
    1852 -
    1853 -extern asmlinkage void sys_set_thread_area(u32 addr);
    1854 -asmlinkage void sys32_set_thread_area(u32 addr)
    1855 -{
    1856 -       sys_set_thread_area(AA(addr));
    1857 -}
    1858 diff -Naur linux-2.6.18.3/arch/mips/kernel/mips-mt.c linux-mips-2.6.18.3/arch/mips/kernel/mips-mt.c
    1859 --- linux-2.6.18.3/arch/mips/kernel/mips-mt.c   2006-11-18 19:28:22.000000000 -0800
    1860 +++ linux-mips-2.6.18.3/arch/mips/kernel/mips-mt.c      2006-11-20 10:09:08.000000000 -0800
     844diff -Naur linux-2.6.19/arch/mips/kernel/mips-mt.c linux-mips-2.6.19/arch/mips/kernel/mips-mt.c
     845--- linux-2.6.19/arch/mips/kernel/mips-mt.c     2006-11-29 13:57:37.000000000 -0800
     846+++ linux-mips-2.6.19/arch/mips/kernel/mips-mt.c        2006-11-29 15:23:09.000000000 -0800
    1861847@@ -96,6 +96,10 @@
    1862848                goto out_unlock;
     
    1882868        cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
    1883869 
    1884 diff -Naur linux-2.6.18.3/arch/mips/kernel/proc.c linux-mips-2.6.18.3/arch/mips/kernel/proc.c
    1885 --- linux-2.6.18.3/arch/mips/kernel/proc.c      2006-11-18 19:28:22.000000000 -0800
    1886 +++ linux-mips-2.6.18.3/arch/mips/kernel/proc.c 2006-11-20 10:09:08.000000000 -0800
    1887 @@ -89,9 +89,9 @@
    1888  
    1889  static int show_cpuinfo(struct seq_file *m, void *v)
    1890  {
    1891 -       unsigned int version = current_cpu_data.processor_id;
    1892 -       unsigned int fp_vers = current_cpu_data.fpu_id;
    1893         unsigned long n = (unsigned long) v - 1;
    1894 +       unsigned int version = cpu_data[n].processor_id;
    1895 +       unsigned int fp_vers = cpu_data[n].fpu_id;
    1896         char fmt [64];
    1897  
    1898  #ifdef CONFIG_SMP
    1899 @@ -107,9 +107,9 @@
    1900  
    1901         seq_printf(m, "processor\t\t: %ld\n", n);
    1902         sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
    1903 -               cpu_has_fpu ? "  FPU V%d.%d" : "");
    1904 -       seq_printf(m, fmt, cpu_name[current_cpu_data.cputype <= CPU_LAST ?
    1905 -                                   current_cpu_data.cputype : CPU_UNKNOWN],
    1906 +               cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
    1907 +       seq_printf(m, fmt, cpu_name[cpu_data[n].cputype <= CPU_LAST ?
    1908 +                                   cpu_data[n].cputype : CPU_UNKNOWN],
    1909                                    (version >> 4) & 0x0f, version & 0x0f,
    1910                                    (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
    1911         seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
    1912 @@ -118,7 +118,7 @@
    1913         seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
    1914         seq_printf(m, "microsecond timers\t: %s\n",
    1915                       cpu_has_counter ? "yes" : "no");
    1916 -       seq_printf(m, "tlb_entries\t\t: %d\n", current_cpu_data.tlbsize);
    1917 +       seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
    1918         seq_printf(m, "extra interrupt vector\t: %s\n",
    1919                       cpu_has_divec ? "yes" : "no");
    1920         seq_printf(m, "hardware watchpoint\t: %s\n",
    1921 diff -Naur linux-2.6.18.3/arch/mips/kernel/process.c linux-mips-2.6.18.3/arch/mips/kernel/process.c
    1922 --- linux-2.6.18.3/arch/mips/kernel/process.c   2006-11-18 19:28:22.000000000 -0800
    1923 +++ linux-mips-2.6.18.3/arch/mips/kernel/process.c      2006-11-20 10:09:08.000000000 -0800
    1924 @@ -114,7 +114,7 @@
    1925         status |= KU_USER;
    1926         regs->cp0_status = status;
    1927         clear_used_math();
    1928 -       lose_fpu();
    1929 +       clear_fpu_owner();
    1930         if (cpu_has_dsp)
    1931                 __init_dsp();
    1932         regs->cp0_epc = pc;
    1933 @@ -281,62 +281,63 @@
    1934  } *schedule_frame, mfinfo[64];
    1935  static int mfinfo_num;
    1936  
    1937 -static int __init get_frame_info(struct mips_frame_info *info)
    1938 +static inline int is_ra_save_ins(union mips_instruction *ip)
    1939  {
    1940 -       int i;
    1941 -       void *func = info->func;
    1942 -       union mips_instruction *ip = (union mips_instruction *)func;
    1943 +       /* sw / sd $ra, offset($sp) */
    1944 +       return (ip->i_format.opcode == sw_op || ip->i_format.opcode == sd_op) &&
    1945 +               ip->i_format.rs == 29 &&
    1946 +               ip->i_format.rt == 31;
    1947 +}
    1948 +
    1949 +static inline int is_jal_jalr_jr_ins(union mips_instruction *ip)
    1950 +{
    1951 +       if (ip->j_format.opcode == jal_op)
    1952 +               return 1;
    1953 +       if (ip->r_format.opcode != spec_op)
    1954 +               return 0;
    1955 +       return ip->r_format.func == jalr_op || ip->r_format.func == jr_op;
    1956 +}
    1957 +
    1958 +static inline int is_sp_move_ins(union mips_instruction *ip)
    1959 +{
    1960 +       /* addiu/daddiu sp,sp,-imm */
    1961 +       if (ip->i_format.rs != 29 || ip->i_format.rt != 29)
    1962 +               return 0;
    1963 +       if (ip->i_format.opcode == addiu_op || ip->i_format.opcode == daddiu_op)
    1964 +               return 1;
    1965 +       return 0;
    1966 +}
    1967 +
    1968 +static int get_frame_info(struct mips_frame_info *info)
    1969 +{
    1970 +       union mips_instruction *ip = info->func;
    1971 +       int i, max_insns =
    1972 +               min(128UL, info->func_size / sizeof(union mips_instruction));
    1973 +
    1974         info->pc_offset = -1;
    1975         info->frame_size = 0;
    1976 -       for (i = 0; i < 128; i++, ip++) {
    1977 -               /* if jal, jalr, jr, stop. */
    1978 -               if (ip->j_format.opcode == jal_op ||
    1979 -                   (ip->r_format.opcode == spec_op &&
    1980 -                    (ip->r_format.func == jalr_op ||
    1981 -                     ip->r_format.func == jr_op)))
    1982 -                       break;
    1983  
    1984 -               if (info->func_size && i >= info->func_size / 4)
    1985 +       for (i = 0; i < max_insns; i++, ip++) {
    1986 +
    1987 +               if (is_jal_jalr_jr_ins(ip))
    1988                         break;
    1989 -               if (
    1990 -#ifdef CONFIG_32BIT
    1991 -                   ip->i_format.opcode == addiu_op &&
    1992 -#endif
    1993 -#ifdef CONFIG_64BIT
    1994 -                   ip->i_format.opcode == daddiu_op &&
    1995 -#endif
    1996 -                   ip->i_format.rs == 29 &&
    1997 -                   ip->i_format.rt == 29) {
    1998 -                       /* addiu/daddiu sp,sp,-imm */
    1999 -                       if (info->frame_size)
    2000 -                               continue;
    2001 -                       info->frame_size = - ip->i_format.simmediate;
    2002 +               if (!info->frame_size) {
    2003 +                       if (is_sp_move_ins(ip))
    2004 +                               info->frame_size = - ip->i_format.simmediate;
    2005 +                       continue;
    2006                 }
    2007 -
    2008 -               if (
    2009 -#ifdef CONFIG_32BIT
    2010 -                   ip->i_format.opcode == sw_op &&
    2011 -#endif
    2012 -#ifdef CONFIG_64BIT
    2013 -                   ip->i_format.opcode == sd_op &&
    2014 -#endif
    2015 -                   ip->i_format.rs == 29 &&
    2016 -                   ip->i_format.rt == 31) {
    2017 -                       /* sw / sd $ra, offset($sp) */
    2018 -                       if (info->pc_offset != -1)
    2019 -                               continue;
    2020 +               if (info->pc_offset == -1 && is_ra_save_ins(ip)) {
    2021                         info->pc_offset =
    2022                                 ip->i_format.simmediate / sizeof(long);
    2023 +                       break;
    2024                 }
    2025         }
    2026 -       if (info->pc_offset == -1 || info->frame_size == 0) {
    2027 -               if (func == schedule)
    2028 -                       printk("Can't analyze prologue code at %p\n", func);
    2029 -               info->pc_offset = -1;
    2030 -               info->frame_size = 0;
    2031 -       }
    2032 -
    2033 -       return 0;
    2034 +       if (info->frame_size && info->pc_offset >= 0) /* nested */
    2035 +               return 0;
    2036 +       if (info->pc_offset < 0) /* leaf */
    2037 +               return 1;
    2038 +       /* prologue seems boggus... */
    2039 +       return -1;
    2040  }
    2041  
    2042  static int __init frame_info_init(void)
    2043 @@ -368,7 +369,14 @@
    2044         schedule_frame = &mfinfo[0];
    2045  #endif
    2046         for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
    2047 -               get_frame_info(&mfinfo[i]);
    2048 +               get_frame_info(mfinfo + i);
    2049 +
    2050 +       /*
    2051 +        * Without schedule() frame info, result given by
    2052 +        * thread_saved_pc() and get_wchan() are not reliable.
    2053 +        */
    2054 +       if (schedule_frame->pc_offset < 0)
    2055 +               printk("Can't analyze schedule() prologue at %p\n", schedule);
    2056  
    2057         mfinfo_num = i;
    2058         return 0;
    2059 @@ -427,6 +435,8 @@
    2060                 if (i < 0)
    2061                         break;
    2062  
    2063 +               if (mfinfo[i].pc_offset < 0)
    2064 +                       break;
    2065                 pc = ((unsigned long *)frame)[mfinfo[i].pc_offset];
    2066                 if (!mfinfo[i].frame_size)
    2067                         break;
    2068 @@ -437,3 +447,49 @@
    2069         return pc;
    2070  }
    2071  
    2072 +#ifdef CONFIG_KALLSYMS
    2073 +/* used by show_backtrace() */
    2074 +unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
    2075 +                          unsigned long pc, unsigned long ra)
    2076 +{
    2077 +       unsigned long stack_page;
    2078 +       struct mips_frame_info info;
    2079 +       char *modname;
    2080 +       char namebuf[KSYM_NAME_LEN + 1];
    2081 +       unsigned long size, ofs;
    2082 +       int leaf;
    2083 +
    2084 +       stack_page = (unsigned long)task_stack_page(task);
    2085 +       if (!stack_page)
    2086 +               return 0;
    2087 +
    2088 +       if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
    2089 +               return 0;
    2090 +       if (ofs == 0)
    2091 +               return 0;
    2092 +
    2093 +       info.func = (void *)(pc - ofs);
    2094 +       info.func_size = ofs;   /* analyze from start to ofs */
    2095 +       leaf = get_frame_info(&info);
    2096 +       if (leaf < 0)
    2097 +               return 0;
    2098 +
    2099 +       if (*sp < stack_page ||
    2100 +           *sp + info.frame_size > stack_page + THREAD_SIZE - 32)
    2101 +               return 0;
    2102 +
    2103 +       if (leaf)
    2104 +               /*
    2105 +                * For some extreme cases, get_frame_info() can
    2106 +                * consider wrongly a nested function as a leaf
    2107 +                * one. In that cases avoid to return always the
    2108 +                * same value.
    2109 +                */
    2110 +               pc = pc != ra ? ra : 0;
    2111 +       else
    2112 +               pc = ((unsigned long *)(*sp))[info.pc_offset];
    2113 +
    2114 +       *sp += info.frame_size;
    2115 +       return __kernel_text_address(pc) ? pc : 0;
    2116 +}
    2117 +#endif
    2118 diff -Naur linux-2.6.18.3/arch/mips/kernel/ptrace.c linux-mips-2.6.18.3/arch/mips/kernel/ptrace.c
    2119 --- linux-2.6.18.3/arch/mips/kernel/ptrace.c    2006-11-18 19:28:22.000000000 -0800
    2120 +++ linux-mips-2.6.18.3/arch/mips/kernel/ptrace.c       2006-11-20 10:09:08.000000000 -0800
     870diff -Naur linux-2.6.19/arch/mips/kernel/ptrace.c linux-mips-2.6.19/arch/mips/kernel/ptrace.c
     871--- linux-2.6.19/arch/mips/kernel/ptrace.c      2006-11-29 13:57:37.000000000 -0800
     872+++ linux-mips-2.6.19/arch/mips/kernel/ptrace.c 2006-11-29 15:23:09.000000000 -0800
    2121873@@ -20,12 +20,12 @@
    2122874 #include <linux/mm.h>
     
    2134886 #include <asm/byteorder.h>
    2135887 #include <asm/cpu.h>
    2136 @@ -106,6 +106,7 @@
    2137  int ptrace_getfpregs (struct task_struct *child, __u32 __user *data)
    2138  {
    2139         int i;
    2140 +       unsigned int tmp;
    2141  
    2142         if (!access_ok(VERIFY_WRITE, data, 33 * 8))
    2143                 return -EIO;
    2144 @@ -121,10 +122,10 @@
    2145  
    2146         __put_user (child->thread.fpu.fcr31, data + 64);
    2147  
    2148 +       preempt_disable();
    2149         if (cpu_has_fpu) {
    2150 -               unsigned int flags, tmp;
    2151 +               unsigned int flags;
    2152  
    2153 -               preempt_disable();
    2154                 if (cpu_has_mipsmt) {
    2155                         unsigned int vpflags = dvpe();
    2156                         flags = read_c0_status();
    2157 @@ -138,11 +139,11 @@
    2158                         __asm__ __volatile__("cfc1\t%0,$0" : "=r" (tmp));
    2159                         write_c0_status(flags);
    2160                 }
    2161 -               preempt_enable();
    2162 -               __put_user (tmp, data + 65);
    2163         } else {
    2164 -               __put_user ((__u32) 0, data + 65);
    2165 +               tmp = 0;
    2166         }
    2167 +       preempt_enable();
    2168 +       __put_user (tmp, data + 65);
    2169  
    2170         return 0;
    2171  }
    2172 @@ -245,16 +246,17 @@
    2173                         unsigned int mtflags;
    2174  #endif /* CONFIG_MIPS_MT_SMTC */
    2175  
    2176 -                       if (!cpu_has_fpu)
    2177 +                       preempt_disable();
    2178 +                       if (!cpu_has_fpu) {
    2179 +                               preempt_enable();
    2180                                 break;
    2181 +                       }
    2182  
    2183  #ifdef CONFIG_MIPS_MT_SMTC
    2184                         /* Read-modify-write of Status must be atomic */
    2185                         local_irq_save(irqflags);
    2186                         mtflags = dmt();
    2187  #endif /* CONFIG_MIPS_MT_SMTC */
    2188 -
    2189 -                       preempt_disable();
    2190                         if (cpu_has_mipsmt) {
    2191                                 unsigned int vpflags = dvpe();
    2192                                 flags = read_c0_status();
    2193 @@ -471,12 +473,16 @@
     888@@ -473,12 +473,16 @@
    2194889  */
    2195890 asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
     
    2208903                goto out;
    2209904 
    2210 @@ -494,9 +500,14 @@
     905@@ -496,9 +500,14 @@
    2211906                send_sig(current->exit_code, current, 1);
    2212907                current->exit_code = 0;
     
    2227922+                                   regs->regs[6], regs->regs[7]);
    2228923 }
    2229 diff -Naur linux-2.6.18.3/arch/mips/kernel/ptrace32.c linux-mips-2.6.18.3/arch/mips/kernel/ptrace32.c
    2230 --- linux-2.6.18.3/arch/mips/kernel/ptrace32.c  2006-11-18 19:28:22.000000000 -0800
    2231 +++ linux-mips-2.6.18.3/arch/mips/kernel/ptrace32.c     2006-11-20 10:09:08.000000000 -0800
    2232 @@ -175,7 +175,9 @@
    2233                         unsigned int mtflags;
    2234  #endif /* CONFIG_MIPS_MT_SMTC */
    2235  
    2236 +                       preempt_disable();
    2237                         if (!cpu_has_fpu) {
    2238 +                               preempt_enable();
    2239                                 tmp = 0;
    2240                                 break;
    2241                         }
    2242 @@ -186,7 +188,6 @@
    2243                         mtflags = dmt();
    2244  #endif /* CONFIG_MIPS_MT_SMTC */
    2245  
    2246 -                       preempt_disable();
    2247                         if (cpu_has_mipsmt) {
    2248                                 unsigned int vpflags = dvpe();
    2249                                 flags = read_c0_status();
    2250 diff -Naur linux-2.6.18.3/arch/mips/kernel/r4k_switch.S linux-mips-2.6.18.3/arch/mips/kernel/r4k_switch.S
    2251 --- linux-2.6.18.3/arch/mips/kernel/r4k_switch.S        2006-11-18 19:28:22.000000000 -0800
    2252 +++ linux-mips-2.6.18.3/arch/mips/kernel/r4k_switch.S   2006-11-20 10:09:08.000000000 -0800
    2253 @@ -85,7 +85,12 @@
    2254         move    $28, a2
    2255         cpu_restore_nonscratch a1
    2256  
    2257 +#if (_THREAD_SIZE - 32) < 0x10000
    2258         PTR_ADDIU       t0, $28, _THREAD_SIZE - 32
    2259 +#else
    2260 +       PTR_LI          t0, _THREAD_SIZE - 32
    2261 +       PTR_ADDU        t0, $28
    2262 +#endif
    2263         set_saved_sp    t0, t1, t2
    2264  #ifdef CONFIG_MIPS_MT_SMTC
    2265         /* Read-modify-writes of Status must be atomic on a VPE */
    2266 diff -Naur linux-2.6.18.3/arch/mips/kernel/scall32-o32.S linux-mips-2.6.18.3/arch/mips/kernel/scall32-o32.S
    2267 --- linux-2.6.18.3/arch/mips/kernel/scall32-o32.S       2006-11-18 19:28:22.000000000 -0800
    2268 +++ linux-mips-2.6.18.3/arch/mips/kernel/scall32-o32.S  2006-11-20 10:09:08.000000000 -0800
    2269 @@ -662,6 +662,8 @@
    2270         sys     sys_tee                 4
    2271         sys     sys_vmsplice            4
    2272         sys     sys_move_pages          6
    2273 +       sys     sys_set_robust_list     2
    2274 +       sys     sys_get_robust_list     3
    2275         .endm
    2276  
    2277         /* We pre-compute the number of _instruction_ bytes needed to
    2278 diff -Naur linux-2.6.18.3/arch/mips/kernel/scall64-64.S linux-mips-2.6.18.3/arch/mips/kernel/scall64-64.S
    2279 --- linux-2.6.18.3/arch/mips/kernel/scall64-64.S        2006-11-18 19:28:22.000000000 -0800
    2280 +++ linux-mips-2.6.18.3/arch/mips/kernel/scall64-64.S   2006-11-20 10:09:08.000000000 -0800
    2281 @@ -466,3 +466,5 @@
    2282         PTR     sys_tee                         /* 5265 */
    2283         PTR     sys_vmsplice
    2284         PTR     sys_move_pages
    2285 +       PTR     sys_set_robust_list
    2286 +       PTR     sys_get_robust_list
    2287 diff -Naur linux-2.6.18.3/arch/mips/kernel/scall64-n32.S linux-mips-2.6.18.3/arch/mips/kernel/scall64-n32.S
    2288 --- linux-2.6.18.3/arch/mips/kernel/scall64-n32.S       2006-11-18 19:28:22.000000000 -0800
    2289 +++ linux-mips-2.6.18.3/arch/mips/kernel/scall64-n32.S  2006-11-20 10:09:08.000000000 -0800
     924diff -Naur linux-2.6.19/arch/mips/kernel/scall64-n32.S linux-mips-2.6.19/arch/mips/kernel/scall64-n32.S
     925--- linux-2.6.19/arch/mips/kernel/scall64-n32.S 2006-11-29 13:57:37.000000000 -0800
     926+++ linux-mips-2.6.19/arch/mips/kernel/scall64-n32.S    2006-11-29 15:23:09.000000000 -0800
    2290927@@ -149,8 +149,8 @@
    2291928        PTR     sys_mincore
     
    2316953        PTR     sys_flock
    2317954        PTR     sys_fsync
    2318 @@ -247,7 +247,7 @@
    2319         PTR     sys_capset
    2320         PTR     sys32_rt_sigpending             /* 6125 */
    2321         PTR     compat_sys_rt_sigtimedwait
    2322 -       PTR     sys_rt_sigqueueinfo
    2323 +       PTR     sys32_rt_sigqueueinfo
    2324         PTR     sysn32_rt_sigsuspend
    2325         PTR     sys32_sigaltstack
    2326         PTR     compat_sys_utime                /* 6130 */
    2327 @@ -280,7 +280,7 @@
    2328         PTR     sys_sync
    2329         PTR     sys_acct
    2330         PTR     sys32_settimeofday
    2331 -       PTR     sys_mount                       /* 6160 */
    2332 +       PTR     compat_sys_mount                /* 6160 */
    2333         PTR     sys_umount
    2334         PTR     sys_swapon
    2335         PTR     sys_swapoff
    2336955@@ -335,7 +335,7 @@
    2337956        PTR     compat_sys_fcntl64
     
    2343962        PTR     compat_sys_statfs64
    2344963        PTR     compat_sys_fstatfs64
    2345 @@ -390,5 +390,7 @@
    2346         PTR     sys_splice
    2347         PTR     sys_sync_file_range
    2348         PTR     sys_tee
    2349 -       PTR     sys_vmsplice                    /* 6271 */
    2350 +       PTR     sys_vmsplice                    /* 6270 */
    2351         PTR     sys_move_pages
    2352 +       PTR     compat_sys_set_robust_list
    2353 +       PTR     compat_sys_get_robust_list
    2354 diff -Naur linux-2.6.18.3/arch/mips/kernel/scall64-o32.S linux-mips-2.6.18.3/arch/mips/kernel/scall64-o32.S
    2355 --- linux-2.6.18.3/arch/mips/kernel/scall64-o32.S       2006-11-18 19:28:22.000000000 -0800
    2356 +++ linux-mips-2.6.18.3/arch/mips/kernel/scall64-o32.S  2006-11-20 10:09:08.000000000 -0800
    2357 @@ -226,7 +226,7 @@
    2358         PTR     sys_ni_syscall                  /* was sys_stat */
    2359         PTR     sys_lseek
    2360         PTR     sys_getpid                      /* 4020 */
    2361 -       PTR     sys_mount
    2362 +       PTR     compat_sys_mount
    2363         PTR     sys_oldumount
    2364         PTR     sys_setuid
    2365         PTR     sys_getuid
    2366 @@ -498,7 +498,7 @@
    2367         PTR     sys_mknodat                     /* 4290 */
    2368         PTR     sys_fchownat
    2369         PTR     compat_sys_futimesat
    2370 -       PTR     compat_sys_newfstatat
    2371 +       PTR     sys_newfstatat
    2372         PTR     sys_unlinkat
    2373         PTR     sys_renameat                    /* 4295 */
    2374         PTR     sys_linkat
    2375 @@ -514,4 +514,6 @@
    2376         PTR     sys_tee
    2377         PTR     sys_vmsplice
    2378         PTR     compat_sys_move_pages
    2379 +       PTR     compat_sys_set_robust_list
    2380 +       PTR     compat_sys_get_robust_list      /* 4310 */
    2381         .size   sys_call_table,.-sys_call_table
    2382 diff -Naur linux-2.6.18.3/arch/mips/kernel/signal.c linux-mips-2.6.18.3/arch/mips/kernel/signal.c
    2383 --- linux-2.6.18.3/arch/mips/kernel/signal.c    2006-11-18 19:28:22.000000000 -0800
    2384 +++ linux-mips-2.6.18.3/arch/mips/kernel/signal.c       2006-11-20 10:09:08.000000000 -0800
    2385 @@ -424,15 +424,11 @@
    2386         if (!user_mode(regs))
    2387                 return;
    2388  
    2389 -       if (try_to_freeze())
    2390 -               goto no_signal;
    2391 -
    2392         if (test_thread_flag(TIF_RESTORE_SIGMASK))
    2393                 oldset = &current->saved_sigmask;
    2394         else
    2395                 oldset = &current->blocked;
    2396  
    2397 -
    2398         signr = get_signal_to_deliver(&info, &ka, regs, NULL);
    2399         if (signr > 0) {
    2400                 /* Whee!  Actually deliver the signal.  */
    2401 @@ -446,9 +442,10 @@
    2402                         if (test_thread_flag(TIF_RESTORE_SIGMASK))
    2403                                 clear_thread_flag(TIF_RESTORE_SIGMASK);
    2404                 }
    2405 +
    2406 +               return;
    2407         }
    2408  
    2409 -no_signal:
    2410         /*
    2411          * Who's code doesn't conform to the restartable syscall convention
    2412          * dies here!!!  The li instruction, a single machine instruction,
    2413 @@ -466,6 +463,7 @@
    2414                         regs->regs[7] = regs->regs[26];
    2415                         regs->cp0_epc -= 4;
    2416                 }
    2417 +               regs->regs[0] = 0;      /* Don't deal with this again.  */
    2418         }
    2419  
    2420         /*
    2421 diff -Naur linux-2.6.18.3/arch/mips/kernel/signal32.c linux-mips-2.6.18.3/arch/mips/kernel/signal32.c
    2422 --- linux-2.6.18.3/arch/mips/kernel/signal32.c  2006-11-18 19:28:22.000000000 -0800
    2423 +++ linux-mips-2.6.18.3/arch/mips/kernel/signal32.c     2006-11-20 10:09:08.000000000 -0800
    2424 @@ -815,9 +815,6 @@
    2425         if (!user_mode(regs))
    2426                 return;
    2427  
    2428 -       if (try_to_freeze())
    2429 -               goto no_signal;
    2430 -
    2431         if (test_thread_flag(TIF_RESTORE_SIGMASK))
    2432                 oldset = &current->saved_sigmask;
    2433         else
    2434 @@ -836,9 +833,10 @@
    2435                         if (test_thread_flag(TIF_RESTORE_SIGMASK))
    2436                                 clear_thread_flag(TIF_RESTORE_SIGMASK);
    2437                 }
    2438 +
    2439 +               return;
    2440         }
    2441  
    2442 -no_signal:
    2443         /*
    2444          * Who's code doesn't conform to the restartable syscall convention
    2445          * dies here!!!  The li instruction, a single machine instruction,
    2446 @@ -856,6 +854,7 @@
    2447                         regs->regs[7] = regs->regs[26];
    2448                         regs->cp0_epc -= 4;
    2449                 }
    2450 +               regs->regs[0] = 0;      /* Don't deal with this again.  */
    2451         }
    2452  
    2453         /*
    2454 diff -Naur linux-2.6.18.3/arch/mips/kernel/smp-mt.c linux-mips-2.6.18.3/arch/mips/kernel/smp-mt.c
    2455 --- linux-2.6.18.3/arch/mips/kernel/smp-mt.c    2006-11-18 19:28:22.000000000 -0800
    2456 +++ linux-mips-2.6.18.3/arch/mips/kernel/smp-mt.c       2006-11-20 10:09:08.000000000 -0800
    2457 @@ -203,7 +203,7 @@
    2458                                 write_vpe_c0_config( read_c0_config());
    2459  
    2460                                 /* make sure there are no software interrupts pending */
    2461 -                               write_vpe_c0_cause(read_vpe_c0_cause() & ~(C_SW1|C_SW0));
    2462 +                               write_vpe_c0_cause(0);
    2463  
    2464                                 /* Propagate Config7 */
    2465                                 write_vpe_c0_config7(read_c0_config7());
    2466 diff -Naur linux-2.6.18.3/arch/mips/kernel/smp.c linux-mips-2.6.18.3/arch/mips/kernel/smp.c
    2467 --- linux-2.6.18.3/arch/mips/kernel/smp.c       2006-11-18 19:28:22.000000000 -0800
    2468 +++ linux-mips-2.6.18.3/arch/mips/kernel/smp.c  2006-11-20 10:09:08.000000000 -0800
    2469 @@ -467,14 +467,18 @@
    2470  
    2471  static int __init topology_init(void)
    2472  {
    2473 -       int cpu;
    2474 -       int ret;
    2475 +       int i, ret;
    2476  
    2477 -       for_each_present_cpu(cpu) {
    2478 -               ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu);
    2479 +#ifdef CONFIG_NUMA
    2480 +       for_each_online_node(i)
    2481 +               register_one_node(i);
    2482 +#endif /* CONFIG_NUMA */
    2483 +
    2484 +       for_each_present_cpu(i) {
    2485 +               ret = register_cpu(&per_cpu(cpu_devices, i), i);
    2486                 if (ret)
    2487                         printk(KERN_WARNING "topology_init: register_cpu %d "
    2488 -                              "failed (%d)\n", cpu, ret);
    2489 +                              "failed (%d)\n", i, ret);
    2490         }
    2491  
    2492         return 0;
    2493 diff -Naur linux-2.6.18.3/arch/mips/kernel/smtc-asm.S linux-mips-2.6.18.3/arch/mips/kernel/smtc-asm.S
    2494 --- linux-2.6.18.3/arch/mips/kernel/smtc-asm.S  2006-11-18 19:28:22.000000000 -0800
    2495 +++ linux-mips-2.6.18.3/arch/mips/kernel/smtc-asm.S     2006-11-20 10:09:08.000000000 -0800
    2496 @@ -8,7 +8,7 @@
    2497  #include <asm/regdef.h>
    2498  #include <asm/asmmacro.h>
    2499  #include <asm/stackframe.h>
    2500 -#include <asm/stackframe.h>
    2501 +#include <asm/irqflags.h>
    2502  
    2503  /*
    2504   * "Software Interrupt" linkage.
    2505 diff -Naur linux-2.6.18.3/arch/mips/kernel/syscall.c linux-mips-2.6.18.3/arch/mips/kernel/syscall.c
    2506 --- linux-2.6.18.3/arch/mips/kernel/syscall.c   2006-11-18 19:28:22.000000000 -0800
    2507 +++ linux-mips-2.6.18.3/arch/mips/kernel/syscall.c      2006-11-20 10:09:08.000000000 -0800
    2508 @@ -263,7 +263,7 @@
    2509         return error;
    2510  }
    2511  
    2512 -void sys_set_thread_area(unsigned long addr)
    2513 +asmlinkage int sys_set_thread_area(unsigned long addr)
    2514  {
    2515         struct thread_info *ti = task_thread_info(current);
    2516  
    2517 @@ -271,6 +271,8 @@
    2518  
    2519         /* If some future MIPS implementation has this register in hardware,
    2520          * we will need to update it here (and in context switches).  */
    2521 +
    2522 +       return 0;
    2523  }
    2524  
    2525  asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
    2526 diff -Naur linux-2.6.18.3/arch/mips/kernel/traps.c linux-mips-2.6.18.3/arch/mips/kernel/traps.c
    2527 --- linux-2.6.18.3/arch/mips/kernel/traps.c     2006-11-18 19:28:22.000000000 -0800
    2528 +++ linux-mips-2.6.18.3/arch/mips/kernel/traps.c        2006-11-20 10:09:08.000000000 -0800
    2529 @@ -20,6 +20,7 @@
    2530  #include <linux/spinlock.h>
    2531  #include <linux/kallsyms.h>
    2532  #include <linux/bootmem.h>
    2533 +#include <linux/interrupt.h>
    2534  
    2535  #include <asm/bootinfo.h>
    2536  #include <asm/branch.h>
    2537 @@ -64,7 +65,7 @@
    2538  extern asmlinkage void handle_reserved(void);
    2539  
    2540  extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
    2541 -       struct mips_fpu_struct *ctx);
    2542 +       struct mips_fpu_struct *ctx, int has_fpu);
    2543  
    2544  void (*board_be_init)(void);
    2545  int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
    2546 @@ -72,28 +73,68 @@
    2547  void (*board_ejtag_handler_setup)(void);
    2548  void (*board_bind_eic_interrupt)(int irq, int regset);
    2549  
    2550 -/*
    2551 - * These constant is for searching for possible module text segments.
    2552 - * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
    2553 - */
    2554 -#define MODULE_RANGE (8*1024*1024)
    2555 +
    2556 +static void show_raw_backtrace(unsigned long reg29)
    2557 +{
    2558 +       unsigned long *sp = (unsigned long *)reg29;
    2559 +       unsigned long addr;
    2560 +
    2561 +       printk("Call Trace:");
    2562 +#ifdef CONFIG_KALLSYMS
    2563 +       printk("\n");
    2564 +#endif
    2565 +       while (!kstack_end(sp)) {
    2566 +               addr = *sp++;
    2567 +               if (__kernel_text_address(addr))
    2568 +                       print_ip_sym(addr);
    2569 +       }
    2570 +       printk("\n");
    2571 +}
    2572 +
    2573 +#ifdef CONFIG_KALLSYMS
    2574 +static int raw_show_trace;
    2575 +static int __init set_raw_show_trace(char *str)
    2576 +{
    2577 +       raw_show_trace = 1;
    2578 +       return 1;
    2579 +}
    2580 +__setup("raw_show_trace", set_raw_show_trace);
    2581 +
    2582 +extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
    2583 +                                 unsigned long pc, unsigned long ra);
    2584 +
    2585 +static void show_backtrace(struct task_struct *task, struct pt_regs *regs)
    2586 +{
    2587 +       unsigned long sp = regs->regs[29];
    2588 +       unsigned long ra = regs->regs[31];
    2589 +       unsigned long pc = regs->cp0_epc;
    2590 +
    2591 +       if (raw_show_trace || !__kernel_text_address(pc)) {
    2592 +               show_raw_backtrace(sp);
    2593 +               return;
    2594 +       }
    2595 +       printk("Call Trace:\n");
    2596 +       do {
    2597 +               print_ip_sym(pc);
    2598 +               pc = unwind_stack(task, &sp, pc, ra);
    2599 +               ra = 0;
    2600 +       } while (pc);
    2601 +       printk("\n");
    2602 +}
    2603 +#else
    2604 +#define show_backtrace(task, r) show_raw_backtrace((r)->regs[29]);
    2605 +#endif
    2606  
    2607  /*
    2608   * This routine abuses get_user()/put_user() to reference pointers
    2609   * with at least a bit of error checking ...
    2610   */
    2611 -void show_stack(struct task_struct *task, unsigned long *sp)
    2612 +static void show_stacktrace(struct task_struct *task, struct pt_regs *regs)
    2613  {
    2614         const int field = 2 * sizeof(unsigned long);
    2615         long stackdata;
    2616         int i;
    2617 -
    2618 -       if (!sp) {
    2619 -               if (task && task != current)
    2620 -                       sp = (unsigned long *) task->thread.reg29;
    2621 -               else
    2622 -                       sp = (unsigned long *) &sp;
    2623 -       }
    2624 +       unsigned long *sp = (unsigned long *)regs->regs[29];
    2625  
    2626         printk("Stack :");
    2627         i = 0;
    2628 @@ -114,32 +155,48 @@
    2629                 i++;
    2630         }
    2631         printk("\n");
    2632 +       show_backtrace(task, regs);
    2633  }
    2634  
    2635 -void show_trace(struct task_struct *task, unsigned long *stack)
    2636 +static __always_inline void prepare_frametrace(struct pt_regs *regs)
    2637  {
    2638 -       const int field = 2 * sizeof(unsigned long);
    2639 -       unsigned long addr;
    2640 -
    2641 -       if (!stack) {
    2642 -               if (task && task != current)
    2643 -                       stack = (unsigned long *) task->thread.reg29;
    2644 -               else
    2645 -                       stack = (unsigned long *) &stack;
    2646 -       }
    2647 -
    2648 -       printk("Call Trace:");
    2649 -#ifdef CONFIG_KALLSYMS
    2650 -       printk("\n");
    2651 +       __asm__ __volatile__(
    2652 +               ".set push\n\t"
    2653 +               ".set noat\n\t"
    2654 +#ifdef CONFIG_64BIT
    2655 +               "1: dla $1, 1b\n\t"
    2656 +               "sd $1, %0\n\t"
    2657 +               "sd $29, %1\n\t"
    2658 +               "sd $31, %2\n\t"
    2659 +#else
    2660 +               "1: la $1, 1b\n\t"
    2661 +               "sw $1, %0\n\t"
    2662 +               "sw $29, %1\n\t"
    2663 +               "sw $31, %2\n\t"
    2664  #endif
    2665 -       while (!kstack_end(stack)) {
    2666 -               addr = *stack++;
    2667 -               if (__kernel_text_address(addr)) {
    2668 -                       printk(" [<%0*lx>] ", field, addr);
    2669 -                       print_symbol("%s\n", addr);
    2670 +               ".set pop\n\t"
    2671 +               : "=m" (regs->cp0_epc),
    2672 +               "=m" (regs->regs[29]), "=m" (regs->regs[31])
    2673 +               : : "memory");
    2674 +}
    2675 +
    2676 +void show_stack(struct task_struct *task, unsigned long *sp)
    2677 +{
    2678 +       struct pt_regs regs;
    2679 +       if (sp) {
    2680 +               regs.regs[29] = (unsigned long)sp;
    2681 +               regs.regs[31] = 0;
    2682 +               regs.cp0_epc = 0;
    2683 +       } else {
    2684 +               if (task && task != current) {
    2685 +                       regs.regs[29] = task->thread.reg29;
    2686 +                       regs.regs[31] = 0;
    2687 +                       regs.cp0_epc = task->thread.reg31;
    2688 +               } else {
    2689 +                       prepare_frametrace(&regs);
    2690                 }
    2691         }
    2692 -       printk("\n");
    2693 +       show_stacktrace(task, &regs);
    2694  }
    2695  
    2696  /*
    2697 @@ -147,9 +204,15 @@
    2698   */
    2699  void dump_stack(void)
    2700  {
    2701 -       unsigned long stack;
    2702 +       struct pt_regs regs;
    2703  
    2704 -       show_trace(current, &stack);
    2705 +       /*
    2706 +        * Remove any garbage that may be in regs (specially func
    2707 +        * addresses) to avoid show_raw_backtrace() to report them
    2708 +        */
    2709 +       memset(&regs, 0, sizeof(regs));
    2710 +       prepare_frametrace(&regs);
    2711 +       show_backtrace(current, &regs);
    2712  }
    2713  
    2714  EXPORT_SYMBOL(dump_stack);
    2715 @@ -268,8 +331,7 @@
    2716         print_modules();
    2717         printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
    2718                 current->comm, current->pid, current_thread_info(), current);
    2719 -       show_stack(current, (long *) regs->regs[29]);
    2720 -       show_trace(current, (long *) regs->regs[29]);
    2721 +       show_stacktrace(current, regs);
    2722         show_code((unsigned int *) regs->cp0_epc);
    2723         printk("\n");
    2724  }
    2725 @@ -292,6 +354,16 @@
    2726         printk("%s[#%d]:\n", str, ++die_counter);
    2727         show_registers(regs);
    2728         spin_unlock_irq(&die_lock);
    2729 +
    2730 +       if (in_interrupt())
    2731 +               panic("Fatal exception in interrupt");
    2732 +
    2733 +       if (panic_on_oops) {
    2734 +               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
    2735 +               ssleep(5);
    2736 +               panic("Fatal exception");
    2737 +       }
    2738 +
    2739         do_exit(SIGSEGV);
    2740  }
    2741  
    2742 @@ -601,7 +673,7 @@
    2743                 preempt_enable();
    2744  
    2745                 /* Run the emulator */
    2746 -               sig = fpu_emulator_cop1Handler (regs, &current->thread.fpu);
    2747 +               sig = fpu_emulator_cop1Handler (regs, &current->thread.fpu, 1);
    2748  
    2749                 preempt_disable();
    2750  
    2751 @@ -751,11 +823,13 @@
    2752                         set_used_math();
    2753                 }
    2754  
    2755 -               preempt_enable();
    2756 -
    2757 -               if (!cpu_has_fpu) {
    2758 -                       int sig = fpu_emulator_cop1Handler(regs,
    2759 -                                               &current->thread.fpu);
    2760 +               if (cpu_has_fpu) {
    2761 +                       preempt_enable();
    2762 +               } else {
    2763 +                       int sig;
    2764 +                       preempt_enable();
    2765 +                       sig = fpu_emulator_cop1Handler(regs,
    2766 +                                               &current->thread.fpu, 0);
    2767                         if (sig)
    2768                                 force_sig(sig, current);
    2769  #ifdef CONFIG_MIPS_MT_FPAFF
    2770 diff -Naur linux-2.6.18.3/arch/mips/kernel/vmlinux.lds.S linux-mips-2.6.18.3/arch/mips/kernel/vmlinux.lds.S
    2771 --- linux-2.6.18.3/arch/mips/kernel/vmlinux.lds.S       2006-11-18 19:28:22.000000000 -0800
    2772 +++ linux-mips-2.6.18.3/arch/mips/kernel/vmlinux.lds.S  2006-11-20 10:09:08.000000000 -0800
    2773 @@ -50,6 +50,16 @@
    2774    /* writeable */
    2775    .data : {                    /* Data */
    2776      . = . + DATAOFFSET;                /* for CONFIG_MAPPED_KERNEL */
    2777 +    /*
    2778 +     * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
    2779 +     * limits the maximum alignment to at most 32kB and results in the following
    2780 +     * warning:
    2781 +     *
    2782 +     *  CC      arch/mips/kernel/init_task.o
    2783 +     * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
    2784 +     * is greater than maximum object file alignment.  Using 32768
    2785 +     */
    2786 +    . = ALIGN(_PAGE_SIZE);
    2787      *(.data.init_task)
    2788  
    2789      *(.data)
    2790 diff -Naur linux-2.6.18.3/arch/mips/kernel/vpe.c linux-mips-2.6.18.3/arch/mips/kernel/vpe.c
    2791 --- linux-2.6.18.3/arch/mips/kernel/vpe.c       2006-11-18 19:28:22.000000000 -0800
    2792 +++ linux-mips-2.6.18.3/arch/mips/kernel/vpe.c  2006-11-20 10:09:08.000000000 -0800
    2793 @@ -768,10 +768,16 @@
    2794          */
    2795         write_tc_c0_tcbind((read_tc_c0_tcbind() & ~TCBIND_CURVPE) | v->minor);
    2796  
    2797 +       write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() & ~(VPECONF0_VPA));
    2798 +
    2799 +       back_to_back_c0_hazard();
    2800 +
    2801          /* Set up the XTC bit in vpeconf0 to point at our tc */
    2802          write_vpe_c0_vpeconf0( (read_vpe_c0_vpeconf0() & ~(VPECONF0_XTC))
    2803                                 | (t->index << VPECONF0_XTC_SHIFT));
    2804  
    2805 +       back_to_back_c0_hazard();
    2806 +
    2807          /* enable this VPE */
    2808          write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_VPA);
    2809  
    2810 diff -Naur linux-2.6.18.3/arch/mips/lib/Makefile linux-mips-2.6.18.3/arch/mips/lib/Makefile
    2811 --- linux-2.6.18.3/arch/mips/lib/Makefile       2006-11-18 19:28:22.000000000 -0800
    2812 +++ linux-mips-2.6.18.3/arch/mips/lib/Makefile  2006-11-20 10:09:08.000000000 -0800
     964diff -Naur linux-2.6.19/arch/mips/lib/Makefile linux-mips-2.6.19/arch/mips/lib/Makefile
     965--- linux-2.6.19/arch/mips/lib/Makefile 2006-11-29 13:57:37.000000000 -0800
     966+++ linux-mips-2.6.19/arch/mips/lib/Makefile    2006-11-29 15:23:09.000000000 -0800
    2813967@@ -5,8 +5,6 @@
    2814968 lib-y  += csum_partial_copy.o memcpy.o promlib.o strlen_user.o strncpy_user.o \
     
    2820974 lib-y += ashldi3.o ashrdi3.o lshrdi3.o
    2821975 
    2822 diff -Naur linux-2.6.18.3/arch/mips/lib/iomap.c linux-mips-2.6.18.3/arch/mips/lib/iomap.c
    2823 --- linux-2.6.18.3/arch/mips/lib/iomap.c        2006-11-18 19:28:22.000000000 -0800
    2824 +++ linux-mips-2.6.18.3/arch/mips/lib/iomap.c   1969-12-31 16:00:00.000000000 -0800
     976diff -Naur linux-2.6.19/arch/mips/lib/iomap.c linux-mips-2.6.19/arch/mips/lib/iomap.c
     977--- linux-2.6.19/arch/mips/lib/iomap.c  2006-11-29 13:57:37.000000000 -0800
     978+++ linux-mips-2.6.19/arch/mips/lib/iomap.c     1969-12-31 16:00:00.000000000 -0800
    2825979@@ -1,78 +0,0 @@
    2826980-/*
     
    29021056-EXPORT_SYMBOL(pci_iomap);
    29031057-EXPORT_SYMBOL(pci_iounmap);
    2904 diff -Naur linux-2.6.18.3/arch/mips/lib-32/dump_tlb.c linux-mips-2.6.18.3/arch/mips/lib-32/dump_tlb.c
    2905 --- linux-2.6.18.3/arch/mips/lib-32/dump_tlb.c  2006-11-18 19:28:22.000000000 -0800
    2906 +++ linux-mips-2.6.18.3/arch/mips/lib-32/dump_tlb.c     2006-11-20 10:09:08.000000000 -0800
     1058diff -Naur linux-2.6.19/arch/mips/lib-32/dump_tlb.c linux-mips-2.6.19/arch/mips/lib-32/dump_tlb.c
     1059--- linux-2.6.19/arch/mips/lib-32/dump_tlb.c    2006-11-29 13:57:37.000000000 -0800
     1060+++ linux-mips-2.6.19/arch/mips/lib-32/dump_tlb.c       2006-11-29 15:23:09.000000000 -0800
    29071061@@ -40,8 +40,6 @@
    29081062                return "256Mb";
     
    29141068 
    29151069 #define BARRIER()                                      \
    2916 diff -Naur linux-2.6.18.3/arch/mips/lib-64/dump_tlb.c linux-mips-2.6.18.3/arch/mips/lib-64/dump_tlb.c
    2917 --- linux-2.6.18.3/arch/mips/lib-64/dump_tlb.c  2006-11-18 19:28:22.000000000 -0800
    2918 +++ linux-mips-2.6.18.3/arch/mips/lib-64/dump_tlb.c     2006-11-20 10:09:08.000000000 -0800
     1070diff -Naur linux-2.6.19/arch/mips/lib-64/dump_tlb.c linux-mips-2.6.19/arch/mips/lib-64/dump_tlb.c
     1071--- linux-2.6.19/arch/mips/lib-64/dump_tlb.c    2006-11-29 13:57:37.000000000 -0800
     1072+++ linux-mips-2.6.19/arch/mips/lib-64/dump_tlb.c       2006-11-29 15:23:09.000000000 -0800
    29191073@@ -31,8 +31,6 @@
    29201074        case PM_256M:   return "256Mb";
     
    29261080 
    29271081 #define BARRIER()                                      \
    2928 @@ -149,7 +147,7 @@
    2929         printk("Addr                 == %08lx\n", addr);
    2930         printk("tasks->mm.pgd        == %08lx\n", (unsigned long) t->mm->pgd);
    2931  
    2932 -       page_dir = pgd_offset(t->mm, 0);
    2933 +       page_dir = pgd_offset(t->mm, 0UL);
    2934         printk("page_dir == %016lx\n", (unsigned long) page_dir);
    2935  
    2936         pgd = pgd_offset(t->mm, addr);
    2937 @@ -184,13 +182,13 @@
    2938         dump_list_process(current, address);
     1082diff -Naur linux-2.6.19/arch/mips/mm/init.c linux-mips-2.6.19/arch/mips/mm/init.c
     1083--- linux-2.6.19/arch/mips/mm/init.c    2006-11-29 13:57:37.000000000 -0800
     1084+++ linux-mips-2.6.19/arch/mips/mm/init.c       2006-11-29 15:23:09.000000000 -0800
     1085@@ -203,6 +203,31 @@
     1086        preempt_check_resched();
    29391087 }
    29401088 
    2941 -unsigned int vtop(void *address)
    2942 +unsigned long vtop(void *address)
    2943  {
    2944         pgd_t   *pgd;
    2945         pud_t   *pud;
    2946         pmd_t   *pmd;
    2947         pte_t   *pte;
    2948 -       unsigned int addr, paddr;
    2949 +       unsigned long addr, paddr;
    2950  
    2951         addr = (unsigned long) address;
    2952         pgd = pgd_offset(current->mm, addr);
    2953 diff -Naur linux-2.6.18.3/arch/mips/math-emu/cp1emu.c linux-mips-2.6.18.3/arch/mips/math-emu/cp1emu.c
    2954 --- linux-2.6.18.3/arch/mips/math-emu/cp1emu.c  2006-11-18 19:28:22.000000000 -0800
    2955 +++ linux-mips-2.6.18.3/arch/mips/math-emu/cp1emu.c     2006-11-20 10:09:08.000000000 -0800
    2956 @@ -38,8 +38,6 @@
    2957  
    2958  #include <asm/inst.h>
    2959  #include <asm/bootinfo.h>
    2960 -#include <asm/cpu.h>
    2961 -#include <asm/cpu-features.h>
    2962  #include <asm/processor.h>
    2963  #include <asm/ptrace.h>
    2964  #include <asm/signal.h>
    2965 @@ -1233,7 +1231,8 @@
    2966         return 0;
    2967  }
    2968  
    2969 -int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
    2970 +int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
    2971 +       int has_fpu)
    2972  {
    2973         unsigned long oldepc, prevepc;
    2974         mips_instruction insn;
    2975 @@ -1263,7 +1262,7 @@
    2976                         ieee754_csr.rm = mips_rm[ieee754_csr.rm];
    2977                 }
    2978  
    2979 -               if (cpu_has_fpu)
    2980 +               if (has_fpu)
    2981                         break;
    2982                 if (sig)
    2983                         break;
    2984 diff -Naur linux-2.6.18.3/arch/mips/mips-boards/atlas/atlas_int.c linux-mips-2.6.18.3/arch/mips/mips-boards/atlas/atlas_int.c
    2985 --- linux-2.6.18.3/arch/mips/mips-boards/atlas/atlas_int.c      2006-11-18 19:28:22.000000000 -0800
    2986 +++ linux-mips-2.6.18.3/arch/mips/mips-boards/atlas/atlas_int.c 2006-11-20 10:09:08.000000000 -0800
    2987 @@ -1,6 +1,8 @@
    2988  /*
    2989 - * Carsten Langgaard, carstenl@mips.com
    2990 - * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
    2991 + * Copyright (C) 1999, 2000, 2006  MIPS Technologies, Inc.
    2992 + *     All rights reserved.
    2993 + *     Authors: Carsten Langgaard <carstenl@mips.com>
    2994 + *              Maciej W. Rozycki <macro@mips.com>
    2995   *
    2996   * ########################################################################
    2997   *
    2998 @@ -25,17 +27,20 @@
    2999   */
    3000  #include <linux/compiler.h>
    3001  #include <linux/init.h>
    3002 +#include <linux/irq.h>
    3003  #include <linux/sched.h>
    3004  #include <linux/slab.h>
    3005  #include <linux/interrupt.h>
    3006  #include <linux/kernel_stat.h>
    3007  
    3008 -#include <asm/irq.h>
    3009 +#include <asm/gdb-stub.h>
    3010  #include <asm/io.h>
    3011 +#include <asm/irq_cpu.h>
    3012 +#include <asm/msc01_ic.h>
    3013 +
    3014  #include <asm/mips-boards/atlas.h>
    3015  #include <asm/mips-boards/atlasint.h>
    3016 -#include <asm/gdb-stub.h>
    3017 -
    3018 +#include <asm/mips-boards/generic.h>
    3019  
    3020  static struct atlas_ictrl_regs *atlas_hw0_icregs;
    3021  
    3022 @@ -47,13 +52,13 @@
    3023  
    3024  void disable_atlas_irq(unsigned int irq_nr)
    3025  {
    3026 -       atlas_hw0_icregs->intrsten = (1 << (irq_nr-ATLASINT_BASE));
    3027 +       atlas_hw0_icregs->intrsten = 1 << (irq_nr - ATLAS_INT_BASE);
    3028         iob();
    3029  }
    3030  
    3031  void enable_atlas_irq(unsigned int irq_nr)
    3032  {
    3033 -       atlas_hw0_icregs->intseten = (1 << (irq_nr-ATLASINT_BASE));
    3034 +       atlas_hw0_icregs->intseten = 1 << (irq_nr - ATLAS_INT_BASE);
    3035         iob();
    3036  }
    3037  
    3038 @@ -107,7 +112,7 @@
    3039         if (unlikely(int_status == 0))
    3040                 return;
    3041  
    3042 -       irq = ATLASINT_BASE + ls1bit32(int_status);
    3043 +       irq = ATLAS_INT_BASE + ls1bit32(int_status);
    3044  
    3045         DEBUG_INT("atlas_hw0_irqdispatch: irq=%d\n", irq);
    3046  
    3047 @@ -161,15 +166,14 @@
    3048  }
    3049  
    3050  /*
    3051 - * IRQs on the Atlas board look basically (barring software IRQs which we
    3052 - * don't use at all and all external interrupt sources are combined together
    3053 - * on hardware interrupt 0 (MIPS IRQ 2)) like:
    3054 + * IRQs on the Atlas board look basically like (all external interrupt
    3055 + * sources are combined together on hardware interrupt 0 (MIPS IRQ 2)):
    3056   *
    3057 - *     MIPS IRQ        Source
    3058 + *      MIPS IRQ        Source
    3059   *      --------        ------
    3060 - *             0       Software (ignored)
    3061 - *             1        Software (ignored)
    3062 - *             2        Combined hardware interrupt (hw0)
    3063 + *             0        Software 0 (reschedule IPI on MT)
    3064 + *             1        Software 1 (remote call IPI on MT)
    3065 + *             2        Combined Atlas hardware interrupt (hw0)
    3066   *             3        Hardware (ignored)
    3067   *             4        Hardware (ignored)
    3068   *             5        Hardware (ignored)
    3069 @@ -179,7 +183,7 @@
    3070   * We handle the IRQ according to _our_ priority which is:
    3071   *
    3072   * Highest ----     R4k Timer
    3073 - * Lowest  ----     Combined hardware interrupt
    3074 + * Lowest  ----     Software 0
    3075   *
    3076   * then we just return, if multiple IRQs are pending then we will just take
    3077   * another exception, big deal.
    3078 @@ -193,17 +197,19 @@
    3079  
    3080         if (irq == MIPSCPU_INT_ATLAS)
    3081                 atlas_hw0_irqdispatch(regs);
    3082 -       else if (irq > 0)
    3083 +       else if (irq >= 0)
    3084                 do_IRQ(MIPSCPU_INT_BASE + irq, regs);
    3085         else
    3086                 spurious_interrupt(regs);
    3087  }
    3088  
    3089 -void __init arch_init_irq(void)
    3090 +static inline void init_atlas_irqs (int base)
    3091  {
    3092         int i;
    3093  
    3094 -       atlas_hw0_icregs = (struct atlas_ictrl_regs *)ioremap (ATLAS_ICTRL_REGS_BASE, sizeof(struct atlas_ictrl_regs *));
    3095 +       atlas_hw0_icregs = (struct atlas_ictrl_regs *)
    3096 +                          ioremap(ATLAS_ICTRL_REGS_BASE,
    3097 +                                  sizeof(struct atlas_ictrl_regs *));
    3098  
    3099         /*
    3100          * Mask out all interrupt by writing "1" to all bit position in
    3101 @@ -211,7 +217,7 @@
    3102          */
    3103         atlas_hw0_icregs->intrsten = 0xffffffff;
    3104  
    3105 -       for (i = ATLASINT_BASE; i <= ATLASINT_END; i++) {
    3106 +       for (i = ATLAS_INT_BASE; i <= ATLAS_INT_END; i++) {
    3107                 irq_desc[i].status      = IRQ_DISABLED;
    3108                 irq_desc[i].action      = 0;
    3109                 irq_desc[i].depth       = 1;
    3110 @@ -219,3 +225,62 @@
    3111                 spin_lock_init(&irq_desc[i].lock);
    3112         }
    3113  }
    3114 +
    3115 +static struct irqaction atlasirq = {
    3116 +       .handler = no_action,
    3117 +       .name = "Atlas cascade"
    3118 +};
    3119 +
    3120 +msc_irqmap_t __initdata msc_irqmap[] = {
    3121 +       {MSC01C_INT_TMR,                MSC01_IRQ_EDGE, 0},
    3122 +       {MSC01C_INT_PCI,                MSC01_IRQ_LEVEL, 0},
    3123 +};
    3124 +int __initdata msc_nr_irqs = sizeof(msc_irqmap) / sizeof(*msc_irqmap);
    3125 +
    3126 +msc_irqmap_t __initdata msc_eicirqmap[] = {
    3127 +       {MSC01E_INT_SW0,                MSC01_IRQ_LEVEL, 0},
    3128 +       {MSC01E_INT_SW1,                MSC01_IRQ_LEVEL, 0},
    3129 +       {MSC01E_INT_ATLAS,              MSC01_IRQ_LEVEL, 0},
    3130 +       {MSC01E_INT_TMR,                MSC01_IRQ_EDGE, 0},
    3131 +       {MSC01E_INT_PCI,                MSC01_IRQ_LEVEL, 0},
    3132 +       {MSC01E_INT_PERFCTR,            MSC01_IRQ_LEVEL, 0},
    3133 +       {MSC01E_INT_CPUCTR,             MSC01_IRQ_LEVEL, 0}
    3134 +};
    3135 +int __initdata msc_nr_eicirqs = sizeof(msc_eicirqmap) / sizeof(*msc_eicirqmap);
    3136 +
    3137 +void __init arch_init_irq(void)
    3138 +{
    3139 +       init_atlas_irqs(ATLAS_INT_BASE);
    3140 +
    3141 +       if (!cpu_has_veic)
    3142 +               mips_cpu_irq_init(MIPSCPU_INT_BASE);
    3143 +
    3144 +       switch(mips_revision_corid) {
    3145 +       case MIPS_REVISION_CORID_CORE_MSC:
    3146 +       case MIPS_REVISION_CORID_CORE_FPGA2:
    3147 +       case MIPS_REVISION_CORID_CORE_FPGA3:
    3148 +       case MIPS_REVISION_CORID_CORE_24K:
    3149 +       case MIPS_REVISION_CORID_CORE_EMUL_MSC:
    3150 +               if (cpu_has_veic)
    3151 +                       init_msc_irqs (MSC01E_INT_BASE,
    3152 +                                      msc_eicirqmap, msc_nr_eicirqs);
    3153 +               else
    3154 +                       init_msc_irqs (MSC01C_INT_BASE,
    3155 +                                      msc_irqmap, msc_nr_irqs);
    3156 +       }
    3157 +
    3158 +
    3159 +       if (cpu_has_veic) {
    3160 +               set_vi_handler (MSC01E_INT_ATLAS, atlas_hw0_irqdispatch);
    3161 +               setup_irq (MSC01E_INT_BASE + MSC01E_INT_ATLAS, &atlasirq);
    3162 +       } else if (cpu_has_vint) {
    3163 +               set_vi_handler (MIPSCPU_INT_ATLAS, atlas_hw0_irqdispatch);
    3164 +#ifdef CONFIG_MIPS_MT_SMTC
    3165 +               setup_irq_smtc (MIPSCPU_INT_BASE + MIPSCPU_INT_ATLAS,
    3166 +                               &atlasirq, (0x100 << MIPSCPU_INT_ATLAS));
    3167 +#else /* Not SMTC */
    3168 +               setup_irq(MIPSCPU_INT_BASE + MIPSCPU_INT_ATLAS, &atlasirq);
    3169 +#endif /* CONFIG_MIPS_MT_SMTC */
    3170 +       } else
    3171 +               setup_irq(MIPSCPU_INT_BASE + MIPSCPU_INT_ATLAS, &atlasirq);
    3172 +}
    3173 diff -Naur linux-2.6.18.3/arch/mips/mips-boards/atlas/atlas_setup.c linux-mips-2.6.18.3/arch/mips/mips-boards/atlas/atlas_setup.c
    3174 --- linux-2.6.18.3/arch/mips/mips-boards/atlas/atlas_setup.c    2006-11-18 19:28:22.000000000 -0800
    3175 +++ linux-mips-2.6.18.3/arch/mips/mips-boards/atlas/atlas_setup.c       2006-11-20 10:09:08.000000000 -0800
    3176 @@ -77,7 +77,7 @@
    3177  #else
    3178         s.iobase = ATLAS_UART_REGS_BASE+3;
    3179  #endif
    3180 -       s.irq = ATLASINT_UART;
    3181 +       s.irq = ATLAS_INT_UART;
    3182         s.uartclk = ATLAS_BASE_BAUD * 16;
    3183         s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ;
    3184         s.iotype = UPIO_PORT;
    3185 diff -Naur linux-2.6.18.3/arch/mips/mips-boards/generic/memory.c linux-mips-2.6.18.3/arch/mips/mips-boards/generic/memory.c
    3186 --- linux-2.6.18.3/arch/mips/mips-boards/generic/memory.c       2006-11-18 19:28:22.000000000 -0800
    3187 +++ linux-mips-2.6.18.3/arch/mips/mips-boards/generic/memory.c  2006-11-20 10:09:08.000000000 -0800
    3188 @@ -176,7 +176,7 @@
    3189                 if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
    3190                         continue;
    3191  
    3192 -               addr = boot_mem_map.map[i].addr;
    3193 +               addr = PAGE_ALIGN(boot_mem_map.map[i].addr);
    3194                 while (addr < boot_mem_map.map[i].addr
    3195                               + boot_mem_map.map[i].size) {
    3196                         ClearPageReserved(virt_to_page(__va(addr)));
    3197 diff -Naur linux-2.6.18.3/arch/mips/mips-boards/generic/time.c linux-mips-2.6.18.3/arch/mips/mips-boards/generic/time.c
    3198 --- linux-2.6.18.3/arch/mips/mips-boards/generic/time.c 2006-11-18 19:28:22.000000000 -0800
    3199 +++ linux-mips-2.6.18.3/arch/mips/mips-boards/generic/time.c    2006-11-20 10:09:08.000000000 -0800
    3200 @@ -41,8 +41,13 @@
    3201  
    3202  #include <asm/mips-boards/generic.h>
    3203  #include <asm/mips-boards/prom.h>
    3204 +
    3205 +#ifdef CONFIG_MIPS_ATLAS
    3206 +#include <asm/mips-boards/atlasint.h>
    3207 +#endif
    3208 +#ifdef CONFIG_MIPS_MALTA
    3209  #include <asm/mips-boards/maltaint.h>
    3210 -#include <asm/mc146818-time.h>
    3211 +#endif
    3212  
    3213  unsigned long cpu_khz;
    3214  
    3215 @@ -92,10 +97,9 @@
    3216  irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
    3217  {
    3218         int cpu = smp_processor_id();
    3219 -       int r2 = cpu_has_mips_r2;
    3220  
    3221  #ifdef CONFIG_MIPS_MT_SMTC
    3222 -        /*
    3223 +       /*
    3224          *  In an SMTC system, one Count/Compare set exists per VPE.
    3225          *  Which TC within a VPE gets the interrupt is essentially
    3226          *  random - we only know that it shouldn't be one with
    3227 @@ -108,29 +112,46 @@
    3228          *  the general MIPS timer_interrupt routine.
    3229          */
    3230  
    3231 +       int vpflags;
    3232 +
    3233         /*
    3234 -        * DVPE is necessary so long as cross-VPE interrupts
    3235 -        * are done via read-modify-write of Cause register.
    3236 +        * We could be here due to timer interrupt,
    3237 +        * perf counter overflow, or both.
    3238          */
    3239 -       int vpflags = dvpe();
    3240 -       write_c0_compare (read_c0_count() - 1);
    3241 -       clear_c0_cause(CPUCTR_IMASKBIT);
    3242 -       evpe(vpflags);
    3243 -
    3244 -       if (cpu_data[cpu].vpe_id == 0) {
    3245 -               timer_interrupt(irq, dev_id, regs);
    3246 -               scroll_display_message();
    3247 -       } else
    3248 -               write_c0_compare (read_c0_count() + ( mips_hpt_frequency/HZ));
    3249 -       smtc_timer_broadcast(cpu_data[cpu].vpe_id);
    3250 +       if (read_c0_cause() & (1 << 26))
    3251 +               perf_irq(regs);
    3252  
    3253 -       if (cpu != 0)
    3254 +       if (read_c0_cause() & (1 << 30)) {
    3255 +               /* If timer interrupt, make it de-assert */
    3256 +               write_c0_compare (read_c0_count() - 1);
    3257                 /*
    3258 -                * Other CPUs should do profiling and process accounting
    3259 +                * DVPE is necessary so long as cross-VPE interrupts
    3260 +                * are done via read-modify-write of Cause register.
    3261                  */
    3262 -               local_timer_interrupt(irq, dev_id, regs);
    3263 -
    3264 +               vpflags = dvpe();
    3265 +               clear_c0_cause(CPUCTR_IMASKBIT);
    3266 +               evpe(vpflags);
    3267 +               /*
    3268 +                * There are things we only want to do once per tick
    3269 +                * in an "MP" system.   One TC of each VPE will take
    3270 +                * the actual timer interrupt.  The others will get
    3271 +                * timer broadcast IPIs. We use whoever it is that takes
    3272 +                * the tick on VPE 0 to run the full timer_interrupt().
    3273 +                */
    3274 +               if (cpu_data[cpu].vpe_id == 0) {
    3275 +                               timer_interrupt(irq, NULL, regs);
    3276 +                               smtc_timer_broadcast(cpu_data[cpu].vpe_id);
    3277 +                               scroll_display_message();
    3278 +               } else {
    3279 +                       write_c0_compare(read_c0_count() +
    3280 +                                        (mips_hpt_frequency/HZ));
    3281 +                       local_timer_interrupt(irq, dev_id, regs);
    3282 +                       smtc_timer_broadcast(cpu_data[cpu].vpe_id);
    3283 +               }
    3284 +       }
    3285  #else /* CONFIG_MIPS_MT_SMTC */
    3286 +       int r2 = cpu_has_mips_r2;
    3287 +
    3288         if (cpu == 0) {
    3289                 /*
    3290                  * CPU 0 handles the global timer interrupt job and process
    3291 @@ -161,14 +182,13 @@
    3292                  */
    3293                 local_timer_interrupt(irq, dev_id, regs);
    3294         }
    3295 -#endif /* CONFIG_MIPS_MT_SMTC */
    3296 -
    3297  out:
    3298 +#endif /* CONFIG_MIPS_MT_SMTC */
    3299         return IRQ_HANDLED;
    3300  }
    3301  
    3302  /*
    3303 - * Estimate CPU frequency.  Sets mips_counter_frequency as a side-effect
    3304 + * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
    3305   */
    3306  static unsigned int __init estimate_cpu_frequency(void)
    3307  {
    3308 diff -Naur linux-2.6.18.3/arch/mips/mips-boards/malta/malta_int.c linux-mips-2.6.18.3/arch/mips/mips-boards/malta/malta_int.c
    3309 --- linux-2.6.18.3/arch/mips/mips-boards/malta/malta_int.c      2006-11-18 19:28:22.000000000 -0800
    3310 +++ linux-mips-2.6.18.3/arch/mips/mips-boards/malta/malta_int.c 2006-11-20 10:09:08.000000000 -0800
    3311 @@ -208,23 +208,23 @@
    3312         unsigned int a0 = 7;
    3313         unsigned int t0;
    3314  
    3315 -       t0 = s0 & 0xf000;
    3316 +       t0 = pending & 0xf000;
    3317         t0 = t0 < 1;
    3318         t0 = t0 << 2;
    3319         a0 = a0 - t0;
    3320 -       s0 = s0 << t0;
    3321 +       pending = pending << t0;
    3322  
    3323 -       t0 = s0 & 0xc000;
    3324 +       t0 = pending & 0xc000;
    3325         t0 = t0 < 1;
    3326         t0 = t0 << 1;
    3327         a0 = a0 - t0;
    3328 -       s0 = s0 << t0;
    3329 +       pending = pending << t0;
    3330  
    3331 -       t0 = s0 & 0x8000;
    3332 +       t0 = pending & 0x8000;
    3333         t0 = t0 < 1;
    3334         //t0 = t0 << 2;
    3335         a0 = a0 - t0;
    3336 -       //s0 = s0 << t0;
    3337 +       //pending = pending << t0;
    3338  
    3339         return a0;
    3340  #endif
    3341 diff -Naur linux-2.6.18.3/arch/mips/mips-boards/sim/sim_time.c linux-mips-2.6.18.3/arch/mips/mips-boards/sim/sim_time.c
    3342 --- linux-2.6.18.3/arch/mips/mips-boards/sim/sim_time.c 2006-11-18 19:28:22.000000000 -0800
    3343 +++ linux-mips-2.6.18.3/arch/mips/mips-boards/sim/sim_time.c    2006-11-20 10:09:08.000000000 -0800
    3344 @@ -103,7 +103,7 @@
    3345  
    3346  
    3347  /*
    3348 - * Estimate CPU frequency.  Sets mips_counter_frequency as a side-effect
    3349 + * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
    3350   */
    3351  static unsigned int __init estimate_cpu_frequency(void)
    3352  {
    3353 diff -Naur linux-2.6.18.3/arch/mips/mm/c-r3k.c linux-mips-2.6.18.3/arch/mips/mm/c-r3k.c
    3354 --- linux-2.6.18.3/arch/mips/mm/c-r3k.c 2006-11-18 19:28:22.000000000 -0800
    3355 +++ linux-mips-2.6.18.3/arch/mips/mm/c-r3k.c    2006-11-20 10:09:08.000000000 -0800
    3356 @@ -335,7 +335,7 @@
    3357         flush_cache_mm = r3k_flush_cache_mm;
    3358         flush_cache_range = r3k_flush_cache_range;
    3359         flush_cache_page = r3k_flush_cache_page;
    3360 -       flush_icache_page = r3k_flush_icache_page;
    3361 +       __flush_icache_page = r3k_flush_icache_page;
    3362         flush_icache_range = r3k_flush_icache_range;
    3363  
    3364         flush_cache_sigtramp = r3k_flush_cache_sigtramp;
    3365 diff -Naur linux-2.6.18.3/arch/mips/mm/c-r4k.c linux-mips-2.6.18.3/arch/mips/mm/c-r4k.c
    3366 --- linux-2.6.18.3/arch/mips/mm/c-r4k.c 2006-11-18 19:28:22.000000000 -0800
    3367 +++ linux-mips-2.6.18.3/arch/mips/mm/c-r4k.c    2006-11-20 10:09:08.000000000 -0800
    3368 @@ -475,7 +475,7 @@
    3369                 }
    3370         }
    3371         if (exec) {
    3372 -               if (cpu_has_vtag_icache) {
    3373 +               if (cpu_has_vtag_icache && mm == current->active_mm) {
    3374                         int cpu = smp_processor_id();
    3375  
    3376                         if (cpu_context(cpu, mm) != 0)
    3377 @@ -599,7 +599,7 @@
    3378          * We're not sure of the virtual address(es) involved here, so
    3379          * we have to flush the entire I-cache.
    3380          */
    3381 -       if (cpu_has_vtag_icache) {
    3382 +       if (cpu_has_vtag_icache && vma->vm_mm == current->active_mm) {
    3383                 int cpu = smp_processor_id();
    3384  
    3385                 if (cpu_context(cpu, vma->vm_mm) != 0)
    3386 @@ -1242,7 +1242,7 @@
    3387                 clear_c0_config(CONF_CU);
    3388                 break;
    3389         /*
    3390 -        * We need to catch the ealry Alchemy SOCs with
    3391 +        * We need to catch the early Alchemy SOCs with
    3392          * the write-only co_config.od bit and set it back to one...
    3393          */
    3394         case CPU_AU1000: /* rev. DA, HA, HB */
    3395 @@ -1291,7 +1291,7 @@
    3396         __flush_cache_all       = r4k___flush_cache_all;
    3397         flush_cache_mm          = r4k_flush_cache_mm;
    3398         flush_cache_page        = r4k_flush_cache_page;
    3399 -       flush_icache_page       = r4k_flush_icache_page;
    3400 +       __flush_icache_page     = r4k_flush_icache_page;
    3401         flush_cache_range       = r4k_flush_cache_range;
    3402  
    3403         flush_cache_sigtramp    = r4k_flush_cache_sigtramp;
    3404 diff -Naur linux-2.6.18.3/arch/mips/mm/c-sb1.c linux-mips-2.6.18.3/arch/mips/mm/c-sb1.c
    3405 --- linux-2.6.18.3/arch/mips/mm/c-sb1.c 2006-11-18 19:28:22.000000000 -0800
    3406 +++ linux-mips-2.6.18.3/arch/mips/mm/c-sb1.c    2006-11-20 10:09:08.000000000 -0800
    3407 @@ -19,6 +19,7 @@
    3408   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    3409   */
    3410  #include <linux/init.h>
    3411 +#include <linux/hardirq.h>
    3412  
    3413  #include <asm/asm.h>
    3414  #include <asm/bootinfo.h>
    3415 @@ -155,6 +156,26 @@
    3416  }
    3417  
    3418  /*
    3419 + * Invalidate a range of the icache.  The addresses are virtual, and
    3420 + * the cache is virtually indexed and tagged.  However, we don't
    3421 + * necessarily have the right ASID context, so use index ops instead
    3422 + * of hit ops.
    3423 + */
    3424 +static inline void __sb1_flush_icache_range(unsigned long start,
    3425 +       unsigned long end)
    3426 +{
    3427 +       start &= ~(icache_line_size - 1);
    3428 +       end = (end + icache_line_size - 1) & ~(icache_line_size - 1);
    3429 +
    3430 +       while (start != end) {
    3431 +               cache_set_op(Index_Invalidate_I, start & icache_index_mask);
    3432 +               start += icache_line_size;
    3433 +       }
    3434 +       mispredict();
    3435 +       sync();
    3436 +}
    3437 +
    3438 +/*
    3439   * Flush the icache for a given physical page.  Need to writeback the
    3440   * dcache first, then invalidate the icache.  If the page isn't
    3441   * executable, nothing is required.
    3442 @@ -173,8 +194,11 @@
    3443         /*
    3444          * Bumping the ASID is probably cheaper than the flush ...
    3445          */
    3446 -       if (cpu_context(cpu, vma->vm_mm) != 0)
    3447 -               drop_mmu_context(vma->vm_mm, cpu);
    3448 +       if (vma->vm_mm == current->active_mm) {
    3449 +               if (cpu_context(cpu, vma->vm_mm) != 0)
    3450 +                       drop_mmu_context(vma->vm_mm, cpu);
    3451 +       } else
    3452 +               __sb1_flush_icache_range(addr, addr + PAGE_SIZE);
    3453  }
    3454  
    3455  #ifdef CONFIG_SMP
    3456 @@ -210,26 +234,25 @@
    3457         __attribute__((alias("local_sb1_flush_cache_page")));
    3458  #endif
    3459  
    3460 -/*
    3461 - * Invalidate a range of the icache.  The addresses are virtual, and
    3462 - * the cache is virtually indexed and tagged.  However, we don't
    3463 - * necessarily have the right ASID context, so use index ops instead
    3464 - * of hit ops.
    3465 - */
    3466 -static inline void __sb1_flush_icache_range(unsigned long start,
    3467 -       unsigned long end)
    3468 +#ifdef CONFIG_SMP
    3469 +static void sb1_flush_cache_data_page_ipi(void *info)
    3470  {
    3471 -       start &= ~(icache_line_size - 1);
    3472 -       end = (end + icache_line_size - 1) & ~(icache_line_size - 1);
    3473 +       unsigned long start = (unsigned long)info;
    3474  
    3475 -       while (start != end) {
    3476 -               cache_set_op(Index_Invalidate_I, start & icache_index_mask);
    3477 -               start += icache_line_size;
    3478 -       }
    3479 -       mispredict();
    3480 -       sync();
    3481 +       __sb1_writeback_inv_dcache_range(start, start + PAGE_SIZE);
    3482  }
    3483  
    3484 +static void sb1_flush_cache_data_page(unsigned long addr)
    3485 +{
    3486 +       if (in_atomic())
    3487 +               __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
    3488 +       else
    3489 +               on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1);
    3490 +}
    3491 +#else
    3492 +void sb1_flush_cache_data_page(unsigned long)
    3493 +       __attribute__((alias("local_sb1_flush_cache_data_page")));
    3494 +#endif
    3495  
    3496  /*
    3497   * Invalidate all caches on this CPU
    3498 @@ -326,9 +349,12 @@
    3499          * If there's a context, bump the ASID (cheaper than a flush,
    3500          * since we don't know VAs!)
    3501          */
    3502 -       if (cpu_context(cpu, vma->vm_mm) != 0) {
    3503 -               drop_mmu_context(vma->vm_mm, cpu);
    3504 -       }
    3505 +       if (vma->vm_mm == current->active_mm) {
    3506 +               if (cpu_context(cpu, vma->vm_mm) != 0)
    3507 +                       drop_mmu_context(vma->vm_mm, cpu);
    3508 +       } else
    3509 +               __sb1_flush_icache_range(start, start + PAGE_SIZE);
    3510 +
    3511  }
    3512  
    3513  #ifdef CONFIG_SMP
    3514 @@ -520,7 +546,7 @@
    3515  
    3516         /* These routines are for Icache coherence with the Dcache */
    3517         flush_icache_range = sb1_flush_icache_range;
    3518 -       flush_icache_page = sb1_flush_icache_page;
    3519 +       __flush_icache_page = sb1_flush_icache_page;
    3520         flush_icache_all = __sb1_flush_icache_all; /* local only */
    3521  
    3522         /* This implies an Icache flush too, so can't be nop'ed */
    3523 @@ -528,7 +554,7 @@
    3524  
    3525         flush_cache_sigtramp = sb1_flush_cache_sigtramp;
    3526         local_flush_data_cache_page = (void *) sb1_nop;
    3527 -       flush_data_cache_page = (void *) sb1_nop;
    3528 +       flush_data_cache_page = sb1_flush_cache_data_page;
    3529  
    3530         /* Full flush */
    3531         __flush_cache_all = sb1___flush_cache_all;
    3532 @@ -552,5 +578,5 @@
    3533         :
    3534         : "memory");
    3535  
    3536 -       flush_cache_all();
    3537 +       local_sb1___flush_cache_all();
    3538  }
    3539 diff -Naur linux-2.6.18.3/arch/mips/mm/c-tx39.c linux-mips-2.6.18.3/arch/mips/mm/c-tx39.c
    3540 --- linux-2.6.18.3/arch/mips/mm/c-tx39.c        2006-11-18 19:28:22.000000000 -0800
    3541 +++ linux-mips-2.6.18.3/arch/mips/mm/c-tx39.c   2006-11-20 10:09:08.000000000 -0800
    3542 @@ -382,7 +382,7 @@
    3543                 flush_cache_mm          = (void *) tx39h_flush_icache_all;
    3544                 flush_cache_range       = (void *) tx39h_flush_icache_all;
    3545                 flush_cache_page        = (void *) tx39h_flush_icache_all;
    3546 -               flush_icache_page       = (void *) tx39h_flush_icache_all;
    3547 +               __flush_icache_page     = (void *) tx39h_flush_icache_all;
    3548                 flush_icache_range      = (void *) tx39h_flush_icache_all;
    3549  
    3550                 flush_cache_sigtramp    = (void *) tx39h_flush_icache_all;
    3551 @@ -408,7 +408,7 @@
    3552                 flush_cache_mm = tx39_flush_cache_mm;
    3553                 flush_cache_range = tx39_flush_cache_range;
    3554                 flush_cache_page = tx39_flush_cache_page;
    3555 -               flush_icache_page = tx39_flush_icache_page;
    3556 +               __flush_icache_page = tx39_flush_icache_page;
    3557                 flush_icache_range = tx39_flush_icache_range;
    3558  
    3559                 flush_cache_sigtramp = tx39_flush_cache_sigtramp;
    3560 diff -Naur linux-2.6.18.3/arch/mips/mm/cache.c linux-mips-2.6.18.3/arch/mips/mm/cache.c
    3561 --- linux-2.6.18.3/arch/mips/mm/cache.c 2006-11-18 19:28:22.000000000 -0800
    3562 +++ linux-mips-2.6.18.3/arch/mips/mm/cache.c    2006-11-20 10:09:08.000000000 -0800
    3563 @@ -25,7 +25,7 @@
    3564  void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page,
    3565         unsigned long pfn);
    3566  void (*flush_icache_range)(unsigned long start, unsigned long end);
    3567 -void (*flush_icache_page)(struct vm_area_struct *vma, struct page *page);
    3568 +void (*__flush_icache_page)(struct vm_area_struct *vma, struct page *page);
    3569  
    3570  /* MIPS specific cache operations */
    3571  void (*flush_cache_sigtramp)(unsigned long addr);
    3572 @@ -70,6 +70,8 @@
    3573         struct address_space *mapping = page_mapping(page);
    3574         unsigned long addr;
    3575  
    3576 +       if (PageHighMem(page))
    3577 +               return;
    3578         if (mapping && !mapping_mapped(mapping)) {
    3579                 SetPageDcacheDirty(page);
    3580                 return;
    3581 @@ -91,16 +93,16 @@
    3582  {
    3583         struct page *page;
    3584         unsigned long pfn, addr;
    3585 +       int exec = (vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc;
    3586  
    3587         pfn = pte_pfn(pte);
    3588 -       if (pfn_valid(pfn) && (page = pfn_to_page(pfn), page_mapping(page)) &&
    3589 -           Page_dcache_dirty(page)) {
    3590 -               if (pages_do_alias((unsigned long)page_address(page),
    3591 -                                  address & PAGE_MASK)) {
    3592 -                       addr = (unsigned long) page_address(page);
    3593 +       if (unlikely(!pfn_valid(pfn)))
    3594 +               return;
    3595 +       page = pfn_to_page(pfn);
    3596 +       if (page_mapping(page) && Page_dcache_dirty(page)) {
    3597 +               addr = (unsigned long) page_address(page);
    3598 +               if (exec || pages_do_alias(addr, address & PAGE_MASK))
    3599                         flush_data_cache_page(addr);
    3600 -               }
    3601 -
    3602                 ClearPageDcacheDirty(page);
    3603         }
    3604  }
    3605 diff -Naur linux-2.6.18.3/arch/mips/mm/fault.c linux-mips-2.6.18.3/arch/mips/mm/fault.c
    3606 --- linux-2.6.18.3/arch/mips/mm/fault.c 2006-11-18 19:28:22.000000000 -0800
    3607 +++ linux-mips-2.6.18.3/arch/mips/mm/fault.c    2006-11-20 10:09:08.000000000 -0800
    3608 @@ -89,7 +89,7 @@
    3609                 if (!(vma->vm_flags & VM_WRITE))
    3610                         goto bad_area;
    3611         } else {
    3612 -               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
    3613 +               if (!(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)))
    3614                         goto bad_area;
    3615         }
    3616  
    3617 diff -Naur linux-2.6.18.3/arch/mips/mm/init.c linux-mips-2.6.18.3/arch/mips/mm/init.c
    3618 --- linux-2.6.18.3/arch/mips/mm/init.c  2006-11-18 19:28:22.000000000 -0800
    3619 +++ linux-mips-2.6.18.3/arch/mips/mm/init.c     2006-11-20 10:09:08.000000000 -0800
    3620 @@ -30,11 +30,39 @@
    3621  #include <asm/cachectl.h>
    3622  #include <asm/cpu.h>
    3623  #include <asm/dma.h>
    3624 +#include <asm/kmap_types.h>
    3625  #include <asm/mmu_context.h>
    3626  #include <asm/sections.h>
    3627  #include <asm/pgtable.h>
    3628  #include <asm/pgalloc.h>
    3629  #include <asm/tlb.h>
    3630 +#include <asm/fixmap.h>
    3631 +
    3632 +/* CP0 hazard avoidance. */
    3633 +#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
    3634 +                                    "nop; nop; nop; nop; nop; nop;\n\t" \
    3635 +                                    ".set reorder\n\t")
    3636 +
    3637 +/* Atomicity and interruptability */
    3638 +#ifdef CONFIG_MIPS_MT_SMTC
    3639 +
    3640 +#include <asm/mipsmtregs.h>
    3641 +
    3642 +#define ENTER_CRITICAL(flags) \
    3643 +       { \
    3644 +       unsigned int mvpflags; \
    3645 +       local_irq_save(flags);\
    3646 +       mvpflags = dvpe()
    3647 +#define EXIT_CRITICAL(flags) \
    3648 +       evpe(mvpflags); \
    3649 +       local_irq_restore(flags); \
    3650 +       }
    3651 +#else
    3652 +
    3653 +#define ENTER_CRITICAL(flags) local_irq_save(flags)
    3654 +#define EXIT_CRITICAL(flags) local_irq_restore(flags)
    3655 +
    3656 +#endif /* CONFIG_MIPS_MT_SMTC */
    3657  
    3658  DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
    3659  
    3660 @@ -80,13 +108,184 @@
    3661         return 1UL << order;
    3662  }
    3663  
    3664 -#ifdef CONFIG_HIGHMEM
    3665 -pte_t *kmap_pte;
    3666 -pgprot_t kmap_prot;
    3667 +/*
    3668 + * These are almost like kmap_atomic / kunmap_atmic except they take an
    3669 + * additional address argument as the hint.
    3670 + */
    3671  
    3672  #define kmap_get_fixmap_pte(vaddr)                                     \
    3673         pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr))
    3674  
    3675 +#ifdef CONFIG_MIPS_MT_SMTC
    3676 +static pte_t *kmap_coherent_pte;
    3677 +static void __init kmap_coherent_init(void)
    3678 +{
    3679 +       unsigned long vaddr;
    3680 +
    3681 +       /* cache the first coherent kmap pte */
    3682 +       vaddr = __fix_to_virt(FIX_CMAP_BEGIN);
    3683 +       kmap_coherent_pte = kmap_get_fixmap_pte(vaddr);
    3684 +}
    3685 +#else
    3686 +static inline void kmap_coherent_init(void) {}
    3687 +#endif
    3688 +
    3689 +static inline void *kmap_coherent(struct page *page, unsigned long addr)
    3690 +{
    3691 +       enum fixed_addresses idx;
    3692 +       unsigned long vaddr, flags, entrylo;
    3693 +       unsigned long old_ctx;
    3694 +       pte_t pte;
    3695 +       int tlbidx;
    3696 +
    3697 +       inc_preempt_count();
    3698 +       idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
    3699 +#ifdef CONFIG_MIPS_MT_SMTC
    3700 +       idx += FIX_N_COLOURS * smp_processor_id();
    3701 +#endif
    3702 +       vaddr = __fix_to_virt(FIX_CMAP_END - idx);
    3703 +       pte = mk_pte(page, PAGE_KERNEL);
    3704 +#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
    3705 +       entrylo = pte.pte_high;
    3706 +#else
    3707 +       entrylo = pte_val(pte) >> 6;
    3708 +#endif
    3709 +
    3710 +       ENTER_CRITICAL(flags);
    3711 +       old_ctx = read_c0_entryhi();
    3712 +       write_c0_entryhi(vaddr & (PAGE_MASK << 1));
    3713 +       write_c0_entrylo0(entrylo);
    3714 +       write_c0_entrylo1(entrylo);
    3715 +#ifdef CONFIG_MIPS_MT_SMTC
    3716 +       set_pte(kmap_coherent_pte - (FIX_CMAP_END - idx), pte);
    3717 +       /* preload TLB instead of local_flush_tlb_one() */
    3718 +       mtc0_tlbw_hazard();
    3719 +       tlb_probe();
    3720 +       BARRIER;
    3721 +       tlbidx = read_c0_index();
    3722 +       mtc0_tlbw_hazard();
    3723 +       if (tlbidx < 0)
    3724 +               tlb_write_random();
    3725 +       else
    3726 +               tlb_write_indexed();
    3727 +#else
    3728 +       tlbidx = read_c0_wired();
    3729 +       write_c0_wired(tlbidx + 1);
    3730 +       write_c0_index(tlbidx);
    3731 +       mtc0_tlbw_hazard();
    3732 +       tlb_write_indexed();
    3733 +#endif
    3734 +       tlbw_use_hazard();
    3735 +       write_c0_entryhi(old_ctx);
    3736 +       EXIT_CRITICAL(flags);
    3737 +
    3738 +       return (void*) vaddr;
    3739 +}
    3740 +
    3741 +#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
    3742 +
    3743 +static inline void kunmap_coherent(struct page *page)
    3744 +{
    3745 +#ifndef CONFIG_MIPS_MT_SMTC
    3746 +       unsigned int wired;
    3747 +       unsigned long flags, old_ctx;
    3748 +
    3749 +       ENTER_CRITICAL(flags);
    3750 +       old_ctx = read_c0_entryhi();
    3751 +       wired = read_c0_wired() - 1;
    3752 +       write_c0_wired(wired);
    3753 +       write_c0_index(wired);
    3754 +       write_c0_entryhi(UNIQUE_ENTRYHI(wired));
    3755 +       write_c0_entrylo0(0);
    3756 +       write_c0_entrylo1(0);
    3757 +       mtc0_tlbw_hazard();
    3758 +       tlb_write_indexed();
    3759 +       tlbw_use_hazard();
    3760 +       write_c0_entryhi(old_ctx);
    3761 +       EXIT_CRITICAL(flags);
    3762 +#endif
    3763 +       dec_preempt_count();
    3764 +       preempt_check_resched();
    3765 +}
    3766 +
    37671089+void copy_user_highpage(struct page *to, struct page *from,
    37681090+       unsigned long vaddr, struct vm_area_struct *vma)
     
    37901112+EXPORT_SYMBOL(copy_user_highpage);
    37911113+
    3792 +void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
    3793 +       struct page *to)
    3794 +{
    3795 +       if (cpu_has_dc_aliases) {
    3796 +               struct page *from = virt_to_page(vfrom);
    3797 +               vfrom = kmap_coherent(from, vaddr);
    3798 +               copy_page(vto, vfrom);
    3799 +               kunmap_coherent(from);
    3800 +       } else
    3801 +               copy_page(vto, vfrom);
    3802 +       if (!cpu_has_ic_fills_f_dc ||
    3803 +           pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
    3804 +               flush_data_cache_page((unsigned long)vto);
    3805 +}
    3806 +
    3807 +EXPORT_SYMBOL(copy_user_page);
    3808 +
    3809 +void copy_to_user_page(struct vm_area_struct *vma,
    3810 +       struct page *page, unsigned long vaddr, void *dst, const void *src,
    3811 +       unsigned long len)
    3812 +{
    3813 +       if (cpu_has_dc_aliases) {
    3814 +               void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
    3815 +               memcpy(vto, src, len);
    3816 +               kunmap_coherent(page);
    3817 +       } else
    3818 +               memcpy(dst, src, len);
    3819 +       if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc)
    3820 +               flush_cache_page(vma, vaddr, page_to_pfn(page));
    3821 +}
    3822 +
    3823 +EXPORT_SYMBOL(copy_to_user_page);
    3824 +
    3825 +void copy_from_user_page(struct vm_area_struct *vma,
    3826 +       struct page *page, unsigned long vaddr, void *dst, const void *src,
    3827 +       unsigned long len)
    3828 +{
    3829 +       if (cpu_has_dc_aliases) {
    3830 +               void *vfrom =
    3831 +                       kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
    3832 +               memcpy(dst, vfrom, len);
    3833 +               kunmap_coherent(page);
    3834 +       } else
    3835 +               memcpy(dst, src, len);
    3836 +}
    3837 +
    3838 +EXPORT_SYMBOL(copy_from_user_page);
    3839 +
    3840 +
    3841 +#ifdef CONFIG_HIGHMEM
    3842 +pte_t *kmap_pte;
    3843 +pgprot_t kmap_prot;
    3844 +
    3845  static void __init kmap_init(void)
    3846  {
    3847         unsigned long kmap_vstart;
    3848 @@ -97,11 +296,12 @@
    3849  
    3850         kmap_prot = PAGE_KERNEL;
    3851  }
    3852 +#endif /* CONFIG_HIGHMEM */
    3853  
    3854 -#ifdef CONFIG_32BIT
    3855  void __init fixrange_init(unsigned long start, unsigned long end,
    3856         pgd_t *pgd_base)
    3857  {
    3858 +#if defined(CONFIG_HIGHMEM) || defined(CONFIG_MIPS_MT_SMTC)
    3859         pgd_t *pgd;
    3860         pud_t *pud;
    3861         pmd_t *pmd;
    3862 @@ -122,7 +322,7 @@
    3863                         for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
    3864                                 if (pmd_none(*pmd)) {
    3865                                         pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
    3866 -                                       set_pmd(pmd, __pmd(pte));
    3867 +                                       set_pmd(pmd, __pmd((unsigned long)pte));
    3868                                         if (pte != pte_offset_kernel(pmd, 0))
    3869                                                 BUG();
    3870                                 }
    3871 @@ -132,9 +332,8 @@
    3872                 }
    3873                 j = 0;
    3874         }
    3875 +#endif
    3876  }
    3877 -#endif /* CONFIG_32BIT */
    3878 -#endif /* CONFIG_HIGHMEM */
    3879  
    3880  #ifndef CONFIG_NEED_MULTIPLE_NODES
    3881  extern void pagetable_init(void);
    3882 @@ -175,6 +374,7 @@
    3883  #ifdef CONFIG_HIGHMEM
    3884         kmap_init();
    3885  #endif
    3886 +       kmap_coherent_init();
    3887  
    3888         max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
    3889         low = max_low_pfn;
    3890 diff -Naur linux-2.6.18.3/arch/mips/mm/ioremap.c linux-mips-2.6.18.3/arch/mips/mm/ioremap.c
    3891 --- linux-2.6.18.3/arch/mips/mm/ioremap.c       2006-11-18 19:28:22.000000000 -0800
    3892 +++ linux-mips-2.6.18.3/arch/mips/mm/ioremap.c  2006-11-20 10:09:08.000000000 -0800
    3893 @@ -176,7 +176,7 @@
    3894  
    3895  #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
    3896  
    3897 -void __iounmap(volatile void __iomem *addr)
    3898 +void __iounmap(const volatile void __iomem *addr)
    3899  {
    3900         struct vm_struct *p;
    3901  
    3902 diff -Naur linux-2.6.18.3/arch/mips/mm/pg-r4k.c linux-mips-2.6.18.3/arch/mips/mm/pg-r4k.c
    3903 --- linux-2.6.18.3/arch/mips/mm/pg-r4k.c        2006-11-18 19:28:22.000000000 -0800
    3904 +++ linux-mips-2.6.18.3/arch/mips/mm/pg-r4k.c   2006-11-20 10:09:08.000000000 -0800
    3905 @@ -270,6 +270,20 @@
    3906         emit_instruction(mi);
    3907  }
    3908  
    3909 +static inline void build_addiu_a2(unsigned long offset)
    3910 +{
    3911 +       union mips_instruction mi;
    3912 +
    3913 +       BUG_ON(offset > 0x7fff);
    3914 +
    3915 +       mi.i_format.opcode     = cpu_has_64bit_gp_regs ? daddiu_op : addiu_op;
    3916 +       mi.i_format.rs         = 6;             /* $a2 */
    3917 +       mi.i_format.rt         = 6;             /* $a2 */
    3918 +       mi.i_format.simmediate = offset;
    3919 +
    3920 +       emit_instruction(mi);
    3921 +}
    3922 +
    3923  static inline void build_addiu_a1(unsigned long offset)
    3924  {
    3925         union mips_instruction mi;
    3926 @@ -333,6 +347,7 @@
    3927  void __init build_clear_page(void)
    3928  {
    3929         unsigned int loop_start;
    3930 +       unsigned long off;
    3931  
    3932         epc = (unsigned int *) &clear_page_array;
    3933         instruction_pending = 0;
    3934 @@ -369,7 +384,12 @@
    3935                 }
    3936         }
    3937  
    3938 -       build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0));
    3939 +        off = PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0);
    3940 +       if (off > 0x7fff) {
    3941 +               build_addiu_a2_a0(off >> 1);
    3942 +               build_addiu_a2(off >> 1);
    3943 +       } else
    3944 +               build_addiu_a2_a0(off);
    3945  
    3946         if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
    3947                 build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
    3948 @@ -420,12 +440,18 @@
    3949  void __init build_copy_page(void)
    3950  {
    3951         unsigned int loop_start;
    3952 +       unsigned long off;
    3953  
    3954         epc = (unsigned int *) &copy_page_array;
    3955         store_offset = load_offset = 0;
    3956         instruction_pending = 0;
    3957  
    3958 -       build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0));
    3959 +       off = PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0);
    3960 +       if (off > 0x7fff) {
    3961 +               build_addiu_a2_a0(off >> 1);
    3962 +               build_addiu_a2(off >> 1);
    3963 +       } else
    3964 +               build_addiu_a2_a0(off);
    3965  
    3966         if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
    3967                 build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
    3968 diff -Naur linux-2.6.18.3/arch/mips/mm/pgtable-32.c linux-mips-2.6.18.3/arch/mips/mm/pgtable-32.c
    3969 --- linux-2.6.18.3/arch/mips/mm/pgtable-32.c    2006-11-18 19:28:22.000000000 -0800
    3970 +++ linux-mips-2.6.18.3/arch/mips/mm/pgtable-32.c       2006-11-20 10:09:08.000000000 -0800
    3971 @@ -31,9 +31,10 @@
    3972  
    3973  void __init pagetable_init(void)
    3974  {
    3975 -#ifdef CONFIG_HIGHMEM
    3976         unsigned long vaddr;
    3977 -       pgd_t *pgd, *pgd_base;
    3978 +       pgd_t *pgd_base;
    3979 +#ifdef CONFIG_HIGHMEM
    3980 +       pgd_t *pgd;
    3981         pud_t *pud;
    3982         pmd_t *pmd;
    3983         pte_t *pte;
    3984 @@ -44,7 +45,6 @@
    3985         pgd_init((unsigned long)swapper_pg_dir
    3986                  + sizeof(pgd_t) * USER_PTRS_PER_PGD);
    3987  
    3988 -#ifdef CONFIG_HIGHMEM
    3989         pgd_base = swapper_pg_dir;
    3990  
    3991         /*
    3992 @@ -53,6 +53,7 @@
    3993         vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
    3994         fixrange_init(vaddr, 0, pgd_base);
    3995  
    3996 +#ifdef CONFIG_HIGHMEM
    3997         /*
    3998          * Permanent kmaps:
    3999          */
    4000 diff -Naur linux-2.6.18.3/arch/mips/mm/pgtable-64.c linux-mips-2.6.18.3/arch/mips/mm/pgtable-64.c
    4001 --- linux-2.6.18.3/arch/mips/mm/pgtable-64.c    2006-11-18 19:28:22.000000000 -0800
    4002 +++ linux-mips-2.6.18.3/arch/mips/mm/pgtable-64.c       2006-11-20 10:09:08.000000000 -0800
    4003 @@ -8,6 +8,7 @@
    4004   */
    4005  #include <linux/init.h>
    4006  #include <linux/mm.h>
    4007 +#include <asm/fixmap.h>
    4008  #include <asm/pgtable.h>
    4009  
    4010  void pgd_init(unsigned long page)
    4011 @@ -52,7 +53,17 @@
    4012  
    4013  void __init pagetable_init(void)
    4014  {
    4015 +       unsigned long vaddr;
    4016 +       pgd_t *pgd_base;
    4017 +
    4018         /* Initialize the entire pgd.  */
    4019         pgd_init((unsigned long)swapper_pg_dir);
    4020         pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
    4021 +
    4022 +       pgd_base = swapper_pg_dir;
    4023 +       /*
    4024 +        * Fixed mappings:
    4025 +        */
    4026 +       vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
    4027 +       fixrange_init(vaddr, 0, pgd_base);
    4028  }
    4029 diff -Naur linux-2.6.18.3/arch/mips/mm/tlbex.c linux-mips-2.6.18.3/arch/mips/mm/tlbex.c
    4030 --- linux-2.6.18.3/arch/mips/mm/tlbex.c 2006-11-18 19:28:22.000000000 -0800
    4031 +++ linux-mips-2.6.18.3/arch/mips/mm/tlbex.c    2006-11-20 10:09:08.000000000 -0800
    4032 @@ -102,7 +102,7 @@
    4033         insn_addu, insn_addiu, insn_and, insn_andi, insn_beq,
    4034         insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl,
    4035         insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0,
    4036 -       insn_dsll, insn_dsll32, insn_dsra, insn_dsrl,
    4037 +       insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32,
    4038         insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld,
    4039         insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0,
    4040         insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll,
    4041 @@ -145,6 +145,7 @@
    4042         { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE },
    4043         { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE },
    4044         { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE },
    4045 +       { insn_dsrl32, M(spec_op,0,0,0,0,dsrl32_op), RT | RD | RE },
    4046         { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD },
    4047         { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 },
    4048         { insn_j, M(j_op,0,0,0,0,0), JIMM },
    4049 @@ -385,6 +386,7 @@
    4050  I_u2u1u3(_dsll32);
    4051  I_u2u1u3(_dsra);
    4052  I_u2u1u3(_dsrl);
    4053 +I_u2u1u3(_dsrl32);
    4054  I_u3u1u2(_dsubu);
    4055  I_0(_eret);
    4056  I_u1(_j);
    4057 @@ -996,7 +998,12 @@
    4058  #endif
    4059  
    4060         l_vmalloc_done(l, *p);
    4061 -       i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3); /* get pgd offset in bytes */
    4062 +
    4063 +       if (PGDIR_SHIFT - 3 < 32)               /* get pgd offset in bytes */
    4064 +               i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3);
    4065 +       else
    4066 +               i_dsrl32(p, tmp, tmp, PGDIR_SHIFT - 3 - 32);
    4067 +
    4068         i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3);
    4069         i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */
    4070         i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */
    4071 @@ -1073,7 +1080,7 @@
    4072  
    4073  static __init void build_adjust_context(u32 **p, unsigned int ctx)
    4074  {
    4075 -       unsigned int shift = 4 - (PTE_T_LOG2 + 1);
    4076 +       unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12;
    4077         unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1);
    4078  
    4079         switch (current_cpu_data.cputype) {
    4080 diff -Naur linux-2.6.18.3/arch/mips/momentum/jaguar_atx/Makefile linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/Makefile
    4081 --- linux-2.6.18.3/arch/mips/momentum/jaguar_atx/Makefile       2006-11-18 19:28:22.000000000 -0800
    4082 +++ linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/Makefile  2006-11-20 10:09:08.000000000 -0800
     1114 void copy_to_user_page(struct vm_area_struct *vma,
     1115        struct page *page, unsigned long vaddr, void *dst, const void *src,
     1116        unsigned long len)
     1117diff -Naur linux-2.6.19/arch/mips/momentum/jaguar_atx/Makefile linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/Makefile
     1118--- linux-2.6.19/arch/mips/momentum/jaguar_atx/Makefile 2006-11-29 13:57:37.000000000 -0800
     1119+++ linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/Makefile    2006-11-29 15:23:09.000000000 -0800
    40831120@@ -6,7 +6,7 @@
    40841121 # unless it's something special (ie not a .c file).
     
    40901127 obj-$(CONFIG_SERIAL_8250_CONSOLE) += ja-console.o
    40911128 obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o
    4092 diff -Naur linux-2.6.18.3/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h
    4093 --- linux-2.6.18.3/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h      2006-11-18 19:28:22.000000000 -0800
    4094 +++ linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h 2006-11-20 10:09:08.000000000 -0800
     1129diff -Naur linux-2.6.19/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h
     1130--- linux-2.6.19/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h        2006-11-29 13:57:37.000000000 -0800
     1131+++ linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/jaguar_atx_fpga.h   2006-11-29 15:23:09.000000000 -0800
    40951132@@ -46,7 +46,9 @@
    40961133 
     
    41051142 
    41061143 #endif
    4107 diff -Naur linux-2.6.18.3/arch/mips/momentum/jaguar_atx/platform.c linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/platform.c
    4108 --- linux-2.6.18.3/arch/mips/momentum/jaguar_atx/platform.c     1969-12-31 16:00:00.000000000 -0800
    4109 +++ linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/platform.c        2006-11-20 10:09:08.000000000 -0800
     1144diff -Naur linux-2.6.19/arch/mips/momentum/jaguar_atx/platform.c linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/platform.c
     1145--- linux-2.6.19/arch/mips/momentum/jaguar_atx/platform.c       1969-12-31 16:00:00.000000000 -0800
     1146+++ linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/platform.c  2006-11-29 15:23:09.000000000 -0800
    41101147@@ -0,0 +1,235 @@
    41111148+#include <linux/delay.h>
     
    43441381+
    43451382+#endif /* defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) */
    4346 diff -Naur linux-2.6.18.3/arch/mips/momentum/jaguar_atx/prom.c linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/prom.c
    4347 --- linux-2.6.18.3/arch/mips/momentum/jaguar_atx/prom.c 2006-11-18 19:28:22.000000000 -0800
    4348 +++ linux-mips-2.6.18.3/arch/mips/momentum/jaguar_atx/prom.c    2006-11-20 10:09:08.000000000 -0800
     1383diff -Naur linux-2.6.19/arch/mips/momentum/jaguar_atx/prom.c linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/prom.c
     1384--- linux-2.6.19/arch/mips/momentum/jaguar_atx/prom.c   2006-11-29 13:57:37.000000000 -0800
     1385+++ linux-mips-2.6.19/arch/mips/momentum/jaguar_atx/prom.c      2006-11-29 15:23:09.000000000 -0800
    43491386@@ -39,56 +39,6 @@
    43501387        return "Momentum Jaguar-ATX";
     
    44161453 
    44171454 unsigned long __init prom_free_prom_memory(void)
    4418 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_3/Makefile linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/Makefile
    4419 --- linux-2.6.18.3/arch/mips/momentum/ocelot_3/Makefile 2006-11-18 19:28:22.000000000 -0800
    4420 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/Makefile    2006-11-20 10:09:08.000000000 -0800
    4421 @@ -5,4 +5,4 @@
    4422  # removes any old dependencies. DON'T put your own dependencies here
    4423  # unless it's something special (ie not a .c file).
    4424  #
    4425 -obj-y   += irq.o prom.o reset.o setup.o
    4426 +obj-y   += irq.o platform.o prom.o reset.o setup.o
    4427 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h
    4428 --- linux-2.6.18.3/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h  2006-11-18 19:28:22.000000000 -0800
    4429 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/ocelot_3_fpga.h     2006-11-20 10:09:08.000000000 -0800
    4430 @@ -51,7 +51,9 @@
    4431  
    4432  extern unsigned long ocelot_fpga_base;
    4433  
    4434 -#define OCELOT_FPGA_WRITE(x, y) writeb(x, ocelot_fpga_base + OCELOT_3_REG_##y)
    4435 -#define OCELOT_FPGA_READ(x) readb(ocelot_fpga_base + OCELOT_3_REG_##x)
    4436 +#define __FPGA_REG_TO_ADDR(reg)                                                \
    4437 +       ((void *) ocelot_fpga_base + OCELOT_3_REG_##reg)
    4438 +#define OCELOT_FPGA_WRITE(x, reg) writeb(x, __FPGA_REG_TO_ADDR(reg))
    4439 +#define OCELOT_FPGA_READ(reg) readb(__FPGA_REG_TO_ADDR(reg))
    4440  
    4441  #endif
    4442 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_3/platform.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/platform.c
    4443 --- linux-2.6.18.3/arch/mips/momentum/ocelot_3/platform.c       1969-12-31 16:00:00.000000000 -0800
    4444 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/platform.c  2006-11-20 10:09:08.000000000 -0800
    4445 @@ -0,0 +1,235 @@
    4446 +#include <linux/delay.h>
    4447 +#include <linux/if_ether.h>
    4448 +#include <linux/ioport.h>
    4449 +#include <linux/mv643xx.h>
    4450 +#include <linux/platform_device.h>
    4451 +
    4452 +#include "ocelot_3_fpga.h"
    4453 +
    4454 +#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
    4455 +
    4456 +static struct resource mv643xx_eth_shared_resources[] = {
    4457 +       [0] = {
    4458 +               .name   = "ethernet shared base",
    4459 +               .start  = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
    4460 +               .end    = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
    4461 +                                      MV643XX_ETH_SHARED_REGS_SIZE - 1,
    4462 +               .flags  = IORESOURCE_MEM,
    4463 +       },
    4464 +};
    4465 +
    4466 +static struct platform_device mv643xx_eth_shared_device = {
    4467 +       .name           = MV643XX_ETH_SHARED_NAME,
    4468 +       .id             = 0,
    4469 +       .num_resources  = ARRAY_SIZE(mv643xx_eth_shared_resources),
    4470 +       .resource       = mv643xx_eth_shared_resources,
    4471 +};
    4472 +
    4473 +#define MV_SRAM_BASE                   0xfe000000UL
    4474 +#define MV_SRAM_SIZE                   (256 * 1024)
    4475 +
    4476 +#define MV_SRAM_RXRING_SIZE            (MV_SRAM_SIZE / 4)
    4477 +#define MV_SRAM_TXRING_SIZE            (MV_SRAM_SIZE / 4)
    4478 +
    4479 +#define MV_SRAM_BASE_ETH0              MV_SRAM_BASE
    4480 +#define MV_SRAM_BASE_ETH1              (MV_SRAM_BASE + (MV_SRAM_SIZE / 2))
    4481 +
    4482 +#define MV64x60_IRQ_ETH_0 48
    4483 +#define MV64x60_IRQ_ETH_1 49
    4484 +#define MV64x60_IRQ_ETH_2 50
    4485 +
    4486 +#ifdef CONFIG_MV643XX_ETH_0
    4487 +
    4488 +static struct resource mv64x60_eth0_resources[] = {
    4489 +       [0] = {
    4490 +               .name   = "eth0 irq",
    4491 +               .start  = MV64x60_IRQ_ETH_0,
    4492 +               .end    = MV64x60_IRQ_ETH_0,
    4493 +               .flags  = IORESOURCE_IRQ,
    4494 +       },
    4495 +};
    4496 +
    4497 +static char eth0_mac_addr[ETH_ALEN];
    4498 +
    4499 +static struct mv643xx_eth_platform_data eth0_pd = {
    4500 +       .mac_addr       = eth0_mac_addr,
    4501 +
    4502 +       .tx_sram_addr   = MV_SRAM_BASE_ETH0,
    4503 +       .tx_sram_size   = MV_SRAM_TXRING_SIZE,
    4504 +       .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
    4505 +
    4506 +       .rx_sram_addr   = MV_SRAM_BASE_ETH0 + MV_SRAM_TXRING_SIZE,
    4507 +       .rx_sram_size   = MV_SRAM_RXRING_SIZE,
    4508 +       .rx_queue_size  = MV_SRAM_RXRING_SIZE / 16,
    4509 +};
    4510 +
    4511 +static struct platform_device eth0_device = {
    4512 +       .name           = MV643XX_ETH_NAME,
    4513 +       .id             = 0,
    4514 +       .num_resources  = ARRAY_SIZE(mv64x60_eth0_resources),
    4515 +       .resource       = mv64x60_eth0_resources,
    4516 +       .dev = {
    4517 +               .platform_data = &eth0_pd,
    4518 +       },
    4519 +};
    4520 +#endif /* CONFIG_MV643XX_ETH_0 */
    4521 +
    4522 +#ifdef CONFIG_MV643XX_ETH_1
    4523 +
    4524 +static struct resource mv64x60_eth1_resources[] = {
    4525 +       [0] = {
    4526 +               .name   = "eth1 irq",
    4527 +               .start  = MV64x60_IRQ_ETH_1,
    4528 +               .end    = MV64x60_IRQ_ETH_1,
    4529 +               .flags  = IORESOURCE_IRQ,
    4530 +       },
    4531 +};
    4532 +
    4533 +static char eth1_mac_addr[ETH_ALEN];
    4534 +
    4535 +static struct mv643xx_eth_platform_data eth1_pd = {
    4536 +       .mac_addr       = eth1_mac_addr,
    4537 +
    4538 +       .tx_sram_addr   = MV_SRAM_BASE_ETH1,
    4539 +       .tx_sram_size   = MV_SRAM_TXRING_SIZE,
    4540 +       .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
    4541 +
    4542 +       .rx_sram_addr   = MV_SRAM_BASE_ETH1 + MV_SRAM_TXRING_SIZE,
    4543 +       .rx_sram_size   = MV_SRAM_RXRING_SIZE,
    4544 +       .rx_queue_size  = MV_SRAM_RXRING_SIZE / 16,
    4545 +};
    4546 +
    4547 +static struct platform_device eth1_device = {
    4548 +       .name           = MV643XX_ETH_NAME,
    4549 +       .id             = 1,
    4550 +       .num_resources  = ARRAY_SIZE(mv64x60_eth1_resources),
    4551 +       .resource       = mv64x60_eth1_resources,
    4552 +       .dev = {
    4553 +               .platform_data = &eth1_pd,
    4554 +       },
    4555 +};
    4556 +#endif /* CONFIG_MV643XX_ETH_1 */
    4557 +
    4558 +#ifdef CONFIG_MV643XX_ETH_2
    4559 +
    4560 +static struct resource mv64x60_eth2_resources[] = {
    4561 +       [0] = {
    4562 +               .name   = "eth2 irq",
    4563 +               .start  = MV64x60_IRQ_ETH_2,
    4564 +               .end    = MV64x60_IRQ_ETH_2,
    4565 +               .flags  = IORESOURCE_IRQ,
    4566 +       },
    4567 +};
    4568 +
    4569 +static char eth2_mac_addr[ETH_ALEN];
    4570 +
    4571 +static struct mv643xx_eth_platform_data eth2_pd = {
    4572 +       .mac_addr       = eth2_mac_addr,
    4573 +};
    4574 +
    4575 +static struct platform_device eth2_device = {
    4576 +       .name           = MV643XX_ETH_NAME,
    4577 +       .id             = 1,
    4578 +       .num_resources  = ARRAY_SIZE(mv64x60_eth2_resources),
    4579 +       .resource       = mv64x60_eth2_resources,
    4580 +       .dev = {
    4581 +               .platform_data = &eth2_pd,
    4582 +       },
    4583 +};
    4584 +#endif /* CONFIG_MV643XX_ETH_2 */
    4585 +
    4586 +static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
    4587 +       &mv643xx_eth_shared_device,
    4588 +#ifdef CONFIG_MV643XX_ETH_0
    4589 +       &eth0_device,
    4590 +#endif
    4591 +#ifdef CONFIG_MV643XX_ETH_1
    4592 +       &eth1_device,
    4593 +#endif
    4594 +#ifdef CONFIG_MV643XX_ETH_2
    4595 +       &eth2_device,
    4596 +#endif
    4597 +};
    4598 +
    4599 +static u8 __init exchange_bit(u8 val, u8 cs)
    4600 +{
    4601 +       /* place the data */
    4602 +       OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
    4603 +       udelay(1);
    4604 +
    4605 +       /* turn the clock on */
    4606 +       OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
    4607 +       udelay(1);
    4608 +
    4609 +       /* turn the clock off and read-strobe */
    4610 +       OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
    4611 +
    4612 +       /* return the data */
    4613 +       return (OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1;
    4614 +}
    4615 +
    4616 +static void __init get_mac(char dest[6])
    4617 +{
    4618 +       u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    4619 +       int i,j;
    4620 +
    4621 +       for (i = 0; i < 12; i++)
    4622 +               exchange_bit(read_opcode[i], 1);
    4623 +
    4624 +       for (j = 0; j < 6; j++) {
    4625 +               dest[j] = 0;
    4626 +               for (i = 0; i < 8; i++) {
    4627 +                       dest[j] <<= 1;
    4628 +                       dest[j] |= exchange_bit(0, 1);
    4629 +               }
    4630 +       }
    4631 +
    4632 +       /* turn off CS */
    4633 +       exchange_bit(0,0);
    4634 +}
    4635 +
    4636 +/*
    4637 + * Copy and increment ethernet MAC address by a small value.
    4638 + *
    4639 + * This is useful for systems where the only one MAC address is stored in
    4640 + * non-volatile memory for multiple ports.
    4641 + */
    4642 +static inline void eth_mac_add(unsigned char *dst, unsigned char *src,
    4643 +       unsigned int add)
    4644 +{
    4645 +       int i;
    4646 +
    4647 +       BUG_ON(add >= 256);
    4648 +
    4649 +       for (i = ETH_ALEN; i >= 0; i--) {
    4650 +               dst[i] = src[i] + add;
    4651 +               add = dst[i] < src[i];          /* compute carry */
    4652 +       }
    4653 +
    4654 +       WARN_ON(add);
    4655 +}
    4656 +
    4657 +static int __init mv643xx_eth_add_pds(void)
    4658 +{
    4659 +       unsigned char mac[ETH_ALEN];
    4660 +       int ret;
    4661 +
    4662 +       get_mac(mac);
    4663 +#ifdef CONFIG_MV643XX_ETH_0
    4664 +       eth_mac_add(eth1_mac_addr, mac, 0);
    4665 +#endif
    4666 +#ifdef CONFIG_MV643XX_ETH_1
    4667 +       eth_mac_add(eth1_mac_addr, mac, 1);
    4668 +#endif
    4669 +#ifdef CONFIG_MV643XX_ETH_2
    4670 +       eth_mac_add(eth2_mac_addr, mac, 2);
    4671 +#endif
    4672 +       ret = platform_add_devices(mv643xx_eth_pd_devs,
    4673 +                       ARRAY_SIZE(mv643xx_eth_pd_devs));
    4674 +
    4675 +       return ret;
    4676 +}
    4677 +
    4678 +device_initcall(mv643xx_eth_add_pds);
    4679 +
    4680 +#endif /* defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) */
    4681 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_3/prom.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/prom.c
    4682 --- linux-2.6.18.3/arch/mips/momentum/ocelot_3/prom.c   2006-11-18 19:28:22.000000000 -0800
    4683 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/prom.c      2006-11-20 10:09:08.000000000 -0800
    4684 @@ -34,64 +34,11 @@
    4685  extern unsigned long marvell_base;
    4686  extern unsigned long cpu_clock;
    4687  
    4688 -#ifdef CONFIG_MV643XX_ETH
    4689 -extern unsigned char prom_mac_addr_base[6];
    4690 -#endif
    4691 -
    4692  const char *get_system_type(void)
    4693  {
    4694         return "Momentum Ocelot-3";
    4695  }
    4696  
    4697 -#ifdef CONFIG_MV643XX_ETH
    4698 -void burn_clocks(void)
    4699 -{
    4700 -       int i;
    4701 -
    4702 -       /* this loop should burn at least 1us -- this should be plenty */
    4703 -       for (i = 0; i < 0x10000; i++)
    4704 -               ;
    4705 -}
    4706 -
    4707 -u8 exchange_bit(u8 val, u8 cs)
    4708 -{
    4709 -       /* place the data */
    4710 -       OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
    4711 -       burn_clocks();
    4712 -
    4713 -       /* turn the clock on */
    4714 -       OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
    4715 -       burn_clocks();
    4716 -
    4717 -       /* turn the clock off and read-strobe */
    4718 -       OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
    4719 -
    4720 -       /* return the data */
    4721 -       return ((OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);
    4722 -}
    4723 -
    4724 -void get_mac(char dest[6])
    4725 -{
    4726 -       u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    4727 -       int i,j;
    4728 -
    4729 -       for (i = 0; i < 12; i++)
    4730 -               exchange_bit(read_opcode[i], 1);
    4731 -
    4732 -       for (j = 0; j < 6; j++) {
    4733 -               dest[j] = 0;
    4734 -               for (i = 0; i < 8; i++) {
    4735 -                       dest[j] <<= 1;
    4736 -                       dest[j] |= exchange_bit(0, 1);
    4737 -               }
    4738 -       }
    4739 -
    4740 -       /* turn off CS */
    4741 -       exchange_bit(0,0);
    4742 -}
    4743 -#endif
    4744 -
    4745 -
    4746  #ifdef CONFIG_64BIT
    4747  
    4748  unsigned long signext(unsigned long addr)
    4749 @@ -228,11 +175,6 @@
    4750         mips_machgroup = MACH_GROUP_MOMENCO;
    4751         mips_machtype = MACH_MOMENCO_OCELOT_3;
    4752  
    4753 -#ifdef CONFIG_MV643XX_ETH
    4754 -       /* get the base MAC address for on-board ethernet ports */
    4755 -       get_mac(prom_mac_addr_base);
    4756 -#endif
    4757 -
    4758  #ifndef CONFIG_64BIT
    4759         debug_vectors->printf("Booting Linux kernel...\n");
    4760  #endif
    4761 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_3/setup.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/setup.c
    4762 --- linux-2.6.18.3/arch/mips/momentum/ocelot_3/setup.c  2006-11-18 19:28:22.000000000 -0800
    4763 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_3/setup.c     2006-11-20 10:09:08.000000000 -0800
    4764 @@ -4,7 +4,7 @@
    4765   * BRIEF MODULE DESCRIPTION
    4766   * Momentum Computer Ocelot-3 board dependent boot routines
    4767   *
    4768 - * Copyright (C) 1996, 1997, 01, 05  Ralf Baechle
    4769 + * Copyright (C) 1996, 1997, 01, 05 - 06  Ralf Baechle
    4770   * Copyright (C) 2000 RidgeRun, Inc.
    4771   * Copyright (C) 2001 Red Hat, Inc.
    4772   * Copyright (C) 2002 Momentum Computer
    4773 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_c/Makefile linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/Makefile
    4774 --- linux-2.6.18.3/arch/mips/momentum/ocelot_c/Makefile 2006-11-18 19:28:22.000000000 -0800
    4775 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/Makefile    2006-11-20 10:09:08.000000000 -0800
    4776 @@ -2,7 +2,7 @@
    4777  # Makefile for Momentum Computer's Ocelot-C and -CS boards.
    4778  #
    4779  
    4780 -obj-y                  += cpci-irq.o irq.o prom.o reset.o \
    4781 +obj-y                  += cpci-irq.o irq.o platform.o prom.o reset.o \
    4782                            setup.o uart-irq.o
    4783  
    4784  obj-$(CONFIG_KGDB)     += dbg_io.o
    4785 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
    4786 --- linux-2.6.18.3/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h  2006-11-18 19:28:22.000000000 -0800
    4787 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h     2006-11-20 10:09:08.000000000 -0800
    4788 @@ -53,7 +53,9 @@
    4789  #define OCELOT_C_REG_INTSET            0xe
    4790  #define OCELOT_C_REG_INTCLR            0xf
    4791  
    4792 -#define OCELOT_FPGA_WRITE(x, y) writeb(x, OCELOT_C_CS0_ADDR + OCELOT_C_REG_##y)
    4793 -#define OCELOT_FPGA_READ(x) readb(OCELOT_C_CS0_ADDR + OCELOT_C_REG_##x)
    4794 +#define __FPGA_REG_TO_ADDR(reg)                                                \
    4795 +       ((void *) OCELOT_C_CS0_ADDR + OCELOT_C_REG_##reg)
    4796 +#define OCELOT_FPGA_WRITE(x, reg) writeb(x, __FPGA_REG_TO_ADDR(reg))
    4797 +#define OCELOT_FPGA_READ(reg) readb(__FPGA_REG_TO_ADDR(reg))
    4798  
    4799  #endif
    4800 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_c/platform.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/platform.c
    4801 --- linux-2.6.18.3/arch/mips/momentum/ocelot_c/platform.c       1969-12-31 16:00:00.000000000 -0800
    4802 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/platform.c  2006-11-20 10:09:08.000000000 -0800
    4803 @@ -0,0 +1,201 @@
    4804 +#include <linux/delay.h>
    4805 +#include <linux/if_ether.h>
    4806 +#include <linux/ioport.h>
    4807 +#include <linux/mv643xx.h>
    4808 +#include <linux/platform_device.h>
    4809 +
    4810 +#include "ocelot_c_fpga.h"
    4811 +
    4812 +#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
    4813 +
    4814 +static struct resource mv643xx_eth_shared_resources[] = {
    4815 +       [0] = {
    4816 +               .name   = "ethernet shared base",
    4817 +               .start  = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
    4818 +               .end    = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
    4819 +                                      MV643XX_ETH_SHARED_REGS_SIZE - 1,
    4820 +               .flags  = IORESOURCE_MEM,
    4821 +       },
    4822 +};
    4823 +
    4824 +static struct platform_device mv643xx_eth_shared_device = {
    4825 +       .name           = MV643XX_ETH_SHARED_NAME,
    4826 +       .id             = 0,
    4827 +       .num_resources  = ARRAY_SIZE(mv643xx_eth_shared_resources),
    4828 +       .resource       = mv643xx_eth_shared_resources,
    4829 +};
    4830 +
    4831 +#define MV_SRAM_BASE                   0xfe000000UL
    4832 +#define MV_SRAM_SIZE                   (256 * 1024)
    4833 +
    4834 +#define MV_SRAM_RXRING_SIZE            (MV_SRAM_SIZE / 4)
    4835 +#define MV_SRAM_TXRING_SIZE            (MV_SRAM_SIZE / 4)
    4836 +
    4837 +#define MV_SRAM_BASE_ETH0              MV_SRAM_BASE
    4838 +#define MV_SRAM_BASE_ETH1              (MV_SRAM_BASE + (MV_SRAM_SIZE / 2))
    4839 +
    4840 +#define MV64x60_IRQ_ETH_0 48
    4841 +#define MV64x60_IRQ_ETH_1 49
    4842 +
    4843 +#ifdef CONFIG_MV643XX_ETH_0
    4844 +
    4845 +static struct resource mv64x60_eth0_resources[] = {
    4846 +       [0] = {
    4847 +               .name   = "eth0 irq",
    4848 +               .start  = MV64x60_IRQ_ETH_0,
    4849 +               .end    = MV64x60_IRQ_ETH_0,
    4850 +               .flags  = IORESOURCE_IRQ,
    4851 +       },
    4852 +};
    4853 +
    4854 +static char eth0_mac_addr[ETH_ALEN];
    4855 +
    4856 +static struct mv643xx_eth_platform_data eth0_pd = {
    4857 +       .mac_addr       = eth0_mac_addr,
    4858 +
    4859 +       .tx_sram_addr   = MV_SRAM_BASE_ETH0,
    4860 +       .tx_sram_size   = MV_SRAM_TXRING_SIZE,
    4861 +       .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
    4862 +
    4863 +       .rx_sram_addr   = MV_SRAM_BASE_ETH0 + MV_SRAM_TXRING_SIZE,
    4864 +       .rx_sram_size   = MV_SRAM_RXRING_SIZE,
    4865 +       .rx_queue_size  = MV_SRAM_RXRING_SIZE / 16,
    4866 +};
    4867 +
    4868 +static struct platform_device eth0_device = {
    4869 +       .name           = MV643XX_ETH_NAME,
    4870 +       .id             = 0,
    4871 +       .num_resources  = ARRAY_SIZE(mv64x60_eth0_resources),
    4872 +       .resource       = mv64x60_eth0_resources,
    4873 +       .dev = {
    4874 +               .platform_data = &eth0_pd,
    4875 +       },
    4876 +};
    4877 +#endif /* CONFIG_MV643XX_ETH_0 */
    4878 +
    4879 +#ifdef CONFIG_MV643XX_ETH_1
    4880 +
    4881 +static struct resource mv64x60_eth1_resources[] = {
    4882 +       [0] = {
    4883 +               .name   = "eth1 irq",
    4884 +               .start  = MV64x60_IRQ_ETH_1,
    4885 +               .end    = MV64x60_IRQ_ETH_1,
    4886 +               .flags  = IORESOURCE_IRQ,
    4887 +       },
    4888 +};
    4889 +
    4890 +static char eth1_mac_addr[ETH_ALEN];
    4891 +
    4892 +static struct mv643xx_eth_platform_data eth1_pd = {
    4893 +       .mac_addr       = eth1_mac_addr,
    4894 +
    4895 +       .tx_sram_addr   = MV_SRAM_BASE_ETH1,
    4896 +       .tx_sram_size   = MV_SRAM_TXRING_SIZE,
    4897 +       .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
    4898 +
    4899 +       .rx_sram_addr   = MV_SRAM_BASE_ETH1 + MV_SRAM_TXRING_SIZE,
    4900 +       .rx_sram_size   = MV_SRAM_RXRING_SIZE,
    4901 +       .rx_queue_size  = MV_SRAM_RXRING_SIZE / 16,
    4902 +};
    4903 +
    4904 +static struct platform_device eth1_device = {
    4905 +       .name           = MV643XX_ETH_NAME,
    4906 +       .id             = 1,
    4907 +       .num_resources  = ARRAY_SIZE(mv64x60_eth1_resources),
    4908 +       .resource       = mv64x60_eth1_resources,
    4909 +       .dev = {
    4910 +               .platform_data = &eth1_pd,
    4911 +       },
    4912 +};
    4913 +#endif /* CONFIG_MV643XX_ETH_1 */
    4914 +
    4915 +static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
    4916 +       &mv643xx_eth_shared_device,
    4917 +#ifdef CONFIG_MV643XX_ETH_0
    4918 +       &eth0_device,
    4919 +#endif
    4920 +#ifdef CONFIG_MV643XX_ETH_1
    4921 +       &eth1_device,
    4922 +#endif
    4923 +       /* The third port is not wired up on the Ocelot C */
    4924 +};
    4925 +
    4926 +static u8 __init exchange_bit(u8 val, u8 cs)
    4927 +{
    4928 +       /* place the data */
    4929 +       OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
    4930 +       udelay(1);
    4931 +
    4932 +       /* turn the clock on */
    4933 +       OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
    4934 +       udelay(1);
    4935 +
    4936 +       /* turn the clock off and read-strobe */
    4937 +       OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
    4938 +
    4939 +       /* return the data */
    4940 +       return (OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1;
    4941 +}
    4942 +
    4943 +static void __init get_mac(char dest[6])
    4944 +{
    4945 +       u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    4946 +       int i,j;
    4947 +
    4948 +       for (i = 0; i < 12; i++)
    4949 +               exchange_bit(read_opcode[i], 1);
    4950 +
    4951 +       for (j = 0; j < 6; j++) {
    4952 +               dest[j] = 0;
    4953 +               for (i = 0; i < 8; i++) {
    4954 +                       dest[j] <<= 1;
    4955 +                       dest[j] |= exchange_bit(0, 1);
    4956 +               }
    4957 +       }
    4958 +
    4959 +       /* turn off CS */
    4960 +       exchange_bit(0,0);
    4961 +}
    4962 +
    4963 +/*
    4964 + * Copy and increment ethernet MAC address by a small value.
    4965 + *
    4966 + * This is useful for systems where the only one MAC address is stored in
    4967 + * non-volatile memory for multiple ports.
    4968 + */
    4969 +static inline void eth_mac_add(unsigned char *dst, unsigned char *src,
    4970 +       unsigned int add)
    4971 +{
    4972 +       int i;
    4973 +
    4974 +       BUG_ON(add >= 256);
    4975 +
    4976 +       for (i = ETH_ALEN; i >= 0; i--) {
    4977 +               dst[i] = src[i] + add;
    4978 +               add = dst[i] < src[i];          /* compute carry */
    4979 +       }
    4980 +
    4981 +       WARN_ON(add);
    4982 +}
    4983 +
    4984 +static int __init mv643xx_eth_add_pds(void)
    4985 +{
    4986 +       unsigned char mac[ETH_ALEN];
    4987 +       int ret;
    4988 +
    4989 +       get_mac(mac);
    4990 +#ifdef CONFIG_MV643XX_ETH_0
    4991 +       eth_mac_add(eth1_mac_addr, mac, 0);
    4992 +#endif
    4993 +#ifdef CONFIG_MV643XX_ETH_1
    4994 +       eth_mac_add(eth1_mac_addr, mac, 1);
    4995 +#endif
    4996 +       ret = platform_add_devices(mv643xx_eth_pd_devs,
    4997 +                       ARRAY_SIZE(mv643xx_eth_pd_devs));
    4998 +
    4999 +       return ret;
    5000 +}
    5001 +
    5002 +device_initcall(mv643xx_eth_add_pds);
    5003 +
    5004 +#endif /* defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) */
    5005 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_c/prom.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/prom.c
    5006 --- linux-2.6.18.3/arch/mips/momentum/ocelot_c/prom.c   2006-11-18 19:28:22.000000000 -0800
    5007 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/prom.c      2006-11-20 10:09:08.000000000 -0800
    5008 @@ -29,11 +29,7 @@
    5009  struct callvectors* debug_vectors;
    5010  
    5011  extern unsigned long marvell_base;
    5012 -extern unsigned long cpu_clock;
    5013 -
    5014 -#ifdef CONFIG_MV643XX_ETH
    5015 -extern unsigned char prom_mac_addr_base[6];
    5016 -#endif
    5017 +extern unsigned int cpu_clock;
    5018  
    5019  const char *get_system_type(void)
    5020  {
    5021 @@ -44,55 +40,6 @@
    5022  #endif
    5023  }
    5024  
    5025 -#ifdef CONFIG_MV643XX_ETH
    5026 -static void burn_clocks(void)
    5027 -{
    5028 -       int i;
    5029 -
    5030 -       /* this loop should burn at least 1us -- this should be plenty */
    5031 -       for (i = 0; i < 0x10000; i++)
    5032 -               ;
    5033 -}
    5034 -
    5035 -static u8 exchange_bit(u8 val, u8 cs)
    5036 -{
    5037 -       /* place the data */
    5038 -       OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
    5039 -       burn_clocks();
    5040 -
    5041 -       /* turn the clock on */
    5042 -       OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
    5043 -       burn_clocks();
    5044 -
    5045 -       /* turn the clock off and read-strobe */
    5046 -       OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
    5047 -
    5048 -       /* return the data */
    5049 -       return ((OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);
    5050 -}
    5051 -
    5052 -void get_mac(char dest[6])
    5053 -{
    5054 -       u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    5055 -       int i,j;
    5056 -
    5057 -       for (i = 0; i < 12; i++)
    5058 -               exchange_bit(read_opcode[i], 1);
    5059 -
    5060 -       for (j = 0; j < 6; j++) {
    5061 -               dest[j] = 0;
    5062 -               for (i = 0; i < 8; i++) {
    5063 -                       dest[j] <<= 1;
    5064 -                       dest[j] |= exchange_bit(0, 1);
    5065 -               }
    5066 -       }
    5067 -
    5068 -       /* turn off CS */
    5069 -       exchange_bit(0,0);
    5070 -}
    5071 -#endif
    5072 -
    5073 -
    5074  #ifdef CONFIG_64BIT
    5075  
    5076  unsigned long signext(unsigned long addr)
    5077 @@ -226,11 +173,6 @@
    5078         mips_machgroup = MACH_GROUP_MOMENCO;
    5079         mips_machtype = MACH_MOMENCO_OCELOT_C;
    5080  
    5081 -#ifdef CONFIG_MV643XX_ETH
    5082 -       /* get the base MAC address for on-board ethernet ports */
    5083 -       get_mac(prom_mac_addr_base);
    5084 -#endif
    5085 -
    5086  #ifndef CONFIG_64BIT
    5087         debug_vectors->printf("Booting Linux kernel...\n");
    5088  #endif
    5089 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_c/setup.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/setup.c
    5090 --- linux-2.6.18.3/arch/mips/momentum/ocelot_c/setup.c  2006-11-18 19:28:22.000000000 -0800
    5091 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_c/setup.c     2006-11-20 10:09:08.000000000 -0800
    5092 @@ -70,8 +70,7 @@
    5093  #include "ocelot_c_fpga.h"
    5094  
    5095  unsigned long marvell_base;
    5096 -extern unsigned long mv64340_sram_base;
    5097 -unsigned long cpu_clock;
    5098 +unsigned int cpu_clock;
    5099  
    5100  /* These functions are used for rebooting or halting the machine*/
    5101  extern void momenco_ocelot_restart(char *command);
    5102 @@ -120,7 +119,6 @@
    5103         add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfffffffffe000000, PM_16M);
    5104  
    5105         marvell_base = 0xfffffffff4000000;
    5106 -       mv64340_sram_base = 0xfffffffffe000000;
    5107  #else
    5108         /* marvell and extra space */
    5109         add_wired_entry(ENTRYLO(0xf4000000), ENTRYLO(0xf4010000), 0xf4000000, PM_64K);
    5110 @@ -130,7 +128,6 @@
    5111         add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfe000000, PM_16M);
    5112  
    5113         marvell_base = 0xf4000000;
    5114 -       mv64340_sram_base = 0xfe000000;
    5115  #endif
    5116  }
    5117  
    5118 @@ -347,22 +344,20 @@
    5119         }
    5120  }
    5121  
    5122 -#ifndef CONFIG_64BIT
    5123 -/* This needs to be one of the first initcalls, because no I/O port access
    5124 -   can work before this */
    5125 +/*
    5126 + * This needs to be one of the first initcalls, because no I/O port access
    5127 + * can work before this
    5128 + */
    5129  static int io_base_ioremap(void)
    5130  {
    5131 -       /* we're mapping PCI accesses from 0xc0000000 to 0xf0000000 */
    5132 -       void *io_remap_range = ioremap(0xc0000000, 0x30000000);
    5133 +       void __iomem * io_remap_range = ioremap(0xc0000000UL, 0x10000);
    5134  
    5135 -       if (!io_remap_range) {
    5136 +       if (!io_remap_range)
    5137                 panic("Could not ioremap I/O port range");
    5138 -       }
    5139 -       printk("io_remap_range set at 0x%08x\n", (uint32_t)io_remap_range);
    5140 -       set_io_port_base(io_remap_range - 0xc0000000);
    5141 +
    5142 +       set_io_port_base((unsigned long) io_remap_range);
    5143  
    5144         return 0;
    5145  }
    5146  
    5147  module_init(io_base_ioremap);
    5148 -#endif
    5149 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_g/gt-irq.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_g/gt-irq.c
    5150 --- linux-2.6.18.3/arch/mips/momentum/ocelot_g/gt-irq.c 2006-11-18 19:28:22.000000000 -0800
    5151 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_g/gt-irq.c    2006-11-20 10:09:08.000000000 -0800
    5152 @@ -28,7 +28,7 @@
    5153   * be handled and ack'ed differently than other MIPS interrupts.
    5154   */
    5155  
    5156 -#if CURRENTLY_UNUSED
    5157 +#if 0
    5158  
    5159  struct tq_struct irq_handlers[MAX_CAUSE_REGS][MAX_CAUSE_REG_WIDTH];
    5160  void hook_irq_handler(int int_cause, int bit_num, void *isr_ptr);
    5161 @@ -96,7 +96,7 @@
    5162                 return 0;
    5163         return 1;
    5164  }
    5165 -#endif                         /*  UNUSED  */
    5166 +#endif /* 0 */
    5167  
    5168  /*
    5169   * Interrupt handler for interrupts coming from the Galileo chip via P0_INT#.
    5170 @@ -197,7 +197,7 @@
    5171  
    5172  void gt64240_irq_init(void)
    5173  {
    5174 -#if CURRENTLY_UNUSED
    5175 +#if 0
    5176         int i, j;
    5177  
    5178         /* Reset irq handlers pointers to NULL */
    5179 @@ -209,5 +209,5 @@
    5180                         irq_handlers[i][j].data = NULL;
    5181                 }
    5182         }
    5183 -#endif
    5184 +#endif /* 0 */
    5185  }
    5186 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_g/ocelot_pld.h linux-mips-2.6.18.3/arch/mips/momentum/ocelot_g/ocelot_pld.h
    5187 --- linux-2.6.18.3/arch/mips/momentum/ocelot_g/ocelot_pld.h     2006-11-18 19:28:22.000000000 -0800
    5188 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_g/ocelot_pld.h        2006-11-20 10:09:08.000000000 -0800
    5189 @@ -23,8 +23,8 @@
    5190  #define OCELOT_REG_INTSET (12)
    5191  #define OCELOT_REG_INTCLR (13)
    5192  
    5193 -#define OCELOT_PLD_WRITE(x, y) writeb(x, OCELOT_CS0_ADDR + OCELOT_REG_##y)
    5194 -#define OCELOT_PLD_READ(x) readb(OCELOT_CS0_ADDR + OCELOT_REG_##x)
    5195 -
    5196 +#define __PLD_REG_TO_ADDR(reg) ((void *) OCELOT_CS0_ADDR + OCELOT_REG_##reg)
    5197 +#define OCELOT_PLD_WRITE(x, reg) writeb(x, __PLD_REG_TO_ADDR(reg))
    5198 +#define OCELOT_PLD_READ(reg) readb(__PLD_REG_TO_ADDR(reg))
    5199  
    5200  #endif /* __MOMENCO_OCELOT_PLD_H__ */
    5201 diff -Naur linux-2.6.18.3/arch/mips/momentum/ocelot_g/setup.c linux-mips-2.6.18.3/arch/mips/momentum/ocelot_g/setup.c
    5202 --- linux-2.6.18.3/arch/mips/momentum/ocelot_g/setup.c  2006-11-18 19:28:22.000000000 -0800
    5203 +++ linux-mips-2.6.18.3/arch/mips/momentum/ocelot_g/setup.c     2006-11-20 10:09:08.000000000 -0800
    5204 @@ -57,6 +57,7 @@
    5205  #include <asm/gt64240.h>
    5206  #include <asm/irq.h>
    5207  #include <asm/pci.h>
    5208 +#include <asm/pgtable.h>
    5209  #include <asm/processor.h>
    5210  #include <asm/ptrace.h>
    5211  #include <asm/reboot.h>
    5212 @@ -161,6 +162,10 @@
    5213         printk("Done\n");
    5214  }
    5215  
    5216 +void __init plat_timer_setup(struct irqaction *irq)
    5217 +{
    5218 +}
    5219 +
    5220  void __init plat_mem_setup(void)
    5221  {
    5222         void (*l3func)(unsigned long) = (void *) KSEG1ADDR(setup_l3cache);
    5223 diff -Naur linux-2.6.18.3/arch/mips/oprofile/op_model_mipsxx.c linux-mips-2.6.18.3/arch/mips/oprofile/op_model_mipsxx.c
    5224 --- linux-2.6.18.3/arch/mips/oprofile/op_model_mipsxx.c 2006-11-18 19:28:22.000000000 -0800
    5225 +++ linux-mips-2.6.18.3/arch/mips/oprofile/op_model_mipsxx.c    2006-11-20 10:09:08.000000000 -0800
    5226 @@ -30,16 +30,18 @@
    5227  #define M_COUNTER_OVERFLOW             (1UL      << 31)
    5228  
    5229  #ifdef CONFIG_MIPS_MT_SMP
    5230 -#define WHAT   (M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
    5231 +#define WHAT           (M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
    5232 +#define vpe_id()       smp_processor_id()
    5233  #else
    5234 -#define WHAT   0
    5235 +#define WHAT           0
    5236 +#define vpe_id()       smp_processor_id()
    5237  #endif
    5238  
    5239  #define __define_perf_accessors(r, n, np)                              \
    5240                                                                         \
    5241  static inline unsigned int r_c0_ ## r ## n(void)                       \
    5242  {                                                                      \
    5243 -       unsigned int cpu = smp_processor_id();                          \
    5244 +       unsigned int cpu = vpe_id();                                    \
    5245                                                                         \
    5246         switch (cpu) {                                                  \
    5247         case 0:                                                         \
    5248 @@ -54,7 +56,7 @@
    5249                                                                         \
    5250  static inline void w_c0_ ## r ## n(unsigned int value)                 \
    5251  {                                                                      \
    5252 -       unsigned int cpu = smp_processor_id();                          \
    5253 +       unsigned int cpu = vpe_id();                                    \
    5254                                                                         \
    5255         switch (cpu) {                                                  \
    5256         case 0:                                                         \
    5257 @@ -217,7 +219,7 @@
    5258  {
    5259         int counters = __n_counters();
    5260  
    5261 -#ifndef CONFIG_SMP
    5262 +#ifdef CONFIG_MIPS_MT_SMP
    5263         if (current_cpu_data.cputype == CPU_34K)
    5264                 return counters >> 1;
    5265  #endif
    5266 diff -Naur linux-2.6.18.3/arch/mips/pci/Makefile linux-mips-2.6.18.3/arch/mips/pci/Makefile
    5267 --- linux-2.6.18.3/arch/mips/pci/Makefile       2006-11-18 19:28:22.000000000 -0800
    5268 +++ linux-mips-2.6.18.3/arch/mips/pci/Makefile  2006-11-20 10:09:08.000000000 -0800
    5269 @@ -28,7 +28,7 @@
    5270  obj-$(CONFIG_LASAT)            += pci-lasat.o
    5271  obj-$(CONFIG_MIPS_ATLAS)       += fixup-atlas.o
    5272  obj-$(CONFIG_MIPS_COBALT)      += fixup-cobalt.o
    5273 -obj-$(CONFIG_MIPS_EV96100)     += fixup-ev64120.o
    5274 +obj-$(CONFIG_MIPS_EV64120)     += pci-ev64120.o
    5275  obj-$(CONFIG_MIPS_EV96100)     += fixup-ev96100.o pci-ev96100.o
    5276  obj-$(CONFIG_MIPS_ITE8172)     += fixup-ite8172g.o
    5277  obj-$(CONFIG_MIPS_IVR)         += fixup-ivr.o
    5278 diff -Naur linux-2.6.18.3/arch/mips/pci/fixup-atlas.c linux-mips-2.6.18.3/arch/mips/pci/fixup-atlas.c
    5279 --- linux-2.6.18.3/arch/mips/pci/fixup-atlas.c  2006-11-18 19:28:22.000000000 -0800
    5280 +++ linux-mips-2.6.18.3/arch/mips/pci/fixup-atlas.c     2006-11-20 10:09:08.000000000 -0800
    5281 @@ -21,16 +21,16 @@
    5282  
    5283  #include <asm/mips-boards/atlasint.h>
    5284  
    5285 -#define PCIA           ATLASINT_PCIA
    5286 -#define PCIB           ATLASINT_PCIB
    5287 -#define PCIC           ATLASINT_PCIC
    5288 -#define PCID           ATLASINT_PCID
    5289 -#define INTA           ATLASINT_INTA
    5290 -#define INTB           ATLASINT_INTB
    5291 -#define ETH            ATLASINT_ETH
    5292 -#define INTC           ATLASINT_INTC
    5293 -#define SCSI           ATLASINT_SCSI
    5294 -#define INTD           ATLASINT_INTD
    5295 +#define PCIA           ATLAS_INT_PCIA
    5296 +#define PCIB           ATLAS_INT_PCIB
    5297 +#define PCIC           ATLAS_INT_PCIC
    5298 +#define PCID           ATLAS_INT_PCID
    5299 +#define INTA           ATLAS_INT_INTA
    5300 +#define INTB           ATLAS_INT_INTB
    5301 +#define ETH            ATLAS_INT_ETH
    5302 +#define INTC           ATLAS_INT_INTC
    5303 +#define SCSI           ATLAS_INT_SCSI
    5304 +#define INTD           ATLAS_INT_INTD
    5305  
    5306  static char irq_tab[][5] __initdata = {
    5307         /*      INTA    INTB    INTC    INTD */
    5308 diff -Naur linux-2.6.18.3/arch/mips/pci/fixup-ev64120.c linux-mips-2.6.18.3/arch/mips/pci/fixup-ev64120.c
    5309 --- linux-2.6.18.3/arch/mips/pci/fixup-ev64120.c        2006-11-18 19:28:22.000000000 -0800
    5310 +++ linux-mips-2.6.18.3/arch/mips/pci/fixup-ev64120.c   1969-12-31 16:00:00.000000000 -0800
    5311 @@ -1,34 +0,0 @@
    5312 -#include <linux/pci.h>
    5313 -#include <linux/init.h>
    5314 -
    5315 -int pci_range_ck(unsigned char bus, unsigned char dev)
    5316 -{
    5317 -       if (((bus == 0) || (bus == 1)) && (dev >= 6) && (dev <= 8))
    5318 -               return 0;
    5319 -
    5320 -       return -1;
    5321 -}
    5322 -
    5323 -/*
    5324 - * After detecting all agents over the PCI , this function is called
    5325 - * in order to give an interrupt number for each PCI device starting
    5326 - * from IRQ 20. It does also enables master for each device.
    5327 - */
    5328 -void __devinit pcibios_fixup_bus(struct pci_bus *bus)
    5329 -{
    5330 -       unsigned int irq = 20;
    5331 -       struct pci_bus *current_bus = bus;
    5332 -       struct pci_dev *dev;
    5333 -       struct list_head *devices_link;
    5334 -
    5335 -       list_for_each(devices_link, &(current_bus->devices)) {
    5336 -               dev = pci_dev_b(devices_link);
    5337 -               if (dev != NULL) {
    5338 -                       dev->irq = irq++;
    5339 -
    5340 -                       /* Assign an interrupt number for the device */
    5341 -                       pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
    5342 -                       pcibios_set_master(dev);
    5343 -               }
    5344 -       }
    5345 -}
    5346 diff -Naur linux-2.6.18.3/arch/mips/pci/fixup-tb0219.c linux-mips-2.6.18.3/arch/mips/pci/fixup-tb0219.c
    5347 --- linux-2.6.18.3/arch/mips/pci/fixup-tb0219.c 2006-11-18 19:28:22.000000000 -0800
    5348 +++ linux-mips-2.6.18.3/arch/mips/pci/fixup-tb0219.c    2006-11-20 10:09:08.000000000 -0800
     1455diff -Naur linux-2.6.19/arch/mips/pci/fixup-tb0219.c linux-mips-2.6.19/arch/mips/pci/fixup-tb0219.c
     1456--- linux-2.6.19/arch/mips/pci/fixup-tb0219.c   2006-11-29 13:57:37.000000000 -0800
     1457+++ linux-mips-2.6.19/arch/mips/pci/fixup-tb0219.c      2006-11-29 15:23:09.000000000 -0800
    53491458@@ -2,7 +2,7 @@
    53501459  *  fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups.
     
    53561465  *  This program is free software; you can redistribute it and/or modify
    53571466  *  it under the terms of the GNU General Public License as published by
    5358 diff -Naur linux-2.6.18.3/arch/mips/pci/ops-au1000.c linux-mips-2.6.18.3/arch/mips/pci/ops-au1000.c
    5359 --- linux-2.6.18.3/arch/mips/pci/ops-au1000.c   2006-11-18 19:28:22.000000000 -0800
    5360 +++ linux-mips-2.6.18.3/arch/mips/pci/ops-au1000.c      2006-11-20 10:09:08.000000000 -0800
    5361 @@ -110,7 +110,7 @@
    5362         if (first_cfg) {
    5363                 /* reserve a wired entry for pci config accesses */
    5364                 first_cfg = 0;
    5365 -               pci_cfg_vm = get_vm_area(0x2000, 0);
    5366 +               pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
    5367                 if (!pci_cfg_vm)
    5368                         panic (KERN_ERR "PCI unable to get vm area\n");
    5369                 pci_cfg_wired_entry = read_c0_wired();
    5370 diff -Naur linux-2.6.18.3/arch/mips/pci/pci-ev64120.c linux-mips-2.6.18.3/arch/mips/pci/pci-ev64120.c
    5371 --- linux-2.6.18.3/arch/mips/pci/pci-ev64120.c  1969-12-31 16:00:00.000000000 -0800
    5372 +++ linux-mips-2.6.18.3/arch/mips/pci/pci-ev64120.c     2006-11-20 10:09:08.000000000 -0800
    5373 @@ -0,0 +1,21 @@
    5374 +#include <linux/pci.h>
    5375 +
    5376 +int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
    5377 +{
    5378 +       int irq;
    5379 +
    5380 +       if (!pin)
    5381 +               return 0;
    5382 +
    5383 +       irq = allocate_irqno();
    5384 +       if (irq < 0)
    5385 +               return 0;
    5386 +
    5387 +       return irq;
    5388 +}
    5389 +
    5390 +/* Do platform specific device initialization at pci_enable_device() time */
    5391 +int pcibios_plat_dev_init(struct pci_dev *dev)
    5392 +{
    5393 +       return 0;
    5394 +}
    5395 diff -Naur linux-2.6.18.3/arch/mips/qemu/Makefile linux-mips-2.6.18.3/arch/mips/qemu/Makefile
    5396 --- linux-2.6.18.3/arch/mips/qemu/Makefile      2006-11-18 19:28:22.000000000 -0800
    5397 +++ linux-mips-2.6.18.3/arch/mips/qemu/Makefile 2006-11-20 10:09:08.000000000 -0800
     1467diff -Naur linux-2.6.19/arch/mips/qemu/Makefile linux-mips-2.6.19/arch/mips/qemu/Makefile
     1468--- linux-2.6.19/arch/mips/qemu/Makefile        2006-11-29 13:57:37.000000000 -0800
     1469+++ linux-mips-2.6.19/arch/mips/qemu/Makefile   2006-11-29 15:23:09.000000000 -0800
    53981470@@ -4,4 +4,5 @@
    53991471 
     
    54021474+obj-$(CONFIG_VT) += q-vga.o
    54031475 obj-$(CONFIG_SMP) += q-smp.o
    5404 diff -Naur linux-2.6.18.3/arch/mips/qemu/q-setup.c linux-mips-2.6.18.3/arch/mips/qemu/q-setup.c
    5405 --- linux-2.6.18.3/arch/mips/qemu/q-setup.c     2006-11-18 19:28:22.000000000 -0800
    5406 +++ linux-mips-2.6.18.3/arch/mips/qemu/q-setup.c        2006-11-20 10:09:08.000000000 -0800
     1476diff -Naur linux-2.6.19/arch/mips/qemu/q-setup.c linux-mips-2.6.19/arch/mips/qemu/q-setup.c
     1477--- linux-2.6.19/arch/mips/qemu/q-setup.c       2006-11-29 13:57:37.000000000 -0800
     1478+++ linux-mips-2.6.19/arch/mips/qemu/q-setup.c  2006-11-29 15:23:09.000000000 -0800
    54071479@@ -2,6 +2,7 @@
    54081480 #include <asm/io.h>
     
    54231495        qemu_reboot_setup();
    54241496 }
    5425 diff -Naur linux-2.6.18.3/arch/mips/qemu/q-vga.c linux-mips-2.6.18.3/arch/mips/qemu/q-vga.c
    5426 --- linux-2.6.18.3/arch/mips/qemu/q-vga.c       1969-12-31 16:00:00.000000000 -0800
    5427 +++ linux-mips-2.6.18.3/arch/mips/qemu/q-vga.c  2006-11-20 10:09:08.000000000 -0800
     1497diff -Naur linux-2.6.19/arch/mips/qemu/q-vga.c linux-mips-2.6.19/arch/mips/qemu/q-vga.c
     1498--- linux-2.6.19/arch/mips/qemu/q-vga.c 1969-12-31 16:00:00.000000000 -0800
     1499+++ linux-mips-2.6.19/arch/mips/qemu/q-vga.c    2006-11-29 15:23:09.000000000 -0800
    54281500@@ -0,0 +1,189 @@
    54291501+/*
     
    55661638+       int i;
    55671639+
    5568 +#if LOAD_VGA_FONT
     1640+#ifdef LOAD_VGA_FONT
    55691641+       qvga_load_font(vgafont16, 4096);
    55701642+#endif
     
    56161688+#endif
    56171689+}
    5618 diff -Naur linux-2.6.18.3/arch/mips/sgi-ip27/ip27-irq.c linux-mips-2.6.18.3/arch/mips/sgi-ip27/ip27-irq.c
    5619 --- linux-2.6.18.3/arch/mips/sgi-ip27/ip27-irq.c        2006-11-18 19:28:22.000000000 -0800
    5620 +++ linux-mips-2.6.18.3/arch/mips/sgi-ip27/ip27-irq.c   2006-11-20 10:09:08.000000000 -0800
    5621 @@ -355,29 +355,6 @@
    5622         .end            = end_bridge_irq,
    5623  };
    5624  
    5625 -static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
    5626 -
    5627 -int allocate_irqno(void)
    5628 -{
    5629 -       int irq;
    5630 -
    5631 -again:
    5632 -       irq = find_first_zero_bit(irq_map, NR_IRQS);
    5633 -
    5634 -       if (irq >= NR_IRQS)
    5635 -               return -ENOSPC;
    5636 -
    5637 -       if (test_and_set_bit(irq, irq_map))
    5638 -               goto again;
    5639 -
    5640 -       return irq;
    5641 -}
    5642 -
    5643 -void free_irqno(unsigned int irq)
    5644 -{
    5645 -       clear_bit(irq, irq_map);
    5646 -}
    5647 -
    5648  void __devinit register_bridge_irq(unsigned int irq)
    5649  {
    5650         irq_desc[irq].status    = IRQ_DISABLED;
    5651 diff -Naur linux-2.6.18.3/arch/mips/sgi-ip27/ip27-timer.c linux-mips-2.6.18.3/arch/mips/sgi-ip27/ip27-timer.c
    5652 --- linux-2.6.18.3/arch/mips/sgi-ip27/ip27-timer.c      2006-11-18 19:28:22.000000000 -0800
    5653 +++ linux-mips-2.6.18.3/arch/mips/sgi-ip27/ip27-timer.c 2006-11-20 10:09:08.000000000 -0800
    5654 @@ -223,8 +223,6 @@
    5655         .name           = "timer"
    5656  };
    5657  
    5658 -extern int allocate_irqno(void);
    5659 -
    5660  void __init plat_timer_setup(struct irqaction *irq)
    5661  {
    5662         int irqno  = allocate_irqno();
    5663 diff -Naur linux-2.6.18.3/arch/mips/sibyte/bcm1480/irq.c linux-mips-2.6.18.3/arch/mips/sibyte/bcm1480/irq.c
    5664 --- linux-2.6.18.3/arch/mips/sibyte/bcm1480/irq.c       2006-11-18 19:28:22.000000000 -0800
    5665 +++ linux-mips-2.6.18.3/arch/mips/sibyte/bcm1480/irq.c  2006-11-20 10:09:08.000000000 -0800
    5666 @@ -469,21 +469,6 @@
    5667  
    5668  #endif         /* CONFIG_KGDB */
    5669  
    5670 -static inline int dclz(unsigned long long x)
    5671 -{
    5672 -       int lz;
    5673 -
    5674 -       __asm__ (
    5675 -       "       .set    push                                            \n"
    5676 -       "       .set    mips64                                          \n"
    5677 -       "       dclz    %0, %1                                          \n"
    5678 -       "       .set    pop                                             \n"
    5679 -       : "=r" (lz)
    5680 -       : "r" (x));
    5681 -
    5682 -       return lz;
    5683 -}
    5684 -
    5685  extern void bcm1480_timer_interrupt(struct pt_regs *regs);
    5686  extern void bcm1480_mailbox_interrupt(struct pt_regs *regs);
    5687  extern void bcm1480_kgdb_interrupt(struct pt_regs *regs);
    5688 @@ -497,7 +482,7 @@
    5689         write_c0_compare(read_c0_count());
    5690  #endif
    5691  
    5692 -       pending = read_c0_cause();
    5693 +       pending = read_c0_cause() & read_c0_status();
    5694  
    5695  #ifdef CONFIG_SIBYTE_BCM1480_PROF
    5696         if (pending & CAUSEF_IP7)       /* Cpu performance counter interrupt */
    5697 @@ -536,9 +521,9 @@
    5698  
    5699                 if (mask_h) {
    5700                         if (mask_h ^ 1)
    5701 -                               do_IRQ(63 - dclz(mask_h), regs);
    5702 +                               do_IRQ(fls64(mask_h) - 1, regs);
    5703                         else
    5704 -                               do_IRQ(127 - dclz(mask_l), regs);
    5705 +                               do_IRQ(63 + fls64(mask_l), regs);
    5706                 }
    5707         }
    5708  }
    5709 diff -Naur linux-2.6.18.3/arch/mips/sibyte/bcm1480/smp.c linux-mips-2.6.18.3/arch/mips/sibyte/bcm1480/smp.c
    5710 --- linux-2.6.18.3/arch/mips/sibyte/bcm1480/smp.c       2006-11-18 19:28:22.000000000 -0800
    5711 +++ linux-mips-2.6.18.3/arch/mips/sibyte/bcm1480/smp.c  2006-11-20 10:09:08.000000000 -0800
    5712 @@ -34,21 +34,21 @@
    5713   * independent of board/firmware
    5714   */
    5715  
    5716 -static void *mailbox_0_set_regs[] = {
    5717 +static volatile void *mailbox_0_set_regs[] = {
    5718         IOADDR(A_BCM1480_IMR_CPU0_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
    5719         IOADDR(A_BCM1480_IMR_CPU1_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
    5720         IOADDR(A_BCM1480_IMR_CPU2_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
    5721         IOADDR(A_BCM1480_IMR_CPU3_BASE + R_BCM1480_IMR_MAILBOX_0_SET_CPU),
    5722  };
    5723  
    5724 -static void *mailbox_0_clear_regs[] = {
    5725 +static volatile void *mailbox_0_clear_regs[] = {
    5726         IOADDR(A_BCM1480_IMR_CPU0_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
    5727         IOADDR(A_BCM1480_IMR_CPU1_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
    5728         IOADDR(A_BCM1480_IMR_CPU2_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
    5729         IOADDR(A_BCM1480_IMR_CPU3_BASE + R_BCM1480_IMR_MAILBOX_0_CLR_CPU),
    5730  };
    5731  
    5732 -static void *mailbox_0_regs[] = {
    5733 +static volatile void *mailbox_0_regs[] = {
    5734         IOADDR(A_BCM1480_IMR_CPU0_BASE + R_BCM1480_IMR_MAILBOX_0_CPU),
    5735         IOADDR(A_BCM1480_IMR_CPU1_BASE + R_BCM1480_IMR_MAILBOX_0_CPU),
    5736         IOADDR(A_BCM1480_IMR_CPU2_BASE + R_BCM1480_IMR_MAILBOX_0_CPU),
    5737 diff -Naur linux-2.6.18.3/arch/mips/sibyte/sb1250/irq.c linux-mips-2.6.18.3/arch/mips/sibyte/sb1250/irq.c
    5738 --- linux-2.6.18.3/arch/mips/sibyte/sb1250/irq.c        2006-11-18 19:28:22.000000000 -0800
    5739 +++ linux-mips-2.6.18.3/arch/mips/sibyte/sb1250/irq.c   2006-11-20 10:09:08.000000000 -0800
    5740 @@ -419,21 +419,6 @@
    5741  
    5742  #endif         /* CONFIG_KGDB */
    5743  
    5744 -static inline int dclz(unsigned long long x)
    5745 -{
    5746 -       int lz;
    5747 -
    5748 -       __asm__ (
    5749 -       "       .set    push                                            \n"
    5750 -       "       .set    mips64                                          \n"
    5751 -       "       dclz    %0, %1                                          \n"
    5752 -       "       .set    pop                                             \n"
    5753 -       : "=r" (lz)
    5754 -       : "r" (x));
    5755 -
    5756 -       return lz;
    5757 -}
    5758 -
    5759  extern void sb1250_timer_interrupt(struct pt_regs *regs);
    5760  extern void sb1250_mailbox_interrupt(struct pt_regs *regs);
    5761  extern void sb1250_kgdb_interrupt(struct pt_regs *regs);
    5762 @@ -457,7 +442,7 @@
    5763          * blasting the high 32 bits.
    5764          */
    5765  
    5766 -       pending = read_c0_cause();
    5767 +       pending = read_c0_cause() & read_c0_status();
    5768  
    5769  #ifdef CONFIG_SIBYTE_SB1250_PROF
    5770         if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */
    5771 @@ -490,6 +475,9 @@
    5772                 mask = __raw_readq(IOADDR(A_IMR_REGISTER(smp_processor_id(),
    5773                                               R_IMR_INTERRUPT_STATUS_BASE)));
    5774                 if (mask)
    5775 -                       do_IRQ(63 - dclz(mask), regs);
    5776 -       }
    5777 +                       do_IRQ(fls64(mask) - 1, regs);
    5778 +               else
    5779 +                       spurious_interrupt(regs);
    5780 +       } else
    5781 +               spurious_interrupt(regs);
    5782  }
    5783 diff -Naur linux-2.6.18.3/arch/mips/tx4927/common/tx4927_setup.c linux-mips-2.6.18.3/arch/mips/tx4927/common/tx4927_setup.c
    5784 --- linux-2.6.18.3/arch/mips/tx4927/common/tx4927_setup.c       2006-11-18 19:28:22.000000000 -0800
    5785 +++ linux-mips-2.6.18.3/arch/mips/tx4927/common/tx4927_setup.c  2006-11-20 10:09:08.000000000 -0800
    5786 @@ -53,19 +53,9 @@
    5787  void dump_cp0(char *key);
    5788  
    5789  
    5790 -void (*__wbflush) (void);
    5791 -
    5792 -static void tx4927_write_buffer_flush(void)
    5793 -{
    5794 -       __asm__ __volatile__
    5795 -           ("sync\n\t" "nop\n\t" "loop: bc0f loop\n\t" "nop\n\t");
    5796 -}
    5797 -
    5798 -
    5799  void __init plat_mem_setup(void)
    5800  {
    5801         board_time_init = tx4927_time_init;
    5802 -       __wbflush = tx4927_write_buffer_flush;
    5803  
    5804  #ifdef CONFIG_TOSHIBA_RBTX4927
    5805         {
    5806 diff -Naur linux-2.6.18.3/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c linux-mips-2.6.18.3/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
    5807 --- linux-2.6.18.3/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c     2006-11-18 19:28:22.000000000 -0800
    5808 +++ linux-mips-2.6.18.3/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c        2006-11-20 10:09:08.000000000 -0800
    5809 @@ -130,6 +130,7 @@
    5810  #include <asm/ptrace.h>
    5811  #include <asm/reboot.h>
    5812  #include <asm/time.h>
    5813 +#include <asm/wbflush.h>
    5814  #include <linux/bootmem.h>
    5815  #include <linux/blkdev.h>
    5816  #ifdef CONFIG_RTC_DS1742
    5817 diff -Naur linux-2.6.18.3/arch/mips/tx4938/common/irq.c linux-mips-2.6.18.3/arch/mips/tx4938/common/irq.c
    5818 --- linux-2.6.18.3/arch/mips/tx4938/common/irq.c        2006-11-18 19:28:22.000000000 -0800
    5819 +++ linux-mips-2.6.18.3/arch/mips/tx4938/common/irq.c   2006-11-20 10:09:08.000000000 -0800
    5820 @@ -30,6 +30,7 @@
    5821  #include <asm/irq.h>
    5822  #include <asm/mipsregs.h>
    5823  #include <asm/system.h>
    5824 +#include <asm/wbflush.h>
    5825  #include <asm/tx4938/rbtx4938.h>
    5826  
    5827  /**********************************************************************************/
    5828 diff -Naur linux-2.6.18.3/arch/mips/tx4938/common/setup.c linux-mips-2.6.18.3/arch/mips/tx4938/common/setup.c
    5829 --- linux-2.6.18.3/arch/mips/tx4938/common/setup.c      2006-11-18 19:28:22.000000000 -0800
    5830 +++ linux-mips-2.6.18.3/arch/mips/tx4938/common/setup.c 2006-11-20 10:09:08.000000000 -0800
    5831 @@ -41,29 +41,10 @@
    5832  void __init tx4938_time_init(void);
    5833  void dump_cp0(char *key);
    5834  
    5835 -void (*__wbflush) (void);
    5836 -
    5837 -static void
    5838 -tx4938_write_buffer_flush(void)
    5839 -{
    5840 -       mmiowb();
    5841 -
    5842 -       __asm__ __volatile__(
    5843 -               ".set   push\n\t"
    5844 -               ".set   noreorder\n\t"
    5845 -               "lw     $0,%0\n\t"
    5846 -               "nop\n\t"
    5847 -               ".set   pop"
    5848 -               : /* no output */
    5849 -               : "m" (*(int *)KSEG1)
    5850 -               : "memory");
    5851 -}
    5852 -
    5853  void __init
    5854  plat_mem_setup(void)
    5855  {
    5856         board_time_init = tx4938_time_init;
    5857 -       __wbflush = tx4938_write_buffer_flush;
    5858         toshiba_rbtx4938_setup();
    5859  }
    5860  
    5861 diff -Naur linux-2.6.18.3/arch/mips/tx4938/toshiba_rbtx4938/irq.c linux-mips-2.6.18.3/arch/mips/tx4938/toshiba_rbtx4938/irq.c
    5862 --- linux-2.6.18.3/arch/mips/tx4938/toshiba_rbtx4938/irq.c      2006-11-18 19:28:22.000000000 -0800
    5863 +++ linux-mips-2.6.18.3/arch/mips/tx4938/toshiba_rbtx4938/irq.c 2006-11-20 10:09:08.000000000 -0800
    5864 @@ -84,6 +84,7 @@
    5865  #include <asm/ptrace.h>
    5866  #include <asm/reboot.h>
    5867  #include <asm/time.h>
    5868 +#include <asm/wbflush.h>
    5869  #include <linux/bootmem.h>
    5870  #include <asm/tx4938/rbtx4938.h>
    5871  
    5872 diff -Naur linux-2.6.18.3/drivers/char/Kconfig linux-mips-2.6.18.3/drivers/char/Kconfig
    5873 --- linux-2.6.18.3/drivers/char/Kconfig 2006-11-18 19:28:22.000000000 -0800
    5874 +++ linux-mips-2.6.18.3/drivers/char/Kconfig    2006-11-20 10:09:08.000000000 -0800
    5875 @@ -357,23 +357,68 @@
     1690diff -Naur linux-2.6.19/drivers/char/Kconfig linux-mips-2.6.19/drivers/char/Kconfig
     1691--- linux-2.6.19/drivers/char/Kconfig   2006-11-29 13:57:37.000000000 -0800
     1692+++ linux-mips-2.6.19/drivers/char/Kconfig      2006-11-29 15:23:09.000000000 -0800
     1693@@ -357,19 +357,56 @@
    58761694          To compile this driver as a module, choose M here: the
    58771695          module will be called istallion.
     
    58951713+       depends on MIPS && SOC_AU1X00
    58961714+
    5897 +config AU1X00_USB_TTY
    5898 +       tristate "Au1000 USB TTY Device support"
    5899 +       depends on MIPS && MIPS_AU1000 && AU1000_USB_DEVICE=y && AU1000_USB_DEVICE
    5900 +
    5901 +config AU1X00_USB_RAW
    5902 +       tristate "Au1000 USB Raw Device support"
    5903 +       depends on MIPS && MIPS_AU1000 && AU1000_USB_DEVICE=y && AU1000_USB_TTY!=y && AU1X00_USB_DEVICE
    5904 +
    59051715+config SIBYTE_SB1250_DUART
    59061716+       bool "Support for BCM1xxx onchip DUART"
     
    59151725+       depends on MACH_DECSTATION
    59161726+       default y
    5917         help
    5918 -         If you have an Alchemy AU1000 processor (MIPS based) and you want
    5919 -         to use a console on a serial port, say Y.  Otherwise, say N.
     1727+       help
    59201728+         This selects whether you want to be asked about drivers for
    59211729+         DECstation serial ports.
     
    59441752+       depends on SERIAL_DEC
    59451753+       default y
    5946 +       help
     1754        help
     1755-         If you have an Alchemy AU1000 processor (MIPS based) and you want
     1756-         to use a console on a serial port, say Y.  Otherwise, say N.
    59471757+         Documentation on the Zilog 85C350 serial communications controller
    59481758+         is downloadable at <http://www.zilog.com/pdfs/serial/z85c30.pdf>.
    59491759 
    5950  config QTRONIX_KEYBOARD
    5951         bool "Enable Qtronix 990P Keyboard Support"
    5952 -       depends on IT8712
    5953 +       depends on MIPS && (MIPS_ITE8172 || MIPS_IVR)
    5954         help
    5955           Images of Qtronix keyboards are at
    5956           <http://www.qtronix.com/keyboard.html>.
    5957 @@ -385,7 +430,7 @@
    5958  
    5959  config IT8172_SCR0
    5960         bool "Enable Smart Card Reader 0 Support "
    5961 -       depends on IT8712
    5962 +       depends on MIPS && (MIPS_ITE8172 || MIPS_IVR)
    5963         help
    5964           Say Y here to support smart-card reader 0 (SCR0) on the Integrated
    5965           Technology Express, Inc. ITE8172 SBC.  Vendor page at
    5966 @@ -394,13 +439,17 @@
    5967  
    5968  config IT8172_SCR1
    5969         bool "Enable Smart Card Reader 1 Support "
    5970 -       depends on IT8712
    5971 +       depends on MIPS && (MIPS_ITE8172 || MIPS_IVR)
    5972         help
    5973           Say Y here to support smart-card reader 1 (SCR1) on the Integrated
    5974           Technology Express, Inc. ITE8172 SBC.  Vendor page at
    5975           <http://www.ite.com.tw/ia/brief_it8172bsp.htm>; picture of the
    5976           board at <http://www.mvista.com/partners/semiconductor/ite.html>.
    5977  
    5978 +config ITE_GPIO
    5979 +       tristate "ITE GPIO"
    5980 +       depends on MIPS && MIPS_ITE8172
    5981 +
    59821760 config A2232
    59831761        tristate "Commodore A2232 serial support (EXPERIMENTAL)"
    5984         depends on EXPERIMENTAL && ZORRO && BROKEN_ON_SMP
    5985 diff -Naur linux-2.6.18.3/drivers/char/Makefile linux-mips-2.6.18.3/drivers/char/Makefile
    5986 --- linux-2.6.18.3/drivers/char/Makefile        2006-11-18 19:28:22.000000000 -0800
    5987 +++ linux-mips-2.6.18.3/drivers/char/Makefile   2006-11-20 10:09:08.000000000 -0800
     1762diff -Naur linux-2.6.19/drivers/char/Makefile linux-mips-2.6.19/drivers/char/Makefile
     1763--- linux-2.6.19/drivers/char/Makefile  2006-11-29 13:57:37.000000000 -0800
     1764+++ linux-mips-2.6.19/drivers/char/Makefile     2006-11-29 15:23:09.000000000 -0800
    59881765@@ -31,6 +31,7 @@
    59891766 obj-$(CONFIG_A2232)            += ser_a2232.o generic_serial.o
     
    59941771 obj-$(CONFIG_RISCOM8)          += riscom8.o
    59951772 obj-$(CONFIG_ISI)              += isicom.o
    5996 @@ -51,6 +52,7 @@
     1773@@ -53,6 +54,7 @@
    59971774 obj-$(CONFIG_VIOTAPE)          += viotape.o
    59981775 obj-$(CONFIG_HVCS)             += hvcs.o
    59991776 obj-$(CONFIG_SGI_MBCS)         += mbcs.o
    60001777+obj-$(CONFIG_SERIAL_DEC)       += decserial.o
     1778 obj-$(CONFIG_BRIQ_PANEL)       += briq_panel.o
    60011779 
    60021780 obj-$(CONFIG_PRINTER)          += lp.o
    6003  obj-$(CONFIG_TIPAR)            += tipar.o
    6004 @@ -78,6 +80,10 @@
     1781@@ -80,6 +82,7 @@
    60051782 obj-$(CONFIG_HW_RANDOM)                += hw_random/
    60061783 obj-$(CONFIG_FTAPE)            += ftape/
    60071784 obj-$(CONFIG_COBALT_LCD)       += lcd.o
    6008 +obj-$(CONFIG_ITE_GPIO)         += ite_gpio.o
    60091785+obj-$(CONFIG_AU1000_GPIO)      += au1000_gpio.o
    6010 +obj-$(CONFIG_AU1000_USB_TTY)   += au1000_usbtty.o
    6011 +obj-$(CONFIG_AU1000_USB_RAW)   += au1000_usbraw.o
    60121786 obj-$(CONFIG_PPDEV)            += ppdev.o
    60131787 obj-$(CONFIG_NWBUTTON)         += nwbutton.o
    60141788 obj-$(CONFIG_NWFLASH)          += nwflash.o
    6015 diff -Naur linux-2.6.18.3/drivers/char/au1000_gpio.c linux-mips-2.6.18.3/drivers/char/au1000_gpio.c
    6016 --- linux-2.6.18.3/drivers/char/au1000_gpio.c   1969-12-31 16:00:00.000000000 -0800
    6017 +++ linux-mips-2.6.18.3/drivers/char/au1000_gpio.c      2006-11-20 10:09:08.000000000 -0800
    6018 @@ -0,0 +1,266 @@
     1789diff -Naur linux-2.6.19/drivers/char/au1000_gpio.c linux-mips-2.6.19/drivers/char/au1000_gpio.c
     1790--- linux-2.6.19/drivers/char/au1000_gpio.c     1969-12-31 16:00:00.000000000 -0800
     1791+++ linux-mips-2.6.19/drivers/char/au1000_gpio.c        2006-11-29 15:23:09.000000000 -0800
     1792@@ -0,0 +1,262 @@
    60191793+/*
    60201794+ * FILE NAME au1000_gpio.c
     
    60501824+
    60511825+#include <linux/module.h>
    6052 +#include <linux/config.h>
    60531826+#include <linux/types.h>
    60541827+#include <linux/kernel.h>
     
    61041877+
    61051878+#ifdef CONFIG_USB_OHCI
    6106 +       avail_mask &= ~((1<<4) | (1<<11));
    6107 +#ifndef CONFIG_AU1X00_USB_DEVICE
    6108 +       avail_mask &= ~((1<<5) | (1<<13));
    6109 +#endif
     1879+       avail_mask &= ~((1<<4) | (1<<11) | (1<<5) | (1<<13));
    61101880+#endif
    61111881+       
     
    62832053+module_init(au1000gpio_init);
    62842054+module_exit(au1000gpio_exit);
    6285 diff -Naur linux-2.6.18.3/drivers/char/au1000_ts.c linux-mips-2.6.18.3/drivers/char/au1000_ts.c
    6286 --- linux-2.6.18.3/drivers/char/au1000_ts.c     1969-12-31 16:00:00.000000000 -0800
    6287 +++ linux-mips-2.6.18.3/drivers/char/au1000_ts.c        2006-11-20 10:09:08.000000000 -0800
     2055diff -Naur linux-2.6.19/drivers/char/au1000_ts.c linux-mips-2.6.19/drivers/char/au1000_ts.c
     2056--- linux-2.6.19/drivers/char/au1000_ts.c       1969-12-31 16:00:00.000000000 -0800
     2057+++ linux-mips-2.6.19/drivers/char/au1000_ts.c  2006-11-29 15:23:09.000000000 -0800
    62882058@@ -0,0 +1,677 @@
    62892059+/*
     
    66632433+
    66642434+static void
    6665 +ssi0_interrupt(int irq, void *dev_id, struct pt_regs *regs)
     2435+ssi0_interrupt(int irq, void *dev_id)
    66662436+{
    66672437+       au1000_ts_t *ts = (au1000_ts_t*)dev_id;
     
    69642734+module_init(au1000ts_init_module);
    69652735+module_exit(au1000ts_cleanup_module);
    6966 diff -Naur linux-2.6.18.3/drivers/char/au1000_usbraw.c linux-mips-2.6.18.3/drivers/char/au1000_usbraw.c
    6967 --- linux-2.6.18.3/drivers/char/au1000_usbraw.c 1969-12-31 16:00:00.000000000 -0800
    6968 +++ linux-mips-2.6.18.3/drivers/char/au1000_usbraw.c    2006-11-20 10:09:08.000000000 -0800
    6969 @@ -0,0 +1,573 @@
    6970 +/*
    6971 + * BRIEF MODULE DESCRIPTION
    6972 + *     Au1x00 USB Device-Side Raw Block Driver (function layer)
    6973 + *
    6974 + * Copyright 2001-2002 MontaVista Software Inc.
    6975 + * Author: MontaVista Software, Inc.
    6976 + *             stevel@mvista.com or source@mvista.com
    6977 + *
    6978 + *  This program is free software; you can redistribute         it and/or modify it
    6979 + *  under  the terms of         the GNU General  Public License as published by the
    6980 + *  Free Software Foundation;  either version 2 of the License, or (at your
    6981 + *  option) any later version.
    6982 + *
    6983 + *  THIS  SOFTWARE  IS PROVIDED          ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
    6984 + *  WARRANTIES,          INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
    6985 + *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
    6986 + *  NO EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
    6987 + *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    6988 + *  NOT LIMITED          TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
    6989 + *  USE, DATA, OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
    6990 + *  ANY THEORY OF LIABILITY, WHETHER IN         CONTRACT, STRICT LIABILITY, OR TORT
    6991 + *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    6992 + *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    6993 + *
    6994 + *  You should have received a copy of the  GNU General Public License along
    6995 + *  with this program; if not, write  to the Free Software Foundation, Inc.,
    6996 + *  675 Mass Ave, Cambridge, MA 02139, USA.
    6997 + */
    6998 +
    6999 +#include <linux/config.h>
    7000 +#include <linux/kernel.h>
    7001 +#include <linux/ioport.h>
    7002 +#include <linux/sched.h>
    7003 +#include <linux/signal.h>
    7004 +#include <linux/errno.h>
    7005 +#include <linux/poll.h>
    7006 +#include <linux/init.h>
    7007 +#include <linux/slab.h>
    7008 +#include <linux/fcntl.h>
    7009 +#include <linux/module.h>
    7010 +#include <linux/spinlock.h>
    7011 +#include <linux/list.h>
    7012 +#include <linux/smp_lock.h>
    7013 +#undef DEBUG
    7014 +#include <linux/usb.h>
    7015 +
    7016 +#include <asm/io.h>
    7017 +#include <asm/uaccess.h>
    7018 +#include <asm/irq.h>
    7019 +#include <asm/au1000.h>
    7020 +#include <asm/au1000_usbdev.h>
    7021 +
    7022 +#define USBRAW_MAJOR 190 // FIXME: need a legal major
    7023 +#define USBRAW_NAME "usbraw"
    7024 +
    7025 +#define MAX_NUM_PORTS 2
    7026 +
    7027 +#define IN_MAX_PACKET_SIZE  64
    7028 +#define OUT_MAX_PACKET_SIZE 64
    7029 +
    7030 +// FIXME: when Au1x00 endpoints 3 and 5 are fixed, make NUM_PORTS=2
    7031 +#define NUM_PORTS 1
    7032 +#define NUM_EP 2*NUM_PORTS
    7033 +
    7034 +#define CONFIG_DESC_LEN \
    7035 + USB_DT_CONFIG_SIZE + USB_DT_INTERFACE_SIZE + NUM_EP*USB_DT_ENDPOINT_SIZE
    7036 +
    7037 +/* must be power of two */
    7038 +#define READ_BUF_SIZE (1<<12)
    7039 +
    7040 +struct usb_raw_port {
    7041 +       unsigned char number;
    7042 +       spinlock_t port_lock;
    7043 +
    7044 +       struct usb_endpoint_descriptor* out_desc;
    7045 +       struct usb_endpoint_descriptor* in_desc;
    7046 +
    7047 +       int out_ep_addr; /* endpoint address of OUT endpoint */
    7048 +       int in_ep_addr;  /* endpoint address of IN endpoint */
    7049 +       
    7050 +       __u8 read_buf[READ_BUF_SIZE]; // FIXME: allocate with get_free_pages
    7051 +       int read_nextin, read_nextout;
    7052 +       int read_count;
    7053 +
    7054 +       wait_queue_head_t wait;
    7055 +       struct fasync_struct *fasync;     // asynch notification
    7056 +
    7057 +       int active;     /* someone has this device open */
    7058 +       int open_count; /* number of times this port has been opened */
    7059 +};
    7060 +
    7061 +static struct usb_serial {
    7062 +       struct usb_device_descriptor* dev_desc;
    7063 +       struct usb_config_descriptor* config_desc;
    7064 +       struct usb_interface_descriptor* if_desc;
    7065 +       struct usb_string_descriptor * str_desc[6];
    7066 +       void* str_desc_buf;
    7067 +
    7068 +       usbdev_state_t dev_state;
    7069 +
    7070 +       struct usb_raw_port port[NUM_PORTS];
    7071 +} usbraw;
    7072 +
    7073 +static struct usb_device_descriptor dev_desc = {
    7074 +       bLength:USB_DT_DEVICE_SIZE,
    7075 +       bDescriptorType:USB_DT_DEVICE,
    7076 +       bcdUSB:USBDEV_REV,              //usb rev
    7077 +       bDeviceClass:USB_CLASS_PER_INTERFACE,   //class    (none)
    7078 +       bDeviceSubClass:0x00,   //subclass (none)
    7079 +       bDeviceProtocol:0x00,   //protocol (none)
    7080 +       bMaxPacketSize0:USBDEV_EP0_MAX_PACKET_SIZE, //max packet size for ep0
    7081 +       idVendor:0x6d04,        //vendor  id
    7082 +       idProduct:0x0bc0,       //product id
    7083 +       bcdDevice:0x0001,       //BCD rev 0.1
    7084 +       iManufacturer:0x01,     //manufactuer string index
    7085 +       iProduct:0x02,          //product string index
    7086 +       iSerialNumber:0x03,     //serial# string index
    7087 +       bNumConfigurations:0x01 //num configurations
    7088 +};
    7089 +
    7090 +static struct usb_endpoint_descriptor ep_desc[] = {
    7091 +       {
    7092 +               // Bulk IN for Port 0
    7093 +               bLength:USB_DT_ENDPOINT_SIZE,
    7094 +               bDescriptorType:USB_DT_ENDPOINT,
    7095 +               bEndpointAddress:USB_DIR_IN,
    7096 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7097 +               wMaxPacketSize:IN_MAX_PACKET_SIZE,
    7098 +               bInterval:0x00  // ignored for bulk
    7099 +       },
    7100 +       {
    7101 +               // Bulk OUT for Port 0
    7102 +               bLength:USB_DT_ENDPOINT_SIZE,
    7103 +               bDescriptorType:USB_DT_ENDPOINT,
    7104 +               bEndpointAddress:USB_DIR_OUT,
    7105 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7106 +               wMaxPacketSize:OUT_MAX_PACKET_SIZE,
    7107 +               bInterval:0x00  // ignored for bulk
    7108 +       },
    7109 +       {
    7110 +               // Bulk IN for Port 1
    7111 +               bLength:USB_DT_ENDPOINT_SIZE,
    7112 +               bDescriptorType:USB_DT_ENDPOINT,
    7113 +               bEndpointAddress:USB_DIR_IN,
    7114 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7115 +               wMaxPacketSize:IN_MAX_PACKET_SIZE,
    7116 +               bInterval:0x00  // ignored for bulk
    7117 +       },
    7118 +       {
    7119 +               // Bulk OUT for Port 1
    7120 +               bLength:USB_DT_ENDPOINT_SIZE,
    7121 +               bDescriptorType:USB_DT_ENDPOINT,
    7122 +               bEndpointAddress:USB_DIR_OUT,
    7123 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7124 +               wMaxPacketSize:OUT_MAX_PACKET_SIZE,
    7125 +               bInterval:0x00  // ignored for bulk
    7126 +       }
    7127 +};
    7128 +
    7129 +static struct usb_interface_descriptor if_desc = {
    7130 +       bLength:USB_DT_INTERFACE_SIZE,
    7131 +       bDescriptorType:USB_DT_INTERFACE,
    7132 +       bInterfaceNumber:0x00,
    7133 +       bAlternateSetting:0x00,
    7134 +       bNumEndpoints:NUM_EP,
    7135 +       bInterfaceClass:0xff,
    7136 +       bInterfaceSubClass:0xab,
    7137 +       bInterfaceProtocol:0x00,
    7138 +       iInterface:0x05
    7139 +};
    7140 +
    7141 +static struct usb_config_descriptor config_desc = {
    7142 +       bLength:USB_DT_CONFIG_SIZE,
    7143 +       bDescriptorType:USB_DT_CONFIG,
    7144 +       wTotalLength:CONFIG_DESC_LEN,
    7145 +       bNumInterfaces:0x01,
    7146 +       bConfigurationValue:0x01,
    7147 +       iConfiguration:0x04,    // configuration string
    7148 +       bmAttributes:0xc0,      // self-powered
    7149 +       MaxPower:20             // 40 mA
    7150 +};
    7151 +
    7152 +// String[0] is a list of Language IDs supported by this device
    7153 +static struct usb_string_descriptor string_desc0 = {
    7154 +       bLength:4,
    7155 +       bDescriptorType:USB_DT_STRING,
    7156 +       wData:{0x0409} // English, US
    7157 +};
    7158 +
    7159 +// These strings will be converted to Unicode in string_desc[]
    7160 +static char *strings[5] = {
    7161 +       "Alchemy Semiconductor",  // iManufacturer
    7162 +       "USB Raw Block Device",   // iProduct
    7163 +       "0.1",                    // iSerialNumber
    7164 +       "USB Raw Config",         // iConfiguration
    7165 +       "USB Raw Interface"       // iInterface
    7166 +};
    7167 +
    7168 +
    7169 +static void
    7170 +receive_callback(struct usb_raw_port *port)
    7171 +{
    7172 +       int i, pkt_size;
    7173 +       usbdev_pkt_t* pkt;
    7174 +       
    7175 +       if ((pkt_size = usbdev_receive_packet(port->out_ep_addr,
    7176 +                                             &pkt)) <= 0) {
    7177 +               dbg(__FUNCTION__ ": usbdev_receive_packet returns %d",
    7178 +                   pkt_size);
    7179 +               return;
    7180 +       }
    7181 +
    7182 +       dbg(__FUNCTION__ ": ep%d, size=%d", port->out_ep_addr, pkt_size);
    7183 +
    7184 +       spin_lock(&port->port_lock);
    7185 +       for (i=0; i < pkt_size; i++) {
    7186 +               port->read_buf[port->read_nextin++] = pkt->payload[i];
    7187 +               port->read_nextin &= (READ_BUF_SIZE - 1);
    7188 +               if (++port->read_count == READ_BUF_SIZE)
    7189 +                       break;
    7190 +       }
    7191 +       spin_unlock(&port->port_lock);
    7192 +
    7193 +       /* free the packet */
    7194 +       kfree(pkt);
    7195 +       
    7196 +       // async notify
    7197 +       if (port->fasync)
    7198 +               kill_fasync(&port->fasync, SIGIO, POLL_IN);
    7199 +       // wake up any read call
    7200 +       if (waitqueue_active(&port->wait))
    7201 +               wake_up_interruptible(&port->wait);
    7202 +}
    7203 +
    7204 +static void
    7205 +transmit_callback(struct usb_raw_port *port, usbdev_pkt_t* pkt)
    7206 +{
    7207 +       dbg(__FUNCTION__ ": ep%d", port->in_ep_addr);
    7208 +       /* just free the returned packet */
    7209 +       kfree(pkt);
    7210 +}
    7211 +
    7212 +
    7213 +static void
    7214 +usbraw_callback(usbdev_cb_type_t cb_type, unsigned long arg, void* data)
    7215 +{
    7216 +       usbdev_pkt_t* pkt;
    7217 +       int i;
    7218 +       
    7219 +       switch (cb_type) {
    7220 +       case CB_NEW_STATE:
    7221 +               usbraw.dev_state = (usbdev_state_t)arg;
    7222 +               break;
    7223 +       case CB_PKT_COMPLETE:
    7224 +               pkt = (usbdev_pkt_t*)arg;
    7225 +               for (i=0; i<NUM_PORTS; i++) {
    7226 +                       struct usb_raw_port *port = &usbraw.port[i];
    7227 +                       if (pkt->ep_addr == port->in_ep_addr) {
    7228 +                               transmit_callback(port, pkt);
    7229 +                               break;
    7230 +                       } else if (pkt->ep_addr == port->out_ep_addr) {
    7231 +                               receive_callback(port);
    7232 +                               break;
    7233 +                       }
    7234 +               }
    7235 +               break;
    7236 +       }
    7237 +}
    7238 +
    7239 +/*****************************************************************************
    7240 + * Here begins the driver interface functions
    7241 + *****************************************************************************/
    7242 +
    7243 +static unsigned int usbraw_poll(struct file * filp, poll_table * wait)
    7244 +{
    7245 +       struct usb_raw_port *port = (struct usb_raw_port *)filp->private_data;
    7246 +       unsigned long flags;
    7247 +       int count;
    7248 +       
    7249 +       poll_wait(filp, &port->wait, wait);
    7250 +
    7251 +       spin_lock_irqsave(&port->port_lock, flags);
    7252 +       count = port->read_count;
    7253 +       spin_unlock_irqrestore(&port->port_lock, flags);
    7254 +
    7255 +       if (count > 0) {
    7256 +               dbg(__FUNCTION__ ": count=%d", count);
    7257 +               return POLLIN | POLLRDNORM;
    7258 +       }
    7259 +       
    7260 +       return 0;
    7261 +}
    7262 +
    7263 +static int usbraw_fasync(int fd, struct file *filp, int mode)
    7264 +{
    7265 +       struct usb_raw_port *port = (struct usb_raw_port *)filp->private_data;
    7266 +       return fasync_helper(fd, filp, mode, &port->fasync);
    7267 +}
    7268 +
    7269 +static int usbraw_open(struct inode * inode, struct file *filp)
    7270 +{
    7271 +       int portNumber;
    7272 +       struct usb_raw_port *port;
    7273 +       unsigned long flags;
    7274 +
    7275 +       /*
    7276 +        * the device-layer must be in the configured state before the
    7277 +        * function layer can operate.
    7278 +        */
    7279 +       if (usbraw.dev_state != CONFIGURED)
    7280 +               return -ENODEV;
    7281 +       
    7282 +       /* set up our port structure making the tty driver remember
    7283 +          our port object, and us it */
    7284 +       portNumber = MINOR(inode->i_rdev);
    7285 +       port = &usbraw.port[portNumber];
    7286 +       filp->private_data = port;
    7287 +
    7288 +       dbg(__FUNCTION__ ": port %d", port->number);
    7289 +
    7290 +       spin_lock_irqsave(&port->port_lock, flags);
    7291 +
    7292 +       ++port->open_count;
    7293 +
    7294 +       if (!port->active) {
    7295 +               port->active = 1;
    7296 +       }
    7297 +
    7298 +       /* flush read buffer */
    7299 +       port->read_nextin = port->read_nextout = port->read_count = 0;
    7300 +
    7301 +       spin_unlock_irqrestore(&port->port_lock, flags);
    7302 +
    7303 +       return 0;
    7304 +}
    7305 +
    7306 +static int usbraw_release(struct inode * inode, struct file * filp)
    7307 +{
    7308 +       struct usb_raw_port *port = (struct usb_raw_port *)filp->private_data;
    7309 +       unsigned long flags;
    7310 +
    7311 +       dbg(__FUNCTION__ ": port %d", port->number);
    7312 +
    7313 +       if (!port->active) {
    7314 +               err(__FUNCTION__ ": port not opened");
    7315 +               return -ENODEV;
    7316 +       }
    7317 +
    7318 +       usbraw_fasync(-1, filp, 0);
    7319 +
    7320 +       spin_lock_irqsave(&port->port_lock, flags);
    7321 +
    7322 +       --port->open_count;
    7323 +
    7324 +       if (port->open_count <= 0) {
    7325 +               port->active = 0;
    7326 +               port->open_count = 0;
    7327 +       }
    7328 +
    7329 +       spin_unlock_irqrestore(&port->port_lock, flags);
    7330 +
    7331 +       return 0;
    7332 +}
    7333 +
    7334 +
    7335 +static ssize_t usbraw_read(struct file * filp, char * buf,
    7336 +                          size_t count, loff_t * l)
    7337 +{
    7338 +       struct usb_raw_port *port = (struct usb_raw_port *)filp->private_data;
    7339 +       unsigned long flags;
    7340 +       int i, cnt;
    7341 +
    7342 +       /*
    7343 +        * the device-layer must be in the configured state before the
    7344 +        * function layer can operate.
    7345 +        */
    7346 +       if (usbraw.dev_state != CONFIGURED)
    7347 +               return -ENODEV;
    7348 +
    7349 +       do {
    7350 +               spin_lock_irqsave(&port->port_lock, flags);
    7351 +               cnt = port->read_count;
    7352 +               spin_unlock_irqrestore(&port->port_lock, flags);
    7353 +               if (cnt == 0) {
    7354 +                       if (filp->f_flags & O_NONBLOCK)
    7355 +                               return -EAGAIN;
    7356 +                       interruptible_sleep_on(&port->wait);
    7357 +                       if (signal_pending(current))
    7358 +                               return -ERESTARTSYS;
    7359 +               }
    7360 +       } while (cnt == 0);
    7361 +
    7362 +       count = (count > cnt) ? cnt : count;
    7363 +
    7364 +       for (i=0; i<count; i++) {
    7365 +               put_user(port->read_buf[port->read_nextout++], &buf[i]);
    7366 +               port->read_nextout &= (READ_BUF_SIZE - 1);
    7367 +               spin_lock_irqsave(&port->port_lock, flags);
    7368 +               port->read_count--;
    7369 +               spin_unlock_irqrestore(&port->port_lock, flags);
    7370 +               if (port->read_count == 0)
    7371 +                       break;
    7372 +       }
    7373 +
    7374 +       return i+1;
    7375 +}
    7376 +
    7377 +static ssize_t usbraw_write(struct file * filp, const char * buf,
    7378 +                           size_t count, loff_t *ppos)
    7379 +{
    7380 +       struct usb_raw_port *port = (struct usb_raw_port *)filp->private_data;
    7381 +       usbdev_pkt_t* pkt;
    7382 +       int ret, max_pkt_sz;
    7383 +       
    7384 +       /*
    7385 +        * the device-layer must be in the configured state before the
    7386 +        * function layer can operate.
    7387 +        */
    7388 +       if (usbraw.dev_state != CONFIGURED)
    7389 +               return -ENODEV;
    7390 +
    7391 +       if (!port->active) {
    7392 +               err(__FUNCTION__ ": port not opened");
    7393 +               return -EINVAL;
    7394 +       }
    7395 +
    7396 +       if (count == 0) {
    7397 +               dbg(__FUNCTION__ ": write request of 0 bytes");
    7398 +               return (0);
    7399 +       }
    7400 +
    7401 +       max_pkt_sz = port->in_desc->wMaxPacketSize;
    7402 +       count = (count > max_pkt_sz) ? max_pkt_sz : count;
    7403 +
    7404 +       if ((ret = usbdev_alloc_packet(port->in_ep_addr, count, &pkt)) < 0)
    7405 +               return ret;
    7406 +
    7407 +       copy_from_user(pkt->payload, buf, count);
    7408 +       
    7409 +       return usbdev_send_packet(port->in_ep_addr, pkt);
    7410 +}
    7411 +
    7412 +static int usbraw_ioctl(struct inode *inode, struct file *filp,
    7413 +                       unsigned int cmd, unsigned long arg)
    7414 +{
    7415 +       struct usb_raw_port *port = (struct usb_raw_port *)filp->private_data;
    7416 +
    7417 +       if (!port->active) {
    7418 +               err(__FUNCTION__ ": port not open");
    7419 +               return -ENODEV;
    7420 +       }
    7421 +       // FIXME: need any IOCTLs?
    7422 +
    7423 +       return -ENOIOCTLCMD;
    7424 +}
    7425 +
    7426 +
    7427 +static struct file_operations usbraw_fops = {
    7428 +        .owner          = THIS_MODULE,
    7429 +        .write          = usbraw_write,
    7430 +       .read           = usbraw_read,
    7431 +       .poll           = usbraw_poll,
    7432 +       .ioctl          = usbraw_ioctl,
    7433 +       .fasync         = usbraw_fasync,
    7434 +       .open           = usbraw_open,
    7435 +       .release        = usbraw_release,
    7436 +};
    7437 +
    7438 +void usbfn_raw_exit(void)
    7439 +{
    7440 +       /* kill the device layer */
    7441 +       usbdev_exit();
    7442 +
    7443 +       unregister_chrdev(USBRAW_MAJOR, USBRAW_NAME);
    7444 +
    7445 +       if (usbraw.str_desc_buf)
    7446 +               kfree(usbraw.str_desc_buf);
    7447 +}
    7448 +
    7449 +
    7450 +int usbfn_raw_init(void)
    7451 +{
    7452 +       int ret = 0, i, str_desc_len;
    7453 +
    7454 +       /* register our character device */
    7455 +       if ((ret = register_chrdev(USBRAW_MAJOR, USBRAW_NAME,
    7456 +                                  &usbraw_fops)) < 0) {
    7457 +               err("can't get major number");
    7458 +               return ret;
    7459 +       }
    7460 +       info("registered");
    7461 +
    7462 +       /*
    7463 +        * initialize pointers to descriptors
    7464 +        */
    7465 +       usbraw.dev_desc = &dev_desc;
    7466 +       usbraw.config_desc = &config_desc;
    7467 +       usbraw.if_desc = &if_desc;
    7468 +
    7469 +       /*
    7470 +        * initialize the string descriptors
    7471 +        */
    7472 +
    7473 +       /* alloc buffer big enough for all string descriptors */
    7474 +       str_desc_len = string_desc0.bLength;
    7475 +       for (i = 0; i < 5; i++)
    7476 +               str_desc_len += 2 + 2 * strlen(strings[i]);
    7477 +       usbraw.str_desc_buf = (void *) kmalloc(str_desc_len, GFP_KERNEL);
    7478 +       if (!usbraw.str_desc_buf) {
    7479 +               err(__FUNCTION__ ": failed to alloc string descriptors");
    7480 +               ret = -ENOMEM;
    7481 +               goto out;
    7482 +       }
    7483 +
    7484 +       usbraw.str_desc[0] =
    7485 +               (struct usb_string_descriptor *)usbraw.str_desc_buf;
    7486 +       memcpy(usbraw.str_desc[0], &string_desc0, string_desc0.bLength);
    7487 +       usbraw.str_desc[1] = (struct usb_string_descriptor *)
    7488 +               (usbraw.str_desc_buf + string_desc0.bLength);
    7489 +       for (i = 1; i < 6; i++) {
    7490 +               struct usb_string_descriptor *desc = usbraw.str_desc[i];
    7491 +               char *str = strings[i - 1];
    7492 +               int j, str_len = strlen(str);
    7493 +
    7494 +               desc->bLength = 2 + 2 * str_len;
    7495 +               desc->bDescriptorType = USB_DT_STRING;
    7496 +               for (j = 0; j < str_len; j++) {
    7497 +                       desc->wData[j] = (u16) str[j];
    7498 +               }
    7499 +               if (i < 5)
    7500 +                       usbraw.str_desc[i + 1] =
    7501 +                               (struct usb_string_descriptor *)
    7502 +                               ((u8 *) desc + desc->bLength);
    7503 +       }
    7504 +
    7505 +       /*
    7506 +        * start the device layer. The device layer assigns us
    7507 +        * our endpoint addresses
    7508 +        */
    7509 +       if ((ret = usbdev_init(&dev_desc, &config_desc, &if_desc, ep_desc,
    7510 +                              usbraw.str_desc, usbraw_callback, NULL))) {
    7511 +               err(__FUNCTION__ ": device-layer init failed");
    7512 +               goto out;
    7513 +       }
    7514 +       
    7515 +       /* initialize the devfs nodes for this device and let the user
    7516 +          know what ports we are bound to */
    7517 +       for (i = 0; i < NUM_PORTS; ++i) {
    7518 +               struct usb_raw_port *port = &usbraw.port[i];
    7519 +
    7520 +               port->number = i;
    7521 +               port->in_desc = &ep_desc[NUM_PORTS*i];
    7522 +               port->out_desc = &ep_desc[NUM_PORTS*i + 1];
    7523 +               port->in_ep_addr = port->in_desc->bEndpointAddress & 0x0f;
    7524 +               port->out_ep_addr = port->out_desc->bEndpointAddress & 0x0f;
    7525 +               init_waitqueue_head(&port->wait);
    7526 +               spin_lock_init(&port->port_lock);
    7527 +       }
    7528 +
    7529 + out:
    7530 +       if (ret)
    7531 +               usbfn_raw_exit();
    7532 +       return ret;
    7533 +}
    7534 +
    7535 +
    7536 +/* Module information */
    7537 +MODULE_AUTHOR("Steve Longerbeam, stevel@mvista.com, www.mvista.com");
    7538 +MODULE_DESCRIPTION("Au1x00 USB Device-Side Raw Block Driver");
    7539 +MODULE_LICENSE("GPL");
    7540 +
    7541 +module_init(usbfn_raw_init);
    7542 +module_exit(usbfn_raw_exit);
    7543 diff -Naur linux-2.6.18.3/drivers/char/au1000_usbtty.c linux-mips-2.6.18.3/drivers/char/au1000_usbtty.c
    7544 --- linux-2.6.18.3/drivers/char/au1000_usbtty.c 1969-12-31 16:00:00.000000000 -0800
    7545 +++ linux-mips-2.6.18.3/drivers/char/au1000_usbtty.c    2006-11-20 10:09:08.000000000 -0800
    7546 @@ -0,0 +1,761 @@
    7547 +/*
    7548 + * BRIEF MODULE DESCRIPTION
    7549 + *     Au1x00 USB Device-Side Serial TTY Driver (function layer)
    7550 + *
    7551 + * Copyright 2001-2002 MontaVista Software Inc.
    7552 + * Author: MontaVista Software, Inc.
    7553 + *             stevel@mvista.com or source@mvista.com
    7554 + *
    7555 + *  Derived from drivers/usb/serial/usbserial.c:
    7556 + *
    7557 + *  Copyright (C) 1999 - 2001 Greg Kroah-Hartman (greg@kroah.com)
    7558 + *  Copyright (c) 2000 Peter Berger (pberger@brimson.com)
    7559 + *  Copyright (c) 2000 Al Borchers (borchers@steinerpoint.com)
    7560 + *
    7561 + *  This program is free software; you can redistribute         it and/or modify it
    7562 + *  under  the terms of         the GNU General  Public License as published by the
    7563 + *  Free Software Foundation;  either version 2 of the License, or (at your
    7564 + *  option) any later version.
    7565 + *
    7566 + *  THIS  SOFTWARE  IS PROVIDED          ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
    7567 + *  WARRANTIES,          INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
    7568 + *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
    7569 + *  NO EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
    7570 + *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    7571 + *  NOT LIMITED          TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
    7572 + *  USE, DATA, OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
    7573 + *  ANY THEORY OF LIABILITY, WHETHER IN         CONTRACT, STRICT LIABILITY, OR TORT
    7574 + *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    7575 + *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    7576 + *
    7577 + *  You should have received a copy of the  GNU General Public License along
    7578 + *  with this program; if not, write  to the Free Software Foundation, Inc.,
    7579 + *  675 Mass Ave, Cambridge, MA 02139, USA.
    7580 + */
    7581 +
    7582 +#include <linux/config.h>
    7583 +#include <linux/kernel.h>
    7584 +#include <linux/ioport.h>
    7585 +#include <linux/sched.h>
    7586 +#include <linux/signal.h>
    7587 +#include <linux/errno.h>
    7588 +#include <linux/poll.h>
    7589 +#include <linux/init.h>
    7590 +#include <linux/slab.h>
    7591 +#include <linux/fcntl.h>
    7592 +#include <linux/tty.h>
    7593 +#include <linux/tty_driver.h>
    7594 +#include <linux/tty_flip.h>
    7595 +#include <linux/module.h>
    7596 +#include <linux/spinlock.h>
    7597 +#include <linux/list.h>
    7598 +#include <linux/smp_lock.h>
    7599 +#undef DEBUG
    7600 +#include <linux/usb.h>
    7601 +
    7602 +#include <asm/io.h>
    7603 +#include <asm/uaccess.h>
    7604 +#include <asm/irq.h>
    7605 +#include <asm/au1000.h>
    7606 +#include <asm/au1000_usbdev.h>
    7607 +
    7608 +
    7609 +/* local function prototypes */
    7610 +static int serial_open(struct tty_struct *tty, struct file *filp);
    7611 +static void serial_close(struct tty_struct *tty, struct file *filp);
    7612 +static int serial_write(struct tty_struct *tty, int from_user,
    7613 +                       const unsigned char *buf, int count);
    7614 +static int serial_write_room(struct tty_struct *tty);
    7615 +static int serial_chars_in_buffer(struct tty_struct *tty);
    7616 +static void serial_throttle(struct tty_struct *tty);
    7617 +static void serial_unthrottle(struct tty_struct *tty);
    7618 +static int serial_ioctl(struct tty_struct *tty, struct file *file,
    7619 +                       unsigned int cmd, unsigned long arg);
    7620 +static void serial_set_termios (struct tty_struct *tty, struct termios * old);
    7621 +
    7622 +#define SERIAL_TTY_MAJOR 189 // FIXME: need a legal major
    7623 +
    7624 +#define MAX_NUM_PORTS 2
    7625 +
    7626 +#define IN_MAX_PACKET_SIZE  32
    7627 +#define OUT_MAX_PACKET_SIZE 32
    7628 +
    7629 +// FIXME: when Au1x00 endpoints 3 and 5 are fixed, make NUM_PORTS=2
    7630 +#define NUM_PORTS 2
    7631 +#define NUM_EP 2*NUM_PORTS
    7632 +
    7633 +#define CONFIG_DESC_LEN \
    7634 + USB_DT_CONFIG_SIZE + USB_DT_INTERFACE_SIZE + NUM_EP*USB_DT_ENDPOINT_SIZE
    7635 +
    7636 +struct usb_serial_port {
    7637 +       struct tty_struct *tty;    /* the coresponding tty for this port */
    7638 +       unsigned char number;
    7639 +       spinlock_t port_lock;
    7640 +
    7641 +       struct usb_endpoint_descriptor* out_desc;
    7642 +       struct usb_endpoint_descriptor* in_desc;
    7643 +
    7644 +       int out_ep_addr; /* endpoint address of OUT endpoint */
    7645 +       int in_ep_addr;  /* endpoint address of IN endpoint */
    7646 +       
    7647 +       /* task queue for line discipline waking up on send packet complete */
    7648 +       struct tq_struct send_complete_tq;
    7649 +       /* task queue for line discipline wakeup on receive packet complete */
    7650 +       struct tq_struct receive_complete_tq;
    7651 +
    7652 +       int active;     /* someone has this device open */
    7653 +       int writing;    /* a packet write is in progress */
    7654 +       int open_count; /* number of times this port has been opened */
    7655 +
    7656 +};
    7657 +
    7658 +static struct usb_serial {
    7659 +       usbdev_state_t dev_state; // current state of device layer
    7660 +       struct usb_device_descriptor* dev_desc;
    7661 +       struct usb_config_descriptor* config_desc;
    7662 +       struct usb_interface_descriptor* if_desc;
    7663 +       struct usb_string_descriptor * str_desc[6];
    7664 +       void* str_desc_buf;
    7665 +
    7666 +       struct usb_serial_port port[NUM_PORTS];
    7667 +} usbtty;
    7668 +
    7669 +static int                 serial_refcount;
    7670 +static struct tty_driver   serial_tty_driver;
    7671 +static struct tty_struct * serial_tty[NUM_PORTS];
    7672 +static struct termios *    serial_termios[NUM_PORTS];
    7673 +static struct termios *    serial_termios_locked[NUM_PORTS];
    7674 +
    7675 +static struct usb_device_descriptor dev_desc = {
    7676 +       bLength:USB_DT_DEVICE_SIZE,
    7677 +       bDescriptorType:USB_DT_DEVICE,
    7678 +       bcdUSB:USBDEV_REV,              //usb rev
    7679 +       bDeviceClass:USB_CLASS_PER_INTERFACE,   //class    (none)
    7680 +       bDeviceSubClass:0x00,   //subclass (none)
    7681 +       bDeviceProtocol:0x00,   //protocol (none)
    7682 +       bMaxPacketSize0:USBDEV_EP0_MAX_PACKET_SIZE, //max packet size for ep0
    7683 +       idVendor:0x6d04,        //vendor  id
    7684 +       idProduct:0x0bc0,       //product id
    7685 +       bcdDevice:0x0001,       //BCD rev 0.1
    7686 +       iManufacturer:0x01,     //manufactuer string index
    7687 +       iProduct:0x02,          //product string index
    7688 +       iSerialNumber:0x03,     //serial# string index
    7689 +       bNumConfigurations:0x01 //num configurations
    7690 +};
    7691 +
    7692 +static struct usb_endpoint_descriptor ep_desc[] = {
    7693 +       {
    7694 +               // Bulk IN for Port 0
    7695 +               bLength:USB_DT_ENDPOINT_SIZE,
    7696 +               bDescriptorType:USB_DT_ENDPOINT,
    7697 +               bEndpointAddress:USB_DIR_IN,
    7698 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7699 +               wMaxPacketSize:IN_MAX_PACKET_SIZE,
    7700 +               bInterval:0x00  // ignored for bulk
    7701 +       },
    7702 +       {
    7703 +               // Bulk OUT for Port 0
    7704 +               bLength:USB_DT_ENDPOINT_SIZE,
    7705 +               bDescriptorType:USB_DT_ENDPOINT,
    7706 +               bEndpointAddress:USB_DIR_OUT,
    7707 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7708 +               wMaxPacketSize:OUT_MAX_PACKET_SIZE,
    7709 +               bInterval:0x00  // ignored for bulk
    7710 +       },
    7711 +       {
    7712 +               // Bulk IN for Port 1
    7713 +               bLength:USB_DT_ENDPOINT_SIZE,
    7714 +               bDescriptorType:USB_DT_ENDPOINT,
    7715 +               bEndpointAddress:USB_DIR_IN,
    7716 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7717 +               wMaxPacketSize:IN_MAX_PACKET_SIZE,
    7718 +               bInterval:0x00  // ignored for bulk
    7719 +       },
    7720 +       {
    7721 +               // Bulk OUT for Port 1
    7722 +               bLength:USB_DT_ENDPOINT_SIZE,
    7723 +               bDescriptorType:USB_DT_ENDPOINT,
    7724 +               bEndpointAddress:USB_DIR_OUT,
    7725 +               bmAttributes:USB_ENDPOINT_XFER_BULK,
    7726 +               wMaxPacketSize:OUT_MAX_PACKET_SIZE,
    7727 +               bInterval:0x00  // ignored for bulk
    7728 +       }
    7729 +};
    7730 +
    7731 +static struct usb_interface_descriptor if_desc = {
    7732 +       bLength:USB_DT_INTERFACE_SIZE,
    7733 +       bDescriptorType:USB_DT_INTERFACE,
    7734 +       bInterfaceNumber:0x00,
    7735 +       bAlternateSetting:0x00,
    7736 +       bNumEndpoints:NUM_EP,
    7737 +       bInterfaceClass:0xff,
    7738 +       bInterfaceSubClass:0xab,
    7739 +       bInterfaceProtocol:0x00,
    7740 +       iInterface:0x05
    7741 +};
    7742 +
    7743 +static struct usb_config_descriptor config_desc = {
    7744 +       bLength:USB_DT_CONFIG_SIZE,
    7745 +       bDescriptorType:USB_DT_CONFIG,
    7746 +       wTotalLength:CONFIG_DESC_LEN,
    7747 +       bNumInterfaces:0x01,
    7748 +       bConfigurationValue:0x01,
    7749 +       iConfiguration:0x04,    // configuration string
    7750 +       bmAttributes:0xc0,      // self-powered
    7751 +       MaxPower:20             // 40 mA
    7752 +};
    7753 +
    7754 +// String[0] is a list of Language IDs supported by this device
    7755 +static struct usb_string_descriptor string_desc0 = {
    7756 +       bLength:4,
    7757 +       bDescriptorType:USB_DT_STRING,
    7758 +       wData:{0x0409} // English, US
    7759 +};
    7760 +
    7761 +// These strings will be converted to Unicode in string_desc[]
    7762 +static char *strings[5] = {
    7763 +       "Alchemy Semiconductor",  // iManufacturer
    7764 +       "WutzAMattaU",            // iProduct
    7765 +       "1.0.doh!",               // iSerialNumber
    7766 +       "Au1000 TTY Config",      // iConfiguration
    7767 +       "Au1000 TTY Interface"    // iInterface
    7768 +};
    7769 +
    7770 +static inline int
    7771 +port_paranoia_check(struct usb_serial_port *port, const char *function)
    7772 +{
    7773 +       if (!port) {
    7774 +               err("%s: port is NULL", function);
    7775 +               return -1;
    7776 +       }
    7777 +       if (!port->tty) {
    7778 +               err("%s: port->tty is NULL", function);
    7779 +               return -1;
    7780 +       }
    7781 +
    7782 +       return 0;
    7783 +}
    7784 +
    7785 +
    7786 +static void
    7787 +port_rx_callback(struct usb_serial_port *port)
    7788 +{
    7789 +       dbg(__FUNCTION__ ": ep%d", port->out_ep_addr);
    7790 +       // mark a bh to push this data up to the tty
    7791 +       queue_task(&port->receive_complete_tq, &tq_immediate);
    7792 +       mark_bh(IMMEDIATE_BH);
    7793 +}
    7794 +
    7795 +static void
    7796 +port_tx_callback(struct usb_serial_port *port, usbdev_pkt_t* pkt)
    7797 +{
    7798 +       dbg(__FUNCTION__ ": ep%d", port->in_ep_addr);
    7799 +       // mark a bh to wakeup any tty write system call on the port.
    7800 +       queue_task(&port->send_complete_tq, &tq_immediate);
    7801 +       mark_bh(IMMEDIATE_BH);
    7802 +
    7803 +       /* free the returned packet */
    7804 +       kfree(pkt);
    7805 +}
    7806 +
    7807 +static void
    7808 +usbtty_callback(usbdev_cb_type_t cb_type, unsigned long arg, void* data)
    7809 +{
    7810 +       usbdev_pkt_t* pkt;
    7811 +       int i;
    7812 +       
    7813 +       switch (cb_type) {
    7814 +       case CB_NEW_STATE:
    7815 +               dbg(__FUNCTION__ ": new dev_state=%d", (int)arg);
    7816 +               usbtty.dev_state = (usbdev_state_t)arg;
    7817 +               break;
    7818 +       case CB_PKT_COMPLETE:
    7819 +               pkt = (usbdev_pkt_t*)arg;
    7820 +               for (i=0; i<NUM_PORTS; i++) {
    7821 +                       struct usb_serial_port *port = &usbtty.port[i];
    7822 +                       if (pkt->ep_addr == port->in_ep_addr) {
    7823 +                               port_tx_callback(port, pkt);
    7824 +                               break;
    7825 +                       } else if (pkt->ep_addr == port->out_ep_addr) {
    7826 +                               port_rx_callback(port);
    7827 +                               break;
    7828 +                       }
    7829 +               }
    7830 +               break;
    7831 +       }
    7832 +}
    7833 +
    7834 +
    7835 +/*****************************************************************************
    7836 + * Here begins the tty driver interface functions
    7837 + *****************************************************************************/
    7838 +
    7839 +static int serial_open(struct tty_struct *tty, struct file *filp)
    7840 +{
    7841 +       int portNumber;
    7842 +       struct usb_serial_port *port;
    7843 +       unsigned long flags;
    7844 +
    7845 +       /* initialize the pointer incase something fails */
    7846 +       tty->driver_data = NULL;
    7847 +
    7848 +       /* set up our port structure making the tty driver remember
    7849 +          our port object, and us it */
    7850 +       portNumber = MINOR(tty->device);
    7851 +       port = &usbtty.port[portNumber];
    7852 +       tty->driver_data = port;
    7853 +       port->tty = tty;
    7854 +
    7855 +       if (usbtty.dev_state != CONFIGURED ||
    7856 +           port_paranoia_check(port, __FUNCTION__)) {
    7857 +               /*
    7858 +                * the device-layer must be in the configured state before
    7859 +                * the function layer can operate.
    7860 +                */
    7861 +               return -ENODEV;
    7862 +       }
    7863 +       
    7864 +       dbg(__FUNCTION__ ": port %d", port->number);
    7865 +
    7866 +       spin_lock_irqsave(&port->port_lock, flags);
    7867 +
    7868 +       ++port->open_count;
    7869 +
    7870 +       if (!port->active) {
    7871 +               port->active = 1;
    7872 +
    7873 +               /*
    7874 +                * force low_latency on so that our tty_push actually forces
    7875 +                * the data through, otherwise it is scheduled, and with high
    7876 +                * data rates (like with OHCI) data can get lost.
    7877 +                */
    7878 +               port->tty->low_latency = 1;
    7879 +
    7880 +       }
    7881 +
    7882 +       spin_unlock_irqrestore(&port->port_lock, flags);
    7883 +
    7884 +       return 0;
    7885 +}
    7886 +
    7887 +
    7888 +static void serial_close(struct tty_struct *tty, struct file *filp)
    7889 +{
    7890 +       struct usb_serial_port *port =
    7891 +               (struct usb_serial_port *) tty->driver_data;
    7892 +       unsigned long flags;
    7893 +
    7894 +       dbg(__FUNCTION__ ": port %d", port->number);
    7895 +
    7896 +       if (!port->active) {
    7897 +               err(__FUNCTION__ ": port not opened");
    7898 +               return;
    7899 +       }
    7900 +
    7901 +       spin_lock_irqsave(&port->port_lock, flags);
    7902 +
    7903 +       --port->open_count;
    7904 +
    7905 +       if (port->open_count <= 0) {
    7906 +               port->active = 0;
    7907 +               port->open_count = 0;
    7908 +       }
    7909 +
    7910 +       spin_unlock_irqrestore(&port->port_lock, flags);
    7911 +       MOD_DEC_USE_COUNT;
    7912 +}
    7913 +
    7914 +
    7915 +static int serial_write(struct tty_struct *tty, int from_user,
    7916 +                       const unsigned char *buf, int count)
    7917 +{
    7918 +       struct usb_serial_port *port =
    7919 +               (struct usb_serial_port *) tty->driver_data;
    7920 +       usbdev_pkt_t* pkt;
    7921 +       int max_pkt_sz, ret;
    7922 +       unsigned long flags;
    7923 +       
    7924 +       /*
    7925 +        * the device-layer must be in the configured state before the
    7926 +        * function layer can operate.
    7927 +        */
    7928 +       if (usbtty.dev_state != CONFIGURED)
    7929 +               return -ENODEV;
    7930 +
    7931 +       if (!port->active) {
    7932 +               err(__FUNCTION__ ": port not open");
    7933 +               return -EINVAL;
    7934 +       }
    7935 +
    7936 +       if (count == 0) {
    7937 +               dbg(__FUNCTION__ ": request of 0 bytes");
    7938 +               return (0);
    7939 +       }
    7940 +
    7941 +#if 0
    7942 +       if (port->writing) {
    7943 +               dbg(__FUNCTION__ ": already writing");
    7944 +               return 0;
    7945 +       }
    7946 +#endif
    7947 +       
    7948 +       max_pkt_sz = port->in_desc->wMaxPacketSize;
    7949 +       count = (count > max_pkt_sz) ? max_pkt_sz : count;
    7950 +
    7951 +       if ((ret = usbdev_alloc_packet(port->in_ep_addr, count, &pkt)))
    7952 +               return ret;
    7953 +
    7954 +       if (from_user)
    7955 +               copy_from_user(pkt->payload, buf, count);
    7956 +       else
    7957 +               memcpy(pkt->payload, buf, count);
    7958 +       
    7959 +       ret = usbdev_send_packet(port->in_ep_addr, pkt);
    7960 +
    7961 +       spin_lock_irqsave(&port->port_lock, flags);
    7962 +       port->writing = 1;
    7963 +       spin_unlock_irqrestore(&port->port_lock, flags);
    7964 +
    7965 +       return ret;
    7966 +}
    7967 +
    7968 +
    7969 +static int serial_write_room(struct tty_struct *tty)
    7970 +{
    7971 +       struct usb_serial_port *port =
    7972 +               (struct usb_serial_port *) tty->driver_data;
    7973 +       int room = 0;
    7974 +       
    7975 +       /*
    7976 +        * the device-layer must be in the configured state before the
    7977 +        * function layer can operate.
    7978 +        */
    7979 +       if (usbtty.dev_state != CONFIGURED)
    7980 +               return -ENODEV;
    7981 +
    7982 +       if (!port->active) {
    7983 +               err(__FUNCTION__ ": port not open");
    7984 +               return -EINVAL;
    7985 +       }
    7986 +
    7987 +       //room = port->writing ? 0 : port->in_desc->wMaxPacketSize;
    7988 +       room = port->in_desc->wMaxPacketSize;
    7989 +       
    7990 +       dbg(__FUNCTION__ ": %d", room);
    7991 +       return room;
    7992 +}
    7993 +
    7994 +
    7995 +static int serial_chars_in_buffer(struct tty_struct *tty)
    7996 +{
    7997 +       struct usb_serial_port *port =
    7998 +               (struct usb_serial_port *) tty->driver_data;
    7999 +       int chars = 0;
    8000 +       
    8001 +       /*
    8002 +        * the device-layer must be in the configured state before the
    8003 +        * function layer can operate.
    8004 +        */
    8005 +       if (usbtty.dev_state != CONFIGURED)
    8006 +               return -ENODEV;
    8007 +
    8008 +       if (!port->active) {
    8009 +               err(__FUNCTION__ ": port not open");
    8010 +               return -EINVAL;
    8011 +       }
    8012 +
    8013 +       //chars = port->writing ? usbdev_get_byte_count(port->in_ep_addr) : 0;
    8014 +       chars = usbdev_get_byte_count(port->in_ep_addr);
    8015 +
    8016 +       dbg(__FUNCTION__ ": %d", chars);
    8017 +       return chars;
    8018 +}
    8019 +
    8020 +
    8021 +static void serial_throttle(struct tty_struct *tty)
    8022 +{
    8023 +       struct usb_serial_port *port =
    8024 +               (struct usb_serial_port *) tty->driver_data;
    8025 +
    8026 +       if (!port->active || usbtty.dev_state != CONFIGURED) {
    8027 +               err(__FUNCTION__ ": port not open");
    8028 +               return;
    8029 +       }
    8030 +
    8031 +       // FIXME: anything to do?
    8032 +       dbg(__FUNCTION__);
    8033 +}
    8034 +
    8035 +
    8036 +static void serial_unthrottle(struct tty_struct *tty)
    8037 +{
    8038 +       struct usb_serial_port *port =
    8039 +               (struct usb_serial_port *) tty->driver_data;
    8040 +
    8041 +       if (!port->active || usbtty.dev_state != CONFIGURED) {
    8042 +               err(__FUNCTION__ ": port not open");
    8043 +               return;
    8044 +       }
    8045 +
    8046 +       // FIXME: anything to do?
    8047 +       dbg(__FUNCTION__);
    8048 +}
    8049 +
    8050 +
    8051 +static int serial_ioctl(struct tty_struct *tty, struct file *file,
    8052 +                       unsigned int cmd, unsigned long arg)
    8053 +{
    8054 +       struct usb_serial_port *port =
    8055 +               (struct usb_serial_port *) tty->driver_data;
    8056 +
    8057 +       if (!port->active) {
    8058 +               err(__FUNCTION__ ": port not open");
    8059 +               return -ENODEV;
    8060 +       }
    8061 +       // FIXME: need any IOCTLs?
    8062 +       dbg(__FUNCTION__);
    8063 +
    8064 +       return -ENOIOCTLCMD;
    8065 +}
    8066 +
    8067 +
    8068 +static void serial_set_termios(struct tty_struct *tty, struct termios *old)
    8069 +{
    8070 +       struct usb_serial_port *port =
    8071 +               (struct usb_serial_port *) tty->driver_data;
    8072 +
    8073 +       if (!port->active || usbtty.dev_state != CONFIGURED)  {
    8074 +               err(__FUNCTION__ ": port not open");
    8075 +               return;
    8076 +       }
    8077 +
    8078 +       dbg(__FUNCTION__);
    8079 +       // FIXME: anything to do?
    8080 +}
    8081 +
    8082 +
    8083 +static void serial_break(struct tty_struct *tty, int break_state)
    8084 +{
    8085 +       struct usb_serial_port *port =
    8086 +               (struct usb_serial_port *) tty->driver_data;
    8087 +
    8088 +       if (!port->active || usbtty.dev_state != CONFIGURED)  {
    8089 +               err(__FUNCTION__ ": port not open");
    8090 +               return;
    8091 +       }
    8092 +
    8093 +       dbg(__FUNCTION__);
    8094 +       // FIXME: anything to do?
    8095 +}
    8096 +
    8097 +
    8098 +static void port_send_complete(void *private)
    8099 +{
    8100 +       struct usb_serial_port *port = (struct usb_serial_port *) private;
    8101 +       struct tty_struct *tty;
    8102 +       unsigned long flags;
    8103 +
    8104 +       dbg(__FUNCTION__ ": port %d, ep%d", port->number, port->in_ep_addr);
    8105 +
    8106 +       tty = port->tty;
    8107 +       if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
    8108 +           tty->ldisc.write_wakeup) {
    8109 +               dbg(__FUNCTION__ ": write wakeup call.");
    8110 +               (tty->ldisc.write_wakeup) (tty);
    8111 +       }
    8112 +
    8113 +       wake_up_interruptible(&tty->write_wait);
    8114 +
    8115 +       spin_lock_irqsave(&port->port_lock, flags);
    8116 +       port->writing = usbdev_get_byte_count(port->in_ep_addr) <= 0 ? 0 : 1;
    8117 +       spin_unlock_irqrestore(&port->port_lock, flags);
    8118 +}
    8119 +
    8120 +
    8121 +static void port_receive_complete(void *private)
    8122 +{
    8123 +       struct usb_serial_port *port = (struct usb_serial_port *) private;
    8124 +       struct tty_struct *tty = port->tty;
    8125 +       usbdev_pkt_t* pkt = NULL;
    8126 +       int i, count;
    8127 +
    8128 +       /* while there is a packet available */
    8129 +       while ((count = usbdev_receive_packet(port->out_ep_addr,
    8130 +                                             &pkt)) != -ENODATA) {
    8131 +               if (count < 0) {
    8132 +                       if (pkt)
    8133 +                               kfree(pkt);
    8134 +                       break; /* exit if error other than ENODATA */
    8135 +               }
    8136 +               
    8137 +               dbg(__FUNCTION__ ": port %d, ep%d, size=%d",
    8138 +                   port->number, port->out_ep_addr, count);
    8139 +
    8140 +               for (i = 0; i < count; i++) {
    8141 +                       /* if we insert more than TTY_FLIPBUF_SIZE characters,
    8142 +                          we drop them. */
    8143 +                       if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
    8144 +                               tty_flip_buffer_push(tty);
    8145 +                       }
    8146 +                       /* this doesn't actually push the data through
    8147 +                          unless tty->low_latency is set */
    8148 +                       tty_insert_flip_char(tty, pkt->payload[i], 0);
    8149 +               }
    8150 +               tty_flip_buffer_push(tty);
    8151 +
    8152 +               kfree(pkt); /* make sure we free the packet */
    8153 +       }
    8154 +
    8155 +}
    8156 +
    8157 +
    8158 +static struct tty_driver serial_tty_driver = {
    8159 +       .magic= TTY_DRIVER_MAGIC,
    8160 +       .driver_name= "usbfn-tty",
    8161 +       .name= "usb/ttsdev/%d",
    8162 +       .major= SERIAL_TTY_MAJOR,
    8163 +       .minor_start= 0,
    8164 +       .num= NUM_PORTS,
    8165 +       .type= TTY_DRIVER_TYPE_SERIAL,
    8166 +       .subtype= SERIAL_TYPE_NORMAL,
    8167 +       .flags= TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS,
    8168 +       .refcount= &serial_refcount,
    8169 +       .table= serial_tty,
    8170 +       .termios= serial_termios,
    8171 +       .termios_locked= serial_termios_locked,
    8172 +
    8173 +       .open= serial_open,
    8174 +       .close= serial_close,
    8175 +       .write= serial_write,
    8176 +       .write_room= serial_write_room,
    8177 +       .ioctl= serial_ioctl,
    8178 +       .set_termios= serial_set_termios,
    8179 +       .throttle= serial_throttle,
    8180 +       .unthrottle= serial_unthrottle,
    8181 +       .break_ctl= serial_break,
    8182 +       .chars_in_buffer= serial_chars_in_buffer,
    8183 +};
    8184 +
    8185 +
    8186 +void usbfn_tty_exit(void)
    8187 +{
    8188 +       int i;
    8189 +       
    8190 +       /* kill the device layer */
    8191 +       usbdev_exit();
    8192 +
    8193 +       for (i=0; i < NUM_PORTS; i++) {
    8194 +               tty_unregister_devfs(&serial_tty_driver, i);
    8195 +               info("usb serial converter now disconnected from ttyUSBdev%d",
    8196 +                    i);
    8197 +       }
    8198 +
    8199 +       tty_unregister_driver(&serial_tty_driver);
    8200 +
    8201 +       if (usbtty.str_desc_buf)
    8202 +               kfree(usbtty.str_desc_buf);
    8203 +}
    8204 +
    8205 +
    8206 +int usbfn_tty_init(void)
    8207 +{
    8208 +       int ret = 0, i, str_desc_len;
    8209 +
    8210 +       /* register the tty driver */
    8211 +       serial_tty_driver.init_termios = tty_std_termios;
    8212 +       serial_tty_driver.init_termios.c_cflag =
    8213 +               B9600 | CS8 | CREAD | HUPCL | CLOCAL;
    8214 +       
    8215 +       if (tty_register_driver(&serial_tty_driver)) {
    8216 +               err(__FUNCTION__ ": failed to register tty driver");
    8217 +               ret = -ENXIO;
    8218 +               goto out;
    8219 +       }
    8220 +
    8221 +       /*
    8222 +        * initialize pointers to descriptors
    8223 +        */
    8224 +       usbtty.dev_desc = &dev_desc;
    8225 +       usbtty.config_desc = &config_desc;
    8226 +       usbtty.if_desc = &if_desc;
    8227 +
    8228 +       /*
    8229 +        * initialize the string descriptors
    8230 +        */
    8231 +
    8232 +       /* alloc buffer big enough for all string descriptors */
    8233 +       str_desc_len = string_desc0.bLength;
    8234 +       for (i = 0; i < 5; i++)
    8235 +               str_desc_len += 2 + 2 * strlen(strings[i]);
    8236 +       usbtty.str_desc_buf = (void *) kmalloc(str_desc_len, GFP_KERNEL);
    8237 +       if (!usbtty.str_desc_buf) {
    8238 +               err(__FUNCTION__ ": failed to alloc string descriptors");
    8239 +               ret = -ENOMEM;
    8240 +               goto out;
    8241 +       }
    8242 +
    8243 +       usbtty.str_desc[0] =
    8244 +               (struct usb_string_descriptor *)usbtty.str_desc_buf;
    8245 +       memcpy(usbtty.str_desc[0], &string_desc0, string_desc0.bLength);
    8246 +       usbtty.str_desc[1] = (struct usb_string_descriptor *)
    8247 +               (usbtty.str_desc_buf + string_desc0.bLength);
    8248 +       for (i = 1; i < 6; i++) {
    8249 +               struct usb_string_descriptor *desc = usbtty.str_desc[i];
    8250 +               char *str = strings[i - 1];
    8251 +               int j, str_len = strlen(str);
    8252 +
    8253 +               desc->bLength = 2 + 2 * str_len;
    8254 +               desc->bDescriptorType = USB_DT_STRING;
    8255 +               for (j = 0; j < str_len; j++) {
    8256 +                       desc->wData[j] = (u16) str[j];
    8257 +               }
    8258 +               if (i < 5)
    8259 +                       usbtty.str_desc[i + 1] =
    8260 +                               (struct usb_string_descriptor *)
    8261 +                               ((u8 *) desc + desc->bLength);
    8262 +       }
    8263 +
    8264 +       /*
    8265 +        * start the device layer. The device layer assigns us
    8266 +        * our endpoint addresses
    8267 +        */
    8268 +       if ((ret = usbdev_init(&dev_desc, &config_desc, &if_desc, ep_desc,
    8269 +                              usbtty.str_desc, usbtty_callback, NULL))) {
    8270 +               err(__FUNCTION__ ": device-layer init failed");
    8271 +               goto out;
    8272 +       }
    8273 +       
    8274 +       /* initialize the devfs nodes for this device and let the user
    8275 +          know what ports we are bound to */
    8276 +       for (i = 0; i < NUM_PORTS; ++i) {
    8277 +               struct usb_serial_port *port;
    8278 +               tty_register_devfs(&serial_tty_driver, 0, i);
    8279 +               info("usbdev serial attached to ttyUSBdev%d "
    8280 +                    "(or devfs usb/ttsdev/%d)", i, i);
    8281 +               port = &usbtty.port[i];
    8282 +               port->number = i;
    8283 +               port->in_desc = &ep_desc[NUM_PORTS*i];
    8284 +               port->out_desc = &ep_desc[NUM_PORTS*i + 1];
    8285 +               port->in_ep_addr = port->in_desc->bEndpointAddress & 0x0f;
    8286 +               port->out_ep_addr = port->out_desc->bEndpointAddress & 0x0f;
    8287 +               port->send_complete_tq.routine = port_send_complete;
    8288 +               port->send_complete_tq.data = port;
    8289 +               port->receive_complete_tq.routine = port_receive_complete;
    8290 +               port->receive_complete_tq.data = port;
    8291 +               spin_lock_init(&port->port_lock);
    8292 +       }
    8293 +
    8294 + out:
    8295 +       if (ret)
    8296 +               usbfn_tty_exit();
    8297 +       return ret;
    8298 +}
    8299 +
    8300 +
    8301 +/* Module information */
    8302 +MODULE_AUTHOR("Steve Longerbeam, stevel@mvista.com, www.mvista.com");
    8303 +MODULE_DESCRIPTION("Au1x00 USB Device-Side Serial TTY Driver");
    8304 +MODULE_LICENSE("GPL");
    8305 +
    8306 +module_init(usbfn_tty_init);
    8307 +module_exit(usbfn_tty_exit);
    8308 diff -Naur linux-2.6.18.3/drivers/char/decserial.c linux-mips-2.6.18.3/drivers/char/decserial.c
    8309 --- linux-2.6.18.3/drivers/char/decserial.c     2006-11-18 19:28:22.000000000 -0800
    8310 +++ linux-mips-2.6.18.3/drivers/char/decserial.c        2006-11-20 10:09:08.000000000 -0800
     2736diff -Naur linux-2.6.19/drivers/char/decserial.c linux-mips-2.6.19/drivers/char/decserial.c
     2737--- linux-2.6.19/drivers/char/decserial.c       2006-11-29 13:57:37.000000000 -0800
     2738+++ linux-mips-2.6.19/drivers/char/decserial.c  2006-11-29 15:23:09.000000000 -0800
    83112739@@ -14,86 +14,84 @@
    83122740  *      device. Added support for PROM console in drivers/char/tty_io.c
     
    84422870 
    84432871 #endif
    8444 diff -Naur linux-2.6.18.3/drivers/char/qtronix.c linux-mips-2.6.18.3/drivers/char/qtronix.c
    8445 --- linux-2.6.18.3/drivers/char/qtronix.c       2006-11-18 19:28:22.000000000 -0800
    8446 +++ linux-mips-2.6.18.3/drivers/char/qtronix.c  2006-11-20 10:09:08.000000000 -0800
    8447 @@ -534,8 +534,7 @@
    8448                 i--;
    8449         }
    8450         if (count-i) {
    8451 -               struct inode *inode = file->f_dentry->d_inode;
    8452 -               inode->i_atime = current_fs_time(inode->i_sb);
    8453 +               file->f_dentry->d_inode->i_atime = get_seconds();
    8454                 return count-i;
    8455         }
    8456         if (signal_pending(current))
    8457 diff -Naur linux-2.6.18.3/drivers/char/rtc.c linux-mips-2.6.18.3/drivers/char/rtc.c
    8458 --- linux-2.6.18.3/drivers/char/rtc.c   2006-11-18 19:28:22.000000000 -0800
    8459 +++ linux-mips-2.6.18.3/drivers/char/rtc.c      2006-11-20 10:09:08.000000000 -0800
    8460 @@ -35,16 +35,16 @@
    8461   *     1.09a   Pete Zaitcev: Sun SPARC
    8462   *     1.09b   Jeff Garzik: Modularize, init cleanup
    8463   *     1.09c   Jeff Garzik: SMP cleanup
    8464 - *     1.10    Paul Barton-Davis: add support for async I/O
    8465 + *     1.10    Paul Barton-Davis: add support for async I/O
    8466   *     1.10a   Andrea Arcangeli: Alpha updates
    8467   *     1.10b   Andrew Morton: SMP lock fix
    8468   *     1.10c   Cesar Barros: SMP locking fixes and cleanup
    8469   *     1.10d   Paul Gortmaker: delete paranoia check in rtc_exit
    8470   *     1.10e   Maciej W. Rozycki: Handle DECstation's year weirdness.
    8471 - *      1.11    Takashi Iwai: Kernel access functions
    8472 + *     1.11    Takashi Iwai: Kernel access functions
    8473   *                           rtc_register/rtc_unregister/rtc_control
    8474   *      1.11a   Daniele Bellucci: Audit create_proc_read_entry in rtc_init
    8475 - *     1.12    Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer
    8476 + *     1.12    Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer
    8477   *             CONFIG_HPET_EMULATE_RTC
    8478   *     1.12a   Maciej W. Rozycki: Handle memory-mapped chips properly.
    8479   *     1.12ac  Alan Cox: Allow read access to the day of week register
    8480 diff -Naur linux-2.6.18.3/drivers/char/sb1250_duart.c linux-mips-2.6.18.3/drivers/char/sb1250_duart.c
    8481 --- linux-2.6.18.3/drivers/char/sb1250_duart.c  1969-12-31 16:00:00.000000000 -0800
    8482 +++ linux-mips-2.6.18.3/drivers/char/sb1250_duart.c     2006-11-20 10:09:08.000000000 -0800
    8483 @@ -0,0 +1,910 @@
     2872diff -Naur linux-2.6.19/drivers/char/sb1250_duart.c linux-mips-2.6.19/drivers/char/sb1250_duart.c
     2873--- linux-2.6.19/drivers/char/sb1250_duart.c    1969-12-31 16:00:00.000000000 -0800
     2874+++ linux-mips-2.6.19/drivers/char/sb1250_duart.c       2006-11-29 15:23:09.000000000 -0800
     2875@@ -0,0 +1,909 @@
    84842876+/*
    84852877+ * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation
     
    85032895+ * Driver support for the on-chip sb1250 dual-channel serial port,
    85042896+ * running in asynchronous mode.  Also, support for doing a serial console
    8505 + * on one of those ports 
     2897+ * on one of those ports
    85062898+ */
    8507 +#include <linux/config.h>
    85082899+#include <linux/types.h>
    85092900+#include <linux/kernel.h>
     
    87153106+ * Generic interrupt handler for both channels.  dev_id is a pointer
    87163107+ * to the proper uart_states structure, so from that we can derive
    8717 + * which port interrupted 
     3108+ * which port interrupted
    87183109+ */
    87193110+
    8720 +static irqreturn_t duart_int(int irq, void *dev_id, struct pt_regs *regs)
     3111+static irqreturn_t duart_int(int irq, void *dev_id)
    87213112+{
    87223113+       uart_state_t *us = (uart_state_t *)dev_id;
     
    93923783+
    93933784+#endif /* CONFIG_SIBYTE_SB1250_DUART_CONSOLE */
    9394 diff -Naur linux-2.6.18.3/drivers/ide/mips/Makefile linux-mips-2.6.18.3/drivers/ide/mips/Makefile
    9395 --- linux-2.6.18.3/drivers/ide/mips/Makefile    2006-11-18 19:28:22.000000000 -0800
    9396 +++ linux-mips-2.6.18.3/drivers/ide/mips/Makefile       2006-11-20 10:09:08.000000000 -0800
     3785diff -Naur linux-2.6.19/drivers/ide/mips/Makefile linux-mips-2.6.19/drivers/ide/mips/Makefile
     3786--- linux-2.6.19/drivers/ide/mips/Makefile      2006-11-29 13:57:37.000000000 -0800
     3787+++ linux-mips-2.6.19/drivers/ide/mips/Makefile 2006-11-29 15:23:09.000000000 -0800
    93973788@@ -1,4 +1,4 @@
    93983789 obj-$(CONFIG_BLK_DEV_IDE_SWARM)                += swarm.o
     
    94013792-EXTRA_CFLAGS    := -Idrivers/ide
    94023793+CFLAGS_au1xxx-ide.o := -Idrivers/ide
    9403 diff -Naur linux-2.6.18.3/drivers/ide/mips/swarm.c linux-mips-2.6.18.3/drivers/ide/mips/swarm.c
    9404 --- linux-2.6.18.3/drivers/ide/mips/swarm.c     2006-11-18 19:28:22.000000000 -0800
    9405 +++ linux-mips-2.6.18.3/drivers/ide/mips/swarm.c        2006-11-20 10:09:08.000000000 -0800
    9406 @@ -4,6 +4,7 @@
    9407   *     Author: Manish Lachwani, mlachwani@mvista.com
    9408   * Copyright (C) 2004  MIPS Technologies, Inc.  All rights reserved.
    9409   *     Author: Maciej W. Rozycki <macro@mips.com>
    9410 + * Copyright (c) 2006  Maciej W. Rozycki
    9411   *
    9412   * This program is free software; you can redistribute it and/or
    9413   * modify it under the terms of the GNU General Public License
    9414 @@ -127,6 +128,7 @@
    9415         memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
    9416         hwif->irq = hwif->hw.irq;
    9417  
    9418 +       probe_hwif_init(hwif);
    9419         dev_set_drvdata(dev, hwif);
    9420  
    9421         return 0;
    9422 diff -Naur linux-2.6.18.3/drivers/mtd/devices/docprobe.c linux-mips-2.6.18.3/drivers/mtd/devices/docprobe.c
    9423 --- linux-2.6.18.3/drivers/mtd/devices/docprobe.c       2006-11-18 19:28:22.000000000 -0800
    9424 +++ linux-mips-2.6.18.3/drivers/mtd/devices/docprobe.c  2006-11-20 10:09:08.000000000 -0800
     3794diff -Naur linux-2.6.19/drivers/mtd/devices/docprobe.c linux-mips-2.6.19/drivers/mtd/devices/docprobe.c
     3795--- linux-2.6.19/drivers/mtd/devices/docprobe.c 2006-11-29 13:57:37.000000000 -0800
     3796+++ linux-mips-2.6.19/drivers/mtd/devices/docprobe.c    2006-11-29 15:23:09.000000000 -0800
    94253797@@ -83,10 +83,10 @@
    94263798        0xe4000000,
     
    94373809 #endif
    94383810        0xffffffff };
    9439 diff -Naur linux-2.6.18.3/drivers/mtd/maps/Kconfig linux-mips-2.6.18.3/drivers/mtd/maps/Kconfig
    9440 --- linux-2.6.18.3/drivers/mtd/maps/Kconfig     2006-11-18 19:28:22.000000000 -0800
    9441 +++ linux-mips-2.6.18.3/drivers/mtd/maps/Kconfig        2006-11-20 10:09:08.000000000 -0800
    9442 @@ -299,6 +299,18 @@
    9443           Mapping for the Flaga digital module. If you don't have one, ignore
    9444           this setting.
    9445  
    9446 +config MTD_XXS1500
    9447 +       tristate "MyCable XXS1500 Flash device"
    9448 +       depends on MIPS && MIPS_XXS1500
    9449 +       help
    9450 +         Flash memory access on MyCable XXS1500 Board
    9451 +
    9452 +config MTD_MTX1
    9453 +       tristate "4-G Systems MTX-1 Flash device"
    9454 +       depends on MIPS && MIPS_MTX1
    9455 +       help
    9456 +         Flash memory access on 4-G Systems MTX-1 Board
    9457 +
    9458  config MTD_BEECH
    9459         tristate "CFI Flash device mapped on IBM 405LP Beech"
    9460         depends on MTD_CFI && BEECH
    9461 diff -Naur linux-2.6.18.3/drivers/mtd/maps/lasat.c linux-mips-2.6.18.3/drivers/mtd/maps/lasat.c
    9462 --- linux-2.6.18.3/drivers/mtd/maps/lasat.c     2006-11-18 19:28:22.000000000 -0800
    9463 +++ linux-mips-2.6.18.3/drivers/mtd/maps/lasat.c        2006-11-20 10:09:08.000000000 -0800
     3811diff -Naur linux-2.6.19/drivers/mtd/maps/lasat.c linux-mips-2.6.19/drivers/mtd/maps/lasat.c
     3812--- linux-2.6.19/drivers/mtd/maps/lasat.c       2006-11-29 13:57:37.000000000 -0800
     3813+++ linux-mips-2.6.19/drivers/mtd/maps/lasat.c  2006-11-29 15:23:09.000000000 -0800
    94643814@@ -7,7 +7,7 @@
    94653815  * modify it under the terms of the GNU General Public License version
     
    94803830        lasat_map.size = lasat_board_info.li_flash_size;
    94813831 
    9482 diff -Naur linux-2.6.18.3/drivers/net/Kconfig linux-mips-2.6.18.3/drivers/net/Kconfig
    9483 --- linux-2.6.18.3/drivers/net/Kconfig  2006-11-18 19:28:22.000000000 -0800
    9484 +++ linux-mips-2.6.18.3/drivers/net/Kconfig     2006-11-20 10:09:08.000000000 -0800
    9485 @@ -438,6 +438,14 @@
     3832diff -Naur linux-2.6.19/drivers/net/Kconfig linux-mips-2.6.19/drivers/net/Kconfig
     3833--- linux-2.6.19/drivers/net/Kconfig    2006-11-29 13:57:37.000000000 -0800
     3834+++ linux-mips-2.6.19/drivers/net/Kconfig       2006-11-29 15:23:09.000000000 -0800
     3835@@ -441,6 +441,14 @@
    94863836          This is the driver for the onboard card of MIPS Magnum 4000,
    94873837          Acer PICA, Olivetti M700-10 and a few other identical OEM systems.
     
    94953845+         the Galileo (now Marvell) GT64240 chipset.
    94963846+
    9497  config MIPS_GT96100ETH
    9498         bool "MIPS GT96100 Ethernet support"
    9499         depends on NET_ETHERNET && MIPS_GT96100
    9500 @@ -453,10 +461,6 @@
     3847 config MIPS_AU1X00_ENET
     3848        bool "MIPS AU1000 Ethernet support"
     3849        depends on NET_ETHERNET && SOC_AU1X00
     3850@@ -450,10 +458,6 @@
    95013851          If you have an Alchemy Semi AU1X00 based system
    95023852          say Y.  Otherwise, say N.
     
    95093859        bool "SGI IOC3 Ethernet"
    95103860        depends on NET_ETHERNET && PCI && SGI_IP27
    9511 @@ -467,25 +471,13 @@
     3861@@ -464,25 +468,13 @@
    95123862          the Ethernet-HOWTO, available from
    95133863          <http://www.tldp.org/docs.html#howto>.
     
    95413891 config MIPS_SIM_NET
    95423892        tristate "MIPS simulator Network device (EXPERIMENTAL)"
    9543 @@ -2035,6 +2027,10 @@
     3893@@ -2065,6 +2057,10 @@
    95443894 
    95453895          If in doubt, say N.
     
    95523902        bool "VLAN support"
    95533903        depends on R8169 && VLAN_8021Q
    9554 @@ -2266,8 +2262,8 @@
     3904@@ -2296,8 +2292,8 @@
    95553905        select MII
    95563906        help
     
    95633913 config MV643XX_ETH_0
    95643914        bool "MV-643XX Port 0"
    9565 @@ -2290,6 +2286,20 @@
     3915@@ -2320,6 +2316,20 @@
    95663916          This enables support for Port 2 of the Marvell MV643XX Gigabit
    95673917          Ethernet.
     
    95813931+         PMC-Sierra's Titan SoC.
    95823932+
    9583  endmenu
    9584  
    9585  #
    9586 diff -Naur linux-2.6.18.3/drivers/net/Makefile linux-mips-2.6.18.3/drivers/net/Makefile
    9587 --- linux-2.6.18.3/drivers/net/Makefile 2006-11-18 19:28:22.000000000 -0800
    9588 +++ linux-mips-2.6.18.3/drivers/net/Makefile    2006-11-20 10:09:08.000000000 -0800
    9589 @@ -114,6 +114,11 @@
    9590  
     3933 config QLA3XXX
     3934        tristate "QLogic QLA3XXX Network Driver Support"
     3935        depends on PCI
     3936diff -Naur linux-2.6.19/drivers/net/Makefile linux-mips-2.6.19/drivers/net/Makefile
     3937--- linux-2.6.19/drivers/net/Makefile   2006-11-29 13:57:37.000000000 -0800
     3938+++ linux-mips-2.6.19/drivers/net/Makefile      2006-11-29 15:23:09.000000000 -0800
     3939@@ -112,6 +112,10 @@
    95913940 obj-$(CONFIG_MV643XX_ETH) += mv643xx_eth.o
     3941 obj-$(CONFIG_QLA3XXX) += qla3xxx.o
    95923942 
    95933943+obj-$(CONFIG_GALILEO_64240_ETH) += gt64240eth.o
    9594 +obj-$(CONFIG_MV64340_ETH) += mv64340_eth.o
    95953944+obj-$(CONFIG_BIG_SUR_FE) += big_sur_ge.o
    95963945+obj-$(CONFIG_TITAN_GE) += titan_mdio.o titan_ge.o
    95973946+
    9598  obj-$(CONFIG_PPP) += ppp_generic.o slhc.o
     3947 obj-$(CONFIG_PPP) += ppp_generic.o
    95993948 obj-$(CONFIG_PPP_ASYNC) += ppp_async.o
    96003949 obj-$(CONFIG_PPP_SYNC_TTY) += ppp_synctty.o
    9601 diff -Naur linux-2.6.18.3/drivers/net/big_sur_ge.c linux-mips-2.6.18.3/drivers/net/big_sur_ge.c
    9602 --- linux-2.6.18.3/drivers/net/big_sur_ge.c     1969-12-31 16:00:00.000000000 -0800
    9603 +++ linux-mips-2.6.18.3/drivers/net/big_sur_ge.c        2006-11-20 10:09:08.000000000 -0800
    9604 @@ -0,0 +1,2005 @@
     3950diff -Naur linux-2.6.19/drivers/net/big_sur_ge.c linux-mips-2.6.19/drivers/net/big_sur_ge.c
     3951--- linux-2.6.19/drivers/net/big_sur_ge.c       1969-12-31 16:00:00.000000000 -0800
     3952+++ linux-mips-2.6.19/drivers/net/big_sur_ge.c  2006-11-29 15:23:09.000000000 -0800
     3953@@ -0,0 +1,2004 @@
    96053954+/*
    96063955+ * drivers/net/big_sur_ge.c - Driver for PMC-Sierra Big Sur ethernet ports
     
    101734522+}
    101744523+
    10175 +static irqreturn_t big_sur_ge_int_handler(int irq, void *dev_id,
    10176 +                                  struct pt_regs *regs)
     4524+static irqreturn_t big_sur_ge_int_handler(int irq, void *dev_id)
    101774525+{
    101784526+       struct net_device *netdev = dev_id;
     
    116085956+MODULE_DESCRIPTION("PMC-Sierra Big Sur Ethernet MAC Driver");
    116095957+MODULE_LICENSE("GPL");
    11610 diff -Naur linux-2.6.18.3/drivers/net/big_sur_ge.h linux-mips-2.6.18.3/drivers/net/big_sur_ge.h
    11611 --- linux-2.6.18.3/drivers/net/big_sur_ge.h     1969-12-31 16:00:00.000000000 -0800
    11612 +++ linux-mips-2.6.18.3/drivers/net/big_sur_ge.h        2006-11-20 10:09:08.000000000 -0800
     5958diff -Naur linux-2.6.19/drivers/net/big_sur_ge.h linux-mips-2.6.19/drivers/net/big_sur_ge.h
     5959--- linux-2.6.19/drivers/net/big_sur_ge.h       1969-12-31 16:00:00.000000000 -0800
     5960+++ linux-mips-2.6.19/drivers/net/big_sur_ge.h  2006-11-29 15:23:09.000000000 -0800
    116135961@@ -0,0 +1,713 @@
    116145962+/*
     
    123256673+
    123266674+#endif
    12327 diff -Naur linux-2.6.18.3/drivers/net/gt64240eth.c linux-mips-2.6.18.3/drivers/net/gt64240eth.c
    12328 --- linux-2.6.18.3/drivers/net/gt64240eth.c     1969-12-31 16:00:00.000000000 -0800
    12329 +++ linux-mips-2.6.18.3/drivers/net/gt64240eth.c        2006-11-20 10:09:08.000000000 -0800
    12330 @@ -0,0 +1,1672 @@
     6675diff -Naur linux-2.6.19/drivers/net/gt64240eth.c linux-mips-2.6.19/drivers/net/gt64240eth.c
     6676--- linux-2.6.19/drivers/net/gt64240eth.c       1969-12-31 16:00:00.000000000 -0800
     6677+++ linux-mips-2.6.19/drivers/net/gt64240eth.c  2006-11-29 15:23:09.000000000 -0800
     6678@@ -0,0 +1,1671 @@
    123316679+/*
    123326680+ * This file is subject to the terms and conditions of the GNU General Public
     
    124586806+static struct net_device_stats *gt64240_get_stats(struct net_device *dev);
    124596807+
    12460 +extern char *__init prom_getcmdline(void);
     6808+extern char * prom_getcmdline(void);
    124616809+extern int prom_get_mac_addrs(unsigned char
    124626810+                             station_addr[NUM_INTERFACES][6]);
     
    129747322+}
    129757323+
    12976 +static irqreturn_t gt64240_interrupt(int irq, void *dev_id,
    12977 +       struct pt_regs *regs)
     7324+static irqreturn_t gt64240_interrupt(int irq, void *dev_id)
    129787325+{
    129797326+       struct net_device *dev = (struct net_device *) dev_id;
     
    140018348+       return &gp->stats;
    140028349+}
    14003 diff -Naur linux-2.6.18.3/drivers/net/gt64240eth.h linux-mips-2.6.18.3/drivers/net/gt64240eth.h
    14004 --- linux-2.6.18.3/drivers/net/gt64240eth.h     2006-11-18 19:28:22.000000000 -0800
    14005 +++ linux-mips-2.6.18.3/drivers/net/gt64240eth.h        2006-11-20 10:09:08.000000000 -0800
    14006 @@ -9,6 +9,7 @@
    14007   * Copyright 2000 MontaVista Software Inc.
    14008   * Author: MontaVista Software, Inc.
    14009   *             stevel@mvista.com or support@mvista.com
     8350diff -Naur linux-2.6.19/drivers/net/gt64240eth.h linux-mips-2.6.19/drivers/net/gt64240eth.h
     8351--- linux-2.6.19/drivers/net/gt64240eth.h       1969-12-31 16:00:00.000000000 -0800
     8352+++ linux-mips-2.6.19/drivers/net/gt64240eth.h  2006-11-29 15:23:09.000000000 -0800
     8353@@ -0,0 +1,403 @@
     8354+/*
     8355+ * This file is subject to the terms and conditions of the GNU General Public
     8356+ * License.  See the file "COPYING" in the main directory of this archive
     8357+ * for more details.
     8358+ *
     8359+ * Copyright (C) 2001 Patton Electronics Company
     8360+ * Copyright (C) 2002 Momentum Computer
     8361+ *
     8362+ * Copyright 2000 MontaVista Software Inc.
     8363+ * Author: MontaVista Software, Inc.
     8364+ *             stevel@mvista.com or support@mvista.com
    140108365+ * Copyright 2004, 05 Ralf Baechle (ralf@linux-mips.org)
    14011   *
    14012   *  This program is free software; you can distribute it and/or modify it
    14013   *  under the terms of the GNU General Public License (Version 2) as
    14014 @@ -31,6 +32,7 @@
    14015  #ifndef _GT64240ETH_H
    14016  #define _GT64240ETH_H
    14017  
    14018 +#include <linux/config.h>
    14019  #include <asm/gt64240.h>
    14020  
    14021  #define ETHERNET_PORTS_DIFFERENCE_OFFSETS      0x400
    14022 @@ -108,10 +110,10 @@
    14023  #define REV_GT64240A 0x10
    14024  
    14025  #define GT64240ETH_READ(gp, offset)                                    \
    14026 -       GT_READ((gp)->port_offset + (offset))
     8366+ *
     8367+ *  This program is free software; you can distribute it and/or modify it
     8368+ *  under the terms of the GNU General Public License (Version 2) as
     8369+ *  published by the Free Software Foundation.
     8370+ *
     8371+ *  This program is distributed in the hope it will be useful, but WITHOUT
     8372+ *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     8373+ *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     8374+ *  for more details.
     8375+ *
     8376+ *  You should have received a copy of the GNU General Public License along
     8377+ *  with this program; if not, write to the Free Software Foundation, Inc.,
     8378+ *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
     8379+ *
     8380+ * Ethernet driver definitions for the MIPS GT96100 Advanced
     8381+ * Communication Controller.
     8382+ *
     8383+ * Modified for the Marvellous GT64240 Retarded Communication Controller.
     8384+ */
     8385+#ifndef _GT64240ETH_H
     8386+#define _GT64240ETH_H
     8387+
     8388+#include <asm/gt64240.h>
     8389+
     8390+#define ETHERNET_PORTS_DIFFERENCE_OFFSETS      0x400
     8391+
     8392+/* Translate those weanie names from Galileo/VxWorks header files: */
     8393+
     8394+#define GT64240_MRR                    MAIN_ROUTING_REGISTER
     8395+#define GT64240_CIU_ARBITER_CONFIG     COMM_UNIT_ARBITER_CONFIGURATION_REGISTER
     8396+#define GT64240_CIU_ARBITER_CONTROL    COMM_UNIT_ARBITER_CONTROL
     8397+#define GT64240_MAIN_LOW_CAUSE         LOW_INTERRUPT_CAUSE_REGISTER
     8398+#define GT64240_MAIN_HIGH_CAUSE        HIGH_INTERRUPT_CAUSE_REGISTER
     8399+#define GT64240_CPU_LOW_MASK           CPU_INTERRUPT_MASK_REGISTER_LOW
     8400+#define GT64240_CPU_HIGH_MASK          CPU_INTERRUPT_MASK_REGISTER_HIGH
     8401+#define GT64240_CPU_SELECT_CAUSE       CPU_SELECT_CAUSE_REGISTER
     8402+
     8403+#define GT64240_ETH_PHY_ADDR_REG       ETHERNET_PHY_ADDRESS_REGISTER
     8404+#define GT64240_ETH_PORT_CONFIG        ETHERNET0_PORT_CONFIGURATION_REGISTER
     8405+#define GT64240_ETH_PORT_CONFIG_EXT    ETHERNET0_PORT_CONFIGURATION_EXTEND_REGISTER
     8406+#define GT64240_ETH_PORT_COMMAND       ETHERNET0_PORT_COMMAND_REGISTER
     8407+#define GT64240_ETH_PORT_STATUS        ETHERNET0_PORT_STATUS_REGISTER
     8408+#define GT64240_ETH_IO_SIZE            ETHERNET_PORTS_DIFFERENCE_OFFSETS
     8409+#define GT64240_ETH_SMI_REG            ETHERNET_SMI_REGISTER
     8410+#define GT64240_ETH_MIB_COUNT_BASE     ETHERNET0_MIB_COUNTER_BASE
     8411+#define GT64240_ETH_SDMA_CONFIG        ETHERNET0_SDMA_CONFIGURATION_REGISTER
     8412+#define GT64240_ETH_SDMA_COMM          ETHERNET0_SDMA_COMMAND_REGISTER
     8413+#define GT64240_ETH_INT_MASK           ETHERNET0_INTERRUPT_MASK_REGISTER
     8414+#define GT64240_ETH_INT_CAUSE          ETHERNET0_INTERRUPT_CAUSE_REGISTER
     8415+#define GT64240_ETH_CURR_TX_DESC_PTR0  ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER0
     8416+#define GT64240_ETH_CURR_TX_DESC_PTR1  ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER1
     8417+#define GT64240_ETH_1ST_RX_DESC_PTR0   ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER0
     8418+#define GT64240_ETH_CURR_RX_DESC_PTR0  ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER0
     8419+#define GT64240_ETH_HASH_TBL_PTR       ETHERNET0_HASH_TABLE_POINTER_REGISTER
     8420+
     8421+/* Turn on NAPI by default */
     8422+
     8423+#define        GT64240_NAPI                    1
     8424+
     8425+/* Some 64240 settings that SHOULD eventually be setup in PROM monitor: */
     8426+/* (Board-specific to the DSL3224 Rev A board ONLY!)                    */
     8427+#define D3224_MPP_CTRL0_SETTING                0x66669900
     8428+#define D3224_MPP_CTRL1_SETTING                0x00000000
     8429+#define D3224_MPP_CTRL2_SETTING                0x00887700
     8430+#define D3224_MPP_CTRL3_SETTING                0x00000044
     8431+#define D3224_GPP_IO_CTRL_SETTING      0x0000e800
     8432+#define D3224_GPP_LEVEL_CTRL_SETTING   0xf001f703
     8433+#define D3224_GPP_VALUE_SETTING                0x00000000
     8434+
     8435+/* Keep the ring sizes a power of two for efficiency. */
     8436+//-#define TX_RING_SIZE 16
     8437+#define TX_RING_SIZE   64      /* TESTING !!! */
     8438+#define RX_RING_SIZE   32
     8439+#define PKT_BUF_SZ     1536    /* Size of each temporary Rx buffer. */
     8440+
     8441+#define RX_HASH_TABLE_SIZE 16384
     8442+#define HASH_HOP_NUMBER 12
     8443+
     8444+#define NUM_INTERFACES 3
     8445+
     8446+#define GT64240ETH_TX_TIMEOUT HZ/4
     8447+
     8448+#define MIPS_GT64240_BASE 0xf4000000
     8449+#define GT64240_ETH0_BASE (MIPS_GT64240_BASE + GT64240_ETH_PORT_CONFIG)
     8450+#define GT64240_ETH1_BASE (GT64240_ETH0_BASE + GT64240_ETH_IO_SIZE)
     8451+#define GT64240_ETH2_BASE (GT64240_ETH1_BASE + GT64240_ETH_IO_SIZE)
     8452+
     8453+#if defined(CONFIG_MIPS_DSL3224)
     8454+#define GT64240_ETHER0_IRQ 4
     8455+#define GT64240_ETHER1_IRQ 4
     8456+#else
     8457+#define GT64240_ETHER0_IRQ -1
     8458+#define GT64240_ETHER1_IRQ -1
     8459+#endif
     8460+
     8461+#define REV_GT64240  0x1
     8462+#define REV_GT64240A 0x10
     8463+
     8464+#define GT64240ETH_READ(gp, offset)                                    \
    140278465+       MV_READ((gp)->port_offset + (offset))
    14028  
    14029  #define GT64240ETH_WRITE(gp, offset, data)                             \
    14030 -       GT_WRITE((gp)->port_offset + (offset), (data))
     8466+
     8467+#define GT64240ETH_WRITE(gp, offset, data)                             \
    140318468+       MV_WRITE((gp)->port_offset + (offset), (data))
    14032  
    14033  #define GT64240ETH_SETBIT(gp, offset, bits)                            \
    14034         GT64240ETH_WRITE((gp), (offset),                                \
    14035 @@ -121,8 +123,8 @@
    14036         GT64240ETH_WRITE((gp), (offset),                                \
    14037                          GT64240ETH_READ((gp), (offset)) & ~(bits))
    14038  
    14039 -#define GT64240_READ(ofs)              GT_READ(ofs)
    14040 -#define GT64240_WRITE(ofs, data)       GT_WRITE((ofs), (data))
     8469+
     8470+#define GT64240ETH_SETBIT(gp, offset, bits)                            \
     8471+       GT64240ETH_WRITE((gp), (offset),                                \
     8472+                        GT64240ETH_READ((gp), (offset)) | (bits))
     8473+
     8474+#define GT64240ETH_CLRBIT(gp, offset, bits)                            \
     8475+       GT64240ETH_WRITE((gp), (offset),                                \
     8476+                        GT64240ETH_READ((gp), (offset)) & ~(bits))
     8477+
    140418478+#define GT64240_READ(ofs)              MV_READ(ofs)
    140428479+#define GT64240_WRITE(ofs, data)       MV_WRITE((ofs), (data))
    14043  
    14044  /* Bit definitions of the SMI Reg */
    14045  enum {
    14046 diff -Naur linux-2.6.18.3/drivers/net/ioc3-eth.c linux-mips-2.6.18.3/drivers/net/ioc3-eth.c
    14047 --- linux-2.6.18.3/drivers/net/ioc3-eth.c       2006-11-18 19:28:22.000000000 -0800
    14048 +++ linux-mips-2.6.18.3/drivers/net/ioc3-eth.c  2006-11-20 10:09:08.000000000 -0800
     8480+
     8481+/* Bit definitions of the SMI Reg */
     8482+enum {
     8483+       smirDataMask = 0xffff,
     8484+       smirPhyAdMask = 0x1f << 16,
     8485+       smirPhyAdBit = 16,
     8486+       smirRegAdMask = 0x1f << 21,
     8487+       smirRegAdBit = 21,
     8488+       smirOpCode = 1 << 26,
     8489+       smirReadValid = 1 << 27,
     8490+       smirBusy = 1 << 28
     8491+};
     8492+
     8493+/* Bit definitions of the Port Config Reg */
     8494+enum pcr_bits {
     8495+       pcrPM = 1 << 0,
     8496+       pcrRBM = 1 << 1,
     8497+       pcrPBF = 1 << 2,
     8498+       pcrEN = 1 << 7,
     8499+       pcrLPBKMask = 0x3 << 8,
     8500+       pcrLPBKBit = 1 << 8,
     8501+       pcrFC = 1 << 10,
     8502+       pcrHS = 1 << 12,
     8503+       pcrHM = 1 << 13,
     8504+       pcrHDM = 1 << 14,
     8505+       pcrHD = 1 << 15,
     8506+       pcrISLMask = 0x7 << 28,
     8507+       pcrISLBit = 28,
     8508+       pcrACCS = 1 << 31
     8509+};
     8510+
     8511+/* Bit definitions of the Port Config Extend Reg */
     8512+enum pcxr_bits {
     8513+       pcxrIGMP = 1,
     8514+       pcxrSPAN = 2,
     8515+       pcxrPAR = 4,
     8516+       pcxrPRIOtxMask = 0x7 << 3,
     8517+       pcxrPRIOtxBit = 3,
     8518+       pcxrPRIOrxMask = 0x3 << 6,
     8519+       pcxrPRIOrxBit = 6,
     8520+       pcxrPRIOrxOverride = 1 << 8,
     8521+       pcxrDPLXen = 1 << 9,
     8522+       pcxrFCTLen = 1 << 10,
     8523+       pcxrFLP = 1 << 11,
     8524+       pcxrFCTL = 1 << 12,
     8525+       pcxrMFLMask = 0x3 << 14,
     8526+       pcxrMFLBit = 14,
     8527+       pcxrMIBclrMode = 1 << 16,
     8528+       pcxrSpeed = 1 << 18,
     8529+       pcxrSpeeden = 1 << 19,
     8530+       pcxrRMIIen = 1 << 20,
     8531+       pcxrDSCPen = 1 << 21
     8532+};
     8533+
     8534+/* Bit definitions of the Port Command Reg */
     8535+enum pcmr_bits {
     8536+       pcmrFJ = 1 << 15
     8537+};
     8538+
     8539+
     8540+/* Bit definitions of the Port Status Reg */
     8541+enum psr_bits {
     8542+       psrSpeed = 1,
     8543+       psrDuplex = 2,
     8544+       psrFctl = 4,
     8545+       psrLink = 8,
     8546+       psrPause = 1 << 4,
     8547+       psrTxLow = 1 << 5,
     8548+       psrTxHigh = 1 << 6,
     8549+       psrTxInProg = 1 << 7
     8550+};
     8551+
     8552+/* Bit definitions of the SDMA Config Reg */
     8553+enum sdcr_bits {
     8554+       sdcrRCMask = 0xf << 2,
     8555+       sdcrRCBit = 2,
     8556+       sdcrBLMR = 1 << 6,
     8557+       sdcrBLMT = 1 << 7,
     8558+       sdcrPOVR = 1 << 8,
     8559+       sdcrRIFB = 1 << 9,
     8560+       sdcrBSZMask = 0x3 << 12,
     8561+       sdcrBSZBit = 12
     8562+};
     8563+
     8564+/* Bit definitions of the SDMA Command Reg */
     8565+enum sdcmr_bits {
     8566+       sdcmrERD = 1 << 7,
     8567+       sdcmrAR = 1 << 15,
     8568+       sdcmrSTDH = 1 << 16,
     8569+       sdcmrSTDL = 1 << 17,
     8570+       sdcmrTXDH = 1 << 23,
     8571+       sdcmrTXDL = 1 << 24,
     8572+       sdcmrAT = 1 << 31
     8573+};
     8574+
     8575+/* Bit definitions of the Interrupt Cause Reg */
     8576+enum icr_bits {
     8577+       icrRxBuffer = 1,
     8578+       icrTxBufferHigh = 1 << 2,
     8579+       icrTxBufferLow = 1 << 3,
     8580+       icrTxEndHigh = 1 << 6,
     8581+       icrTxEndLow = 1 << 7,
     8582+       icrRxError = 1 << 8,
     8583+       icrTxErrorHigh = 1 << 10,
     8584+       icrTxErrorLow = 1 << 11,
     8585+       icrRxOVR = 1 << 12,
     8586+       icrTxUdr = 1 << 13,
     8587+       icrRxBufferQ0 = 1 << 16,
     8588+       icrRxBufferQ1 = 1 << 17,
     8589+       icrRxBufferQ2 = 1 << 18,
     8590+       icrRxBufferQ3 = 1 << 19,
     8591+       icrRxErrorQ0 = 1 << 20,
     8592+       icrRxErrorQ1 = 1 << 21,
     8593+       icrRxErrorQ2 = 1 << 22,
     8594+       icrRxErrorQ3 = 1 << 23,
     8595+       icrMIIPhySTC = 1 << 28,
     8596+       icrSMIdone = 1 << 29,
     8597+       icrEtherIntSum = 1 << 31
     8598+};
     8599+
     8600+
     8601+/* The Rx and Tx descriptor lists. */
     8602+#ifdef __LITTLE_ENDIAN
     8603+typedef struct {
     8604+       u32 cmdstat;
     8605+       u16 reserved;           //-prk21aug01    u32 reserved:16;
     8606+       u16 byte_cnt;           //-prk21aug01    u32 byte_cnt:16;
     8607+       u32 buff_ptr;
     8608+       u32 next;
     8609+} gt64240_td_t;
     8610+
     8611+typedef struct {
     8612+       u32 cmdstat;
     8613+       u16 byte_cnt;           //-prk21aug01    u32 byte_cnt:16;
     8614+       u16 buff_sz;            //-prk21aug01    u32 buff_sz:16;
     8615+       u32 buff_ptr;
     8616+       u32 next;
     8617+} gt64240_rd_t;
     8618+#elif defined(__BIG_ENDIAN)
     8619+typedef struct {
     8620+       u16 byte_cnt;           //-prk21aug01    u32 byte_cnt:16;
     8621+       u16 reserved;           //-prk21aug01    u32 reserved:16;
     8622+       u32 cmdstat;
     8623+       u32 next;
     8624+       u32 buff_ptr;
     8625+} gt64240_td_t;
     8626+
     8627+typedef struct {
     8628+       u16 buff_sz;            //-prk21aug01    u32 buff_sz:16;
     8629+       u16 byte_cnt;           //-prk21aug01    u32 byte_cnt:16;
     8630+       u32 cmdstat;
     8631+       u32 next;
     8632+       u32 buff_ptr;
     8633+} gt64240_rd_t;
     8634+#else
     8635+#error Either __BIG_ENDIAN or __LITTLE_ENDIAN must be defined!
     8636+#endif
     8637+
     8638+
     8639+/* Values for the Tx command-status descriptor entry. */
     8640+enum td_cmdstat {
     8641+       txOwn = 1 << 31,
     8642+       txAutoMode = 1 << 30,
     8643+       txEI = 1 << 23,
     8644+       txGenCRC = 1 << 22,
     8645+       txPad = 1 << 18,
     8646+       txFirst = 1 << 17,
     8647+       txLast = 1 << 16,
     8648+       txErrorSummary = 1 << 15,
     8649+       txReTxCntMask = 0x0f << 10,
     8650+       txReTxCntBit = 10,
     8651+       txCollision = 1 << 9,
     8652+       txReTxLimit = 1 << 8,
     8653+       txUnderrun = 1 << 6,
     8654+       txLateCollision = 1 << 5
     8655+};
     8656+
     8657+
     8658+/* Values for the Rx command-status descriptor entry. */
     8659+enum rd_cmdstat {
     8660+       rxOwn = 1 << 31,
     8661+       rxAutoMode = 1 << 30,
     8662+       rxEI = 1 << 23,
     8663+       rxFirst = 1 << 17,
     8664+       rxLast = 1 << 16,
     8665+       rxErrorSummary = 1 << 15,
     8666+       rxIGMP = 1 << 14,
     8667+       rxHashExpired = 1 << 13,
     8668+       rxMissedFrame = 1 << 12,
     8669+       rxFrameType = 1 << 11,
     8670+       rxShortFrame = 1 << 8,
     8671+       rxMaxFrameLen = 1 << 7,
     8672+       rxOverrun = 1 << 6,
     8673+       rxCollision = 1 << 4,
     8674+       rxCRCError = 1
     8675+};
     8676+
     8677+/* Bit fields of a Hash Table Entry */
     8678+enum hash_table_entry {
     8679+       hteValid = 1,
     8680+       hteSkip = 2,
     8681+       hteRD = 4
     8682+};
     8683+
     8684+// The MIB counters
     8685+typedef struct {
     8686+       u32 byteReceived;
     8687+       u32 byteSent;
     8688+       u32 framesReceived;
     8689+       u32 framesSent;
     8690+       u32 totalByteReceived;
     8691+       u32 totalFramesReceived;
     8692+       u32 broadcastFramesReceived;
     8693+       u32 multicastFramesReceived;
     8694+       u32 cRCError;
     8695+       u32 oversizeFrames;
     8696+       u32 fragments;
     8697+       u32 jabber;
     8698+       u32 collision;
     8699+       u32 lateCollision;
     8700+       u32 frames64;
     8701+       u32 frames65_127;
     8702+       u32 frames128_255;
     8703+       u32 frames256_511;
     8704+       u32 frames512_1023;
     8705+       u32 frames1024_MaxSize;
     8706+       u32 macRxError;
     8707+       u32 droppedFrames;
     8708+       u32 outMulticastFrames;
     8709+       u32 outBroadcastFrames;
     8710+       u32 undersizeFrames;
     8711+} mib_counters_t;
     8712+
     8713+
     8714+struct gt64240_private {
     8715+       gt64240_rd_t *rx_ring;
     8716+       gt64240_td_t *tx_ring;
     8717+       // The Rx and Tx rings must be 16-byte aligned
     8718+       dma_addr_t rx_ring_dma;
     8719+       dma_addr_t tx_ring_dma;
     8720+       char *hash_table;
     8721+       // The Hash Table must be 8-byte aligned
     8722+       dma_addr_t hash_table_dma;
     8723+       int hash_mode;
     8724+
     8725+       // The Rx buffers must be 8-byte aligned
     8726+       char *rx_buff;
     8727+       dma_addr_t rx_buff_dma;
     8728+       // Tx buffers (tx_skbuff[i]->data) with less than 8 bytes
     8729+       // of payload must be 8-byte aligned
     8730+       struct sk_buff *tx_skbuff[TX_RING_SIZE];
     8731+       int rx_next_out;        /* The next free ring entry to receive */
     8732+       int tx_next_in;         /* The next free ring entry to send */
     8733+       int tx_next_out;        /* The last ring entry the ISR processed */
     8734+       int tx_count;           /* current # of pkts waiting to be sent in Tx ring */
     8735+       int intr_work_done;     /* number of Rx and Tx pkts processed in the isr */
     8736+       int tx_full;            /* Tx ring is full */
     8737+
     8738+       mib_counters_t mib;
     8739+       struct net_device_stats stats;
     8740+
     8741+       int io_size;
     8742+       int port_num;           // 0 or 1
     8743+       u32 port_offset;
     8744+
     8745+       int phy_addr;           // PHY address
     8746+       u32 last_psr;           // last value of the port status register
     8747+
     8748+       int options;            /* User-settable misc. driver options. */
     8749+       int drv_flags;
     8750+       spinlock_t lock;        /* Serialise access to device */
     8751+       struct mii_if_info mii_if;
     8752+
     8753+       u32 msg_enable;
     8754+};
     8755+
     8756+#endif /* _GT64240ETH_H */
     8757diff -Naur linux-2.6.19/drivers/net/ioc3-eth.c linux-mips-2.6.19/drivers/net/ioc3-eth.c
     8758--- linux-2.6.19/drivers/net/ioc3-eth.c 2006-11-29 13:57:37.000000000 -0800
     8759+++ linux-mips-2.6.19/drivers/net/ioc3-eth.c    2006-11-29 15:23:09.000000000 -0800
    140498760@@ -5,7 +5,7 @@
    140508761  *
     
    141608871+}
    141618872+
    14162  static struct ethtool_ops ioc3_ethtool_ops = {
     8873 static const struct ethtool_ops ioc3_ethtool_ops = {
    141638874        .get_drvinfo            = ioc3_get_drvinfo,
    141648875        .get_settings           = ioc3_get_settings,
     
    141738884 
    141748885 static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
    14175 diff -Naur linux-2.6.18.3/drivers/net/titan_ge.c linux-mips-2.6.18.3/drivers/net/titan_ge.c
    14176 --- linux-2.6.18.3/drivers/net/titan_ge.c       1969-12-31 16:00:00.000000000 -0800
    14177 +++ linux-mips-2.6.18.3/drivers/net/titan_ge.c  2006-11-20 10:09:08.000000000 -0800
    14178 @@ -0,0 +1,2071 @@
     8886diff -Naur linux-2.6.19/drivers/net/titan_ge.c linux-mips-2.6.19/drivers/net/titan_ge.c
     8887--- linux-2.6.19/drivers/net/titan_ge.c 1969-12-31 16:00:00.000000000 -0800
     8888+++ linux-mips-2.6.19/drivers/net/titan_ge.c    2006-11-29 15:23:09.000000000 -0800
     8889@@ -0,0 +1,2069 @@
    141798890+/*
    141808891+ * drivers/net/titan_ge.c - Driver for Titan ethernet ports
     
    142258936+ */
    142268937+
    14227 +#include <linux/config.h>
    142288938+#include <linux/dma-mapping.h>
    142298939+#include <linux/module.h>
     
    145499259+ * the channel.
    145509260+ */
    14551 +static irqreturn_t titan_ge_int_handler(int irq, void *dev_id,
    14552 +       struct pt_regs *regs)
     9261+static irqreturn_t titan_ge_int_handler(int irq, void *dev_id)
    145539262+{
    145549263+       struct net_device *netdev = (struct net_device *) dev_id;
     
    1624810957+module_init(titan_ge_init_module);
    1624910958+module_exit(titan_ge_cleanup_module);
    16250 diff -Naur linux-2.6.18.3/drivers/net/titan_ge.h linux-mips-2.6.18.3/drivers/net/titan_ge.h
    16251 --- linux-2.6.18.3/drivers/net/titan_ge.h       1969-12-31 16:00:00.000000000 -0800
    16252 +++ linux-mips-2.6.18.3/drivers/net/titan_ge.h  2006-11-20 10:09:08.000000000 -0800
    16253 @@ -0,0 +1,417 @@
     10959diff -Naur linux-2.6.19/drivers/net/titan_ge.h linux-mips-2.6.19/drivers/net/titan_ge.h
     10960--- linux-2.6.19/drivers/net/titan_ge.h 1969-12-31 16:00:00.000000000 -0800
     10961+++ linux-mips-2.6.19/drivers/net/titan_ge.h    2006-11-29 15:23:09.000000000 -0800
     10962@@ -0,0 +1,415 @@
    1625410963+#ifndef _TITAN_GE_H_
    1625510964+#define _TITAN_GE_H_
    1625610965+
    16257 +#include <linux/config.h>
    1625810966+#include <linux/module.h>
    1625910967+#include <linux/kernel.h>
    16260 +#include <linux/config.h>
    1626110968+#include <linux/spinlock.h>
    1626210969+#include <asm/byteorder.h>
     
    1666911376+#endif                                 /* _TITAN_GE_H_ */
    1667011377+
    16671 diff -Naur linux-2.6.18.3/drivers/net/titan_mdio.c linux-mips-2.6.18.3/drivers/net/titan_mdio.c
    16672 --- linux-2.6.18.3/drivers/net/titan_mdio.c     1969-12-31 16:00:00.000000000 -0800
    16673 +++ linux-mips-2.6.18.3/drivers/net/titan_mdio.c        2006-11-20 10:09:08.000000000 -0800
     11378diff -Naur linux-2.6.19/drivers/net/titan_mdio.c linux-mips-2.6.19/drivers/net/titan_mdio.c
     11379--- linux-2.6.19/drivers/net/titan_mdio.c       1969-12-31 16:00:00.000000000 -0800
     11380+++ linux-mips-2.6.19/drivers/net/titan_mdio.c  2006-11-29 15:23:09.000000000 -0800
    1667411381@@ -0,0 +1,217 @@
    1667511382+/*
     
    1689011597+}
    1689111598+
    16892 diff -Naur linux-2.6.18.3/drivers/net/titan_mdio.h linux-mips-2.6.18.3/drivers/net/titan_mdio.h
    16893 --- linux-2.6.18.3/drivers/net/titan_mdio.h     1969-12-31 16:00:00.000000000 -0800
    16894 +++ linux-mips-2.6.18.3/drivers/net/titan_mdio.h        2006-11-20 10:09:08.000000000 -0800
     11599diff -Naur linux-2.6.19/drivers/net/titan_mdio.h linux-mips-2.6.19/drivers/net/titan_mdio.h
     11600--- linux-2.6.19/drivers/net/titan_mdio.h       1969-12-31 16:00:00.000000000 -0800
     11601+++ linux-mips-2.6.19/drivers/net/titan_mdio.h  2006-11-29 15:23:09.000000000 -0800
    1689511602@@ -0,0 +1,56 @@
    1689611603+/*
     
    1695011657+
    1695111658+#endif /* _TITAN_MDIO_H */
    16952 diff -Naur linux-2.6.18.3/drivers/scsi/NCR53C9x.h linux-mips-2.6.18.3/drivers/scsi/NCR53C9x.h
    16953 --- linux-2.6.18.3/drivers/scsi/NCR53C9x.h      2006-11-18 19:28:22.000000000 -0800
    16954 +++ linux-mips-2.6.18.3/drivers/scsi/NCR53C9x.h 2006-11-20 10:09:08.000000000 -0800
     11659diff -Naur linux-2.6.19/drivers/scsi/NCR53C9x.h linux-mips-2.6.19/drivers/scsi/NCR53C9x.h
     11660--- linux-2.6.19/drivers/scsi/NCR53C9x.h        2006-11-29 13:57:37.000000000 -0800
     11661+++ linux-mips-2.6.19/drivers/scsi/NCR53C9x.h   2006-11-29 15:23:09.000000000 -0800
    1695511662@@ -144,12 +144,7 @@
    1695611663 
     
    1696711674 
    1696811675 struct ESP_regs {
    16969 diff -Naur linux-2.6.18.3/drivers/scsi/dec_esp.c linux-mips-2.6.18.3/drivers/scsi/dec_esp.c
    16970 --- linux-2.6.18.3/drivers/scsi/dec_esp.c       2006-11-18 19:28:22.000000000 -0800
    16971 +++ linux-mips-2.6.18.3/drivers/scsi/dec_esp.c  2006-11-20 10:09:08.000000000 -0800
     11676diff -Naur linux-2.6.19/drivers/scsi/dec_esp.c linux-mips-2.6.19/drivers/scsi/dec_esp.c
     11677--- linux-2.6.19/drivers/scsi/dec_esp.c 2006-11-29 13:57:37.000000000 -0800
     11678+++ linux-mips-2.6.19/drivers/scsi/dec_esp.c    2006-11-29 15:23:09.000000000 -0800
    1697211679@@ -55,7 +55,7 @@
    1697311680 
     
    1698811695                        esp->dregs = 0;
    1698911696                        esp->eregs = (void *)CKSEG1ADDR(mem_start +
    16990 diff -Naur linux-2.6.18.3/drivers/scsi/sgiwd93.c linux-mips-2.6.18.3/drivers/scsi/sgiwd93.c
    16991 --- linux-2.6.18.3/drivers/scsi/sgiwd93.c       2006-11-18 19:28:22.000000000 -0800
    16992 +++ linux-mips-2.6.18.3/drivers/scsi/sgiwd93.c  2006-11-20 10:09:08.000000000 -0800
     11697diff -Naur linux-2.6.19/drivers/scsi/sgiwd93.c linux-mips-2.6.19/drivers/scsi/sgiwd93.c
     11698--- linux-2.6.19/drivers/scsi/sgiwd93.c 2006-11-29 13:57:37.000000000 -0800
     11699+++ linux-mips-2.6.19/drivers/scsi/sgiwd93.c    2006-11-29 15:23:09.000000000 -0800
    1699311700@@ -14,6 +14,7 @@
    1699411701 #include <linux/interrupt.h>
     
    1700711714 static inline void init_hpc_chain(struct hpc_data *hd)
    1700811715 {
    17009 diff -Naur linux-2.6.18.3/drivers/serial/Kconfig linux-mips-2.6.18.3/drivers/serial/Kconfig
    17010 --- linux-2.6.18.3/drivers/serial/Kconfig       2006-11-18 19:28:22.000000000 -0800
    17011 +++ linux-mips-2.6.18.3/drivers/serial/Kconfig  2006-11-20 10:09:08.000000000 -0800
    17012 @@ -651,6 +651,25 @@
     11716diff -Naur linux-2.6.19/drivers/serial/Kconfig linux-mips-2.6.19/drivers/serial/Kconfig
     11717--- linux-2.6.19/drivers/serial/Kconfig 2006-11-29 13:57:37.000000000 -0800
     11718+++ linux-mips-2.6.19/drivers/serial/Kconfig    2006-11-29 15:23:09.000000000 -0800
     11719@@ -657,6 +657,25 @@
    1701311720        depends on SERIAL_SH_SCI=y
    1701411721        select SERIAL_CORE_CONSOLE
     
    1703611743        tristate
    1703711744 
    17038 diff -Naur linux-2.6.18.3/drivers/serial/Makefile linux-mips-2.6.18.3/drivers/serial/Makefile
    17039 --- linux-2.6.18.3/drivers/serial/Makefile      2006-11-18 19:28:22.000000000 -0800
    17040 +++ linux-mips-2.6.18.3/drivers/serial/Makefile 2006-11-20 10:09:08.000000000 -0800
     11745diff -Naur linux-2.6.19/drivers/serial/Makefile linux-mips-2.6.19/drivers/serial/Makefile
     11746--- linux-2.6.19/drivers/serial/Makefile        2006-11-29 13:57:37.000000000 -0800
     11747+++ linux-mips-2.6.19/drivers/serial/Makefile   2006-11-29 15:23:09.000000000 -0800
    1704111748@@ -39,6 +39,7 @@
    1704211749 obj-$(CONFIG_V850E_UART) += v850e_uart.o
     
    1704711754 obj-$(CONFIG_SERIAL_SH_SCI) += sh-sci.o
    1704811755 obj-$(CONFIG_SERIAL_SGI_L1_CONSOLE) += sn_console.o
    17049 diff -Naur linux-2.6.18.3/drivers/serial/ip22zilog.c linux-mips-2.6.18.3/drivers/serial/ip22zilog.c
    17050 --- linux-2.6.18.3/drivers/serial/ip22zilog.c   2006-11-18 19:28:22.000000000 -0800
    17051 +++ linux-mips-2.6.18.3/drivers/serial/ip22zilog.c      2006-11-20 10:09:08.000000000 -0800
    17052 @@ -865,6 +865,7 @@
     11756diff -Naur linux-2.6.19/drivers/serial/ip22zilog.c linux-mips-2.6.19/drivers/serial/ip22zilog.c
     11757--- linux-2.6.19/drivers/serial/ip22zilog.c     2006-11-29 13:57:37.000000000 -0800
     11758+++ linux-mips-2.6.19/drivers/serial/ip22zilog.c        2006-11-29 15:23:09.000000000 -0800
     11759@@ -863,6 +863,7 @@
    1705311760        up->cflag = termios->c_cflag;
    1705411761 
     
    1705811765        spin_unlock_irqrestore(&up->port.lock, flags);
    1705911766 }
    17060 @@ -1026,6 +1027,8 @@
     11767@@ -1024,6 +1025,8 @@
    1706111768        }
    1706211769 
     
    1706711774 
    1706811775 static int __init ip22zilog_console_setup(struct console *con, char *options)
    17069 diff -Naur linux-2.6.18.3/drivers/serial/ip3106_uart.c linux-mips-2.6.18.3/drivers/serial/ip3106_uart.c
    17070 --- linux-2.6.18.3/drivers/serial/ip3106_uart.c 1969-12-31 16:00:00.000000000 -0800
    17071 +++ linux-mips-2.6.18.3/drivers/serial/ip3106_uart.c    2006-11-20 10:09:08.000000000 -0800
    17072 @@ -0,0 +1,912 @@
     11776diff -Naur linux-2.6.19/drivers/serial/ip3106_uart.c linux-mips-2.6.19/drivers/serial/ip3106_uart.c
     11777--- linux-2.6.19/drivers/serial/ip3106_uart.c   1969-12-31 16:00:00.000000000 -0800
     11778+++ linux-mips-2.6.19/drivers/serial/ip3106_uart.c      2006-11-29 15:23:09.000000000 -0800
     11779@@ -0,0 +1,909 @@
    1707311780+/*
    1707411781+ * Initially based on linux-2.4.20_mvl31-pnx8xx0/drivers/char/serial_pnx8550.c
     
    1708911796+ */
    1709011797+
    17091 +#include <linux/config.h>
    17092 +
    1709311798+#if defined(CONFIG_SERIAL_IP3106_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
    1709411799+#define SUPPORT_SYSRQ
     
    1726311968+}
    1726411969+
    17265 +static void
    17266 +ip3106_rx_chars(struct ip3106_port *sport, struct pt_regs *regs)
     11970+static void ip3106_rx_chars(struct ip3106_port *sport)
    1726711971+{
    1726811972+       struct tty_struct *tty = sport->port.info->tty;
     
    1738012084+}
    1738112085+
    17382 +static irqreturn_t ip3106_int(int irq, void *dev_id, struct pt_regs *regs)
     12086+static irqreturn_t ip3106_int(int irq, void *dev_id)
    1738312087+{
    1738412088+       struct ip3106_port *sport = dev_id;
     
    1798312687+MODULE_LICENSE("GPL");
    1798412688+MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_IP3106_MAJOR);
    17985 diff -Naur linux-2.6.18.3/drivers/usb/gadget/net2280.c linux-mips-2.6.18.3/drivers/usb/gadget/net2280.c
    17986 --- linux-2.6.18.3/drivers/usb/gadget/net2280.c 2006-11-18 19:28:22.000000000 -0800
    17987 +++ linux-mips-2.6.18.3/drivers/usb/gadget/net2280.c    2006-11-20 10:09:08.000000000 -0800
    17988 @@ -467,7 +467,8 @@
    17989  #elif  defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE)
    17990  #define USE_KMALLOC
    17991  
    17992 -#elif  defined(CONFIG_MIPS) && !defined(CONFIG_DMA_NONCOHERENT)
    17993 +#elif  defined(CONFIG_MIPS) && \
    17994 +       (defined(CONFIG_DMA_COHERENT) || defined(CONFIG_DMA_IP27))
    17995  #define USE_KMALLOC
    17996  
    17997  /* FIXME there are other cases, including an x86-64 one ...  */
    17998 diff -Naur linux-2.6.18.3/drivers/usb/host/ohci-hcd.c linux-mips-2.6.18.3/drivers/usb/host/ohci-hcd.c
    17999 --- linux-2.6.18.3/drivers/usb/host/ohci-hcd.c  2006-11-18 19:28:22.000000000 -0800
    18000 +++ linux-mips-2.6.18.3/drivers/usb/host/ohci-hcd.c     2006-11-20 10:09:08.000000000 -0800
    18001 @@ -909,6 +909,10 @@
     12689diff -Naur linux-2.6.19/drivers/usb/host/ohci-hcd.c linux-mips-2.6.19/drivers/usb/host/ohci-hcd.c
     12690--- linux-2.6.19/drivers/usb/host/ohci-hcd.c    2006-11-29 13:57:37.000000000 -0800
     12691+++ linux-mips-2.6.19/drivers/usb/host/ohci-hcd.c       2006-11-29 15:23:09.000000000 -0800
     12692@@ -931,6 +931,10 @@
    1800212693 #include "ohci-au1xxx.c"
    1800312694 #endif
     
    1801012701 #include "ohci-ppc-soc.c"
    1801112702 #endif
    18012 diff -Naur linux-2.6.18.3/drivers/usb/host/ohci-pnx8550.c linux-mips-2.6.18.3/drivers/usb/host/ohci-pnx8550.c
    18013 --- linux-2.6.18.3/drivers/usb/host/ohci-pnx8550.c      1969-12-31 16:00:00.000000000 -0800
    18014 +++ linux-mips-2.6.18.3/drivers/usb/host/ohci-pnx8550.c 2006-11-20 10:09:08.000000000 -0800
     12703diff -Naur linux-2.6.19/drivers/usb/host/ohci-pnx8550.c linux-mips-2.6.19/drivers/usb/host/ohci-pnx8550.c
     12704--- linux-2.6.19/drivers/usb/host/ohci-pnx8550.c        1969-12-31 16:00:00.000000000 -0800
     12705+++ linux-mips-2.6.19/drivers/usb/host/ohci-pnx8550.c   2006-11-29 15:23:09.000000000 -0800
    1801512706@@ -0,0 +1,277 @@
    1801612707+/*
     
    1829112982+module_init (ohci_hcd_pnx8550_init);
    1829212983+module_exit (ohci_hcd_pnx8550_cleanup);
    18293 diff -Naur linux-2.6.18.3/drivers/video/Kconfig linux-mips-2.6.18.3/drivers/video/Kconfig
    18294 --- linux-2.6.18.3/drivers/video/Kconfig        2006-11-18 19:28:22.000000000 -0800
    18295 +++ linux-mips-2.6.18.3/drivers/video/Kconfig   2006-11-20 10:09:08.000000000 -0800
    18296 @@ -1250,6 +1250,17 @@
     12984diff -Naur linux-2.6.19/drivers/video/Kconfig linux-mips-2.6.19/drivers/video/Kconfig
     12985--- linux-2.6.19/drivers/video/Kconfig  2006-11-29 13:57:37.000000000 -0800
     12986+++ linux-mips-2.6.19/drivers/video/Kconfig     2006-11-29 15:23:09.000000000 -0800
     12987@@ -1277,6 +1277,17 @@
    1829712988          Please read the <file:Documentation/fb/README-sstfb.txt> for supported
    1829812989          options and other important info  support.
     
    1831213003        tristate "Cyberblade/i1 support"
    1831313004        depends on FB && PCI && X86_32 && !64BIT
    18314 @@ -1314,7 +1325,25 @@
     13005@@ -1341,7 +1352,25 @@
    1831513006 
    1831613007 config FB_AU1100
     
    1833913030 config FB_AU1200
    1834013031        bool "Au1200 LCD Driver"
    18341 @@ -1430,8 +1459,8 @@
     13032@@ -1457,8 +1486,8 @@
    1834213033        select FB_CFB_IMAGEBLIT
    1834313034        help
     
    1835013041 config FB_MAXINE
    1835113042        bool "Maxine (Personal DECstation) onboard framebuffer support"
    18352 diff -Naur linux-2.6.18.3/drivers/video/Makefile linux-mips-2.6.18.3/drivers/video/Makefile
    18353 --- linux-2.6.18.3/drivers/video/Makefile       2006-11-18 19:28:22.000000000 -0800
    18354 +++ linux-mips-2.6.18.3/drivers/video/Makefile  2006-11-20 10:09:08.000000000 -0800
    18355 @@ -95,6 +95,7 @@
     13043diff -Naur linux-2.6.19/drivers/video/Makefile linux-mips-2.6.19/drivers/video/Makefile
     13044--- linux-2.6.19/drivers/video/Makefile 2006-11-29 13:57:37.000000000 -0800
     13045+++ linux-mips-2.6.19/drivers/video/Makefile    2006-11-29 15:23:09.000000000 -0800
     13046@@ -96,6 +96,7 @@
    1835613047 obj-$(CONFIG_FB_TX3912)                  += tx3912fb.o
    1835713048 obj-$(CONFIG_FB_S1D13XXX)        += s1d13xxxfb.o
     
    1836113052 obj-$(CONFIG_FB_PNX4008_DUM)     += pnx4008/
    1836213053 obj-$(CONFIG_FB_PNX4008_DUM_RGB)  += pnx4008/
    18363 diff -Naur linux-2.6.18.3/drivers/video/au1100fb.c linux-mips-2.6.18.3/drivers/video/au1100fb.c
    18364 --- linux-2.6.18.3/drivers/video/au1100fb.c     2006-11-18 19:28:22.000000000 -0800
    18365 +++ linux-mips-2.6.18.3/drivers/video/au1100fb.c        2006-11-20 10:09:08.000000000 -0800
    18366 @@ -40,6 +40,7 @@
     13054diff -Naur linux-2.6.19/drivers/video/au1100fb.c linux-mips-2.6.19/drivers/video/au1100fb.c
     13055--- linux-2.6.19/drivers/video/au1100fb.c       2006-11-29 13:57:37.000000000 -0800
     13056+++ linux-mips-2.6.19/drivers/video/au1100fb.c  2006-11-29 15:23:09.000000000 -0800
     13057@@ -41,6 +41,7 @@
    1836713058  *  with this program; if not, write  to the Free Software Foundation, Inc.,
    1836813059  *  675 Mass Ave, Cambridge, MA 02139, USA.
     
    1837213063 #include <linux/kernel.h>
    1837313064 #include <linux/errno.h>
    18374 diff -Naur linux-2.6.18.3/drivers/video/smivgxfb.c linux-mips-2.6.18.3/drivers/video/smivgxfb.c
    18375 --- linux-2.6.18.3/drivers/video/smivgxfb.c     1969-12-31 16:00:00.000000000 -0800
    18376 +++ linux-mips-2.6.18.3/drivers/video/smivgxfb.c        2006-11-20 10:09:08.000000000 -0800
     13065diff -Naur linux-2.6.19/drivers/video/smivgxfb.c linux-mips-2.6.19/drivers/video/smivgxfb.c
     13066--- linux-2.6.19/drivers/video/smivgxfb.c       1969-12-31 16:00:00.000000000 -0800
     13067+++ linux-mips-2.6.19/drivers/video/smivgxfb.c  2006-11-29 15:23:09.000000000 -0800
    1837713068@@ -0,0 +1,387 @@
    1837813069+/***************************************************************************
     
    1876313454+MODULE_DESCRIPTION("Framebuffer driver for SMI Voyager");
    1876413455+MODULE_LICENSE("GPL");
    18765 diff -Naur linux-2.6.18.3/include/asm-mips/Kbuild linux-mips-2.6.18.3/include/asm-mips/Kbuild
    18766 --- linux-2.6.18.3/include/asm-mips/Kbuild      2006-11-18 19:28:22.000000000 -0800
    18767 +++ linux-mips-2.6.18.3/include/asm-mips/Kbuild 2006-11-20 10:09:08.000000000 -0800
    18768 @@ -1 +1,3 @@
    18769  include include/asm-generic/Kbuild.asm
    18770 +
    18771 +header-y += cachectl.h sgidefs.h sysmips.h
    18772 diff -Naur linux-2.6.18.3/include/asm-mips/asm.h linux-mips-2.6.18.3/include/asm-mips/asm.h
    18773 --- linux-2.6.18.3/include/asm-mips/asm.h       2006-11-18 19:28:22.000000000 -0800
    18774 +++ linux-mips-2.6.18.3/include/asm-mips/asm.h  2006-11-20 10:09:08.000000000 -0800
    18775 @@ -344,6 +344,7 @@
    18776  #define PTR_L          lw
    18777  #define PTR_S          sw
    18778  #define PTR_LA         la
    18779 +#define PTR_LI         li
    18780  #define PTR_SLL                sll
    18781  #define PTR_SLLV       sllv
    18782  #define PTR_SRL                srl
    18783 @@ -368,6 +369,7 @@
    18784  #define PTR_L          ld
    18785  #define PTR_S          sd
    18786  #define PTR_LA         dla
    18787 +#define PTR_LI         dli
    18788  #define PTR_SLL                dsll
    18789  #define PTR_SLLV       dsllv
    18790  #define PTR_SRL                dsrl
    18791 diff -Naur linux-2.6.18.3/include/asm-mips/cacheflush.h linux-mips-2.6.18.3/include/asm-mips/cacheflush.h
    18792 --- linux-2.6.18.3/include/asm-mips/cacheflush.h        2006-11-18 19:28:22.000000000 -0800
    18793 +++ linux-mips-2.6.18.3/include/asm-mips/cacheflush.h   2006-11-20 10:09:08.000000000 -0800
    18794 @@ -21,7 +21,6 @@
    18795   *  - flush_cache_range(vma, start, end) flushes a range of pages
    18796   *  - flush_icache_range(start, end) flush a range of instructions
    18797   *  - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
    18798 - *  - flush_icache_page(vma, pg) flushes(invalidates) a page for icache
    18799   *
    18800   * MIPS specific flush operations:
    18801   *
    18802 @@ -39,7 +38,7 @@
    18803  
    18804  static inline void flush_dcache_page(struct page *page)
    18805  {
    18806 -       if (cpu_has_dc_aliases)
    18807 +       if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc)
    18808                 __flush_dcache_page(page);
    18809  
    18810  }
    18811 @@ -47,30 +46,24 @@
    18812  #define flush_dcache_mmap_lock(mapping)                do { } while (0)
    18813  #define flush_dcache_mmap_unlock(mapping)      do { } while (0)
    18814  
    18815 -extern void (*flush_icache_page)(struct vm_area_struct *vma,
    18816 +extern void (*__flush_icache_page)(struct vm_area_struct *vma,
    18817         struct page *page);
    18818 +static inline void flush_icache_page(struct vm_area_struct *vma,
    18819 +       struct page *page)
    18820 +{
    18821 +}
    18822 +
    18823  extern void (*flush_icache_range)(unsigned long start, unsigned long end);
    18824  #define flush_cache_vmap(start, end)           flush_cache_all()
    18825  #define flush_cache_vunmap(start, end)         flush_cache_all()
    18826  
    18827 -static inline void copy_to_user_page(struct vm_area_struct *vma,
    18828 +extern void copy_to_user_page(struct vm_area_struct *vma,
    18829         struct page *page, unsigned long vaddr, void *dst, const void *src,
    18830 -       unsigned long len)
    18831 -{
    18832 -       if (cpu_has_dc_aliases)
    18833 -               flush_cache_page(vma, vaddr, page_to_pfn(page));
    18834 -       memcpy(dst, src, len);
    18835 -       flush_icache_page(vma, page);
    18836 -}
    18837 +       unsigned long len);
    18838  
    18839 -static inline void copy_from_user_page(struct vm_area_struct *vma,
    18840 +extern void copy_from_user_page(struct vm_area_struct *vma,
    18841         struct page *page, unsigned long vaddr, void *dst, const void *src,
    18842 -       unsigned long len)
    18843 -{
    18844 -       if (cpu_has_dc_aliases)
    18845 -               flush_cache_page(vma, vaddr, page_to_pfn(page));
    18846 -       memcpy(dst, src, len);
    18847 -}
    18848 +       unsigned long len);
    18849  
    18850  extern void (*flush_cache_sigtramp)(unsigned long addr);
    18851  extern void (*flush_icache_all)(void);
    18852 diff -Naur linux-2.6.18.3/include/asm-mips/compat.h linux-mips-2.6.18.3/include/asm-mips/compat.h
    18853 --- linux-2.6.18.3/include/asm-mips/compat.h    2006-11-18 19:28:22.000000000 -0800
    18854 +++ linux-mips-2.6.18.3/include/asm-mips/compat.h       2006-11-20 10:09:08.000000000 -0800
     13456diff -Naur linux-2.6.19/include/asm-mips/compat.h linux-mips-2.6.19/include/asm-mips/compat.h
     13457--- linux-2.6.19/include/asm-mips/compat.h      2006-11-29 13:57:37.000000000 -0800
     13458+++ linux-mips-2.6.19/include/asm-mips/compat.h 2006-11-29 15:23:09.000000000 -0800
    1885513459@@ -32,6 +32,7 @@
    1885613460        s32     val[2];
     
    1893313537+
    1893413538 #endif /* _ASM_COMPAT_H */
    18935 diff -Naur linux-2.6.18.3/include/asm-mips/fixmap.h linux-mips-2.6.18.3/include/asm-mips/fixmap.h
    18936 --- linux-2.6.18.3/include/asm-mips/fixmap.h    2006-11-18 19:28:22.000000000 -0800
    18937 +++ linux-mips-2.6.18.3/include/asm-mips/fixmap.h       2006-11-20 10:09:08.000000000 -0800
    18938 @@ -45,8 +45,16 @@
    18939   * fix-mapped?
    18940   */
    18941  enum fixed_addresses {
    18942 +#define FIX_N_COLOURS 8
    18943 +       FIX_CMAP_BEGIN,
    18944 +#ifdef CONFIG_MIPS_MT_SMTC
    18945 +       FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS),
    18946 +#else
    18947 +       FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
    18948 +#endif
    18949  #ifdef CONFIG_HIGHMEM
    18950 -       FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
    18951 +       /* reserved pte's for temporary kernel mappings */
    18952 +       FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
    18953         FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
    18954  #endif
    18955         __end_of_fixed_addresses
    18956 @@ -70,9 +78,9 @@
    18957   * at the top of mem..
    18958   */
    18959  #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
    18960 -#define FIXADDR_TOP    (0xff000000UL - 0x2000)
    18961 +#define FIXADDR_TOP    ((unsigned long)(long)(int)(0xff000000 - 0x20000))
    18962  #else
    18963 -#define FIXADDR_TOP    (0xffffe000UL)
    18964 +#define FIXADDR_TOP    ((unsigned long)(long)(int)0xfffe0000)
    18965  #endif
    18966  #define FIXADDR_SIZE   (__end_of_fixed_addresses << PAGE_SHIFT)
    18967  #define FIXADDR_START  (FIXADDR_TOP - FIXADDR_SIZE)
    18968 diff -Naur linux-2.6.18.3/include/asm-mips/fpu.h linux-mips-2.6.18.3/include/asm-mips/fpu.h
    18969 --- linux-2.6.18.3/include/asm-mips/fpu.h       2006-11-18 19:28:22.000000000 -0800
    18970 +++ linux-mips-2.6.18.3/include/asm-mips/fpu.h  2006-11-20 10:09:08.000000000 -0800
    18971 @@ -134,9 +134,11 @@
    18972  
    18973  static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
    18974  {
    18975 -       if (cpu_has_fpu) {
    18976 -               if ((tsk == current) && __is_fpu_owner())
    18977 +       if (tsk == current) {
    18978 +               preempt_disable();
    18979 +               if (is_fpu_owner())
    18980                         _save_fp(current);
    18981 +               preempt_enable();
    18982         }
    18983  
    18984         return tsk->thread.fpu.fpr;
    18985 diff -Naur linux-2.6.18.3/include/asm-mips/io.h linux-mips-2.6.18.3/include/asm-mips/io.h
    18986 --- linux-2.6.18.3/include/asm-mips/io.h        2006-11-18 19:28:22.000000000 -0800
    18987 +++ linux-mips-2.6.18.3/include/asm-mips/io.h   2006-11-20 10:09:08.000000000 -0800
    18988 @@ -172,7 +172,7 @@
    18989  #define page_to_phys(page)     ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
    18990  
    18991  extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags);
    18992 -extern void __iounmap(volatile void __iomem *addr);
    18993 +extern void __iounmap(const volatile void __iomem *addr);
    18994  
    18995  static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
    18996         unsigned long flags)
    18997 @@ -279,7 +279,7 @@
    18998  #define ioremap_uncached_accelerated(offset, size)                     \
    18999         __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED)
    19000  
    19001 -static inline void iounmap(volatile void __iomem *addr)
    19002 +static inline void iounmap(const volatile void __iomem *addr)
    19003  {
    19004  #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
    19005  
     13539diff -Naur linux-2.6.19/include/asm-mips/io.h linux-mips-2.6.19/include/asm-mips/io.h
     13540--- linux-2.6.19/include/asm-mips/io.h  2006-11-29 13:57:37.000000000 -0800
     13541+++ linux-mips-2.6.19/include/asm-mips/io.h     2006-11-29 15:23:09.000000000 -0800
    1900613542@@ -518,34 +518,6 @@
    1900713543 }
     
    1903913575  * to explicitly ioremap() it. The fact that the ISA IO space is mapped
    1904013576  * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
    19041 diff -Naur linux-2.6.18.3/include/asm-mips/irq.h linux-mips-2.6.18.3/include/asm-mips/irq.h
    19042 --- linux-2.6.18.3/include/asm-mips/irq.h       2006-11-18 19:28:22.000000000 -0800
    19043 +++ linux-mips-2.6.18.3/include/asm-mips/irq.h  2006-11-20 10:09:08.000000000 -0800
    19044 @@ -76,8 +76,8 @@
    19045                            unsigned long hwmask);
    19046  #endif /* CONFIG_MIPS_MT_SMTC */
    19047  
    19048 -#ifdef CONFIG_SMP
    19049 -#define ARCH_HAS_IRQ_PER_CPU
    19050 -#endif
    19051 +extern int allocate_irqno(void);
    19052 +extern void alloc_legacy_irqno(void);
    19053 +extern void free_irqno(unsigned int irq);
    19054  
    19055  #endif /* _ASM_IRQ_H */
    19056 diff -Naur linux-2.6.18.3/include/asm-mips/mach-atlas/mc146818rtc.h linux-mips-2.6.18.3/include/asm-mips/mach-atlas/mc146818rtc.h
    19057 --- linux-2.6.18.3/include/asm-mips/mach-atlas/mc146818rtc.h    2006-11-18 19:28:22.000000000 -0800
    19058 +++ linux-mips-2.6.18.3/include/asm-mips/mach-atlas/mc146818rtc.h       2006-11-20 10:09:08.000000000 -0800
    19059 @@ -28,10 +28,12 @@
    19060  #include <asm/mips-boards/atlas.h>
    19061  #include <asm/mips-boards/atlasint.h>
    19062  
    19063 +#define ARCH_RTC_LOCATION
    19064 +
    19065  #define RTC_PORT(x)    (ATLAS_RTC_ADR_REG + (x) * 8)
    19066  #define RTC_IO_EXTENT  0x100
    19067  #define RTC_IOMAPPED   0
    19068 -#define RTC_IRQ                ATLASINT_RTC
    19069 +#define RTC_IRQ                ATLAS_INT_RTC
    19070  
    19071  static inline unsigned char CMOS_READ(unsigned long addr)
    19072  {
    19073 diff -Naur linux-2.6.18.3/include/asm-mips/mach-au1x00/au1000.h linux-mips-2.6.18.3/include/asm-mips/mach-au1x00/au1000.h
    19074 --- linux-2.6.18.3/include/asm-mips/mach-au1x00/au1000.h        2006-11-18 19:28:22.000000000 -0800
    19075 +++ linux-mips-2.6.18.3/include/asm-mips/mach-au1x00/au1000.h   2006-11-20 10:09:08.000000000 -0800
     13577diff -Naur linux-2.6.19/include/asm-mips/mach-au1x00/au1000.h linux-mips-2.6.19/include/asm-mips/mach-au1x00/au1000.h
     13578--- linux-2.6.19/include/asm-mips/mach-au1x00/au1000.h  2006-11-29 13:57:37.000000000 -0800
     13579+++ linux-mips-2.6.19/include/asm-mips/mach-au1x00/au1000.h     2006-11-29 15:23:09.000000000 -0800
    1907613580@@ -39,6 +39,7 @@
    1907713581 #ifndef _LANGUAGE_ASSEMBLY
     
    1910113605 #define PCI_IO_START    (Au1500_PCI_IO_START + 0x1000)
    1910213606 #define PCI_IO_END      (Au1500_PCI_IO_END)
    19103 diff -Naur linux-2.6.18.3/include/asm-mips/mach-au1x00/au1xxx_ide.h linux-mips-2.6.18.3/include/asm-mips/mach-au1x00/au1xxx_ide.h
    19104 --- linux-2.6.18.3/include/asm-mips/mach-au1x00/au1xxx_ide.h    2006-11-18 19:28:22.000000000 -0800
    19105 +++ linux-mips-2.6.18.3/include/asm-mips/mach-au1x00/au1xxx_ide.h       2006-11-20 10:09:08.000000000 -0800
     13607diff -Naur linux-2.6.19/include/asm-mips/mach-au1x00/au1xxx_ide.h linux-mips-2.6.19/include/asm-mips/mach-au1x00/au1xxx_ide.h
     13608--- linux-2.6.19/include/asm-mips/mach-au1x00/au1xxx_ide.h      2006-11-29 13:57:37.000000000 -0800
     13609+++ linux-mips-2.6.19/include/asm-mips/mach-au1x00/au1xxx_ide.h 2006-11-29 15:23:09.000000000 -0800
    1910613610@@ -83,6 +83,7 @@
    1910713611 } _auide_hwif;
     
    1911213616 static const struct drive_list_entry dma_white_list [] = {
    1911313617 /*
    19114 diff -Naur linux-2.6.18.3/include/asm-mips/mips-boards/atlasint.h linux-mips-2.6.18.3/include/asm-mips/mips-boards/atlasint.h
    19115 --- linux-2.6.18.3/include/asm-mips/mips-boards/atlasint.h      2006-11-18 19:28:22.000000000 -0800
    19116 +++ linux-mips-2.6.18.3/include/asm-mips/mips-boards/atlasint.h 2006-11-20 10:09:08.000000000 -0800
    19117 @@ -1,6 +1,7 @@
    19118  /*
    19119 - * Carsten Langgaard, carstenl@mips.com
    19120 - * Copyright (C) 1999 MIPS Technologies, Inc.  All rights reserved.
    19121 + * Copyright (C) 1999, 2006  MIPS Technologies, Inc.  All rights reserved.
    19122 + *     Authors: Carsten Langgaard <carstenl@mips.com>
    19123 + *              Maciej W. Rozycki <macro@mips.com>
    19124   *
    19125   * ########################################################################
    19126   *
    19127 @@ -25,41 +26,88 @@
    19128  #ifndef _MIPS_ATLASINT_H
    19129  #define _MIPS_ATLASINT_H
    19130  
    19131 -#define ATLASINT_BASE          1
    19132 -#define ATLASINT_UART          (ATLASINT_BASE+0)
    19133 -#define ATLASINT_TIM0          (ATLASINT_BASE+1)
    19134 -#define ATLASINT_RES2          (ATLASINT_BASE+2)
    19135 -#define ATLASINT_RES3          (ATLASINT_BASE+3)
    19136 -#define ATLASINT_RTC           (ATLASINT_BASE+4)
    19137 -#define ATLASINT_COREHI                (ATLASINT_BASE+5)
    19138 -#define ATLASINT_CORELO                (ATLASINT_BASE+6)
    19139 -#define ATLASINT_RES7          (ATLASINT_BASE+7)
    19140 -#define ATLASINT_PCIA          (ATLASINT_BASE+8)
    19141 -#define ATLASINT_PCIB          (ATLASINT_BASE+9)
    19142 -#define ATLASINT_PCIC          (ATLASINT_BASE+10)
    19143 -#define ATLASINT_PCID          (ATLASINT_BASE+11)
    19144 -#define ATLASINT_ENUM          (ATLASINT_BASE+12)
    19145 -#define ATLASINT_DEG           (ATLASINT_BASE+13)
    19146 -#define ATLASINT_ATXFAIL       (ATLASINT_BASE+14)
    19147 -#define ATLASINT_INTA          (ATLASINT_BASE+15)
    19148 -#define ATLASINT_INTB          (ATLASINT_BASE+16)
    19149 -#define ATLASINT_ETH           ATLASINT_INTB
    19150 -#define ATLASINT_INTC          (ATLASINT_BASE+17)
    19151 -#define ATLASINT_SCSI          ATLASINT_INTC
    19152 -#define ATLASINT_INTD          (ATLASINT_BASE+18)
    19153 -#define ATLASINT_SERR          (ATLASINT_BASE+19)
    19154 -#define ATLASINT_RES20         (ATLASINT_BASE+20)
    19155 -#define ATLASINT_RES21         (ATLASINT_BASE+21)
    19156 -#define ATLASINT_RES22         (ATLASINT_BASE+22)
    19157 -#define ATLASINT_RES23         (ATLASINT_BASE+23)
    19158 -#define ATLASINT_RES24         (ATLASINT_BASE+24)
    19159 -#define ATLASINT_RES25         (ATLASINT_BASE+25)
    19160 -#define ATLASINT_RES26         (ATLASINT_BASE+26)
    19161 -#define ATLASINT_RES27         (ATLASINT_BASE+27)
    19162 -#define ATLASINT_RES28         (ATLASINT_BASE+28)
    19163 -#define ATLASINT_RES29         (ATLASINT_BASE+29)
    19164 -#define ATLASINT_RES30         (ATLASINT_BASE+30)
    19165 -#define ATLASINT_RES31         (ATLASINT_BASE+31)
    19166 -#define ATLASINT_END           (ATLASINT_BASE+31)
    19167 +/*
    19168 + * Interrupts 0..7 are used for Atlas CPU interrupts (nonEIC mode)
    19169 + */
    19170 +#define MIPSCPU_INT_BASE       0
    19171 +
    19172 +/* CPU interrupt offsets */
    19173 +#define MIPSCPU_INT_SW0                0
    19174 +#define MIPSCPU_INT_SW1                1
    19175 +#define MIPSCPU_INT_MB0                2
    19176 +#define MIPSCPU_INT_ATLAS      MIPSCPU_INT_MB0
    19177 +#define MIPSCPU_INT_MB1                3
    19178 +#define MIPSCPU_INT_MB2                4
    19179 +#define MIPSCPU_INT_MB3                5
    19180 +#define MIPSCPU_INT_MB4                6
    19181 +#define MIPSCPU_INT_CPUCTR     7
    19182 +
    19183 +/*
    19184 + * Interrupts 8..39 are used for Atlas interrupt controller interrupts
    19185 + */
    19186 +#define ATLAS_INT_BASE         8
    19187 +#define ATLAS_INT_UART         (ATLAS_INT_BASE + 0)
    19188 +#define ATLAS_INT_TIM0         (ATLAS_INT_BASE + 1)
    19189 +#define ATLAS_INT_RES2         (ATLAS_INT_BASE + 2)
    19190 +#define ATLAS_INT_RES3         (ATLAS_INT_BASE + 3)
    19191 +#define ATLAS_INT_RTC          (ATLAS_INT_BASE + 4)
    19192 +#define ATLAS_INT_COREHI       (ATLAS_INT_BASE + 5)
    19193 +#define ATLAS_INT_CORELO       (ATLAS_INT_BASE + 6)
    19194 +#define ATLAS_INT_RES7         (ATLAS_INT_BASE + 7)
    19195 +#define ATLAS_INT_PCIA         (ATLAS_INT_BASE + 8)
    19196 +#define ATLAS_INT_PCIB         (ATLAS_INT_BASE + 9)
    19197 +#define ATLAS_INT_PCIC         (ATLAS_INT_BASE + 10)
    19198 +#define ATLAS_INT_PCID         (ATLAS_INT_BASE + 11)
    19199 +#define ATLAS_INT_ENUM         (ATLAS_INT_BASE + 12)
    19200 +#define ATLAS_INT_DEG          (ATLAS_INT_BASE + 13)
    19201 +#define ATLAS_INT_ATXFAIL      (ATLAS_INT_BASE + 14)
    19202 +#define ATLAS_INT_INTA         (ATLAS_INT_BASE + 15)
    19203 +#define ATLAS_INT_INTB         (ATLAS_INT_BASE + 16)
    19204 +#define ATLAS_INT_ETH          ATLAS_INT_INTB
    19205 +#define ATLAS_INT_INTC         (ATLAS_INT_BASE + 17)
    19206 +#define ATLAS_INT_SCSI         ATLAS_INT_INTC
    19207 +#define ATLAS_INT_INTD         (ATLAS_INT_BASE + 18)
    19208 +#define ATLAS_INT_SERR         (ATLAS_INT_BASE + 19)
    19209 +#define ATLAS_INT_RES20                (ATLAS_INT_BASE + 20)
    19210 +#define ATLAS_INT_RES21                (ATLAS_INT_BASE + 21)
    19211 +#define ATLAS_INT_RES22                (ATLAS_INT_BASE + 22)
    19212 +#define ATLAS_INT_RES23                (ATLAS_INT_BASE + 23)
    19213 +#define ATLAS_INT_RES24                (ATLAS_INT_BASE + 24)
    19214 +#define ATLAS_INT_RES25                (ATLAS_INT_BASE + 25)
    19215 +#define ATLAS_INT_RES26                (ATLAS_INT_BASE + 26)
    19216 +#define ATLAS_INT_RES27                (ATLAS_INT_BASE + 27)
    19217 +#define ATLAS_INT_RES28                (ATLAS_INT_BASE + 28)
    19218 +#define ATLAS_INT_RES29                (ATLAS_INT_BASE + 29)
    19219 +#define ATLAS_INT_RES30                (ATLAS_INT_BASE + 30)
    19220 +#define ATLAS_INT_RES31                (ATLAS_INT_BASE + 31)
    19221 +#define ATLAS_INT_END          (ATLAS_INT_BASE + 31)
    19222 +
    19223 +/*
    19224 + * Interrupts 64..127 are used for Soc-it Classic interrupts
    19225 + */
    19226 +#define MSC01C_INT_BASE                64
    19227 +
    19228 +/* SOC-it Classic interrupt offsets */
    19229 +#define MSC01C_INT_TMR         0
    19230 +#define MSC01C_INT_PCI         1
    19231 +
    19232 +/*
    19233 + * Interrupts 64..127 are used for Soc-it EIC interrupts
    19234 + */
    19235 +#define MSC01E_INT_BASE                64
    19236 +
    19237 +/* SOC-it EIC interrupt offsets */
    19238 +#define        MSC01E_INT_SW0          1
    19239 +#define        MSC01E_INT_SW1          2
    19240 +#define        MSC01E_INT_MB0          3
    19241 +#define        MSC01E_INT_ATLAS        MSC01E_INT_MB0
    19242 +#define        MSC01E_INT_MB1          4
    19243 +#define        MSC01E_INT_MB2          5
    19244 +#define        MSC01E_INT_MB3          6
    19245 +#define        MSC01E_INT_MB4          7
    19246 +#define        MSC01E_INT_TMR          8
    19247 +#define        MSC01E_INT_PCI          9
    19248 +#define        MSC01E_INT_PERFCTR      10
    19249 +#define        MSC01E_INT_CPUCTR       11
    19250  
    19251  #endif /* !(_MIPS_ATLASINT_H) */
    19252 diff -Naur linux-2.6.18.3/include/asm-mips/page.h linux-mips-2.6.18.3/include/asm-mips/page.h
    19253 --- linux-2.6.18.3/include/asm-mips/page.h      2006-11-18 19:28:22.000000000 -0800
    19254 +++ linux-mips-2.6.18.3/include/asm-mips/page.h 2006-11-20 10:09:08.000000000 -0800
    19255 @@ -53,19 +53,17 @@
    19256         extern void (*flush_data_cache_page)(unsigned long addr);
    19257  
    19258         clear_page(addr);
    19259 -       if (pages_do_alias((unsigned long) addr, vaddr))
    19260 +       if (pages_do_alias((unsigned long) addr, vaddr & PAGE_MASK))
     13618diff -Naur linux-2.6.19/include/asm-mips/page.h linux-mips-2.6.19/include/asm-mips/page.h
     13619--- linux-2.6.19/include/asm-mips/page.h        2006-11-29 13:57:37.000000000 -0800
     13620+++ linux-mips-2.6.19/include/asm-mips/page.h   2006-11-29 15:23:09.000000000 -0800
     13621@@ -59,16 +59,13 @@
    1926113622                flush_data_cache_page((unsigned long)addr);
    1926213623 }
     
    1926613627-{
    1926713628-       extern void (*flush_data_cache_page)(unsigned long addr);
     13629-
     13630-       copy_page(vto, vfrom);
     13631-       if (!cpu_has_ic_fills_f_dc ||
     13632-           pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
     13633-               flush_data_cache_page((unsigned long)vto);
     13634-}
    1926813635+extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
    1926913636+       struct page *to);
     
    1927113638+extern void copy_user_highpage(struct page *to, struct page *from,
    1927213639+       unsigned long vaddr, struct vm_area_struct *vma);
    19273  
    19274 -       copy_page(vto, vfrom);
    19275 -       if (pages_do_alias((unsigned long)vto, vaddr))
    19276 -               flush_data_cache_page((unsigned long)vto);
    19277 -}
     13640+
    1927813641+#define __HAVE_ARCH_COPY_USER_HIGHPAGE
    1927913642 
    1928013643 /*
    1928113644  * These are used to make use of C type-checking..
    19282 @@ -74,15 +72,17 @@
    19283    #ifdef CONFIG_CPU_MIPS32
    19284      typedef struct { unsigned long pte_low, pte_high; } pte_t;
    19285      #define pte_val(x)    ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
    19286 +    #define __pte(x)      ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
    19287    #else
    19288       typedef struct { unsigned long long pte; } pte_t;
    19289       #define pte_val(x)        ((x).pte)
    19290 +     #define __pte(x)  ((pte_t) { (x) } )
    19291    #endif
    19292  #else
    19293  typedef struct { unsigned long pte; } pte_t;
    19294  #define pte_val(x)     ((x).pte)
    19295 -#endif
    19296  #define __pte(x)       ((pte_t) { (x) } )
    19297 +#endif
    19298  
    19299  /*
    19300   * For 3-level pagetables we defines these ourselves, for 2-level the
    19301 diff -Naur linux-2.6.18.3/include/asm-mips/pgalloc.h linux-mips-2.6.18.3/include/asm-mips/pgalloc.h
    19302 --- linux-2.6.18.3/include/asm-mips/pgalloc.h   2006-11-18 19:28:22.000000000 -0800
    19303 +++ linux-mips-2.6.18.3/include/asm-mips/pgalloc.h      2006-11-20 10:09:08.000000000 -0800
    19304 @@ -48,7 +48,7 @@
    19305  
    19306         ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
    19307         if (ret) {
    19308 -               init = pgd_offset(&init_mm, 0);
    19309 +               init = pgd_offset(&init_mm, 0UL);
    19310                 pgd_init((unsigned long)ret);
    19311                 memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
    19312                        (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
    19313 diff -Naur linux-2.6.18.3/include/asm-mips/pgtable-64.h linux-mips-2.6.18.3/include/asm-mips/pgtable-64.h
    19314 --- linux-2.6.18.3/include/asm-mips/pgtable-64.h        2006-11-18 19:28:22.000000000 -0800
    19315 +++ linux-mips-2.6.18.3/include/asm-mips/pgtable-64.h   2006-11-20 10:09:08.000000000 -0800
    19316 @@ -170,7 +170,7 @@
    19317  #define __pmd_offset(address)  pmd_index(address)
    19318  
    19319  /* to find an entry in a kernel page-table-directory */
    19320 -#define pgd_offset_k(address) pgd_offset(&init_mm, 0)
    19321 +#define pgd_offset_k(address) pgd_offset(&init_mm, 0UL)
    19322  
    19323  #define pgd_index(address)     (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
    19324  #define pmd_index(address)     (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
    19325 diff -Naur linux-2.6.18.3/include/asm-mips/ptrace.h linux-mips-2.6.18.3/include/asm-mips/ptrace.h
    19326 --- linux-2.6.18.3/include/asm-mips/ptrace.h    2006-11-18 19:28:22.000000000 -0800
    19327 +++ linux-mips-2.6.18.3/include/asm-mips/ptrace.h       2006-11-20 10:09:08.000000000 -0800
    19328 @@ -10,8 +10,6 @@
    19329  #define _ASM_PTRACE_H
    19330  
    19331  
    19332 -#include <asm/isadep.h>
    19333 -
    19334  /* 0 - 31 are integer registers, 32 - 63 are fp registers.  */
    19335  #define FPR_BASE       32
    19336  #define PC             64
    19337 @@ -73,6 +71,7 @@
    19338  #ifdef __KERNEL__
    19339  
    19340  #include <linux/linkage.h>
    19341 +#include <asm/isadep.h>
    19342  
    19343  /*
    19344   * Does the process account for user or for system time?
    19345 diff -Naur linux-2.6.18.3/include/asm-mips/spinlock.h linux-mips-2.6.18.3/include/asm-mips/spinlock.h
    19346 --- linux-2.6.18.3/include/asm-mips/spinlock.h  2006-11-18 19:28:22.000000000 -0800
    19347 +++ linux-mips-2.6.18.3/include/asm-mips/spinlock.h     2006-11-20 10:09:08.000000000 -0800
    19348 @@ -239,7 +239,51 @@
    19349         : "memory");
    19350  }
    19351  
    19352 -#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
    19353 +static inline int __raw_read_trylock(raw_rwlock_t *rw)
    19354 +{
    19355 +       unsigned int tmp;
    19356 +       int ret;
    19357 +
    19358 +       if (R10000_LLSC_WAR) {
    19359 +               __asm__ __volatile__(
    19360 +               "       .set    noreorder       # __raw_read_trylock    \n"
    19361 +               "       li      %2, 0                                   \n"
    19362 +               "1:     ll      %1, %3                                  \n"
    19363 +               "       bnez    %1, 2f                                  \n"
    19364 +               "        addu   %1, 1                                   \n"
    19365 +               "       sc      %1, %0                                  \n"
    19366 +               "       beqzl   %1, 1b                                  \n"
    19367 +               "       .set    reorder                                 \n"
    19368 +#ifdef CONFIG_SMP
    19369 +               "        sync                                           \n"
    19370 +#endif
    19371 +               "       li      %2, 1                                   \n"
    19372 +               "2:                                                     \n"
    19373 +               : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
    19374 +               : "m" (rw->lock)
    19375 +               : "memory");
    19376 +       } else {
    19377 +               __asm__ __volatile__(
    19378 +               "       .set    noreorder       # __raw_read_trylock    \n"
    19379 +               "       li      %2, 0                                   \n"
    19380 +               "1:     ll      %1, %3                                  \n"
    19381 +               "       bnez    %1, 2f                                  \n"
    19382 +               "        addu   %1, 1                                   \n"
    19383 +               "       sc      %1, %0                                  \n"
    19384 +               "       beqz    %1, 1b                                  \n"
    19385 +               "       .set    reorder                                 \n"
    19386 +#ifdef CONFIG_SMP
    19387 +               "        sync                                           \n"
    19388 +#endif
    19389 +               "       li      %2, 1                                   \n"
    19390 +               "2:                                                     \n"
    19391 +               : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
    19392 +               : "m" (rw->lock)
    19393 +               : "memory");
    19394 +       }
    19395 +
    19396 +       return ret;
    19397 +}
    19398  
    19399  static inline int __raw_write_trylock(raw_rwlock_t *rw)
    19400  {
    19401 @@ -283,4 +327,5 @@
    19402         return ret;
    19403  }
    19404  
    19405 +
    19406  #endif /* _ASM_SPINLOCK_H */
    19407 diff -Naur linux-2.6.18.3/include/asm-mips/system.h linux-mips-2.6.18.3/include/asm-mips/system.h
    19408 --- linux-2.6.18.3/include/asm-mips/system.h    2006-11-18 19:28:22.000000000 -0800
    19409 +++ linux-mips-2.6.18.3/include/asm-mips/system.h       2006-11-20 10:09:08.000000000 -0800
    19410 @@ -392,7 +392,7 @@
    19411  {
    19412         __u64 retval;
    19413  
    19414 -       if (cpu_has_llsc) {
    19415 +       if (cpu_has_llsc && R10000_LLSC_WAR) {
    19416                 __asm__ __volatile__(
    19417                 "       .set    push                                    \n"
    19418                 "       .set    noat                                    \n"
    19419 diff -Naur linux-2.6.18.3/include/asm-mips/timex.h linux-mips-2.6.18.3/include/asm-mips/timex.h
    19420 --- linux-2.6.18.3/include/asm-mips/timex.h     2006-11-18 19:28:22.000000000 -0800
    19421 +++ linux-mips-2.6.18.3/include/asm-mips/timex.h        2006-11-20 10:09:08.000000000 -0800
    19422 @@ -8,6 +8,8 @@
    19423  #ifndef _ASM_TIMEX_H
    19424  #define _ASM_TIMEX_H
    19425  
    19426 +#ifdef __KERNEL__
    19427 +
    19428  #include <asm/mipsregs.h>
    19429  
    19430  /*
    19431 @@ -51,4 +53,6 @@
    19432         return read_c0_count();
    19433  }
    19434  
    19435 +#endif /* __KERNEL__ */
    19436 +
    19437  #endif /*  _ASM_TIMEX_H */
    19438 diff -Naur linux-2.6.18.3/include/asm-mips/unistd.h linux-mips-2.6.18.3/include/asm-mips/unistd.h
    19439 --- linux-2.6.18.3/include/asm-mips/unistd.h    2006-11-18 19:28:22.000000000 -0800
    19440 +++ linux-mips-2.6.18.3/include/asm-mips/unistd.h       2006-11-20 10:09:08.000000000 -0800
    19441 @@ -313,7 +313,7 @@
    19442  #define __NR_mknodat                   (__NR_Linux + 290)
    19443  #define __NR_fchownat                  (__NR_Linux + 291)
    19444  #define __NR_futimesat                 (__NR_Linux + 292)
    19445 -#define __NR_fstatat                   (__NR_Linux + 293)
    19446 +#define __NR_fstatat64                 (__NR_Linux + 293)
    19447  #define __NR_unlinkat                  (__NR_Linux + 294)
    19448  #define __NR_renameat                  (__NR_Linux + 295)
    19449  #define __NR_linkat                    (__NR_Linux + 296)
    19450 @@ -329,16 +329,18 @@
    19451  #define __NR_tee                       (__NR_Linux + 306)
    19452  #define __NR_vmsplice                  (__NR_Linux + 307)
    19453  #define __NR_move_pages                        (__NR_Linux + 308)
    19454 +#define __NR_set_robust_list           (__NR_Linux + 309)
    19455 +#define __NR_get_robust_list           (__NR_Linux + 310)
    19456  
    19457  /*
    19458   * Offset of the last Linux o32 flavoured syscall
    19459   */
    19460 -#define __NR_Linux_syscalls            308
    19461 +#define __NR_Linux_syscalls            310
    19462  
    19463  #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
    19464  
    19465  #define __NR_O32_Linux                 4000
    19466 -#define __NR_O32_Linux_syscalls                308
    19467 +#define __NR_O32_Linux_syscalls                310
    19468  
    19469  #if _MIPS_SIM == _MIPS_SIM_ABI64
    19470  
    19471 @@ -598,7 +600,7 @@
    19472  #define __NR_mknodat                   (__NR_Linux + 249)
    19473  #define __NR_fchownat                  (__NR_Linux + 250)
    19474  #define __NR_futimesat                 (__NR_Linux + 251)
    19475 -#define __NR_fstatat                   (__NR_Linux + 252)
    19476 +#define __NR_newfstatat                        (__NR_Linux + 252)
    19477  #define __NR_unlinkat                  (__NR_Linux + 253)
    19478  #define __NR_renameat                  (__NR_Linux + 254)
    19479  #define __NR_linkat                    (__NR_Linux + 255)
    19480 @@ -614,16 +616,18 @@
    19481  #define __NR_tee                       (__NR_Linux + 265)
    19482  #define __NR_vmsplice                  (__NR_Linux + 266)
    19483  #define __NR_move_pages                        (__NR_Linux + 267)
    19484 +#define __NR_set_robust_list           (__NR_Linux + 268)
    19485 +#define __NR_get_robust_list           (__NR_Linux + 269)
    19486  
    19487  /*
    19488   * Offset of the last Linux 64-bit flavoured syscall
    19489   */
    19490 -#define __NR_Linux_syscalls            267
    19491 +#define __NR_Linux_syscalls            269
    19492  
    19493  #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
    19494  
    19495  #define __NR_64_Linux                  5000
    19496 -#define __NR_64_Linux_syscalls         267
    19497 +#define __NR_64_Linux_syscalls         269
    19498  
    19499  #if _MIPS_SIM == _MIPS_SIM_NABI32
    19500  
    19501 @@ -887,7 +891,7 @@
    19502  #define __NR_mknodat                   (__NR_Linux + 253)
    19503  #define __NR_fchownat                  (__NR_Linux + 254)
    19504  #define __NR_futimesat                 (__NR_Linux + 255)
    19505 -#define __NR_fstatat                   (__NR_Linux + 256)
    19506 +#define __NR_newfstatat                        (__NR_Linux + 256)
    19507  #define __NR_unlinkat                  (__NR_Linux + 257)
    19508  #define __NR_renameat                  (__NR_Linux + 258)
    19509  #define __NR_linkat                    (__NR_Linux + 259)
    19510 @@ -903,16 +907,18 @@
    19511  #define __NR_tee                       (__NR_Linux + 269)
    19512  #define __NR_vmsplice                  (__NR_Linux + 270)
    19513  #define __NR_move_pages                        (__NR_Linux + 271)
    19514 +#define __NR_set_robust_list           (__NR_Linux + 272)
    19515 +#define __NR_get_robust_list           (__NR_Linux + 273)
    19516  
    19517  /*
    19518   * Offset of the last N32 flavoured syscall
    19519   */
    19520 -#define __NR_Linux_syscalls            271
    19521 +#define __NR_Linux_syscalls            273
    19522  
    19523  #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
    19524  
    19525  #define __NR_N32_Linux                 6000
    19526 -#define __NR_N32_Linux_syscalls                271
    19527 +#define __NR_N32_Linux_syscalls                273
    19528  
    19529  #ifdef __KERNEL__
    19530  
    19531 diff -Naur linux-2.6.18.3/include/asm-mips/user.h linux-mips-2.6.18.3/include/asm-mips/user.h
    19532 --- linux-2.6.18.3/include/asm-mips/user.h      2006-11-18 19:28:22.000000000 -0800
    19533 +++ linux-mips-2.6.18.3/include/asm-mips/user.h 2006-11-20 10:09:08.000000000 -0800
    19534 @@ -8,6 +8,8 @@
    19535  #ifndef _ASM_USER_H
    19536  #define _ASM_USER_H
    19537  
    19538 +#ifdef __KERNEL__
    19539 +
    19540  #include <asm/page.h>
    19541  #include <asm/reg.h>
    19542  
    19543 @@ -55,4 +57,6 @@
    19544  #define HOST_DATA_START_ADDR   (u.start_data)
    19545  #define HOST_STACK_END_ADDR    (u.start_stack + u.u_ssize * NBPG)
    19546  
    19547 +#endif /* __KERNEL__ */
    19548 +
    19549  #endif /* _ASM_USER_H */
    19550 diff -Naur linux-2.6.18.3/include/linux/highmem.h linux-mips-2.6.18.3/include/linux/highmem.h
    19551 --- linux-2.6.18.3/include/linux/highmem.h      2006-11-18 19:28:22.000000000 -0800
    19552 +++ linux-mips-2.6.18.3/include/linux/highmem.h 2006-11-20 10:09:08.000000000 -0800
    19553 @@ -89,7 +89,10 @@
     13645diff -Naur linux-2.6.19/include/linux/highmem.h linux-mips-2.6.19/include/linux/highmem.h
     13646--- linux-2.6.19/include/linux/highmem.h        2006-11-29 13:57:37.000000000 -0800
     13647+++ linux-mips-2.6.19/include/linux/highmem.h   2006-11-29 15:23:09.000000000 -0800
     13648@@ -94,7 +94,10 @@
    1955413649        kunmap_atomic(kaddr, KM_USER0);
    1955513650 }
     
    1956313658        char *vfrom, *vto;
    1956413659 
    19565 @@ -102,6 +105,8 @@
     13660@@ -107,6 +110,8 @@
    1956613661        smp_wmb();
    1956713662 }
     
    1957213667 {
    1957313668        char *vfrom, *vto;
    19574 diff -Naur linux-2.6.18.3/include/linux/pci_ids.h linux-mips-2.6.18.3/include/linux/pci_ids.h
    19575 --- linux-2.6.18.3/include/linux/pci_ids.h      2006-11-18 19:28:22.000000000 -0800
    19576 +++ linux-mips-2.6.18.3/include/linux/pci_ids.h 2006-11-20 10:09:08.000000000 -0800
    19577 @@ -1603,6 +1603,9 @@
     13669diff -Naur linux-2.6.19/include/linux/pci_ids.h linux-mips-2.6.19/include/linux/pci_ids.h
     13670--- linux-2.6.19/include/linux/pci_ids.h        2006-11-29 13:57:37.000000000 -0800
     13671+++ linux-mips-2.6.19/include/linux/pci_ids.h   2006-11-29 15:23:09.000000000 -0800
     13672@@ -1604,6 +1604,9 @@
    1957813673 #define PCI_VENDOR_ID_SATSAGEM         0x1267
    1957913674 #define PCI_DEVICE_ID_SATSAGEM_NICCY   0x1016
     
    1958513680 #define PCI_VENDOR_ID_ENSONIQ          0x1274
    1958613681 #define PCI_DEVICE_ID_ENSONIQ_CT5880   0x5880
    19587 diff -Naur linux-2.6.18.3/include/linux/serial.h linux-mips-2.6.18.3/include/linux/serial.h
    19588 --- linux-2.6.18.3/include/linux/serial.h       2006-11-18 19:28:22.000000000 -0800
    19589 +++ linux-mips-2.6.18.3/include/linux/serial.h  2006-11-20 10:09:08.000000000 -0800
     13682diff -Naur linux-2.6.19/include/linux/serial.h linux-mips-2.6.19/include/linux/serial.h
     13683--- linux-2.6.19/include/linux/serial.h 2006-11-29 13:57:37.000000000 -0800
     13684+++ linux-mips-2.6.19/include/linux/serial.h    2006-11-29 15:23:09.000000000 -0800
    1959013685@@ -76,7 +76,8 @@
    1959113686 #define PORT_16654     11
     
    1959813693 #define SERIAL_IO_PORT 0
    1959913694 #define SERIAL_IO_HUB6 1
    19600 diff -Naur linux-2.6.18.3/include/linux/serial_ip3106.h linux-mips-2.6.18.3/include/linux/serial_ip3106.h
    19601 --- linux-2.6.18.3/include/linux/serial_ip3106.h        2006-11-18 19:28:22.000000000 -0800
    19602 +++ linux-mips-2.6.18.3/include/linux/serial_ip3106.h   2006-11-20 10:09:08.000000000 -0800
     13695diff -Naur linux-2.6.19/include/linux/serial_ip3106.h linux-mips-2.6.19/include/linux/serial_ip3106.h
     13696--- linux-2.6.19/include/linux/serial_ip3106.h  2006-11-29 13:57:37.000000000 -0800
     13697+++ linux-mips-2.6.19/include/linux/serial_ip3106.h     2006-11-29 15:23:09.000000000 -0800
    1960313698@@ -78,4 +78,16 @@
    1960413699 #define IP3106_UART_FIFO_RXFIFO                0x00001F00
     
    1961813713+
    1961913714 #endif
    19620 diff -Naur linux-2.6.18.3/mm/memory.c linux-mips-2.6.18.3/mm/memory.c
    19621 --- linux-2.6.18.3/mm/memory.c  2006-11-18 19:28:22.000000000 -0800
    19622 +++ linux-mips-2.6.18.3/mm/memory.c     2006-11-20 10:09:08.000000000 -0800
    19623 @@ -1407,7 +1407,7 @@
     13715diff -Naur linux-2.6.19/mm/memory.c linux-mips-2.6.19/mm/memory.c
     13716--- linux-2.6.19/mm/memory.c    2006-11-29 13:57:37.000000000 -0800
     13717+++ linux-mips-2.6.19/mm/memory.c       2006-11-29 15:23:09.000000000 -0800
     13718@@ -1431,7 +1431,7 @@
    1962413719        return pte;
    1962513720 }
     
    1963013725        /*
    1963113726         * If the source page was a PFN mapping, we don't have
    19632 @@ -1429,9 +1429,9 @@
    19633                         memset(kaddr, 0, PAGE_SIZE);
     13727@@ -1454,9 +1454,9 @@
    1963413728                kunmap_atomic(kaddr, KM_USER0);
     13729                flush_dcache_page(dst);
    1963513730                return;
    1963613731-               
     
    1964213737 
    1964313738 /*
    19644 @@ -1531,7 +1531,7 @@
     13739@@ -1567,7 +1567,7 @@
    1964513740                new_page = alloc_page_vma(GFP_HIGHUSER, vma, address);
    1964613741                if (!new_page)
     
    1965113746 
    1965213747        /*
    19653 @@ -2142,7 +2142,7 @@
     13748@@ -2191,7 +2191,7 @@
    1965413749                        page = alloc_page_vma(GFP_HIGHUSER, vma, address);
    1965513750                        if (!page)
     
    1966013755                        new_page = page;
    1966113756                        anon = 1;
    19662 diff -Naur linux-2.6.18.3/sound/oss/Kconfig linux-mips-2.6.18.3/sound/oss/Kconfig
    19663 --- linux-2.6.18.3/sound/oss/Kconfig    2006-11-18 19:28:22.000000000 -0800
    19664 +++ linux-mips-2.6.18.3/sound/oss/Kconfig       2006-11-20 10:09:08.000000000 -0800
    19665 @@ -132,6 +132,13 @@
     13757diff -Naur linux-2.6.19/sound/oss/Kconfig linux-mips-2.6.19/sound/oss/Kconfig
     13758--- linux-2.6.19/sound/oss/Kconfig      2006-11-29 13:57:37.000000000 -0800
     13759+++ linux-mips-2.6.19/sound/oss/Kconfig 2006-11-29 15:23:09.000000000 -0800
     13760@@ -128,6 +128,13 @@
    1966613761        select SND_AC97_CODEC
    1966713762        depends on SOUND_PRIME && (SOC_AU1550 || SOC_AU1200)
     
    1967713772        tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core"
    1967813773        depends on SOUND_PRIME && PCI
    19679 diff -Naur linux-2.6.18.3/sound/oss/Makefile linux-mips-2.6.18.3/sound/oss/Makefile
    19680 --- linux-2.6.18.3/sound/oss/Makefile   2006-11-18 19:28:22.000000000 -0800
    19681 +++ linux-mips-2.6.18.3/sound/oss/Makefile      2006-11-20 10:09:08.000000000 -0800
    19682 @@ -66,6 +66,7 @@
     13774diff -Naur linux-2.6.19/sound/oss/Makefile linux-mips-2.6.19/sound/oss/Makefile
     13775--- linux-2.6.19/sound/oss/Makefile     2006-11-29 13:57:37.000000000 -0800
     13776+++ linux-mips-2.6.19/sound/oss/Makefile        2006-11-29 15:23:09.000000000 -0800
     13777@@ -45,6 +45,7 @@
     13778 obj-$(CONFIG_SOUND_ES1371)     += es1371.o ac97_codec.o
    1968313779 obj-$(CONFIG_SOUND_VRC5477)    += nec_vrc5477.o ac97_codec.o
    19684  obj-$(CONFIG_SOUND_AU1000)     += au1000.o ac97_codec.o
    1968513780 obj-$(CONFIG_SOUND_AU1550_AC97)        += au1550_ac97.o ac97_codec.o
    1968613781+obj-$(CONFIG_SOUND_AU1550_I2S) += au1550_i2s.o
    19687  obj-$(CONFIG_SOUND_ESSSOLO1)   += esssolo1.o
    1968813782 obj-$(CONFIG_SOUND_FUSION)     += cs46xx.o ac97_codec.o
    19689  obj-$(CONFIG_SOUND_MAESTRO)    += maestro.o
    19690 diff -Naur linux-2.6.18.3/sound/oss/au1550_i2s.c linux-mips-2.6.18.3/sound/oss/au1550_i2s.c
    19691 --- linux-2.6.18.3/sound/oss/au1550_i2s.c       1969-12-31 16:00:00.000000000 -0800
    19692 +++ linux-mips-2.6.18.3/sound/oss/au1550_i2s.c  2006-11-20 10:09:08.000000000 -0800
     13783 obj-$(CONFIG_SOUND_TRIDENT)    += trident.o ac97_codec.o
     13784 obj-$(CONFIG_SOUND_EMU10K1)    += ac97_codec.o
     13785diff -Naur linux-2.6.19/sound/oss/au1550_i2s.c linux-mips-2.6.19/sound/oss/au1550_i2s.c
     13786--- linux-2.6.19/sound/oss/au1550_i2s.c 1969-12-31 16:00:00.000000000 -0800
     13787+++ linux-mips-2.6.19/sound/oss/au1550_i2s.c    2006-11-29 15:23:09.000000000 -0800
    1969313788@@ -0,0 +1,2029 @@
    1969413789+/*
  • patches/linux-2.6.19-mips_fixes-1.patch

    rc5d783f re89ec63  
    11Submitted By: Jim Gifford (patches at jg555 dot com)
    2 Date: 2006-10-22
    3 Initial Package Version: 2.6.18.1
     2Date: 2006-11-29
     3Initial Package Version: 2.6.19
    44Origin: Linux-MIPS Mailing List
    55Upstream Status: Not Applied
    66Description: These are patches that have not been accepted by
    7              Linux-MIPS.
     7             Linux-MIPS.
    88
    9         1 - iomap for MIPS - iomap.c io.h
    10         2 - Cobalt ide fixes
    11         3 - Updates to Support N32 only builds
     9        1 - iomap for MIPS - iomap.c io.h
     10        2 - Cobalt ide fixes
     11        3 - Updates to Support N32 only builds
    1212
    13 diff -Naur linux-2.6.18.1.orig/arch/mips/kernel/Makefile linux-2.6.18.1/arch/mips/kernel/Makefile
    14 --- linux-2.6.18.1.orig/arch/mips/kernel/Makefile       2006-10-13 20:34:03.000000000 -0700
    15 +++ linux-2.6.18.1/arch/mips/kernel/Makefile    2006-10-22 08:53:36.651478827 -0700
    16 @@ -56,7 +56,7 @@
     13diff -Naur linux-2.6.19.orig/arch/mips/kernel/Makefile linux-2.6.19/arch/mips/kernel/Makefile
     14--- linux-2.6.19.orig/arch/mips/kernel/Makefile 2006-11-29 13:57:37.000000000 -0800
     15+++ linux-2.6.19/arch/mips/kernel/Makefile      2006-11-29 20:06:07.000000000 -0800
     16@@ -57,7 +57,7 @@
    1717 obj-$(CONFIG_64BIT)            += scall64-64.o
    1818 obj-$(CONFIG_BINFMT_IRIX)      += binfmt_irix.o
     
    2323 
    2424 obj-$(CONFIG_KGDB)             += gdb-low.o gdb-stub.o
    25 diff -Naur linux-2.6.18.1.orig/arch/mips/lib/Makefile linux-2.6.18.1/arch/mips/lib/Makefile
    26 --- linux-2.6.18.1.orig/arch/mips/lib/Makefile  2006-10-22 08:44:32.090563000 -0700
    27 +++ linux-2.6.18.1/arch/mips/lib/Makefile       2006-10-22 08:53:05.908554370 -0700
     25diff -Naur linux-2.6.19.orig/arch/mips/lib/Makefile linux-2.6.19/arch/mips/lib/Makefile
     26--- linux-2.6.19.orig/arch/mips/lib/Makefile    2006-11-29 20:05:48.000000000 -0800
     27+++ linux-2.6.19/arch/mips/lib/Makefile 2006-11-29 20:06:07.000000000 -0800
    2828@@ -5,6 +5,8 @@
    2929 lib-y  += csum_partial_copy.o memcpy.o promlib.o strlen_user.o strncpy_user.o \
     
    3535 lib-y += ashldi3.o ashrdi3.o lshrdi3.o
    3636 
    37 diff -Naur linux-2.6.18.1.orig/arch/mips/lib/iomap.c linux-2.6.18.1/arch/mips/lib/iomap.c
    38 --- linux-2.6.18.1.orig/arch/mips/lib/iomap.c   1969-12-31 16:00:00.000000000 -0800
    39 +++ linux-2.6.18.1/arch/mips/lib/iomap.c        2006-10-22 08:53:05.908554370 -0700
     37diff -Naur linux-2.6.19.orig/arch/mips/lib/iomap.c linux-2.6.19/arch/mips/lib/iomap.c
     38--- linux-2.6.19.orig/arch/mips/lib/iomap.c     1969-12-31 16:00:00.000000000 -0800
     39+++ linux-2.6.19/arch/mips/lib/iomap.c  2006-11-29 20:06:07.000000000 -0800
    4040@@ -0,0 +1,78 @@
    4141+/*
     
    117117+EXPORT_SYMBOL(pci_iomap);
    118118+EXPORT_SYMBOL(pci_iounmap);
    119 diff -Naur linux-2.6.18.1.orig/include/asm-mips/io.h linux-2.6.18.1/include/asm-mips/io.h
    120 --- linux-2.6.18.1.orig/include/asm-mips/io.h   2006-10-22 08:44:40.566266000 -0700
    121 +++ linux-2.6.18.1/include/asm-mips/io.h        2006-10-22 08:53:05.908554370 -0700
     119diff -Naur linux-2.6.19.orig/include/asm-mips/io.h linux-2.6.19/include/asm-mips/io.h
     120--- linux-2.6.19.orig/include/asm-mips/io.h     2006-11-29 20:05:48.000000000 -0800
     121+++ linux-2.6.19/include/asm-mips/io.h  2006-11-29 20:06:07.000000000 -0800
    122122@@ -518,6 +518,34 @@
    123123 }
     
    155155  * to explicitly ioremap() it. The fact that the ISA IO space is mapped
    156156  * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
    157 diff -Naur linux-2.6.18.1.orig/include/asm-mips/mach-cobalt/ide.h linux-2.6.18.1/include/asm-mips/mach-cobalt/ide.h
    158 --- linux-2.6.18.1.orig/include/asm-mips/mach-cobalt/ide.h      1969-12-31 16:00:00.000000000 -0800
    159 +++ linux-2.6.18.1/include/asm-mips/mach-cobalt/ide.h   2006-10-22 08:53:05.908554370 -0700
     157diff -Naur linux-2.6.19.orig/include/asm-mips/mach-cobalt/ide.h linux-2.6.19/include/asm-mips/mach-cobalt/ide.h
     158--- linux-2.6.19.orig/include/asm-mips/mach-cobalt/ide.h        1969-12-31 16:00:00.000000000 -0800
     159+++ linux-2.6.19/include/asm-mips/mach-cobalt/ide.h     2006-11-29 20:06:07.000000000 -0800
    160160@@ -0,0 +1,83 @@
    161161+
  • patches/linux-2.6.19-tulip-1.patch

    rc5d783f re89ec63  
    11Submitted By: Jim Gifford (patches at jg555 dot com)
    2 Date: 2005-10-29
    3 Initial Package Version: 2.6.14
     2Date: 2006-11-29
     3Initial Package Version: 2.6.19
    44Origin: Grant Gundler (parisc linux)
    55Upstream Status: in -mm
    66Description: Make the tulip drivers follow the chipset specs
    7  
    8 diff -Naur linux-2.6.14.orig/drivers/net/tulip/21142.c linux-2.6.14/drivers/net/tulip/21142.c
    9 --- linux-2.6.14.orig/drivers/net/tulip/21142.c 2005-10-28 00:02:08.000000000 +0000
    10 +++ linux-2.6.14/drivers/net/tulip/21142.c      2005-10-30 03:54:09.000000000 +0000
     7
     8diff -Naur linux-2.6.19.orig/drivers/net/tulip/21142.c linux-2.6.19/drivers/net/tulip/21142.c
     9--- linux-2.6.19.orig/drivers/net/tulip/21142.c 2006-11-29 13:57:37.000000000 -0800
     10+++ linux-2.6.19/drivers/net/tulip/21142.c      2006-11-29 19:27:20.000000000 -0800
    1111@@ -172,7 +172,7 @@
    1212                        int i;
     
    1818                                        tulip_select_media(dev, startup);
    1919                                        setup_done = 1;
    20 diff -Naur linux-2.6.14.orig/drivers/net/tulip/media.c linux-2.6.14/drivers/net/tulip/media.c
    21 --- linux-2.6.14.orig/drivers/net/tulip/media.c 2005-10-28 00:02:08.000000000 +0000
    22 +++ linux-2.6.14/drivers/net/tulip/media.c      2005-10-30 03:54:09.000000000 +0000
     20diff -Naur linux-2.6.19.orig/drivers/net/tulip/media.c linux-2.6.19/drivers/net/tulip/media.c
     21--- linux-2.6.19.orig/drivers/net/tulip/media.c 2006-11-29 13:57:37.000000000 -0800
     22+++ linux-2.6.19/drivers/net/tulip/media.c      2006-11-29 19:27:20.000000000 -0800
    2323@@ -44,8 +44,10 @@
    2424 
     
    9292                        if (tmp_info)
    9393                                tp->advertising[phy_num] = tmp_info | 1;
    94 diff -Naur linux-2.6.14.orig/drivers/net/tulip/tulip.h linux-2.6.14/drivers/net/tulip/tulip.h
    95 --- linux-2.6.14.orig/drivers/net/tulip/tulip.h 2005-10-28 00:02:08.000000000 +0000
    96 +++ linux-2.6.14/drivers/net/tulip/tulip.h      2005-10-30 03:54:09.000000000 +0000
    97 @@ -474,8 +474,11 @@
     94diff -Naur linux-2.6.19.orig/drivers/net/tulip/tulip.h linux-2.6.19/drivers/net/tulip/tulip.h
     95--- linux-2.6.19.orig/drivers/net/tulip/tulip.h 2006-11-29 13:57:37.000000000 -0800
     96+++ linux-2.6.19/drivers/net/tulip/tulip.h      2006-11-29 19:27:20.000000000 -0800
     97@@ -481,8 +481,11 @@
    9898                        udelay(10);
    9999 
     
    109109 }
    110110 
    111 diff -Naur linux-2.6.14.orig/drivers/net/tulip/tulip_core.c linux-2.6.14/drivers/net/tulip/tulip_core.c
    112 --- linux-2.6.14.orig/drivers/net/tulip/tulip_core.c    2005-10-28 00:02:08.000000000 +0000
    113 +++ linux-2.6.14/drivers/net/tulip/tulip_core.c 2005-10-30 03:54:09.000000000 +0000
    114 @@ -22,7 +22,7 @@
     111diff -Naur linux-2.6.19.orig/drivers/net/tulip/tulip_core.c linux-2.6.19/drivers/net/tulip/tulip_core.c
     112--- linux-2.6.19.orig/drivers/net/tulip/tulip_core.c    2006-11-29 13:57:37.000000000 -0800
     113+++ linux-2.6.19/drivers/net/tulip/tulip_core.c 2006-11-29 19:27:20.000000000 -0800
     114@@ -21,7 +21,7 @@
    115115 #else
    116  #define DRV_VERSION    "1.1.13"
     116 #define DRV_VERSION    "1.1.14"
    117117 #endif
    118118-#define DRV_RELDATE    "May 11, 2002"
     
    121121 
    122122 #include <linux/module.h>
    123 @@ -148,7 +148,7 @@
    124         HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI, tulip_timer },
    125  
    126    /* DC21142, DC21143 */
    127 -  { "Digital DS21143 Tulip", 128, 0x0801fbff,
    128 +  { "Digital DS21142/DS21143 Tulip", 128, 0x0801fbff,
    129         HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY
    130         | HAS_INTR_MITIGATION | HAS_PCI_MWI, t21142_timer },
    131  
     123
Note: See TracChangeset for help on using the changeset viewer.