aboutsummaryrefslogtreecommitdiff
path: root/common/spl/spl_nand.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl_nand.c')
-rw-r--r--common/spl/spl_nand.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index e2bcefb111e..5f8a111a2f0 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -11,6 +11,11 @@
#include <linux/libfdt_env.h>
#include <fdt.h>
+uint32_t __weak spl_nand_get_uboot_raw_page(void)
+{
+ return CONFIG_SYS_NAND_U_BOOT_OFFS;
+}
+
#if defined(CONFIG_SPL_NAND_RAW_ONLY)
static int spl_nand_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
@@ -21,7 +26,7 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE,
CONFIG_SYS_NAND_U_BOOT_DST);
- nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+ nand_spl_load_image(spl_nand_get_uboot_raw_page(),
CONFIG_SYS_NAND_U_BOOT_SIZE,
(void *)CONFIG_SYS_NAND_U_BOOT_DST);
spl_set_header_raw_uboot(spl_image);
@@ -63,6 +68,15 @@ static int spl_nand_load_element(struct spl_image_info *spl_image,
load.bl_len = 1;
load.read = spl_nand_fit_read;
return spl_load_simple_fit(spl_image, &load, offset, header);
+ } else if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) {
+ struct spl_load_info load;
+
+ load.dev = NULL;
+ load.priv = NULL;
+ load.filename = NULL;
+ load.bl_len = 1;
+ load.read = spl_nand_fit_read;
+ return spl_load_imx_container(spl_image, &load, offset);
} else {
err = spl_parse_image_header(spl_image, header);
if (err)
@@ -139,7 +153,7 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
#endif
#endif
/* Load u-boot */
- err = spl_nand_load_element(spl_image, CONFIG_SYS_NAND_U_BOOT_OFFS,
+ err = spl_nand_load_element(spl_image, spl_nand_get_uboot_raw_page(),
header);
#ifdef CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND
#if CONFIG_SYS_NAND_U_BOOT_OFFS != CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND