.. | .. |
---|
1 | 1 | #ifndef _CHIP_H |
---|
2 | 2 | #define _CHIP_H |
---|
3 | 3 | /* |
---|
4 | | - * Copyright(c) 2015 - 2017 Intel Corporation. |
---|
| 4 | + * Copyright(c) 2015 - 2020 Intel Corporation. |
---|
5 | 5 | * |
---|
6 | 6 | * This file is provided under a dual BSD/GPLv2 license. When using or |
---|
7 | 7 | * redistributing this file, you may do so under either license. |
---|
.. | .. |
---|
52 | 52 | */ |
---|
53 | 53 | |
---|
54 | 54 | /* sizes */ |
---|
55 | | -#define CCE_NUM_MSIX_VECTORS 256 |
---|
56 | | -#define CCE_NUM_INT_CSRS 12 |
---|
57 | | -#define CCE_NUM_INT_MAP_CSRS 96 |
---|
| 55 | +#define BITS_PER_REGISTER (BITS_PER_BYTE * sizeof(u64)) |
---|
58 | 56 | #define NUM_INTERRUPT_SOURCES 768 |
---|
59 | 57 | #define RXE_NUM_CONTEXTS 160 |
---|
60 | 58 | #define RXE_PER_CONTEXT_SIZE 0x1000 /* 4k */ |
---|
.. | .. |
---|
161 | 159 | (CR_CREDIT_RETURN_DUE_TO_FORCE_MASK << \ |
---|
162 | 160 | CR_CREDIT_RETURN_DUE_TO_FORCE_SHIFT) |
---|
163 | 161 | |
---|
164 | | -/* interrupt source numbers */ |
---|
165 | | -#define IS_GENERAL_ERR_START 0 |
---|
166 | | -#define IS_SDMAENG_ERR_START 16 |
---|
167 | | -#define IS_SENDCTXT_ERR_START 32 |
---|
168 | | -#define IS_SDMA_START 192 /* includes SDmaProgress,SDmaIdle */ |
---|
| 162 | +/* Specific IRQ sources */ |
---|
| 163 | +#define CCE_ERR_INT 0 |
---|
| 164 | +#define RXE_ERR_INT 1 |
---|
| 165 | +#define MISC_ERR_INT 2 |
---|
| 166 | +#define PIO_ERR_INT 4 |
---|
| 167 | +#define SDMA_ERR_INT 5 |
---|
| 168 | +#define EGRESS_ERR_INT 6 |
---|
| 169 | +#define TXE_ERR_INT 7 |
---|
| 170 | +#define PBC_INT 240 |
---|
| 171 | +#define GPIO_ASSERT_INT 241 |
---|
| 172 | +#define QSFP1_INT 242 |
---|
| 173 | +#define QSFP2_INT 243 |
---|
| 174 | +#define TCRIT_INT 244 |
---|
| 175 | + |
---|
| 176 | +/* interrupt source ranges */ |
---|
| 177 | +#define IS_FIRST_SOURCE CCE_ERR_INT |
---|
| 178 | +#define IS_GENERAL_ERR_START 0 |
---|
| 179 | +#define IS_SDMAENG_ERR_START 16 |
---|
| 180 | +#define IS_SENDCTXT_ERR_START 32 |
---|
| 181 | +#define IS_SDMA_START 192 |
---|
| 182 | +#define IS_SDMA_PROGRESS_START 208 |
---|
| 183 | +#define IS_SDMA_IDLE_START 224 |
---|
169 | 184 | #define IS_VARIOUS_START 240 |
---|
170 | 185 | #define IS_DC_START 248 |
---|
171 | 186 | #define IS_RCVAVAIL_START 256 |
---|
172 | 187 | #define IS_RCVURGENT_START 416 |
---|
173 | 188 | #define IS_SENDCREDIT_START 576 |
---|
174 | 189 | #define IS_RESERVED_START 736 |
---|
175 | | -#define IS_MAX_SOURCES 768 |
---|
| 190 | +#define IS_LAST_SOURCE 767 |
---|
176 | 191 | |
---|
177 | 192 | /* derived interrupt source values */ |
---|
178 | | -#define IS_GENERAL_ERR_END IS_SDMAENG_ERR_START |
---|
179 | | -#define IS_SDMAENG_ERR_END IS_SENDCTXT_ERR_START |
---|
180 | | -#define IS_SENDCTXT_ERR_END IS_SDMA_START |
---|
181 | | -#define IS_SDMA_END IS_VARIOUS_START |
---|
182 | | -#define IS_VARIOUS_END IS_DC_START |
---|
183 | | -#define IS_DC_END IS_RCVAVAIL_START |
---|
184 | | -#define IS_RCVAVAIL_END IS_RCVURGENT_START |
---|
185 | | -#define IS_RCVURGENT_END IS_SENDCREDIT_START |
---|
186 | | -#define IS_SENDCREDIT_END IS_RESERVED_START |
---|
187 | | -#define IS_RESERVED_END IS_MAX_SOURCES |
---|
188 | | - |
---|
189 | | -/* absolute interrupt numbers for QSFP1Int and QSFP2Int */ |
---|
190 | | -#define QSFP1_INT 242 |
---|
191 | | -#define QSFP2_INT 243 |
---|
| 193 | +#define IS_GENERAL_ERR_END 7 |
---|
| 194 | +#define IS_SDMAENG_ERR_END 31 |
---|
| 195 | +#define IS_SENDCTXT_ERR_END 191 |
---|
| 196 | +#define IS_SDMA_END 207 |
---|
| 197 | +#define IS_SDMA_PROGRESS_END 223 |
---|
| 198 | +#define IS_SDMA_IDLE_END 239 |
---|
| 199 | +#define IS_VARIOUS_END 244 |
---|
| 200 | +#define IS_DC_END 255 |
---|
| 201 | +#define IS_RCVAVAIL_END 415 |
---|
| 202 | +#define IS_RCVURGENT_END 575 |
---|
| 203 | +#define IS_SENDCREDIT_END 735 |
---|
| 204 | +#define IS_RESERVED_END IS_LAST_SOURCE |
---|
192 | 205 | |
---|
193 | 206 | /* DCC_CFG_PORT_CONFIG logical link states */ |
---|
194 | 207 | #define LSTATE_DOWN 0x1 |
---|
.. | .. |
---|
345 | 358 | #define MAX_EAGER_BUFFER (256 * 1024) |
---|
346 | 359 | #define MAX_EAGER_BUFFER_TOTAL (64 * (1 << 20)) /* max per ctxt 64MB */ |
---|
347 | 360 | #define MAX_EXPECTED_BUFFER (2048 * 1024) |
---|
| 361 | +#define HFI1_MIN_HDRQ_EGRBUF_CNT 32 |
---|
| 362 | +#define HFI1_MAX_HDRQ_EGRBUF_CNT 16352 |
---|
348 | 363 | |
---|
349 | 364 | /* |
---|
350 | 365 | * Receive expected base and count and eager base and count increment - |
---|
.. | .. |
---|
686 | 701 | return read_csr(dd, RCV_ARRAY_CNT); |
---|
687 | 702 | } |
---|
688 | 703 | |
---|
| 704 | +u8 encode_rcv_header_entry_size(u8 size); |
---|
| 705 | +int hfi1_validate_rcvhdrcnt(struct hfi1_devdata *dd, uint thecnt); |
---|
| 706 | +void set_hdrq_regs(struct hfi1_devdata *dd, u8 ctxt, u8 entsize, u16 hdrcnt); |
---|
| 707 | + |
---|
689 | 708 | u64 create_pbc(struct hfi1_pportdata *ppd, u64 flags, int srate_mbs, u32 vl, |
---|
690 | 709 | u32 dw_len); |
---|
691 | 710 | |
---|
.. | .. |
---|
791 | 810 | u32 hdrqempty(struct hfi1_ctxtdata *rcd); |
---|
792 | 811 | int is_ax(struct hfi1_devdata *dd); |
---|
793 | 812 | int is_bx(struct hfi1_devdata *dd); |
---|
| 813 | +bool is_urg_masked(struct hfi1_ctxtdata *rcd); |
---|
794 | 814 | u32 read_physical_state(struct hfi1_devdata *dd); |
---|
795 | 815 | u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate); |
---|
796 | 816 | const char *opa_lstate_name(u32 lstate); |
---|
.. | .. |
---|
844 | 864 | /* Per device counter indexes */ |
---|
845 | 865 | enum { |
---|
846 | 866 | C_RCV_OVF = 0, |
---|
| 867 | + C_RX_LEN_ERR, |
---|
| 868 | + C_RX_SHORT_ERR, |
---|
| 869 | + C_RX_ICRC_ERR, |
---|
| 870 | + C_RX_EBP, |
---|
847 | 871 | C_RX_TID_FULL, |
---|
848 | 872 | C_RX_TID_INVALID, |
---|
849 | 873 | C_RX_TID_FLGMS, |
---|
.. | .. |
---|
914 | 938 | C_SW_PIO_WAIT, |
---|
915 | 939 | C_SW_PIO_DRAIN, |
---|
916 | 940 | C_SW_KMEM_WAIT, |
---|
| 941 | + C_SW_TID_WAIT, |
---|
917 | 942 | C_SW_SEND_SCHED, |
---|
918 | 943 | C_SDMA_DESC_FETCHED_CNT, |
---|
919 | 944 | C_SDMA_INT_CNT, |
---|
.. | .. |
---|
1228 | 1253 | C_SW_IBP_RDMA_SEQ, |
---|
1229 | 1254 | C_SW_IBP_UNALIGNED, |
---|
1230 | 1255 | C_SW_IBP_SEQ_NAK, |
---|
| 1256 | + C_SW_IBP_RC_CRWAITS, |
---|
1231 | 1257 | C_SW_CPU_RC_ACKS, |
---|
1232 | 1258 | C_SW_CPU_RC_QACKS, |
---|
1233 | 1259 | C_SW_CPU_RC_DELAYED_COMP, |
---|
.. | .. |
---|
1417 | 1443 | void hfi1_init_vnic_rsm(struct hfi1_devdata *dd); |
---|
1418 | 1444 | void hfi1_deinit_vnic_rsm(struct hfi1_devdata *dd); |
---|
1419 | 1445 | |
---|
| 1446 | +irqreturn_t general_interrupt(int irq, void *data); |
---|
| 1447 | +irqreturn_t sdma_interrupt(int irq, void *data); |
---|
| 1448 | +irqreturn_t receive_context_interrupt(int irq, void *data); |
---|
| 1449 | +irqreturn_t receive_context_thread(int irq, void *data); |
---|
| 1450 | +irqreturn_t receive_context_interrupt_napi(int irq, void *data); |
---|
| 1451 | + |
---|
| 1452 | +int set_intr_bits(struct hfi1_devdata *dd, u16 first, u16 last, bool set); |
---|
| 1453 | +void init_qsfp_int(struct hfi1_devdata *dd); |
---|
| 1454 | +void clear_all_interrupts(struct hfi1_devdata *dd); |
---|
| 1455 | +void remap_intr(struct hfi1_devdata *dd, int isrc, int msix_intr); |
---|
| 1456 | +void remap_sdma_interrupts(struct hfi1_devdata *dd, int engine, int msix_intr); |
---|
| 1457 | +void reset_interrupts(struct hfi1_devdata *dd); |
---|
| 1458 | +u8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx); |
---|
| 1459 | +void hfi1_init_aip_rsm(struct hfi1_devdata *dd); |
---|
| 1460 | +void hfi1_deinit_aip_rsm(struct hfi1_devdata *dd); |
---|
| 1461 | + |
---|
1420 | 1462 | /* |
---|
1421 | 1463 | * Interrupt source table. |
---|
1422 | 1464 | * |
---|