Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sbus Associate the OpenBoot / OpenFirmware node with...



details:   https://anonhg.NetBSD.org/src/rev/6777aa9b3113
branches:  trunk
changeset: 379090:6777aa9b3113
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon May 10 23:53:44 2021 +0000

description:
Associate the OpenBoot / OpenFirmware node with attached devices
at config_found() time.

diffstat:

 sys/arch/sparc/dev/bootbus.c        |   5 +++--
 sys/arch/sparc/dev/ebus.c           |   8 +++++---
 sys/arch/sparc/dev/sbus.c           |   6 ++++--
 sys/arch/sparc/dev/vme_machdep.c    |   8 +++++---
 sys/arch/sparc/sparc/autoconf.c     |  22 +++++++++++++++-------
 sys/arch/sparc/sparc/iommu.c        |  12 ++++++++----
 sys/arch/sparc/sparc/msiiep.c       |   8 +++++---
 sys/arch/sparc64/dev/cbus.c         |   9 +++++----
 sys/arch/sparc64/dev/central.c      |   8 +++++---
 sys/arch/sparc64/dev/ebus.c         |   8 +++++---
 sys/arch/sparc64/dev/ebus_mainbus.c |   8 +++++---
 sys/arch/sparc64/dev/fhc.c          |   5 +++--
 sys/arch/sparc64/dev/psycho.c       |   8 +++++---
 sys/arch/sparc64/dev/pyro.c         |   8 +++++---
 sys/arch/sparc64/dev/sbus.c         |   8 +++++---
 sys/arch/sparc64/dev/schizo.c       |   8 +++++---
 sys/arch/sparc64/dev/upa.c          |   8 +++++---
 sys/arch/sparc64/dev/vbus.c         |   6 ++++--
 sys/arch/sparc64/dev/vpci.c         |   8 +++++---
 sys/arch/sparc64/sparc64/autoconf.c |  12 ++++++++----
 sys/dev/sbus/dma_sbus.c             |   5 +++--
 sys/dev/sbus/lebuffer.c             |   8 +++++---
 sys/dev/sbus/qec.c                  |   8 +++++---
 sys/dev/sbus/xbox.c                 |   8 +++++---
 24 files changed, 128 insertions(+), 74 deletions(-)

diffs (truncated from 744 to 300 lines):

diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc/dev/bootbus.c
--- a/sys/arch/sparc/dev/bootbus.c      Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc/dev/bootbus.c      Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootbus.c,v 1.21 2021/04/24 23:36:49 thorpej Exp $     */
+/*     $NetBSD: bootbus.c,v 1.22 2021/05/10 23:53:44 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bootbus.c,v 1.21 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bootbus.c,v 1.22 2021/05/10 23:53:44 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -123,6 +123,7 @@ bootbus_attach(device_t parent, device_t
                        panic("bootbus_attach: failed to set up attach args");
 
                config_found(self, &baa, bootbus_print,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(node),
                    CFARG_SUBMATCH, bootbus_submatch,
                    CFARG_EOL);
 
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc/dev/ebus.c
--- a/sys/arch/sparc/dev/ebus.c Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc/dev/ebus.c Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ebus.c,v 1.39 2021/04/24 23:36:49 thorpej Exp $ */
+/*     $NetBSD: ebus.c,v 1.40 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.39 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.40 2021/05/10 23:53:44 thorpej Exp $");
 
 #if defined(DEBUG) && !defined(EBUS_DEBUG)
 #define EBUS_DEBUG
@@ -316,7 +316,9 @@ ebus_attach(device_t parent, device_t se
                }
                DPRINTF(EDB_CHILD,
                        ("- found child `%s', attaching\n", ea.ea_name));
-               (void)config_found(self, &ea, ebus_print, CFARG_EOL);
+               (void)config_found(self, &ea, ebus_print,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+                   CFARG_EOL);
                ebus_destroy_attach_args(&ea);
        }
 }
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc/dev/sbus.c
--- a/sys/arch/sparc/dev/sbus.c Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc/dev/sbus.c Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.81 2021/04/24 23:36:49 thorpej Exp $ */
+/*     $NetBSD: sbus.c,v 1.82 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.81 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.82 2021/05/10 23:53:44 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -413,6 +413,7 @@ sbus_attach_common(struct sbus_softc *sc
                        panic("sbus_attach: %s: incomplete", sp);
                }
                (void) config_found(sc->sc_dev, (void *)&sa, sbus_print,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(node),
                    CFARG_EOL);
                sbus_destroy_attach_args(&sa);
        }
@@ -435,6 +436,7 @@ sbus_attach_common(struct sbus_softc *sc
                        continue;
                }
                (void) config_found(sc->sc_dev, (void *)&sa, sbus_print,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(node),
                    CFARG_EOL);
                sbus_destroy_attach_args(&sa);
        }
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc/dev/vme_machdep.c
--- a/sys/arch/sparc/dev/vme_machdep.c  Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc/dev/vme_machdep.c  Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vme_machdep.c,v 1.72 2021/04/24 23:36:49 thorpej Exp $ */
+/*     $NetBSD: vme_machdep.c,v 1.73 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.72 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.73 2021/05/10 23:53:44 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/extent.h>
@@ -431,7 +431,9 @@ vmeattach_iommu(device_t parent, device_
        printf(": version 0x%x\n",
               sc->sc_reg->vmebus_cr & VMEBUS_CR_IMPL);
 
-       (void)config_found(self, &vba, 0, CFARG_EOL);
+       (void)config_found(self, &vba, 0,
+           CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+           CFARG_EOL);
 #endif /* SUN4M */
 }
 
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc/sparc/autoconf.c
--- a/sys/arch/sparc/sparc/autoconf.c   Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc/sparc/autoconf.c   Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.265 2021/04/24 23:36:49 thorpej Exp $ */
+/*     $NetBSD: autoconf.c,v 1.266 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.265 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.266 2021/05/10 23:53:44 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1285,7 +1285,9 @@ mainbus_attach(device_t parent, device_t
                        ma.ma_dmatag = &mainbus_dma_tag;
                        ma.ma_node = node;
                        ma.ma_name = "cpu";
-                       config_found(dev, (void *)&ma, mbprint, CFARG_EOL);
+                       config_found(dev, (void *)&ma, mbprint,
+                           CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+                           CFARG_EOL);
                        if (node == bootnode && bootmid != 0) {
                                /* Re-enter loop to find all remaining CPUs */
                                goto rescan;
