diff mbox series

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

Message ID 1542796908-7947-8-git-send-email-tien.fong.chee@intel.com
State Superseded
Delegated to: Marek Vasut
Headers show
Series Add support for loading FPGA bitstream | expand

Commit Message

Chee, Tien Fong Nov. 21, 2018, 10:41 a.m. UTC
From: Tien Fong Chee <tien.fong.chee@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@denx.de>
---
 arch/arm/mach-socfpga/spl_a10.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
diff mbox series

Patch

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