Add psci_sys_reset2 reboot modes for hamoa and purwa boards
v3 cover Add psci_sys_reset2 reboot modes for hamoa and purwa boards
Adding PSCI SYSTEM_RESET2 reboot-modes for hamoa and purwa based boards.
These DT patches depend on PSCI SYSTEM_RESET2 support introduced in:
https://lore.kernel.org/all/20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com/
To: Bjorn Andersson <[email protected]>
To: Konrad Dybcio <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
Changes in v3:
- Split into two patches: one for hamoa, one for purwa
- Move reboot-mode from shared hamoa.dtsi to board-specific files
- Add psci label in hamoa.dtsi to allow board files to reference the node
- Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Fix mode-bootloader and mode-edl reset_type
- Link to v1: https://lore.kernel.org/all/[email protected]/
---
Xin Liu (2):
arm64: dts: qcom: hamoa: Add PSCI SYSTEM_RESET2 types
arm64: dts: qcom: purwa: Add PSCI SYSTEM_RESET2 types
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts | 7 +++++++ arch/arm64/boot/dts/qcom/hamoa.dtsi | 2 +- arch/arm64/boot/dts/qcom/purwa-iot-evk.dts | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-)
---
base-commit: e30626823a406725ce29bc75cb8ec467d3e1e326
Best regards,
--
Xin Liu <[email protected]>
PATCH v3 1/2 arm64: dts: qcom: hamoa: Add PSCI SYSTEM_RESET2 types
Add support for SYSTEM_RESET2 vendor-specific resets as reboot-modes in the psci node. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol.
--- arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts | 7 +++++++ arch/arm64/boot/dts/qcom/hamoa.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts +7 -0
@@ -1192,6 +1192,13 @@ &pmk8550_pwm { status = "okay"; }; +&psci { + reboot-mode { + mode-bootloader = <0x80010001 0x2>; + mode-edl = <0x80000000 0x1>; + }; +}; + &sdhc_2 { cd-gpios = <&tlmm 71 GPIO_ACTIVE_LOW>;
arch/arm64/boot/dts/qcom/hamoa.dtsi +1 -1
@@ -374,7 +374,7 @@ pmu { interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_LOW>; }; - psci { + psci: psci { compatible = "arm,psci-1.0"; method = "smc";
--
2.34.1
[email protected]
AI reviewRe: [PATCH v3 1/2] arm64: dts: qcom: hamoa: Add PSCI SYSTEM_RESET2 types
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The addition of the `reboot-mode` subnode to the `psci` node violates the PSCI device tree binding…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The addition of the reboot-mode subnode to the psci node violates the PSCI device tree binding schema, causing make dtbs_check to fail. --
commit 0761e0e4725677d66ad02781f96c6323f5504b5a
Author: Xin Liu <[email protected]>
arm64: dts: qcom: hamoa: Add PSCI SYSTEM_RESET2 types
This commit adds support for SYSTEM_RESET2 vendor-specific resets as reboot-modes in the psci node. It defines "bootloader" and "edl" reset modes for the hamoa-iot-evk device.
Quoted 5 lines
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts +0
-0
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts &pmk8550_pwm { · line 1200
Quoted 9 lines
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts +6
-0@@ -1192,6 +1192,13 @@ &pmk8550_pwm { status = "okay"; }; +&psci { + reboot-mode { + mode-bootloader = <0x80010001 0x2>; + mode-edl = <0x80000000 0x1>; + }; +};
[Severity: Low]
Does adding the reboot-mode subnode to the psci node violate the PSCI device tree binding schema?
The psci schema in Documentation/devicetree/bindings/arm/psci.yaml specifies
additionalProperties: false and does not define or reference a reboot-mode property.
Will adding this undocumented subnode cause a dtbs_check validation failure during the build?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v3 2/2 arm64: dts: qcom: purwa: Add PSCI SYSTEM_RESET2 types
In reply to Xin LiuAdd support for SYSTEM_RESET2 vendor-specific resets as reboot-modes in the psci node. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol.
--- arch/arm64/boot/dts/qcom/purwa-iot-evk.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/purwa-iot-evk.dts +7 -0
@@ -1180,6 +1180,13 @@ &pmk8550_pwm { status = "okay"; }; +&psci { + reboot-mode { + mode-bootloader = <0x80010001 0x2>; + mode-edl = <0x80000000 0x1>; + }; +}; + &sdhc_2 { cd-gpios = <&tlmm 71 GPIO_ACTIVE_LOW>;
--
2.34.1
[email protected]
AI reviewRe: [PATCH v3 2/2] arm64: dts: qcom: purwa: Add PSCI SYSTEM_RESET2 types
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The `reboot-mode` child node in the `psci` node violates the DT binding schema and is completely…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The reboot-mode child node in the psci node violates the DT binding schema and is completely unhandled by the kernel, resulting in validation failures and a non-functional feature. --
commit 6aadf5c7e368cd8a19850d3a52be3816bc1f1974
Author: Xin Liu <[email protected]>
arm64: dts: qcom: purwa: Add PSCI SYSTEM_RESET2 types
This commit adds vendor-specific reset types to the psci device tree node as reboot-modes for the purwa-iot-evk. The new modes are intended to allow the device to reboot into fastboot or emergency download mode.
Quoted 3 lines
arch/arm64/boot/dts/qcom/purwa-iot-evk.dts +0
-0
[ ... ]
arch/arm64/boot/dts/qcom/purwa-iot-evk.dts &pmk8550_pwm { · line 1188
Quoted 10 lines
arch/arm64/boot/dts/qcom/purwa-iot-evk.dts +6
-0@@ -1180,6 +1180,13 @@ &pmk8550_pwm { status = "okay"; }; +&psci { + reboot-mode { + mode-bootloader = <0x80010001 0x2>; + mode-edl = <0x80000000 0x1>; + }; +};
[Severity: Medium]
Will this reboot-mode node cause a dtbs_check validation error?
The psci device tree binding schema in Documentation/devicetree/bindings/arm/psci.yaml specifies "additionalProperties: false" and does not define a reboot-mode child node. Furthermore, this node lacks a compatible string, which means standard reboot-mode drivers will not bind to it.
Additionally, are these vendor-specific reset modes actually supported by the psci driver?
Looking at psci_sys_reset() in drivers/firmware/psci/psci.c, the kernel hardcodes the arguments for SYSTEM_RESET2 to 0 instead of parsing them from the device tree:
psci_sys_reset() {
/*
* reset_type[31] = 0 (architectural)
* reset_type[30:0] = 0 (SYSTEM_WARM_RESET)
* cookie = 0 (ignored by the implementation)
*/
invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), 0, 0, 0);
}This means that executing a command like "reboot edl" might just perform a standard warm reset rather than the requested vendor reset, leaving the feature non-functional.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2