Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/dev Add ofpci_make_tag().



details:   https://anonhg.NetBSD.org/src/rev/76bd7d53feec
branches:  trunk
changeset: 526594:76bd7d53feec
user:      eeh <eeh%NetBSD.org@localhost>
date:      Mon May 06 22:18:51 2002 +0000

description:
Add ofpci_make_tag().

diffstat:

 sys/arch/sparc64/dev/pci_machdep.c |  39 ++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 8 deletions(-)

diffs (73 lines):

diff -r d7f4fba782f0 -r 76bd7d53feec sys/arch/sparc64/dev/pci_machdep.c
--- a/sys/arch/sparc64/dev/pci_machdep.c        Mon May 06 22:12:43 2002 +0000
+++ b/sys/arch/sparc64/dev/pci_machdep.c        Mon May 06 22:18:51 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.26 2002/03/20 18:54:47 eeh Exp $     */
+/*     $NetBSD: pci_machdep.c,v 1.27 2002/05/06 22:18:51 eeh Exp $     */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -62,6 +62,8 @@
 
 #include <dev/ofw/ofw_pci.h>
 
+#include <sparc64/dev/ofpcivar.h>
+
 #include <sparc64/dev/iommureg.h>
 #include <sparc64/dev/iommuvar.h>
 #include <sparc64/dev/psychoreg.h>
@@ -315,7 +317,7 @@
                        continue;
 
                /* Got a match */
-               tag = PCITAG_CREATE(node, b, d, f);
+               tag = ofpci_make_tag(pc, node, b, d, f);
 
                /*
                 * Record the node.  This has two effects:
@@ -324,18 +326,39 @@
                 * 2) pci_bus_devorder will scan the right bus.
                 */
                pc->curnode = node;
-
-               /* Enable all the different spaces for this device */
-               pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
-                       PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_MASTER_ENABLE|
-                       PCI_COMMAND_IO_ENABLE);
-               DPRINTF(SPDB_PROBE, ("found node %x %s\n", node, name));
                return (tag);
        }
        /* No device found -- return a dead tag */
        return (tag);
 }
 
+pcitag_t
+ofpci_make_tag(pc, node, b, d, f)
+       pci_chipset_tag_t pc;
+       int node;
+       int b;
+       int d;
+       int f;
+{
+       pcitag_t tag;
+
+       tag = PCITAG_CREATE(node, b, d, f);
+
+       /*
+        * Record the node.  This has two effects:
+        *
+        * 1) We don't have to search as far.
+        * 2) pci_bus_devorder will scan the right bus.
+        */
+       pc->curnode = node;
+
+       /* Enable all the different spaces for this device */
+       pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
+               PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_MASTER_ENABLE|
+               PCI_COMMAND_IO_ENABLE);
+       return (tag);
+}
+
 /* assume we are mapped little-endian/side-effect */
 pcireg_t
 pci_conf_read(pc, tag, reg)



Home | Main Index | Thread Index | Old Index