[PATCH 2/2] riscv: Enable CONFIG_OF_BOARD_FIXUP by default

Rick Chen rickchen36 at gmail.com
Tue Jun 2 08:04:17 CEST 2020


Hi Bin

> Hi Rick,
>
> On Mon, Jun 1, 2020 at 3:36 PM Rick Chen <rickchen36 at gmail.com> wrote:
> >
> > Hi Bin
> >
> > > Hi Rick,
> > >
> > > On Thu, May 28, 2020 at 4:17 PM Rick Chen <rickchen36 at gmail.com> wrote:
> > > >
> > > > 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 <bin.meng at windriver.com>
> > > > >
> > > > > 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 <bin.meng at windriver.com>
> > > > > ---
> > > > >
> > > > >  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.
> > >
> > > I believe we should turn on this feature by default for every RISC-V
> > > board, because SBI firmware used memory must be marked as reserved
> > > otherwise OS might use it and get crashed. For boards which don't want
> > > to enable this, they can unset the option in their board defconfig
> > > files. This is to reduce some maintenance effort.
> >
> > But not all RISC-V boards need this configuration.
> > If we enable it by default, non spl configuration will run this fdt
> > fix flow, but it is unnecessary.
> >
>
> Non SPL configuration also needs this, because U-Boot has to patch the
> final DTB that is passed to the kernel. It's a RISC-V architecture
> thing.

But non SPL configuration will not run openSbi, why it will need this flow ?

Thanks,
Rick

>
> Regards,
> Bin


More information about the U-Boot mailing list