-/* $OpenBSD: simplebus.c,v 1.16 2020/04/29 15:25:07 kettenis Exp $ */
+/* $OpenBSD: simplebus.c,v 1.17 2021/02/18 00:04:13 jsg Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
*
#include <dev/ofw/openfirm.h>
#include <dev/ofw/fdt.h>
+#include <dev/ofw/ofw_clock.h>
+#include <dev/ofw/ofw_power.h>
#include <arm/fdt.h>
#include <arm/simplebus/simplebusvar.h>
if (fa->fa_node == 0)
return (0);
- if (!OF_is_compatible(fa->fa_node, "simple-bus"))
- return (0);
-
- return (1);
+ return (OF_is_compatible(fa->fa_node, "simple-bus") ||
+ OF_is_compatible(fa->fa_node, "simple-pm-bus"));
}
void
sc->sc_dmaranges, sc->sc_dmarangeslen);
}
+ if (OF_is_compatible(sc->sc_node, "simple-pm-bus")) {
+ power_domain_enable(sc->sc_node);
+ clock_enable_all(sc->sc_node);
+ }
+
/* Scan the whole tree. */
sc->sc_early = 1;
for (node = OF_child(sc->sc_node); node; node = OF_peer(node))