netxen_nic_phan_reg.h 7.3 KB
Newer Older
A
Amit S. Kale 已提交
1
/*
D
Dhananjay Phadke 已提交
2
 * Copyright (C) 2003 - 2009 NetXen, Inc.
A
Amit S. Kale 已提交
3
 * All rights reserved.
4
 *
A
Amit S. Kale 已提交
5 6 7 8
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
9
 *
A
Amit S. Kale 已提交
10 11 12 13
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
14
 *
A
Amit S. Kale 已提交
15 16 17 18
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA  02111-1307, USA.
19
 *
A
Amit S. Kale 已提交
20 21
 * The full GNU General Public License is included in this distribution
 * in the file called LICENSE.
22
 *
A
Amit S. Kale 已提交
23 24
 * Contact Information:
 *    info@netxen.com
D
Dhananjay Phadke 已提交
25 26 27 28
 * NetXen Inc,
 * 18922 Forge Drive
 * Cupertino, CA 95014-0701
 *
A
Amit S. Kale 已提交
29 30 31 32 33
 */

#ifndef __NIC_PHAN_REG_H_
#define __NIC_PHAN_REG_H_

34
/*
A
Amit S. Kale 已提交
35 36
 * CRB Registers or queue message done only at initialization time.
 */
37 38
#define NIC_CRB_BASE               NETXEN_CAM_RAM(0x200)
#define NETXEN_NIC_REG(X)             (NIC_CRB_BASE+(X))
A
Amit S. Kale 已提交
39

