public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Samuel Holland <samuel@sholland.org>
Cc: u-boot@lists.denx.de, "Jagan Teki" <jagan@amarulasolutions.com>,
	"Alex G ." <mr.nuke.me@gmail.com>, "Pali Rohár" <pali@kernel.org>,
	"Artem Lapkin" <email2tema@gmail.com>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Sughosh Ganu" <sughosh.ganu@linaro.org>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Simon Glass" <sjg@chromium.org>
Subject: Re: [PATCH v4 4/4] sunxi: Support building a SPL as a TOC0 image
Date: Thu, 21 Oct 2021 00:50:14 +0100	[thread overview]
Message-ID: <20211021005014.34f8a484@slackpad.fritz.box> (raw)
In-Reply-To: <20211020024455.48136-5-samuel@sholland.org>

On Tue, 19 Oct 2021 21:44:54 -0500
Samuel Holland <samuel@sholland.org> wrote:

Hi,

> Now that mkimage can generate TOC0 images, and the SPL can interpret
> them, hook up the build infrastructure so the user can choose which
> image type to build. Since the absolute load address is stored in the
> TOC0 header, that information must be passed to mkimage.
> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Nice, that allows to build TOC0 images very easily!
Tested for regressions on a bunch of boards, and on a Remix Mini PC,
selecting SPL_IMAGE_TYPE_SUNXI_TOC0: boots straight through!
Will double check the DT I made, then send it later, so that we get a
user in the tree.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> 
> (no changes since v2)
> 
> Changes in v2:
>  - Rebase on top of Icenowy's RISC-V support series
>  - Rename Kconfig symbols to include the full image type name
> 
>  arch/arm/mach-sunxi/Kconfig |  2 ++
>  board/sunxi/Kconfig         | 24 ++++++++++++++++++++++++
>  scripts/Makefile.spl        |  5 ++++-
>  3 files changed, 30 insertions(+), 1 deletion(-)
>  create mode 100644 board/sunxi/Kconfig
> 
> diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
> index 2c18cf02d1..879efb9f61 100644
> --- a/arch/arm/mach-sunxi/Kconfig
> +++ b/arch/arm/mach-sunxi/Kconfig
> @@ -1050,6 +1050,8 @@ config BLUETOOTH_DT_DEVICE_FIXUP
>  	  The used address is "bdaddr" if set, and "ethaddr" with the LSB
>  	  flipped elsewise.
>  
> +source "board/sunxi/Kconfig"
> +
>  endif
>  
>  config CHIP_DIP_SCAN
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> new file mode 100644
> index 0000000000..084a8b0c6c
> --- /dev/null
> +++ b/board/sunxi/Kconfig
> @@ -0,0 +1,24 @@
> +choice
> +	prompt "SPL Image Type"
> +	default SPL_IMAGE_TYPE_SUNXI_EGON
> +
> +config SPL_IMAGE_TYPE_SUNXI_EGON
> +	bool "eGON (normal)"
> +	help
> +	  Select this option to embed the SPL binary in an eGON.BT0 image,
> +	  which is compatible with the normal boot ROM (NBROM).
> +
> +	  This is usually the correct option to choose.
> +
> +config SPL_IMAGE_TYPE_SUNXI_TOC0
> +	bool "TOC0 (secure)"
> +	help
> +	  Select this option to embed the SPL binary in a TOC0 image,
> +	  which is compatible with the secure boot ROM (SBROM).
> +
> +endchoice
> +
> +config SPL_IMAGE_TYPE
> +	string
> +	default "sunxi_egon" if SPL_IMAGE_TYPE_SUNXI_EGON
> +	default "sunxi_toc0" if SPL_IMAGE_TYPE_SUNXI_TOC0
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index 4cc23799db..635fa14cb9 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -411,7 +411,10 @@ endif
>  $(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
>  	$(call if_changed,mkimage)
>  
> -MKIMAGEFLAGS_sunxi-spl.bin = -A $(ARCH) -T sunxi_egon \
> +MKIMAGEFLAGS_sunxi-spl.bin = \
> +	-A $(ARCH) \
> +	-T $(CONFIG_SPL_IMAGE_TYPE) \
> +	-a $(CONFIG_SPL_TEXT_BASE) \
>  	-n $(CONFIG_DEFAULT_DEVICE_TREE)
>  
>  OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)


      reply	other threads:[~2021-10-20 23:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20  2:44 [PATCH v4 0/4] sunxi: TOC0 image type support Samuel Holland
2021-10-20  2:44 ` [PATCH v4 1/4] tools: Separate image types which depend on OpenSSL Samuel Holland
2021-10-20  7:29   ` Pali Rohár
2021-10-20 13:29     ` Andre Przywara
2021-10-20 13:47       ` Pali Rohár
2021-10-20 14:14         ` Samuel Holland
2021-10-21 12:33           ` Marek Behún
2021-10-21 13:00           ` Marek Behún
2021-10-21 13:01             ` Pali Rohár
2021-10-22  1:25             ` Samuel Holland
2021-10-22 10:09             ` Heinrich Schuchardt
2021-10-22 14:59               ` Marek Behún
2021-10-22 15:09                 ` Tom Rini
2021-10-22 15:56                   ` Andre Przywara
2021-10-22 16:22                     ` Tom Rini
2021-10-22 16:47                       ` Vagrant Cascadian
2021-10-22 17:11                         ` Pali Rohár
2021-10-22 17:20                         ` Andre Przywara
2021-10-22 19:46                           ` Vagrant Cascadian
2021-10-27 17:11                             ` Tom Rini
2021-10-27 20:11                               ` Peter Robinson
2021-10-28 15:44                   ` Matthias Brugger
2021-10-20  2:44 ` [PATCH v4 2/4] tools: mkimage: Add Allwinner TOC0 support Samuel Holland
2021-10-20 23:49   ` Andre Przywara
2021-10-20  2:44 ` [PATCH v4 3/4] sunxi: Support SPL in both eGON and TOC0 images Samuel Holland
2021-10-20 23:49   ` Andre Przywara
2021-10-20  2:44 ` [PATCH v4 4/4] sunxi: Support building a SPL as a TOC0 image Samuel Holland
2021-10-20 23:50   ` Andre Przywara [this message]

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=20211021005014.34f8a484@slackpad.fritz.box \
    --to=andre.przywara@arm.com \
    --cc=email2tema@gmail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=marek.behun@nic.cz \
    --cc=mr.nuke.me@gmail.com \
    --cc=pali@kernel.org \
    --cc=priyanka.jain@nxp.com \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox