Subject: patch to make /proc/cpuinfo show Indigo2

From: Vince Weaver <[email-masked]>
Date: Fri, 14 Jan 2000 07:42:40 -0500 (EST)

Hello,
Here is an improved version of my patch that properly implements
Indy/Indigo2 machine type in /proc/cpuinfo using the sgi_guiness flag.
I'd like whoever has the power to commit it please ;)

For example, my indigo2 now shows

bash# cat /proc/cpuinfo
cpu                     : MIPS
cpu model               : R4000SC V3.0
system type             : SGI Indigo2
BogoMIPS                : 49.87
byteorder               : big endian
unaligned accesses      : 0
wait instruction        : no
microsecond timers      : no
extra interrupt vector  : no
hardware watchpoint     : yes
VCED exceptions         : 38
VCEI exceptions         : 56

The patch follows....

[-----------------------------]

--- ./linux/include/asm-mips/bootinfo.old.h	Thu Jan 13 12:29:17 2000
+++ ./linux/include/asm-mips/bootinfo.h	Fri Jan 14 07:28:13 2000
@@ -91,8 +91,9 @@
  * Valid machtype for group SGI
  */
 #define MACH_SGI_INDY		0	/* R4?K and R5K Indy workstaions */
+#define MACH_SGI_INDIGO2	1
 
-#define GROUP_SGI_NAMES { "Indy" }
+#define GROUP_SGI_NAMES { "Indy", "Indigo2" }
 
 /*
  * Valid machtype for group COBALT
--- ./linux/arch/mips/arc/identify.old.c	Thu Jan 13 12:45:18 2000
+++ ./linux/arch/mips/arc/identify.c	Fri Jan 14 07:29:48 2000
@@ -17,6 +17,7 @@
 #include <asm/sgi/sgi.h>
 #include <asm/sgialib.h>
 #include <asm/bootinfo.h>
+#include <asm/sgi/sgihpc.h>
 
 struct smatch {
     char *name;
@@ -59,10 +60,14 @@
      */
     p = prom_getchild(PROM_NULL_COMPONENT);
     printk("ARCH: %s\n", p->iname);
-    mach = string_to_mach(p->iname);
 
+    mach = string_to_mach(p->iname);
     mips_machgroup = mach->group;
-    mips_machtype = mach->type;
+   
+     /* sgi_guiness=1 implies an indy, sgi_guiness=0 implies an Indigo2.
+      * We'll need to fix this if more SGI arch's get added.  --vmw
+      */
+    mips_machtype = !sgi_guiness;
     prom_flags = mach->flags;
 }

---

From: Vince Weaver <[email-masked]>
Date: Fri, 14 Jan 2000 08:45:09 -0500 (EST)

Ugh, just realized that ./linux/arch/mips/arc/identify.c is used by more
than just SGI machines.

Here is an updated patch, that should handle things correctly.

Vince

[P.S. (shameless plug)  If there is anoyone out there looking for a
 college student summer intern with some sgi/linux experience, let me
know]

[-------------]

 
 /*
  * Valid machtype for group COBALT
--- ./linux/arch/mips/arc/identify.c.old	Fri Jan 14 08:01:53 2000
+++ ./linux/arch/mips/arc/identify.c	Fri Jan 14 08:21:07 2000
@@ -17,6 +17,7 @@
 #include <asm/sgi/sgi.h>
 #include <asm/sgialib.h>
 #include <asm/bootinfo.h>
+#include <asm/sgi/sgihpc.h>
 
 struct smatch {
     char *name;
@@ -59,10 +60,16 @@
      */
 
+    mach = string_to_mach(p->iname);
     mips_machgroup = mach->group;
-    mips_machtype = mach->type;
+   
+     /* sgi_guiness=1 implies an indy, sgi_guiness=0 implies an Indigo2.
+      * We'll need to fix this if more SGI arch's get added.  --vmw
+      */
+    if (mips_machgroup==MACH_GROUP_SGI) mips_machtype=!sgi_guiness;
+    else mips_machtype=mach->type;
+    
     prom_flags = mach->flags;
 }