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/macppc/pci pullup 1.10->1.11 (thorpej)



details:   https://anonhg.NetBSD.org/src/rev/9d3b115e44ed
branches:  netbsd-1-4
changeset: 468684:9d3b115e44ed
user:      perry <perry%NetBSD.org@localhost>
date:      Thu May 06 19:38:49 1999 +0000

description:
pullup 1.10->1.11 (thorpej)

diffstat:

 sys/arch/macppc/pci/bandit.c |  52 +++++++++++++++++++++++++++----------------
 1 files changed, 32 insertions(+), 20 deletions(-)

diffs (98 lines):

diff -r 2830c6ea6c94 -r 9d3b115e44ed sys/arch/macppc/pci/bandit.c
--- a/sys/arch/macppc/pci/bandit.c      Thu May 06 19:38:31 1999 +0000
+++ b/sys/arch/macppc/pci/bandit.c      Thu May 06 19:38:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bandit.c,v 1.8.2.1 1999/05/06 02:20:56 perry Exp $     */
+/*     $NetBSD: bandit.c,v 1.8.2.2 1999/05/06 19:38:49 perry Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -107,14 +107,15 @@
 #define        BANDIT_SPECIAL_CYCLE    0xe00000        /* Special Cycle offset */
 
 static void bandit_init __P((pci_chipset_tag_t));
-static void scan_pci_devs __P((void));
+static void scan_pci_devs __P((int));
 static void config_slot __P((int, pci_chipset_tag_t, int));
 
 void
-pci_init()
+pci_init(canmap)
+       int canmap;
 {
 
-       scan_pci_devs();
+       scan_pci_devs(canmap);
 }
 
 static void
@@ -138,7 +139,8 @@
 
 
 static void
-scan_pci_devs()
+scan_pci_devs(canmap)
+       int canmap;
 {
        int reglen, node, child, n, is_bandit, is_mpc106;
        char name[64];
@@ -223,6 +225,7 @@
                        continue;
 
                pci_bridges[n].bus = reg[0];
+               pci_bridges[n].present = 1;
 
                /*
                 * Map the PCI configuration space access registers,
@@ -230,27 +233,36 @@
                 */
                if (is_bandit) {
                        /* XXX magic numbers */
-                       if (OF_getprop(node, "reg", reg, sizeof(reg)) != 8)
-                               continue;
-                       pci_bridges[n].addr = mapiodev(reg[0] + 0x800000, 4);
-                       pci_bridges[n].data = mapiodev(reg[0] + 0xc00000, 4);
                        pci_bridges[n].pc = n;
-                       bandit_init(n);
+                       if (canmap) {
+                               if (OF_getprop(node, "reg", reg,
+                                   sizeof(reg)) != 8)
+                                       continue;
+                               pci_bridges[n].addr =
+                                   mapiodev(reg[0] + 0x800000, 4);
+                               pci_bridges[n].data =
+                                   mapiodev(reg[0] + 0xc00000, 4);
+                               bandit_init(n);
+                       }
                } else if (is_mpc106) {
                        /* XXX magic numbers */
-                       pci_bridges[n].addr = mapiodev(0xfec00000, 4);
-                       pci_bridges[n].data = mapiodev(0xfee00000, 4);
                        pci_bridges[n].pc = PCI_CHIPSET_MPC106; /* for now */
+                       if (canmap) {
+                               pci_bridges[n].addr = mapiodev(0xfec00000, 4);
+                               pci_bridges[n].data = mapiodev(0xfee00000, 4);
+                       }
                }
 
-               /*
-                * Configure all of the PCI devices attached to this
-                * PCI-Host bridge.
-                */
-               child = OF_child(node);
-               while (child) {
-                       config_slot(child, pci_bridges[n].pc, -1);
-                       child = OF_peer(child);
+               if (canmap) {
+                       /*
+                        * Configure all of the PCI devices attached to this
+                        * PCI-Host bridge.
+                        */
+                       child = OF_child(node);
+                       while (child) {
+                               config_slot(child, pci_bridges[n].pc, -1);
+                               child = OF_peer(child);
+                       }
                }
 
                /* Bridge found, increment bridge instance. */



Home | Main Index | Thread Index | Old Index