From: patrick Date: Mon, 16 Jan 2023 20:07:48 +0000 (+0000) Subject: Attach drivers on nodes under /firmware. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b7307cad049096910490d43bf65aa04ab60ccdee;p=openbsd Attach drivers on nodes under /firmware. ok kettenis@ --- diff --git a/sys/arch/arm64/dev/mainbus.c b/sys/arch/arm64/dev/mainbus.c index ccadc1ba840..72417c2e78f 100644 --- a/sys/arch/arm64/dev/mainbus.c +++ b/sys/arch/arm64/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $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 * Copyright (c) 2017 Mark Kettenis @@ -43,6 +43,7 @@ void mainbus_attach_psci(struct device *); 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; @@ -138,6 +139,7 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) 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))) { @@ -418,3 +420,15 @@ mainbus_attach_framebuffer(struct device *self) 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); +}