From patchwork Sat Apr 18 06:07:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1272569 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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.a=rsa-sha256 header.s=dkim.wdc.com header.b=Bu2MMXm1; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4942f614YJz9sP7 for ; Sat, 18 Apr 2020 16:11:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6FC8681A4E; Sat, 18 Apr 2020 08:11:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="Bu2MMXm1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8D6E8819EF; Sat, 18 Apr 2020 08:10:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CC98D812A9 for ; Sat, 18 Apr 2020 08:10:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=370d05252=atish.patra@wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1587190224; x=1618726224; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=15wEaSM5+aJTlTiM9DMRllUUNc6sZN1168dhM8zY40U=; b=Bu2MMXm1CCiyo2qoMI4GpfS20GGdNc2oS+7oW/yiXZSs84kMPHsm6van gBk3y9utUHlSO13GZiPdi17TRmmviZO7CkDI3hX4H4WbZKzD6oLCU6msp EeYv1tDjY2Sgrcjy6r4w3iOsdh+bnwUAMGuX71y8X/9q+NDAz7Ieo30KM s61GR/RUruIJwbBqUybwScr4tdNMOBFqetMPyCmIC5NUCUZi4WkocubGW TrlmbEO9laXQJFC3xojhtKsAkgx1eP9nRmtlV1qGUFZEM+rzNpioSoONn wrhwGRbloDZoo+DM/yURp2LW1nSYDLnfF89LYYeGooWtf6EVF1amJilQ+ g==; IronPort-SDR: luvhiBoeGvOhAAXYp3pE2MvQY1b82LFbv3vTeU1/3AF6mDDeT95ZetorjPSecb094B66qyFvHo eoVZsigF8RKAOEboR5scD3M3PBf75lJMnuIxZEmEASZm2Mlcx9nUQbQsmRTwLFsaHBuGsRjbUN rHSig0nVYM3V2ZKl9Ecxg2YryZdOCZQW6/EPBkVYR5suHnG2u1hJP7fDjYNafXGjpTqD69Doxk 8ZBsutGHdq+SCNl9jixnmn1GeEPSIgiQnxH9+RfaBblYfIz5zQAbUNl7OC+y3SbEyGHm9SfX8H AbU= X-IronPort-AV: E=Sophos;i="5.72,397,1580745600"; d="scan'208";a="139952080" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 18 Apr 2020 14:10:21 +0800 IronPort-SDR: Vh5s3JmlgTZTzXu4S1BoDERJzNuebI2IvRjtXWJpbZmurqkHSRghzuBKLCbshEmcfc2dG4MRO2 4yQIZ8XpS0l5f1E2RqgixOHvmS+spq3O4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2020 23:00:45 -0700 IronPort-SDR: Lb/+ZGNqEl/+S6HOCQN3eztn5UHQG4JPTdRSNAaxXCSqpbxjTHQV59VmAg9BqYYLxlFH2sC5ih EB2ufhLEgSnA== WDCIronportException: Internal Received: from 5s19j72.ad.shared (HELO yoda.hgst.com) ([10.86.56.13]) by uls-op-cesaip01.wdc.com with ESMTP; 17 Apr 2020 23:10:21 -0700 From: Atish Patra To: u-boot@lists.denx.de Cc: Atish Patra , Bin Meng , Anup Patel , Lukas Auer , Heinrich Schuchardt , agraf@csgraf.de, ard.biesheuvel@linaro.org, Marcus Comstedt , Paul Walmsley , Rick Chen , palmer@dabbelt.com Subject: [RESEND PATCH v5 5/6] riscv: Copy the reserved-memory nodes to final DT Date: Fri, 17 Apr 2020 23:07:57 -0700 Message-Id: <20200418060758.4839-6-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200418060758.4839-1-atish.patra@wdc.com> References: <20200418060758.4839-1-atish.patra@wdc.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The DT used by U-Boot may be different from the DT being passed to the OS if the DT is loaded from external media such as network or mmc. In that case, the reserved-memory node needs to be copied to the DT passed to the OS. Signed-off-by: Atish Patra Reviewed-by: Bin Meng --- arch/riscv/lib/bootm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index 87cadad5016d..8ff8db6bf533 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -28,8 +28,8 @@ __weak void board_quiesce_devices(void) int arch_fixup_fdt(void *blob) { -#ifdef CONFIG_EFI_LOADER int err; +#ifdef CONFIG_EFI_LOADER u32 size; int chosen_offset; @@ -50,6 +50,12 @@ int arch_fixup_fdt(void *blob) /* Overwrite the boot-hartid as U-Boot is the last stage BL */ fdt_setprop_u32(blob, chosen_offset, "boot-hartid", gd->arch.boot_hart); #endif + + /* Copy the reserved-memory node to the DT used by OS */ + err = riscv_fdt_copy_resv_mem_node(gd->fdt_blob, blob); + if (err < 0) + return err; + return 0; }