[U-Boot] [PATCH 7/9] ARM: socfpga: Use custom header target buffer in SPL

tien.fong.chee at intel.com tien.fong.chee at intel.com
Wed Nov 21 10:41:46 UTC 2018


From: Tien Fong Chee <tien.fong.chee at intel.com>

Allocate buffers from OCRAM heap for the image headers in SPL on
Arria10, since DRAM is not available at that point. This allows
U-Boot to load the fitImage header, parse it, extract the FPGA
bitstream section from it, program the FPGA and make DRAM available.

Signed-off-by: Marek Vasut <marex at denx.de>
---
 arch/arm/mach-socfpga/spl_a10.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-socfpga/spl_a10.c b/arch/arm/mach-socfpga/spl_a10.c
index 2baeba6..7fe9790 100644
--- a/arch/arm/mach-socfpga/spl_a10.c
+++ b/arch/arm/mach-socfpga/spl_a10.c
@@ -9,6 +9,7 @@
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <image.h>
+#include <malloc.h>
 #include <asm/arch/reset_manager.h>
 #include <spl.h>
 #include <asm/arch/system_manager.h>
@@ -157,4 +158,14 @@ int board_fit_config_name_match(const char *name)
 
 	return 0;
 }
+
+struct image_header *spl_get_load_buffer(int offset, size_t size)
+{
+	struct image_header *mem = memalign(4, size);
+
+	if (!mem)
+		hang();
+
+	return mem;
+}
 #endif
-- 
1.7.7.4



More information about the U-Boot mailing list