40 41 42 43
#define CRB_PHAN_CNTRL_LO_OFFSET    NETXEN_NIC_REG(0x00)
#define CRB_PHAN_CNTRL_HI_OFFSET    NETXEN_NIC_REG(0x04)
#define CRB_CMD_PRODUCER_OFFSET     NETXEN_NIC_REG(0x08)
#define CRB_CMD_CONSUMER_OFFSET     NETXEN_NIC_REG(0x0c)
D
Dhananjay Phadke 已提交
44
#define CRB_PAUSE_ADDR_LO           NETXEN_NIC_REG(0x10)
45
#define CRB_PAUSE_ADDR_HI           NETXEN_NIC_REG(0x14)
46 47 48 49 50
#define NX_CDRP_CRB_OFFSET          NETXEN_NIC_REG(0x18)
#define NX_ARG1_CRB_OFFSET          NETXEN_NIC_REG(0x1c)
#define NX_ARG2_CRB_OFFSET          NETXEN_NIC_REG(0x20)
#define NX_ARG3_CRB_OFFSET          NETXEN_NIC_REG(0x24)
#define NX_SIGN_CRB_OFFSET          NETXEN_NIC_REG(0x28)
D
Dhananjay Phadke 已提交
51
#define CRB_CMD_INTR_LOOP           NETXEN_NIC_REG(0x20)
52 53 54
#define CRB_CMD_DMA_LOOP            NETXEN_NIC_REG(0x24)
#define CRB_RCV_INTR_LOOP           NETXEN_NIC_REG(0x28)
#define CRB_RCV_DMA_LOOP            NETXEN_NIC_REG(0x2c)
D
Dhananjay Phadke 已提交
55
#define CRB_ENABLE_TX_INTR          NETXEN_NIC_REG(0x30)
56 57 58 59 60 61 62 63 64 65 66 67
#define CRB_MMAP_ADDR_3             NETXEN_NIC_REG(0x34)
#define CRB_CMDPEG_CMDRING          NETXEN_NIC_REG(0x38)
#define CRB_HOST_DUMMY_BUF_ADDR_HI  NETXEN_NIC_REG(0x3c)
#define CRB_HOST_DUMMY_BUF_ADDR_LO  NETXEN_NIC_REG(0x40)
#define CRB_MMAP_ADDR_0             NETXEN_NIC_REG(0x44)
#define CRB_MMAP_ADDR_1             NETXEN_NIC_REG(0x48)
#define CRB_MMAP_ADDR_2             NETXEN_NIC_REG(0x4c)
#define CRB_CMDPEG_STATE            NETXEN_NIC_REG(0x50)
#define CRB_MMAP_SIZE_0             NETXEN_NIC_REG(0x54)
#define CRB_MMAP_SIZE_1             NETXEN_NIC_REG(0x58)
#define CRB_MMAP_SIZE_2             NETXEN_NIC_REG(0x5c)
#define CRB_MMAP_SIZE_3             NETXEN_NIC_REG(0x60)
D
Dhananjay Phadke 已提交
68
#define CRB_GLOBAL_INT_COAL         NETXEN_NIC_REG(0x64)
69 70 71 72 73 74 75 76 77 78 79
#define CRB_INT_COAL_MODE           NETXEN_NIC_REG(0x68)
#define CRB_MAX_RCV_BUFS            NETXEN_NIC_REG(0x6c)
#define CRB_TX_INT_THRESHOLD        NETXEN_NIC_REG(0x70)
#define CRB_RX_PKT_TIMER            NETXEN_NIC_REG(0x74)
#define CRB_TX_PKT_TIMER            NETXEN_NIC_REG(0x78)
#define CRB_RX_PKT_CNT              NETXEN_NIC_REG(0x7c)
#define CRB_RX_TMR_CNT              NETXEN_NIC_REG(0x80)
#define CRB_RX_LRO_TIMER            NETXEN_NIC_REG(0x84)
#define CRB_RX_LRO_MID_TIMER        NETXEN_NIC_REG(0x88)
#define CRB_DMA_MAX_RCV_BUFS        NETXEN_NIC_REG(0x8c)
#define CRB_MAX_DMA_ENTRIES         NETXEN_NIC_REG(0x90)
80 81
#define CRB_XG_STATE                NETXEN_NIC_REG(0x94) /* XG Link status */
#define CRB_XG_STATE_P3             NETXEN_NIC_REG(0x98) /* XG PF Link status */
82 83 84 85
#define CRB_AGENT_TX_SIZE           NETXEN_NIC_REG(0x9c)
#define CRB_AGENT_TX_TYPE           NETXEN_NIC_REG(0xa0)
#define CRB_AGENT_TX_ADDR           NETXEN_NIC_REG(0xa4)
#define CRB_AGENT_TX_MSS            NETXEN_NIC_REG(0xa8)
D
Dhananjay Phadke 已提交
86
#define CRB_TX_STATE                NETXEN_NIC_REG(0xac)
87 88 89
#define CRB_TX_COUNT                NETXEN_NIC_REG(0xb0)
#define CRB_RX_STATE                NETXEN_NIC_REG(0xb4)
#define CRB_RX_PERF_DEBUG_1         NETXEN_NIC_REG(0xb8)
D
Dhananjay Phadke 已提交
90
#define CRB_RX_LRO_CONTROL          NETXEN_NIC_REG(0xbc)
91
#define CRB_RX_LRO_START_NUM        NETXEN_NIC_REG(0xc0)
D
Dhananjay Phadke 已提交
92
#define CRB_MPORT_MODE              NETXEN_NIC_REG(0xc4)
93
#define CRB_CMD_RING_SIZE           NETXEN_NIC_REG(0xc8)
94
#define CRB_DMA_SHIFT               NETXEN_NIC_REG(0xcc)
95 96 97 98 99
#define CRB_INT_VECTOR              NETXEN_NIC_REG(0xd4)
#define CRB_CTX_RESET               NETXEN_NIC_REG(0xd8)
#define CRB_HOST_STS_PROD           NETXEN_NIC_REG(0xdc)
#define CRB_HOST_STS_CONS           NETXEN_NIC_REG(0xe0)
#define CRB_PEG_CMD_PROD            NETXEN_NIC_REG(0xe4)
100 101
#define CRB_PF_LINK_SPEED_1         NETXEN_NIC_REG(0xe8)
#define CRB_PF_LINK_SPEED_2         NETXEN_NIC_REG(0xec)
102 103 104
#define CRB_HOST_BUFFER_CONS        NETXEN_NIC_REG(0xf0)
#define CRB_JUMBO_BUFFER_PROD       NETXEN_NIC_REG(0xf4)
#define CRB_JUMBO_BUFFER_CONS       NETXEN_NIC_REG(0xf8)
105
#define CRB_HOST_DUMMY_BUF          NETXEN_NIC_REG(0xfc)
A
Amit S. Kale 已提交
106

