diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-01-05 03:42:20 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-01-05 03:42:20 +0000 |
commit | 73dcca385cbf64a3d815fafb4b254539d78b20cc (patch) | |
tree | a1e505c43755fdd773307256f028a5668465a128 /sys/arch/arm | |
parent | 74dd2d1a4474e6ccb13c30d5b0e512eb4d84b15b (diff) |
match arm64 and print unconfigured simplebus devices on armv7
ok dlg@ kettenis@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/simplebus/simplebus.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/arch/arm/simplebus/simplebus.c b/sys/arch/arm/simplebus/simplebus.c index 9385954cc87..1742a336bcf 100644 --- a/sys/arch/arm/simplebus/simplebus.c +++ b/sys/arch/arm/simplebus/simplebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebus.c,v 1.13 2017/04/27 22:41:46 kettenis Exp $ */ +/* $OpenBSD: simplebus.c,v 1.14 2019/01/05 03:42:19 jsg Exp $ */ /* * Copyright (c) 2016 Patrick Wildt <patrick@blueri.se> * @@ -115,6 +115,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. */ @@ -180,7 +200,8 @@ simplebus_attach_node(struct device *self, int node) 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)); |