summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <[email protected]>2019-09-23 10:18:43 +0800
committerStefano Babic <[email protected]>2019-10-08 16:36:36 +0200
commit2c79229c02ad9f0eae4faee028a76394d00a699d (patch)
treec95178477469bf89853d6203ccc8ad4dfff72157
parent07d900af76228e0f88116919272b935d456d112b (diff)
spl: nand: Introduce spl_nand_get_uboot_raw_page
Introduce weak spl_nand_get_uboot_raw_page, then platform could have their own implementation. Signed-off-by: Peng Fan <[email protected]> Cc: Simon Goldschmidt <[email protected]> Cc: Tien Fong Chee <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Andreas Dannenberg <[email protected]> Cc: Alex Kiernan <[email protected]> Cc: Stefan Roese <[email protected]> Cc: Patrick Delaunay <[email protected]> Cc: Miquel Raynal <[email protected]> Cc: Michal Simek <[email protected]>
-rw-r--r--common/spl/spl_nand.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index e2bcefb111e..d3185dc0170 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);
@@ -139,7 +144,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