Skip to content

Commit b34cc49

Browse files
travisgCQ Bot
authored andcommitted
[kernel][psci] add hook to call the SYSTEM_RESET2 psci call directly
Used to pass specific reset arguments through the call, which is currently not possible. Change-Id: Ib300c5ea538a0d8b266b73faa954d4e5dc84d04a Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1053868 Reviewed-by: Will Drewry <drewry@google.com> Commit-Queue: Travis Geiselbrecht <travisg@google.com>
1 parent 1746fe2 commit b34cc49

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

zircon/kernel/dev/psci/include/dev/psci.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,7 @@ zx::result<power_cpu_state> psci_get_cpu_state(uint64_t mpid);
7878
zx_status_t psci_system_off();
7979
zx_status_t psci_system_reset(power_reboot_flags flags);
8080

81+
// Used when calling SYSTEM_RESET2 directly
82+
zx_status_t psci_system_reset2_raw(uint32_t reset_type, uint32_t cookie);
83+
8184
#endif // ZIRCON_KERNEL_DEV_PSCI_INCLUDE_DEV_PSCI_H_

zircon/kernel/dev/psci/psci.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ uint32_t psci_get_feature(uint32_t psci_call) {
107107
return (uint32_t)do_psci_call(PSCI64_PSCI_FEATURES, psci_call, 0, 0);
108108
}
109109

110+
zx_status_t psci_system_reset2_raw(uint32_t reset_type, uint32_t cookie) {
111+
dprintf(INFO, "PSCI SYSTEM_RESET2: %#" PRIx32 " %#" PRIx32 "\n", reset_type, cookie);
112+
113+
uint64_t psci_status = do_psci_call(PSCI64_SYSTEM_RESET2, reset_type, cookie, 0);
114+
115+
dprintf(INFO, "PSCI SYSTEM_RESET2 returns %" PRIi64 "\n", static_cast<int64_t>(psci_status));
116+
117+
return psci_status_to_zx_status(psci_status);
118+
}
119+
110120
zx_status_t psci_system_reset(power_reboot_flags flags) {
111121
uint64_t* args = reboot_args;
112122

0 commit comments

Comments
 (0)