Re: [RFC PATCH 0/1] Add driver for bootstage stash

Geert Uytterhoeven <[email protected]> Fri, 23 May 2025 09:04:48 +0200
Newsgroups org.kernel.vger.linux-embedded
Message-ID <CAMuHMdXqw9igYU-iPFbA-uP8-LrmZocUKT4k9cb8+py1gFp8tA@mail.gmail.com>
Hi Francesco,

On Fri, 23 May 2025 at 02:25, Francesco Valla <[email protected]> wrote:
> after the discussion on the "Unified Boot Log" topic during the latest
> Boot Time SIG special meeting [1], I tried to mock up a driver that
> reads a bootstage stash saved by the U-Boot bootloader in a given memory
> area and exposes the data in a user- and machine- friendly through both
> sysfs and debugfs attributes. Details on the interfaces, as well as
> example output for the debugfs interfaces, can be found on the
> documentation that is part of the patchset.

Thanks for your work!

> To use this driver, a memory area shall be reserved inside the Linux
> kernel devicetree as follows (possibly changing the address and the size
> of the memory area):
>
>     bootstage@a4300000 {
>         compatible = "bootstage";
>         reg = <0 0xa4300000 0 0x1000>;
>         no-map;
>     };
>
> At U-Boot side, following configuration shall then be set:
>
>     CONFIG_BOOTSTAGE=y
>     CONFIG_BOOTSTAGE_STASH_ADDR=0xa4300000
>     CONFIG_BOOTSTAGE_STASH_SIZE=0x1000

I think this can be simplified further, using either of these two options:
  1. If the bootstage@a4300000 node would already be present in the
     DTB used by U-Boot, the two CONFIG_BOOTSTAGE_STASH_*
     options would no longer be needed.
  2. U-Boot could add the bootstage@a4300000 to the DTB that is
     passed to the kernel, just like it already adds/updates the memory
     nodes.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds