From patchwork Wed Jun 24 21:56:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1316602 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=NylyGr/c; 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 49scRv4HnFz9sPF for ; Thu, 25 Jun 2020 07:56:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E667820A2; Wed, 24 Jun 2020 23:56: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="NylyGr/c"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 232898208F; Wed, 24 Jun 2020 23:56:25 +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_PASS,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 2FC178208F for ; Wed, 24 Jun 2020 23:56:20 +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=4379450a5=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=1593035781; x=1624571781; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7sVNaRVUAqs2yoqMiruSjF4WC1lss3lE7QsijFlj+Y8=; b=NylyGr/cl0bmkO49Me/1Pnca7G5IZKL5bFYzYKjyzDWxKuWaqJa4FeMe L8ZJrL4dLW1IEflFQisz9VY6DmkK9Sn+sITPHcbXbLncg3v8EWvUIw7hA QzW+TW0LOIcXQuyS+938spKVkgf1eqrA1FuR8rfmHaOJlZMEUcLf0//v4 uYuHpx2E6/EfpdhoSuc5edHoFSjouB2dnWM+iNWffZNNSRJJGDYnAJts8 VD6ZVf8uulGQKMKuAdml6lvaquZS/9ut6+XG+OvbClX/PQvDw6w2iN+57 fPgZbBR19g3uy+qaL0KQ2m4/p1+sGfDXTQRaMydjQUVGqT3v84v+QTib9 Q==; IronPort-SDR: CCWjUqZYUKz/9WfpsmkknjYRA8H7dPCl0VcAPlfyf4RTaA93ftdUiQHo3tVKDNRE/EGX4i6X/W 1R+jWwMuYCYRLMR+k6cXNcrnACuscxfKRVeBglGChbur4chQKm2vdCfXpz+K41/ftcm5ytP3wO A3psEA6RAj/pI/k/KOi9aVIWyMAVQg4SDxLCRPOzRcCUIMdsxd8mi+CB7lMQ1mI9jmf0Asp0yx 7p9F+/9QsM9s+zzv7GCOkICjfKEF5TnMNYvhrfDtZDSj+H3ib0LmvT/Ba/97rPg/P15TzxmQlL Ml0= X-IronPort-AV: E=Sophos;i="5.75,276,1589212800"; d="scan'208";a="142209014" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 25 Jun 2020 05:56:17 +0800 IronPort-SDR: zxeDGnD65ueh4Upb/RsN6JYffrHETT08Hw0YXx1eVi2irTcvq0S79xnYCb3i9+vft2m0UJUOMb /ZbUgO9pXNpqp0GgFroiLnvcXN+VeD6Tk= 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; 24 Jun 2020 14:45:19 -0700 IronPort-SDR: tqprfFCPurjZlOmAKFlADonTzhoqcU12oRzLTunVb1EDVq2XaVRAmCLZ3p7rRzPRJV+vrup2kg YNvbzejDH+KA== WDCIronportException: Internal Received: from usgvt6l72.ad.shared (HELO jedi-01.hgst.com) ([10.86.58.190]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Jun 2020 14:56:18 -0700 From: Atish Patra To: u-boot@lists.denx.de Cc: Atish Patra , Anup Patel , Bin Meng , Heinrich Schuchardt , Jagan Teki , Marek Vasut , Simon Goldschmidt , David Abdurachmanov , Tom Rini Subject: [PATCH v3 1/2] riscv: Do not return error if reserved node already exists Date: Wed, 24 Jun 2020 14:56:14 -0700 Message-Id: <20200624215615.19256-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200624215615.19256-1-atish.patra@wdc.com> References: <20200624215615.19256-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 Not all errors are fatal. If a reserved memory node already exists in the destination device tree, we can continue to boot without failing. Signed-off-by: Atish Patra Reviewed-by: Bin Meng --- arch/riscv/lib/fdt_fixup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 6db48ad04a56..05ca41b49dda 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -62,7 +62,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst) pmp_mem.end = addr + size - 1; err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem, &phandle); - if (err < 0) { + if (err < 0 && err != -FDT_ERR_EXISTS) { printf("failed to add reserved memory: %d\n", err); return err; } From patchwork Wed Jun 24 21:56:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1316603 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=eYUiWano; 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 49scS41xDyz9sPF for ; Thu, 25 Jun 2020 07:56:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B88B82095; Wed, 24 Jun 2020 23:56:40 +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="eYUiWano"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E98682095; Wed, 24 Jun 2020 23:56: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_PASS,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 096B282095 for ; Wed, 24 Jun 2020 23:56:21 +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=4379450a5=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=1593035782; x=1624571782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7R5KHBRKOJiOsKSqdygT1DAZYuwQkyhYmzJV9/rjwoI=; b=eYUiWanoV4Pb9p+DNNm6ubGfolffApKh64dOhH3pxFibX22Y1yaV2k9J Otbc+FOm5XYsqXQM5nS9oP5eAMn7u+Lq5hPzPMdAVLE+yv1My05bILMYH zVh/G7YuvIaSFls3gyteHda00ItDzAJu5+QMXIk6oECvJcgSiuxvjcwMs t/N8RsQ/xCcqIIs8n4NCaaR6aXwjLb6XLanbqN7ZNXYtARwSE839wJfRZ JjoDFe6qBMTV7EXA/wupWF9oszpIcd8903g+WhBFiqxKYNjhgAinALai6 b9nwDB4aPPpxnE/GsyhI0XoVu3QOvVbcNBAiRnjrauoavUyLLNevcnmGX g==; IronPort-SDR: XmgxGWAyQJISZJv9NM0ZUyPmFw5tKnxgLdMvhonfyUk5RrIwloDmS86Aa47GIIv4ioBM45xVn9 Vv6LwlEugrG0SKZkHgB/vRpSz1myHUcRnLL05Lk6mJiEYiojZZfTVe/R1IlB/sWQm6+rn228r9 ZLah+lUQgdverdTBPo/D2quJ5192QrxVVdkAn255y6u8iQcPtHJI4gBOY7oqAKKiKnZzOtQwln yzwOENgMUAVaP7mQGeizBIKaRHuXYQMD7FHchXMydJwMg5YlsJeUv4LeytpHE1ktUF9JfRb5Ql IqU= X-IronPort-AV: E=Sophos;i="5.75,276,1589212800"; d="scan'208";a="142209018" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 25 Jun 2020 05:56:18 +0800 IronPort-SDR: OykVpQj45XaxX0KRklVuRg43ZBie2omQZXE8ETAL5Hf6UBb+wyO6We4RyYUUYaWVbsnTiocepj 5t+KLW/JTH4TiJxPqvjdXAUx5Qq+NYU80= 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; 24 Jun 2020 14:45:20 -0700 IronPort-SDR: IMcF5owNcOS1169YrU2w2UFigtELU/tbyGJxNHoM2dntmKE8yUJymPrjmPVlZk9PuBSOGTfQGL A17GABa4bejQ== WDCIronportException: Internal Received: from usgvt6l72.ad.shared (HELO jedi-01.hgst.com) ([10.86.58.190]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Jun 2020 14:56:18 -0700 From: Atish Patra To: u-boot@lists.denx.de Cc: Atish Patra , Bin Meng , Anup Patel , Bin Meng , Heinrich Schuchardt , Jagan Teki , Marek Vasut , Simon Goldschmidt , David Abdurachmanov , Tom Rini Subject: [PATCH v3 2/2] riscv: Use optimized version of fdtdec_get_addr_size_no_parent Date: Wed, 24 Jun 2020 14:56:15 -0700 Message-Id: <20200624215615.19256-3-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200624215615.19256-1-atish.patra@wdc.com> References: <20200624215615.19256-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 fdtdec_get_addr_size_no_parent is not an optimized version if parent node is already available with the caller. Use fdtdec_get_addr_size_auto_parent to read the "reg" property Signed-off-by: Atish Patra Reviewed-by: Bin Meng --- arch/riscv/lib/fdt_fixup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 05ca41b49dda..fab93873d5c7 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -44,9 +44,9 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst) fdt_for_each_subnode(node, src, offset) { name = fdt_get_name(src, node, NULL); - addr = fdtdec_get_addr_size_auto_noparent(src, node, - "reg", 0, &size, - false); + addr = fdtdec_get_addr_size_auto_parent(src, offset, node, + "reg", 0, &size, + false); if (addr == FDT_ADDR_T_NONE) { debug("failed to read address/size for %s\n", name); continue;