From patchwork Sun Jan 22 21:15:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1730195 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm1 header.b=BRpFvGdf; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=APpKEgPW; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P0Qy10GRqz23gd for ; Mon, 23 Jan 2023 08:15:51 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 769DF85479; Sun, 22 Jan 2023 22:15:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="BRpFvGdf"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="APpKEgPW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E60538569C; Sun, 22 Jan 2023 22:15:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 8140884FD1 for ; Sun, 22 Jan 2023 22:15:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (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.west.internal (Postfix) with ESMTP id 2B00932004AE; Sun, 22 Jan 2023 16:15:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 22 Jan 2023 16:15:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1674422132; x=1674508532; bh=sC n+K89UYN4c0pRkrj016pqEgWZBksZlDiuOSgcBesk=; b=BRpFvGdfSt/8qfeAqE U0JyJoE57tA+2YxRW6Ommhph3BPisKoxXESSf+CDsxCOamCNpMAgcU9DwJgioEOh vtGmQ+TP3cfLKaLS/jI4noADF6ZbPtzORTXYV5ro8TxlL3LHygozQEGgVal8h6ei fKma2rPN1MIRYWQPF7OlNs0UK3ASkuCtMYnO53KK8sND1E3VdYW0MaxPWPfbAg7i KESojwM1A8HfPazUgZ2lKAJzRJyQNdOzqI6Lo5wOvk5ojmP+48VsjaxW8mN5xJlK b4gO+BCbHW/RFuco/M3dAdmmxMESRIRN5W8ttEUrCI+SP70zzv0Ua2p4Oa5wEczA l3Ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1674422132; x=1674508532; bh=sCn+K89UYN4c0 pRkrj016pqEgWZBksZlDiuOSgcBesk=; b=APpKEgPWkLLXvnWpV0OSM6eIZzHI8 DfIG7B5lNMQ0T1bp3TQqQOMPT1SK93kj1h8mKEnYr0FI3rwPYkAEW16vH5972R2Q ozMKyLCKUohv6n52wdjXaQac2JQk/U4tMDl9DobizCbz1VVHnLwQSYyHt422/+mI UpYxPHru1kNWme5X88OSfjFbaYSQlSObjr2lsQOakeTI8s2pTp2jOp7AApJKqx7C ovt+Hh68LqLKMoENULTAN5mb5YBroCnXhvj8lrKcKZ7iy3YNfWT5zv4+TzMrkv9t 05j/R97YNfuN9NKJ66SFoNZcH+jEhvVLzMnCXyci4V/aRxFP4IsZDniWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduiedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeeh gfdufeeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Jan 2023 16:15:32 -0500 (EST) From: Samuel Holland To: Andre Przywara , Jagan Teki Cc: Jesse Taube , Icenowy Zheng , u-boot@lists.denx.de, Samuel Holland Subject: [PATCH v2 1/4] sunxi: spl: Disable padding from SPL_PAD_TO Date: Sun, 22 Jan 2023 15:15:27 -0600 Message-Id: <20230122211531.23181-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230122211531.23181-1-samuel@sholland.org> References: <20230122211531.23181-1-samuel@sholland.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Starting with H6, Allwinner removed the artificial 32 KiB SPL size limit from the boot ROM. Now SPL size is only limited by the available SRAM. This limit ranges from 152 KiB on H6 to a whopping 2052 KiB on R329. To take advantage of this additional space, we must increase SPL_MAX_SIZE. Since we do not want to unnecessarily pad SPL out to these giant sizes, we must set SPL_PAD_TO to zero. This causes no problems because binman already takes care of appending the SPL payload at the right offset. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 common/spl/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 3c2af453ab..a7c55f8c4c 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -97,8 +97,7 @@ config SPL_PAD_TO default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB default 0x11000 if ARCH_MX7 || (ARCH_MX6 && !MX6_OCRAM_256KB) default 0x10000 if ARCH_KEYSTONE - default 0x8000 if ARCH_SUNXI && !MACH_SUN50I_H616 - default 0x0 if ARCH_MTMIPS + default 0x0 if ARCH_MTMIPS || ARCH_SUNXI default TPL_MAX_SIZE if TPL_MAX_SIZE > SPL_MAX_SIZE default SPL_MAX_SIZE help From patchwork Sun Jan 22 21:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1730197 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm1 header.b=dlRJAZDb; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=bcI1v7aC; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P0QyP3S97z23gd for ; Mon, 23 Jan 2023 08:16:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 39F79856A1; Sun, 22 Jan 2023 22:15:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="dlRJAZDb"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="bcI1v7aC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3F692856A1; Sun, 22 Jan 2023 22:15:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 AE7AF8566F for ; Sun, 22 Jan 2023 22:15:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D6B9A32004ED; Sun, 22 Jan 2023 16:15:35 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 22 Jan 2023 16:15:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1674422135; x=1674508535; bh=Mo A4sgmLVH/EnqViQJtM5vnLFhxXKEBRmW8lb8HApJs=; b=dlRJAZDbz74K8dr0hO WKNVrZW5nHJe+XC5w60W8hflK6qOUUQIb8Xg7F5hB57+wpFzGgP1KMo2naHYNke9 BFiSj3ZXlxlW6E46Qua6Cmcsb/0+G1COmNsmKGF3OE8YAHXR+4t6rf2ksWM0i+s4 fgwM35ub2MQHkbNswJQRpoaWcxiUy7oaEFeoFYkieWXKueJkpue/GHa2XTIsF57u DQNq3NiekMYr9EvNGP0/0c8joehQ6mI0bVc9xSYKxUDVhBu5qNXvanRVQKqd5Mbw 4jrqumb/Jz21U5rvNasWExhJrRTVuq/r3ZLr9Zm30cEZFLVdBeJT6N8+ssINIVy3 QYFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1674422135; x=1674508535; bh=MoA4sgmLVH/En qViQJtM5vnLFhxXKEBRmW8lb8HApJs=; b=bcI1v7aCHIRVzE0vaFjRZLNB9V4Cx Kin45UjTE0gWs4PvWYKx/8Z5wTDKZHcdD1q06PDALT1tKi9JMDIT/XQdtTGl9PIS FuBN1hbVZUIaaY3UfHdO5wKZftpo6B6eEgNFK+C79sVRQvKdaAKht+KY2xUlO/vz gg5hNlXpf/jagN9MZ/as+nqEG+CTHYYr4JE6BMkJj83Kvb6w68QgN66iJv2MhAky 6DpIKb/afRbxyQ632DgwpQnELRHGE0Fop9x64rE7Ul/WaQiosrp1r+mqYLMJO3cK 1Z83lCSWBLDaolHBo8d0U3QbHifbyGvv/hui2Nvlly7fd/vvVyiNylbnA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduiedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeeh gfdufeeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Jan 2023 16:15:34 -0500 (EST) From: Samuel Holland To: Andre Przywara , Jagan Teki Cc: Jesse Taube , Icenowy Zheng , u-boot@lists.denx.de, Samuel Holland Subject: [PATCH v2 2/4] sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig Date: Sun, 22 Jan 2023 15:15:28 -0600 Message-Id: <20230122211531.23181-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230122211531.23181-1-samuel@sholland.org> References: <20230122211531.23181-1-samuel@sholland.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean This is easier to read than the #ifdef staircase, provides better visibility into the memory map (alongside the other Kconfig definitions), and allows these addresses to be reused from code. Signed-off-by: Samuel Holland Reviewed-by: Simon Glass --- Changes in v2: - New patch for v2, split from the .dtsi changes arch/arm/dts/sunxi-u-boot.dtsi | 24 +++++++----------------- arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi index 8a6c9e901a..f38359fd42 100644 --- a/arch/arm/dts/sunxi-u-boot.dtsi +++ b/arch/arm/dts/sunxi-u-boot.dtsi @@ -1,15 +1,5 @@ #include -#ifdef CONFIG_MACH_SUN50I_H6 -#define BL31_ADDR 0x104000 -#define SCP_ADDR 0x114000 -#elif defined(CONFIG_MACH_SUN50I_H616) -#define BL31_ADDR 0x40000000 -#else -#define BL31_ADDR 0x44000 -#define SCP_ADDR 0x50000 -#endif - / { aliases { #ifndef CONFIG_MACH_SUNIV @@ -64,8 +54,8 @@ os = "arm-trusted-firmware"; arch = "arm64"; compression = "none"; - load = ; - entry = ; + load = ; + entry = ; atf-bl31 { filename = "bl31.bin"; @@ -73,13 +63,13 @@ }; }; -#ifdef SCP_ADDR +#if CONFIG_SUNXI_SCP_BASE scp { description = "SCP firmware"; type = "firmware"; arch = "or1k"; compression = "none"; - load = ; + load = ; scp { filename = "scp.bin"; @@ -101,10 +91,10 @@ @config-SEQ { description = "NAME"; firmware = "atf"; -#ifndef SCP_ADDR - loadables = "uboot"; -#else +#if CONFIG_SUNXI_SCP_BASE loadables = "scp", "uboot"; +#else + loadables = "uboot"; #endif fdt = "fdt-SEQ"; }; diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index dbe6005daa..8e67f7e91d 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -110,6 +110,23 @@ config SUNXI_SRAM_ADDRESS Some newer SoCs map the boot ROM at address 0 instead and move the SRAM to a different address. +config SUNXI_BL31_BASE + hex + default 0x00044000 if MACH_SUN50I || MACH_SUN50I_H5 + default 0x00104000 if MACH_SUN50I_H6 + default 0x40000000 if MACH_SUN50I_H616 + default 0x0 + help + Address where BL31 (TF-A) is loaded, or zero if BL31 is not used. + +config SUNXI_SCP_BASE + hex + default 0x00050000 if MACH_SUN50I || MACH_SUN50I_H5 + default 0x00114000 if MACH_SUN50I_H6 + default 0x0 + help + Address where SCP firmware is loaded, or zero if it is not used. + config SUNXI_A64_TIMER_ERRATUM bool From patchwork Sun Jan 22 21:15:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1730198 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm1 header.b=nrmWopAj; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=GKsQeGmr; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P0Qyd0Pbsz23gd for ; Mon, 23 Jan 2023 08:16:24 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 959A9856C2; Sun, 22 Jan 2023 22:15:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="nrmWopAj"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="GKsQeGmr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA461856BD; Sun, 22 Jan 2023 22:15:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 3C310856A7 for ; Sun, 22 Jan 2023 22:15:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 651183200392; Sun, 22 Jan 2023 16:15:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 22 Jan 2023 16:15:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1674422138; x=1674508538; bh=MG ZbBN6UAkTl6rkERUGUFln5gg/w+/aFgDm8qt07sXA=; b=nrmWopAjAv30Bso0FP nrU4FNWpP1Bpq+vJJkCV8WBmIzN1SwW9TWYklHmRVToouBSDiyEgBY+17EiLY9sX jtAz2CRR86c+4lEt6oiBqr13p7b5/bT51UpNuRgmWRKFm2pxw2/Gto35kSk4GIXJ Of7mvM3DJVpi9OHuHdQoPMvy1YzpHskRmRs7S4weht9ofBVMPtubGllNG+bUoiHs sW/4gp26j9V1W1fXNpVxMxILJC5PvQexnPaDCY5yGtCLuXWBGOSwUeTwW9QcqYUY x4Zv/i7CYvIZXZgLMC7Wh6QkmnnmKXc/XJg2WA4uPkHytm8Hg7O30puplO9RkCKQ QHew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1674422138; x=1674508538; bh=MGZbBN6UAkTl6 rkERUGUFln5gg/w+/aFgDm8qt07sXA=; b=GKsQeGmrAjevzH1sYoRzF5+pJl7xB 7UBRRKn7u43NEzZDeKVtSaiNNSn14cShLOLwlAij68MnNxAuH8V+i0AbyYzogg+X NTBJCeTgOgAJ2YrkapKhaOS+UV9b0Vf12tV9qQS81ZRx5GxZcN4sGr8gIouRipo7 UEpjQour+Mtu5M3SJi31N/SYZWF2jQ4a4b9RQ5uVk8SoXxhk+jp6t9WnAGrg04Ay ZBI3dQ68CaKBhR/7PI8m4XmlGR8OGDelUXH2FMrppO55eB4i3O9EGIIHaXxdWf6G N+XnUJ5oyIAlL1AEqGvoQ/w09URxM6YxuouYh2w4bH9OsPlUi0tnzQYxg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduiedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeeh gfdufeeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Jan 2023 16:15:37 -0500 (EST) From: Samuel Holland To: Andre Przywara , Jagan Teki Cc: Jesse Taube , Icenowy Zheng , u-boot@lists.denx.de, Samuel Holland Subject: [PATCH v2 3/4] sunxi: binman: Support FIT generation for 32-bit SoCs Date: Sun, 22 Jan 2023 15:15:29 -0600 Message-Id: <20230122211531.23181-4-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230122211531.23181-1-samuel@sholland.org> References: <20230122211531.23181-1-samuel@sholland.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Some 32-bit SoCs can use SCP firmware to implement additional PSCI functionality, such as system suspend. In order to load this firmware from SPL, we need to generate and use a FIT instead of a legacy image. Adjust the binman FIT definition so it does not rely on TF-A BL31, as this is not used on 32-bit SoCs. Instead, after loading the firmware, U-Boot proper is executed directly. Signed-off-by: Samuel Holland --- Changes in v2: - Rely on binman min-size instead of using explicit offsets - Use Kconfig for firmware addresses instead of an #ifdef staircase arch/arm/dts/sunxi-u-boot.dtsi | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi index f38359fd42..c7089b8619 100644 --- a/arch/arm/dts/sunxi-u-boot.dtsi +++ b/arch/arm/dts/sunxi-u-boot.dtsi @@ -1,5 +1,11 @@ #include +#ifdef CONFIG_ARM64 +#define ARCH "arm64" +#else +#define ARCH "arm" +#endif + / { aliases { #ifndef CONFIG_MACH_SUNIV @@ -29,30 +35,32 @@ 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"; #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 { }; }; +#if CONFIG_SUNXI_BL31_BASE atf { description = "ARM Trusted Firmware"; type = "firmware"; os = "arm-trusted-firmware"; - arch = "arm64"; + arch = ARCH; compression = "none"; load = ; entry = ; @@ -62,6 +70,7 @@ missing-msg = "atf-bl31-sunxi"; }; }; +#endif #if CONFIG_SUNXI_SCP_BASE scp { @@ -90,7 +99,11 @@ @config-SEQ { description = "NAME"; +#if CONFIG_SUNXI_BL31_BASE firmware = "atf"; +#else + firmware = "uboot"; +#endif #if CONFIG_SUNXI_SCP_BASE loadables = "scp", "uboot"; #else From patchwork Sun Jan 22 21:15:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1730199 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm1 header.b=OwnrAfmh; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=prBeESpi; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P0Qys08srz23gd for ; Mon, 23 Jan 2023 08:16:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 737EC856D1; Sun, 22 Jan 2023 22:16:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="OwnrAfmh"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="prBeESpi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 951FD84474; Sun, 22 Jan 2023 22:15:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 17EA784FD1 for ; Sun, 22 Jan 2023 22:15:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D0AD532005BC; Sun, 22 Jan 2023 16:15:40 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 22 Jan 2023 16:15:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1674422140; x=1674508540; bh=aV BCHN7sT/vtd+2n2JH92BQ8WC6W7Df1Q9zl90/+PoY=; b=OwnrAfmhfPWkFTy55s gzgfj/WAj5hrxdvaDfhAW376UOQ0/pL8CnVApEvhuXuYjb3aOLS7yHSDBtD/gWLl Hybn7Y9alKPczL0Ws7+Xa9cmEntW1EvpKemr7/grM/ZctcESQ0ZRlfCL0YV74IYd +/QuKANtlk64Czp0Ri/PkVwG0NcMJWP4vJX0USUDr5jyvmZib4NW/Ug3BA1EtcO+ PugeoMY8ZUvqJm67GNqHMSWoMXvmkmOoNbVsyyEqdFVJVdkA/m1r8BCmaRLmj0WE aRO9u4zsNedSwspnttf2NsOM1hv2CTGW7wXDlBDQcV31fmOt1zrEqK2Sl54jfXG0 BxAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1674422140; x=1674508540; bh=aVBCHN7sT/vtd +2n2JH92BQ8WC6W7Df1Q9zl90/+PoY=; b=prBeESpi57THIpXSX+J2dRSm/4O7k W08JvVc0hZxsvhYvUIhvOK+X8cDGsC92kyqEwY4KEm82DDsRZudkqCrjMT4O00jA A0CqW7eR5GWUzuhiqlfDAeT3Z/i98M1/Jqi6alm6qXm69x1MPcrXi54E/uAb5wYi 6Cfk012urnHdy/03sIH4xL2yNa0c0wMD1zhxQDTfPplK53S16NAdqmlPHVHDasH8 +kEObm0ZIlb+Ph6S2FyOTPGZgPXdH4m6aci1LJZjAMJbMCg1KKS1xEuSRFq0wkkX nzLkxkb2rQysZC+3dmVPwnVtT+XKKQiPWqxdgTJ1BJbsBVu7psr/Noo/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduiedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeeh gfdufeeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Jan 2023 16:15:39 -0500 (EST) From: Samuel Holland To: Andre Przywara , Jagan Teki Cc: Jesse Taube , Icenowy Zheng , u-boot@lists.denx.de, Samuel Holland Subject: [PATCH v2 4/4] sunxi: Enable SPL FIT loading for 32-bit SoCs Date: Sun, 22 Jan 2023 15:15:30 -0600 Message-Id: <20230122211531.23181-5-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230122211531.23181-1-samuel@sholland.org> References: <20230122211531.23181-1-samuel@sholland.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Now that 32-bit SoCs can load U-Boot proper (and possibly other firmware) from a FIT, use this method by default. SPL_FIT_IMAGE_TINY is required to stay within the 24 or 32 KiB SPL size limit on early SoCs; for consistency, enable it everywhere. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2, split from the .dtsi changes arch/arm/Kconfig | 1 + common/spl/Kconfig | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c9a44ebc22..f150bc3903 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1135,6 +1135,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/common/spl/Kconfig b/common/spl/Kconfig index a7c55f8c4c..502b0f27b8 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -575,8 +575,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 || ARCH_IMX9 + default y if ARCH_IMX8M || ARCH_IMX9 || 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.