On Thu, Jan 03, 2019 at 10:47:14PM +1100, Jonathan Gray wrote:
> On Wed, Jan 02, 2019 at 04:08:53PM +1000, David Gwynne wrote:
> > This makes it more obvious what interesting things there are to hack on.
> > 
> > Thoughts? ok?
> > 
> > For example, from an od1000:
> > 
> > dlg@o1000 fdt$ dmesg | grep 'not configured'
> 
> The whitespace is wrong on 'return (UNCONF)'
> 
> The same diff for armv7 on cubox:

And octeon which I can't test:

Index: simplebus.c
===================================================================
RCS file: /cvs/src/sys/arch/octeon/dev/simplebus.c,v
retrieving revision 1.1
diff -u -p -r1.1 simplebus.c
--- simplebus.c 8 Dec 2016 16:24:51 -0000       1.1
+++ simplebus.c 5 Jan 2019 08:27:04 -0000
@@ -121,6 +121,26 @@ simplebus_submatch(struct device *self, 
        return 0;
 }
 
+int
+simplebus_print(void *aux, const char *pnp)
+{
+       struct fdt_attach_args *fa = aux;
+       char name[32];
+
+       if (!pnp)
+               return (QUIET);
+
+       if (OF_getprop(fa->fa_node, "name", name, sizeof(name)) > 0) {
+               name[sizeof(name) - 1] = 0;
+               printf("\"%s\"", name);
+       } else
+               printf("node %u", fa->fa_node);
+
+       printf(" at %s", pnp);
+
+       return (UNCONF);
+}
+
 /*
  * Look for a driver that wants to be attached to this node.
  */
@@ -186,7 +206,8 @@ simplebus_attach_node(struct device *sel
                OF_getpropintarray(node, "interrupts", fa.fa_intr, len);
        }
 
-       config_found_sm(self, &fa, NULL, simplebus_submatch);
+       config_found_sm(self, &fa, sc->sc_early ? NULL : simplebus_print,
+           simplebus_submatch);
 
        free(fa.fa_reg, M_DEVBUF, fa.fa_nreg * sizeof(struct fdt_reg));
        free(fa.fa_intr, M_DEVBUF, fa.fa_nintr * sizeof(uint32_t));

Reply via email to