From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ley Foon Tan Date: Tue, 12 Mar 2019 16:31:09 +0800 Subject: [U-Boot] [PATCH 05/10] board: altera: Stratix10: Add board_get_usable_ram_top() In-Reply-To: <1552379474-12867-1-git-send-email-ley.foon.tan@intel.com> References: <1552379474-12867-1-git-send-email-ley.foon.tan@intel.com> Message-ID: <1552379474-12867-6-git-send-email-ley.foon.tan@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add board_get_usable_ram_top() function. Limit maximum usable ram top to 2GB. Signed-off-by: Dalon Westergreen Signed-off-by: Ley Foon Tan --- board/altera/stratix10-socdk/socfpga.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/board/altera/stratix10-socdk/socfpga.c b/board/altera/stratix10-socdk/socfpga.c index 043fc543f1..99c10d313c 100644 --- a/board/altera/stratix10-socdk/socfpga.c +++ b/board/altera/stratix10-socdk/socfpga.c @@ -5,3 +5,15 @@ */ #include +#include +#include + +#ifdef CONFIG_ALTERA_SDRAM +ulong board_get_usable_ram_top(ulong total_size) +{ + if (sdram_calculate_size() > SZ_2G) + return SZ_2G; + else + return sdram_calculate_size(); +} +#endif -- 2.19.0