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 D4758EB64DC for ; Tue, 27 Jun 2023 19:11:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12A6D86617; Tue, 27 Jun 2023 21:11:03 +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="oJUkzeIh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 94E57865F4; 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 6C4FE86600 for ; Tue, 27 Jun 2023 21:10:40 +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=PW4pEIMmIwZf1MCism9Qa64MmY1Hwiydb+HwEn3OP0U=; b=oJUkzeIhT41+6nuzaNSZ6hZXUqROi3dfneE1MowNCitW3RYcpCVl6mJIQE6JY53wCGMV x1/jnFsotQjBOmOEFyrAo7mmuejL37Y0WNuTj2Gu/4Wy0FNKZ9n1mQA6h3kqhKYhSEepED rrC1YDka4Z6vMTA53kFMujZXfVsJNZ6a65gOZsxZe+nV44NGDy4S/hCQLuvGhjxghuDFxi Hami6XhOBlNvgwSUzuHII7L8Vs5gMmCnRkq01K5mXoOYaxuiyLNb3oytVNjvdvjJq1Mt5s Buvq+pChgWlq+UTvcwQ+fMvbCkTm6g1Q5qgxzzREvpnPQV6udoya7B7fcNLamHTw== Received: by filterdrecv-65f68489c8-lsfh9 with SMTP id filterdrecv-65f68489c8-lsfh9-1-649B342D-3A 2023-06-27 19:10:37.977078707 +0000 UTC m=+4131278.809180278 Received: from bionic.localdomain (unknown) by geopod-ismtpd-9 (SG) with ESMTP id D-PZsZgLQ_-37WOHrSNdvA Tue, 27 Jun 2023 19:10:37.783 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 3/5] rockchip: rk3399-pinephone-pro: Fix SPL max size and SPI flash payload offset Date: Tue, 27 Jun 2023 19:10:38 +0000 (UTC) Message-ID: <20230627191034.2093823-4-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+RrMu3cja6a0h3LBDJJ55GnONOCWT?= =?us-ascii?Q?faYShlKvBIcYvnSzhkT0KowvyEdNSt8g+PofzDQ?= =?us-ascii?Q?IkrG6M7F1aVraXhTt23SorHo+psqcnP05fChTWm?= =?us-ascii?Q?9dTG9yD5WFBJoKyPhBcu+JwohkSzfpIsPLPkQJI?= =?us-ascii?Q?5lNUwtpN0KxqHUIEwQftMMeauS=2Fc6XFnOjSYNa?= 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 add CONFIG_ROCKCHIP_SPI_IMAGE=y to build a bootable SPI flash image, u-boot-rockchip-spi.bin. Signed-off-by: Jonas Karlman --- arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi | 4 ---- configs/pinephone-pro-rk3399_defconfig | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi index 347243fe4793..cabf0a9dae89 100644 --- a/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi +++ b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi @@ -10,10 +10,6 @@ chosen { u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; }; - - config { - u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ - }; }; &rng { diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig index e4a8beeb1abb..b09211f4eb6e 100644 --- a/configs/pinephone-pro-rk3399_defconfig +++ b/configs/pinephone-pro-rk3399_defconfig @@ -12,6 +12,7 @@ CONFIG_ENV_OFFSET=0x3F8000 CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinephone-pro" CONFIG_DM_RESET=y CONFIG_ROCKCHIP_RK3399=y +CONFIG_ROCKCHIP_SPI_IMAGE=y CONFIG_TARGET_PINEPHONE_PRO_RK3399=y CONFIG_SPL_STACK=0x400000 CONFIG_DEBUG_UART_BASE=0xFF1A0000 @@ -25,7 +26,7 @@ CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinephone-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 @@ -35,6 +36,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_TPL=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPIO=y -- 2.41.0