From 9efdd763c17762bba4c53ed3fa6aaf7fb6f21492 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Tue, 21 Oct 2025 13:04:47 +0200 Subject: [PATCH] dt-bindings: chosen: Add "power-state-change-reason" nvmem property A lot of systems (especially embedded) store the last shutdown/reboot reason in NVMEM. This could be anything from "over temperature" or "brown-out" to an "EC panic" or watchdog reset. There's currently no standard way for firmware to tell the kernel where to find this information. The /chosen node is already used for passing global, firmware-provided data like 'bootargs' and 'stdout-path'. Let's use it for this, too. This patch adds a binding for a new generic NVMEM cell name in /chosen: "power-state-change-reason". Example from the binding: chosen { nvmem-cells = <&pscr_cell>; nvmem-cell-names = "power-state-change-reason"; }; Signed-off-by: Oleksij Rempel --- dtschema/schemas/chosen.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dtschema/schemas/chosen.yaml b/dtschema/schemas/chosen.yaml index ea136f84..fc477d63 100644 --- a/dtschema/schemas/chosen.yaml +++ b/dtschema/schemas/chosen.yaml @@ -167,6 +167,18 @@ properties: will assign devices in its usual manner, otherwise it will not try to assign devices and instead use them as they are configured already. + nvmem-cells: + maxItems: 1 + description: + A phandle to an NVMEM cell providing system-wide information. + Used in conjunction with 'nvmem-cell-names'. + + nvmem-cell-names: + items: + - const: power-state-change-reason + description: + Indicates the NVMEM cell contains the last power state change reason + stdout-path: $ref: types.yaml#/definitions/string pattern: "^[a-zA-Z0-9@/,+\\-._]*(:[0-9]*[noe]?[78]?[r]?)?$"