diff options
| author | Simon Glass <[email protected]> | 2024-08-07 16:47:39 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-08-09 16:03:20 -0600 |
| commit | 3403422767650d3ff4f3129ee959e1b5de525161 (patch) | |
| tree | 0b411495115b29462dc65cfd92a8cc5a928499fd /test/boot | |
| parent | 91fde8e1764ee6302269b2a213d6e6495d539c38 (diff) | |
upl: Add an end-to-end test
Now that sandbox_vpl supports UPL, add a test that checks that the
payload can be loaded by SPL and the handoff information passed through
to U-Boot proper.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'test/boot')
| -rw-r--r-- | test/boot/upl.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/boot/upl.c b/test/boot/upl.c index 056ae54831b..364fb0526e4 100644 --- a/test/boot/upl.c +++ b/test/boot/upl.c @@ -398,6 +398,35 @@ static int upl_test_read_write(struct unit_test_state *uts) } UPL_TEST(upl_test_read_write, UT_TESTF_CONSOLE_REC); +/* Test UPL passthrough */ +static int upl_test_info_norun(struct unit_test_state *uts) +{ + const struct upl_image *img; + struct upl *upl = gd_upl(); + const void *fit; + + ut_assertok(run_command("upl info -v", 0)); + ut_assert_nextline("UPL state: active"); + ut_assert_nextline("fit %lx", upl->fit); + ut_assert_nextline("conf_offset %x", upl->conf_offset); + ut_assert_nextlinen("image 0"); + ut_assert_nextlinen("image 1"); + ut_assert_console_end(); + + /* check the offsets */ + fit = map_sysmem(upl->fit, 0); + ut_asserteq_str("conf-1", fdt_get_name(fit, upl->conf_offset, NULL)); + + ut_asserteq(2, upl->image.count); + + img = alist_get(&upl->image, 1, struct upl_image); + ut_asserteq_str("firmware-1", fdt_get_name(fit, img->offset, NULL)); + ut_asserteq(CONFIG_TEXT_BASE, img->load); + + return 0; +} +UPL_TEST(upl_test_info_norun, UT_TESTF_CONSOLE_REC | UT_TESTF_MANUAL); + int do_ut_upl(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct unit_test *tests = UNIT_TEST_SUITE_START(upl_test); |
