xref: /openbmc/u-boot/cmd/aspeed/nettest/ncsi.h (revision b8233483f822dc441692cc7df659e402e7edcd1b)
1 /*
2  *  This program is distributed in the hope that it will be useful,
3  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
4  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5  *  GNU General Public License for more details.
6  *
7  *  You should have received a copy of the GNU General Public License
8  *  along with this program; if not, write to the Free Software
9  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
10  */
11 
12 #ifndef NCSI_H
13 #define NCSI_H
14 
15 
16 #define NCSI_RxDMA_PakSize                       2048
17 #define NCSI_RxDMA_BASE                          ( DMA_BASE + 0x00100000 )
18 
19 //---------------------------------------------------------
20 // Define
21 //---------------------------------------------------------
22 #define MAX_PACKAGE_NUM                          8      // 1 ~ 8
23 #define MAX_CHANNEL_NUM                          4      // 1 ~ 32
24 
25 //---------------------------------------------------------
26 // Function
27 //---------------------------------------------------------
28 #define SENT_RETRY_COUNT                         1
29 #define NCSI_RxDESNum                            2048
30 
31 #define NCSI_Skip_RxCRCData
32 //#define NCSI_Skip_Phase1_DeSelectPackage
33 #define NCSI_Skip_DeSelectPackage
34 //#define NCSI_Skip_DiSChannel
35 //#define NCSI_EnableDelay_DeSelectPackage
36 //#define NCSI_EnableDelay_GetLinkStatus
37 //#define NCSI_EnableDelay_EachPackage
38 //#define NCSI_VERBOSE_TEST
39 //#define Print_Version_ID
40 //#define Print_PackageName
41 #define Print_DetailFrame
42 
43 //---------------------------------------------------------
44 // Delay (ms)
45 //---------------------------------------------------------
46 #define Delay_EachPackage                        1000
47 #define Delay_DeSelectPackage                    50
48 #define Delay_GetLinkStatus                      50
49 
50 //---------------------------------------------------------
51 // PCI DID/VID & Manufacturer ID
52 //---------------------------------------------------------
53 #define ManufacturerID_Intel                     0x00000157     //343
54 #define ManufacturerID_Broadcom                  0x0000113d     //4413
55 #define ManufacturerID_Mellanox                  0x000002c9     //713
56 #define ManufacturerID_Mellanox1                 0x00008119     //33049
57 #define ManufacturerID_Emulex                    0x0000006c     //108
58 
59 //PCI VID: [163c]intel
60 //PCI VID: [8086]Intel Corporation
61 //PCI VID: [8087]Intel
62 //PCI VID: [14e4]Broadcom Corporation
63 //PCI VID: [15b3]Mellanox
64 //PCI VID: [10df]Emulex
65 #define PCI_DID_VID_Intel_82574L                 0x10d38086     // IntelR 82574L Gigabit Ethernet Controller
66 #define PCI_DID_VID_Intel_82575_10d6             0x10d68086     // 82566 DM-2-gigabyte
67 #define PCI_DID_VID_Intel_82575_10a7             0x10a78086     // 82575EB Gigabit Network Connection
68 #define PCI_DID_VID_Intel_82575_10a9             0x10a98086     // 82575EB Gigabit Network Connection
69 #define PCI_DID_VID_Intel_82576_10c9             0x10c98086     //*82576 Gigabit ET Dual Port Server Adapter
70 #define PCI_DID_VID_Intel_82576_10e6             0x10e68086     // 82576 Gigabit Network Connection
71 #define PCI_DID_VID_Intel_82576_10e7             0x10e78086     // 82576 Gigabit Network Connection
72 #define PCI_DID_VID_Intel_82576_10e8             0x10e88086     // E64750-xxx Intel Gigabit ET Quad Port Server Adapter
73 #define PCI_DID_VID_Intel_82576_1518             0x15188086     // 82576NS SerDes Gigabit Network Connectio
74 #define PCI_DID_VID_Intel_82576_1526             0x15268086     // Intel Gigabit ET2 Quad Port Server Adapter
75 #define PCI_DID_VID_Intel_82576_150a             0x150a8086     // 82576NS Gigabit Ethernet Controller
76 #define PCI_DID_VID_Intel_82576_150d             0x150d8086     // 82576 Gigabit Backplane Connection
77 #define PCI_DID_VID_Intel_82599_10fb             0x10fb8086     // 10 Gb Ethernet controller
78 #define PCI_DID_VID_Intel_82599_1557             0x15578086     // 82599EN
79 #define PCI_DID_VID_Intel_I210_1533              0x15338086     //
80 #define PCI_DID_VID_Intel_I210_1537              0x15378086     //???
81 #define PCI_DID_VID_Intel_I350_1521              0x15218086     //
82 #define PCI_DID_VID_Intel_I350_1523              0x15238086     //
83 #define PCI_DID_VID_Intel_X540                   0x15288086     //
84 #define PCI_DID_VID_Intel_X550                   0x15638086     //
85 #define PCI_DID_VID_Intel_Broadwell_DE           0x15ab8086     //PCH
86 #define PCI_DID_VID_Intel_X722_37d0              0x37d08086     //
87 #define PCI_DID_VID_Broadcom_BCM5718             0x165614e4     //
88 #define PCI_DID_VID_Broadcom_BCM5719             0x165714e4     //
89 #define PCI_DID_VID_Broadcom_BCM5720             0x165f14e4     //
90 #define PCI_DID_VID_Broadcom_BCM5725             0x164314e4     //
91 #define PCI_DID_VID_Broadcom_BCM57810S           0x168e14e4     //
92 #define PCI_DID_VID_Broadcom_Cumulus             0x16ca14e4     //
93 #define PCI_DID_VID_Broadcom_BCM57302            0x16c914e4     //
94 #define PCI_DID_VID_Broadcom_BCM957452           0x16f114e4     //
95 #define PCI_DID_VID_Mellanox_ConnectX_3_1003     0x100315b3     //*
96 #define PCI_DID_VID_Mellanox_ConnectX_3_1007     0x100715b3     //ConnectX-3 Pro
97 #define PCI_DID_VID_Mellanox_ConnectX_4          0x101515b3     //*
98 #define PCI_DID_VID_Emulex_40G                   0x072010df     //
99 
100 //---------------------------------------------------------
101 // NCSI Parameter
102 //---------------------------------------------------------
103 //Command and Response Type
104 #define CLEAR_INITIAL_STATE                      0x00           //M
105 #define SELECT_PACKAGE                           0x01           //M
106 #define DESELECT_PACKAGE                         0x02           //M
107 #define ENABLE_CHANNEL                           0x03           //M
108 #define DISABLE_CHANNEL                          0x04           //M
109 #define RESET_CHANNEL                            0x05           //M
110 #define ENABLE_CHANNEL_NETWORK_TX                0x06           //M
111 #define DISABLE_CHANNEL_NETWORK_TX               0x07           //M
112 #define AEN_ENABLE                               0x08
113 #define SET_LINK                                 0x09           //M
114 #define GET_LINK_STATUS                          0x0A           //M
115 #define SET_VLAN_FILTER                          0x0B           //M
116 #define ENABLE_VLAN                              0x0C           //M
117 #define DISABLE_VLAN                             0x0D           //M
118 #define SET_MAC_ADDRESS                          0x0E           //M
119 #define ENABLE_BROADCAST_FILTERING               0x10           //M
120 #define DISABLE_BROADCAST_FILTERING              0x11           //M
121 #define ENABLE_GLOBAL_MULTICAST_FILTERING        0x12
122 #define DISABLE_GLOBAL_MULTICAST_FILTERING       0x13
123 #define SET_NCSI_FLOW_CONTROL                    0x14
124 #define GET_VERSION_ID                           0x15           //M
125 #define GET_CAPABILITIES                         0x16           //M
126 #define GET_PARAMETERS                           0x17           //M
127 #define GET_CONTROLLER_PACKET_STATISTICS         0x18
128 #define GET_NCSI_STATISTICS                      0x19
129 #define GET_NCSI_PASS_THROUGH_STATISTICS         0x1A
130 
131 //Standard Response Code
132 #define COMMAND_COMPLETED                        0x00
133 #define COMMAND_FAILED                           0x01
134 #define COMMAND_UNAVAILABLE                      0x02
135 #define COMMAND_UNSUPPORTED                      0x03
136 
137 //Standard Reason Code
138 #define NO_ERROR                                 0x0000
139 #define INTERFACE_INITIALIZATION_REQUIRED        0x0001
140 #define PARAMETER_IS_INVALID                     0x0002
141 #define CHANNEL_NOT_READY                        0x0003
142 #define PACKAGE_NOT_READY                        0x0004
143 #define INVALID_PAYLOAD_LENGTH                   0x0005
144 #define UNKNOWN_COMMAND_TYPE                     0x7FFF
145 
146 //SET_MAC_ADDRESS
147 #define UNICAST                                  ( 0x00 << 5 )
148 #define MULTICAST                                ( 0x01 << 5 )
149 #define DISABLE_MAC_ADDRESS_FILTER               0x00
150 #define ENABLE_MAC_ADDRESS_FILTER                0x01
151 
152 //GET_LINK_STATUS
153 #define LINK_DOWN                                0
154 #define LINK_UP                                  1
155 
156 #endif // NCSI_H
157