107
#define CRB_RCVPEG_STATE            NETXEN_NIC_REG(0x13c)
108 109
#define CRB_CMD_PRODUCER_OFFSET_1   NETXEN_NIC_REG(0x1ac)
#define CRB_CMD_CONSUMER_OFFSET_1   NETXEN_NIC_REG(0x1b0)
110 111 112 113
#define CRB_CMD_PRODUCER_OFFSET_2   NETXEN_NIC_REG(0x1b8)
#define CRB_CMD_CONSUMER_OFFSET_2   NETXEN_NIC_REG(0x1bc)
#define CRB_CMD_PRODUCER_OFFSET_3   NETXEN_NIC_REG(0x1d0)
#define CRB_CMD_CONSUMER_OFFSET_3   NETXEN_NIC_REG(0x1d4)
114
#define CRB_TEMP_STATE              NETXEN_NIC_REG(0x1b4)
A
Amit S. Kale 已提交
115

116 117 118 119 120
#define CRB_V2P_0		    NETXEN_NIC_REG(0x290)
#define CRB_V2P_1		    NETXEN_NIC_REG(0x294)
#define CRB_V2P_2		    NETXEN_NIC_REG(0x298)
#define CRB_V2P_3		    NETXEN_NIC_REG(0x29c)
#define CRB_V2P(port)		    (CRB_V2P_0+((port)*4))
D
Dhananjay Phadke 已提交
121
#define CRB_DRIVER_VERSION	   NETXEN_NIC_REG(0x2a0)
122 123 124 125 126
#define CRB_SW_INT_MASK_0	   NETXEN_NIC_REG(0x1d8)
#define CRB_SW_INT_MASK_1	   NETXEN_NIC_REG(0x1e0)
#define CRB_SW_INT_MASK_2	   NETXEN_NIC_REG(0x1e4)
#define CRB_SW_INT_MASK_3	   NETXEN_NIC_REG(0x1e8)

D
Dhananjay Phadke 已提交
127 128
#define CRB_MAC_BLOCK_START        NETXEN_CAM_RAM(0x1c0)

129 130 131 132 133 134
/*
 * capabilities register, can be used to selectively enable/disable features
 * for backward compability
 */
#define CRB_NIC_CAPABILITIES_HOST	NETXEN_NIC_REG(0x1a8)
#define CRB_NIC_CAPABILITIES_FW	  	NETXEN_NIC_REG(0x1dc)
D
Dhananjay Phadke 已提交
135
#define CRB_NIC_MSI_MODE_HOST		NETXEN_NIC_REG(0x270)
D
Dhananjay Phadke 已提交
136
#define CRB_NIC_MSI_MODE_FW	  	NETXEN_NIC_REG(0x274)
137 138

#define INTR_SCHEME_PERPORT	      	0x1
D
Dhananjay Phadke 已提交
139
#define MSI_MODE_MULTIFUNC	      	0x1
140

141 142 143
/* used for ethtool tests */
#define CRB_SCRATCHPAD_TEST	    NETXEN_NIC_REG(0x280)

A
Amit S. Kale 已提交
144 145 146 147 148 149 150 151
/*
 * CrbPortPhanCntrHi/Lo is used to pass the address of HostPhantomIndex address
 * which can be read by the Phantom host to get producer/consumer indexes from
 * Phantom/Casper. If it is not HOST_SHARED_MEMORY, then the following
 * registers will be used for the addresses of the ring's shared memory
 * on the Phantom.
 */

152 153 154
#define nx_get_temp_val(x)		((x) >> 16)
#define nx_get_temp_state(x)		((x) & 0xffff)
#define nx_encode_temp(val, state)	(((val) << 16) | (state))
A
Amit S. Kale 已提交
155 156

/*
157
 * CRB registers used by the receive peg logic.
A
Amit S. Kale 已提交
158 159 160
 */

struct netxen_recv_crb {
161 162
	u32 crb_rcv_producer[NUM_RCV_DESC_RINGS];
	u32 crb_sts_consumer;
A
Amit S. Kale 已提交
163 164
};

165 166 167 168 169 170 171 172 173
/*
 * Temperature control.
 */
enum {
	NX_TEMP_NORMAL = 0x1,	/* Normal operating range */
	NX_TEMP_WARN,		/* Sound alert, temperature getting high */
	NX_TEMP_PANIC		/* Fatal error, hardware has shut down. */
};

A
Amit S. Kale 已提交
174
#endif				/* __NIC_PHAN_REG_H_ */