Message ID | 20190123042442.106038-4-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="S5Q6wpgc"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="QL0jGQ62"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43kslf5Dv6z9s7h for <incoming@patchwork.ozlabs.org>; Wed, 23 Jan 2019 15:30:21 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D86BFC21E2F; Wed, 23 Jan 2019 04:29:35 +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 06362C21E2C; Wed, 23 Jan 2019 04:26:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2F1EDC21DFF; Wed, 23 Jan 2019 04:26:02 +0000 (UTC) Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lists.denx.de (Postfix) with ESMTPS id A4D83C21D83 for <u-boot@lists.denx.de>; Wed, 23 Jan 2019 04:25:39 +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=1548217540; x=1579753540; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AmwHm6MLugXWJNntqplRcTB+sRQRl608VcWm5AALqZM=; b=S5Q6wpgcITCBzRnVkV+RvltlkAypSzJBNdF0glbAphQlWDBWrMJd2/MK s0v+ffVAE0RrKYJR8hvx1MbL0X023Boi/lSZadoZA2enmajNxvoVCSKX/ BrGen6JgeZpbyyMcI1TFBVWoO+TmcRw9GyIiHziqJjOhP+nPWRoEWVXGy itFJMRjpu4bhzHKO6fWakDwYeUjWWnjohIZJclCjzvCSBIL514ZXwT/4J +Nvg8gM0zXJqEf0T6LQ3fZwaXTMCbLlwEEiT3OA3MfUyeaGlG1Agomn8T 6rtunuBvpQzsXKC3N2dFn4tfhlmnE7UFiLrny3/n/1SWjn3e5D184VwcS w==; X-IronPort-AV: E=Sophos;i="5.56,509,1539619200"; d="scan'208";a="104481027" Received: from mail-cys01nam02lp2058.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([104.47.37.58]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2019 12:25:37 +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=QL0jGQ62TGKZgvC40b9/nglLy6EXv9SYiPLlVdRxOKOFeCrWfhtuxI1NRRQBpnCymYO5JFTMa+yQfmyA0p3Qmt65ZjqJ1pwcl/VZVFZvFtKy9Y/zKstLMuXZohgA48zicKe0ae7Mtp7nBRZNERLdEt2xRpMARLEnrFfmvd30NAI= Received: from BYAPR04MB5303.namprd04.prod.outlook.com (20.178.49.148) by BYAPR04MB5319.namprd04.prod.outlook.com (20.178.49.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.29; Wed, 23 Jan 2019 04:25:35 +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.1537.031; Wed, 23 Jan 2019 04:25:35 +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 v3 03/12] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems Thread-Index: AQHUstOveemEPbEB/UmZznlT72J39g== Date: Wed, 23 Jan 2019 04:25:35 +0000 Message-ID: <20190123042442.106038-4-anup.patel@wdc.com> References: <20190123042442.106038-1-anup.patel@wdc.com> In-Reply-To: <20190123042442.106038-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0055.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::17) 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.146] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR04MB5319; 6:OGHLDdMlXXWwsJ4q0xevHJ5CHq4mqSoJ/k10wlaEn+dkVjbQoLLZBwjWkiDqoO8foCfElXU2Irx+RhPyw5DB6T1cxhAoZvykMiIwvorOUeC3SmUZXcfRlflbeZoyzQmZFPFZ14/XTuYeuQ8s9lLo2SeGH2llJEhnhLwg0azXxsgIPvPIvuB7MzLYdzTqKnowqsutzecJDcVn6pnbbKiujW1GeeHoQu6UQMdwltqshf83QNskv1NMXzakgFoeP2x5HFCAba2b9KCaMvYydH66dBP/ZRCyW7s2ZbpHqqBxe9XdR9YKEH8znJJRdWNPZEQaoC72P+c3CwKAy00XKnpVFBFA6bk3YedZVHyvmjk93dtpNR6JOIxjf+baXVpv594xtf8gU0ExDt/XwNx5iicOVnPbE0tg42CGcaxiDSL2KRRfSVxkgZJVyn4LeiaNTJUJSZ2MmaP+PWrBXP2G5pNemw==; 5:y+i0V5DX9OZ5fZE1/YQoO7bNV78T4iq2JOn5H5tWXhet3HUJanYMdNGjnmCZf1bVc3BuFvM+WuVovQIVtfSoSZeBVV7U3JeeJqQi6QeCQ4m86TuF7EGT5ZH37eJFug9UAjbWj4wmxw1AUIP0XZ21a/EIgj89FWTJRqyRzb5v9IDjsfT7+1KO6jYHrmfDXwK4z/rnrJkoEm1XYKKCciHGhA==; 7:Cv1WVClvs7KLf/NAiYamCorwYX3H/rWO1IWNk0eYzYi4Rzh57i5+/0SMiq3dVuIAWEx63lAr3TagOhTzKsk0fSnrBa5E0yCWvWM3NnYJ0LRB1kXFlVcIfuXsfGBfwhTOUsYkYsaU2jW1nlORI57FFA== x-ms-office365-filtering-correlation-id: f3c33a91-2628-4b8d-79b5-08d680ead1e7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:BYAPR04MB5319; x-ms-traffictypediagnostic: BYAPR04MB5319: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: <BYAPR04MB5319CF8F54C7514DDFDF39F78D990@BYAPR04MB5319.namprd04.prod.outlook.com> x-forefront-prvs: 0926B0E013 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(136003)(376002)(366004)(346002)(396003)(199004)(189003)(305945005)(7736002)(76176011)(52116002)(486006)(26005)(1076003)(50226002)(99286004)(8936002)(316002)(478600001)(53936002)(110136005)(54906003)(2616005)(97736004)(186003)(476003)(6512007)(446003)(11346002)(86362001)(386003)(6506007)(81166006)(81156014)(8676002)(68736007)(102836004)(105586002)(44832011)(55236004)(106356001)(2906002)(66066001)(71200400001)(71190400001)(25786009)(39060400002)(256004)(36756003)(14454004)(72206003)(4326008)(7416002)(6116002)(6436002)(6486002)(3846002)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5319; H:BYAPR04MB5303.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: iIe0UQeS/FSd3UQyi8Jhoie2L07L7XkTHmFUBaaVP7OyNJyfVoE+Dm4a2Ll5BWiQYI5efbra9S83HpBJ1SykCrfAdpfote8McnvmTl6cYH0nh18lcgV4+vt8+0V4v19g008T4dd+6ebY+glBKJlfxGJh6C2X9ZNUx4So26Yom+VIptvLLRIvN25++hrNFDHb7awn4gAOwuqyuBgwozFncgaHPinw04fwzzoo0eHMku9BQBBAicICZptBW3yxluB2s7gwzYtmIQQ9+R7C8ZVp+sfUsBsybuCjuDQ6r4J+EooZouBGcNN9DqYJjQzoGrU9bSdnN7nazlihaxmURjwz/iHYbBiAQaXX0t49jszcvizZduhlQc8uJ+WmNiF4BVw4nJlzYzYJvoHrBwK2YulHlh8DJF3ipTl/Ss8fX9O22lY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3c33a91-2628-4b8d-79b5-08d680ead1e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jan 2019 04:25:31.5251 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5319 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>, Paul Walmsley <paul.walmsley@sifive.com> Subject: [U-Boot] [PATCH v3 03/12] 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; +}