1 /*
2  * Copyright 2022-2024 NXP
3 *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef MRU_IP_CFG_H
8 #define MRU_IP_CFG_H
9 
10 /**
11 *   @file    Mru_Ip_Cfg.h
12 *   @version 2.0.0
13 *
14 *   @brief   AUTOSAR Platform - Mru configuration header file.
15 *   @details This file is the header containing all the necessary information for MRU
16 *            module configuration(s).
17 *   @addtogroup MRU_IP_DRIVER_CONFIGURATION Mru Ip Driver Configuration
18 *   @{
19 */
20 
21 #ifdef __cplusplus
22 extern "C"{
23 #endif
24 
25 
26 /*==================================================================================================
27 *                                        INCLUDE FILES
28 * 1) system and project includes
29 * 2) needed interfaces from external units
30 * 3) internal and external interfaces from this unit
31 * 4) user callback header files
32 ==================================================================================================*/
33 #include <zephyr/devicetree.h>
34 #include "Mcal.h"
35 #include "OsIf.h"
36 #include "Mru_Ip_CfgDefines.h"
37 #include "S32Z2_SMU_MRU.h"
38 #include "S32Z2_RTU_MRU.h"
39 #include "S32Z2_CE_MRU.h"
40 /*==================================================================================================
41 *                              SOURCE FILE VERSION INFORMATION
42 ==================================================================================================*/
43 #define CDD_PLATFORM_MRU_IP_VENDOR_ID_CFG                       43
44 #define CDD_PLATFORM_MRU_IP_AR_RELEASE_MAJOR_VERSION_CFG        4
45 #define CDD_PLATFORM_MRU_IP_AR_RELEASE_MINOR_VERSION_CFG        7
46 #define CDD_PLATFORM_MRU_IP_AR_RELEASE_REVISION_VERSION_CFG     0
47 #define CDD_PLATFORM_MRU_IP_SW_MAJOR_VERSION_CFG                2
48 #define CDD_PLATFORM_MRU_IP_SW_MINOR_VERSION_CFG                0
49 #define CDD_PLATFORM_MRU_IP_SW_PATCH_VERSION_CFG                0
50 
51 /*==================================================================================================
52                                       FILE VERSION CHECKS
53 ==================================================================================================*/
54 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
55     /* Check if current file and Mcal header file are of the same Autosar version */
56     #if ((CDD_PLATFORM_MRU_IP_AR_RELEASE_MAJOR_VERSION_CFG != MCAL_AR_RELEASE_MAJOR_VERSION) || \
57          (CDD_PLATFORM_MRU_IP_AR_RELEASE_MINOR_VERSION_CFG != MCAL_AR_RELEASE_MINOR_VERSION))
58     #error "AutoSar Version Numbers of Mru_Ip_Cfg.h and Mcal.h are different"
59     #endif
60 
61     /* Check if the current file and OsIf.h header file are of the same version */
62     #if ((CDD_PLATFORM_MRU_IP_AR_RELEASE_MAJOR_VERSION_CFG != OSIF_AR_RELEASE_MAJOR_VERSION) || \
63          (CDD_PLATFORM_MRU_IP_AR_RELEASE_MINOR_VERSION_CFG != OSIF_AR_RELEASE_MINOR_VERSION) \
64         )
65         #error "AutoSar Version Numbers of Mru_Ip_Cfg.h and OsIf.h are different"
66     #endif
67 #endif
68 
69 /* Check if Mru_Ip_CfgDefines.h and Mru_Ip_Cfg.h are of the same vendor */
70 #if (CDD_PLATFORM_MRU_IP_CFG_DEFINES_VENDOR_ID != CDD_PLATFORM_MRU_IP_VENDOR_ID_CFG)
71     #error "Mru_Ip_CfgDefines.h and Mru_Ip_Cfg.h have different vendor ids"
72 #endif
73 /* Check if Mru_Ip_CfgDefines.h file and Mru_Ip_Cfg.h file are of the same Autosar version */
74 #if ((CDD_PLATFORM_MRU_IP_CFG_DEFINES_AR_RELEASE_MAJOR_VERSION != CDD_PLATFORM_MRU_IP_AR_RELEASE_MAJOR_VERSION_CFG) || \
75      (CDD_PLATFORM_MRU_IP_CFG_DEFINES_AR_RELEASE_MINOR_VERSION != CDD_PLATFORM_MRU_IP_AR_RELEASE_MINOR_VERSION_CFG) || \
76      (CDD_PLATFORM_MRU_IP_CFG_DEFINES_AR_RELEASE_REVISION_VERSION != CDD_PLATFORM_MRU_IP_AR_RELEASE_REVISION_VERSION_CFG))
77 #error "AutoSar Version Numbers of Mru_Ip_CfgDefines.h and Mru_Ip_Cfg.h are different"
78 #endif
79 #if ((CDD_PLATFORM_MRU_IP_CFG_DEFINES_SW_MAJOR_VERSION != CDD_PLATFORM_MRU_IP_SW_MAJOR_VERSION_CFG) || \
80      (CDD_PLATFORM_MRU_IP_CFG_DEFINES_SW_MINOR_VERSION != CDD_PLATFORM_MRU_IP_SW_MINOR_VERSION_CFG) || \
81      (CDD_PLATFORM_MRU_IP_CFG_DEFINES_SW_PATCH_VERSION != CDD_PLATFORM_MRU_IP_SW_PATCH_VERSION_CFG))
82 #error "Software Version Numbers of Mru_Ip_CfgDefines.h and Mru_Ip_Cfg.h are different"
83 #endif
84 /*==================================================================================================
85                                             CONSTANTS
86 ==================================================================================================*/
87 
88 /*==================================================================================================
89  *                                     DEFINES AND MACROS
90 ==================================================================================================*/
91 
92 /* Not used by Zephyr integration but required to build the drivers */
93 #define MRU_IP_CONFIG_EXT
94 
95 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru0), okay)
96 /**
97 * @brief RTU0_MRU0 is enabled and used.
98 */
99 #define RTU0_MRU0_ENABLED                  (STD_ON)
100 /**
101 * @brief Instance number for RTU0_MRU0.
102 */
103 #define MRU_IP_RTU0_MRU0_INSTANCE          (0U)
104 /**
105 * @brief Instance ID for RTU0_MRU0.
106 */
107 #define MRU_IP_RTU0_MRU0_ID                (0U)
108 #endif
109 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru1), okay)
110 /**
111 * @brief RTU0_MRU1 is enabled and used.
112 */
113 #define RTU0_MRU1_ENABLED                  (STD_ON)
114 /**
115 * @brief Instance number for RTU0_MRU1.
116 */
117 #define MRU_IP_RTU0_MRU1_INSTANCE          (1U)
118 /**
119 * @brief Instance ID for RTU0_MRU1.
120 */
121 #define MRU_IP_RTU0_MRU1_ID                (1U)
122 #endif
123 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru2), okay)
124 /**
125 * @brief RTU0_MRU2 is enabled and used.
126 */
127 #define RTU0_MRU2_ENABLED                  (STD_ON)
128 /**
129 * @brief Instance number for RTU0_MRU2.
130 */
131 #define MRU_IP_RTU0_MRU2_INSTANCE          (2U)
132 /**
133 * @brief Instance ID for RTU0_MRU2.
134 */
135 #define MRU_IP_RTU0_MRU2_ID                (2U)
136 #endif
137 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru3), okay)
138 /**
139 * @brief RTU0_MRU3 is enabled and used.
140 */
141 #define RTU0_MRU3_ENABLED                  (STD_ON)
142 /**
143 * @brief Instance number for RTU0_MRU3.
144 */
145 #define MRU_IP_RTU0_MRU3_INSTANCE          (3U)
146 /**
147 * @brief Instance ID for RTU0_MRU3.
148 */
149 #define MRU_IP_RTU0_MRU3_ID                (3U)
150 #endif
151 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru4), okay)
152 /**
153 * @brief RTU1_MRU4 is enabled and used.
154 */
155 #define RTU1_MRU4_ENABLED                  (STD_ON)
156 /**
157 * @brief Instance number for RTU1_MRU4.
158 */
159 #define MRU_IP_RTU1_MRU4_INSTANCE          (4U)
160 /**
161 * @brief Instance ID for RTU1_MRU4.
162 */
163 #define MRU_IP_RTU1_MRU4_ID                (4U)
164 #endif
165 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru5), okay)
166 /**
167 * @brief RTU1_MRU5 is enabled and used.
168 */
169 #define RTU1_MRU5_ENABLED                  (STD_ON)
170 /**
171 * @brief Instance number for RTU1_MRU5.
172 */
173 #define MRU_IP_RTU1_MRU5_INSTANCE          (5U)
174 /**
175 * @brief Instance ID for RTU1_MRU5.
176 */
177 #define MRU_IP_RTU1_MRU5_ID                (5U)
178 #endif
179 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru6), okay)
180 /**
181 * @brief RTU1_MRU6 is enabled and used.
182 */
183 #define RTU1_MRU6_ENABLED                  (STD_ON)
184 /**
185 * @brief Instance number for RTU1_MRU6.
186 */
187 #define MRU_IP_RTU1_MRU6_INSTANCE          (6U)
188 /**
189 * @brief Instance ID for RTU1_MRU6.
190 */
191 #define MRU_IP_RTU1_MRU6_ID                (6U)
192 #endif
193 #if DT_NODE_HAS_STATUS(DT_NODELABEL(mru7), okay)
194 /**
195 * @brief RTU1_MRU7 is enabled and used.
196 */
197 #define RTU1_MRU7_ENABLED                  (STD_ON)
198 /**
199 * @brief Instance number for RTU1_MRU7.
200 */
201 #define MRU_IP_RTU1_MRU7_INSTANCE          (7U)
202 /**
203 * @brief Instance ID for RTU1_MRU7.
204 */
205 #define MRU_IP_RTU1_MRU7_ID                (7U)
206 #endif
207 
208 /**
209 * @brief Number of instance is used by the driver.
210 */
211 #define MRU_IP_NUMBER_OF_INSTANCES    (8U)
212 
213 /**
214 * @brief ID for interrupt group 0.
215 */
216 #define MRU_IP_INT_GROUP_0  0
217 /**
218 * @brief ID for interrupt group 1.
219 */
220 #define MRU_IP_INT_GROUP_1  1
221 
222 /*==================================================================================================
223 *                                            ENUMS
224 ==================================================================================================*/
225 
226 
227 /*==================================================================================================
228 *                               STRUCTURES AND OTHER TYPEDEFS
229 ==================================================================================================*/
230 
231 
232 /*==================================================================================================
233 *                                GLOBAL VARIABLE DECLARATIONS
234 ==================================================================================================*/
235 #define PLATFORM_START_SEC_CONST_UNSPECIFIED
236 #include "Platform_MemMap.h"
237 extern RTU_MRU_Type* const Mru_Ip_apxRTU_Bases[RTU_MRU_INSTANCE_COUNT];
238 #define PLATFORM_STOP_SEC_CONST_UNSPECIFIED
239 #include "Platform_MemMap.h"
240 /*==================================================================================================
241 *                                    FUNCTION PROTOTYPES
242 ==================================================================================================*/
243 
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 #endif
249 
250 /** @} */
251