linux-mips-fnet
[Top] [All Lists]

TurboChannel detect - diff

To: linux-mips@fnet.fr
Subject: TurboChannel detect - diff
From: Florian Lohoff <flo@mini.gt.owl.de>
Date: Tue, 16 Jun 1998 01:57:38 +0200
Hi,
after i got the first kernel compiled, (and was a little motivated)
i looked a bit after tc detection ... and tata .. here is my very
fist kernel patch :)  Should now fix the tc detection ... (it does
for me ...)

--------------------schanipp----------------
TURBOchannel rev. 1 at 25.0 MHz (no parity)
3 slots, size 8 MB
    slot 0: DEC      PMAZ-AA  V5.3d
    slot 1: DEC      PMAZ-AA  V5.3d
    slot 2: DEC      PMAF-FA  V1.1
--------------------------------------------

I hope i did not screw up with the other patch ... :)

Ok ... now i am (much) motivated ... what next ? Will there be a DecStation
hack meeting somewhere around Germany/Europe ? I might bring 2 complete
development places with me (2 Decstations + 2 CrossCompile boxes :) )

----------------------------------schanipp-----------------------
--- linux-2.1.99/drivers/tc/tc.c.orig   Tue Jun  2 17:16:03 1998
+++ linux-2.1.99/drivers/tc/tc.c        Tue Jun 16 03:49:52 1998
@@ -15,7 +15,7 @@
 #include <asm/ptrace.h>
 #include <linux/kernel.h>
 
-#define MAX_SLOT 7
+#define MAX_SLOT 3
 
 typedef struct {
        unsigned char *base_addr;
@@ -37,6 +37,7 @@
  */
 static void my_dbe_handler(struct pt_regs *regs)
 {
+       regs->cp0_epc += 4;
 }
 
 static void tc_probe(unsigned long startaddr, unsigned long size, int max)
@@ -51,8 +52,8 @@
        old_be_handler = dbe_board_handler;
        dbe_board_handler = my_dbe_handler;
 
-       for (slot = 0; slot <= max && slot <= MAX_SLOT; slot++) {
-               module = (char *)(startaddr + slot * size);
+       for (slot = 0; slot <= max && slot <= MAX_SLOT-1; slot++) {
+               module = (char *)(startaddr + slot * size * 1024 * 1024);
                offset = -1;
                if (module[OLDCARD + PATTERN0] == 0x55 && module[OLDCARD + 
PATTERN1] == 0x00
                  && module[OLDCARD + PATTERN2] == 0xaa && module[OLDCARD + 
PATTERN3] == 0xff)
-------------------------schanipp-----------------------------

Flo
-- 
Florian Lohoff          flo@mini.gt.owl.de              +49-5241-470566

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