Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/arch/alpha/pci Pull up revision 1.7 (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/87ed245ac96c
branches:  netbsd-1-4
changeset: 469869:87ed245ac96c
user:      he <he%NetBSD.org@localhost>
date:      Thu Dec 16 23:16:54 1999 +0000

description:
Pull up revision 1.7 (requested by mjacob):
  Force probing of MCPCIAs such that if they are not there we can
  still boot.  Not all Alpha 4100 / Rawhide systems have the full
  four MCPCIAs.

diffstat:

 sys/arch/alpha/pci/mcpcia.c |  20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diffs (55 lines):

diff -r f0128c1cbad7 -r 87ed245ac96c sys/arch/alpha/pci/mcpcia.c
--- a/sys/arch/alpha/pci/mcpcia.c       Thu Dec 16 23:16:28 1999 +0000
+++ b/sys/arch/alpha/pci/mcpcia.c       Thu Dec 16 23:16:54 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcpcia.c,v 1.4.8.1 1999/04/16 23:36:29 thorpej Exp $ */
+/* $NetBSD: mcpcia.c,v 1.4.8.2 1999/12/16 23:16:54 he Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.4.8.1 1999/04/16 23:36:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.4.8.2 1999/12/16 23:16:54 he Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -97,6 +97,12 @@
         (((unsigned long) (mc)->cc_mid) << MCBUS_MID_SHIFT) | \
         (MCBUS_IOSPACE))
 
+#define        MCPCIA_PROBE(mid, gid)  \
+       badaddr((void *)KV(((((unsigned long) gid) << MCBUS_GID_SHIFT) | \
+        (((unsigned long) mid) << MCBUS_MID_SHIFT) | \
+        (MCBUS_IOSPACE) | MCPCIA_PCI_BRIDGE | _MCPCIA_PCI_REV)), \
+       sizeof(u_int32_t))
+
 static int     mcpciamatch __P((struct device *, struct cfdata *, void *));
 static void    mcpciaattach __P((struct device *, struct device *, void *));
 struct cfattach mcpcia_ca = {
@@ -152,6 +158,14 @@
        struct pcibus_attach_args pba;
        u_int32_t ctl;
 
+       /*
+        * Make sure this MCPCIA exists...
+        */
+       if (MCPCIA_PROBE(ma->ma_mid, ma->ma_gid)) {
+               mcp->mcpcia_cc = NULL;
+               printf(" (not present)\n");
+               return;
+       }
        printf("\n");
 
        /*
@@ -327,6 +341,8 @@
                        continue;
                
                ccp = mcp->mcpcia_cc;
+               if (ccp == NULL)
+                       continue;
 
                ctl = REGVAL(MCPCIA_INT_MASK0(ccp));
                ctl |= MCPCIA_GEN_IENABL;



Home | Main Index | Thread Index | Old Index