Message ID | 20190205130346.77175-7-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="Q6MgtopS"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="FVbnw3D0"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43v4cq0FSpz9sNL for <incoming@patchwork.ozlabs.org>; Wed, 6 Feb 2019 00:07:54 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A878DC21EE4; Tue, 5 Feb 2019 13:05:46 +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.6 required=5.0 tests=KHOP_BIG_TO_CC, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9B9A9C21F05; Tue, 5 Feb 2019 13:05:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2A679C21F0F; Tue, 5 Feb 2019 13:05:04 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lists.denx.de (Postfix) with ESMTPS id CF467C21F5B for <u-boot@lists.denx.de>; Tue, 5 Feb 2019 13:04:59 +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=1549371900; x=1580907900; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AmwHm6MLugXWJNntqplRcTB+sRQRl608VcWm5AALqZM=; b=Q6MgtopS6wf4AKkLZS6XW9M1BG0eaxo5lB8RlrBVFwQHN3zhwbfDrcJc PVR0a3Jn0cUE00qZGgGKgO8O58INWZRTVHLtWbjBBeWmyUi1HbSSqc/cT SZ8sQ2Z4sF8FVN5rBrtcklbgyKPkudhRw1UsthVxq1g8cioaihe3afOfB 1or4aAfNk9Aei+g1EQd4aATcD0EKDxSmQZMQ0UJIwiorNwdEAOkK8Zpa6 vkPMUf4OB61r6xgdGrjrQsGPB7VG7NGKoCHNNyDlmndoPgyOgppDyGAFK FKqa2qsvECLoXBxIWdbViotvcD74esxhyjFVpbzW75QTxlmzwWXvtDUxy w==; X-IronPort-AV: E=Sophos;i="5.56,564,1539619200"; d="scan'208";a="102319742" Received: from mail-by2nam05lp2058.outbound.protection.outlook.com (HELO NAM05-BY2-obe.outbound.protection.outlook.com) ([104.47.50.58]) by ob1.hgst.iphmx.com with ESMTP; 05 Feb 2019 21:04:58 +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=FVbnw3D0yWzNn4t4OTWkpp5QrcwoUG282qVJFRi9hNCG09BsKynKCuy2Ap/xCK4Qydsh2uWobqLDtJt0lyuCgfdrJEjngZbiIA7Yrp+WgOe+AzdBb/dsojBNuyqIrG93QoVIh0LZmUIVvTtxA+fAV33mGDkjT6LE7IsizfoZJ/o= Received: from BYAPR04MB5303.namprd04.prod.outlook.com (20.178.49.148) by BYAPR04MB6229.namprd04.prod.outlook.com (20.178.235.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Tue, 5 Feb 2019 13:04:55 +0000 Received: from BYAPR04MB5303.namprd04.prod.outlook.com ([fe80::add1:92cc:65d7:5d94]) by BYAPR04MB5303.namprd04.prod.outlook.com ([fe80::add1:92cc:65d7:5d94%2]) with mapi id 15.20.1580.019; Tue, 5 Feb 2019 13:04:55 +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 v5 06/15] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems Thread-Index: AQHUvVNjW6G/J9V1zUaRKFf4KN3xkQ== Date: Tue, 5 Feb 2019 13:04:55 +0000 Message-ID: <20190205130346.77175-7-anup.patel@wdc.com> References: <20190205130346.77175-1-anup.patel@wdc.com> In-Reply-To: <20190205130346.77175-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::33) To BYAPR04MB5303.namprd04.prod.outlook.com (2603:10b6:a03:c8::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: [49.207.55.104] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR04MB6229; 6:yYOtYbx8Lux6Ms0Xt0HZx9sipPge+J42zYo/RF0g5K2d1jHmE2kZsEV0b+U/N+CEVHir8Quhl7NEMaK+zYAAP2VbJqQ3QN4YT4aVx42gYpa43HDhP76NLYJNuNYExM+PKSd2Ftk0Ehq11cTEeF0i69lLfRwpnbKBGL7k+mif5b/H8uKhhjyfhh1ix4z7+lTCKNFiYraWmGlGsMUcIBW8YkwYhvVjvwauFdvIvI7z4Irkxudp2PVoeP5Gn92jyJo/FONK+ZdBbhPAkEXtNnWIDAR82qn09Icn8JuaPLGm2fmcg/t9Vh2fLZWSrEY7e0JOzXhe9YghVZAKqqedkrNX/noSeRtCDNoBEhJBOhsqBqrpJLgoVHVq7LWeIIWVZ+GNv90V0wezX2EOzX9bbJgiWYMzTRXWIYrMiQQP+7O9HreMp3ZF7tGYmwVZKy/05PcPkW4teh5Mgb967R4aQAPGAA==; 5:2fVBWfhaScU8RbLdbgsZGzQzwlbCrqPJ1m3IlmVjGtQUlvk7VBgMHjxxSkNOd/eDsiitPdRuMg9tUrL/1zCI8H2bvI4kzJWW0pIcNUTqCAzfOOPzvHdzd2M+PH4WeRom7dXggChRATnskcWR1FVz+qWUnIbuOun0cI6aPO05hUYrjcGDS2S0Cyles4dOlUNqi/NxaRXIr/qcK+3o2Hp0QA==; 7:ma3yl39QJvBAegk3BQkhUFa3Xcgvv7btraJzC2+GTxMb/K4/gy4W/EPPNv1gk6dfNHxlGWnGWWq9mRLHLieY5PFqBTtSUBe/CMfTFODAzTid0xoVA5j1AKi8YX4XxZGHtbdlOjl/0fbYNil4Q3QoOg== x-ms-office365-filtering-correlation-id: 658ee1a3-1725-4914-300f-08d68b6a861f 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)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:BYAPR04MB6229; x-ms-traffictypediagnostic: BYAPR04MB6229: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: <BYAPR04MB6229EF3A8F079888140E13248D6E0@BYAPR04MB6229.namprd04.prod.outlook.com> x-forefront-prvs: 0939529DE2 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(39860400002)(376002)(346002)(136003)(189003)(199004)(4326008)(72206003)(6512007)(54906003)(110136005)(53936002)(68736007)(7416002)(25786009)(316002)(14454004)(305945005)(36756003)(478600001)(66066001)(7736002)(1076003)(6486002)(71200400001)(71190400001)(476003)(81156014)(86362001)(81166006)(106356001)(2616005)(44832011)(256004)(486006)(8936002)(8676002)(386003)(6506007)(6116002)(3846002)(2906002)(52116002)(99286004)(55236004)(446003)(97736004)(6436002)(105586002)(186003)(102836004)(50226002)(76176011)(11346002)(26005)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB6229; H:BYAPR04MB5303.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: epL2Xz7t6axGWmhQBQtfbtdsRMNI+VdcO14NSK5xYwRHZyO45kd6AtdzvCinKv2DbLFAIQyWf1eqOckAXZ+aP3Oa2cBqlj58XEFnmgCUikyzH/OLOWnh0sqG0yyp0lloUqjSPnxl67liSGc5B6D8OE0dHZGHKoE5gyhAfRiSU5gVV++yNJv/yvFaj/ueEbXapgPqd2qCe5/wHWCPhMB1PcyzLdLedOm4Hrgu2tJUypl9Ze9NYphnmRgA7iDQTHe56NpXXyh7L3WLnOOrnjeb1kJe1fd+NqdaILW+aZYOvR++QT2tXB9BovNmcoi0Lt6YJuq/W6FrFb98I/swkFiD/QmlP6XzOEYbI8IX4/HNwBXRRa6+sQnf9P2k1uJ+EcO0wVVsZKrQcOgp+kMNi0mMbLJN4DdEyP4LNYsQbND7lpk= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 658ee1a3-1725-4914-300f-08d68b6a861f X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2019 13:04:51.5372 (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: BYAPR04MB6229 Cc: Palmer Dabbelt <palmer@sifive.com>, U-Boot Mailing List <u-boot@lists.denx.de>, Alexander Graf <agraf@suse.de>, Christoph Hellwig <hch@infradead.org> Subject: [U-Boot] [PATCH v5 06/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; +}