summaryrefslogtreecommitdiff
path: root/drivers/firmware/psci.c
diff options
context:
space:
mode:
authorWeizhao Ouyang <o451686892@gmail.com>2024-03-04 14:42:40 +0000
committerTom Rini <trini@konsulko.com>2024-03-13 12:40:43 -0400
commit12ccdcd79bddace90dfb6080084b0e36a6d44b37 (patch)
treee202611b4cc9a821213bd969c61c1db5bd49ac7d /drivers/firmware/psci.c
parent0cff87c90c676d0e5c5b59553a2a982782f024bb (diff)
firmware: psci: Fix bind_smccc_features psci check
According to PSCI specification DEN0022F, PSCI_FEATURES is used to check whether the SMCCC is implemented by discovering SMCCC_VERSION. Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
Diffstat (limited to 'drivers/firmware/psci.c')
-rw-r--r--drivers/firmware/psci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index c6b9efab41c..03544d76ed4 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -135,10 +135,13 @@ static int bind_smccc_features(struct udevice *dev, int psci_method)
PSCI_VERSION_MAJOR(psci_0_2_get_version()) == 0)
return 0;
- if (request_psci_features(ARM_SMCCC_ARCH_FEATURES) ==
+ if (request_psci_features(ARM_SMCCC_VERSION) ==
PSCI_RET_NOT_SUPPORTED)
return 0;
+ if (invoke_psci_fn(ARM_SMCCC_VERSION, 0, 0, 0) < ARM_SMCCC_VERSION_1_1)
+ return 0;
+
if (psci_method == PSCI_METHOD_HVC)
pdata->invoke_fn = smccc_invoke_hvc;
else