@@ -14,6 +14,7 @@
#include <asm/cpufeature.h>
#include <asm/monitor.h>
#include <asm/regs.h>
+#include <asm/scmi-smc.h>
#include <asm/smccc.h>
#include <asm/tee/ffa.h>
#include <asm/tee/tee.h>
@@ -224,6 +225,22 @@ static bool handle_sssc(struct cpu_user_regs *regs)
}
}
+/* Secure Calls defined by the Silicon Provider (SiP) */
+static bool handle_sip(struct cpu_user_regs *regs)
+{
+ uint32_t fid = (uint32_t)get_user_reg(regs, 0);
+
+ /* Firstly, let each platform define custom handling for these SMCs */
+ if ( platform_smc(regs) )
+ return true;
+
+ /* Otherwise, if valid SCMI SMC, forward the call to EL3 */
+ if ( scmi_is_enabled() && scmi_is_valid_smc_id(fid) )
+ return scmi_handle_smc(regs);
+
+ return false;
+}
+
/*
* vsmccc_handle_call() - handle SMC/HVC call according to ARM SMCCC.
* returns true if that was valid SMCCC call (even if function number
@@ -288,7 +305,7 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs)
handled = handle_sssc(regs);
break;
case ARM_SMCCC_OWNER_SIP:
- handled = platform_smc(regs);
+ handled = handle_sip(regs);
break;
case ARM_SMCCC_OWNER_TRUSTED_APP ... ARM_SMCCC_OWNER_TRUSTED_APP_END:
case ARM_SMCCC_OWNER_TRUSTED_OS ... ARM_SMCCC_OWNER_TRUSTED_OS_END: