From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79462C433EF for ; Wed, 20 Oct 2021 23:50:47 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9E87611B0 for ; Wed, 20 Oct 2021 23:50:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C9E87611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C418183459; Thu, 21 Oct 2021 01:50:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 60D168340A; Thu, 21 Oct 2021 01:50:27 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id DC9FF8344A for ; Thu, 21 Oct 2021 01:50:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D5B0D6E; Wed, 20 Oct 2021 16:50:19 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8727B3F694; Wed, 20 Oct 2021 16:50:17 -0700 (PDT) Date: Thu, 21 Oct 2021 00:50:14 +0100 From: Andre Przywara To: Samuel Holland Cc: u-boot@lists.denx.de, Jagan Teki , "Alex G ." , Pali =?UTF-8?B?Um9ow6Fy?= , Artem Lapkin , Priyanka Jain , Sughosh Ganu , Marek =?UTF-8?B?QmVow7pu?= , Simon Glass Subject: Re: [PATCH v4 4/4] sunxi: Support building a SPL as a TOC0 image Message-ID: <20211021005014.34f8a484@slackpad.fritz.box> In-Reply-To: <20211020024455.48136-5-samuel@sholland.org> References: <20211020024455.48136-1-samuel@sholland.org> <20211020024455.48136-5-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Tue, 19 Oct 2021 21:44:54 -0500 Samuel Holland 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 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 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)