feat(stm32mp2): add a runtime service for STGEN configuration
Other component such as OP-TEE may have the responsibility for
STGEN configuration but updating Arm CNTFRQ can only be done from
EL3. Therefore, implement a SiP SMC handler for this purpose and
a runtime service to catch SIP SMCs.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Change-Id: I7854e1ae6328f149798b43d52bb1ecdf71a5aa69
diff --git a/plat/st/stm32mp2/include/stm32mp2_smc.h b/plat/st/stm32mp2/include/stm32mp2_smc.h
index 1801683..3bf6a84 100644
--- a/plat/st/stm32mp2/include/stm32mp2_smc.h
+++ b/plat/st/stm32mp2/include/stm32mp2_smc.h
@@ -9,4 +9,14 @@
#define STM32_COMMON_SIP_NUM_CALLS 1U
+/*
+ * STM32_SIP_SMC_STGEN_SET_RATE call API
+ * This service is opened to secure world only.
+ *
+ * Argument a0: (input) SMCC ID
+ * (output) status return code
+ * Argument a1: (input) Frequency to set (given by sender)
+ */
+#define STM32_SIP_SMC_STGEN_SET_RATE 0x82000000
+
#endif /* STM32MP2_SMC_H */