[PATCH] efi: probe devices from the device-tree

Michael Olbrich m.olbrich at pengutronix.de
Mon Feb 7 02:59:35 PST 2022

The state device-tree may contain devices. For example block devices with a
'barebox,storage-by-uuid' compatible. Probing is necessary to ensure that
those devices are available.

Call barebox_register_of() instead of of_set_root_node(). It probes the
devices after setting the root node.

Signed-off-by: Michael Olbrich <m.olbrich at pengutronix.de>

I've tested the series and with this aditional patch it works on EFI, so

Tested-by: Michael Olbrich <m.olbrich at pengutronix.de>


 common/efi/payload/init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/efi/payload/init.c b/common/efi/payload/init.c
index 6db6b2389540..1541683186fb 100644
--- a/common/efi/payload/init.c
+++ b/common/efi/payload/init.c
@@ -349,7 +349,9 @@ static int efi_late_init(void)
 		if (IS_ERR(root))
 			return PTR_ERR(root);
-		of_set_root_node(root);
+		ret = barebox_register_of(root);
+		if (ret)
+			pr_warn("Failed to register device-tree: %pe\n", ERR_PTR(ret));
 		np = of_find_node_by_alias(root, "state");

More information about the barebox mailing list