From patchwork Tue Mar 17 21:19:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1256967 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=85.214.62.61; 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=njizNXnn; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 48hmLH2bX2z9sPF for ; Wed, 18 Mar 2020 08:20:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 416478157B; Tue, 17 Mar 2020 22:20:31 +0100 (CET) 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="njizNXnn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 92E7A80E7C; Tue, 17 Mar 2020 22:20:16 +0100 (CET) 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 esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (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 A75F5812D3 for ; Tue, 17 Mar 2020 22:20:08 +0100 (CET) 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=3382782c6=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=1584480009; x=1616016009; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Iion5CUeCPY2TmsrIANBc+Hj8ARafdjtPnkjdyk+9eY=; b=njizNXnnHIr7A5Ko97Uu/ZJFgpRSTFdTOgnCHkEBpyMckGvfeMN6XRvU 1xUxOvo2aSRWdqvHjLqBxDJSfC4bIo8p/9QuSxeU9gZd/HAINp+3DYJsk FJLhH0MsryHnMb/Qezpbr2LenMkcrVgRhQijmCSOH6P347iSBcAB7Ba+b mJIwOwUVpaIxRgCPCp5K/wfzIPdIRBvsIQQtHGh6DQkewKgJXcibpTkh0 5t7s7rxgNuNdtI9m9rJ0ENSIOU2wQDdTjvZXYkK6RhWNi3S/DkDtgylsu aYlQW0JVs0vm/eY2w0dqJdpqpSp5LiQjWJoS/Kdkv/kihX7v+zB8Z/nIY g==; IronPort-SDR: BAHwqfliW1TwKgnotQoSMXGWmyyiFXi/U5FTy3ubbj2UGJ6M4M3J3IVyUc0N5gR37vhRyJQvlF 0V22khc+kW4ZgOZ68ZAiDklqhLNVuyAhisB8sS+SMb/zVYQiHA0UcW5gCTZPONWqPtuxR0FgtG txTW/sSFX4RxdKzxoeD5hwQc7c30Q6u+fwNcoh63a/CRgmDw/xkQKgv4CsP1+BHwIUfVfHbkhg bvFI2WT+Rp0JcHZhzJg8W6KFw2u4OtK/UeO8FOpB1lZFsxL9DvGlHK8q8bWQNsm9KlhgqixdTK h4o= X-IronPort-AV: E=Sophos;i="5.70,565,1574092800"; d="scan'208";a="133222684" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 18 Mar 2020 05:19:58 +0800 IronPort-SDR: ERI+IH579eNJ0TX4sBvIdIs3eMXnI6Ns0f+k1aL3eGmQUC1GpyPN93waOtGwwszjd2wtKJeyr0 rPvrh7nTw9L9o77HDKFq53E3Pb5KsFGXkYfskEDXQbpyd406kxOl4ueKfC19XYCNopqNON6qLb ZeIJdvLONyf2gVot3y4eU+Nme9xSznJpdS8VqVytPCHGApboy38GrI9mTcj92AeXGBryoLvgyd kawRDcvjOxrsGn+h7ZpTTinnrk6YYviD3LP3R0fuWxccxwCePNV44jGzlirVVlVS8OMvco3nMc 6f4twQi5sFpymfqCHB1RBGeX Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 14:11:24 -0700 IronPort-SDR: IH+XJNSgiJnCgXbnHL3AQQX+6XwCU5aRPuwGjcYxiFRzKwTa26JSec0ifLx6kuXPTR5flNPsPt FPyPRudls23pU2eeDGToXbnyj3Jb51drZiL89bQd608/BNIRvaXt0oSUHo6p4aW9i98TEVOMyi ZNdd4Rs9lQHPvIV9jqsNUwRLrZyClKd4P0RDr/bad8QU3eitYJdyKqoHJW6g//nnlX1XXDdUMW QEvY0vTAcbDYw+RZDqSzGzDRW4UqQqmnCKE+DgAj6o30e/aGj4AT2+COgNDjgW3hDsQzOeqUBB Hnc= WDCIronportException: Internal Received: from mccorma-lt.ad.shared (HELO yoda.hgst.com) ([10.86.54.125]) by uls-op-cesaip02.wdc.com with ESMTP; 17 Mar 2020 14:19:57 -0700 From: Atish Patra To: u-boot@lists.denx.de Cc: Atish Patra , Alexander Graf , Anup Patel , Bin Meng , Heinrich Schuchardt , Lukas Auer , Palmer Dabbelt , Rick Chen , abner.chang@hpe.com, daniel.schaefer@hpe.com Subject: [PATCH v3 5/5] riscv: Copy the reserved-memory nodes to final DT Date: Tue, 17 Mar 2020 14:19:46 -0700 Message-Id: <20200317211946.28062-6-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200317211946.28062-1-atish.patra@wdc.com> References: <20200317211946.28062-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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index 5e907e96701c..1ca8370849a0 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -118,6 +118,11 @@ int arch_fixup_fdt(void *blob) fdt_setprop_u32(blob, chosen_offset, "boot-hartid", gd->arch.boot_hart); + /* 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; }