From patchwork Fri Jun 26 01:16:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1317302 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=A0F40KGp; 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 49tJrs1Pwtz9s6w for ; Fri, 26 Jun 2020 11:17:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC47681E73; Fri, 26 Jun 2020 03:16:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="A0F40KGp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 48AEE81E73; Fri, 26 Jun 2020 03:16:20 +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,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE5D381E6C for ; Fri, 26 Jun 2020 03:16:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pj1-x1041.google.com with SMTP id q90so3485968pjh.3 for ; Thu, 25 Jun 2020 18:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=e7ZFY4W7tjQibExuF3yRAhB3I+q0U46FE9+jf9jo3Kw=; b=A0F40KGpNsErr/+KroGc66I51IVBhtX1tNJhqMOb5lVkW3chUiRtu8ybk19+3LnCYT 0l26crpz0uepUucTh/lfe4wPHlGLkET6M2yxP/45wzfTEBQP8Gkpqj3Zy4D7BOqNGSyn n+i1R4wN6XBpHlSzkLRmd7VPOq0eQajPB25pPgbZMjwUFW9XGOXkiqg/tFg4sCmNhGT9 Exahdb1FX+uzs39tTH4MStOYDDBRNmIhjM9o89gJ1BOU5O3iUQXb6NJSu0eg50hFbfqm Qs+TZpLNXfRKrXA0h/4d55k6s6FpM+2DBvKcoKcEFRmlqu9iETPbrLvHKuAMWB/IQT3b ypWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=e7ZFY4W7tjQibExuF3yRAhB3I+q0U46FE9+jf9jo3Kw=; b=mTORo51X6ihSBOCNX9EtYeDiKVdSdPs2cKA27+LcwbAXYVHgHrF4PJ55D+fMV9CQT4 XZguMvpd+JdHnC/Sb4nzk00S58XKoRQsN8GL+dCZzL4Kr16xoERSlXUUJf4KLa7ZejrV NDKc3cq9TV6OUkBGAyWy4JzUemPzep/hN+RD/V1DQ+t3vX0h9qd01E3yEjlUhzRF4AUK DD6x3GITOcR8mx2rDnlliC4IjqQ84X+xT/c0KOWm91k3GOBKX0D2+hBK/Vlea57lC378 3+udt/5koubhxqz3A+iIYOmlTMwN4HqDpKJvHRBaMZXgMkEi3sUg1KiOtUmEPV7OvLoD D3fA== X-Gm-Message-State: AOAM530mkWv7dn1tJGmWaK/yA4R0iE6Tngc+6YEDSs/MMipN0xJJyB9t bWtW7zvcBHjLTWjcPCxDKwg= X-Google-Smtp-Source: ABdhPJx67tHfjBd31k4xyYPWBFf0u68KQ5JC4wOfi+8cRs7GNCzWQIxQh19I2P70QkmcvCSOb55hFw== X-Received: by 2002:a17:902:c411:: with SMTP id k17mr462370plk.165.1593134174972; Thu, 25 Jun 2020 18:16:14 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id e191sm3268702pfh.42.2020.06.25.18.16.14 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jun 2020 18:16:14 -0700 (PDT) From: Bin Meng To: Rick Chen , U-Boot Mailing List Cc: Atish Patra , Bin Meng Subject: [PATCH v4 1/3] riscv: Avoid the reserved memory fixup if src and dst point to the same place Date: Thu, 25 Jun 2020 18:16:06 -0700 Message-Id: <1593134168-16266-1-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 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 From: Bin Meng The copy of reserved memory node from source dtb to destination dtb can be avoided if they point to the same place. This is useful when OF_PRIOR_STAGE is used. Signed-off-by: Bin Meng Reviewed-by: Rick Chen Reviewed-by: Atish Patra --- (no changes since v1) arch/riscv/lib/fdt_fixup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 6db48ad..5f523f0 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -82,10 +82,9 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst) * @fdt: Pointer to the device tree in which reserved memory node needs to be * added. * - * In RISC-V, any board compiled with OF_SEPARATE needs to copy the reserved - * memory node from the device tree provided by the firmware to the device tree - * used by U-Boot. This is a common function that individual board fixup - * functions can invoke. + * In RISC-V, any board needs to copy the reserved memory node from the device + * tree provided by the firmware to the device tree used by U-Boot. This is a + * common function that individual board fixup functions can invoke. * * Return: 0 on success or error otherwise. */ @@ -95,6 +94,11 @@ int riscv_board_reserved_mem_fixup(void *fdt) void *src_fdt_addr; src_fdt_addr = map_sysmem(gd->arch.firmware_fdt_addr, 0); + + /* avoid the copy if we are using the same device tree */ + if (src_fdt_addr == fdt) + return 0; + err = riscv_fdt_copy_resv_mem_node(src_fdt_addr, fdt); if (err < 0) return err; From patchwork Fri Jun 26 01:16:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1317301 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=WWs+BDwL; 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 49tJrg675Yz9s6w for ; Fri, 26 Jun 2020 11:17:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4360981E25; Fri, 26 Jun 2020 03:16:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WWs+BDwL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E2BE81DF1; Fri, 26 Jun 2020 03:16:20 +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,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6B2D981DF1 for ; Fri, 26 Jun 2020 03:16:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pg1-x544.google.com with SMTP id e9so4202746pgo.9 for ; Thu, 25 Jun 2020 18:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vsX/VG47n+RrRXVo0UW5wEyfNEUIU7xxRSkkugmwWrk=; b=WWs+BDwLW+hU/AXRgyJMtfAmTQwWf0k3CG4W9Mg3do8UqrbcxC2UWomu8zV1mset6a MNBuMEF982UATYc9SD7RotsAphN9PqSsfZVObXWRv3b2/hhzCgSG5nbdlHhnZNSH/WPu hKHhIFxn3h4cZEpL3btxPvbSMTQdpslZQh26/RLc+5qFr3b8dhDpOgRM2dnRhh05wd9S QracJBOyXKsfo+RwG8EdgRufA6SZYSPkD+geHMeMJfP5kp9JQJypW/5CRDDf8wDXvXpd 4aeIXT8ML5iciImzk7hhO5M10BOOqowMOaWtlC23pFJc3AQwmvTZqeYhiJMlqy3lEVEs Qv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vsX/VG47n+RrRXVo0UW5wEyfNEUIU7xxRSkkugmwWrk=; b=d2u+Yi5Is4p8vjttHMmoY8v+yY7bbrWxTo0gMoibeAhxUdgeXkQpqY2pQGQFVBzaLA v/coUDdVdRuzjo2SnZH/knKVabgJ7c/qXuiMSNuGpr+0HFmQIW/PbwH8nvQG7Y8Cg8oo 40utkBj25cXwUuNbMvmzv0nMOq0dt/SrB+zaamkw6aB3qtoMtLiDuscwVyvIUeRPOi5H +ZPVV2GY14Qg8+Yg2EDLieHfm34dE3f/bczMPYLNjSqEedG5I9noFRQoCkk/iqeEgHuW D/J9UZ76KUY6k2PmGHwdYuU9hX2+iHmVZiDRkyiETAdNqMh/RcNTzIVNuO6R2gH7QdrP uArA== X-Gm-Message-State: AOAM5303Tw6n/zBpIohLjvGddXYlpV++mKUfeEH746b0hlcgFW/wgiEr cY11LnzmbfAwRHhlIcmE5cE= X-Google-Smtp-Source: ABdhPJwt/2GKIVFmQSnbjGhGh7CQGtGkkoNB3otSsQ3nttKZVNaa5HXdQ531AC+FlADjmptDVQdH0A== X-Received: by 2002:a63:9246:: with SMTP id s6mr569491pgn.22.1593134175796; Thu, 25 Jun 2020 18:16:15 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id e191sm3268702pfh.42.2020.06.25.18.16.15 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jun 2020 18:16:15 -0700 (PDT) From: Bin Meng To: Rick Chen , U-Boot Mailing List Cc: Atish Patra , Bin Meng Subject: [PATCH v4 2/3] riscv: Expand the DT size before copy reserved memory node Date: Thu, 25 Jun 2020 18:16:07 -0700 Message-Id: <1593134168-16266-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1593134168-16266-1-git-send-email-bmeng.cn@gmail.com> References: <1593134168-16266-1-git-send-email-bmeng.cn@gmail.com> 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 From: Bin Meng The FDT blob might not have sufficient space to hold a copy of reserved memory node. Expand it before the copy. Reported-by: Rick Chen Signed-off-by: Bin Meng Reviewed-by: Atish Patra Reviewed-by: Rick Chen --- (no changes since v3) Changes in v3: - Extend the FDT size by 1024 bytes arch/riscv/lib/fdt_fixup.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 5f523f0..160ccca 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -41,6 +41,18 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst) return 0; } + /* + * Extend the FDT by the following estimated size: + * + * Each PMP memory region entry occupies 64 bytes. + * With 16 PMP memory regions we need 64 * 16 = 1024 bytes. + */ + err = fdt_open_into(dst, dst, fdt_totalsize(dst) + 1024); + if (err < 0) { + printf("Device Tree can't be expanded to accommodate new node"); + return err; + } + fdt_for_each_subnode(node, src, offset) { name = fdt_get_name(src, node, NULL); From patchwork Fri Jun 26 01:16:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1317303 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=XjqFRrjX; 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 49tJs23PdGz9sRN for ; Fri, 26 Jun 2020 11:17:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D9B081EEB; Fri, 26 Jun 2020 03:16:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XjqFRrjX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 657FF81E73; Fri, 26 Jun 2020 03:16:23 +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,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3D9E781E04 for ; Fri, 26 Jun 2020 03:16:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pl1-x642.google.com with SMTP id x11so3625454plo.7 for ; Thu, 25 Jun 2020 18:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KOgpfnLpbUtUkquaetiNNmuI/UClylMZSkhCMj9EFWE=; b=XjqFRrjXDR4gx8PJ5rOjXisaYVMyaIZLjs8eW8QvC7LZpbRVq++VVdFHABcI1XR+eT /apM9uwTCawKEHudZNCVOOphp1A0nSVP1OXTV5IjPJALiI85sVjOWT+2skn4REEI/FEV OjMXoq6G4RhvRTWe5h9DV7YVE1AOcsCrgNLEPQax1pH43cEDMfCxGAUSR8Kz+0gDNvWm /Zcvzh7UlAQt+bZKfClP9EMNtqpVi5+0u2+Drp6Vk8HuP+pcjSCV9k5Ebrul9i8uWaPX TJdyFQ9sSzsr0CKD/eEdNLmg/RX2GwUNduOXl/gXVwpdCv2KgPJIuAVNU8GBsMEy+rrR siqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KOgpfnLpbUtUkquaetiNNmuI/UClylMZSkhCMj9EFWE=; b=Okq8sg4K1FLeOWf8d3J82JLbFN1ae/IaU15G+zQmezhnIFpnN+/5a87wcc92t9Ekol kYcUgz5T1rRpQrB1RDFAVQA2tE3Su5XzaV5T8MGmY9iHZd8uVIkKHMPYYIMByU7/pGCs 1dQL9G3xnNU6wJgCfF/VlqdS5KZ4498RK8hxHnOkLeF6aJOVlBBIK//NAs4/UV0n86l5 i9oooEvsGVuVlql9b96tkJefDUMUaK5nRltayPG5wH9oMdd2j5ITBG6fUkvWvusNRaTB 9EfQvtyoz7a8PSI3hwj4sqkF+y0x8E75xtYX1zDiNJWE6pI3xJmS7YPWxAd2DThm8v5W D9ZQ== X-Gm-Message-State: AOAM533StVpwNEyvTQGlRCqu4JbVFJJ1G9KkVTDL+jCNngvumR1kStmn KlmFbLGL4Qg0hbJxO3BxVN0= X-Google-Smtp-Source: ABdhPJwR2tO/w0Tv3KUi+qfqL57v1533IcziAlTuD5gxe2rRIcUgOuRHpcc6zBWRjB5hbDHy5E9MXg== X-Received: by 2002:a17:90a:db04:: with SMTP id g4mr751853pjv.53.1593134176718; Thu, 25 Jun 2020 18:16:16 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id e191sm3268702pfh.42.2020.06.25.18.16.15 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jun 2020 18:16:16 -0700 (PDT) From: Bin Meng To: Rick Chen , U-Boot Mailing List Cc: Atish Patra , Bin Meng Subject: [PATCH v4 3/3] riscv: Enable CONFIG_OF_BOARD_FIXUP by default for OF_SEPARATE Date: Thu, 25 Jun 2020 18:16:08 -0700 Message-Id: <1593134168-16266-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1593134168-16266-1-git-send-email-bmeng.cn@gmail.com> References: <1593134168-16266-1-git-send-email-bmeng.cn@gmail.com> 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 From: Bin Meng Starting from OpenSBI v0.7, the SBI firmware inserts/fixes up the reserved memory node for PMP protected memory regions. All RISC-V boards need to copy the reserved memory node from the device tree provided by the firmware to the device tree used by U-Boot. Turn on CONFIG_OF_BOARD_FIXUP by default for OF_SEPARATE. Signed-off-by: Bin Meng Reviewed-by: Atish Patra Reviewed-by: Rick Chen --- Changes in v4: - /s/needs/need in the commit message Changes in v3: - change to "default y if OF_SEPARATE" arch/riscv/Kconfig | 3 +++ configs/sifive_fu540_defconfig | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index d9854f5..ff8a9f8 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -273,4 +273,7 @@ config STACK_SIZE_SHIFT int default 14 +config OF_BOARD_FIXUP + default y if OF_SEPARATE + endmenu diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig index 8d412f8..32347c2 100644 --- a/configs/sifive_fu540_defconfig +++ b/configs/sifive_fu540_defconfig @@ -16,7 +16,6 @@ CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_YMODEM_SUPPORT=y -CONFIG_OF_BOARD_FIXUP=y CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SPL_CLK=y