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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E58C48BDF for ; Mon, 21 Jun 2021 02:56:48 +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 B255B6102A for ; Mon, 21 Jun 2021 02:56:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B255B6102A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B987829C7; Mon, 21 Jun 2021 04:56:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="icW4jvaR"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZR9MUM7Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED79C829B6; Mon, 21 Jun 2021 04:56:09 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8BA46829AE for ; Mon, 21 Jun 2021 04:56:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B58945C0159; Sun, 20 Jun 2021 22:55:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 20 Jun 2021 22:55:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=chiQVmIC6JMdk e9Bd6nT+7lWdSa7p6Xod3FSUoGuX7k=; b=icW4jvaRLI4mOVzF85LGxmVS/Phpw waN4nX5bRWRUZN7qM6o8/GS8kSDN6yYURtIoTNiLvJvpTQMDoPylMX2M4BKZM/2Q Q6xadPvplWgE7wxZQ6OnioyxQHuin2uv1FWE8DNg7xrYEHMtqPH5TK02ACol9TNa p1NQxhr9RJxvZUJ67Ao7nxJKwCMSU719AAJWE23VgHTaU9Db6ILmK31NQj8N55U8 G2nfSU3Mf7DnXiC1e4BLuK8f/rokc5WrZh2vpLUsfbvSa8Q8mctnfwvVCY4sgS1d yNx/F0FcBTN4utaRNjvCyIKLZ8/zhFYrlSWfs0nLJBa04QF6F3/QN3Hlg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=chiQVmIC6JMdke9Bd6nT+7lWdSa7p6Xod3FSUoGuX7k=; b=ZR9MUM7Z UqpqaMmRMe5JNWlUK2fmSOCWPrHpmPZvvV9b+EVAv9wTQOGZCumUcBlPMWUvvzyg on7hzdKOJSozJnW8+wBu+oKgfvyNvbFwIqlD1PYmxy968WY/oSwrJ6MrO82F8p7D sa0sXzCVZp3i7JNMLCd2X6roxuwtCP5JXSZEabr/hLpiv2qkg09/5/3YxN7oPkXS yTc2Hxe8DwGUDMz9CdwVHLVz2RvIFiCQKGrh1y+fdaxFrsHWD90/upUyKalQK6Ky 3hen82L8xvgFBAun0UjXvHpOqDcgOBfDjrJ9W81iy0EEX6Egz01faXjzVw3ZfhKI +1ZKZSDKdTRbWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeefkedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Jun 2021 22:55:59 -0400 (EDT) From: Samuel Holland To: Jagan Teki , Andre Przywara , Hans de Goede Cc: u-boot@lists.denx.de, Samuel Holland Subject: [PATCH 4/4] sunxi: Support building a SPL as a TOC0 image Date: Sun, 20 Jun 2021 21:55:55 -0500 Message-Id: <20210621025555.19390-5-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621025555.19390-1-samuel@sholland.org> References: <20210621025555.19390-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. Signed-off-by: Samuel Holland --- arch/arm/mach-sunxi/Kconfig | 2 ++ board/sunxi/Kconfig | 24 ++++++++++++++++++++++++ scripts/Makefile.spl | 3 ++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 board/sunxi/Kconfig diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index bc8509b72a2..4c466325f3a 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -1088,6 +1088,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 00000000000..c5c0929db52 --- /dev/null +++ b/board/sunxi/Kconfig @@ -0,0 +1,24 @@ +choice + prompt "SPL Image Type" + default SUNXI_SPL_IMAGE_EGON + +config SUNXI_SPL_IMAGE_EGON + bool "eGON (non-secure)" + help + Select this option to embed the SPL binary in an eGON.BT0 image, + which is compatible with the non-secure boot ROM (NBROM). + + This is usually the correct option to choose. + +config SUNXI_SPL_IMAGE_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 SUNXI_SPL_IMAGE_TYPE + string + default "sunxi_egon" if SUNXI_SPL_IMAGE_EGON + default "sunxi_toc0" if SUNXI_SPL_IMAGE_TOC0 diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 5be1a9ba1b1..7cc78bb3186 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -414,7 +414,8 @@ endif $(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE $(call if_changed,mkimage) -MKIMAGEFLAGS_sunxi-spl.bin = -T sunxi_egon \ +MKIMAGEFLAGS_sunxi-spl.bin = -T $(CONFIG_SUNXI_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) -- 2.31.1