summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2019-01-03 23:04:51 +0000
committerdlg <dlg@openbsd.org>2019-01-03 23:04:51 +0000
commite3246555cbf9adcdec31893a9dd902402d5ca4c3 (patch)
treea6de5d508555b4395c0d449a89c7523c29da29c9
parentUnbreak build under OPT_DEBUG (diff)
downloadwireguard-openbsd-e3246555cbf9adcdec31893a9dd902402d5ca4c3.tar.xz
wireguard-openbsd-e3246555cbf9adcdec31893a9dd902402d5ca4c3.zip
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@
-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));