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