1 /*
2  * Copyright 2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef GMAC_IP_CFG_H
8 #define GMAC_IP_CFG_H
9 
10 /**
11 *   @file
12 *
13 *   @addtogroup GMAC_DRIVER_CONFIGURATION GMAC Driver Configuration
14 *   @{
15 */
16 
17 #ifdef __cplusplus
18 extern "C"{
19 #endif
20 
21 /*==================================================================================================
22                                          INCLUDE FILES
23  1) system and project includes
24  2) needed interfaces from external units
25  3) internal and external interfaces from this unit
26 ==================================================================================================*/
27 #include "Gmac_Ip_Sa_Init_PBcfg.h"
28 
29 #include "StandardTypes.h"
30 #include "Reg_eSys.h"
31 /*==================================================================================================
32 *                              SOURCE FILE VERSION INFORMATION
33 ==================================================================================================*/
34 #define GMAC_IP_CFG_VENDOR_ID                    43
35 #define GMAC_IP_CFG_AR_RELEASE_MAJOR_VERSION     4
36 #define GMAC_IP_CFG_AR_RELEASE_MINOR_VERSION     7
37 #define GMAC_IP_CFG_AR_RELEASE_REVISION_VERSION  0
38 #define GMAC_IP_CFG_SW_MAJOR_VERSION             3
39 #define GMAC_IP_CFG_SW_MINOR_VERSION             0
40 #define GMAC_IP_CFG_SW_PATCH_VERSION             0
41 
42 /*==================================================================================================
43 *                                     FILE VERSION CHECKS
44 ==================================================================================================*/
45 /* Checks against Gmac_Ip_Sa_Init_PBcfg.h */
46 #if (GMAC_IP_CFG_VENDOR_ID != GMAC_IP_SA_INIT_PBCFG_VENDOR_ID)
47     #error "Gmac_Ip_Cfg.h and Gmac_Ip_Sa_Init_PBcfg.h have different vendor ids"
48 #endif
49 #if ((GMAC_IP_CFG_AR_RELEASE_MAJOR_VERSION    != GMAC_IP_SA_INIT_PBCFG_AR_RELEASE_MAJOR_VERSION) || \
50      (GMAC_IP_CFG_AR_RELEASE_MINOR_VERSION    != GMAC_IP_SA_INIT_PBCFG_AR_RELEASE_MINOR_VERSION) || \
51      (GMAC_IP_CFG_AR_RELEASE_REVISION_VERSION != GMAC_IP_SA_INIT_PBCFG_AR_RELEASE_REVISION_VERSION))
52      #error "AUTOSAR Version Numbers of Gmac_Ip_Cfg.h and Gmac_Ip_Sa_Init_PBcfg.h are different"
53 #endif
54 #if ((GMAC_IP_CFG_SW_MAJOR_VERSION != GMAC_IP_SA_INIT_PBCFG_SW_MAJOR_VERSION) || \
55      (GMAC_IP_CFG_SW_MINOR_VERSION != GMAC_IP_SA_INIT_PBCFG_SW_MINOR_VERSION) || \
56      (GMAC_IP_CFG_SW_PATCH_VERSION != GMAC_IP_SA_INIT_PBCFG_SW_PATCH_VERSION))
57     #error "Software Version Numbers of Gmac_Ip_Cfg.h and Gmac_Ip_Sa_Init_PBcfg.h are different"
58 #endif
59 
60 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
61     /* Checks against StandardTypes.h */
62     #if ((GMAC_IP_CFG_AR_RELEASE_MAJOR_VERSION != STD_AR_RELEASE_MAJOR_VERSION) || \
63          (GMAC_IP_CFG_AR_RELEASE_MINOR_VERSION != STD_AR_RELEASE_MINOR_VERSION))
64         #error "AUTOSAR Version Numbers of Gmac_Ip_Cfg.h and StandardTypes.h are different"
65     #endif
66     /* Checks against Reg_eSys.h */
67     #if ((GMAC_IP_CFG_AR_RELEASE_MAJOR_VERSION != REG_ESYS_AR_RELEASE_MAJOR_VERSION) || \
68          (GMAC_IP_CFG_AR_RELEASE_MINOR_VERSION != REG_ESYS_AR_RELEASE_MINOR_VERSION))
69         #error "AUTOSAR Version Numbers of Gmac_Ip_Cfg.h and Reg_eSys.h are different"
70     #endif
71 #endif
72 /*==================================================================================================
73 *                                      DEFINES AND MACROS
74 ==================================================================================================*/
75 #define GMAC_CONFIG_EXT \
76     GMAC_CONFIG_SA_INIT_PB \
77 
78 #define GMAC_IP_DEV_ERROR_DETECT            (STD_OFF)
79 
80 #define GMAC_TIMEOUT_TYPE                (OSIF_COUNTER_SYSTEM)
81 
82 #define GMAC_TIMEOUT_VALUE_US            (1000U)
83 
84 #define GMAC_ENABLE_USER_MODE_SUPPORT    (STD_OFF)
85 
86 #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
87     #if (STD_ON == GMAC_ENABLE_USER_MODE_SUPPORT)
88         #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running GMAC in user mode, MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined.
89     #endif /* (STD_ON == GMAC_ENABLE_USER_MODE_SUPPORT */
90 #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
91 
92 #if ((STD_ON == GMAC_ENABLE_USER_MODE_SUPPORT) && defined(MCAL_GMAC_REG_PROT_AVAILABLE))
93     #if (STD_ON == MCAL_GMAC_REG_PROT_AVAILABLE)
94         #define GMAC_SET_USER_ACCESS_ALLOWED_AVAILABLE      (STD_ON)
95     #else
96         #define GMAC_SET_USER_ACCESS_ALLOWED_AVAILABLE      (STD_OFF)
97     #endif
98 #else
99     #define GMAC_SET_USER_ACCESS_ALLOWED_AVAILABLE      (STD_OFF)
100 #endif
101 
102 /* @brief Enables / Disables the allocation of the TX data buffers. */
103 #define GMAC_IP_HAS_EXTERNAL_TX_BUFFERS  (STD_OFF)
104 
105 #if (STD_ON == GMAC_IP_HAS_EXTERNAL_TX_BUFFERS)
106     /* @brief Array of the feature of external buffers support indexed at controller level. */
107     #define GMAC_IP_INST_HAS_EXTERNAL_TX_BUFFERS  {(boolean) FALSE}
108 #endif
109 
110 /*! @brief Enables/Disables internal cache management */
111 #define  GMAC_HAS_CACHE_MANAGEMENT  (STD_OFF)
112 
113 /*==================================================================================================
114 *                                             ENUMS
115 ==================================================================================================*/
116 
117 /*==================================================================================================
118 *                                STRUCTURES AND OTHER TYPEDEFS
119 ==================================================================================================*/
120 /* Forward GMAC structure declarations */
121 struct sGmac_Ip_StateType;
122 struct sGmac_Ip_ConfigType;
123 struct sGmac_Ip_RxRingConfigType;
124 struct sGmac_Ip_TxRingConfigType;
125 struct sGmac_Ip_TxTimeAwareShaper;
126 
127 /**
128 * @brief   The structure contains the hardware controller configuration type.
129 */
130 typedef struct sGmac_CtrlConfigType
131 {
132     struct sGmac_Ip_StateType                 *Gmac_pCtrlState;
133     const struct sGmac_Ip_ConfigType          *Gmac_pCtrlConfig;
134     const struct sGmac_Ip_RxRingConfigType    *Gmac_paCtrlRxRingConfig;
135     const struct sGmac_Ip_TxRingConfigType    *Gmac_paCtrlTxRingConfig;
136     const uint8                               *Gmac_pau8CtrlPhysAddr;
137     const struct sGmac_Ip_TxTimeAwareShaper   *Gmac_pCtrlTxTimeAwareShaper;
138 } Gmac_CtrlConfigType;
139 
140 /*==================================================================================================
141 *                                GLOBAL VARIABLE DECLARATIONS
142 ==================================================================================================*/
143 
144 /*==================================================================================================
145                                        GLOBAL CONSTANTS
146 ==================================================================================================*/
147 
148 
149 /*==================================================================================================
150 *                                    FUNCTION PROTOTYPES
151 ==================================================================================================*/
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 /** @} */
158 
159 #endif /* GMAC_IP_CFG_H */
160