[processor-sdk/pdk.git] / packages / ti / drv / icss_emac / firmware / icss_dualemac / src / icss_vlan_mcast_filter_mmap.h
1 /******************************************************************************
2 *
3 *
4 * TEXAS INSTRUMENTS TEXT FILE LICENSE
5 *
6 * Copyright (c) 2018-2019 Texas Instruments Incorporated
7 *
8 * All rights reserved not granted herein.
9 *
10 * Limited License.
11 *
12 * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
13 * license under copyrights and patents it now or hereafter owns or controls to
14 * make, have made, use, import, offer to sell and sell ("Utilize") this software
15 * subject to the terms herein. With respect to the foregoing patent license,
16 * such license is granted solely to the extent that any such patent is necessary
17 * to Utilize the software alone. The patent license shall not apply to any
18 * combinations which include this software, other than combinations with devices
19 * manufactured by or for TI ("TI Devices"). No hardware patent is licensed hereunder.
20 *
21 * Redistributions must preserve existing copyright notices and reproduce this license
22 * (including the above copyright notice and the disclaimer and (if applicable) source
23 * code license limitations below) in the documentation and/or other materials provided
24 * with the distribution.
25 *
26 * Redistribution and use in binary form, without modification, are permitted provided
27 * that the following conditions are met:
28 * No reverse engineering, decompilation, or disassembly of this software is
29 * permitted with respect to any software provided in binary form.
30 * Any redistribution and use are licensed by TI for use only with TI Devices.
31 * Nothing shall obligate TI to provide you with source code for the software
32 * licensed and provided to you in object code.
33 *
34 * If software source code is provided to you, modification and redistribution of the
35 * source code are permitted provided that the following conditions are met:
36 * Any redistribution and use of the source code, including any resulting derivative
37 * works, are licensed by TI for use only with TI Devices.
38 * Any redistribution and use of any object code compiled from the source code
39 * and any resulting derivative works, are licensed by TI for use only with TI Devices.
40 *
41 * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
42 * may be used to endorse or promote products derived from this software without
43 * specific prior written permission.
44 *
45 * DISCLAIMER.
46 *
47 * THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED
48 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
49 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S
50 * LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
51 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
52 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
53 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
55 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 *
57 *
58 * file : icss_vlan_mcast_filter_mmap.h
59 *
60 * brief: This file contains VLAN/Multicast filtering feature memory map
61 *
62 */
63 #ifndef ICSS_VLAN_MULTICAST_FILTER_MM_H
64 #define ICSS_VLAN_MULTICAST_FILTER_MM_H
66 /************************************************************************************
67 * VLAN/Multicast filter defines & offsets, present on both PRU0 and PRU1 DRAM
68 *************************************************************************************/
69 /* Feature enable/disable values for multicast filtering */
70 #define ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_DISABLED 0x00
71 #define ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_ENABLED 0x01
73 /* Feature enable/disable values for VLAN filtering */
74 #define ICSS_EMAC_FW_VLAN_FILTER_CTRL_DISABLED 0x00
75 #define ICSS_EMAC_FW_VLAN_FILTER_CTRL_ENABLED 0x01
77 /* Add/remove multicast mac id for filtering bin */
78 #define ICSS_EMAC_FW_MULTICAST_FILTER_HOST_RCV_ALLOWED 0x01
79 #define ICSS_EMAC_FW_MULTICAST_FILTER_HOST_RCV_NOT_ALLOWED 0x00
81 /* Default HASH value for the multicast filtering Mask */
82 #define ICSS_EMAC_FW_MULTICAST_FILTER_INIT_VAL 0xFF
84 /* Size requirements for Multicast filtering feature */
85 #define ICSS_EMAC_FW_MULTICAST_TABLE_SIZE_BYTES 256
86 #define ICSS_EMAC_FW_MULTICAST_FILTER_MASK_SIZE_BYTES 6
87 #define ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_SIZE_BYTES 1
88 #define ICSS_EMAC_FW_MULTICAST_FILTER_MASK_OVERRIDE_STATUS_SIZE_BYTES 1
89 #define ICSS_EMAC_FW_MULTICAST_FILTER_DROP_CNT_SIZE_BYTES 4
91 /* Size requirements for VLAN filtering feature : 4096 bits = 512 bytes */
92 #define ICSS_EMAC_FW_VLAN_FILTER_TABLE_SIZE_BYTES 512
93 #define ICSS_EMAC_FW_VLAN_FILTER_CTRL_SIZE_BYTES 1
94 #define ICSS_EMAC_FW_VLAN_FILTER_DROP_CNT_SIZE_BYTES 4
96 /* Mask override set status */
97 #define ICSS_EMAC_FW_MULTICAST_FILTER_MASK_OVERRIDE_SET 1
98 /* Mask override not set status */
99 #define ICSS_EMAC_FW_MULTICAST_FILTER_MASK_OVERRIDE_NOT_SET 0
100 /* 6 bytes HASH Mask for the MAC */
101 #define ICSS_EMAC_FW_MULTICAST_FILTER_MASK_OFFSET ( 0xF4 )
102 /* 0 -> multicast filtering disabled | 1 -> multicast filtering enabled */
103 #define ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_OFFSET ( ICSS_EMAC_FW_MULTICAST_FILTER_MASK_OFFSET + ICSS_EMAC_FW_MULTICAST_FILTER_MASK_SIZE_BYTES )
104 /* Status indicating if the HASH override is done or not: 0: no, 1: yes */
105 #define ICSS_EMAC_FW_MULTICAST_FILTER_OVERRIDE_STATUS ( ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_OFFSET + ICSS_EMAC_FW_MULTICAST_FILTER_CTRL_SIZE_BYTES )
106 /* Multicast drop statistics */
107 #define ICSS_EMAC_FW_MULTICAST_FILTER_DROP_CNT_OFFSET ( ICSS_EMAC_FW_MULTICAST_FILTER_OVERRIDE_STATUS + ICSS_EMAC_FW_MULTICAST_FILTER_MASK_OVERRIDE_STATUS_SIZE_BYTES )
108 /* Multicast table */
109 #define ICSS_EMAC_FW_MULTICAST_FILTER_TABLE ( ICSS_EMAC_FW_MULTICAST_FILTER_DROP_CNT_OFFSET + ICSS_EMAC_FW_MULTICAST_FILTER_DROP_CNT_SIZE_BYTES )
111 /* VLAN table Offsets */
112 #define ICSS_EMAC_FW_VLAN_FLTR_TBL_BASE_ADDR ( 0x200 )
113 #define ICSS_EMAC_FW_VLAN_FILTER_CTRL_BITMAP_OFFSET ( 0xEF )
114 #define ICSS_EMAC_FW_VLAN_FILTER_DROP_CNT_OFFSET ( ICSS_EMAC_FW_VLAN_FILTER_CTRL_BITMAP_OFFSET + ICSS_EMAC_FW_VLAN_FILTER_CTRL_SIZE_BYTES )
116 /* VLAN filter Control Bit maps */
117 /* one bit field, bit 0: | 0 : VLAN filter disabled (default), 1: VLAN filter enabled */
118 #define ICSS_EMAC_FW_VLAN_FILTER_CTRL_ENABLE_BIT ( 0 )
119 /* one bit field, bit 1: | 0 : untagged host rcv allowed (default), 1: untagged host rcv not allowed */
120 #define ICSS_EMAC_FW_VLAN_FILTER_UNTAG_HOST_RCV_ALLOW_CTRL_BIT ( 1 )
121 /* one bit field, bit 1: | 0 : priotag host rcv allowed (default), 1: priotag host rcv not allowed */
122 #define ICSS_EMAC_FW_VLAN_FILTER_PRIOTAG_HOST_RCV_ALLOW_CTRL_BIT ( 2 )
123 /* one bit field, bit 1: | 0 : skip sv vlan flow :1 : take sv vlan flow (not applicable for dual emac
124 #define ICSS_EMAC_FW_VLAN_FILTER_SV_VLAN_FLOW_HOST_RCV_ALLOW_CTRL_BIT ( 3 )
125 */
127 /* VLAN IDs */
128 #define ICSS_EMAC_FW_VLAN_FILTER_PRIOTAG_VID ( 0 )
129 #define ICSS_EMAC_FW_VLAN_FILTER_VID_MIN ( 0x0000 )
130 #define ICSS_EMAC_FW_VLAN_FILTER_VID_MAX ( 0x0FFF )
132 /* VLAN Filtering Commands */
133 #define ICSS_EMAC_FW_VLAN_FILTER_ADD_VLAN_VID_CMD ( 0x00 )
134 #define ICSS_EMAC_FW_VLAN_FILTER_REMOVE_VLAN_VID_CMD ( 0x01 )
136 #endif /* ICSS_MULTICAST_FILTER_MM_H */