Message ID | 20190225081334.23256-6-anup.patel@wdc.com |
---|---|
State | Accepted |
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="EsBhM1BZ"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="b5ZHZ8N/"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 447FCZ2Bsgz9s9T for <incoming@patchwork.ozlabs.org>; Mon, 25 Feb 2019 19:16:42 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id DA280C21DF8; Mon, 25 Feb 2019 08:16: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.7 required=5.0 tests=BAD_ENC_HEADER, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_LOW, 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 D751EC21DF9; Mon, 25 Feb 2019 08:14:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B37E7C21C57; Mon, 25 Feb 2019 08:14:45 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lists.denx.de (Postfix) with ESMTPS id 5FCDBC21D74 for <u-boot@lists.denx.de>; Mon, 25 Feb 2019 08:14:35 +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=1551082476; x=1582618476; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AmwHm6MLugXWJNntqplRcTB+sRQRl608VcWm5AALqZM=; b=EsBhM1BZSUWkPsbO9IK4Da0oA9834N8Cn/9EotIsipR7tdg+Pt8eZ2Z1 PIJOa3I6CGV1x7MRYJW6h9GL8agfVIFZfTfuTB4b4jTokt+wj9LAInVrg XJbN1zynA0kmsxFLm50+yjjO9hlAVaBKmv/vSmP7nepvOMikEnID25zu+ cdcjnNQxjGpBiCEBJhFgufcP9OtXBjkE68r5rddk0JS9SADJwndVvrF6/ ph4AzYjzNnmRyKSA/vdnoyhBgHj33oIN5zW690Ri0YHUYmvy/y3Fi8Grn vSaxj0WHnv7PihGmTZroQO3+Tll8A163KKAyejilurvD9OOZGlivLPnGM A==; X-IronPort-AV: E=Sophos;i="5.58,410,1544457600"; d="scan'208";a="103840142" Received: from mail-sn1nam04lp2055.outbound.protection.outlook.com (HELO NAM04-SN1-obe.outbound.protection.outlook.com) ([104.47.44.55]) by ob1.hgst.iphmx.com with ESMTP; 25 Feb 2019 16:14:31 +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=b5ZHZ8N/BaY16CnI/liNE40jO60IspAf/EqPpUIRO6ZzwhR25FE0VbJw0Mug+kC/7ArMIgqxv2vCHtfR/lUsKs5Oggmg0Yg4KuMkCh1WFR+RfP7oSrxHuwEPy5jCoTuHAEGnC4YVH3MsAvjQV0QgFRQPOg+j3khy2W+eZDupQdg= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB5789.namprd04.prod.outlook.com (20.179.20.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.15; Mon, 25 Feb 2019 08:14:30 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::d197:7b59:7e0d:e819]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::d197:7b59:7e0d:e819%3]) with mapi id 15.20.1643.019; Mon, 25 Feb 2019 08:14:30 +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 v10 05/15] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems Thread-Index: AQHUzOIho1iwaUYxpEieE8YsfP5/TA== Date: Mon, 25 Feb 2019 08:14:30 +0000 Message-ID: <20190225081334.23256-6-anup.patel@wdc.com> References: <20190225081334.23256-1-anup.patel@wdc.com> In-Reply-To: <20190225081334.23256-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0069.jpnprd01.prod.outlook.com (2603:1096:404:2b::33) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) 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-ms-office365-filtering-correlation-id: dca85f32-2af1-4fc2-fc2b-08d69af94437 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:MN2PR04MB5789; x-ms-traffictypediagnostic: MN2PR04MB5789: wdcipoutbound: EOP-TRUE x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; MN2PR04MB5789; 23:mB8QvSR7vFcb30JCfRLBMEfsUR5pc3LnwWLKZBK?= =?iso-8859-1?q?ArtRBzn0gssbpFBjCVN2iLe2h?= =?iso-8859-1?q?bDV4DvHcr8o+/HXClttXV9qKsbdxaQTS7jldixUSL9XTm/WS4jx?= =?iso-8859-1?q?oxqu0DE+JsDyUaEBuFpyIQ1Ilau6gH0FvPf9iIYRwYm58ZAxasn?= =?iso-8859-1?q?wWfaTdzIchGFu/eORIr0PtweAXbCJNYzJJ5jHgoQMKt5pv4kmxN?= =?iso-8859-1?q?maU0kBammSzYmrIVjlAtq+T4EZChMzQsOs4/Yb6ZCbCKValCyGY?= =?iso-8859-1?q?HF9TdZ5W06gzpQPpUyVZRZfQH0wTPortPlxlyAZNDvm9/2Xy+oM?= =?iso-8859-1?q?T1Sph+blLOnuuOgTYhi+cA9iKyHiKnjCknKbEs8Kua/9iiQ6GQJ?= =?iso-8859-1?q?xKXgsbfoCXgd8mrbgNs4oLLPa1vJsClu9jqN2AH52Qaq+3au7gT?= =?iso-8859-1?q?y4VaZUO1nfLlkP5Rn5RtGjYG7+Q5I07UL/DylO64cqo2u3dJnBM?= =?iso-8859-1?q?G6UmHt4VTuEnh7gJP0ETJBzxbHychgd6DMI/EfJWlM97hfJ++dl?= =?iso-8859-1?q?Mj8tLH3U1j3qltWaeCHhwh0Q1gCoJihIHP091kE+VZFbbaUOmZm?= =?iso-8859-1?q?ZkgagF5SCxzrpwadp3PqL/U/+ULluvVi6HH/XXU588LdBpoIvd+?= =?iso-8859-1?q?ZCoQb+M3drxPKkuEAXZybCKmWrX1AcL/q36ZBctooqLoDKfxx2X?= =?iso-8859-1?q?t8HgirRbUBV3Yon55IyWzd0M93sqdxluaIWF9cSbLikWQJeEtIV?= =?iso-8859-1?q?CSbxRv0gs4upPLxlQjzSvUzPoTk44Agyf/FJVsLmQhoD1gb6Rec?= =?iso-8859-1?q?I1qdNgRnsuqs5Gh/AC2Phf6+a3A+4OVfLx0CVZzbU1Y0eXxStiL?= =?iso-8859-1?q?lqu/fBLK6yXNaKqLQheBrMw27Gpp58vxHcybSrQCM8PmlfUawy3?= =?iso-8859-1?q?EDZS122Ei8QK8F+8bZyNKGUb1va+5fFAk2iZw6UVlsXQWP5imuM?= =?iso-8859-1?q?I5cNnLsfKtqIGFdiIjaC6boQ+Q/Nhq7uKPvNY6WfiQgncALpQSq?= =?iso-8859-1?q?1gnv/rskldrkaEebdUcpCh18/ZGZvJ+zhsoGPZ6PQ0oJ54bcrCu?= =?iso-8859-1?q?f3neVl6kYRqh7f/r/D5Jkyk+LsGWXhc8JoVYaLa68f7aX4JE6/c?= =?iso-8859-1?q?Gcf3SY0GoNRb/f1aLKCwbIVNqw6CMw50KMdoCIxW3A16rJse7vD?= =?iso-8859-1?q?Hm18PoJYq0+qHmsPlkOeCf8d0F5GM9LnI6px76YxzlLc/SES9nN?= =?iso-8859-1?q?V6ZXzfBLCcz8i5FGylxCQZVTXXstL1YPPvyJgSf30uUeRLpfpoD?= =?iso-8859-1?q?02qOSvV8TWr17hPXfJCW5TodIjBUCu2fCl2ZNBgbLTDkcYf7ErC?= =?iso-8859-1?q?7dha7Ihi5EjRNJusLkukxsnAxn4M2iXFIwM=3D?= x-microsoft-antispam-prvs: <MN2PR04MB578927E4C4A72877D2B213A58D7A0@MN2PR04MB5789.namprd04.prod.outlook.com> x-forefront-prvs: 095972DF2F x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(396003)(366004)(39860400002)(136003)(189003)(199004)(66066001)(6512007)(186003)(53936002)(7736002)(305945005)(44832011)(478600001)(106356001)(26005)(486006)(2616005)(476003)(105586002)(7416002)(5660300002)(14454004)(6506007)(386003)(72206003)(8676002)(86362001)(54906003)(110136005)(81156014)(71190400001)(316002)(102836004)(6346003)(71200400001)(81166006)(1076003)(36756003)(25786009)(99286004)(97736004)(52116002)(50226002)(76176011)(2906002)(8936002)(11346002)(6486002)(6436002)(4326008)(68736007)(446003)(256004)(6116002)(3846002)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB5789; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: yykEHxj/oOpNkyMjOqu8WblXkrTk9fk/V8Ih+tBgNB9lVtnZu+52PtN3IJ/6UfGkgzJ1N3pGyRzyzah5AbbZ0tcmKbYwwz5WttbdduBglWxxO3yOOUMHjL2zS7gCmiw47/YehLm9doqaCdRNNeZx+rL4CbXtRUhp8tFtkuVvWh+DwuSOtaVkBtfwDrw5ojDQXm26F3dzG3EvCMvSOTnukcDm7o6UaSlZpvCXAbkZNjUnP4qMB75C7fNWPDPn0PsOqtIPSsxnYzr910OznMW6MpKxsS2HEiIudKSQC5/BAUUkTGDUBGb75sRBMNud/9n7vxjNh5o8q6VFiV9FSBVdHJIBOphZCVVQGsWAZ0oDTszgabPecG70XMZAPGUltuB8VXj8+mOpAkDOhv41mxdg5hsGKH4ojYaPrsRLyB/KDgc= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: dca85f32-2af1-4fc2-fc2b-08d69af94437 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Feb 2019 08:14:25.3443 (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: MN2PR04MB5789 Cc: Palmer Dabbelt <palmer@sifive.com>, Alexander Graf <agraf@suse.de>, U-Boot Mailing List <u-boot@lists.denx.de> Subject: [U-Boot] [PATCH v10 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; +}