diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-01-05 11:59:40 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-01-05 11:59:40 +0000 |
commit | 142fbdecc6517c9ab3d632c4bd7b82c8bf90e3c0 (patch) | |
tree | e0b4a02072a60b3c593f32a87656e45b1203d700 /sys/arch | |
parent | fed6e12ef4f08c901cd78da5b0d9b936b9af7f94 (diff) |
match arm64 and armv7 and print unconfigured simplebus devices on octeon
ok and tested by visa@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/octeon/dev/simplebus.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/arch/octeon/dev/simplebus.c b/sys/arch/octeon/dev/simplebus.c index 9acbe649633..489a7f3dda8 100644 --- a/sys/arch/octeon/dev/simplebus.c +++ b/sys/arch/octeon/dev/simplebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebus.c,v 1.1 2016/12/08 16:24:51 visa Exp $ */ +/* $OpenBSD: simplebus.c,v 1.2 2019/01/05 11:59:39 jsg Exp $ */ /* * Copyright (c) 2016 Patrick Wildt <patrick@blueri.se> @@ -121,6 +121,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. */ @@ -186,7 +206,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)); |