Message ID | 20190211054030.21393-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="YOKWhG/R"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="Mm9d6ncN"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43yZVm1KFdz9sBZ for <incoming@patchwork.ozlabs.org>; Mon, 11 Feb 2019 16:44:47 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A00FFC21EFF; Mon, 11 Feb 2019 05:42:28 +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=KHOP_BIG_TO_CC, 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 2239EC21F4E; Mon, 11 Feb 2019 05:42:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CD17AC21ED6; Mon, 11 Feb 2019 05:41:56 +0000 (UTC) Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lists.denx.de (Postfix) with ESMTPS id BED0DC21FAA for <u-boot@lists.denx.de>; Mon, 11 Feb 2019 05:41:54 +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=1549863751; x=1581399751; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AmwHm6MLugXWJNntqplRcTB+sRQRl608VcWm5AALqZM=; b=YOKWhG/RP9+hh+WIpjcv4yaCNELVsLnofHyyyzRj/bE3qSKM8ffBLE/U 0Vi1IBuDvdXR/+YRVL6bt9mVpXeMpeTgRH1x5oLdgpq2kXMXig9Nj8fxl 9fH69BEGbo4UoYgqkz9kwQJNta+bGSM4KObAIoKJfvEvZytqaJtXeVxU3 ixaDNXuiKHKXa7pKgkFzmyxljD1UmRJeUZAPGFBvDH1A1kK7bGxSLfzVF 6DoqXsilLtRT2vTBrh9AC/eqf2O/nnFnX2q05KuWJE7pkMxYdiKkQtHqO nsHRor9PhUtvuP8MGFgGkpfp/HcE3HEGxDoGIK7PSqkMzeLFCtHRiNFH9 A==; X-IronPort-AV: E=Sophos;i="5.58,358,1544457600"; d="scan'208";a="199087415" Received: from mail-bn3nam01lp2053.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.53]) by ob1.hgst.iphmx.com with ESMTP; 11 Feb 2019 13:42:28 +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=Mm9d6ncNbz3uXHbab6Ng3HvO5ZgEO0uA0NPOIrHQe9MWZukGIVZTHmBqSm3RlSXXAD5iSNLLj6hKeLaELHHuBryBciweV2J33+7R/1r5z4DHCu4F3OjugrEEzGMLEqz5TRs7t8Yya4deaw7UVtmxfC33ZH55+VSWl48ziyqYV00= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.247.148) by MN2PR04MB5903.namprd04.prod.outlook.com (20.179.23.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Mon, 11 Feb 2019 05:41:47 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::2cdb:c465:af57:8be1]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::2cdb:c465:af57:8be1%7]) with mapi id 15.20.1601.023; Mon, 11 Feb 2019 05:41:47 +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 v7 05/15] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems Thread-Index: AQHUwcx6HBv7v0nRoUGTMqLHrIMxuw== Date: Mon, 11 Feb 2019 05:41:47 +0000 Message-ID: <20190211054030.21393-6-anup.patel@wdc.com> References: <20190211054030.21393-1-anup.patel@wdc.com> In-Reply-To: <20190211054030.21393-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR01CA0132.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:35::26) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:de::20) 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: [129.253.179.161] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MN2PR04MB5903; 6:eIvhn9uh2Ug9jWg2P76L2H6zyyIRqEr0NL6Gtvgm6bOFucbqTAR7Sh0zG1wd3OSHnFnnhEIQ9rl5/EyaKlYOCOT+8mjOD4FngYmnsg45//KvMAH1TYbif77Abs2wQK3bkFLuGbIuUzbLIWPxOod3gmVPEeffAgVgDdLffXbN67TJshvM+pOR8n67v9//pa4IOf5BO98Efgw+lw73Y5l6+KF181vsgivFWlgQPy3fHLVKR6Ljw1mYMceURJhAQKAtT/nO1n5bJD4NXxZhLtmCWT+iMaoCJUADcfL/v9hTbw5d7Lck5qbX+uYYL7vqYzcb1JJKmseC/ppq1OrtX8Y5XUwhledgM6k7HXhFEIM0Z3F5ouls54VoXEqtKVKtRa6qTE+f9f+4cBwORl7hTh7Tk3b9KSJdtxD+BY+NxyWTAxGQcdKvh6mnlxQokDyM3oa2nYTNWcGtOfDXEnIRxzo+Rw==; 5:sTD4xrGrMX/0V84IXa/BvssDNmkyiQIkF+pAtFD0NsxmBg5mPLKXVm3pOKZYjsC8EoZc2n9090qE2dOiRuAYuXTgIbROKDyzBN3g+HCpVqudMKP/ese4eJ98/LJAJkgYmvRArdd1LGrgsexwxqbbGNbRfKb2DxCEW2lG1aVfsaB7MWWnnXXS8QJBBXoiy/OBn/KCRJcFqihNBYH2Bs8gGg==; 7:RPwyQKiID7DvXvv11DskUg1s5QJwYo2ch+ScIdCAWhA9+KP7lVCeQZkDvWBuu/xmVZPmtLQN5Ihj04Ouz0sV0UlB8366KsPthJLdjZL7AisvxCOkx4VUOm+AZflMvAhHLEZDzKXpQYA6ZWuSMvUSBw== x-ms-office365-filtering-correlation-id: 417e46c6-6a19-442f-fcdb-08d68fe39cae x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:MN2PR04MB5903; x-ms-traffictypediagnostic: MN2PR04MB5903: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: <MN2PR04MB5903CDEFB37B0E45C9B1C9A98D640@MN2PR04MB5903.namprd04.prod.outlook.com> x-forefront-prvs: 0945B0CC72 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(376002)(366004)(136003)(396003)(346002)(199004)(189003)(81156014)(54906003)(2616005)(11346002)(26005)(66066001)(386003)(6506007)(44832011)(102836004)(6486002)(476003)(110136005)(486006)(446003)(316002)(50226002)(6436002)(1076003)(4326008)(81166006)(8676002)(53936002)(68736007)(8936002)(6512007)(71190400001)(71200400001)(305945005)(256004)(105586002)(106356001)(25786009)(97736004)(7736002)(52116002)(76176011)(3846002)(6116002)(7416002)(14454004)(478600001)(72206003)(186003)(2906002)(86362001)(99286004)(36756003)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB5903; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 5WR8ev9femubS40xUNKlRfR7IdkeT4U8EsQUZQrF0mRVxXLSgWSdX9PwiyBy96nGazOOt4LBiXNUBT78DR8WMXa3XpIRiCCWFZAhALEqXDAK3AjyEUdIWjkAWqCR/49Dn3C0NxSZaSRKSYFJ9K5RpFPGQfpaZRx0rW/N/OOAowCXYJC7l0BcN0mhwr2EPhADWnX6Vf/NNJgpXPKhyhVWsMKRueKgs9nwx/1GFd+Dsbu3RHyGH4KfNiQK2nUazO3sTZfvcdJ/QY5hXFxzQfpMUY4yvL+KdwZ7cCHUDbmXv06eZ3Dp9FyGYfQVhErUCTc9ahSAxLILE5Y7UeXYPGknKZWJVqFyrZiu6p3S7gDZoWrSvM1q1VuS0U2jItia2fFZ6BSfu222Yb+KGq39o3dv2xyYzCAxbJfjj9WsJl446IE= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 417e46c6-6a19-442f-fcdb-08d68fe39cae X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2019 05:41:42.5593 (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: MN2PR04MB5903 Cc: Palmer Dabbelt <palmer@sifive.com>, Alexander Graf <agraf@suse.de>, U-Boot Mailing List <u-boot@lists.denx.de> Subject: [U-Boot] [PATCH v7 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; +}