From d9043bb84ad3c55f405208760b367486949de1e1 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Thu, 3 Jan 2019 23:04:52 +0000 Subject: 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@ --- sys/arch/arm64/dev/simplebus.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'sys/arch/arm64/dev') 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 * @@ -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)); -- cgit v1.2.3