From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Chen Date: Thu, 28 May 2020 16:16:50 +0800 Subject: [PATCH 2/2] riscv: Enable CONFIG_OF_BOARD_FIXUP by default In-Reply-To: <752D002CFF5D0F4FA35C0100F1D73F3FA4710061@ATCPCS16.andestech.com> References: <1589960371-20635-1-git-send-email-bmeng.cn@gmail.com> <1589960371-20635-2-git-send-email-bmeng.cn@gmail.com> <752D002CFF5D0F4FA35C0100F1D73F3FA4710061@ATCPCS16.andestech.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bin > From: Bin Meng [mailto:bmeng.cn at gmail.com] > Sent: Wednesday, May 20, 2020 3:40 PM > To: Rick Jian-Zhi Chen(???); U-Boot Mailing List > Cc: Bin Meng > Subject: [PATCH 2/2] riscv: Enable CONFIG_OF_BOARD_FIXUP by default > > 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. > > Signed-off-by: Bin Meng > --- > > 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 fb5fe5a..5176b35 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -272,4 +272,7 @@ config STACK_SIZE_SHIFT > int > default 14 > > +config OF_BOARD_FIXUP > + default y I think it shall invoke by individual board, just like the description of riscv_fdt_copy_resv_mem_node function. In [PATCH 1/2] if source and destination are the same place, it represent that OF_BOARD_FIXUP is unnecessary. BTW when I try OF_SEPARATE and OF_BOARD_FIXUP both are enabled, it hit the problem as below: U-Boot SPL 2020.07-rc3-16981-g4332225-dirty (May 28 2020 - 14:48:18 +0800) Trying to boot from RAM U-Boot 2020.07-rc3-16981-g4332225-dirty (May 28 2020 - 14:48:18 +0800) DRAM: 1 GiB failed to add reserved memory: -3 failed to fixup DT for reserved memory: -3 initcall sequence 0000000001253c20 failed at call 000000000120b8e0 (err=-3) ### ERROR ### Please RESET the board ### I will dig in and figure out what is going on here ? Maybe there exist a potential issue somehow! Thanks, Rick > + > endmenu > diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig index f805aac..6d61e6c 100644 > --- a/configs/sifive_fu540_defconfig > +++ b/configs/sifive_fu540_defconfig > @@ -9,7 +9,6 @@ CONFIG_FIT=y > CONFIG_MISC_INIT_R=y > CONFIG_DISPLAY_CPUINFO=y > CONFIG_DISPLAY_BOARDINFO=y > -CONFIG_OF_BOARD_FIXUP=y > CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" > CONFIG_SYS_RELOC_GD_ENV_ADDR=y > CONFIG_DM_MTD=y > -- > 2.7.4