From: Fabian Pfitzner <f.pfitzner@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
BAREBOX <barebox@lists.infradead.org>
Cc: Fabian Pfitzner <f.pfitzner@pengutronix.de>
Subject: [PATCH 0/2] Implement recovery boot detection for SPI flash
Date: Wed, 20 May 2026 10:32:58 +0200 [thread overview]
Message-ID: <20260520-fpf-bootsource-instance-index-v1-0-29942f0e8f2f@pengutronix.de> (raw)
As of now, there is only the boot rom log on i.MX processors that give us
information on whether we have booted from the primary or recovery image.
Extract this information into a Barebox variable in order to pass this
information to user space. This is useful for tools such as RAUC, that
rely on that information when updating the bootloader atomically.
The variable is called `bootsource_instance_index`.
The intention behind the name is, that for an instance we can have
multiple boot images, where the primary is depicted as zero, and the
recovery/secondary is depicted as a 1.
There is no implementation on how to pass this information to user
space. This could be implemented by a boot script that interprets
the content of that variable into a human readable format.
Successfully tested on the congatec-qmx8p.
Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
---
Fabian Pfitzner (2):
bootsource: add bootsource instance index variable
arch: arm: imx: detect secondary boot
Documentation/user/variables.rst | 1 +
arch/arm/mach-imx/boot.c | 52 ++++++++++++++++++++++++++++++++++++++++
common/bootsource.c | 20 ++++++++++++++++
include/bootsource.h | 11 +++++++++
4 files changed, 84 insertions(+)
---
base-commit: 1806d0f4835a1217a298f82fa2fc88b2694380f2
change-id: 20260518-fpf-bootsource-instance-index-a7bb108392a3
Best regards,
--
Fabian Pfitzner <f.pfitzner@pengutronix.de>
next reply other threads:[~2026-05-20 8:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 8:32 Fabian Pfitzner [this message]
2026-05-20 8:32 ` [PATCH 1/2] bootsource: add bootsource instance index variable Fabian Pfitzner
2026-05-21 12:02 ` Sascha Hauer
2026-05-20 8:33 ` [PATCH 2/2] arch: arm: imx: detect secondary boot Fabian Pfitzner
2026-05-21 12:27 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260520-fpf-bootsource-instance-index-v1-0-29942f0e8f2f@pengutronix.de \
--to=f.pfitzner@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox