From patchwork Thu Jun 25 07:37:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1316764 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=Gg14N/Bk; 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 49ssMP5W0Bz9sSn for ; Thu, 25 Jun 2020 17:38:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ADA37820F1; Thu, 25 Jun 2020 09:38:28 +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="Gg14N/Bk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 11C86820F1; Thu, 25 Jun 2020 09:38:26 +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-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 64B81820CB for ; Thu, 25 Jun 2020 09:38:21 +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-wr1-x442.google.com with SMTP id g18so4764632wrm.2 for ; Thu, 25 Jun 2020 00:38:21 -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=7Af8wnS7GtBlNxOI1jW1nh9NN3KpqUPh8afV89IAErs=; b=Gg14N/BkDxuMTKoTZ0y8oB+YICJYMui6Z6W/AKVLRkGZ1SX8sGW/esYoqkx6q6z/G+ alUqS8BCLxcmLuoV5PvXREiMSoqq0PSZocHy7DsNWyb02YC3Z7cosVGCf1oHaf0q1sFC lh8994naZEJD2xwEo2g2tB/j32hAZ6nzG2m3BYHnjdclP6lr5bKyx0OCb/9H6HOMEq8I oDi4h6Cs7lx3L32lPNKB+Dlq3oeo9LQyVnRfGzs9ZSYbFepKCfYFM8eMx0CJO68hMDdf ypk+fahzANCgiwaYxfR6lKWHtH1slwNPlh30iZxWWKk9kX2wTh2etZDp0CkfvufJCf/L avtg== 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=7Af8wnS7GtBlNxOI1jW1nh9NN3KpqUPh8afV89IAErs=; b=BBaPAV3BfqYmAy4ftp0FdtC2t4PMMGVdFH/krt1heM+9DVotih3Ov+Q1FsWV0Qbmvq GZf2vMW5jKri46T9bbVcRH5VaPrb6gsZxv2sDyVCCOHkeWJwRGQpArm+gKKvBzvb4CZH emBf6J7RCGqTkPLtx3WUIcUW/ZTow80hRzcm7dB9NT+rod1fMclBH+FNDmhOD+I5JSwQ 6mKhvOLErF9WlEl4Ha8sKBphd4hkteBuqHA06vT1rfjePWxbhz9o92O7ls/MnM9dJcTP xivoQerUkcjBw/0LeqDrV+IymVv5Biugn2qbl4jHMMS7U6Gk5Bepsr3CeWBGPHbm4iBu fUmw== X-Gm-Message-State: AOAM533UQHfnr3Rxz39m5VyICZjTxiAEV8IJjqSEfz8s6paj4FIik2PR beiGUd6phjHi2LJBRM2QS/k= X-Google-Smtp-Source: ABdhPJz/iRklm8K9QZC/ZyRYLd51raIXbWHW2mf4foxcaxJmssAQmE6/wyO+V1Gu8mHHsLb9cnYGQg== X-Received: by 2002:adf:fe0b:: with SMTP id n11mr34829991wrr.245.1593070700889; Thu, 25 Jun 2020 00:38:20 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id w13sm30844529wrr.67.2020.06.25.00.38.19 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jun 2020 00:38:20 -0700 (PDT) From: Bin Meng To: Rick Chen , U-Boot Mailing List Cc: Atish Patra , Bin Meng Subject: [PATCH v3 1/3] riscv: Avoid the reserved memory fixup if src and dst point to the same place Date: Thu, 25 Jun 2020 00:37:24 -0700 Message-Id: <1593070646-6774-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 Thu Jun 25 07:37:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1316766 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=jnr277Y/; 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 49ssMw2m7mz9sSn for ; Thu, 25 Jun 2020 17:39:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 905B082119; Thu, 25 Jun 2020 09:38:38 +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="jnr277Y/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A4F4820D2; Thu, 25 Jun 2020 09:38: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,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 E72F5820CF for ; Thu, 25 Jun 2020 09:38: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=bmeng.cn@gmail.com Received: by mail-wm1-x343.google.com with SMTP id u26so6083007wmn.1 for ; Thu, 25 Jun 2020 00:38:23 -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=xbU4r26L6KLKm8jbuk7MdHOtQKg9xnF7RqP4ltiVAa0=; b=jnr277Y/Rkq0Io/KKpcMOm6v8HKzWWfh2I4xHjVb5T327rdXeSBQVPu9BPhiYKDxNI 4dkRaJnonC5UORnujaTEg3DsPgFsNjivVp9P8c4RjpG/eGzk9+HmKHtdC7Q5jOjvP0Ld nuX9hT2c8jKOwYVQAkJAd8mlmgpNbf56KjGlqwynNKRALqFr4k6Q4ZWGCvZ5rzVYf+jz y2xuNPA4KtLp5RkvQ+lk6QGauUKL/pGoeHFq9ZImAgjnJ1dEx4UFdMNCVWAr8B7p8YR/ Mi1c9WADU0so3iHvXHZgA8Z5GiZzbmkRYvOeb4O+fv5xl7vhTOgJdrq5kU7KyMPjX8O6 NbJg== 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=xbU4r26L6KLKm8jbuk7MdHOtQKg9xnF7RqP4ltiVAa0=; b=d/qmidEfGGC6Ky7GasYhUb+OG+s1kn4q2XzKQDC+ye9FN1SIznn86nfIe9kW6mcBzY vqY64TlHsw/O/ixJIvt5nAuUTIzqvZCFzVGMs7BOecvcDINK/HhwOUjD3oJL6NHfKTm+ utXucMAZAGvbWBSg9pA/d5gYsyBXx7za1627Ejq2bmK/rDMQTmcbtxNXNOx5l7dOQTFv mnKsyx6m09ZIO1NYbQd9r/NXq+99lmcncjRz/hijn0N8YynOeYM1kUUtC2WQIHZkpwvz oDGyXgSNXvCIACYj3aw76Z8XkLVYmGS5++aIV3jlPqVbKVgGRP6An7STE8GCgvgkqNWk 0aZA== X-Gm-Message-State: AOAM531qfAVVdujAq08tS+nIUJsl7xAdKKG9CYHEN8Kc6A5dthL+lqi1 yPBSAWpEKqyLNH29YTpS1Vk= X-Google-Smtp-Source: ABdhPJxqUIooO9Gl2NtgLVGO1wjkLGPV/qLa+kdh6WPiI3Wmrn6Al/Dj9UKcx1grw/L8Es4ypzkvjg== X-Received: by 2002:a7b:cd06:: with SMTP id f6mr1895669wmj.8.1593070702629; Thu, 25 Jun 2020 00:38:22 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id w13sm30844529wrr.67.2020.06.25.00.38.21 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jun 2020 00:38:22 -0700 (PDT) From: Bin Meng To: Rick Chen , U-Boot Mailing List Cc: Atish Patra , Bin Meng Subject: [PATCH v3 2/3] riscv: Expand the DT size before copy reserved memory node Date: Thu, 25 Jun 2020 00:37:25 -0700 Message-Id: <1593070646-6774-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1593070646-6774-1-git-send-email-bmeng.cn@gmail.com> References: <1593070646-6774-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 --- 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 Thu Jun 25 07:37:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1316765 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=tfxyfng6; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49ssMd3dDKz9sSJ for ; Thu, 25 Jun 2020 17:38:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E444820EE; Thu, 25 Jun 2020 09:38:35 +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="tfxyfng6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C45D1820EE; Thu, 25 Jun 2020 09:38:30 +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-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 8444D820EE for ; Thu, 25 Jun 2020 09:38:25 +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-wr1-x443.google.com with SMTP id h15so4733515wrq.8 for ; Thu, 25 Jun 2020 00:38:25 -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=V2jQx/9LvUi0RdbiYocf23lXty0cySfcivq10a6ncMk=; b=tfxyfng6QVzh3M8UM6qlJMUZzh8nOGhWr61piCh/tvEq7UdBnNZXuCyGfYtrQZs5Qy AVR2p7E9LP9FrpjbQ+9Rv8MT6+XBsnXxb6mIxCBQVC76snu1aKScF0U3TJFMu1o9+kW7 wpPfh/m/2Geo+TrZjXetQGec7gBlwEkLAJNHgVh7Inv3L0DemInNit6KjNz+GMIxVtXb 6Lg5G1QoL9vtqvnxUJJdcCgaDfBKuaepy0Kwz13Bw/B8KCb9uzq+2IZ2ZOTxqmWvWxN/ wi1BobsPSo84ljJof64h4sYP3us6EqNTZuVQdxRXKn+uT3vjJKG4UlYvbCFH9t4n2xRC 9JGQ== 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=V2jQx/9LvUi0RdbiYocf23lXty0cySfcivq10a6ncMk=; b=S4gfuqloPUc9haJmEe8Z2JzF7dQfOb17anvdlGLjTfvFK6c/XVYkKA+qkYp6I9+mIa +slBZAqNquBF+DKGD/puJ66I0UIwa01koTofdOj/S9HK5vrvNfXBAY0JNQ1YfTCbFeGF ZE3U5UENWsfIQ1wpUlVDRbfiaC6m6lHdiUmN+64nQs0TzrQsdid3h7OVwRZmuFGnJEpS 1obxaRWq7wHyJDaibo5a2jQIcKy1D827tx3ffCz+1VJQb42H9vzruq8FcZ6GJ7cVqs2k +ajM9I8V3xP7qRabr8WorBSeSeHHacKRsHSED3qsVfHnRdybfckKxdQJdogNM+GtEut1 WhOw== X-Gm-Message-State: AOAM530dozdJfJRAn9auosJg5xmjYRfj0U+wm5WvOl2992SBudFoK0KO E0Kmwetk4iU5ejL4RZ+0AYI= X-Google-Smtp-Source: ABdhPJyy76VvFNzbLAqhLNT8Sch2kxdEJECCjUBHZILYkZB4RPhjhDfDjOGx85jSTe79E9GVJ+mvPA== X-Received: by 2002:a5d:4f0e:: with SMTP id c14mr20214093wru.410.1593070704479; Thu, 25 Jun 2020 00:38:24 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id w13sm30844529wrr.67.2020.06.25.00.38.22 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jun 2020 00:38:24 -0700 (PDT) From: Bin Meng To: Rick Chen , U-Boot Mailing List Cc: Atish Patra , Bin Meng Subject: [PATCH v3 3/3] riscv: Enable CONFIG_OF_BOARD_FIXUP by default for OF_SEPARATE Date: Thu, 25 Jun 2020 00:37:26 -0700 Message-Id: <1593070646-6774-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1593070646-6774-1-git-send-email-bmeng.cn@gmail.com> References: <1593070646-6774-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 needs 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 --- 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