From patchwork Thu Feb 28 20:33:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1049749 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YZphzRiL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 449PR53tFQz9s70 for ; Fri, 1 Mar 2019 07:34:07 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id BF9E9C21E44; Thu, 28 Feb 2019 20:33:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 372CFC21C57; Thu, 28 Feb 2019 20:33:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B3424C21C3F; Thu, 28 Feb 2019 20:33:54 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id 4E722C21C27 for ; Thu, 28 Feb 2019 20:33:54 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id i12so23512355wrw.0 for ; Thu, 28 Feb 2019 12:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=PIe9d/jzJqg/CPcgl0mCy5v0GpoJXa6hXQ8IlQJaMWo=; b=YZphzRiLmYbx1tya+QEgX3ZEgAxTMVCwhLbYObUuJPxyrGOlky18E16rDIg7NkI+8b 1rUeulUljpjTDZZfQaPVtNApabo6n+pXqXd9Lk84SkDsIpJrsgSBAMCA5gRjdbHpMtAV t9bEyK55w1aTbyTeqjwQJ2CXhB24LMBcQ4CHSfh1J+NRgYNSGGjDI/hiQCALzs2O86LF M6x6DFUr9/Wp6qtLTP/wZrNZmv5UMvHhjkby33GUWCw6KNK3OefvMOuXi7OScA920NHY 9JqjLB4vjKMaG6evzBFwECPyicyg9zTJP6XmlYWsHMY2mt3gCmJ6Nwh70+qumey1qwit XKnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PIe9d/jzJqg/CPcgl0mCy5v0GpoJXa6hXQ8IlQJaMWo=; b=FNiR/2ic47/JZl0dRH2lsKASWIhsq8exCHlPsaw3zwWhOD4rYfXduwHjs6fAsBlwJ7 c5xXtvrtvUrh+uTqvoApnFuBY0Pw/ACbaBUhRe0XscZqWfFa0b1mAlln1+ez3e+Y5ghn mqMcmmdjH5xyaFIumHrYceze6SJT9KVDJDLZL1/COs7NtC7lecGv4MYUWexWTX65DMbc nxDefpc/l+Hu7NkAPyZ6kXpoHCwhqNOFWsYkKqJF6JOSj74AsW04KO3KwAs0Xj+CWEm4 S2XnmE1lLFnpCbcOwK5UqL60GWsvNtfvtXa8TQYOJr5FjDCIUaqHFohHToLoIXt2XwJb yruA== X-Gm-Message-State: APjAAAWkWxAk/nUO+Cbw6N8npT5a26JbblSgTrxpV6WRXI/+vSz2d18F fP3tg6xfbt3i5Ec7h2U1xZY= X-Google-Smtp-Source: APXvYqxzsFOgYKRuInbn6awQ9GN3legnHuJ4KFxHGcT/io7uaI1R5NFREKHeAT84DfgdlhU59ezCJw== X-Received: by 2002:a5d:474f:: with SMTP id o15mr919897wrs.70.1551386033830; Thu, 28 Feb 2019 12:33:53 -0800 (PST) Received: from ubuntu.home ([2a02:8071:6a3:700:9065:254c:ff38:3288]) by smtp.gmail.com with ESMTPSA id f7sm17608742wru.3.2019.02.28.12.33.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 12:33:53 -0800 (PST) From: Simon Goldschmidt To: Marek Vasut , u-boot@lists.denx.de Date: Thu, 28 Feb 2019 21:33:46 +0100 Message-Id: <20190228203348.28424-1-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: Tien Fong Chee , Tom Rini , Stefan Roese Subject: [U-Boot] [PATCH 1/3] arm: socfpga: fix comment about SPL memory layout X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The comment about SPL memory layout for socfpga gen5 is outdated: the initial malloc memory is now at the end of the SRAM, gd is below it (see board_init_f_alloc_reserve). Signed-off-by: Simon Goldschmidt --- include/configs/socfpga_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index c9cbf8f5e3..a3fbca0a5d 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -237,9 +237,9 @@ unsigned int cm_get_qspi_controller_clk_hz(void); * * 0xFFFF_0000 ...... Start of SRAM * 0xFFFF_xxxx ...... Top of stack (grows down) - * 0xFFFF_yyyy ...... Malloc area - * 0xFFFF_zzzz ...... Global Data - * 0xFFFF_FF00 ...... End of SRAM + * 0xFFFF_yyyy ...... Global Data + * 0xFFFF_zzzz ...... Malloc area + * 0xFFFF_FFFF ...... End of SRAM * * SRAM Memory layout for Arria 10: * 0xFFE0_0000 ...... Start of SRAM (bottom) From patchwork Thu Feb 28 20:33:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1049753 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gGnxTK7N"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 449PRm5QPhz9sMQ for ; Fri, 1 Mar 2019 07:34:44 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 4805DC21E68; Thu, 28 Feb 2019 20:34:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AB7E3C21E16; Thu, 28 Feb 2019 20:33:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 72905C21DAF; Thu, 28 Feb 2019 20:33:56 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id 1090CC21C3F for ; Thu, 28 Feb 2019 20:33:56 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id i16so23415591wrs.13 for ; Thu, 28 Feb 2019 12:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OQMB6T0EeFvWY4MC72DEpOJ2hflQPD5d7CJoLnLNgQw=; b=gGnxTK7NjSbEDPV0dEninBmrANdsJdQ11TMOIK3LilYdNDv9Iex78lzIlwFHwEBIJ3 q9b9Ky0vwvNVxtbOYbc7uRX4WBUXKKjvs5equAzqBTP9egSUMakEAqEsiSkFoHwTb6Eq ijiWE7S9e/KTnZuIHlM2UZgqOqwE1k6pUdk2ClRtwbYFUl6LftY4p82k2kbVpP5cNVPa u0+QLjCPYsI+ygXC4eNKBXKJ9ZbZh9tYzbDk0drYhHTpmKzo+KNzW/Bnpc+SuB9w70kd VcTqjcIS50hUZCOjful1OQ6LjzrOPKii53cxaY65S73nR+Y1SUdHUSMxx4slGj0a1HJY I39g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OQMB6T0EeFvWY4MC72DEpOJ2hflQPD5d7CJoLnLNgQw=; b=hDwbUBCsmKHozHn130fT3CtXC5KDtaj0Zwj4LlP8GfZUx8gf+0Hv/0lKNjJ7hB/RrH nyQ4ATFx8Awyp8sfQMB9nsY3r0z9wxb6H1eV5Ls+bVXi/mpb3QHyB8KXWlYFKNW9cU/S HcANtM9GR6ewMurVFmr29zaQzBfM78xRuKUN3q65RCV+cmXFBMCaTrclX1G14wQrRNyd gLWnoKrb5vA4x17Q/KQ4c01sZ+UXnS5WD4gd1GuKKknjf1oBUv7moRtuxqze8rCZKyEk 133wBc6y1NZuK+l+YzZvh9Jpfz2sSM5BCaENKFGavCWbbvittVWgNxIuz9w03oXyO8lb WjfQ== X-Gm-Message-State: APjAAAWp2oMDoVe2nO6MM7oQZaWbT32La4znwoMICCASAWPHHk7H9uS6 wswl/FPVPxUCARgI1eLbANU= X-Google-Smtp-Source: APXvYqwPG9lPDDSbDx5LZLBoVPaMU5TIYbzKZpbpy00TRQjTWLYsEMlayIYkeza8znsarZP7rcBCHw== X-Received: by 2002:adf:f145:: with SMTP id y5mr941244wro.240.1551386035038; Thu, 28 Feb 2019 12:33:55 -0800 (PST) Received: from ubuntu.home ([2a02:8071:6a3:700:9065:254c:ff38:3288]) by smtp.gmail.com with ESMTPSA id f7sm17608742wru.3.2019.02.28.12.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 12:33:54 -0800 (PST) From: Simon Goldschmidt To: Marek Vasut , u-boot@lists.denx.de Date: Thu, 28 Feb 2019 21:33:47 +0100 Message-Id: <20190228203348.28424-2-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190228203348.28424-1-simon.k.r.goldschmidt@gmail.com> References: <20190228203348.28424-1-simon.k.r.goldschmidt@gmail.com> Cc: Tom Rini , Tien Fong Chee , Chin-Liang See , Stefan Roese Subject: [U-Boot] [PATCH 2/3] arm: socfpga: a10: move SPL stack size to Kconfig X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Instead of fixing the SPL stack to 64 KiB in the board config header via CONFIG_SYS_SPL_MALLOC_SIZE, let's just use CONFIG_SPL_SYS_MALLOC_F_LEN in the defconfig. This also has the advandage that it removes sub-mach specific ifdefs in socfpga_common.h. Signed-off-by: Simon Goldschmidt --- configs/socfpga_arria10_defconfig | 1 + include/configs/socfpga_common.h | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/configs/socfpga_arria10_defconfig b/configs/socfpga_arria10_defconfig index f321a0ac3b..8d0479cc05 100644 --- a/configs/socfpga_arria10_defconfig +++ b/configs/socfpga_arria10_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_ARCH_SOCFPGA=y CONFIG_SYS_TEXT_BASE=0x01000040 CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_SPL_SYS_MALLOC_F_LEN=0x10000 CONFIG_TARGET_SOCFPGA_ARRIA10_SOCDK=y CONFIG_SPL=y CONFIG_IDENT_STRING="socfpga_arria10" diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index a3fbca0a5d..c23b34186a 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -251,16 +251,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_SPL_TEXT_BASE CONFIG_SYS_INIT_RAM_ADDR #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_INIT_RAM_SIZE -#if defined(CONFIG_TARGET_SOCFPGA_ARRIA10) -/* SPL memory allocation configuration, this is for FAT implementation */ -#ifndef CONFIG_SYS_SPL_MALLOC_START -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00010000 -#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_INIT_RAM_SIZE - \ - CONFIG_SYS_SPL_MALLOC_SIZE + \ - CONFIG_SYS_INIT_RAM_ADDR) -#endif -#endif - /* SPL SDMMC boot support */ #ifdef CONFIG_SPL_MMC_SUPPORT #if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4) @@ -287,11 +277,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void); /* * Stack setup */ -#if defined(CONFIG_TARGET_SOCFPGA_GEN5) #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR -#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10) -#define CONFIG_SPL_STACK CONFIG_SYS_SPL_MALLOC_START -#endif /* Extra Environment */ #ifndef CONFIG_SPL_BUILD From patchwork Thu Feb 28 20:33:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1049760 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NuY3JfD1"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 449PSS6Dmnz9s70 for ; Fri, 1 Mar 2019 07:35:20 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 7D84CC21E31; Thu, 28 Feb 2019 20:34:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 576CDC21C27; Thu, 28 Feb 2019 20:34:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8B51EC21E4F; Thu, 28 Feb 2019 20:33:58 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id 4734CC21D72 for ; Thu, 28 Feb 2019 20:33:56 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id n2so23443768wrw.8 for ; Thu, 28 Feb 2019 12:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qz0eR18z4xgGjIUJ47NQ6qEIxvRJ/odC2XtFlw8dHl4=; b=NuY3JfD1yM/cD5+ZYPuiEEdksFnch3UcW1ihQS5ToaQSLUoHEQGYCXQlld6j9wlQPF kos1sqBtrVlFghSpR7HvObiQ5cb/FtmNvpCayNEfjh1pVmpEV+lfwdonwcs5IasNPGmW ZpeGuI1tsnOzWSQ/qyeS8E1bAPMvnvlC4GhYsQ2VrVwVv1lHoDvdWBwITDv1rrEmH9Qi 8RPXqMKKuRV2s4oEhme2N6f9JfWqr6CefeSQ/pejlrshn4OzpGbRObclpbBP/bagVOSW NRF2ntQUql2k17wpnKRLIlovXn6k/3LQBwsXtPl23Zko4PsIUSZv1ev7moiH8s66GoYD BkFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qz0eR18z4xgGjIUJ47NQ6qEIxvRJ/odC2XtFlw8dHl4=; b=s2QW6euGqK7eS5nMAc4cSBSyrJMSQdCTJPNQiGuYN0zmlDx96Rf49u1vA6Hf21bD64 u4bCDPc67eh4r6Uzv4T7tYCXNmTJkXEHWyqHxM/e5XzXs91UIQYRnn1SMzhxOwIf3jP8 cxl7voSjqXtU7ni8FPOtOkkLgv1J6fqgHdrSYWouB5DAsCmP7dhxpbUQ42yU8weujRpM mrwHiSD2QvK9oFhR44Q/40ob6FuLMTorowPAQ5C2NCa1hePJa4S8mg/WHU0EFhWka1rJ mImv1Yd2Y7njugg803zKyNuQg/WHYM12nEkAD9InaZbMLx92fEWk4k97Fly72elfL5wn EIVA== X-Gm-Message-State: APjAAAXpYc1WsZga/Z3sJ1qwPGeZz6EtUiE0Bn4qnESEbPHUtor5uX/K bvjlBWHoIIzR3DKnOpgbc9E= X-Google-Smtp-Source: APXvYqzgNWsIa/a3TpJcrDCODJJt8hrz3T9aUh24ANLCi6TjnBiGSkLomETkTVEXso4gcCnZpdCWDA== X-Received: by 2002:adf:b211:: with SMTP id u17mr919831wra.322.1551386035904; Thu, 28 Feb 2019 12:33:55 -0800 (PST) Received: from ubuntu.home ([2a02:8071:6a3:700:9065:254c:ff38:3288]) by smtp.gmail.com with ESMTPSA id f7sm17608742wru.3.2019.02.28.12.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 12:33:55 -0800 (PST) From: Simon Goldschmidt To: Marek Vasut , u-boot@lists.denx.de Date: Thu, 28 Feb 2019 21:33:48 +0100 Message-Id: <20190228203348.28424-3-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190228203348.28424-1-simon.k.r.goldschmidt@gmail.com> References: <20190228203348.28424-1-simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee , Tom Rini , Stefan Roese Subject: [U-Boot] [PATCH 3/3] arm: socfpga: put initial U-Boot stack into DDR X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If SPL pre-reloc stage puts the stack into DDR, U-Boot should be able to do that, too. The reason to do so is that this way, U-Boot initial stack can be larger than SPL initial stack. In situations where we want to save the SPL in SRAM for next boot without reloading, this prevents overwriting the SPL DTB in SRAM if U-Boot stack usage gets too high. Signed-off-by: Simon Goldschmidt --- include/configs/socfpga_common.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index c23b34186a..7ae3db233f 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -38,12 +38,23 @@ #if ((CONFIG_SYS_BOOTCOUNT_ADDR > CONFIG_SYS_INIT_RAM_ADDR) && \ (CONFIG_SYS_BOOTCOUNT_ADDR < (CONFIG_SYS_INIT_RAM_ADDR + \ CONFIG_SYS_INIT_RAM_SIZE))) -#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_BOOTCOUNT_ADDR +#define CONFIG_SPL_STACK CONFIG_SYS_BOOTCOUNT_ADDR #else -#define CONFIG_SYS_INIT_SP_ADDR \ +#define CONFIG_SPL_STACK \ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE) #endif +/* + * U-Boot stack setup: if SPL post-reloc uses DDR stack, use it in pre-reloc + * phase of U-Boot, too. This prevents overwriting SPL data if stack/heap usage + * in U-Boot pre-reloc is higher than in SPL. + */ +#if defined(CONFIG_SPL_STACK_R_ADDR) && CONFIG_SPL_STACK_R_ADDR +#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK_R_ADDR +#else +#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK +#endif + #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 /* @@ -274,11 +285,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000 #endif -/* - * Stack setup - */ -#define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR - /* Extra Environment */ #ifndef CONFIG_SPL_BUILD