Message ID | 20190220054531.5345-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="hTEnXdX7"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="bgfCb0XF"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4446CX4TBwz9s1l for <incoming@patchwork.ozlabs.org>; Wed, 20 Feb 2019 16:50:48 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 295A8C2203E; Wed, 20 Feb 2019 05:48:00 +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, 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 D01F5C22034; Wed, 20 Feb 2019 05:47:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 08B05C2202A; Wed, 20 Feb 2019 05:46:55 +0000 (UTC) Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lists.denx.de (Postfix) with ESMTPS id B25A4C2203C for <u-boot@lists.denx.de>; Wed, 20 Feb 2019 05:46: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=1550641623; x=1582177623; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AmwHm6MLugXWJNntqplRcTB+sRQRl608VcWm5AALqZM=; b=hTEnXdX7EJ4gNFTJzyryPk5jFd5bdemFVfxPPot0/pDg9KzLcRzrsR3/ PHtE5M+TurKWbxwd0K1ovrcylv84ZHDeliqmGqoVJ5XDU+kmJH+eOIXED EWzwqqtIml5CipnTEUEbGl3vkejEVMCBvlKJUmeBS+7TslbCemzz0Gyx8 J3Hol1WeWjdvcy15KhbIM4Wh7NUUynhD6SMwzoBeSRO6q0w41cTg2UYUS 3gBCW2haJWSTPDTOYPZAxjIR3vwSVDhopCmTmStfajYhyayNhBav3Oxao 9uucWNPJ9+pa2chdFZCC0yfsOzzdm4xpAuAx26ALfgvaCfuOQke8lN8Lz Q==; X-IronPort-AV: E=Sophos;i="5.58,388,1544457600"; d="scan'208";a="200004814" Received: from mail-co1nam04lp2056.outbound.protection.outlook.com (HELO NAM04-CO1-obe.outbound.protection.outlook.com) ([104.47.45.56]) by ob1.hgst.iphmx.com with ESMTP; 20 Feb 2019 13:46:59 +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=bgfCb0XF2GVkPobHKCWTd5avTTgX2NA/XJ7VHigDbu1gzPpNH/XRHD+5XoLFz0yW/5BG7+BAX005VnxIVuPBgrVqg8TgtThXsNZ/evFzGcnMWC0eOGqDIoH+J1MatEFB+LVQXXfiusGvKMvOxjf0JwLuBpzsdXZjcp5VURnnoQc= Received: from DM6PR04MB6059.namprd04.prod.outlook.com (20.178.226.89) by DM6PR04MB5513.namprd04.prod.outlook.com (20.178.224.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.14; Wed, 20 Feb 2019 05:46:37 +0000 Received: from DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::d006:5be7:c3f:ba6c]) by DM6PR04MB6059.namprd04.prod.outlook.com ([fe80::d006:5be7:c3f:ba6c%2]) with mapi id 15.20.1622.018; Wed, 20 Feb 2019 05:46:37 +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 v8 05/15] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems Thread-Index: AQHUyN+lb8EqI8IAnE+2qW+G66m4qQ== Date: Wed, 20 Feb 2019 05:46:37 +0000 Message-ID: <20190220054531.5345-6-anup.patel@wdc.com> References: <20190220054531.5345-1-anup.patel@wdc.com> In-Reply-To: <20190220054531.5345-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0014.namprd03.prod.outlook.com (2603:10b6:a02:a8::27) To DM6PR04MB6059.namprd04.prod.outlook.com (2603:10b6:5:129::25) 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-ms-office365-filtering-correlation-id: 71fc52e9-3b82-41bb-e50a-08d696f6c781 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)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:DM6PR04MB5513; x-ms-traffictypediagnostic: DM6PR04MB5513: wdcipoutbound: EOP-TRUE x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; DM6PR04MB5513; 23:sIEUOWqi+ONQhzs70n/Qmaf1LGZmQpEcA/1vnCr?= =?iso-8859-1?q?pYyX+ZzcbsrueV26BS/aiMGd6?= =?iso-8859-1?q?sIsn6G42scBPoEGrH4cw9xSCrRwjJI+te74cUX1Y6w4Ykqh1+hE?= =?iso-8859-1?q?nb62uZeXxExZ2YjWcekuH7tZSP31yTkLU0RyLbEzrvRInUI/PRy?= =?iso-8859-1?q?2TzxSrui0gXwvdK/81lgGJ9JxD58IH0She1dcKC9EIlySvptbGs?= =?iso-8859-1?q?7GWCF4/gMDb5eKvXKD91ImPM92Br9BNrfHd3mPziAtLb0jvTlxP?= =?iso-8859-1?q?oO7Xx5h/kYbVEjfgHoZDp5YeDch7vg3+DTgEQKGks6Zc3FwQPiu?= =?iso-8859-1?q?g4FwARuYXf0gPKB+KC/NKEIbJiOIvb7jLWCydV32jpIWP/S3TW7?= =?iso-8859-1?q?WDG6Tukj42N65SvdiMH/p9JPSBm8pQCR9vyOk3XaYSCwMnwrTUQ?= =?iso-8859-1?q?JOrJQHMBcMLR4Fug/jvekPwazyUYOWOKewnH6Ckd3qyEm7zrH/1?= =?iso-8859-1?q?nPanbWyEsgDYLXIz+Y046wsARBO1KRzGwcUFt2m8z4UjuArcPK3?= =?iso-8859-1?q?z4COM1aO3RGCE+sSY1Ehip3IhhZ6xeEqq5GmRg6qsD8Rf3n/Uf7?= =?iso-8859-1?q?bSWv6GrW28sxaBnjttGdfG16k/zIUSlsjOFTzjdLp++wkMnOB7O?= =?iso-8859-1?q?/QMvLNb0ld2YtQjHy0r0e7Ag9QDTQU+/ThFL+GDHhq0Nfw2D60i?= =?iso-8859-1?q?v1FhiYbjG3+zZNBHcjMC2sSjesg+8B5JKKzPAnNqjzyQIvOwHFO?= =?iso-8859-1?q?WUy+Sz05updHCCV01MzmerwPoa+SylTzZumV8QG1yl2ijaApg5J?= =?iso-8859-1?q?TF9ZVzGIuTLxm9i+Bibm8toY1Q8MMND9wdN7GOFdC33fj5tCZJd?= =?iso-8859-1?q?xTWEa2GyZym9izGaOG3bsP2Ts2d4Pxi2rJBovBknS9hvGaNLPlq?= =?iso-8859-1?q?D6GeOJPDbQcO/KMqNzSA1Apu+qn5uw51fli9uThJY1GWJMiqkPO?= =?iso-8859-1?q?lB3h23mqYmp22bFW7FKMjAyBeJFGFRA+vCeBjIxhkCB2ZMiBQFt?= =?iso-8859-1?q?tnTnjN1NFv2SQvEASSBnYi3uy1LewDrajsbixiVjB0VJ5Ct421t?= =?iso-8859-1?q?5Rk8CJTSAt0pCHHOrP3BGFA3tQsALi18/NpZguhYThFHg+g0NOW?= =?iso-8859-1?q?fHSXxkZk5rIBdQbzIfrGyX8lIvEwg7urQ03KKm+jnFAPW803u1N?= =?iso-8859-1?q?neQv2Y0OxL3E6DP+eRxdz2shZ0+twN1F/vifMaaOswtQj0RG7/J?= =?iso-8859-1?q?xlWGQreSirHZceX8gKAiCceEl+TPW2kE+tUerDuJ0y/I3csQJQc?= =?iso-8859-1?q?vSlu10xLcswUQY7B5pWHRtp2s+8qMsyGzv5GivI4OC7yZ05Cfks?= =?iso-8859-1?q?hZ5goWjnQERdxA=3D=3D?= x-microsoft-antispam-prvs: <DM6PR04MB5513DB5C64FFF0B8ED4ED4A68D7D0@DM6PR04MB5513.namprd04.prod.outlook.com> x-forefront-prvs: 0954EE4910 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(136003)(376002)(396003)(366004)(346002)(199004)(189003)(81166006)(81156014)(386003)(486006)(11346002)(6506007)(26005)(8936002)(6116002)(3846002)(102836004)(68736007)(7736002)(71200400001)(71190400001)(99286004)(97736004)(52116002)(305945005)(5660300002)(106356001)(476003)(446003)(2616005)(36756003)(186003)(76176011)(1076003)(4326008)(8676002)(44832011)(105586002)(54906003)(86362001)(25786009)(6436002)(6512007)(66066001)(256004)(50226002)(6486002)(7416002)(53936002)(14454004)(2906002)(72206003)(316002)(110136005)(478600001)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR04MB5513; H:DM6PR04MB6059.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: Y2Iu+cd2ppQUy2baaVUXmouAaaOofHl0H9vGK5a+AlAqWhuwg5oSN0+QS8TIZooEC6Uu5RhjkT4AEtgAC36+tIVa+88odar/wO/Vy7f2mKY85w1KYh2kjdrV5b7NU0sPitCYE2/H8F+aVE+CRY+bpIjL4PqBq2lnTsKt+RrLKS6z1Y0voE9pA8quST/OFBrQnE4T+kZT7ITMXho0ANbxQr7CZZPOHlXczNcCfAQ+8Q2Aocj2Y7XSSKpvxfELRsq9hkdtU0erwhg4qaskwdfpelr9PQUbFhYOlkS0dWp15DgLfHVlQQ/NQ70i91U8H31cJTypM0+BiHqVVk0fP8TayYr2NJBH1T11zNXcgJUvGyfXEYCm/AeL7QJeNR0NB3O8dxmxS+SY2kDYvFdAMnO8CriGI72T5DM3Qfcyo+Imra0= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71fc52e9-3b82-41bb-e50a-08d696f6c781 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Feb 2019 05:46:32.8322 (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: DM6PR04MB5513 Cc: Palmer Dabbelt <palmer@sifive.com>, Alexander Graf <agraf@suse.de>, U-Boot Mailing List <u-boot@lists.denx.de> Subject: [U-Boot] [PATCH v8 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; +}