diff options
| author | Jay Buddhabhatti <jay.buddhabhatti@amd.com> | 2026-07-29 05:25:20 -0700 |
|---|---|---|
| committer | Michal Simek <michal.simek@amd.com> | 2026-08-10 09:30:44 +0200 |
| commit | 00bee072c8ae394b029ed4ce6fc8def3e5627e1c (patch) | |
| tree | 420206aaf49486931e84a802b27af84b4f01e7a2 /include | |
| parent | 5b8c4b238b02db7af65f349a9d677c2dd60359ac (diff) | |
| download | linux-00bee072c8ae394b029ed4ce6fc8def3e5627e1c.tar.gz linux-00bee072c8ae394b029ed4ce6fc8def3e5627e1c.zip | |
firmware: xilinx: Add support to clear EL3 PM state
Currently, during a kexec restart, only the kernel is reloaded, while
EL3-specific data remain unchanged. This leads to a mismatch between the
kernel state and secure firmware state like SGI number and shutdown scope
variable.
For example, the kernel registers an SGI number with EL3 firmware so that
secure firmware can notify the kernel of events via that SGI. EL3 stores
this SGI number in its internal state. After a kexec, the newly loaded
kernel re-registers and may request a different SGI number, but the stale
value programmed in EL3 remains, so event notifications are delivered on
the old SGI and are missed by the new kernel. The shutdown scope variable
has a similar stale state problem.
To resolve this, the TF_A_CLEAR_PM_STATE PM API is introduced to clear
EL3 PM subsystem state during kexec. On a graceful reboot, this API is
triggered by zynqmp_firmware_shutdown(), while in a crash kernel scenario,
it is invoked by zynqmp_firmware_probe() in the reloaded kernel.
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Reviewed-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
Link: https://patch.msgid.link/20260729122522.3732875-2-jay.buddhabhatti@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/firmware/xlnx-zynqmp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 7e27b0f7bf7e..baaa88b0b197 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -3,7 +3,7 @@ * Xilinx Zynq MPSoC Firmware layer * * Copyright (C) 2014-2021 Xilinx - * Copyright (C) 2022 - 2025 Advanced Micro Devices, Inc. + * Copyright (C) 2022 - 2026 Advanced Micro Devices, Inc. * * Michal Simek <michal.simek@amd.com> * Davorin Mista <davorin.mista@aggios.com> @@ -66,6 +66,7 @@ #define FIRMWARE_VERSION_MASK 0xFFFFU /* ATF only commands */ +#define TF_A_CLEAR_PM_STATE 0xa05 #define TF_A_PM_REGISTER_SGI 0xa04 #define PM_GET_TRUSTZONE_VERSION 0xa03 #define PM_SET_SUSPEND_MODE 0xa02 |
