On 2026-08-11T05:18:35, Balaji Selvanathan
<[email protected]> wrote:
> reboot-mode: parse up to 3 magic cells per mode
>
> The reboot-mode framework currently stores a single u32 magic value per
> mode and parses exactly one cell from each "mode-*" device tree property.
> That is sufficient for the existing backing-store users (nvmem, gpio,
> rtc), but a PSCI SYSTEM_RESET2 vendor reset is described by up to three
> 32-bit cells: <reset_type[, cookie_hi[, cookie_lo]]>, matching the
> reboot-mode binding for the psci "reboot-mode" subnode.
>
> Restructure struct reboot_mode_mode to hold an array of up to
> REBOOT_MODE_MAX_MAGIC (3) cells plus a cell count, and make
> dm_reboot_mode_pre_probe() length-aware so it reads 1 to 3 cells from
> each property. dm_reboot_mode_update() now matches the backing-store
> value against magic[0].
>
> Existing single-cell modes (e.g. nvmem "mode-bootloader = <0x02>") parse
> to magic[0] = 0x02, count = 1 and keep matching exactly as before, so
> there is no functional change for current users.
>
> Signed-off-by: Balaji Selvanathan <[email protected]>
>
> drivers/reboot-mode/reboot-mode-uclass.c | 28 ++++++++++++++++++++++------
>  include/reboot-mode/reboot-mode.h        |  8 +++++++-
>  2 files changed, 29 insertions(+), 7 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to