This series adds a way to trigger named resets (for example Qualcomm
EDL/download mode with "reset -edl") without hardcoding any magic values
in a driver or parsing argv inside one. 

The design mirrors the Linux "PSCI reboot mode driver" work, which places
the reset descriptions in a "reboot-mode" subnode of the psci DT node. It
tracks the v24 revision of that series:

  
https://lore.kernel.org/linux-pm/20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373...@oss.qualcomm.com/

The magic layout here (up to three cells, <reset_type[, cookie_hi[,
cookie_lo]]>) follows that revision. The bindings are not yet applied
upstream, so the reboot-mode subnodes live in U-Boot-private *-u-boot.dtsi
overlays for now and can be adjusted if the binding shifts before it lands.

The path a request takes: "reset -edl" strips the leading '-' and calls
reboot_mode_request("edl"). The reboot-mode uclass matches that name
against the modes declared in the device tree and calls the backing
driver's new "trigger" op with the parsed magic cells. The PSCI driver
folds those cells into a SYSTEM_RESET2 vendor reset and the board enters
EDL. "reset -l" walks the same registered modes and lists them.

The pieces behind that: the reboot-mode uclass learns to parse up to three
magic cells per mode and gains the trigger op alongside the existing
get/set, so a backend can act on a mode rather than only read one on boot.
A thin PSCI driver, bound to the psci "reboot-mode" subnode, does the
SYSTEM_RESET2 call with no argv parsing and no hardcoded values. mode-edl
is declared on the qcs6490-rb3gen2 and lemans-evk boards, with the
framework enabled in qcom_defconfig.

Signed-off-by: Balaji Selvanathan <[email protected]>
---
It follows the direction Casey
suggested when the earlier sysreset "-edl" approach was reverted in
c480bbd92b32 ("drivers: sysreset: revert support for args in request"):
  - argument parsing does not belong in reset drivers;
  - the reboot-mode framework already exists for exactly this purpose, so
    the mechanism should not be qcom specific and should not hardcode the
    reset magic values in the driver;
  - the "reset" command should be able to enumerate the modes registered
    with the framework.

---
Balaji Selvanathan (8):
      reboot-mode: parse up to 3 magic cells per mode
      reboot-mode: add trigger op and request/list helpers
      reboot-mode: add PSCI reboot-mode driver
      cmd: reset: dispatch named reset modes via the reboot-mode framework
      arm64: dts: qcom: add psci reboot-mode edl node for lemans/qcs6490-rb3gen2
      configs: qcom: enable PSCI reboot-mode framework
      test: dm: reboot-mode: test trigger dispatch and mode enumeration
      doc: usage: reset: document device-tree-driven reset modes

 arch/arm/dts/lemans-evk-u-boot.dtsi      |  7 +++
 arch/arm/dts/qcs6490-rb3gen2-u-boot.dtsi |  7 +++
 arch/sandbox/dts/test.dts                |  6 +++
 cmd/boot.c                               |  6 ++-
 configs/qcom_defconfig                   |  2 +
 doc/usage/cmd/reset.rst                  | 42 +++++++++++++++
 drivers/firmware/psci.c                  | 16 ++++++
 drivers/reboot-mode/Kconfig              | 11 ++++
 drivers/reboot-mode/Makefile             |  1 +
 drivers/reboot-mode/reboot-mode-psci.c   | 58 +++++++++++++++++++++
 drivers/reboot-mode/reboot-mode-uclass.c | 76 +++++++++++++++++++++++++---
 drivers/sysreset/sysreset-uclass.c       | 27 +++++++++-
 include/reboot-mode/reboot-mode.h        | 48 +++++++++++++++++-
 test/dm/reboot-mode.c                    | 87 ++++++++++++++++++++++++++++++++
 14 files changed, 385 insertions(+), 9 deletions(-)
---
base-commit: baa64b2f892890f00a377eac4a3e685472bb56b5
change-id: 20260810-b4-reset-edl-rebootmode-3b7ca0c34fba

Best regards,
-- 
Balaji Selvanathan <[email protected]>

Reply via email to