All of lore.kernel.org
 help / color / mirror / Atom feed
* Indigo2 patch
@ 1999-05-02 16:24 Andrew R. Baker
  1999-05-02 18:53 ` Ulf Carlsson
  1999-05-07 15:11 ` Andrew R. Baker
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew R. Baker @ 1999-05-02 16:24 UTC (permalink / raw)
  To: Linux SGI

[-- Attachment #1: Type: TEXT/PLAIN, Size: 763 bytes --]



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.
 

[-- Attachment #2: indigo2.patch --]
[-- Type: TEXT/PLAIN, Size: 4713 bytes --]

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;
 };
 

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Indigo2 patch
@ 1999-06-03 19:57 Andrew R. Baker
  1999-06-04 20:07 ` Andrew R. Baker
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew R. Baker @ 1999-06-03 19:57 UTC (permalink / raw)
  To: Linux SGI

[-- Attachment #1: Type: TEXT/PLAIN, Size: 275 bytes --]


Here is the latest patch for the Indigo2, it looks good so far...
Things still left to do:
	allow 8254 timer acks (it actually works on the Indigo2)
	clean up IRQ data structure
	enable 2nd SCSI controller

I am going to work on these once I get back from USENIX.	

-Andrew

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1746 bytes --]

--- indy_int.c.orig	Tue Jun  1 07:27:58 1999
+++ indy_int.c	Wed Jun  2 10:56:46 1999
@@ -5,7 +5,9 @@
  *
  * 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
+ * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) 
+ *                    - Indigo2 changes
+ *                    - Interrupt handling fixes
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -449,10 +451,23 @@
 		action = local_irq_action[irq];
 	}
 
+	/* if irq == 0, then the interrupt has already been cleared */
+	if ( irq == 0 ) { goto end; }
+	/* if action == NULL, then we do have a handler for the irq */
+	if ( action == NULL ) { goto no_handler; }
+	
 	hardirq_enter(cpu);
 	kstat.irqs[0][irq + 16]++;
 	action->handler(irq, action->dev_id, regs);
 	hardirq_exit(cpu);
+	goto end;
+
+no_handler:
+	printk("No handler for local0 irq: %i\n", irq);
+
+end:	
+	return;	
+	
 }
 
 void indy_local1_irqdispatch(struct pt_regs *regs)
@@ -473,10 +488,23 @@
 		irq = lc1msk_to_irqnr[mask];
 		action = local_irq_action[irq];
 	}
+	/* if irq == 0, then the interrupt has already been cleared */
+	/* not sure if it is needed here, but it is needed for local0 */
+	if ( irq == 0 ) { goto end; }
+	/* if action == NULL, then we do have a handler for the irq */
+	if ( action == NULL ) { goto no_handler; }
+	
 	hardirq_enter(cpu);
 	kstat.irqs[0][irq + 24]++;
 	action->handler(irq, action->dev_id, regs);
 	hardirq_exit(cpu);
+	goto end;
+	
+no_handler:
+	printk("No handler for local1 irq: %i\n", irq);
+
+end:	
+	return;	
 }
 
 void indy_buserror_irq(struct pt_regs *regs)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-06-04 20:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-05-02 16:24 Indigo2 patch Andrew R. Baker
1999-05-02 18:53 ` Ulf Carlsson
1999-05-03  1:31   ` Andrew R. Baker
1999-05-04 10:59     ` Ralf Baechle
1999-05-07 15:11 ` Andrew R. Baker
1999-05-07 17:43   ` Ulf Carlsson
  -- strict thread matches above, loose matches on Subject: below --
1999-06-03 19:57 Andrew R. Baker
1999-06-04 20:07 ` Andrew R. Baker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.