aboutsummaryrefslogtreecommitdiff
path: root/common/bloblist.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-12-05 22:42:07 -0500
committerTom Rini <trini@konsulko.com>2021-12-05 22:42:07 -0500
commit6c56bd31b7c11c1f4e97bf6bd1db9f48e35ec10b (patch)
treed1d2b1c7bc2e31a33e65b769e464cb23e8aac22e /common/bloblist.c
parentf89615088fba1b1f33713ad26dbe3a3c82b692ec (diff)
parentc229cd2b6e443a1365ff5089c4c4a6440f218dce (diff)
Merge tag 'dm-pull-5dec21a' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
binman refactoring to improve section handling bloblist - allow it to be allocated sandbox config-header cleanup # gpg: Signature made Sun 05 Dec 2021 10:14:24 PM EST # gpg: using RSA key B25C0022AF86A7CC1655B6277F173A3E9008ADE6 # gpg: issuer "sjg@chromium.org" # gpg: Good signature from "Simon Glass <sjg@chromium.org>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B25C 0022 AF86 A7CC 1655 B627 7F17 3A3E 9008 ADE6
Diffstat (limited to 'common/bloblist.c')
-rw-r--r--common/bloblist.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/common/bloblist.c b/common/bloblist.c
index 1290fff850..01b04103d9 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <bloblist.h>
#include <log.h>
+#include <malloc.h>
#include <mapmem.h>
#include <spl.h>
#include <asm/global_data.h>
@@ -416,10 +417,21 @@ int bloblist_init(void)
ret = bloblist_check(CONFIG_BLOBLIST_ADDR,
CONFIG_BLOBLIST_SIZE);
if (ret) {
+ ulong addr;
+
log(LOGC_BLOBLIST, expected ? LOGL_WARNING : LOGL_DEBUG,
"Existing bloblist not found: creating new bloblist\n");
- ret = bloblist_new(CONFIG_BLOBLIST_ADDR, CONFIG_BLOBLIST_SIZE,
- 0);
+ if (IS_ENABLED(CONFIG_BLOBLIST_ALLOC)) {
+ void *ptr = memalign(BLOBLIST_ALIGN,
+ CONFIG_BLOBLIST_SIZE);
+
+ if (!ptr)
+ return log_msg_ret("alloc", -ENOMEM);
+ addr = map_to_sysmem(ptr);
+ } else {
+ addr = CONFIG_BLOBLIST_ADDR;
+ }
+ ret = bloblist_new(addr, CONFIG_BLOBLIST_SIZE, 0);
} else {
log(LOGC_BLOBLIST, LOGL_DEBUG, "Found existing bloblist\n");
}