diff options
author | Sean Anderson <seanga2@gmail.com> | 2023-11-04 16:37:46 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-16 12:43:48 -0500 |
commit | bd9573c11cbae91ddfea2628bacf504dfa18d11a (patch) | |
tree | 1d248b4b84a81f1401fb4bc49f55c4714aa87623 /common/spl | |
parent | d2e0a9a6918503ff6fd649189427413935535040 (diff) | |
download | u-boot-bd9573c11cbae91ddfea2628bacf504dfa18d11a.zip u-boot-bd9573c11cbae91ddfea2628bacf504dfa18d11a.tar.gz u-boot-bd9573c11cbae91ddfea2628bacf504dfa18d11a.tar.bz2 |
spl: nand: Map memory before accessing it
In sandbox we must map memory before accessing it. Do so for the NAND load
method.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'common/spl')
-rw-r--r-- | common/spl/spl_nand.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 57a7a1a..b8cd640 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -11,6 +11,7 @@ #include <log.h> #include <spl.h> #include <asm/io.h> +#include <mapmem.h> #include <nand.h> #include <linux/libfdt_env.h> #include <fdt.h> @@ -32,7 +33,8 @@ static int spl_nand_load_image(struct spl_image_info *spl_image, nand_spl_load_image(spl_nand_get_uboot_raw_page(), CFG_SYS_NAND_U_BOOT_SIZE, - (void *)CFG_SYS_NAND_U_BOOT_DST); + map_sysmem(CFG_SYS_NAND_U_BOOT_DST, + CFG_SYS_NAND_U_BOOT_SIZE)); spl_set_header_raw_uboot(spl_image); nand_deselect(); @@ -122,7 +124,8 @@ static int spl_nand_load_element(struct spl_image_info *spl_image, if (err) return err; return nand_spl_load_image(offset, spl_image->size, - (void *)(ulong)spl_image->load_addr); + map_sysmem(spl_image->load_addr, + spl_image->size)); } } |