1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Description:
8  *      SCMI Core Configuration Protocol Support.
9  */
10 
11 #ifndef MOD_SCMI_APCORE_H
12 #define MOD_SCMI_APCORE_H
13 
14 #include <stddef.h>
15 #include <stdint.h>
16 
17 /*!
18  * \ingroup GroupModules Modules
19  * \defgroup GroupSCMI_APCORE SCMI Core Configuration Protocol
20  * \{
21  */
22 
23 /*!
24  * \brief SCMI APCORE protocol
25  */
26 #define MOD_SCMI_PROTOCOL_ID_APCORE UINT32_C(0x90)
27 
28 /*!
29  * \brief SCMI APCORE protocol version
30  */
31 #define MOD_SCMI_PROTOCOL_VERSION_APCORE UINT32_C(0x10000)
32 
33 /*!
34  * \brief Identifiers of the SCMI Core Configuration Protocol commands
35  */
36 enum mod_scmi_apcore_command_id {
37     MOD_SCMI_APCORE_RESET_ADDRESS_SET = 0x3,
38     MOD_SCMI_APCORE_RESET_ADDRESS_GET = 0x4,
39 };
40 
41 /*!
42  * \brief Platform reset register widths.
43  */
44 enum mod_scmi_apcore_register_width {
45     /*! Single-word, 32-bit reset address registers supported */
46     MOD_SCMI_APCORE_REG_WIDTH_32,
47 
48     /*! Double-word, 64-bit reset address registers supported */
49     MOD_SCMI_APCORE_REG_WIDTH_64,
50 
51     /*! Number of valid register widths */
52     MOD_SCMI_APCORE_REG_WIDTH_COUNT,
53 };
54 
55 /*!
56  * \brief Reset register group.
57  *
58  * \details Describes a set of reset registers that are contiguous in memory.
59  */
60 struct mod_scmi_apcore_reset_register_group {
61     /*! Address of the first register in the group */
62     uintptr_t base_register;
63 
64     /*! The number of registers in the group */
65     size_t register_count;
66 };
67 
68 /*!
69  * \brief Module configuration.
70  */
71 struct mod_scmi_apcore_config {
72     /*!
73      * \brief Pointer to the table of ::mod_scmi_apcore_reset_register_group
74      *     structures that define the reset registers within the platform.
75      */
76     const struct mod_scmi_apcore_reset_register_group
77         *reset_register_group_table;
78 
79     /*!
80      * \brief Number of ::mod_scmi_apcore_reset_register_group structures in
81      *     ::mod_scmi_apcore_config::reset_register_group_table.
82      */
83     size_t reset_register_group_count;
84 
85     /*! Width of the reset address supported by the platform */
86     enum mod_scmi_apcore_register_width reset_register_width;
87 };
88 
89 /*!
90  * \}
91  */
92 
93 #endif /* MOD_SCMI_APCORE_H */
94