From patchwork Tue Mar 12 08:31:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 1055139 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=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44JSvR3sqGz9s47 for ; Tue, 12 Mar 2019 19:34:43 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id E4010C21F37; Tue, 12 Mar 2019 08:32:38 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED 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 0E1D1C21F0C; Tue, 12 Mar 2019 08:32:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 95A7CC21EFF; Tue, 12 Mar 2019 08:31:43 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lists.denx.de (Postfix) with ESMTPS id 78BCEC21F2F for ; Tue, 12 Mar 2019 08:31:39 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2019 01:31:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,470,1544515200"; d="scan'208";a="133342823" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.82]) by orsmga003.jf.intel.com with SMTP; 12 Mar 2019 01:31:34 -0700 Received: by ubuntu (sSMTP sendmail emulation); Tue, 12 Mar 2019 16:31:33 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de, Marek Vasut Date: Tue, 12 Mar 2019 16:31:09 +0800 Message-Id: <1552379474-12867-6-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 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> Cc: Chin Liang See , Ley Foon Tan , Dalon Westergreen Subject: [U-Boot] [PATCH 05/10] board: altera: Stratix10: Add board_get_usable_ram_top() 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" 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