blob: 52088de28a51724099364c7b8d10cfdf1a6ea383 [file] [log] [blame]
Yann Gautier05be8d82019-01-17 14:51:25 +01001/*
Nicolas Le Bayon152897d2020-01-14 14:03:39 +01002 * Copyright (c) 2016-2021, STMicroelectronics - All Rights Reserved
Yann Gautier05be8d82019-01-17 14:51:25 +01003 *
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
Yann Gautier52448ab2019-01-17 14:53:24 +010018/* 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
Etienne Carriere34f0e932020-07-16 17:36:18 +020032/*
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
Yann Gautier05be8d82019-01-17 14:51:25 +010042/* SMC function IDs for SiP Service queries */
43#define STM32_SIP_SVC_CALL_COUNT 0x8200ff00
44#define STM32_SIP_SVC_UID 0x8200ff01
45/* 0x8200ff02 is reserved */
46#define STM32_SIP_SVC_VERSION 0x8200ff03
47
48/* STM32 SiP Service Calls version numbers */
49#define STM32_SIP_SVC_VERSION_MAJOR 0x0
50#define STM32_SIP_SVC_VERSION_MINOR 0x1
51
52/* Number of STM32 SiP Calls implemented */
Etienne Carriere34f0e932020-07-16 17:36:18 +020053#define STM32_COMMON_SIP_NUM_CALLS 3
Yann Gautier52448ab2019-01-17 14:53:24 +010054
55/* Service for BSEC */
56#define STM32_SMC_READ_SHADOW 0x01
57#define STM32_SMC_PROG_OTP 0x02
58#define STM32_SMC_WRITE_SHADOW 0x03
59#define STM32_SMC_READ_OTP 0x04
Yann Gautier05be8d82019-01-17 14:51:25 +010060
Nicolas Le Bayon152897d2020-01-14 14:03:39 +010061/* SMC error codes */
62#define STM32_SMC_OK 0x00000000U
63#define STM32_SMC_NOT_SUPPORTED 0xFFFFFFFFU
64#define STM32_SMC_FAILED 0xFFFFFFFEU
65#define STM32_SMC_INVALID_PARAMS 0xFFFFFFFDU
66
Yann Gautier05be8d82019-01-17 14:51:25 +010067#endif /* STM32MP1_SMC_H */