summaryrefslogtreecommitdiff
path: root/test/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-09-07 05:27:31 +0300
committerTom Rini <trini@konsulko.com>2022-09-30 05:43:43 +0300
commit0d63213c1ed5246423c22cbe3c6798a09763a2b9 (patch)
tree1252d84737560b561e3929a23322dfc5fcf3841e /test/boot
parent47a677c2eb030d5a4e905fb8993a4cb43bcde55d (diff)
downloadu-boot-0d63213c1ed5246423c22cbe3c6798a09763a2b9.tar.xz
vbe: Allow test to run with live/flat tree
This test can operate in all conditions now. Update the test and comments. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/boot')
-rw-r--r--test/boot/vbe_simple.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/test/boot/vbe_simple.c b/test/boot/vbe_simple.c
index 3f03fc3acd..8acd777f4c 100644
--- a/test/boot/vbe_simple.c
+++ b/test/boot/vbe_simple.c
@@ -74,26 +74,22 @@ static int vbe_simple_test_base(struct unit_test_state *uts)
node_ofs = fdt_add_subnode(fdt_buf, node_ofs, "firmware0");
ut_assert(node_ofs > 0);
- /*
- * This can only work on the live tree, since the ofnode interface for
- * flat tree assumes that ofnode points to the control FDT
- */
- ut_assertok(unflatten_device_tree(fdt_buf, &np));
+ if (of_live_active()) {
+ ut_assertok(unflatten_device_tree(fdt_buf, &np));
+ fixup.tree = oftree_from_np(np);
+ } else {
+ fixup.tree = oftree_from_fdt(fdt_buf);
+ }
/*
* It would be better to call image_setup_libfdt() here, but that
* function does not allow passing an ofnode. We can pass fdt_buf but
- * when it comes to send the evenr, it creates an ofnode that uses the
+ * when it comes to send the event, it creates an ofnode that uses the
* control FDT, since it has no way of accessing the live tree created
* here.
*
- * Two fix this we need:
- * - image_setup_libfdt() is updated to use ofnode
- * - ofnode updated to support access to an FDT other than the control
- * FDT. This is partially implemented with live tree, but not with
- * flat tree
+ * Two fix this we need image_setup_libfdt() is updated to use ofnode
*/
- fixup.tree.np = np;
ut_assertok(event_notify(EVT_FT_FIXUP, &fixup, sizeof(fixup)));
node = oftree_path(fixup.tree, "/chosen/fwupd/firmware0");
@@ -111,5 +107,4 @@ static int vbe_simple_test_base(struct unit_test_state *uts)
return 0;
}
-BOOTSTD_TEST(vbe_simple_test_base, UT_TESTF_DM | UT_TESTF_SCAN_FDT |
- UT_TESTF_LIVE_TREE);
+BOOTSTD_TEST(vbe_simple_test_base, UT_TESTF_DM | UT_TESTF_SCAN_FDT);