Skip to content

Commit 9efdd76

Browse files
committed
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 <[email protected]>
1 parent 3b6fdac commit 9efdd76

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dtschema/schemas/chosen.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ properties:
167167
will assign devices in its usual manner, otherwise it will not try to
168168
assign devices and instead use them as they are configured already.
169169

170+
nvmem-cells:
171+
maxItems: 1
172+
description:
173+
A phandle to an NVMEM cell providing system-wide information.
174+
Used in conjunction with 'nvmem-cell-names'.
175+
176+
nvmem-cell-names:
177+
items:
178+
- const: power-state-change-reason
179+
description:
180+
Indicates the NVMEM cell contains the last power state change reason
181+
170182
stdout-path:
171183
$ref: types.yaml#/definitions/string
172184
pattern: "^[a-zA-Z0-9@/,+\\-._]*(:[0-9]*[noe]?[78]?[r]?)?$"

0 commit comments

Comments
 (0)