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 AE0C1C0015E for ; Fri, 28 Jul 2023 11:38:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50C42868D7; Fri, 28 Jul 2023 13:38:49 +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="EydbTUhz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D58E4868C4; Fri, 28 Jul 2023 13:38:38 +0200 (CEST) Received: from wfbtzhsv.outbound-mail.sendgrid.net (wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) (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 25BFE868AE for ; Fri, 28 Jul 2023 13:38:36 +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=Bv7J/7huL6qWNe0t44SU0W+d/Y6vmXR075l845H4cMI=; b=EydbTUhz1irr/glSBh9gtOrpchuxe3qLTpmROKcBQ3UQIMlDflf2GapiUA4chWGvXQz2 WE21bg1Ij0Z4xy+sN7xf5z3k4TQjIHVnkwKOdH2QxcVSFkbXbJcZ7vHJFz7clTdBvK16Lc DqGVBAvWDnTPVWAhaL0ZY63+V1I8HALAfJMI0tOtb/NgjC/5WqpsFJSGD960jur6AR45pL UMGPUZidWtzdXOeZkSczGkpOARHY96HqowT5EkP+O1wIlTqWk5gbKPac+Yqgq4HN+LcSd2 of9HWd9TR7Qkl17nNHFQSPBsHIZyU63hJ+cMVJeaGup5wTb5FwQOXawO5EsLMAiw== Received: by filterdrecv-65f68489c8-nnkmk with SMTP id filterdrecv-65f68489c8-nnkmk-1-64C3A8BA-11 2023-07-28 11:38:34.350751955 +0000 UTC m=+6782556.286885017 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id iqn4jB56TLu4XcRKNoPbmA Fri, 28 Jul 2023 11:38:34.048 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 1/5] rockchip: rk3399-rockpro64: Fix SPL max size and SPI flash payload offset Date: Fri, 28 Jul 2023 11:38:34 +0000 (UTC) Message-ID: <20230728113830.1731793-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230728113830.1731793-1-jonas@kwiboo.se> References: <20230728113830.1731793-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h7HOQSRvU4atHxrOP?= =?us-ascii?Q?mKmTn=2FR6jFgGniMpUHw4zSJ3+Dh+tAQxhTV0EEi?= =?us-ascii?Q?qNBSMO1SewihVzGuAQ11190vtcH1g=2FQelffU1cF?= =?us-ascii?Q?cXr87CDvldWb6i3CLKDwri50oXOVRRWTqTaooMy?= =?us-ascii?Q?29VZGtRUOteeBlV7mAa0Ra6ccCXdKnt=2FzjlE9P?= To: Kever Yang , Simon Glass , Philipp Tomsich , Akash Gajjar , Jagan Teki , Jonas Karlman Cc: Peter Robinson , Quentin Schulz , u-boot@lists.denx.de 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 Reviewed-by: Quentin Schulz --- v2: - Rebase on u-boot-rockchip/master - Collect r-b tags 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 62daad27a6f8..4cd6b76665bd 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_SPL_ATF_NO_PLATFORM_PARAM=y CONFIG_TPL=y CONFIG_CMD_BOOTZ=y -- 2.41.0