/******************************************************************************* NAME ibChip.h SUMMARY %description% VERSION %version: 2 % UPDATE DATE %date_modified: Tue Oct 04 13:30:38 2005 % PROGRAMMER %created_by: tsnider % Copyright 2005, Engenio Information Technologies, Inc. DESCRIPTION: This file contains 23108 chip related items and interface prototypes for access routines. *******************************************************************************/ #ifndef __INCibChip #define __INCibChip /* There are seperate registers for each port generally the register offset for port 2 is the offset for port 1 + 0x800 */ #define PORT0_OFFSET 0 #define PORT1_OFFSET 0x800 #define LED_REGISTER_OFFSET 0xf0084 #define VENDOR_ID PCIV_MELLANOX // 0x15b3 #define DEV_ID PCID_INFINIHOST // 0x5a44 #define GPIO_UPPER 0xf0080 #define GPIO_LOWER 0xf0084 #define GPIO_DIRECTION 0xf0088 #define GPIO_POLARITY_UPPER 0xf0090 #define GPIO_POLARITY_LOWER 0xf0094 #define IB_LINK_PHYSICAL_STATE 0x100FC /* Bits [7:0] */ /* Link width i.e. speed information. The registers for link width indicate the current/active width of each link. Please see below. MT23108 LINK_WIDTH Address, Port1 = 0x1001C, 32-bit data field. MT23108 LINK_WIDTH Address, Port2 = 0x1081C, 32-bit data field. Link_width_active => bits [7:0] Link_width_supported => bits [15:8] Link_with_enabled => bits [23:16] Definition ======= LinkWidth-Enabled Enabled link width indicated as follows: 0: No state change (NOP) 1: 1X 2: 4X 3: 1X or 4X 8: 12X 9: 1X or 12X 10: 4X or 12X 11: 1X, 4X or 12X 4 - 7, 12 - 254: Reserved (ignored) 255: Set to LinkWidthSupported value When writing this field, only legal transitions are valid. Initial value is 0. LinkWidthSupported Supported link width indicated as follows: 1: 1X 3: 1X or 4X 11: 1X, 4X or 12X 0, 2, 4 - 10, 12 - 255: Reserved. Initial value is 0. LinkWidthActive Currently active link width indicated as follows: 1: 1X 2: 4X 8: 12X 0, 3, 4 - 7, 9 - 255: Reserved. Initial value is 0 readIbRegs 0x1001C,0x1001c - 7011001c - 02 03 03 00 */ #define LINK_WIDTH_OFFSET 0x1001C /* The available performance counters for Port1 and Port2 is listed below. Offsets Port1 Port2 Valid Bits PortXmitData addr 0x10120 0x10920 32 bits PortRcvData addr 0x10124 0x10924 32 bits PortXmitPkts addr 0x10128 0x10928 32 bits PortRcvPkts addr 0x1012C 0x1092C 32 bits PortRcvErrors addr 0x10130 0x10930 16 bits, lsb PortXmitDiscards addr 0x10134 0x10934 16 bits, lsb VL15DroppedCounter addr 0x10138 0x10938 16 bits, lsb PortXmitWait addr 0x1013C 0x1093C 32 bits LocalIntegrityErrors addr 0x10140 0x10940 8 bits, lsb PortRcvRemotePhysicalErrors addr 0x10144 0x10944 16 bits, lsb PortXmitConstraintErrors addr 0x10148 0x10948 8 bits, lsb PortRcvConstraintErrors addr 0x1014C 0x1094C 8 bits, lsb SymbolErrorCounter addr 0x10150 0x10950 32 bits LinkErrorRecoveryCounter addr 0x10154 0x10954 bits [15:0] LinkDownCounter addr 0x10154 0x10954 bits [31:16] ExcessiveBufferOverrunErrors addr 0x10164 0x10964 bits [7:0] LocalLinkIntegrityErrors addr 0x10164 0x10964 bits [15:8] */ #define PORT_XMIT_DATA 0x10120 #define PORT_RCV_DATA 0x10124 #define PORT_XMIT_PKTS 0x10128 #define PORT_RCV_PKTS 0x1012C #define PORT_RCV_ERRORS 0x10130 #define PORT_XMIT_DISCARDS 0x10134 #define VL15_DROPPED_COUNTER 0x10138 #define PORT_XMIT_WAIT 0x1013C #define LOCAL_INTEGRITY_ERRORS 0x10140 #define PORT_RCV_REMOTE_PHYSICAL_ERRORS 0x10144 #define PORT_XMIT_CONSTRAINT_ERRORS 0x10148 #define PORT_RCV_CONSTRAINT_ERRORS 0x1014C #define SYMBOL_ERROR_COUNTER 0x10150 #define LINK_ERROR_RECOVERY_COUNTER 0x10154 #define LINK_DOWN_COUNTER 0x10154 #define EXCESSIVE_BUFFER_OVERRUN_ERRORS 0x10164 #define LOCAL_LINK_INTEGRITY_ERRORS 0x10164 typedef struct ib_chip_counters { ULONG portXmitData; /* 32 bits */ ULONG portRcvData; /* 32 bits */ ULONG portXmitPkts; /* 32 bits */ ULONG portRcvPkts; /* 32 bits */ USHORT portRcvErrors; /* 16 bits, lsb */ USHORT portXmitDiscards; /* 16 bits, lsb */ USHORT vL15DroppedCounter; /* 16 bits, lsb */ ULONG portXmitWait; /* 32 bits */ BYTE localIntegrityErrors; /* 8 bits, lsb */ USHORT portRcvRemotePhysicalErrors; /* 16 bits, lsb */ BYTE portXmitConstraintErrors; /* 8 bits, lsb */ BYTE portRcvConstraintErrors; /* 8 bits, lsb */ ULONG symbolErrorCounter; /* 32 bits */ USHORT linkErrorRecoveryCounter; /* bits [15:0] */ USHORT linkDownCounter; /* bits [31:16] */ BYTE excessiveBufferOverrunErrors; /* bits [7:0] */ USHORT localLinkIntegrityErrors; /* bits [15:8] */ } IB_CHIP_COUNTERS; typedef struct ibLinkSpeed { ULONG activeLinkWidth; ULONG supportedLinkWidth; ULONG enabledLinkWidth; } IB_LINK_SPEED; #endif /* End of __INCibChip */