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