summaryrefslogtreecommitdiff
path: root/common/spl/spl_imx_container.c
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2023-10-14 16:47:55 -0400
committerTom Rini <trini@konsulko.com>2023-10-17 20:50:52 -0400
commitb02c4e941c7fed520f05cc956b9263bc934a9828 (patch)
tree8e37dab03b30112d99d4fe17f76ae6a313688154 /common/spl/spl_imx_container.c
parent93caa3efe25bb9d3e6265aa467dc5b6a2201819b (diff)
spl: Use map_sysmem where appropriate
All "physical" addresses in SPL must be converted to virtual addresses before access in order for sandbox to work. Add some calls to map_sysmem in appropriate places. We do not generally call unmap_sysmem, since we need the image memory to still be mapped when we jump to the image. This doesn't matter at the moment since unmap_sysmem is a no-op. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/spl/spl_imx_container.c')
-rw-r--r--common/spl/spl_imx_container.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/spl/spl_imx_container.c b/common/spl/spl_imx_container.c
index c29cb15f55e..127802f5cb7 100644
--- a/common/spl/spl_imx_container.c
+++ b/common/spl/spl_imx_container.c
@@ -9,6 +9,7 @@
#include <errno.h>
#include <imx_container.h>
#include <log.h>
+#include <mapmem.h>
#include <spl.h>
#ifdef CONFIG_AHAB_BOOT
#include <asm/mach-imx/ahab.h>
@@ -46,7 +47,8 @@ static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image,
debug("%s: container: %p sector: %lu sectors: %u\n", __func__,
container, sector, sectors);
if (info->read(info, sector, sectors,
- (void *)images[image_index].dst) != sectors) {
+ map_sysmem(images[image_index].dst,
+ images[image_index].size)) != sectors) {
printf("%s wrong\n", __func__);
return NULL;
}