Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/vax/vax Routine to figure out which system type is ...



details:   https://anonhg.NetBSD.org/src/rev/f425adcc1588
branches:  trunk
changeset: 473182:f425adcc1588
user:      ragge <ragge%NetBSD.org@localhost>
date:      Sun May 23 22:00:43 1999 +0000

description:
Routine to figure out which system type is booted.

diffstat:

 sys/arch/vax/vax/findcpu.c |  129 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 129 insertions(+), 0 deletions(-)

diffs (133 lines):

diff -r 5da9f50a0704 -r f425adcc1588 sys/arch/vax/vax/findcpu.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/vax/vax/findcpu.c        Sun May 23 22:00:43 1999 +0000
@@ -0,0 +1,129 @@
+/*     $NetBSD: findcpu.c,v 1.1 1999/05/23 22:00:43 ragge Exp $        */
+/*
+ * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed at Ludd, University of Lule}.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include <sys/param.h>
+
+#include <machine/sid.h>
+#include <machine/nexus.h>
+#include <machine/mtpr.h>
+
+/* 
+ * We set up some information about the machine we're
+ * running on and thus initializes/uses vax_cputype and vax_boardtype.
+ * There should be no need to change/reinitialize these variables
+ * outside of this routine, they should be read only!
+ */
+int vax_cputype;       /* highest byte of SID register */
+int vax_bustype;       /* holds/defines all busses on this machine */
+int vax_boardtype;     /* machine dependend, combination of SID and SIE */
+ 
+int vax_cpudata;       /* contents of the SID register */
+int vax_siedata;       /* contents of the SIE register */
+int vax_confdata;      /* machine dependend, configuration/setup data */
+
+/*
+ * Try to figure out which type of system this is.
+ */
+void
+findcpu()
+{
+       vax_cpudata = mfpr(PR_SID);
+       vax_cputype = vax_cpudata >> 24;
+       vax_boardtype = vax_cputype << 24;
+
+       switch (vax_cputype) {
+       case VAX_TYP_780:
+               vax_bustype = VAX_SBIBUS | VAX_CPUBUS;
+               break;
+       case VAX_TYP_750:
+               vax_bustype = VAX_CMIBUS | VAX_CPUBUS;
+               break;
+       case VAX_TYP_790:
+               vax_bustype = VAX_CPUBUS | VAX_MEMBUS;
+               break;
+
+       case VAX_TYP_UV2:
+       case VAX_TYP_CVAX:
+       case VAX_TYP_RIGEL:
+       case VAX_TYP_MARIAH:
+       case VAX_TYP_SOC:
+               vax_siedata = *(int *)(0x20040004);     /* SIE address */
+               vax_boardtype |= vax_siedata >> 24;
+
+               switch (vax_boardtype) {
+               case VAX_BTYP_420: /* They are very similar */
+               case VAX_BTYP_410:
+               case VAX_BTYP_43:
+               case VAX_BTYP_46:
+               case VAX_BTYP_48:
+               case VAX_BTYP_49:
+                       vax_confdata = *(int *)(0x20020000);
+                       vax_bustype = VAX_VSBUS | VAX_CPUBUS;
+                       break;
+
+               case VAX_BTYP_9CC:
+               case VAX_BTYP_9RR:
+               case VAX_BTYP_1202:
+               case VAX_BTYP_1302:
+                       vax_bustype = VAX_XMIBUS;
+                       break;
+
+               case VAX_BTYP_670:
+               case VAX_BTYP_660:
+               case VAX_BTYP_60:
+               case VAX_BTYP_69D:
+                       /* vax_bustype = VAX_MVBUS; */
+               case VAX_BTYP_630:
+               case VAX_BTYP_650:
+                       vax_bustype = VAX_UNIBUS | VAX_CPUBUS;
+                       break;
+
+               }
+               break;
+
+       case VAX_TYP_8SS:
+               vax_boardtype = VAX_BTYP_8000;
+               vax_bustype = VAX_BIBUS;
+               break;
+
+#ifdef notyet
+       case VAX_TYP_8NN:
+       case VAX_TYP_8PS:
+               vax_boardtype = VAX_BTYP_8800;
+               vax_bustype = VAX_NBIBUS;
+               break;
+#endif
+       default:
+               /* CPU not supported, just give up */
+               asm("halt");
+       }
+}



Home | Main Index | Thread Index | Old Index