From patchwork Mon Apr 6 20:44:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1267080 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=hB0yfLwG; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48x2pl4XYZz9sP7 for ; Tue, 7 Apr 2020 06:54:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3921A812C4; Mon, 6 Apr 2020 22:54:29 +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="hB0yfLwG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 571D181577; Mon, 6 Apr 2020 22:54:28 +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 esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (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 96C528006D for ; Mon, 6 Apr 2020 22:50:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=prvs=358c7da5f=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=1586206210; x=1617742210; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=15wEaSM5+aJTlTiM9DMRllUUNc6sZN1168dhM8zY40U=; b=hB0yfLwGCyQhtRWt96A5wDFd+wq5GtN2AVissDSh2iTxdW9wRJUHNv0l ef+NPEuoqgJv/etsjjpxgBOD9g38phAH94YYtQ45GO1x500Xd060RmOp7 8AJcyaosv/EU3uru4jTAsAPj+0kp59K8tqn++HTsLZj3LpHW0qZzMvUTx 1UbjpZM68CPLIgFtgBwqmt1Oeci/BShHmlxjGk9MK+shpFJ81kEFqpugO d211cNbDdsu/2V9qMjn//4YSVd9oh5BbNtMnfYsv8GabJ9mrLTEe2YQOT Ioe7V4suO8Ggro+PPIRNT7gijQVo41qB96WWJ/xoawUQw04gzv1lmMRZc Q==; IronPort-SDR: UD7NONT0QoC9QX4hpbU9KF20BKD4VcA5IUKHihThnPoQxdhwfUJZYpmUtJcolRtbQHXXq9DlMv 7zPlRiqfot5YSGUdQefnks2tF8Av+Si0uPHZfB+n+Dq2wf6SNfCT7M5IG1Y8V9Lu5KS9KW80O1 3dAM/6B3MYyfYTW3FMdisA6rBM469YN4URCBuY7o8YfhxIzUCK9fgs989+l5glUUvugknYs+Va +6MSfYorREf28tU2kfnSw2uEFS/A3yqHrZV3oDPlrLJaQdaDt78JWThg9Unh51tJciIyP8kJmn 3sw= X-IronPort-AV: E=Sophos;i="5.72,352,1580745600"; d="scan'208";a="136167708" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 07 Apr 2020 04:45:00 +0800 IronPort-SDR: pvxRrue3RhDZ8kMv/SmY7MoinpAvwME/rPmusJdcu77dP+ggR2dfNurd98MpW2PJKnsUaWJBya V70tajKFO4PBRyX8RUR/UMuEzd30EZOrpKFljEqa0FNUgjsA/as0wP/6NhYhMqNqLxE5ip8frW NQ0tzFJJh0u/8+10SREiFh6/hftP9aXUV3c3Q1ousVfvdIPVU8dq2NGXrutJjw310w5yrBR/4Q NBQIocGYOeE9OI8xOO3O68WKJOQtzYg5+H7L2/L0ahSqMkcrndPFydzXIY8BpvRAlg2Yh0pdeX QU2mCPVgo8UNZVYTmqLVcDda Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 13:36:17 -0700 IronPort-SDR: XAaT36TQZBScQmv3jq7Bdk8ebtYjLSHVGyb/v3fyCAPsSz1FtyMSLkfi6fko/+GG3hF++FomqG DVU8vpWRgYPifA15Nb5sg92PVPD/6zEvxexQvYLfmyqf/mcauLT8dq2j02/Pq3FV+6C/cyvZuS DJ+6EY2wtlI2kDRB8/VJ+DNA7cG+0XYpa8dEyUO/dubIyO2O3IZand7bSdgcr0MP+V6Ef4dbbl 88/CFWCR6BeW/KHQ3WckOwA1kIHP2JviH04bvTp4TTlz9k+4mDPPSD5Z6RXC9YDTdWHYcpSkAL mFM= WDCIronportException: Internal Received: from thd007499.ad.shared (HELO yoda.hgst.com) ([10.86.55.81]) by uls-op-cesaip01.wdc.com with ESMTP; 06 Apr 2020 13:44:59 -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: [PATCH v5 5/6] riscv: Copy the reserved-memory nodes to final DT Date: Mon, 6 Apr 2020 13:44:52 -0700 Message-Id: <20200406204453.231945-6-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200406204453.231945-1-atish.patra@wdc.com> References: <20200406204453.231945-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; }