Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/mcbus - Add a comment explaining why we probe...



details:   https://anonhg.NetBSD.org/src/rev/70ce8a86a3b6
branches:  trunk
changeset: 471939:70ce8a86a3b6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Apr 15 22:19:52 1999 +0000

description:
- Add a comment explaining why we probe for MCPCIAs in the shuffled
  MID order.
- Export the shuffled MID order; other files now need it.
- Don't derive the GID from the unit number of the mcbus.  A user could
  render his kernel non-bootable by using a different unit number in the
  kernel config file.  We (and the hardware) only support one MCBUS, so
  simply use instance 0.  Note that this will need to be adjusted if there
  are even any multiple-MCBUS systems.

diffstat:

 sys/arch/alpha/mcbus/mcbus.c    |  56 ++++++++++++++++++++++++++++------------
 sys/arch/alpha/mcbus/mcbusvar.h |   8 ++++-
 2 files changed, 45 insertions(+), 19 deletions(-)

diffs (144 lines):

diff -r 4aa64122d9fe -r 70ce8a86a3b6 sys/arch/alpha/mcbus/mcbus.c
--- a/sys/arch/alpha/mcbus/mcbus.c      Thu Apr 15 22:15:38 1999 +0000
+++ b/sys/arch/alpha/mcbus/mcbus.c      Thu Apr 15 22:19:52 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcbus.c,v 1.5 1999/04/10 01:21:38 cgd Exp $ */
+/* $NetBSD: mcbus.c,v 1.6 1999/04/15 22:19:52 thorpej Exp $ */
 
 /*
  * Copyright (c) 1998 by Matthew Jacob
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mcbus.c,v 1.5 1999/04/10 01:21:38 cgd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcbus.c,v 1.6 1999/04/15 22:19:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,9 +74,19 @@
        sizeof (mcbus_softc_t), mcbusmatch, mcbusattach
 };
 
+/*
+ * Tru64 UNIX (formerly Digital UNIX (formerly DEC OSF/1)) probes for MCPCIAs
+ * in the following order:
+ *
+ *     5, 4, 7, 6
+ *
+ * This is so that the built-in CD-ROM on the internal 53c810 is always
+ * dka500.  We probe them in the same order, for consistency.
+ */
+const int mcbus_mcpcia_probe_order[] = { 5, 4, 7, 6 };
+
 extern void mcpcia_config_cleanup __P((void));
 
-
 static int
 mcbusprint(aux, cp)
        void *aux;
@@ -132,11 +142,9 @@
                "(no bcache)", "1MB BCache", "2MB BCache", "4MB BCache",
                "??(4)??", "??(5)??", "??(6)??", "??(7)??"
        };
-       static const u_int8_t pci_mid_order[4] = { 5, 4, 7, 6 };
        struct mcbus_dev_attach_args ta;
        mcbus_softc_t *mbp = (mcbus_softc_t *)self;
-       u_int8_t mid;
-       int i;
+       int i, mid;
 
        printf("\n");
 
@@ -149,26 +157,35 @@
         * Find and "configure" memory.
         */
        ta.ma_name = mcbus_cd.cd_name;
-       ta.ma_gid = MCBUS_GID_FROM_INSTANCE(self->dv_unit);
+       /*
+        * XXX If we ever support more than one MCBUS, we'll
+        * XXX have to probe for them, and map them to unit
+        * XXX numbers.
+        */
+       ta.ma_gid = MCBUS_GID_FROM_INSTANCE(0);
        ta.ma_mid = 1;
        ta.ma_type = MCBUS_TYPE_MEM;
        mbp->mcbus_types[1] = MCBUS_TYPE_MEM;
-       config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
+       (void) config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
 
        /*
-        * Now find PCI busses. In keeping with Digital's ordering
-        * of things, we'll search in a specific MID order.
+        * Now find PCI busses.
         */
        for (i = 0; i < MCPCIA_PER_MCBUS; i++) {
-               mid = pci_mid_order[i];
+               mid = mcbus_mcpcia_probe_order[i];
                ta.ma_name = mcbus_cd.cd_name;
-               ta.ma_gid = MCBUS_GID_FROM_INSTANCE(self->dv_unit);
+               /*
+                * XXX If we ever support more than one MCBUS, we'll
+                * XXX have to probe for them, and map them to unit
+                * XXX numbers.
+                */
+               ta.ma_gid = MCBUS_GID_FROM_INSTANCE(0);
                ta.ma_mid = mid;
                ta.ma_type = MCBUS_TYPE_PCI;
                /*
-                * Attach any  children nodes (PCI busses).
+                * XXX MUST ACTUALLY PROBE FOR MCPCIA!
                 */
-               config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
+               (void) config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
        }
 
        /*
@@ -184,13 +201,18 @@
                printf("%s mid %d: %s %s\n", self->dv_xname,
                    mid, mcbus_node_type_str(MCBUS_TYPE_CPU),
                    bcs[mcbus_primary.mcbus_bcache & 0x7]);
-#if    0
+#if 0
                ta.ma_name = mcbus_cd.cd_name;
-               ta.ma_gid = MCBUS_GID_FROM_INSTANCE(self->dv_unit);
+               /*
+                * XXX If we ever support more than one MCBUS, we'll
+                * XXX have to probe for them, and map them to unit
+                * XXX numbers.
+                */
+               ta.ma_gid = MCBUS_GID_FROM_INSTANCE(0);
                ta.ma_mid = mid;
                ta.ma_type = MCBUS_TYPE_CPU;
                mbp->mcbus_types[mid] = MCBUS_TYPE_CPU;
-               config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
+               (void) config_found_sm(self, &ta, mcbusprint, mcbussubmatch);
 #endif
        }
 
diff -r 4aa64122d9fe -r 70ce8a86a3b6 sys/arch/alpha/mcbus/mcbusvar.h
--- a/sys/arch/alpha/mcbus/mcbusvar.h   Thu Apr 15 22:15:38 1999 +0000
+++ b/sys/arch/alpha/mcbus/mcbusvar.h   Thu Apr 15 22:19:52 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcbusvar.h,v 1.2 1998/04/15 20:40:34 mjacob Exp $ */
+/* $NetBSD: mcbusvar.h,v 1.3 1999/04/15 22:19:52 thorpej Exp $ */
 
 /*
  * Copyright (c) 1998 by Matthew Jacob
@@ -59,7 +59,6 @@
        u_int8_t        mcbus_bcache;   /* BCache on this CPU */
        u_int8_t        mcbus_valid;
 };
-extern struct mcbus_cpu_busdep mcbus_primary;
 
 #define        MCBUS_CPU_BCACHE_0MB    0
 #define        MCBUS_CPU_BCACHE_1MB    1
@@ -73,3 +72,8 @@
 #define        MCBUS_TYPE_MEM  2
 #define        MCBUS_TYPE_CPU  3
 #define        MCBUS_TYPE_PCI  4
+
+#ifdef _KERNEL
+extern struct mcbus_cpu_busdep mcbus_primary;
+extern const int mcbus_mcpcia_probe_order[];
+#endif



Home | Main Index | Thread Index | Old Index