[PATCH 1/4] riscv: spl: Introduce SPL_OPENSBI_OS_BOOT

Rick Chen rickchen36 at gmail.com
Wed Dec 14 03:14:21 CET 2022


Hi Tom,

> On Wed, Dec 14, 2022 at 08:49:03AM +0800, Rick Chen wrote:
> > Hi Tom,
> >
> > > On Tue, Dec 13, 2022 at 10:06:50AM +0800, Rick Chen wrote:
> > > > > On Mon, Dec 12, 2022 at 03:49:10PM +0800, Rick Chen wrote:
> > > > > > > On 12/7/22 01:23, Rick Chen wrote:
> > > > > > > > In RISC-V, it only provide normal mode booting currently.
> > > > > > > > To speed up the booting process, here provide SPL_OPENSBI_OS_BOOT
> > > > > > > > to achieve this feature which will be call Fast-Boot mode. By
> > > > > > >
> > > > > > > Can you name this something different. We already have something called
> > > > > > > fastboot in-tree (the Android-derived protocol) and there's a Microsoft
> > > > > > > technology called fastboot (some kind of hibernation). "OS Boot" isn't
> > > > > > > very specific either, since we (almost always) boot an OS. Maybe "Eagle
> > > > > > > mode" by analogy to Falcon mode, which lets SPL directly boot an OS.
> > > > > >
> > > > > > I think fast boot is a behavior which shall be interpreted widely but
> > > > > > not proprietary.
> > > > > > Or maybe I can  rename it as RISC-V Fast Boot to distinguish them.
> > > > > >
> > > > > > >
> > > > > > > (Is this substantially different from falcon mode anyway?)
> > > > > >
> > > > > > Please see the explanations to Tom.
> > > > > >
> > > > > > >
> > > > > > > > enabling SPL_OPENSBI_OS_BOOT, it will generate linux.itb instead
> > > > > > > > of default u-boot.itb after compiling. It initializes memory with
> > > > > > > > the U-Boot SPL at the first stage, just like what a regular booting
> > > > > > > > process (i.e. Normal Boot) does in the beginning. Instead of jumping
> > > > > > > > to the U-Boot proper from OpenSBI before booting Linux Kernel, the
> > > > > > > > Fast Boot process jumps directly to Linux Kernel to gain shorter
> > > > > > > > booting time.
> > > > > > > >
> > > > > > > > Signed-off-by: Rick Chen <rick at andestech.com>
> > > > > > > > ---
> > > > > > > >   common/spl/Kconfig       | 14 ++++++++++++++
> > > > > > > >   common/spl/spl_fit.c     |  3 ++-
> > > > > > > >   common/spl/spl_opensbi.c | 25 ++++++++++++-------------
> > > > > > > >   3 files changed, 28 insertions(+), 14 deletions(-)
> > > > > > > >
> > > > > > > > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > > > > > > > index 05181bdba3..8805aba1b7 100644
> > > > > > > > --- a/common/spl/Kconfig
> > > > > > > > +++ b/common/spl/Kconfig
> > > > > > > > @@ -1509,6 +1509,20 @@ config SPL_OPENSBI_SCRATCH_OPTIONS
> > > > > > > >         Options passed to fw_dynamic, for example SBI_SCRATCH_NO_BOOT_PRINTS or
> > > > > > > >         SBI_SCRATCH_DEBUG_PRINTS.
> > > > > > > >
> > > > > > > > +config SPL_OPENSBI_OS_BOOT
> > > > > > >
> > > > > > > Please use the same name for the config as for the description.
> > > > > > >
> > > > > > > > +     bool "openSBI Fast Boot"
> > > > > > > > +     depends on SPL_OPENSBI
> > > > > > > > +     help
> > > > > > > > +       Enable this openSBI can jump to Linux Kernel directly.
> > > > > > >
> > > > > > > Can you put some of the explanation from the commit message here?
> > > > > >
> > > > > > OK, I will move some messages here from commit messages.
> > > > > >
> > > > > > >
> > > > > > > > +
> > > > > > > > +config SPL_OPENSBI_FIT_NAME
> > > > > > > > +     string "SPL openSBI fit image name"
> > > > > > > > +     depends on SPL_OPENSBI
> > > > > > > > +     default "linux.itb" if SPL_OPENSBI_OS_BOOT
> > > > > > > > +     default "u-boot.itb"
> > > > > > > > +     help
> > > > > > > > +       This will help to generate different fit name accordingly.
> > > > > > >
> > > > > > > Why not SPL_FS_LOAD_PAYLOAD_NAME?
> > > > > > >
> > > > > > > It looks like the code changes below do not use these configs. Can you
> > > > > > > move them to the next patch so it is clearer that they are for binman?
> > > > > >
> > > > > > I have saw this config, but it does't support SPL_RAM but only for filesystem
> > > > > > That is why I don't leverage it.
> > > > > >
> > > > > > I can prepare a patch as below if no other concerns:
> > > > > >
> > > > > > config SPL_FS_LOAD_PAYLOAD_NAME
> > > > > > string "File to load for U-Boot from the filesystem"
> > > > > > depends on SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS || SPL_RAM
> > > > > > default "tispl.bin" if SYS_K3_SPL_ATF
> > > > > > default "u-boot.itb" if SPL_LOAD_FIT
> > > > > > default "linux.itb" if SPL_OPENSBI_OS_BOOT
> > > > > > default "u-boot.img"
> > > > > > help
> > > > > >   Filename to read to load U-Boot when reading from filesystem.
> > > > >
> > > > > But in the case you have it's for the output name, and not at all about
> > > > > what's being loaded from a filesystem yes? This shouldn't be a "SPL_.."
> > > >
> > > > For SPL_RAM purpose,
> > > > it is just an output name to distinguish normal boot (u-boot.itb) and
> > > > fast boot (linux.itb) indeed.
> > > >
> > > > But for SPL_OPENSBI_OS_BOOT && SPL_MMC && SPL_FAT this combination,
> > > > it can help to load linux.itb automatically from SD card.
> > >
> > > What part of the world is looking for the file named by
> > > SPL_FS_LOAD_PAYLOAD_NAME ? (and this is related to what I just sent out,
> > > asking about the boot flow)
> >
> > In the following commit, CONFIG_SPL_FS_LOAD_PAYLOAD_NAME has been
> > moved to Kconfig from ax25-ae350.h
> > That is why I try to add this change to load u-boot.itb or linux.itb
> > from SD card here
> >
> > commit 4a11e34bc9c0f3818f3e847ac51c82d1c9bbb807
> > Author: Tom Rini <trini at konsulko.com>
> > Date:   Fri May 13 17:12:35 2022 -0400
> >
> >     Convert CONFIG_SPL_FS_LOAD_PAYLOAD_NAME et al to Kconfig
> >
> > ...
> >
> > +++ b/include/configs/ax25-ae350.h
> > @@ -11,10 +11,6 @@
> >  #define CONFIG_SPL_MAX_SIZE            0x00100000
> >  #define CONFIG_SPL_BSS_START_ADDR      0x04000000
> >  #define CONFIG_SPL_BSS_MAX_SIZE                0x00100000
> > -
> > -#ifdef CONFIG_SPL_MMC
> > -#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.itb"
> > -#endif
>
> Yes, I made a best guess "what do I need to do to have zero size change"
> migration of that option, along with most others. So, sorry, my original
> question remains.  In real world usage, what is using that name? The

In development, I will often enable SPL_MMC and SPL_FAT by 'make
menuconfig' manually.
It will boot faster and quickly than SPL_RAM for debugging.

It is wired to add  default "linux.itb" if SPL_OPENSBI_OS_BOOT here.
It shall be appear with an defconfig something like
ae350_rv[32|64]_spl_mmc_fastboot_defconfig which enables SPL_FAT and
SPL_MMC.
Sorry about this confusion.

Thanks,
Rick


> regular usage here is that SPL knows to read from FAT (or similar) that
> name as a hard-coded default.
>
> --
> Tom


More information about the U-Boot mailing list