Add an API to check if a specific PSCI function is supported or not.
This is based on the psci_features() function present in Linux kernel
(drivers/firmware/psci/psci.c).
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
Link: https://patch.msgid.link/20260121063920.1500293-2-varadarajan.narayanan@oss.qualcomm.com
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
while (1)
;
}
+
+int psci_features(u32 psci_func_id)
+{
+ struct pt_regs regs;
+
+ regs.regs[0] = ARM_PSCI_1_0_FN_PSCI_FEATURES;
+ regs.regs[1] = psci_func_id;
+
+ if (use_smc_for_psci)
+ smc_call(®s);
+ else
+ hvc_call(®s);
+
+ return regs.regs[0];
+}
void __noreturn psci_system_reset(void);
void __noreturn psci_system_reset2(u32 reset_level, u32 cookie);
void __noreturn psci_system_off(void);
+int psci_features(u32 psci_func_id);
#ifdef CONFIG_ARMV8_PSCI
extern char __secure_start[];