Re: [PATCH RESEND v3 3/4] firmware: raspberrypi: Add reboot mode support
From: Stefan Wahren
Date: Thu Sep 03 2026 - 14:08:40 EST
Hi Gregor,
Am 03.09.26 um 16:48 schrieb Gregor Herburger:
The Raspberry Pi firmware has a tryboot mode where it tries to boot fromthis part doesn't apply anymore. Did you rebased against 7.3-rc1 ?
another partition. This can be used to create a A/B update scheme.
To enable this on the next boot, the RPI_FIRMWARE_SET_REBOOT_FLAGS
message must be sent to the firmware. Add support for this by
registering a reboot mode driver.
Furthermore, safely registering the reboot mode requires adjusting the
teardown sequence. Replace the manually called rpi_firmware_put() with a
devres-managed called (devm_add_action_or_reset). Without this, the
cleanup function of devm_reboot_mode_register() would trigger a
use-after-free error by attempting to access the firmware context after
it had already been freed by rpi_firmware_remove().
Signed-off-by: Gregor Herburger <gregor.herburger@xxxxxxxxxxxxx>
---
drivers/firmware/Kconfig | 2 ++
drivers/firmware/raspberrypi.c | 40 ++++++++++++++++++++++++++----
include/soc/bcm2835/raspberrypi-firmware.h | 2 ++
3 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index bbd2155d84838..34605bf7c9734 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -115,6 +115,8 @@ config ISCSI_IBFT
config RASPBERRYPI_FIRMWARE
tristate "Raspberry Pi Firmware Driver"
depends on BCM2835_MBOX
+ select POWER_RESET
+ select REBOOT_MODE
help
This option enables support for communicating with the firmware on the
Raspberry Pi.
Best regards