summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-12-05 08:10:51 -0600
committerTom Rini <[email protected]>2024-12-05 08:10:51 -0600
commitac3428fcc7b93787c07fa69ff915ba17c643c8f9 (patch)
treea794e67bd9124e280768fe61551f0b1229ec10ac /test
parentf96e5133184aac377b54bd61f8abf78710f2ee56 (diff)
parent1d9aa4a283daa1e609130b5457c9857d62f1d1cb (diff)
Merge tag 'efi-master-05122024' of https://source.denx.de/u-boot/custodians/u-boot-tpm
CI: https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/23719 Two fixes for the EFI subsystem coming via the TPM tree as agreed by Heinrich The LMB patch fixes a failure in SystemReady testing. Nothing bad happens without the patch in the device operation, but the return values are wrong and SCT tests fail for MemoryAllocationServicesTest category. The second is a shielding the device against mistakes in the definition of struct fields needed by the capsule update mechanism. Instead of crashing, print a humna readable message of what's wrong.
Diffstat (limited to 'test')
-rw-r--r--test/lib/lmb.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/lib/lmb.c b/test/lib/lmb.c
index c917115b7b6..0bd29e2a4fe 100644
--- a/test/lib/lmb.c
+++ b/test/lib/lmb.c
@@ -529,6 +529,26 @@ static int test_alloc_addr(struct unit_test_state *uts, const phys_addr_t ram)
ret = lmb_add(ram, ram_size);
ut_asserteq(ret, 0);
+ /* Try to allocate a page twice */
+ b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NONE);
+ ut_asserteq(b, alloc_addr_a);
+ b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NOOVERWRITE);
+ ut_asserteq(b, 0);
+ b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NONE);
+ ut_asserteq(b, alloc_addr_a);
+ b = lmb_alloc_addr_flags(alloc_addr_a, 0x2000, LMB_NONE);
+ ut_asserteq(b, alloc_addr_a);
+ ret = lmb_free(alloc_addr_a, 0x2000);
+ ut_asserteq(ret, 0);
+ b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NOOVERWRITE);
+ ut_asserteq(b, alloc_addr_a);
+ b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NONE);
+ ut_asserteq(b, 0);
+ b = lmb_alloc_addr_flags(alloc_addr_a, 0x1000, LMB_NOOVERWRITE);
+ ut_asserteq(b, 0);
+ ret = lmb_free(alloc_addr_a, 0x1000);
+ ut_asserteq(ret, 0);
+
/* reserve 3 blocks */
ret = lmb_reserve(alloc_addr_a, 0x10000);
ut_asserteq(ret, 0);
@@ -734,7 +754,7 @@ static int lib_test_lmb_flags(struct unit_test_state *uts)
/* reserve again, same flag */
ret = lmb_reserve_flags(0x40010000, 0x10000, LMB_NOMAP);
- ut_asserteq(ret, 0);
+ ut_asserteq(ret, -1L);
ASSERT_LMB(mem_lst, used_lst, ram, ram_size, 1, 0x40010000, 0x10000,
0, 0, 0, 0);