linux-mips
[Top] [All Lists]

Indigo2 patch

To: Linux SGI <linux@cthulhu.engr.sgi.com>
Subject: Indigo2 patch
From: "Andrew R. Baker" <andrewb@uab.edu>
Date: Sun, 2 May 1999 11:24:54 -0500 (CDT)
Sender: owner-linux@cthulhu.engr.sgi.com

OK, since this is my first time making a patch I am not sure I got
everything quite right.  This will let people with an Indigo2 actually
boot into Linux.  However, they probably won't be able to do much
thereafter (I get the kernel to die while doing a 'cat README' in the root
directory).  Unfortunately, this won't print the console boot messages to
the screen either.  To do this, I replaced the printk code in
kernel/printk.c with the printf code in arch/mips/arc/printf.c.  I'm sure
there is a better way, but I haven't found it yet.  These were made
against the yesterday's (1999.05.01) version of the CVS tree. 

-Andrew

P.S.  It would be nice to get someone to make sure this doesn't break
anything on the Indy.  I don't have one to test things on.
 
diff --exclude=*CVS* -r -u src/linux/arch/mips/Makefile 
src2/linux/arch/mips/Makefile
--- src/linux/arch/mips/Makefile        Tue Feb  9 17:11:30 1999
+++ src2/linux/arch/mips/Makefile       Sat May  1 21:35:01 1999
@@ -6,6 +6,7 @@
 #
 # Copyright (C) 1994, 1995, 1996 by Ralf Baechle
 # DECStation modifications by Paul M. Antoine, 1996
+# LINKFLAGS changed by Andrew R. Baker, 1999
 #
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies. Remember to do have actions
@@ -36,7 +37,8 @@
 CROSS_COMPILE  = $(tool-prefix)
 endif
 
-LINKFLAGS      = -static -N
+# having -N in LINKFLAGS causes my Indigo2 not to boot
+LINKFLAGS      = -static
 MODFLAGS       += -mlong-calls
 
 #
diff --exclude=*CVS* -r -u src/linux/arch/mips/sgi/kernel/indy_hpc.c 
src2/linux/arch/mips/sgi/kernel/indy_hpc.c
--- src/linux/arch/mips/sgi/kernel/indy_hpc.c   Tue Aug 25 04:14:48 1998
+++ src2/linux/arch/mips/sgi/kernel/indy_hpc.c  Sat May  1 21:50:42 1999
@@ -43,7 +43,8 @@
        prom_printf("sgihpc_init: ");
 #endif
 
-       if(sid & 1) {
+       /* This test works now thanks to William J. Earl */
+       if ((sid & 1) == 0 ) {
 #ifdef DEBUG_SGIHPC
                prom_printf("GUINESS ");
 #endif
diff --exclude=*CVS* -r -u src/linux/arch/mips/sgi/kernel/indy_int.c 
src2/linux/arch/mips/sgi/kernel/indy_int.c
--- src/linux/arch/mips/sgi/kernel/indy_int.c   Mon Jan  4 10:03:56 1999
+++ src2/linux/arch/mips/sgi/kernel/indy_int.c  Sat May  1 21:43:15 1999
@@ -5,6 +5,7 @@
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
+ * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -563,9 +564,16 @@
                }
        }
 
-       ioc_icontrol = &sgi_i3regs->ints;
-       ioc_timers = &sgi_i3regs->timers;
-       ioc_tclear = &sgi_i3regs->tclear;
+       /* Indy uses an INT3, Indigo2 uses an INT2 */
+       if (sgi_guiness) {
+               ioc_icontrol = &sgi_i3regs->ints;
+               ioc_timers = &sgi_i3regs->timers;
+               ioc_tclear = &sgi_i3regs->tclear;
+       } else {
+               ioc_icontrol = &sgi_i2regs->ints;
+               ioc_timers = &sgi_i2regs->timers;
+               ioc_tclear = &sgi_i2regs->tclear;
+       }
 
        /* Mask out all interrupts. */
        ioc_icontrol->imask0 = 0;
diff --exclude=*CVS* -r -u src/linux/arch/mips/sgi/kernel/indy_mc.c 
src2/linux/arch/mips/sgi/kernel/indy_mc.c
--- src/linux/arch/mips/sgi/kernel/indy_mc.c    Mon May  4 04:12:57 1998
+++ src2/linux/arch/mips/sgi/kernel/indy_mc.c   Sat May  1 21:39:09 1999
@@ -2,6 +2,7 @@
  * indy_mc.c: Routines for manipulating the INDY memory controller.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes
  *
  * $Id: indy_mc.c,v 1.3 1998/05/04 09:12:57 ralf Exp $
  */
@@ -150,6 +151,8 @@
                        tmpreg |= SGIMC_GIOPARM_PLINEEXP0; /* exp[01] pipelined 
*/
                        tmpreg |= SGIMC_GIOPARM_PLINEEXP1;
                        tmpreg |= SGIMC_GIOPARM_MASTEREISA;/* EISA masters */
+                       /* someone forgot this poor little guy... */
+                       tmpreg |= SGIMC_GIOPARM_GFX64;  /* GFX at 64 bits */
                }
        }
        mcmisc_regs->gioparm = tmpreg; /* poof */
diff --exclude=*CVS* -r -u src/linux/include/asm-mips/sgint23.h 
src2/linux/include/asm-mips/sgint23.h
--- src/linux/include/asm-mips/sgint23.h        Wed Mar 11 09:21:45 1998
+++ src2/linux/include/asm-mips/sgint23.h       Sat May  1 21:44:56 1999
@@ -2,6 +2,7 @@
  * sgint23.h: Defines for the SGI INT2 and INT3 chipsets.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - INT2 corrections
  */
 #ifndef _MIPS_SGINT23_H
 #define _MIPS_SGINT23_H
@@ -20,7 +21,7 @@
 #define SGINT_END      52  /* End of 'spaces' */
 
 /* INT2 occupies HPC PBUS slot 4, INT3 uses slot 6. */
-#define SGI_INT2_BASE 0x1fb80100 /* physical */
+#define SGI_INT2_BASE 0x1fbd9000 /* physical */
 #define SGI_INT3_BASE 0x1fbd9880 /* physical */
 
 struct sgi_ioc_ints {
@@ -128,6 +129,10 @@
 
 #define SGINT_TCSAMP_COUNTER  10255
 
+/* FIXME: What does this really look like?  It was written to have
+ * 17 registers, but there are only 16 in my Indigo2.
+ * I guessed at which one to remove...         - andrewb
+ */
 struct sgi_int2_regs {
        struct sgi_ioc_ints ints;
 
@@ -147,8 +152,11 @@
 #endif
 #define INT2_TCLEAR_T0CLR      0x1        /* Clear timer0 IRQ */
 #define INT2_TCLEAR_T1CLR      0x2        /* Clear timer1 IRQ */
-
-       unsigned long _unused[3];
+/* I am guesing there are only two unused registers here 
+ * but I could be wrong...                     - andrewb
+ */
+/*     unsigned long _unused[3]; */
+       unsigned long _unused[2];
        struct sgi_ioc_timers timers;
 };
 
<Prev in Thread] Current Thread [Next in Thread>