Message ID | 20190221042936.13441-6-anup.patel@wdc.com |
---|---|
State | Superseded |
Delegated to: | Andes |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> 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=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="m5OpkLiv"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="Dp/euDj8"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 444hVY2YHMz9s7h for <incoming@patchwork.ozlabs.org>; Thu, 21 Feb 2019 15:35:49 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 10C74C21ECA; Thu, 21 Feb 2019 04:34:54 +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=BAD_ENC_HEADER, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_BLOCKED, 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 6CB03C21DFA; Thu, 21 Feb 2019 04:31:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 19C55C21E39; Thu, 21 Feb 2019 04:31:00 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lists.denx.de (Postfix) with ESMTPS id 23A1EC21FF5 for <u-boot@lists.denx.de>; Thu, 21 Feb 2019 04:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1550723445; x=1582259445; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AmwHm6MLugXWJNntqplRcTB+sRQRl608VcWm5AALqZM=; b=m5OpkLiv579XySYugbcLBNEzpjv/G3uOpKbYHEkLmOY/R/697Xd6F87y 0yHtPFY1x6cyByUtQH8KDuPnmAV7BDb5edEqrXzpQ1t/6KmT2+Hkb6Nlf e4GToskvtP2F5iL9KZzCtT9XHBML6oy7dWGxIRiIF897Y1O84JLH7fVui XOQU6WeGQJR1CKpqtjGWqWiwP0LWGzO+A2xoGXodNVVGK+X/VQOGQpbvy MorpnpR8VVxM5YrGtdjojKQD/gyMhprtQtPpdHPDNJ1wzB1W4gV3pPHh+ qhI1TBjuQSBcl6mdcB8c2WQQB75pNZ1F1y28VkrGyQoC8QFv293MvLScb A==; X-IronPort-AV: E=Sophos;i="5.58,393,1544457600"; d="scan'208";a="103563900" Received: from mail-dm3nam03lp2056.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([104.47.41.56]) by ob1.hgst.iphmx.com with ESMTP; 21 Feb 2019 12:30:43 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3aTNfY0lQkSqxLcqBZUihCW7zErFNQCbjMgV2rgvR98=; b=Dp/euDj8yP3mOdbOmO6bOKcGfm1IPyNuty6dm3fs4TgwL1kz/JGQtoyTOS8iDa6a/G09S0sPNfn57+8lvfmAvS9RQRPoyAZuVFX4CdUhgbpmcL7x78EZEzUK4OKg3LDQiZu0+XBlRVWz+TDlY7CiR0E58Ovv8z7I5ZRfyCxrIO4= Received: from BN8PR04MB6050.namprd04.prod.outlook.com (20.178.214.224) by BN8PR04MB5889.namprd04.prod.outlook.com (20.179.75.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.19; Thu, 21 Feb 2019 04:30:41 +0000 Received: from BN8PR04MB6050.namprd04.prod.outlook.com ([fe80::f87a:cb97:e3a:b8e7]) by BN8PR04MB6050.namprd04.prod.outlook.com ([fe80::f87a:cb97:e3a:b8e7%4]) with mapi id 15.20.1622.020; Thu, 21 Feb 2019 04:30:41 +0000 From: Anup Patel <Anup.Patel@wdc.com> To: Rick Chen <rick@andestech.com>, Bin Meng <bmeng.cn@gmail.com>, Joe Hershberger <joe.hershberger@ni.com>, Michal Simek <monstr@monstr.eu>, Michal Simek <michal.simek@xilinx.com>, Lukas Auer <lukas.auer@aisec.fraunhofer.de>, Masahiro Yamada <yamada.masahiro@socionext.com>, Simon Glass <sjg@chromium.org> Thread-Topic: [PATCH v9 05/15] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems Thread-Index: AQHUyZ40aaLhBiCRsEOTJ5AIFHg8MA== Date: Thu, 21 Feb 2019 04:30:41 +0000 Message-ID: <20190221042936.13441-6-anup.patel@wdc.com> References: <20190221042936.13441-1-anup.patel@wdc.com> In-Reply-To: <20190221042936.13441-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::32) To BN8PR04MB6050.namprd04.prod.outlook.com (2603:10b6:408:53::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [106.51.20.29] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1f811344-7e21-434d-af46-08d697b5565f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:BN8PR04MB5889; x-ms-traffictypediagnostic: BN8PR04MB5889: wdcipoutbound: EOP-TRUE x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; BN8PR04MB5889; 23:gg1CzqMJC6fOrO2qDD9ujyZUx/jpDx2DQbfo05l?= =?iso-8859-1?q?1Qz2R4MBcH595sOAkqP083pgB?= =?iso-8859-1?q?pw3SuxOFdvBJaFfbeXVvH9cW2CNX5LQDlSqfWeF6FFTYrPrmwAl?= =?iso-8859-1?q?s+zfzVduEm5eB8vvoEtGRAb+L6z/fg5J3EsqGDX1LQJ72fOz4g0?= =?iso-8859-1?q?F7RZb8y2s0F9moU9dzrG3jkdkm7gaOr5CfynCy3zIVHmC1691kh?= =?iso-8859-1?q?JMwjLSXhHV/KIlyFaSV3zlE4YvVvQEbk6nd5qROgNcI5vKQlyX5?= =?iso-8859-1?q?gKDJDIniOHPRMmLkixJITdPOOkHVjhDDEC2qGKUgTthVcczUjsz?= =?iso-8859-1?q?/4pW3WI1u7h62kiq+NdWEdS9DdA535cKD3gLSmhn1bh/Xi3bPu1?= =?iso-8859-1?q?sgbrTy79AHryi8P5Ff+l0k3ULbWDLpD1IofwuwoU49OscW6Biiy?= =?iso-8859-1?q?jLc7hO4VneG8gbwrJZrWzTEDOhDNGqNP/t/EkoBTLtdandfZQNf?= =?iso-8859-1?q?+ewATadCgVsYQmuumEJpKxXjYXiUBsuQWxjvHCuYSe/NcGyAmwp?= =?iso-8859-1?q?lDfAzLZoTJzbVAtRdKXd69gomMoW0+nNiB6k+uiubpPAuSBR+N0?= =?iso-8859-1?q?Kf9Y6U1IAZawZdDRqeTUoYrO+h4gbMgTDmztrIAE5HWaeXQTvwm?= =?iso-8859-1?q?mjTjMg/F9QnTKjxVdlQE5s6hziBj18yTTnyrWhpDL3l3Su93l7B?= =?iso-8859-1?q?tFhF8YTmJ33lx1IaMX1nmZZeaRtcQeQ6jqn/sfq0Oc9IIWfs00n?= =?iso-8859-1?q?8aLEfHZDVLiZP2KVVfULG9x4CsWf68vH+TMj3Aj4xcIjNyOBbNe?= =?iso-8859-1?q?L3Hg7EFLOTkupxmXmtxAcH1ic/tGW/9Fqfl+REQnT9UMjwwFtKX?= =?iso-8859-1?q?OzlD7g+iqebPqh/3NRcWvW2E2Qnse85/JVm1aX9n2IODN8mSY+G?= =?iso-8859-1?q?0AkDxT2mN8hKnnusSEm64ebcg5QMQtfWtTmKEMR/7cC3K+dvVpA?= =?iso-8859-1?q?3GyQJfW3yvV77WEPSnG4fQAKvLHro2S+XT+HEubF0SI2hQOZuk9?= =?iso-8859-1?q?6N3qnbOGdnpAoVJwzHuF8ZMTBq6Yy4tSjoJvHE24QhZmU4/OOKw?= =?iso-8859-1?q?DMJFN4VCrHfXafNi5cgm/kAmgB+34pQl2jp3WTA4YFjJ5ySUGk8?= =?iso-8859-1?q?dEe4LxuSRoP/LEb0fDQ9JkPXpNMNiABIpRPUj0ispMuRBYZgU3Y?= =?iso-8859-1?q?ZpDUHv3yhRYx1t/H/Q2rCaQ+peKAy2PunxAL04qGTQhK4FgTKJt?= =?iso-8859-1?q?3WViSx+pEb64I1PMeyMrN8CCoDxn1YXe4c8C+Ny4at4YWp320VA?= =?iso-8859-1?q?PLfTU8bcBnastaUzXOLi453ASYwH0QYUkHXL7JFoWDTVm5c/lPw?= =?iso-8859-1?q?n+Fd6Nf0K9JYCG8Dosk788/k+iDRkJnENP35Wal3fAebVMtSy+k?= =?iso-8859-1?q?pyFA2ID6/gmQUGaBISfHKRmmEhg=3D=3D?= x-microsoft-antispam-prvs: <BN8PR04MB588918E8B627D2835C13AD408D7E0@BN8PR04MB5889.namprd04.prod.outlook.com> x-forefront-prvs: 09555FB1AD x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(376002)(136003)(366004)(396003)(189003)(199004)(72206003)(66066001)(86362001)(8936002)(105586002)(52116002)(76176011)(71200400001)(71190400001)(8676002)(4326008)(106356001)(478600001)(81166006)(81156014)(6486002)(6436002)(256004)(1076003)(50226002)(53936002)(14454004)(6512007)(25786009)(78486014)(6506007)(386003)(55236004)(36756003)(6116002)(9456002)(3846002)(26005)(102836004)(7416002)(316002)(7736002)(68736007)(5660300002)(186003)(2906002)(97736004)(2616005)(476003)(44832011)(486006)(110136005)(54906003)(99286004)(11346002)(446003)(305945005)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN8PR04MB5889; H:BN8PR04MB6050.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: VLxnZr56SswKRPIFAGSnTCdolaUkwliV2EMOr+CckfN5PSieOp1u1PMHCbj43eLQmlF6TrEG0TG+qAVh+PoBK9ABfzuGPj1yaUAHayr/87KnXGVPqgD5ggpXe7nlw1O88cfGIvHx1NlEsDKVxVgnxOc9ivVudCiR6FP+08TkPwHx+uRJ8o/QeQ++pcauTVxyrrLbvbXC66K/MMWE7GS+lFbhW9p2HbcU/8Ays3cyaaod6PsVPuE9TJ69OmXrguQLHtED0ZkifsvXmt95gG0FQDZriWygd2PBiN+ABSD27Ahg8xOurstePn+PJb+iYawYCSD/6jiApPrxiL/gLmZQnWoUtpXhuWVxmik0n39ekxuMpJiiG4ViPKEyHPo1q5l2yLrkxMHSwigQQ3/B1goTEttRqGQmQEV1QIkc1u8TGuY= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f811344-7e21-434d-af46-08d697b5565f X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2019 04:30:37.2992 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR04MB5889 Cc: Palmer Dabbelt <palmer@sifive.com>, Alexander Graf <agraf@suse.de>, U-Boot Mailing List <u-boot@lists.denx.de> Subject: [U-Boot] [PATCH v9 05/15] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
SiFive FU540 Support
|
expand
|
diff --git a/arch/riscv/cpu/generic/dram.c b/arch/riscv/cpu/generic/dram.c index 84d87d2a7f..b7b1207235 100644 --- a/arch/riscv/cpu/generic/dram.c +++ b/arch/riscv/cpu/generic/dram.c @@ -5,6 +5,9 @@ #include <common.h> #include <fdtdec.h> +#include <linux/sizes.h> + +DECLARE_GLOBAL_DATA_PTR; int dram_init(void) { @@ -15,3 +18,20 @@ int dram_init_banksize(void) { return fdtdec_setup_memory_banksize(); } + +ulong board_get_usable_ram_top(ulong total_size) +{ +#ifdef CONFIG_64BIT + /* + * Ensure that we run from first 4GB so that all + * addresses used by U-Boot are 32bit addresses. + * + * This in-turn ensures that 32bit DMA capable + * devices work fine because DMA mapping APIs will + * provide 32bit DMA addresses only. + */ + if (gd->ram_top > SZ_4G) + return SZ_4G; +#endif + return gd->ram_top; +}