Merge patch series "upl: Prerequite patches for updated spec"

Simon Glass <sjg@chromium.org> says:

The current UPL spec[1] has been tidied up and improved over the last
year, since U-Boot's original UPL support was written.

This series includes some prerequisite patches needed for the real UPL
patches. It is split from [2]

[1] https://github.com/UniversalPayload/spec/tree/3f1450d
[2] https://patchwork.ozlabs.org/project/uboot/list/?series=438574&state=*

Link: https://lore.kernel.org/r/20250111000029.245022-1-sjg@chromium.org
This commit is contained in:
Tom Rini
2025-01-22 16:08:34 -06:00
45 changed files with 369 additions and 110 deletions

View File

@@ -1,9 +1,13 @@
# SPDX-License-Identifier: GPL-2.0+
obj-y += cmd_ut_common.o
obj-$(CONFIG_AUTOBOOT) += test_autoboot.o
ifneq ($(CONFIG_$(XPL_)BLOBLIST),)
ifdef CONFIG_BLOBLIST_FIXED
obj-$(CONFIG_$(XPL_)CMDLINE) += bloblist.o
endif
endif
obj-$(CONFIG_CYCLIC) += cyclic.o
obj-$(CONFIG_EVENT_DYNAMIC) += event.o
obj-y += cread.o

View File

@@ -186,10 +186,30 @@ static int dm_test_compare_node_name(struct unit_test_state *uts)
ut_assert(ofnode_valid(node));
ut_assert(ofnode_name_eq(node, "mmio-bus"));
ut_assert(!ofnode_name_eq(node, "mmio-bus@0"));
return 0;
}
DM_TEST(dm_test_compare_node_name, UTF_SCAN_PDATA);
/* compare node names ignoring the unit address */
static int dm_test_compare_node_name_unit(struct unit_test_state *uts)
{
ofnode node;
node = ofnode_path("/mmio-bus@0");
ut_assert(ofnode_valid(node));
ut_assert(ofnode_name_eq_unit(node, "mmio-bus"));
ut_assert(ofnode_name_eq_unit(node, "mmio-bus@0"));
ut_assert(!ofnode_name_eq_unit(node, "mmio-bus@1"));
ut_assert(!ofnode_name_eq_unit(node, "mmio-bu"));
ut_assert(!ofnode_name_eq_unit(node, "mmio-buss@0"));
return 0;
}
DM_TEST(dm_test_compare_node_name_unit, UTF_SCAN_PDATA);
/* Test that binding with uclass plat setting occurs correctly */
static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts)
{

View File

@@ -1303,6 +1303,25 @@ static int dm_test_ofnode_find_subnode(struct unit_test_state *uts)
}
DM_TEST(dm_test_ofnode_find_subnode, UTF_SCAN_FDT);
/* check ofnode_find_subnode() with unit addresses */
static int dm_test_ofnode_find_subnode_unit(struct unit_test_state *uts)
{
ofnode node, subnode;
node = ofnode_path("/some-bus");
ut_assert(ofnode_valid(node));
subnode = ofnode_find_subnode_unit(node, "c-test@5");
ut_assert(ofnode_valid(subnode));
ut_asserteq_str("c-test@5", ofnode_get_name(subnode));
subnode = ofnode_find_subnode_unit(node, "c-test");
ut_assert(ofnode_valid(subnode));
ut_asserteq_str("c-test@5", ofnode_get_name(subnode));
return 0;
}
DM_TEST(dm_test_ofnode_find_subnode_unit, UTF_SCAN_FDT);
/* test ofnode_find_subnode() on the 'other' tree */
static int dm_test_ofnode_find_subnode_ot(struct unit_test_state *uts)
{

View File

@@ -46,7 +46,29 @@ static int lib_test_abuf_set(struct unit_test_state *uts)
}
LIB_TEST(lib_test_abuf_set, 0);
/* Test abuf_map_sysmem() */
/* Test abuf_init_const() */
static int lib_test_abuf_init_const(struct unit_test_state *uts)
{
struct abuf buf;
ulong start;
void *ptr;
start = ut_check_free();
ptr = map_sysmem(0x100, 0);
abuf_init_const(&buf, ptr, 10);
ut_asserteq_ptr(ptr, buf.data);
ut_asserteq(10, buf.size);
/* No memory should have been allocated */
ut_assertok(ut_check_delta(start));
return 0;
}
LIB_TEST(lib_test_abuf_init_const, 0);
/* Test abuf_map_sysmem() and abuf_addr() */
static int lib_test_abuf_map_sysmem(struct unit_test_state *uts)
{
struct abuf buf;
@@ -60,6 +82,8 @@ static int lib_test_abuf_map_sysmem(struct unit_test_state *uts)
ut_asserteq(TEST_DATA_LEN, buf.size);
ut_asserteq(false, buf.alloced);
ut_asserteq(addr, abuf_addr(&buf));
return 0;
}
LIB_TEST(lib_test_abuf_map_sysmem, 0);

View File

@@ -17,7 +17,7 @@ def test_upl_handoff(u_boot_console):
proper and runs a test to check that the parameters are correct.
The entire FIT is loaded into memory in SPL (in upl_load_from_image()) so
that it can be inpected in upl_test_info_norun
that it can be inspected in upl_test_info_norun
"""
cons = u_boot_console
ram = os.path.join(cons.config.build_dir, 'ram.bin')