summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorRaymond Mao <raymond.mao@linaro.org>2025-02-19 16:02:19 -0800
committerTom Rini <trini@konsulko.com>2025-02-19 18:49:36 -0600
commit6799f09069f402a33c9cb202b71e144497bd9b7a (patch)
tree2b13bc02a4a75795ed42de3885b50bd4a2e60eb4 /common/board_f.c
parent42aebf0f987798599b5f2d2ca6098a775bb9f448 (diff)
bloblist: refactor xferlist and bloblist
Refactor the xferlist to remove the relocating when bloblist passed from the boot args. Refactor bloblist init to use incoming standard passage by default if a valid transfer list exists in the boot args. For bloblist relocation, use the actual total size if it has a smaller BLOBLIST_SIZE_RELOC. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 6c5c3bfab48..2912320054f 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -624,11 +624,14 @@ static int reserve_stacks(void)
static int reserve_bloblist(void)
{
#ifdef CONFIG_BLOBLIST
+ ulong size = bloblist_get_total_size();
+
+ if (size < CONFIG_BLOBLIST_SIZE_RELOC)
+ size = CONFIG_BLOBLIST_SIZE_RELOC;
+
/* Align to a 4KB boundary for easier reading of addresses */
- gd->start_addr_sp = ALIGN_DOWN(gd->start_addr_sp -
- CONFIG_BLOBLIST_SIZE_RELOC, 0x1000);
- gd->boardf->new_bloblist = map_sysmem(gd->start_addr_sp,
- CONFIG_BLOBLIST_SIZE_RELOC);
+ gd->start_addr_sp = ALIGN_DOWN(gd->start_addr_sp - size, 0x1000);
+ gd->boardf->new_bloblist = map_sysmem(gd->start_addr_sp, size);
#endif
return 0;
@@ -698,11 +701,14 @@ static int reloc_bloblist(void)
return 0;
}
if (gd->boardf->new_bloblist) {
- debug("Copying bloblist from %p to %p, size %x\n",
- gd->bloblist, gd->boardf->new_bloblist,
- gd->bloblist->total_size);
- return bloblist_reloc(gd->boardf->new_bloblist,
- CONFIG_BLOBLIST_SIZE_RELOC);
+ ulong size = bloblist_get_total_size();
+
+ if (size < CONFIG_BLOBLIST_SIZE_RELOC)
+ size = CONFIG_BLOBLIST_SIZE_RELOC;
+
+ debug("Copying bloblist from %p to %p, size %lx\n",
+ gd->bloblist, gd->boardf->new_bloblist, size);
+ return bloblist_reloc(gd->boardf->new_bloblist, size);
}
#endif