1 /* 2 * Copyright 2022-2024 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef NETC_ETH_IP_FEATURES_H 8 #define NETC_ETH_IP_FEATURES_H 9 10 /** 11 * @file Netc_Eth_Ip_Features.h 12 * 13 * @addtogroup NETC_ETH_DRIVER NETC_ETH Driver 14 * @{ 15 */ 16 17 #ifdef __cplusplus 18 extern "C" 19 { 20 #endif 21 22 /*================================================================================================== 23 * INCLUDE FILES 24 * 1) system and project includes 25 * 2) needed interfaces from external units 26 * 3) internal and external interfaces from this unit 27 ==================================================================================================*/ 28 29 /*================================================================================================== 30 * SOURCE FILE VERSION INFORMATION 31 ==================================================================================================*/ 32 #define NETC_ETH_IP_FEATURES_VENDOR_ID 43 33 #define NETC_ETH_IP_FEATURES_AR_RELEASE_MAJOR_VERSION 4 34 #define NETC_ETH_IP_FEATURES_AR_RELEASE_MINOR_VERSION 7 35 #define NETC_ETH_IP_FEATURES_AR_RELEASE_REVISION_VERSION 0 36 #define NETC_ETH_IP_FEATURES_SW_MAJOR_VERSION 2 37 #define NETC_ETH_IP_FEATURES_SW_MINOR_VERSION 0 38 #define NETC_ETH_IP_FEATURES_SW_PATCH_VERSION 0 39 40 /*================================================================================================== 41 * FILE VERSION CHECKS 42 ==================================================================================================*/ 43 44 /*================================================================================================== 45 * CONSTANTS 46 ==================================================================================================*/ 47 48 /*================================================================================================== 49 * DEFINES AND MACROS 50 ==================================================================================================*/ 51 /** @brief Total number of virtual ethernet controllers supported on NETC(VSIs). */ 52 #define FEATURE_NETC_ETH_NUM_OF_VIRTUAL_CTRLS 7 53 54 /** @brief Total number of physical ethernet controllers supported on NETC(PSIs). */ 55 #define NETC_ETH_IP_NUM_OF_PHYSICAL_CTRLS (1U) 56 57 /** @brief Total number of ethernet controllers supported on NETC(VSI + PSI). */ 58 #define FEATURE_NETC_ETH_NUMBER_OF_CTRLS (8) 59 60 #define FEATURE_NETC_NUMBER_OF_FUNC (4U) 61 62 /** @brief Index of the physical SI. */ 63 #define NETC_ETH_IP_PSI_INDEX (uint8)(0U) 64 65 /** @brief Alignment for buffer descriptor. */ 66 #define FEATURE_NETC_BUFFDESCR_ALIGNMENT_BYTES (128U) 67 68 /** @brief Alignment for buffer. */ 69 #define FEATURE_NETC_BUFF_ALIGNMENT_BYTES (64U) 70 71 /** @brief Custom tag size. */ 72 #define FEATURE_NETC_ETH_CUSTOM_TAG_SIZE (64U) 73 74 /* TODO: Generate this from configuration. From all VSs take the bigger value. */ 75 /** @brief Number of RX BDR used.*/ 76 #define FEATURE_NETC_RX_BDR_COUNT (18U) 77 /** @brief Number of TX BDR used.*/ 78 #define FEATURE_NETC_TX_BDR_COUNT (18U) 79 80 /** @brief Index in the MSI table of VSI to PSI interrupt. */ 81 #define NETC_ETH_IP_SITOSI_MESSAGE_MSI_TABLE_INDEX (0U) 82 /** @brief Index in the MSI table of TX interrupt. */ 83 #define NETC_ETH_IP_TX_MSI_TABLE_INDEX (1U) 84 /** @brief Index in the MSI table of RX interrupt. */ 85 #define NETC_ETH_IP_RX_MSI_TABLE_INDEX (2U) 86 /** @brief MSI message control enable mask. */ 87 #define NETC_ETH_IP_MSI_MSG_CTL_ENABLE_MASK (0x8000U) 88 /** @brief Number of entries for a MSI table of a SI. */ 89 #define NETC_ETH_IP_NUM_OF_ENTRIES_MSITABLE (3U) 90 91 /** @brief Extract a specific bit form a byte. */ 92 #define NETC_ETH_IP_BIT0_VALUE_FROM_BYTE(Byte) ((Byte) & 1U) 93 #define NETC_ETH_IP_BIT1_VALUE_FROM_BYTE(Byte) (((Byte) >> 1U) & 0x01U) 94 #define NETC_ETH_IP_BIT2_VALUE_FROM_BYTE(Byte) (((Byte) >> 2U) & 0x01U) 95 #define NETC_ETH_IP_BIT3_VALUE_FROM_BYTE(Byte) (((Byte) >> 3U) & 0x01U) 96 #define NETC_ETH_IP_BIT4_VALUE_FROM_BYTE(Byte) (((Byte) >> 4U) & 0x01U) 97 #define NETC_ETH_IP_BIT5_VALUE_FROM_BYTE(Byte) (((Byte) >> 5U) & 0x01U) 98 #define NETC_ETH_IP_BIT6_VALUE_FROM_BYTE(Byte) (((Byte) >> 6U) & 0x01U) 99 #define NETC_ETH_IP_BIT7_VALUE_FROM_BYTE(Byte) (((Byte) >> 7U) & 0x01U) 100 101 /** @brief Number of bytes in a MAC address. */ 102 #define NETC_ETH_IP_MAC_BYTES_SIZE (uint8)(6U) 103 104 /** @brief Select hash value register. */ 105 #define NETC_ETH_IP_SELECT_HASH_REGISTER (uint8)(0x20U) 106 107 /** @brief Select hash value register. */ 108 #define NETC_ETH_IP_HASH_VALUE (uint8)(0x1FU) 109 110 #define NETC_ETH_IP_TIME_GATE_SCHEDULING_TABLE_ID (5U) /*!< Time Gate Scheduling table id */ 111 #define NETC_ETH_IP_RATE_POLICER_TABLE_ID (10U) /*!< Rate Policer table id */ 112 #define NETC_ETH_IP_INGRESS_STREAM_IDEN_TABLE_ID (30U) /*!< Ingress Stream Identification table id */ 113 #define NETC_ETH_IP_INGRESS_PORT_FILTER_TABLE_ID (13U) /*!< Ingress Port Filter table id */ 114 #define NETC_ETH_IP_STREAM_GATE_INSTANCE_TABLE_ID (36U) /*!< Stream Gate Instance table id */ 115 #define NETC_ETH_IP_STREAM_GATE_CTRL_LIST_TABLE_ID (37U) /*!< Stream Gate Control List table id */ 116 #define NETC_ETH_IP_INGRESS_STREAM_TABLE_ID (31U) /*!< Ingress Stream table id */ 117 #define NETC_ETH_IP_BD_NULL_ENTRY_ID (0xFFFFFFFFUL) /*!< BD null entry */ 118 #define NETC_ETH_IP_BD_ZERO_ENTRY_ID (0x00000000UL) /*!< BD null entry */ 119 120 /*! @brief Generate the type of cache IP on the platform used for the cacheable buffers feature */ 121 #define FEATURE_NETC_CACHABLE_BUFFERS_LMEM (0U) 122 #define FEATURE_NETC_CACHABLE_BUFFERS_CORE (1U) 123 124 /*================================================================================================== 125 * ENUMS 126 ==================================================================================================*/ 127 128 /*================================================================================================== 129 * STRUCTURES AND OTHER TYPEDEFS 130 ==================================================================================================*/ 131 132 /*================================================================================================== 133 * GLOBAL VARIABLE DECLARATIONS 134 ==================================================================================================*/ 135 136 /*================================================================================================== 137 * FUNCTION PROTOTYPES 138 ==================================================================================================*/ 139 140 #ifdef __cplusplus 141 } 142 #endif 143 144 /** @} */ 145 146 #endif 147