-/* $OpenBSD: mainbus.c,v 1.22 2021/10/24 17:52:28 mpi Exp $ */
+/* $OpenBSD: mainbus.c,v 1.23 2023/01/16 20:07:48 patrick Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
void mainbus_attach_efi(struct device *);
void mainbus_attach_apm(struct device *);
void mainbus_attach_framebuffer(struct device *);
+void mainbus_attach_firmware(struct device *);
struct mainbus_softc {
struct device sc_dev;
mainbus_attach_cpus(self, mainbus_match_secondary);
mainbus_attach_efi(self);
+ mainbus_attach_firmware(self);
sc->sc_rangeslen = OF_getproplen(OF_peer(0), "ranges");
if (sc->sc_rangeslen > 0 && !(sc->sc_rangeslen % sizeof(uint32_t))) {
for (node = OF_child(node); node != 0; node = OF_peer(node))
mainbus_attach_node(self, node, NULL);
}
+
+void
+mainbus_attach_firmware(struct device *self)
+{
+ int node = OF_finddevice("/firmware");
+
+ if (node == -1)
+ return;
+
+ for (node = OF_child(node); node != 0; node = OF_peer(node))
+ mainbus_attach_node(self, node, NULL);
+}