From: peng.fan at nxp.com Date: Mon, 23 Sep 2019 10:18:43 +0800 Subject: [U-Boot] [PATCH V2 4/9] spl: nand: Introduce spl_nand_get_uboot_raw_page In-Reply-To: <20190923021848.12500-1-peng.fan@nxp.com> References: <20190923021848.12500-1-peng.fan@nxp.com> Message-ID: <20190923021848.12500-4-peng.fan@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Peng Fan Introduce weak spl_nand_get_uboot_raw_page, then platform could have their own implementation. Signed-off-by: Peng Fan Cc: Simon Goldschmidt Cc: Tien Fong Chee Cc: Marek Vasut Cc: Andreas Dannenberg Cc: Alex Kiernan Cc: Stefan Roese Cc: Patrick Delaunay Cc: Miquel Raynal Cc: Michal Simek --- V2: None common/spl/spl_nand.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index e2bcefb111..d3185dc017 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -11,6 +11,11 @@ #include #include +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 -- 2.16.4