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 8DD28C433EF for ; Wed, 13 Oct 2021 02:31:11 +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 DAE3360F92 for ; Wed, 13 Oct 2021 02:31:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DAE3360F92 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org 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 7D2078374A; Wed, 13 Oct 2021 04:30:53 +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="MNALYSSH"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="PVASibHc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B916A834C5; Wed, 13 Oct 2021 04:30:34 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 CFE3D83562 for ; Wed, 13 Oct 2021 04:30:27 +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 1FE985C0185; Tue, 12 Oct 2021 22:30:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 12 Oct 2021 22:30:27 -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=oT9+MreyJdBnz MrH/r2buoMcsIzvlG7+0hWotMQwMCo=; b=MNALYSSHJCj6vHe0tHFHv/zAwwz3k tl9c5PC+41PIIWxMQ1A4vVZ4QKVgAavGpspbFVSm4maFmJbNNSbJU/3mUVBpyPL0 z1sewcp3h25P3fyyvH141o3CJfVKjvyWXztobsvZH8ZEcJZv+kk3SI6p7dC+Ja+y eshZiopF2pkAAPwCXJyxINXx6QI1wfMki0WrJBfewbX4NW1TlLvVa+SifxWxtHiQ ELtF9Do5eklkQxeZf9NaTNQaVLPVuLrlUngKRfcy2sQhJlQtko/B4TrGl2NjMB4z 9Lhju2s8kyiqMLyuhar8WROTm/6OB1MJV92xNANqS5Jw0wZNM+sovQl1w== 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= fm1; bh=oT9+MreyJdBnzMrH/r2buoMcsIzvlG7+0hWotMQwMCo=; b=PVASibHc IUVa6RGNGByeuuL71Lhe1LBwPTiP8A1E0gUn6vFJAKpRH4RZvuflCebyzC5/sEIP 7dEhCaLJrjytjuQqbaQ4t3vhyh5wl8Tdm0okGAVx+GFMVkyqFGIe1uGYX0Dx/eSs xzc48TbPxjSRHqBhqA5qxm2dQdDszDmZbzx0qjeMV+a5bBW8urqUhO9ISEMAIZ3q /gviCYFIUoRJ1r4TNH6cMUpjabM+afYllVlLPo3z2lf8i35po2miUk8erZfl8Y7k vWkj3YIriKgsClue/uzrJxPaE67L6mJbDGkgIAUtD7qFnbG3XJmJ4RP86taFppcl tJ5HltnvbXzYpw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtledgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Oct 2021 22:30:26 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara , Simon Glass Cc: Samuel Holland , Masahiro Yamada Subject: [PATCH 3/3] sunxi: binman: Enable SPL FIT loading for 32-bit SoCs Date: Tue, 12 Oct 2021 21:30:21 -0500 Message-Id: <20211013023022.58829-4-samuel@sholland.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211013023022.58829-1-samuel@sholland.org> References: <20211013023022.58829-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 Crust (SCP firmware) has support for H3, we need a FIT image to load it. H3 also needs to load a SoC-specific eGon blob to support CPU 0 hotplug. Let's first enable FIT support before adding extra firmware. Update the binman description to work on either 32-bit or 64-bit SoCs: - Make BL31 optional, since it is not used on 32-bit SoCs (though BL32 may be used in the future). - Explicitly set the minimum offset of the FIT to 32 KiB, since SPL on some boards is still only 24 KiB large even with FIT support enabled. CONFIG_SPL_PAD_TO cannot be used because it is not defined for H616. FIT unlocks more features (signatures, multiple DTBs, etc.), so enable it by default. A10 (sun4i) only has 24 KiB of SRAM A1, so it needs SPL_FIT_IMAGE_TINY. For simplicity, enable that option everywhere. Signed-off-by: Samuel Holland --- arch/arm/Kconfig | 1 + arch/arm/dts/sunxi-u-boot.dtsi | 46 ++++++++++++++++++++++------------ common/spl/Kconfig | 3 +-- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index d8c041a877..f80f237f7e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1062,6 +1062,7 @@ config ARCH_SUNXI imply SPL_GPIO imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBGENERIC_SUPPORT + imply SPL_LOAD_FIT imply SPL_MMC if MMC imply SPL_POWER imply SPL_SERIAL diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi index 4a6ed3a7dd..ad1f976329 100644 --- a/arch/arm/dts/sunxi-u-boot.dtsi +++ b/arch/arm/dts/sunxi-u-boot.dtsi @@ -1,13 +1,19 @@ #include -#ifdef CONFIG_MACH_SUN50I_H6 -#define BL31_ADDR 0x104000 -#define SCP_ADDR 0x114000 -#elif defined(CONFIG_MACH_SUN50I_H616) -#define BL31_ADDR 0x40000000 +#ifdef CONFIG_ARM64 +#define ARCH "arm64" #else -#define BL31_ADDR 0x44000 -#define SCP_ADDR 0x50000 +#define ARCH "arm" +#endif + +#if defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H5) +#define BL31_ADDR 0x00044000 +#define SCP_ADDR 0x00050000 +#elif defined(CONFIG_MACH_SUN50I_H6) +#define BL31_ADDR 0x00104000 +#define SCP_ADDR 0x00114000 +#elif defined(CONFIG_MACH_SUN50I_H616) +#define BL31_ADDR 0x40000000 #endif / { @@ -30,30 +36,33 @@ filename = "spl/sunxi-spl.bin"; }; -#ifdef CONFIG_ARM64 +#ifdef CONFIG_SPL_LOAD_FIT fit { - description = "Configuration to load ATF before U-Boot"; + description = "Configuration to load U-Boot and firmware"; + offset = <32768>; #address-cells = <1>; fit,fdt-list = "of-list"; images { uboot { - description = "U-Boot (64-bit)"; + description = "U-Boot"; type = "standalone"; os = "u-boot"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = ; + entry = ; u-boot-nodtb { }; }; +#ifdef BL31_ADDR atf { description = "ARM Trusted Firmware"; type = "firmware"; os = "arm-trusted-firmware"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = ; entry = ; @@ -63,6 +72,7 @@ missing-msg = "atf-bl31-sunxi"; }; }; +#endif #ifdef SCP_ADDR scp { @@ -91,19 +101,23 @@ @config-SEQ { description = "NAME"; +#ifdef BL31_ADDR firmware = "atf"; -#ifndef SCP_ADDR - loadables = "uboot"; #else - loadables = "scp", "uboot"; + firmware = "uboot"; +#endif + loadables = +#ifdef SCP_ADDR + "scp", #endif + "uboot"; fdt = "fdt-SEQ"; }; }; }; #else u-boot-img { - offset = ; + offset = <32768>; }; #endif }; diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 17ce2f6b61..cad8125c4b 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -443,8 +443,7 @@ config SPL_MD5 config SPL_FIT_IMAGE_TINY bool "Remove functionality from SPL FIT loading to reduce size" depends on SPL_FIT - default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6 - default y if ARCH_IMX8M + default y if ARCH_IMX8M || ARCH_SUNXI help Enable this to reduce the size of the FIT image loading code in SPL, if space for the SPL binary is very tight. -- 2.32.0