blob: 34930b6c64b9ded264e935636cd7ef3a203023d2 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
Antonio Nino Diaz36110422019-01-30 16:07:36 +00002 * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef __SMCCC_H__
8#define __SMCCC_H__
9
10#include <utils_def.h>
11
12#define SMCCC_VERSION_MAJOR_SHIFT U(16)
13#define SMCCC_VERSION_MAJOR_MASK U(0x7FFF)
14#define SMCCC_VERSION_MINOR_SHIFT U(0)
15#define SMCCC_VERSION_MINOR_MASK U(0xFFFF)
16#define MAKE_SMCCC_VERSION(_major, _minor) \
17 ((((uint32_t)(_major) & SMCCC_VERSION_MAJOR_MASK) << \
18 SMCCC_VERSION_MAJOR_SHIFT) \
19 | (((uint32_t)(_minor) & SMCCC_VERSION_MINOR_MASK) << \
20 SMCCC_VERSION_MINOR_SHIFT))
21
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020022#define SMC_UNKNOWN -1
23
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020024/*******************************************************************************
25 * Bit definitions inside the function id as per the SMC calling convention
26 ******************************************************************************/
27#define FUNCID_TYPE_SHIFT 31
28#define FUNCID_CC_SHIFT 30
29#define FUNCID_OEN_SHIFT 24
30#define FUNCID_NUM_SHIFT 0
31
32#define FUNCID_TYPE_MASK 0x1
33#define FUNCID_CC_MASK 0x1
34#define FUNCID_OEN_MASK 0x3f
35#define FUNCID_NUM_MASK 0xffff
36
37#define FUNCID_TYPE_WIDTH 1
38#define FUNCID_CC_WIDTH 1
39#define FUNCID_OEN_WIDTH 6
40#define FUNCID_NUM_WIDTH 16
41
42#define SMC_64 1
43#define SMC_32 0
44#define SMC_TYPE_FAST 1
45#define SMC_TYPE_STD 0
46
47/*******************************************************************************
48 * Owning entity number definitions inside the function id as per the SMC
49 * calling convention
50 ******************************************************************************/
51#define OEN_ARM_START 0
52#define OEN_ARM_END 0
53#define OEN_CPU_START 1
54#define OEN_CPU_END 1
55#define OEN_SIP_START 2
56#define OEN_SIP_END 2
57#define OEN_OEM_START 3
58#define OEN_OEM_END 3
59#define OEN_STD_START 4 /* Standard Calls */
60#define OEN_STD_END 4
61#define OEN_TAP_START 48 /* Trusted Applications */
62#define OEN_TAP_END 49
63#define OEN_TOS_START 50 /* Trusted OS */
64#define OEN_TOS_END 63
65#define OEN_LIMIT 64
66
67#endif /* __SMCCC_H__ */