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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 758B4EB64DC for ; Tue, 27 Jun 2023 19:11:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD3DA86601; Tue, 27 Jun 2023 21:10:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="Em9fbDgJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 726E2865F5; Tue, 27 Jun 2023 21:10:46 +0200 (CEST) Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1770C865F4 for ; Tue, 27 Jun 2023 21:10:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=cVVlhUI2qx/ogik/kjsDlJlpG8bDtPzhfyixU73Jjns=; b=Em9fbDgJeMIjB/TQYXev8fHEicd3U83N6AVMe0foc/Le5VJiasXs5tRGuwdroaZAs+Yy aopD2HQK3UTYAPRnUzofsAc91TOGIqWenU/lIBatMib4dnmZuGjL65/CoFdO0yn4Rthaul BFmt233zCAl0b6NRN/d1lsQccH0IbuidDSSo/s04dtp/EhlQg33e/ubg/3l2eP+JODhEiY wqLuvwqLaGpvHJzYWaREMxUzhT4C0QfbUG/m+5TfKoaZjwwo1jQc2IGh/XpmC4chY+oSBY 4d4mG7mBk3O5Qaw8k9SLJCFSzoi1hwD+xwdMGfR+0+DVcx0RfUmZHblemiTivW0g== Received: by filterdrecv-65f68489c8-nnkmt with SMTP id filterdrecv-65f68489c8-nnkmt-1-649B342D-3A 2023-06-27 19:10:37.619386108 +0000 UTC m=+4131267.391765056 Received: from bionic.localdomain (unknown) by geopod-ismtpd-9 (SG) with ESMTP id 8arebog2SyimUanVMrZvMQ Tue, 27 Jun 2023 19:10:37.394 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 1/5] rockchip: rk3399-rockpro64: Fix SPL max size and SPI flash payload offset Date: Tue, 27 Jun 2023 19:10:37 +0000 (UTC) Message-ID: <20230627191034.2093823-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627191034.2093823-1-jonas@kwiboo.se> References: <20230627191034.2093823-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hy1tOhQNzilMB0f86?= =?us-ascii?Q?Lq+9BeERIk3dTS1tshdApwJnb76K1rW2lr=2FTlWZ?= =?us-ascii?Q?pDG1xR2iPjJrJnMtsDVwcNycNs3Um9M+aq02wqH?= =?us-ascii?Q?TCuN0qx+t7Cm+fJXLHSDtjeHALArXOjRiC6fAB+?= =?us-ascii?Q?CfqIkkVWEKKlkoCSYzyyJNo4vgjvc6jjS=2F72tr?= To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Peter Robinson , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 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.8 at phobos.denx.de X-Virus-Status: Clean TPL max size is limited to 184 KB, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, this limit SPL max size to 256 KB. With BootRom only reading first 2 KB per 4 KB page of SPI flash, 880 KB may be needed for TPL+SPL in a worst-case scenario. (184 KB + 256 KB) x 2 = 880 KB Use 0xE0000 (896 KB) as the payload offset in SPI flash, this allows for a payload of 3168 KB before env offset start to overlap. Also remove CONFIG_LTO=y now that there is sufficient space for SPL in SPI flash, and to fix a build issue reported by Peter Robinson. Fixes: 5713135ecc75 ("rockchip: rockpro64: Build u-boot-rockchip-spi.bin") Reported-by: Peter Robinson Signed-off-by: Jonas Karlman --- arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 4 ---- configs/rockpro64-rk3399_defconfig | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi index bd864d067018..732727d9b036 100644 --- a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi +++ b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi @@ -9,10 +9,6 @@ chosen { u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdmmc, &sdhci; }; - - config { - u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ - }; }; &sdhci { diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig index dc4392c7451c..2f1ab1c28864 100644 --- a/configs/rockpro64-rk3399_defconfig +++ b/configs/rockpro64-rk3399_defconfig @@ -21,7 +21,6 @@ CONFIG_SPL_SPI=y CONFIG_SYS_LOAD_ADDR=0x800800 CONFIG_PCI=y CONFIG_DEBUG_UART=y -CONFIG_LTO=y CONFIG_SPL_FIT_SIGNATURE=y CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_BOOTSTAGE=y @@ -30,7 +29,7 @@ CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb" CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_MISC_INIT_R=y -CONFIG_SPL_MAX_SIZE=0x2e000 +CONFIG_SPL_MAX_SIZE=0x40000 CONFIG_SPL_PAD_TO=0x7f8000 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y CONFIG_SPL_BSS_START_ADDR=0x400000 @@ -40,7 +39,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x2000 CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 CONFIG_SPL_SPI_LOAD=y -CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000 +CONFIG_SYS_SPI_U_BOOT_OFFS=0xE0000 CONFIG_TPL=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPT=y -- 2.41.0