aboutsummaryrefslogtreecommitdiff
path: root/common/spl/spl.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-07 17:35:14 -0700
committerTom Rini <trini@konsulko.com>2021-03-12 09:57:31 -0500
commit891d9e84a72be6c9a7e11a1f559ab96d786d1c2d (patch)
tree079c36b6f0998e3b494322f6840fa1f6c374f2f2 /common/spl/spl.c
parent01ad9f75c5ccbf2dbb30f8c630fad7e648026449 (diff)
spl: Convert spl_fit to work with sandbox
At present this casts addresses to pointers so cannot work with sandbox. Update the code to use map_sysmem() instead. As part of this change, the existing load_ptr is renamed to src_ptr since it is not a pointer to load_addr. It is confusing to use a similar name for something that is not actually related. For the alignment code, ALIGN() is used instead of open-coded alignment. Add a comment to the line that casts away a const. Use a (new) load_ptr variable to access memory at address load_addr. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/spl/spl.c')
-rw-r--r--common/spl/spl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index bb91b761fc..5f51098a88 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -16,6 +16,7 @@
#include <init.h>
#include <irq_func.h>
#include <log.h>
+#include <mapmem.h>
#include <serial.h>
#include <spl.h>
#include <asm/global_data.h>
@@ -168,7 +169,7 @@ __weak void spl_board_prepare_for_boot(void)
__weak struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
{
- return (struct image_header *)(CONFIG_SYS_TEXT_BASE + offset);
+ return map_sysmem(CONFIG_SYS_TEXT_BASE + offset, 0);
}
void spl_set_header_raw_uboot(struct spl_image_info *spl_image)