xref: /rk3399_ARM-atf/plat/st/stm32mp1/include/stm32mp1_smc.h (revision c7ba52da729300151623348478ff44f7a2b8d69c)
1 /*
2  * Copyright (c) 2016-2019, 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 /* SMC function IDs for SiP Service queries */
33 #define STM32_SIP_SVC_CALL_COUNT	0x8200ff00
34 #define STM32_SIP_SVC_UID		0x8200ff01
35 /*					0x8200ff02 is reserved */
36 #define STM32_SIP_SVC_VERSION		0x8200ff03
37 
38 /* STM32 SiP Service Calls version numbers */
39 #define STM32_SIP_SVC_VERSION_MAJOR	0x0
40 #define STM32_SIP_SVC_VERSION_MINOR	0x1
41 
42 /* Number of STM32 SiP Calls implemented */
43 #define STM32_COMMON_SIP_NUM_CALLS	4
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