mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] commands: devinfo: print Deep Probe status for top-level machine device
@ 2025-10-15  9:27 Ahmad Fatoum
  2025-10-15  9:27 ` [PATCH 2/2] devinfo: print / as device tree node for the root node Ahmad Fatoum
  2025-10-20 10:47 ` [PATCH 1/2] commands: devinfo: print Deep Probe status for top-level machine device Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2025-10-15  9:27 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

There is a log message when deep probe is disabled, but to make it
easier to verify that it's enabled, let's introduce it as extra info
in the devinfo command.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 commands/devinfo.c |  4 ++++
 drivers/of/base.c  | 12 +++++++++---
 include/of.h       |  2 ++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/commands/devinfo.c b/commands/devinfo.c
index cff4dbb92e31..e132f88bf3f3 100644
--- a/commands/devinfo.c
+++ b/commands/devinfo.c
@@ -117,6 +117,10 @@ static int do_devinfo(int argc, char *argv[])
 				printf("\n");
 				of_print_nodes(dev->of_node, 0, ~0);
 			}
+
+			if (dev == of_platform_root_device)
+				printf("Deep probe: %s\n",
+				       deep_probe_is_supported() ? "true" : "false");
 		}
 #endif
 	}
diff --git a/drivers/of/base.c b/drivers/of/base.c
index c20fffb899a9..15265dc22623 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2909,12 +2909,14 @@ static int of_probe_memory(void)
 }
 mem_initcall(of_probe_memory);
 
+struct device *of_platform_root_device;
+
 static void of_platform_device_create_root(struct device_node *np)
 {
-	static struct device *dev;
+	struct device *dev;
 	int ret;
 
-	if (dev)
+	if (of_platform_root_device)
 		return;
 
 	dev = xzalloc(sizeof(*dev));
@@ -2923,8 +2925,12 @@ static void of_platform_device_create_root(struct device_node *np)
 	dev_set_name(dev, "machine");
 
 	ret = platform_device_register(dev);
-	if (ret)
+	if (WARN_ON(ret)) {
 		free_device(dev);
+		return;
+	}
+
+	of_platform_root_device = dev;
 }
 
 static const struct of_device_id reserved_mem_matches[] = {
diff --git a/include/of.h b/include/of.h
index 640d76f4aade..d1efab13c780 100644
--- a/include/of.h
+++ b/include/of.h
@@ -428,6 +428,8 @@ extern int of_set_root_node(struct device_node *node);
 extern int barebox_register_of(struct device_node *root);
 extern int barebox_register_fdt(const void *dtb);
 
+extern struct device *of_platform_root_device;
+
 extern struct device *of_platform_device_create(struct device_node *np,
 						struct device *parent);
 extern void of_platform_device_dummy_drv(struct device *dev);
-- 
2.47.3




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-20 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-15  9:27 [PATCH 1/2] commands: devinfo: print Deep Probe status for top-level machine device Ahmad Fatoum
2025-10-15  9:27 ` [PATCH 2/2] devinfo: print / as device tree node for the root node Ahmad Fatoum
2025-10-20 10:47 ` [PATCH 1/2] commands: devinfo: print Deep Probe status for top-level machine device Sascha Hauer
2025-10-20 12:46   ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox