summaryrefslogtreecommitdiff
path: root/common/spl/spl_fat.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl_fat.c')
-rw-r--r--common/spl/spl_fat.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index c6e2526ade1..014074f85be 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <env.h>
#include <log.h>
+#include <mapmem.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <fat.h>
@@ -20,6 +21,11 @@
static int fat_registered;
+void spl_fat_force_reregister(void)
+{
+ fat_registered = 0;
+}
+
static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
{
int err = 0;
@@ -74,11 +80,13 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
if (IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL) &&
image_get_magic(header) == FDT_MAGIC) {
- err = file_fat_read(filename, (void *)CONFIG_SYS_LOAD_ADDR, 0);
+ err = file_fat_read(filename,
+ map_sysmem(CONFIG_SYS_LOAD_ADDR, 0), 0);
if (err <= 0)
goto end;
err = spl_parse_image_header(spl_image, bootdev,
- (struct legacy_img_hdr *)CONFIG_SYS_LOAD_ADDR);
+ map_sysmem(CONFIG_SYS_LOAD_ADDR,
+ err));
if (err == -EAGAIN)
return err;
if (err == 0)
@@ -99,8 +107,8 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
if (err)
goto end;
- err = file_fat_read(filename,
- (u8 *)(uintptr_t)spl_image->load_addr, 0);
+ err = file_fat_read(filename, map_sysmem(spl_image->load_addr,
+ spl_image->size), 0);
}
end: