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 C685CC4332F for ; Tue, 19 Apr 2022 15:26:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B49283E1B; Tue, 19 Apr 2022 17:26:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="ksGMuEVY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4836783E1D; Tue, 19 Apr 2022 17:26:11 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7AA1D83DF8 for ; Tue, 19 Apr 2022 17:26:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=a-govindraju@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 23JFQ5bd006009; Tue, 19 Apr 2022 10:26:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1650381965; bh=CCvdsf/vvx+qTzOAhoE7hQ4VTJa9+zbaVxOV7zs9xYk=; h=From:To:CC:Subject:Date; b=ksGMuEVY2TyoDI+Quh10BdaFxKVsfIxIAx+TwZ1Q2petJuw9dU6TJg60Rege1Bjry ZIQ041yCIMczR/Qor3qM4fja+ldfS/rCy2JQ3bo/Xfx7uAE3Kw3wdpkK3YJJr31Bjr qAy3CTQxZr5W0z8AzC4hrLSeEzFOFRPHwyxEq8kQ= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 23JFQ5Bb028915 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Apr 2022 10:26:05 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 19 Apr 2022 10:26:05 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Tue, 19 Apr 2022 10:26:05 -0500 Received: from gsaswath-HP-ProBook-640-G5.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 23JFQ2Xx011076; Tue, 19 Apr 2022 10:26:03 -0500 From: Aswath Govindraju To: CC: , Tom Rini , Dave Gerlach , Vignesh Raghavendra , Praneeth Bajjuri , Aswath Govindraju Subject: [PATCH] include: configs: am**x/j721e/j721s2_evm.h: Move the stack pointer init address in arm64 Date: Tue, 19 Apr 2022 20:56:02 +0530 Message-ID: <20220419152602.6644-1-a-govindraju@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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.5 at phobos.denx.de X-Virus-Status: Clean Currently, in case of arm64 bootloader and U-Boot the stack pointer is initialized at an offset of NON_SECURE_MSRAM_SIZE from arm64 SPL's text base address. After jumping to arm64, execution is done out of DDR. Therefore, having an offset corresponding to the size of MSRAM does not have any significance. Instead, initialize the stack pointer after an offset of 4MB from the SPL text base address. This helps in allocating larger memory for stack. ┌────────────────────┐0x80080000 │ │ │ arm64 SPL │ ├────────────────────┤ │ ▲ │ │ │ │ │ STACK │ ├────────────────────┤0x80480000 │ Memory for Load │ │ Buffer Allocation │ ├────────────────────┤0x80800000 │ │ │ U-Boot Image │ │ │ └────────────────────┘ Signed-off-by: Aswath Govindraju --- Notes: - Verified SD and DFU boot modes on platforms where this change will have an effect and are supported - AM64 - SD boot mode, https://pastebin.ubuntu.com/p/YDBjhTqwSK/ - DFU boot mode, https://pastebin.ubuntu.com/p/Xsjn4h7h2W/ - "Error setting up memory banksize. -22" This error was present even without the changes done by this patch - J721e - SD boot mode, https://pastebin.ubuntu.com/p/NpVvKjMMxc/ - DFU boot mode, https://pastebin.ubuntu.com/p/MZPS4Wmkj5/ - J7200 - SD boot mode, https://pastebin.ubuntu.com/p/QyyC8WFsS2/ - DFU boot mode, https://pastebin.ubuntu.com/p/Nmjf3mVRyH/ - J721s2 - SD boot mode, https://pastebin.ubuntu.com/p/xh96CP8ndB/ - AM654 - SD boot mode, https://pastebin.ubuntu.com/p/DbFjFSvj2C/ include/configs/am64x_evm.h | 3 +-- include/configs/am65x_evm.h | 3 +-- include/configs/j721e_evm.h | 3 +-- include/configs/j721s2_evm.h | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h index 135cb3c2ee20..d84a8db97ede 100644 --- a/include/configs/am64x_evm.h +++ b/include/configs/am64x_evm.h @@ -24,8 +24,7 @@ #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE #if defined(CONFIG_TARGET_AM642_A53_EVM) -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \ - CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + SZ_4M) #else /* * Maximum size in memory allocated to the SPL BSS. Keep it as tight as diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h index 55fa6419e33d..b1f9050f3f5b 100644 --- a/include/configs/am65x_evm.h +++ b/include/configs/am65x_evm.h @@ -19,8 +19,7 @@ /* SPL Loader Configuration */ #ifdef CONFIG_TARGET_AM654_A53_EVM -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \ - CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + SZ_4M) #else /* * Maximum size in memory allocated to the SPL BSS. Keep it as tight as diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index df3c16540ba3..2590ee6b0140 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -20,8 +20,7 @@ /* SPL Loader Configuration */ #if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM) -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \ - CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + SZ_4M) #define CONFIG_SYS_UBOOT_BASE 0x50280000 /* Image load address in RAM for DFU boot*/ #else diff --git a/include/configs/j721s2_evm.h b/include/configs/j721s2_evm.h index f0d56b8778ee..a5505f079b43 100644 --- a/include/configs/j721s2_evm.h +++ b/include/configs/j721s2_evm.h @@ -21,8 +21,7 @@ /* SPL Loader Configuration */ #if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM) -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \ - CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + SZ_4M) #define CONFIG_SYS_UBOOT_BASE 0x50280000 /* Image load address in RAM for DFU boot*/ #else -- 2.17.1