xref: /rk3399_ARM-atf/plat/st/stm32mp1/include/stm32mp1_smc.h (revision f1f04d786795a02f81abeef7d1513e93098591ed)
1 /*
2  * Copyright (c) 2016-2024, STMicroelectronics - All Rights Reserved
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef STM32MP1_SMC_H
8 #define STM32MP1_SMC_H
9 
10 /*
11  * SMC function IDs for STM32 Service queries
12  * STM32 SMC services use the space between 0x82000000 and 0x8200FFFF
13  * like this is defined in SMC calling Convention by ARM
14  * for SiP (silicon Partner)
15  * https://developer.arm.com/docs/den0028/latest
16  */
17 
18 /* Secure Service access from Non-secure */
19 
20 /*
21  * STM32_SMC_BSEC call API
22  *
23  * Argument a0: (input) SMCC ID
24  *		(output) status return code
25  * Argument a1: (input) Service ID (STM32_SMC_BSEC_xxx)
26  * Argument a2: (input) OTP index
27  *		(output) OTP read value, if applicable
28  * Argument a3: (input) OTP value if applicable
29  */
30 #define STM32_SMC_BSEC			0x82001003
31 
32 /*
33  * STM32_SIP_SMC_SCMI_AGENT0
34  * STM32_SIP_SMC_SCMI_AGENT1
35  * Process SCMI message pending in SCMI shared memory buffer.
36  *
37  * Argument a0: (input) SMCC ID
38  */
39 #define STM32_SIP_SMC_SCMI_AGENT0	0x82002000
40 #define STM32_SIP_SMC_SCMI_AGENT1	0x82002001
41 
42 /* Number of STM32 SiP Calls implemented */
43 #define STM32_COMMON_SIP_NUM_CALLS	3
44 
45 /* Service for BSEC */
46 #define STM32_SMC_READ_SHADOW		0x01
47 #define STM32_SMC_PROG_OTP		0x02
48 #define STM32_SMC_WRITE_SHADOW		0x03
49 #define STM32_SMC_READ_OTP		0x04
50 
51 #endif /* STM32MP1_SMC_H */
52