bloblist: Use explicit numbering for the tags

At present if someone adds a tag in the middle of the list it works well
enough within a U-Boot build. But if these tags are used in another
project, or with an older version of SPL, the numbers make become
inconsistent.

Use explicit tag numbers that never change, to resolve this problem.
Allocate areas for existing U-Boot tags and set up an area for use by
projects and vendors, as well as for private use. Keep tags above
0x10000 unallocated for now.

Update bloblist_tag_name() and the tests to work with this new setup.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2022-01-12 19:26:19 -07:00
parent f9abc1cac1
commit f16ec77784
3 changed files with 82 additions and 31 deletions

View File

@@ -19,9 +19,9 @@ DECLARE_GLOBAL_DATA_PTR;
UNIT_TEST(_name, _flags, bloblist_test)
enum {
TEST_TAG = 1,
TEST_TAG2 = 2,
TEST_TAG_MISSING = 3,
TEST_TAG = BLOBLISTT_U_BOOT_SPL_HANDOFF,
TEST_TAG2 = BLOBLISTT_VBOOT_CTX,
TEST_TAG_MISSING = 0x10000,
TEST_SIZE = 10,
TEST_SIZE2 = 20,
@@ -288,10 +288,10 @@ static int bloblist_test_cmd_list(struct unit_test_state *uts)
ut_silence_console(uts);
console_record_reset();
run_command("bloblist list", 0);
ut_assert_nextline("Address Size Tag Name");
ut_assert_nextline("%08lx %8x 1 SPL hand-off",
ut_assert_nextline("Address Size Tag Name");
ut_assert_nextline("%08lx %8x 8000 SPL hand-off",
(ulong)map_to_sysmem(data), TEST_SIZE);
ut_assert_nextline("%08lx %8x 2 Chrome OS vboot context",
ut_assert_nextline("%08lx %8x 106 Chrome OS vboot context",
(ulong)map_to_sysmem(data2), TEST_SIZE2);
ut_assert_console_end();
ut_unsilence_console(uts);