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 D5B88C001E0 for ; Fri, 28 Jul 2023 11:39:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B8EB8868D6; Fri, 28 Jul 2023 13:38:52 +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="fjJEcHyF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 08827867B2; Fri, 28 Jul 2023 13:38:40 +0200 (CEST) Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) (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 42D73867B2 for ; Fri, 28 Jul 2023 13:38:37 +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=5Fj0SHrF1VbBscYceKVicW3IVlhb8o2cZttcbclRIYE=; b=fjJEcHyFsyJMptB+Td3OXsRUmHMDIvh5Cxj/ROJGsR3fVhsJTCaoV7W5yhGD+OYSA4aF Kf9nAGqxQJ8FXmYPYpZURDFVE7IasieCZNPxWyD1p/citkB1GIR+5jZvc3/EfXjTaxQDj1 th9onXL2zKuy8OPLZpUW8NjL9DwcaMQW6UlYWYNSlJJAZZyPtvBX8/cduEOY170hB3AIN9 2tTp/yMrSHlV7iiNqFXCR94euQmMpgxIUQlOnwG6+6rnvaJi6sdI5+kvBLAyUdi4Umc514 BGMV3GKxcw1o7Em0Y9qsHR+3AA+v+xN5AH03kVrXgaaZD7Q9hlaDsYUkn/UdDTgw== Received: by filterdrecv-65f68489c8-knmdt with SMTP id filterdrecv-65f68489c8-knmdt-1-64C3A8BB-1B 2023-07-28 11:38:35.545774744 +0000 UTC m=+6782557.481710990 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id I2UD2Wi6R9eNRJZYT12cNA Fri, 28 Jul 2023 11:38:35.338 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 2/5] rockchip: rk3399-pinebook-pro: Fix SPL max size and SPI flash payload offset Date: Fri, 28 Jul 2023 11:38:35 +0000 (UTC) Message-ID: <20230728113830.1731793-3-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+RrMu3cja6a0h8uOC8H2NFdqzKiRD?= =?us-ascii?Q?1gz5LGtFl0lWlL5BHaE500dkIkG0lcAFTOC+VyQ?= =?us-ascii?Q?K8uwIsZJmamgaRiaq1dZMskEDw1kIqb6ezHb0Yr?= =?us-ascii?Q?XxJrtf+CG1W8zUGM2j=2FOtzFVWP7IpKV6Xe9tNMr?= =?us-ascii?Q?tQ5zrulAIrMuAFHctvdgBiWw5tOgORg9raczRB?= To: Kever Yang , Simon Glass , Philipp Tomsich , Peter Robinson Cc: Quentin Schulz , 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 add CONFIG_ROCKCHIP_SPI_IMAGE=y to build a bootable SPI flash image, u-boot-rockchip-spi.bin. Signed-off-by: Jonas Karlman Reviewed-by: Quentin Schulz --- v2: - Rebase on u-boot-rockchip/master - Collect r-b tags arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 4 ---- configs/pinebook-pro-rk3399_defconfig | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi index ea7a5a17ae0f..88a77cad8d43 100644 --- a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi +++ b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi @@ -10,10 +10,6 @@ chosen { u-boot,spl-boot-order = "same-as-spl", &sdhci, &spiflash, &sdmmc; }; - - config { - u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ - }; }; &edp { diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig index 5d493c910ee8..ae3211bbe9c4 100644 --- a/configs/pinebook-pro-rk3399_defconfig +++ b/configs/pinebook-pro-rk3399_defconfig @@ -12,6 +12,7 @@ CONFIG_ENV_OFFSET=0x3F8000 CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" CONFIG_DM_RESET=y CONFIG_ROCKCHIP_RK3399=y +CONFIG_ROCKCHIP_SPI_IMAGE=y CONFIG_TARGET_PINEBOOK_PRO_RK3399=y CONFIG_SPL_STACK=0x400000 CONFIG_DEBUG_UART_BASE=0xFF1A0000 @@ -26,7 +27,7 @@ CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.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 @@ -36,6 +37,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=0xE0000 CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y CONFIG_TPL=y CONFIG_CMD_BOOTZ=y -- 2.41.0