[U-Boot] [PATCH 3/3] spl: fit: Place OS_BOOT DTB at CONFIG_SYS_SPL_ARGS_ADDR if defined

Marek Vasut marex at denx.de
Tue May 28 01:49:15 UTC 2019


If SPL OS_BOOT is enabled and CONFIG_SYS_SPL_ARGS_ADDR is defined,
place the kernel DTB at that location, so the rest of the OS_BOOT
machinery in SPL has the DTB blob at the correct location.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Tom Rini <trini at konsulko.com>
---
 common/spl/spl_fit.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 87ecf0bb9e..e3312b3477 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -291,7 +291,11 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
 	 * Read the device tree and place it after the image.
 	 * Align the destination address to ARCH_DMA_MINALIGN.
 	 */
+#if defined(CONFIG_SPL_OS_BOOT) && defined(CONFIG_SYS_SPL_ARGS_ADDR)
+	image_info.load_addr = CONFIG_SYS_SPL_ARGS_ADDR;
+#else
 	image_info.load_addr = spl_image->load_addr + spl_image->size;
+#endif
 	ret = spl_load_fit_image(info, sector, fit, base_offset, node,
 				 &image_info);
 
@@ -472,7 +476,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 	 * Booting a next-stage U-Boot may require us to append the FDT.
 	 * We allow this to fail, as the U-Boot image might embed its FDT.
 	 */
-	if (spl_image->os == IH_OS_U_BOOT)
+	if (spl_image->os == IH_OS_U_BOOT || spl_image->os == IH_OS_LINUX)
 		spl_fit_append_fdt(spl_image, info, sector, fit,
 				   images, base_offset);
 
-- 
2.20.1



More information about the U-Boot mailing list