aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2019-09-23 10:18:42 +0800
committerStefano Babic <sbabic@denx.de>2019-10-08 16:36:36 +0200
commit07d900af76228e0f88116919272b935d456d112b (patch)
treea824e76fed632b3730496180be8b0216abd8e313
parentec649330942b7898f0e95c832f16ee189df91609 (diff)
downloadu-boot-07d900af76228e0f88116919272b935d456d112b.zip
u-boot-07d900af76228e0f88116919272b935d456d112b.tar.gz
u-boot-07d900af76228e0f88116919272b935d456d112b.tar.bz2
spl: nor: introduce spl_nor_get_uboot_base
Introduce weak spl_nor_get_uboot_base, then platform have their own implementation. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: Marek Vasut <marex@denx.de> Cc: Andreas Dannenberg <dannenberg@ti.com> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Michal Simek <michal.simek@xilinx.com>
-rw-r--r--common/spl/spl_nor.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
index 969e319..0f8afa6 100644
--- a/common/spl/spl_nor.c
+++ b/common/spl/spl_nor.c
@@ -18,6 +18,11 @@ static ulong spl_nor_load_read(struct spl_load_info *load, ulong sector,
}
#endif
+unsigned long __weak spl_nor_get_uboot_base(void)
+{
+ return CONFIG_SYS_UBOOT_BASE;
+}
+
static int spl_nor_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
@@ -80,25 +85,25 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,
* defined location in SDRAM
*/
#ifdef CONFIG_SPL_LOAD_FIT
- header = (const struct image_header *)CONFIG_SYS_UBOOT_BASE;
+ header = (const struct image_header *)spl_nor_get_uboot_base();
if (image_get_magic(header) == FDT_MAGIC) {
debug("Found FIT format U-Boot\n");
load.bl_len = 1;
load.read = spl_nor_load_read;
ret = spl_load_simple_fit(spl_image, &load,
- CONFIG_SYS_UBOOT_BASE,
+ spl_nor_get_uboot_base(),
(void *)header);
return ret;
}
#endif
ret = spl_parse_image_header(spl_image,
- (const struct image_header *)CONFIG_SYS_UBOOT_BASE);
+ (const struct image_header *)spl_nor_get_uboot_base());
if (ret)
return ret;
memcpy((void *)(unsigned long)spl_image->load_addr,
- (void *)(CONFIG_SYS_UBOOT_BASE + sizeof(struct image_header)),
+ (void *)(spl_nor_get_uboot_base() + sizeof(struct image_header)),
spl_image->size);
return 0;