linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] Add driver for bootstage stash
@ 2025-05-22 22:42 Francesco Valla
  2025-05-22 22:42 ` [PATCH 1/1] drivers: misc: add " Francesco Valla
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Francesco Valla @ 2025-05-22 22:42 UTC (permalink / raw)
  To: linux-embedded

Hello,

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.

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

Once booted, the bootstage data can will be found at:

    - /sys/devices/platform/a4300000.bootstage/
    - /sys/kernel/debug/bootstage/a4300000.bootstage/

The device name is purposely part of the sysfs and debugfs paths to
support multiple bootstage areas, as this _might_ then be used for
multiple bootstage sources, e.g. bootloaders running on different
cores inside a SoC with different architectures.

Note that this is not really meant to be integrated as-is, not only
because it's a single patch including code, documentation and devicetree
bindings, but also because the bootstage stash format itself may need to
be touched up a bit. In particular, fixed data type should probably be
evaluated for the bootstage record, in order to increase compatibility
with different data sources.


Comments are of course welcome.

Regards,

Francesco

[1] https://lore.kernel.org/linux-embedded/MW5PR13MB5632B8FA3279D77F2F9217BBFD9CA@MW5PR13MB5632.namprd13.prod.outlook.com/

Francesco Valla (1):
  drivers: misc: add driver for bootstage stash

 .../bindings/reserved-memory/bootstage.yaml   |  44 +++
 Documentation/misc-devices/bootstage.rst      |  53 ++++
 Documentation/misc-devices/index.rst          |   1 +
 MAINTAINERS                                   |   7 +
 drivers/misc/Kconfig                          |  10 +
 drivers/misc/Makefile                         |   1 +
 drivers/misc/bootstage.c                      | 292 ++++++++++++++++++
 drivers/of/platform.c                         |   1 +
 8 files changed, 409 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/bootstage.yaml
 create mode 100644 Documentation/misc-devices/bootstage.rst
 create mode 100644 drivers/misc/bootstage.c

-- 
2.49.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-05-24  7:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 22:42 [RFC PATCH 0/1] Add driver for bootstage stash Francesco Valla
2025-05-22 22:42 ` [PATCH 1/1] drivers: misc: add " Francesco Valla
2025-05-23  6:29   ` Krzysztof Kozlowski
2025-05-23 19:34     ` Rob Landley
2025-05-24  6:16       ` Krzysztof Kozlowski
2025-05-23 19:43     ` Francesco Valla
2025-05-24  6:15       ` Krzysztof Kozlowski
2025-05-23 23:43   ` Bird, Tim
2025-05-24  7:18   ` kernel test robot
2025-05-23  7:04 ` [RFC PATCH 0/1] Add " Geert Uytterhoeven
2025-05-23 20:06   ` Francesco Valla
     [not found] ` <PA4PR08MB604681FF6392B25A19926A11ED98A@PA4PR08MB6046.eurprd08.prod.outlook.com>
2025-05-23  7:34   ` Federico Giovanardi
2025-05-23 19:43     ` Rob Landley
2025-05-23 20:11     ` Francesco Valla
2025-05-24  0:07     ` Bird, Tim
2025-05-24  0:28       ` Bird, Tim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).