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 
8 #ifndef PLATFORM_SDS_H
9 #define PLATFORM_SDS_H
10 
11 #include <mod_sds.h>
12 
13 /*
14  * Structure identifiers.
15  */
16 enum platform_sds_struct_id {
17     PLATFORM_SDS_CPU_INFO = 1 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
18     PLATFORM_SDS_FIRMWARE_VERSION = 2 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
19     PLATFORM_SDS_PLATFORM_ID = 3 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
20     PLATFORM_SDS_RESET_SYNDROME = 4 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
21     PLATFORM_SDS_FEATURE_AVAILABILITY = 5 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
22     PLATFORM_SDS_CPU_BOOTCTR = 6 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
23     PLATFORM_SDS_CPU_FLAGS = 7 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
24 };
25 
26 enum platform_sds_region_idx {
27     PLATFORM_SDS_REGION_SECURE,
28 #ifdef BUILD_MODE_DEBUG
29     PLATFORM_SDS_REGION_NONSECURE,
30 #endif
31     PLATFORM_SDS_REGION_COUNT,
32 };
33 
34 /*
35  * Structure sizes.
36  */
37 #define PLATFORM_SDS_CPU_INFO_SIZE             4
38 #define PLATFORM_SDS_FIRMWARE_VERSION_SIZE     4
39 #define PLATFORM_SDS_PLATFORM_ID_SIZE          8
40 #define PLATFORM_SDS_RESET_SYNDROME_SIZE       4
41 #define PLATFORM_SDS_FEATURE_AVAILABILITY_SIZE 4
42 #define PLATFORM_SDS_CPU_BOOTCTR_SIZE          256
43 #define PLATFORM_SDS_CPU_FLAGS_SIZE            256
44 
45 /*
46  * Field masks and offsets for the PLATFORM_SDS_AP_CPU_INFO structure.
47  */
48 #define PLATFORM_SDS_CPU_INFO_PRIMARY_MASK 0xFFFFFFFF
49 #define PLATFORM_SDS_CPU_INFO_PRIMARY_POS  0
50 
51 /*
52  * Platform information
53  */
54 struct platform_sds_platid {
55     /* Subsystem part number */
56     uint32_t platform_identifier;
57     /* Platform type information */
58     uint32_t platform_type_identifier;
59 };
60 
61 /*
62  * Field masks and offsets for the PLATFORM_SDS_FEATURE_AVAILABILITY
63  * structure.
64  */
65 #define PLATFORM_SDS_FEATURE_FIRMWARE_MASK  0x1
66 #define PLATFORM_SDS_FEATURE_DMC_MASK       0x2
67 #define PLATFORM_SDS_FEATURE_MESSAGING_MASK 0x4
68 
69 #define PLATFORM_SDS_FEATURE_FIRMWARE_POS  0
70 #define PLATFORM_SDS_FEATURE_DMC_POS       1
71 #define PLATFORM_SDS_FEATURE_MESSAGING_POS 2
72 
73 #endif /* PLATFORM_SDS_H */
74