All of lore.kernel.org
 help / color / mirror / Atom feed
From: Westergreen, Dalon <dalon.westergreen@intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] spl: socfpga: stratix10: add hex file output for spl image
Date: Fri, 7 Sep 2018 18:02:38 +0000	[thread overview]
Message-ID: <de3b55c32070269cacbe46db42c68958b5f51bfc.camel@intel.com> (raw)
In-Reply-To: <68716eac-e01c-49e8-7d58-4ce772f57af9@denx.de>

On Fri, 2018-09-07 at 19:36 +0200, Marek Vasut wrote:
> On 09/07/2018 06:40 PM, Dalon L Westergreen wrote:
> On Fri, 2018-09-07 at 18:25 +0200, Marek Vasut wrote:
> On 09/07/2018 06:15 PM, Dalon L Westergreen wrote:
> 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 hex
> image is added to the FPGA configuration image and loaded to
> the 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 <mailto:dwesterg@gmail.com> <mailto:dwesterg at gmail.com <mailto:dwesterg@gmail.com>> <mailto:dwesterg at gmail.com <mailto:dwesterg@gmail.com> <mailto:dwesterg at gmail.com <mailto:dwesterg@gmail.com>>> <mailto:dwesterg at gmail.com <mailto:dwesterg@gmail.com> <mailto:dwesterg at gmail.com <mailto:dwesterg@gmail.com>> <mailto:dwesterg at gmail.com <mailto:dwesterg@gmail.com> <mailto:dwesterg at gmail.com <mailto:dwesterg@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_defconfig
> index 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 the
> explanation here ?
> 
> You suggested the use of CONFIG_OF_EMBED as an alternative to using the
> u-boot-spl-dtb.bin for objcopy.
> The intent is to ensure that the spl elf has the dtb included, and then
> a simple objcopy to elf to hex is fine.
> You no longer need the --change-address as the elf indicates the correct
> start address, unlike the binary.
> 
> And that's fine with your usecase ? Fine be me then ...
> 
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index 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 an
> SPL target, but rather a
> target for creating combined u-boot + spl images at the top level. Adding
> 
> ALL-$(CONFIG_SPL_TARGET) += $(obj)/$(SPL_BIN).hex
> 
> in Makefile.spl and
> CONFIG_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 the
> matching 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
> 
> I guess you did add the u-boot-spl.hex target already ?
> 
> [dwesterg at dwesterg-mobl <mailto:dwesterg@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) FORCE
> 
> Makefile:u-boot.ubl: u-boot-with-spl.bin FORCE
> 
> [dwesterg at dwesterg-mobl <mailto:dwesterg@dwesterg-mobl> u-boot]$ 
> 
> 
> or 
> 
> 
> [dwesterg at dwesterg-mobl <mailto:dwesterg@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 FORCE
> 
> include/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_TPL
> 
> SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
> 
> else
> 
> SPL_PAYLOAD := u-boot.bin
> 
> endif
> 
> 
> 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_TARGET
> 
> i see combine spl and u-boot.
> 
> Try this:
> 
> include/configs/ls1046a_common.h:#define CONFIG_SPL_TARGET
> "spl/u-boot-spl.pbl"
> 
> True, but i would still need to add an spl/u-boot-spl.hex target in the main Makefile.
> 
> What is the benefit of doing this over just adding the hex target in Makefile.spl?
> 
> My whole point was that I'd like this:
> +ALL-$(CONFIG_TARGET_SOCFPGA_STRATIX10)	+= $(obj)/$(SPL_BIN).hex
> to go away.
> 
> If you need to add a target to a Makefile, that's fine of course.
> 
Should i move the sfp generation stuff while I am at it?  use CONFIG_SPL_TARGET
in the gen5 /Arria10 devices as well?  I think it would clean things up.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3282 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180907/aa974e91/attachment.bin>

  reply	other threads:[~2018-09-07 18:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  3:02 [U-Boot] [PATCH v2 1/2] spl: socfpga: only gen5 devices and arria10 require sfp image Dalon Westergreen
2018-09-06  3:02 ` [U-Boot] [PATCH v2 2/2] spl: socfpga: stratix10: add hex file output for spl image Dalon Westergreen
2018-09-06  5:51   ` Simon Goldschmidt
2018-09-06 13:49     ` Dalon L Westergreen
2018-09-06 10:09   ` Marek Vasut
2018-09-06 13:39     ` Dalon L Westergreen
2018-09-06 13:41       ` Marek Vasut
2018-09-06 17:40         ` Dalon L Westergreen
2018-09-06 18:16           ` Marek Vasut
2018-09-06 21:26         ` Dalon L Westergreen
2018-09-06 21:56           ` Marek Vasut
2018-09-07 16:15             ` Dalon L Westergreen
2018-09-07 16:25               ` Marek Vasut
2018-09-07 16:40                 ` Dalon L Westergreen
2018-09-07 17:36                   ` Marek Vasut
2018-09-07 18:02                     ` Westergreen, Dalon [this message]
2018-09-07 18:17                       ` Marek Vasut
2018-09-06 10:08 ` [U-Boot] [PATCH v2 1/2] spl: socfpga: only gen5 devices and arria10 require sfp image Marek Vasut
2018-09-06 13:30   ` Dalon L Westergreen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de3b55c32070269cacbe46db42c68958b5f51bfc.camel@intel.com \
    --to=dalon.westergreen@intel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.