From: Dalon L Westergreen Date: Fri, 07 Sep 2018 09:15:27 -0700 Subject: [U-Boot] [PATCH v2 2/2] spl: socfpga: stratix10: add hex file output for spl image In-Reply-To: <7208f309-3519-fc89-8dc1-8e2358322da3@denx.de> References: <20180906030235.8186-1-dwesterg@gmail.com> <20180906030235.8186-2-dwesterg@gmail.com> <7e5967ae-c6a7-1a28-1a8c-578462e2a165@denx.de> <0e8d97e619b941cf32b0da03a726cdf865505c82.camel@linux.intel.com> <661d622b7f5685fd0673fa2b87e961c531a1654f.camel@linux.intel.com> <7208f309-3519-fc89-8dc1-8e2358322da3@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2018-09-06 at 23:56 +0200, Marek Vasut wrote: > On 09/06/2018 11:26 PM, Dalon L Westergreen wrote:On Thu, 2018-09-06 at 15:41 > +0200, Marek Vasut wrote:On 09/06/2018 03:39 PM, Dalon L Westergreen wrote:On > Thu, 2018-09-06 at 12:09 +0200, Marek Vasut wrote:On 09/06/2018 05:02 AM, > Dalon Westergreen wrote:Stratix10 requires a hex image of the spl for > boot. The heximage is added to the FPGA configuration image and loaded tothe > processor memory by the configuration engine. > v2: -> add CONFIG_OF_EMBED to include dtb in elf -> generate hex from elf > source > Signed-off-by: Dalon Westergreen dwesterg at gmail.com> >> > --- configs/socfpga_stratix10_defconfig | 1 + > scripts/Makefile.spl | 6 ++++++ 2 files changed, 7 > insertions(+) > diff --git a/configs/socfpga_stratix10_defconfig > b/configs/socfpga_stratix10_defconfigindex dceadff439..17cc732cbe 100644--- > a/configs/socfpga_stratix10_defconfig+++ > b/configs/socfpga_stratix10_defconfig@@ -56,3 +56,4 @@ CONFIG_DM_USB=y > CONFIG_USB_DWC2=y CONFIG_USB_STORAGE=y > CONFIG_USE_TINY_PRINTF=y+CONFIG_OF_EMBED=y > Why is this needed ? And where did the objcopy hack go ? What is > theexplanation here ? > You suggested the use of CONFIG_OF_EMBED as an alternative to using theu-boot- > spl-dtb.bin for objcopy.The intent is to ensure that the spl elf has the dtb > included, and thena simple objcopy to elf to hex is fine.You no longer need > the --change-address as the elf indicates the correctstart address, unlike the > binary. > And that's fine with your usecase ? Fine be me then ... > diff --git a/scripts/Makefile.spl b/scripts/Makefile.splindex > 76d08fd92b..b09bd40b2a 100644--- a/scripts/Makefile.spl+++ > b/scripts/Makefile.spl@@ -190,6 +190,7 @@ endif ifdef CONFIG_ARCH_SOCFPGA ALL- > $(CONFIG_TARGET_SOCFPGA_GEN5) += $(obj)/$(SPL_BIN).sfp ALL- > $(CONFIG_TARGET_SOCFPGA_ARRIA10) += $(obj)/$(SPL_BIN).sfp+ALL- > $(CONFIG_TARGET_SOCFPGA_STRATIX10) += $(obj)/$(SPL_BIN).hex > CONFIG_SPL_TARGET "u-boot-spl.hex" can replace this addition I think ? > This doesnt actually work as CONFIG_SPL_TARGET doesnt appear to be anSPL > target, but rather atarget for creating combined u-boot + spl images at the > top level. Adding > ALL-$(CONFIG_SPL_TARGET) += $(obj)/$(SPL_BIN).hex > in Makefile.spl andCONFIG_SPL_TARGET="u-boot-spl.hex"in the > socfpga_stratix10_config > results in a build failure with no target for u-boot-spl.hex > I mean, just define CONFIG_SPL_TARGET and it should generate thematching file > automatically. See the README, it explains this macro. I still get:make: *** No rule to make target 'u-boot-spl.hex', needed by 'all'. Stop. When i look at all of the other defined CONFIG_SPL_TARGET, for example [dwesterg at dwesterg-mobl u-boot]$ grep -R u-boot-with-spl.bin *......include/configs/uniphier.h:#define CONFIG_SPL_TARGET "u-boot-with-spl.bin"Makefile:OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \Makefile:u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCEMakefile:u-boot.ubl: u-boot-with-spl.bin FORCE[dwesterg at dwesterg-mobl u- boot]$ or [dwesterg at dwesterg-mobl u-boot]$ grep -R u-boot-with-nand-spl.imx *arch/arm/mach-imx/Makefile:u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u- boot.uim FORCEinclude/configs/m53evk.h:#define CONFIG_SPL_TARGET "u-boot-with-nand-spl.imx"Makefile:u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE you find the corresponding target in the makefile. There is no target for u- boot-spl.hex,furthermore the CONFIG_SPL_TARGET seems to combine spl with uboot to create a combined image. ifdef CONFIG_TPLSPL_PAYLOAD := tpl/u-boot-with-tpl.binelseSPL_PAYLOAD := u- boot.binendif OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \ --pad-to=$(CONFIG_SPL_PAD_TO)u-boot-with- spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCE $(call if_changed,pad_cat) So I can add a simple u-boot-spl.hex target, but all of the other CONFIG_SPL_TARGETi see combine spl and u-boot. --dalon