linux-mips
[Top] [All Lists]

drivers/tc patch for DS5000/200

To: linux-mips@linux-mips.org
Subject: drivers/tc patch for DS5000/200
From: "Brian R. Gaeke" <brg@dgate.org>
Date: Thu, 2 Dec 2004 18:22:04 -0600
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.5i
Hi linux-mips list,

First, I want to say, Linux/MIPS is great stuff - thanks for all your
hard work, folks!

Now, it is my understanding that, having a pre-REX PROM, the DECstation
5000/200 would not be able to successfully execute the REX calls
(rex_gettcinfo(), rex_slot_address()) in drivers/tc/tc.c.  Therefore,
I have found it necessary to use a patched kernel in my efforts to boot
Linux on VMIPS (http://www.dgate.org/vmips), which has lately gained some
(limited) DECstation 5000/200 emulation capabilities.

If you find this patch useful, you're quite welcome to it.  I'm also
interested in hearing from anyone who has access to a 5000/200 who can
tell me whether I'm right or wrong, as I only have old manuals and
header files to work from.

-Brian Gaeke

-- 
Brian R. Gaeke, brg at dgate.org -- GnuPG encrypted mail gleefully accepted

Index: tc.c
===================================================================
RCS file: /home/cvs/linux/drivers/tc/tc.c,v
retrieving revision 1.7.2.8
diff -u -a -d -p -r1.7.2.8 tc.c
--- tc.c        11 Aug 2003 11:52:38 -0000      1.7.2.8
+++ tc.c        3 Dec 2004 00:14:56 -0000
@@ -32,6 +32,7 @@ MODULE_LICENSE("GPL");
 slot_info tc_bus[MAX_SLOT];
 static int num_tcslots;
 static tcinfo *info;
+static tcinfo ds5000_200_info;
 
 unsigned long system_base;
 
@@ -196,8 +197,18 @@ void __init tc_init(void)
                tc_bus[i].flags = FREE;
        }
 
-       info = (tcinfo *) rex_gettcinfo();
-       slot0addr = (unsigned long)KSEG1ADDR(rex_slot_address(0));
+       if (mips_machtype != MACH_DS5000_200) {
+               info = (tcinfo *) rex_gettcinfo();
+               slot0addr = (unsigned long)KSEG1ADDR(rex_slot_address(0));
+       } else {
+               /* Hardcode these, because the old PROM lacks gettcinfo(). */
+               ds5000_200_info.revision = 0;
+               ds5000_200_info.parity = 0;
+               ds5000_200_info.clk_period = 40;
+               ds5000_200_info.slot_size = 4;
+               info = &ds5000_200_info;
+               slot0addr = 0xbe000000;
+       }
 
        switch (mips_machtype) {
        case MACH_DS5000_200:

<Prev in Thread] Current Thread [Next in Thread>