Skip to content

Commit

Permalink
match arm64 and armv7 and print unconfigured simplebus devices on octeon
Browse files Browse the repository at this point in the history
ok and tested by visa@
  • Loading branch information
jonathangray committed Jan 5, 2019
1 parent 4753977 commit 796a8f7
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions sys/arch/octeon/dev/simplebus.c
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 796a8f7

Please sign in to comment.