summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-01-03 23:04:52 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-01-03 23:04:52 +0000
commitd9043bb84ad3c55f405208760b367486949de1e1 (patch)
tree3184f4c0048bb2d56de21713b156eb87677f63e7 /sys/arch/arm64/dev
parent0dfd9163c7bb71a8f9d4d8461a704df39046f9f9 (diff)
add a simplebus print function so unconfigured devices appear in dmesg.
this was avoided previously because during the early stages of the port, there were mostly unsupported devices. the situation is a bit better now, so make the missing drivers more obvious so people can get interested. ok kettenis@
Diffstat (limited to 'sys/arch/arm64/dev')
-rw-r--r--sys/arch/arm64/dev/simplebus.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/arch/arm64/dev/simplebus.c b/sys/arch/arm64/dev/simplebus.c
index af2e1ff1d42..c2b19a1fb7e 100644
--- a/sys/arch/arm64/dev/simplebus.c
+++ b/sys/arch/arm64/dev/simplebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: simplebus.c,v 1.8 2017/06/01 21:19:07 patrick Exp $ */
+/* $OpenBSD: simplebus.c,v 1.9 2019/01/03 23:04:51 dlg Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
*
@@ -149,6 +149,26 @@ simplebus_submatch(struct device *self, void *match, void *aux)
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.
*/
@@ -221,7 +241,8 @@ simplebus_attach_node(struct device *self, int node)
fa.fa_dmat->_flags |= BUS_DMA_COHERENT;
}
- 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));