1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Description:
8  *     System Control and Management Interface (SCMI) support.
9  */
10 
11 #ifndef MOD_SCMI_HEADER_H
12 #define MOD_SCMI_HEADER_H
13 
14 #define SCMI_MESSAGE_HEADER_MESSAGE_ID_POS   0U
15 #define SCMI_MESSAGE_HEADER_MESSAGE_TYPE_POS 8U
16 #define SCMI_MESSAGE_HEADER_PROTOCOL_ID_POS  10U
17 #define SCMI_MESSAGE_HEADER_TOKEN_POS        18U
18 
19 #define SCMI_MESSAGE_HEADER_MESSAGE_ID_MASK \
20     (UINT32_C(0xFF) << SCMI_MESSAGE_HEADER_MESSAGE_ID_POS)
21 #define SCMI_MESSAGE_HEADER_MESSAGE_TYPE_MASK \
22     (UINT32_C(0x3) << SCMI_MESSAGE_HEADER_MESSAGE_TYPE_POS)
23 #define SCMI_MESSAGE_HEADER_PROTOCOL_ID_MASK \
24     (UINT32_C(0xFF)  << SCMI_MESSAGE_HEADER_PROTOCOL_ID_POS)
25 #define SCMI_MESSAGE_HEADER_TOKEN_MASK  \
26     (UINT32_C(0x3FF) << SCMI_MESSAGE_HEADER_TOKEN_POS)
27 
28 enum mod_scmi_message_type {
29     MOD_SCMI_MESSAGE_TYPE_COMMAND = 0,
30     MOD_SCMI_MESSAGE_TYPE_DELAYED_RESPONSE = 2,
31     MOD_SCMI_MESSAGE_TYPE_NOTIFICATION = 3,
32 };
33 
34 #endif /* MOD_SCMI_HEADER_H */
35