Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/cavium Attach an iobus with octrnm even if usi...



details:   https://anonhg.NetBSD.org/src/rev/fe3d1b2a9c27
branches:  trunk
changeset: 974954:fe3d1b2a9c27
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Aug 17 21:25:12 2020 +0000

description:
Attach an iobus with octrnm even if using devicetree (there is no
corresponding node for this device in the DT).

diffstat:

 sys/arch/mips/cavium/include/iobusvar.h |   4 +++-
 sys/arch/mips/cavium/mainbus.c          |   8 ++++++--
 sys/arch/mips/cavium/octeon1p_iobus.c   |   5 +++--
 sys/arch/mips/cavium/octeon_iobus.c     |  10 ++++++++--
 4 files changed, 20 insertions(+), 7 deletions(-)

diffs (118 lines):

diff -r 0a545d2956e1 -r fe3d1b2a9c27 sys/arch/mips/cavium/include/iobusvar.h
--- a/sys/arch/mips/cavium/include/iobusvar.h   Mon Aug 17 21:00:29 2020 +0000
+++ b/sys/arch/mips/cavium/include/iobusvar.h   Mon Aug 17 21:25:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iobusvar.h,v 1.1 2015/04/29 08:32:01 hikaru Exp $      */
+/*     $NetBSD: iobusvar.h,v 1.2 2020/08/17 21:25:12 jmcneill Exp $    */
 
 /*
  * Copyright (c) 2007
@@ -43,6 +43,8 @@
 
 struct iobus_dev {
        const char      *name;
+       int             flags;
+#define        IOBUS_DEV_FDT   0x01
        int             nunits;
        const struct iobus_unit *units;
 };
diff -r 0a545d2956e1 -r fe3d1b2a9c27 sys/arch/mips/cavium/mainbus.c
--- a/sys/arch/mips/cavium/mainbus.c    Mon Aug 17 21:00:29 2020 +0000
+++ b/sys/arch/mips/cavium/mainbus.c    Mon Aug 17 21:25:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.3 2020/07/16 16:40:28 jmcneill Exp $     */
+/*     $NetBSD: mainbus.c,v 1.4 2020/08/17 21:25:12 jmcneill Exp $     */
 
 /*
  * Copyright (c) 2007
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2020/07/16 16:40:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2020/08/17 21:25:12 jmcneill Exp $");
 
 #define        _MIPS_BUS_DMA_PRIVATE
 
@@ -118,6 +118,10 @@
        config_found_sm_loc(self, "mainbus", NULL, &aa, mainbus_print,
            mainbus_submatch);
 
+       aa.aa_name = "iobus";
+       config_found_sm_loc(self, "mainbus", NULL, &aa, mainbus_print,
+           mainbus_submatch);
+
        octpow_bootstrap(&octeon_configuration);
        octfpa_bootstrap(&octeon_configuration);
 
diff -r 0a545d2956e1 -r fe3d1b2a9c27 sys/arch/mips/cavium/octeon1p_iobus.c
--- a/sys/arch/mips/cavium/octeon1p_iobus.c     Mon Aug 17 21:00:29 2020 +0000
+++ b/sys/arch/mips/cavium/octeon1p_iobus.c     Mon Aug 17 21:25:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: octeon1p_iobus.c,v 1.5 2020/06/23 05:18:02 simonb Exp $        */
+/*     $NetBSD: octeon1p_iobus.c,v 1.6 2020/08/17 21:25:12 jmcneill Exp $      */
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.5 2020/06/23 05:18:02 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.6 2020/08/17 21:25:12 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -67,6 +67,7 @@
 
 static const struct iobus_dev iobus_dev_octrnm = {
        .name = "octrnm",
+       .flags = IOBUS_DEV_FDT,
        .nunits = RNM_NUNITS,
        .units = iobus_units_octrnm
 };
diff -r 0a545d2956e1 -r fe3d1b2a9c27 sys/arch/mips/cavium/octeon_iobus.c
--- a/sys/arch/mips/cavium/octeon_iobus.c       Mon Aug 17 21:00:29 2020 +0000
+++ b/sys/arch/mips/cavium/octeon_iobus.c       Mon Aug 17 21:25:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: octeon_iobus.c,v 1.4 2020/06/23 05:14:18 simonb Exp $  */
+/*     $NetBSD: octeon_iobus.c,v 1.5 2020/08/17 21:25:12 jmcneill Exp $        */
 
 /*
  * Copyright (c) 2007
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: octeon_iobus.c,v 1.4 2020/06/23 05:14:18 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_iobus.c,v 1.5 2020/08/17 21:25:12 jmcneill Exp $");
 
 #include "locators.h"
 
@@ -40,6 +40,8 @@
 
 #include <mips/cavium/include/iobusvar.h>
 
+#include <dev/fdt/fdtvar.h>
+
 struct iobus_softc {
        device_t                sc_dev;
 
@@ -88,6 +90,7 @@
        struct iobus_softc *sc = device_private(self);
        const struct iobus_dev *dev;
        struct iobus_attach_args aa;
+       const bool fdt_p = fdtbus_get_data() != NULL;
        int i, j;
 
        sc->sc_dev = self;
@@ -100,6 +103,9 @@
        for (i = 0; i < (int)iobus_ndevs; i++) {
                dev = iobus_devs[i];
                for (j = 0; j < dev->nunits; j++) {
+                       if (fdt_p && (dev->flags & IOBUS_DEV_FDT) == 0)
+                               continue;
+
                        aa.aa_name = dev->name;
                        aa.aa_unitno = j;
                        aa.aa_unit = &dev->units[j];



Home | Main Index | Thread Index | Old Index