From 893ecc6d2d61381bc56991178cb3de697a948b78 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Fri, 16 Feb 2024 17:05:56 -0800 Subject: of: Add KUnit test to confirm DTB is loaded Add a KUnit test that confirms a DTB has been loaded, i.e. there is a root node, and that the of_have_populated_dt() API works properly. We skip the test when CONFIG_OF_EARLY_FLATREE=n because in that case we know architecture code hasn't called unflatten_(and_copy_)?device_tree() which would populate some sort of root node. Cc: Rob Herring Cc: Frank Rowand Reviewed-by: David Gow Cc: Brendan Higgins Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20240217010557.2381548-8-sboyd@kernel.org Signed-off-by: Rob Herring --- drivers/of/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/of/Kconfig') diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index d738fbad9c36..dd726c7056bf 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -36,6 +36,15 @@ config OF_UNITTEST If unsure, say N here. This option is not safe to enable. +config OF_KUNIT_TEST + tristate "Devicetree KUnit Test" if !KUNIT_ALL_TESTS + depends on KUNIT + default KUNIT_ALL_TESTS + help + This option builds KUnit unit tests for device tree infrastructure. + + If unsure, say N here, but this option is safe to enable. + config OF_ALL_DTBS bool "Build all Device Tree Blobs" depends on COMPILE_TEST -- cgit v1.2.3