From mboxrd@z Thu Jan 1 00:00:00 1970 From: tien.fong.chee at intel.com Date: Wed, 21 Nov 2018 18:41:46 +0800 Subject: [U-Boot] [PATCH 7/9] ARM: socfpga: Use custom header target buffer in SPL In-Reply-To: <1542796908-7947-1-git-send-email-tien.fong.chee@intel.com> References: <1542796908-7947-1-git-send-email-tien.fong.chee@intel.com> Message-ID: <1542796908-7947-8-git-send-email-tien.fong.chee@intel.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: Tien Fong Chee 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 --- 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 #include #include +#include #include #include #include @@ -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