From patchwork Tue Mar 24 04:16:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1260453 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=ayOcTP58; 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 48mdKV3jvxz9sSJ for ; Tue, 24 Mar 2020 15:18:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6AA8A81881; Tue, 24 Mar 2020 05:17:57 +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="ayOcTP58"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8A9FD81827; Tue, 24 Mar 2020 05:17:24 +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 esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (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 EAAF181813 for ; Tue, 24 Mar 2020 05:17:11 +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=345a454b9=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=1585023455; x=1616559455; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=15wEaSM5+aJTlTiM9DMRllUUNc6sZN1168dhM8zY40U=; b=ayOcTP58v2/pQNzeQKKL07WtqFa/m3dbJ1Ij/5gZgd4cvik2eVcyWbpQ NTxhz0pt/rMHAPAOrPkZ1HFrAaHVMTqmLxNmyi7r1JRz459upba8vQ+Ze /EWDCwn7TsdYVG2sAX/YT8h18JXXu2y09djkJSxJr6CFtbg1qnHXBAq8q vLO207A/k7PBE4WVOyPMkBe5AKL8+P1vZ0fTvVxmzoEJ7xmp5wFsbtAf0 HGOq5GnU8zTtP/RUnqM2OAzUES7oTE3lkOe7kF1wE7EEGAnexHbNDuIw5 D/JzjcKZxV9yctnshzwCC+IXkb8kYaOlp8n2s0hDfFhqs4vg7ZOS5572W A==; IronPort-SDR: cJUSjeL2qKQi5fJXgOPH9txGUP87t+2F3l+88KH8UAUQoFM7IdAE1MYtylSjMpn5BkpBVWs7ry gP8h1++Rv/emybwVcCxwS1VDKZw9AulLs/DLWKkzXH4Ggiba53H3IjNzkqCQ5qNMxOAeyHPS4w 6m2eVtgyI8zLnetm9VpOh64LkKXFm4sH3RBX9X3bRjYkHtpJ0Vg3jtp8A1BWk1cWSA6ZRZTBpB MPEOua0Lahb1dF40O0hzggc+6Lnv8grN7uxoyYlIPqAFz0SMd1gSOJd8A1OwcaIXbOCUGkq7zf /Og= X-IronPort-AV: E=Sophos;i="5.72,298,1580745600"; d="scan'208";a="235522569" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 24 Mar 2020 12:17:31 +0800 IronPort-SDR: zANj1jJAy+FBsxdvqwInlYvyCHwKjoz5kJ+/PiKkcsNtiPqtmhM4W8Hd95SBcuV0HnTsiXdjVu sJYAPBlGAvvRDemHgtwz80Rmz39eRploooNJNNECoikPLERYTRBta8g0qV+R+9hrumq0a/en+D DRbE3eFRLQhMQupM95Bo4T2JuZrErg4actPOpaZvXsAzQKEPa3KDXghcYWDJae/O/kMgXUehMK 7RsP717jLM1FK9iMjUMpgGQfLi+MKL6SaBF8J5r/55GYouNZ9wj7j8p2Pt3NDE8yHRv4iE3MOy NCasQRGYVvCmN3gGI2kzfsau Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2020 21:08:49 -0700 IronPort-SDR: VRpR/mlizZsc/xTQy5lJXSbRoLVoRsTqk1Ar3KhiiV27mZ5d7e8clMYSU79VnKt3Md8MTi1z0N b5TOnFFI3jDMMe5ug3EwWZMvc9kDBUdeVwOu9kxSnShqDTaqfgh89K2V+c9iiy18BrnJlcMPRv gBVkUV2zZSE6rLIB1/3lIFOjvx0MZ2wyxT9P/nZQXYRF6V5UOtW7c3RP4aTkXiAHUfEl69bCJF lZxdUgd62MTAXc7ztth2/NU/UVZBK1NaNqn/wnv9mWbA/pkYDvifV408B33zu/06M6WDXe3zMl tXY= WDCIronportException: Internal Received: from cm122g2.ad.shared (HELO yoda.hgst.com) ([10.86.54.193]) by uls-op-cesaip02.wdc.com with ESMTP; 23 Mar 2020 21:17:09 -0700 From: Atish Patra To: u-boot@lists.denx.de Cc: Atish Patra , Bin Meng , Alexander Graf , Anup Patel , Heinrich Schuchardt , Lukas Auer , Rick Chen , abner.chang@hpe.com, daniel.schaefer@hpe.com, Thierry Reding Subject: [PATCH v4 5/6] riscv: Copy the reserved-memory nodes to final DT Date: Mon, 23 Mar 2020 21:16:49 -0700 Message-Id: <20200324041650.280302-6-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324041650.280302-1-atish.patra@wdc.com> References: <20200324041650.280302-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; }