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