@@ -1297,7 +1299,9 @@ mainbus_attach(device_t parent, device_t
                ma.ma_dmatag = &mainbus_dma_tag;
                ma.ma_node = findroot();
                ma.ma_name = "cpu";
-               config_found(dev, (void *)&ma, mbprint, CFARG_EOL);
+               config_found(dev, (void *)&ma, mbprint,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(ma.ma_node),
+                   CFARG_EOL);
        }
 
        for (ssp = openboot_special; (sp = ssp->dev) != NULL; ssp++) {
@@ -1328,6 +1332,7 @@ mainbus_attach(device_t parent, device_t
                        continue;
 
                if (config_found(dev, (void *)&ma, mbprint,
+                                CFARG_DEVHANDLE, prom_node_to_devhandle(node),
                                 CFARG_EOL) == NULL) {
                        if (ssp->flags & BS_OPTIONAL) continue;
                        panic("%s", sp);
@@ -1387,8 +1392,9 @@ mainbus_attach(device_t parent, device_t
                        ma.ma_pri = 0;
                        ma.ma_promvaddr = 0;
 
-                       (void) config_found(dev, (void *)&ma, mbprint,
-                                           CFARG_EOL);
+                       config_found(dev, (void *)&ma, mbprint,
+                           CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+                           CFARG_EOL);
                        continue;
                }
 #endif /* SUN4M */
@@ -1405,7 +1411,9 @@ mainbus_attach(device_t parent, device_t
                if (prom_getprop_address1(node, &ma.ma_promvaddr) != 0)
                        continue;
 
-               (void) config_found(dev, (void *)&ma, mbprint, CFARG_EOL);
+               config_found(dev, (void *)&ma, mbprint,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+                   CFARG_EOL);
        }
 #endif /* SUN4C || SUN4M || SUN4D */
 }
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc/sparc/iommu.c
--- a/sys/arch/sparc/sparc/iommu.c      Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc/sparc/iommu.c      Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iommu.c,v 1.97 2021/04/24 23:36:49 thorpej Exp $ */
+/*     $NetBSD: iommu.c,v 1.98 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.97 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.98 2021/05/10 23:53:44 thorpej Exp $");
 
 #include "opt_sparc_arch.h"
 
@@ -298,7 +298,9 @@ iommu_attach(device_t parent, device_t s
                ia.iom_reg = &sbus_iommu_reg;
                ia.iom_nreg = 1;
 
-               (void) config_found(self, (void *)&ia, iommu_print, CFARG_EOL);
+               config_found(self, (void *)&ia, iommu_print,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+                   CFARG_EOL);
                return;
        }
 
@@ -321,7 +323,9 @@ iommu_attach(device_t parent, device_t s
                prom_getprop(node, "reg", sizeof(struct openprom_addr),
                        &ia.iom_nreg, &ia.iom_reg);
 
-               (void) config_found(self, (void *)&ia, iommu_print, CFARG_EOL);
+               config_found(self, (void *)&ia, iommu_print,
+                   CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+                   CFARG_EOL);
                if (ia.iom_reg != NULL)
                        free(ia.iom_reg, M_DEVBUF);
        }
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc/sparc/msiiep.c
--- a/sys/arch/sparc/sparc/msiiep.c     Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc/sparc/msiiep.c     Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msiiep.c,v 1.50 2021/04/24 23:36:49 thorpej Exp $ */
+/*     $NetBSD: msiiep.c,v 1.51 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 2001 Valeriy E. Ushakov
@@ -27,7 +27,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.50 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.51 2021/05/10 23:53:44 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -362,7 +362,9 @@ mspcic_attach(device_t parent, device_t 
 
        mspcic_pci_scan(sc->sc_node);
 
-       config_found(self, &pba, mspcic_print, CFARG_EOL);
+       config_found(self, &pba, mspcic_print,
+           CFARG_DEVHANDLE, prom_node_to_devhandle(sc->sc_node),
+           CFARG_EOL);
 }
 
 
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc64/dev/cbus.c
--- a/sys/arch/sparc64/dev/cbus.c       Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc64/dev/cbus.c       Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cbus.c,v 1.5 2021/04/24 23:36:49 thorpej Exp $ */
+/*     $NetBSD: cbus.c,v 1.6 2021/05/10 23:53:44 thorpej Exp $ */
 /*     $OpenBSD: cbus.c,v 1.15 2015/09/27 11:29:20 kettenis Exp $      */
 /*
  * Copyright (c) 2008 Mark Kettenis
@@ -118,11 +118,12 @@ cbus_attach(device_t parent, device_t se
                int rc = cbus_get_channel_endpoint(sc, &ca);
                DPRINTF(CBUSDB_AC, ("cbus_attach() - cbus_get_channel_endpoint() %d\n", rc));
                if ( rc != 0) {
-                 continue;
+                       continue;
                }
 
-               config_found(self, &ca, cbus_print, CFARG_EOL);
-
+               config_found(self, &ca, cbus_print,
+                   CFARG_DEVHANDLE, devhandle_from_of(ca.ca_node),
+                   CFARG_EOL);
        }
 }
 
diff -r 9558eb296982 -r 6777aa9b3113 sys/arch/sparc64/dev/central.c
--- a/sys/arch/sparc64/dev/central.c    Mon May 10 14:27:47 2021 +0000
+++ b/sys/arch/sparc64/dev/central.c    Mon May 10 23:53:44 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: central.c,v 1.6 2021/04/24 23:36:49 thorpej Exp $      */
+/*     $NetBSD: central.c,v 1.7 2021/05/10 23:53:44 thorpej Exp $      */
 /*     $OpenBSD: central.c,v 1.7 2010/11/11 17:58:23 miod Exp $        */
 
 /*
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: central.c,v 1.6 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: central.c,v 1.7 2021/05/10 23:53:44 thorpej Exp $");
 
 #include <sys/types.h>



Home | Main Index | Thread Index | Old Index