162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright(c) 2015 - 2020 Intel Corporation. 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef _CHIP_H 762306a36Sopenharmony_ci#define _CHIP_H 862306a36Sopenharmony_ci/* 962306a36Sopenharmony_ci * This file contains all of the defines that is specific to the HFI chip 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci/* sizes */ 1362306a36Sopenharmony_ci#define BITS_PER_REGISTER (BITS_PER_BYTE * sizeof(u64)) 1462306a36Sopenharmony_ci#define NUM_INTERRUPT_SOURCES 768 1562306a36Sopenharmony_ci#define RXE_NUM_CONTEXTS 160 1662306a36Sopenharmony_ci#define RXE_PER_CONTEXT_SIZE 0x1000 /* 4k */ 1762306a36Sopenharmony_ci#define RXE_NUM_TID_FLOWS 32 1862306a36Sopenharmony_ci#define RXE_NUM_DATA_VL 8 1962306a36Sopenharmony_ci#define TXE_NUM_CONTEXTS 160 2062306a36Sopenharmony_ci#define TXE_NUM_SDMA_ENGINES 16 2162306a36Sopenharmony_ci#define NUM_CONTEXTS_PER_SET 8 2262306a36Sopenharmony_ci#define VL_ARB_HIGH_PRIO_TABLE_SIZE 16 2362306a36Sopenharmony_ci#define VL_ARB_LOW_PRIO_TABLE_SIZE 16 2462306a36Sopenharmony_ci#define VL_ARB_TABLE_SIZE 16 2562306a36Sopenharmony_ci#define TXE_NUM_32_BIT_COUNTER 7 2662306a36Sopenharmony_ci#define TXE_NUM_64_BIT_COUNTER 30 2762306a36Sopenharmony_ci#define TXE_NUM_DATA_VL 8 2862306a36Sopenharmony_ci#define TXE_PIO_SIZE (32 * 0x100000) /* 32 MB */ 2962306a36Sopenharmony_ci#define PIO_BLOCK_SIZE 64 /* bytes */ 3062306a36Sopenharmony_ci#define SDMA_BLOCK_SIZE 64 /* bytes */ 3162306a36Sopenharmony_ci#define RCV_BUF_BLOCK_SIZE 64 /* bytes */ 3262306a36Sopenharmony_ci#define PIO_CMASK 0x7ff /* counter mask for free and fill counters */ 3362306a36Sopenharmony_ci#define MAX_EAGER_ENTRIES 2048 /* max receive eager entries */ 3462306a36Sopenharmony_ci#define MAX_TID_PAIR_ENTRIES 1024 /* max receive expected pairs */ 3562306a36Sopenharmony_ci/* 3662306a36Sopenharmony_ci * Virtual? Allocation Unit, defined as AU = 8*2^vAU, 64 bytes, AU is fixed 3762306a36Sopenharmony_ci * at 64 bytes for all generation one devices 3862306a36Sopenharmony_ci */ 3962306a36Sopenharmony_ci#define CM_VAU 3 4062306a36Sopenharmony_ci/* HFI link credit count, AKA receive buffer depth (RBUF_DEPTH) */ 4162306a36Sopenharmony_ci#define CM_GLOBAL_CREDITS 0x880 4262306a36Sopenharmony_ci/* Number of PKey entries in the HW */ 4362306a36Sopenharmony_ci#define MAX_PKEY_VALUES 16 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci#include "chip_registers.h" 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci#define RXE_PER_CONTEXT_USER (RXE + RXE_PER_CONTEXT_OFFSET) 4862306a36Sopenharmony_ci#define TXE_PIO_SEND (TXE + TXE_PIO_SEND_OFFSET) 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci/* PBC flags */ 5162306a36Sopenharmony_ci#define PBC_INTR BIT_ULL(31) 5262306a36Sopenharmony_ci#define PBC_DC_INFO_SHIFT (30) 5362306a36Sopenharmony_ci#define PBC_DC_INFO BIT_ULL(PBC_DC_INFO_SHIFT) 5462306a36Sopenharmony_ci#define PBC_TEST_EBP BIT_ULL(29) 5562306a36Sopenharmony_ci#define PBC_PACKET_BYPASS BIT_ULL(28) 5662306a36Sopenharmony_ci#define PBC_CREDIT_RETURN BIT_ULL(25) 5762306a36Sopenharmony_ci#define PBC_INSERT_BYPASS_ICRC BIT_ULL(24) 5862306a36Sopenharmony_ci#define PBC_TEST_BAD_ICRC BIT_ULL(23) 5962306a36Sopenharmony_ci#define PBC_FECN BIT_ULL(22) 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci/* PbcInsertHcrc field settings */ 6262306a36Sopenharmony_ci#define PBC_IHCRC_LKDETH 0x0 /* insert @ local KDETH offset */ 6362306a36Sopenharmony_ci#define PBC_IHCRC_GKDETH 0x1 /* insert @ global KDETH offset */ 6462306a36Sopenharmony_ci#define PBC_IHCRC_NONE 0x2 /* no HCRC inserted */ 6562306a36Sopenharmony_ci 6662306a36Sopenharmony_ci/* PBC fields */ 6762306a36Sopenharmony_ci#define PBC_STATIC_RATE_CONTROL_COUNT_SHIFT 32 6862306a36Sopenharmony_ci#define PBC_STATIC_RATE_CONTROL_COUNT_MASK 0xffffull 6962306a36Sopenharmony_ci#define PBC_STATIC_RATE_CONTROL_COUNT_SMASK \ 7062306a36Sopenharmony_ci (PBC_STATIC_RATE_CONTROL_COUNT_MASK << \ 7162306a36Sopenharmony_ci PBC_STATIC_RATE_CONTROL_COUNT_SHIFT) 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci#define PBC_INSERT_HCRC_SHIFT 26 7462306a36Sopenharmony_ci#define PBC_INSERT_HCRC_MASK 0x3ull 7562306a36Sopenharmony_ci#define PBC_INSERT_HCRC_SMASK \ 7662306a36Sopenharmony_ci (PBC_INSERT_HCRC_MASK << PBC_INSERT_HCRC_SHIFT) 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci#define PBC_VL_SHIFT 12 7962306a36Sopenharmony_ci#define PBC_VL_MASK 0xfull 8062306a36Sopenharmony_ci#define PBC_VL_SMASK (PBC_VL_MASK << PBC_VL_SHIFT) 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci#define PBC_LENGTH_DWS_SHIFT 0 8362306a36Sopenharmony_ci#define PBC_LENGTH_DWS_MASK 0xfffull 8462306a36Sopenharmony_ci#define PBC_LENGTH_DWS_SMASK \ 8562306a36Sopenharmony_ci (PBC_LENGTH_DWS_MASK << PBC_LENGTH_DWS_SHIFT) 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci/* Credit Return Fields */ 8862306a36Sopenharmony_ci#define CR_COUNTER_SHIFT 0 8962306a36Sopenharmony_ci#define CR_COUNTER_MASK 0x7ffull 9062306a36Sopenharmony_ci#define CR_COUNTER_SMASK (CR_COUNTER_MASK << CR_COUNTER_SHIFT) 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ci#define CR_STATUS_SHIFT 11 9362306a36Sopenharmony_ci#define CR_STATUS_MASK 0x1ull 9462306a36Sopenharmony_ci#define CR_STATUS_SMASK (CR_STATUS_MASK << CR_STATUS_SHIFT) 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_PBC_SHIFT 12 9762306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_PBC_MASK 0x1ull 9862306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_PBC_SMASK \ 9962306a36Sopenharmony_ci (CR_CREDIT_RETURN_DUE_TO_PBC_MASK << \ 10062306a36Sopenharmony_ci CR_CREDIT_RETURN_DUE_TO_PBC_SHIFT) 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_THRESHOLD_SHIFT 13 10362306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_THRESHOLD_MASK 0x1ull 10462306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_THRESHOLD_SMASK \ 10562306a36Sopenharmony_ci (CR_CREDIT_RETURN_DUE_TO_THRESHOLD_MASK << \ 10662306a36Sopenharmony_ci CR_CREDIT_RETURN_DUE_TO_THRESHOLD_SHIFT) 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_ERR_SHIFT 14 10962306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_ERR_MASK 0x1ull 11062306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_ERR_SMASK \ 11162306a36Sopenharmony_ci (CR_CREDIT_RETURN_DUE_TO_ERR_MASK << \ 11262306a36Sopenharmony_ci CR_CREDIT_RETURN_DUE_TO_ERR_SHIFT) 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_FORCE_SHIFT 15 11562306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_FORCE_MASK 0x1ull 11662306a36Sopenharmony_ci#define CR_CREDIT_RETURN_DUE_TO_FORCE_SMASK \ 11762306a36Sopenharmony_ci (CR_CREDIT_RETURN_DUE_TO_FORCE_MASK << \ 11862306a36Sopenharmony_ci CR_CREDIT_RETURN_DUE_TO_FORCE_SHIFT) 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci/* Specific IRQ sources */ 12162306a36Sopenharmony_ci#define CCE_ERR_INT 0 12262306a36Sopenharmony_ci#define RXE_ERR_INT 1 12362306a36Sopenharmony_ci#define MISC_ERR_INT 2 12462306a36Sopenharmony_ci#define PIO_ERR_INT 4 12562306a36Sopenharmony_ci#define SDMA_ERR_INT 5 12662306a36Sopenharmony_ci#define EGRESS_ERR_INT 6 12762306a36Sopenharmony_ci#define TXE_ERR_INT 7 12862306a36Sopenharmony_ci#define PBC_INT 240 12962306a36Sopenharmony_ci#define GPIO_ASSERT_INT 241 13062306a36Sopenharmony_ci#define QSFP1_INT 242 13162306a36Sopenharmony_ci#define QSFP2_INT 243 13262306a36Sopenharmony_ci#define TCRIT_INT 244 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci/* interrupt source ranges */ 13562306a36Sopenharmony_ci#define IS_FIRST_SOURCE CCE_ERR_INT 13662306a36Sopenharmony_ci#define IS_GENERAL_ERR_START 0 13762306a36Sopenharmony_ci#define IS_SDMAENG_ERR_START 16 13862306a36Sopenharmony_ci#define IS_SENDCTXT_ERR_START 32 13962306a36Sopenharmony_ci#define IS_SDMA_START 192 14062306a36Sopenharmony_ci#define IS_SDMA_PROGRESS_START 208 14162306a36Sopenharmony_ci#define IS_SDMA_IDLE_START 224 14262306a36Sopenharmony_ci#define IS_VARIOUS_START 240 14362306a36Sopenharmony_ci#define IS_DC_START 248 14462306a36Sopenharmony_ci#define IS_RCVAVAIL_START 256 14562306a36Sopenharmony_ci#define IS_RCVURGENT_START 416 14662306a36Sopenharmony_ci#define IS_SENDCREDIT_START 576 14762306a36Sopenharmony_ci#define IS_RESERVED_START 736 14862306a36Sopenharmony_ci#define IS_LAST_SOURCE 767 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci/* derived interrupt source values */ 15162306a36Sopenharmony_ci#define IS_GENERAL_ERR_END 7 15262306a36Sopenharmony_ci#define IS_SDMAENG_ERR_END 31 15362306a36Sopenharmony_ci#define IS_SENDCTXT_ERR_END 191 15462306a36Sopenharmony_ci#define IS_SDMA_END 207 15562306a36Sopenharmony_ci#define IS_SDMA_PROGRESS_END 223 15662306a36Sopenharmony_ci#define IS_SDMA_IDLE_END 239 15762306a36Sopenharmony_ci#define IS_VARIOUS_END 244 15862306a36Sopenharmony_ci#define IS_DC_END 255 15962306a36Sopenharmony_ci#define IS_RCVAVAIL_END 415 16062306a36Sopenharmony_ci#define IS_RCVURGENT_END 575 16162306a36Sopenharmony_ci#define IS_SENDCREDIT_END 735 16262306a36Sopenharmony_ci#define IS_RESERVED_END IS_LAST_SOURCE 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci/* DCC_CFG_PORT_CONFIG logical link states */ 16562306a36Sopenharmony_ci#define LSTATE_DOWN 0x1 16662306a36Sopenharmony_ci#define LSTATE_INIT 0x2 16762306a36Sopenharmony_ci#define LSTATE_ARMED 0x3 16862306a36Sopenharmony_ci#define LSTATE_ACTIVE 0x4 16962306a36Sopenharmony_ci 17062306a36Sopenharmony_ci/* DCC_CFG_RESET reset states */ 17162306a36Sopenharmony_ci#define LCB_RX_FPE_TX_FPE_INTO_RESET (DCC_CFG_RESET_RESET_LCB | \ 17262306a36Sopenharmony_ci DCC_CFG_RESET_RESET_TX_FPE | \ 17362306a36Sopenharmony_ci DCC_CFG_RESET_RESET_RX_FPE | \ 17462306a36Sopenharmony_ci DCC_CFG_RESET_ENABLE_CCLK_BCC) 17562306a36Sopenharmony_ci /* 0x17 */ 17662306a36Sopenharmony_ci 17762306a36Sopenharmony_ci#define LCB_RX_FPE_TX_FPE_OUT_OF_RESET DCC_CFG_RESET_ENABLE_CCLK_BCC /* 0x10 */ 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci/* DC8051_STS_CUR_STATE port values (physical link states) */ 18062306a36Sopenharmony_ci#define PLS_DISABLED 0x30 18162306a36Sopenharmony_ci#define PLS_OFFLINE 0x90 18262306a36Sopenharmony_ci#define PLS_OFFLINE_QUIET 0x90 18362306a36Sopenharmony_ci#define PLS_OFFLINE_PLANNED_DOWN_INFORM 0x91 18462306a36Sopenharmony_ci#define PLS_OFFLINE_READY_TO_QUIET_LT 0x92 18562306a36Sopenharmony_ci#define PLS_OFFLINE_REPORT_FAILURE 0x93 18662306a36Sopenharmony_ci#define PLS_OFFLINE_READY_TO_QUIET_BCC 0x94 18762306a36Sopenharmony_ci#define PLS_OFFLINE_QUIET_DURATION 0x95 18862306a36Sopenharmony_ci#define PLS_POLLING 0x20 18962306a36Sopenharmony_ci#define PLS_POLLING_QUIET 0x20 19062306a36Sopenharmony_ci#define PLS_POLLING_ACTIVE 0x21 19162306a36Sopenharmony_ci#define PLS_CONFIGPHY 0x40 19262306a36Sopenharmony_ci#define PLS_CONFIGPHY_DEBOUCE 0x40 19362306a36Sopenharmony_ci#define PLS_CONFIGPHY_ESTCOMM 0x41 19462306a36Sopenharmony_ci#define PLS_CONFIGPHY_ESTCOMM_TXRX_HUNT 0x42 19562306a36Sopenharmony_ci#define PLS_CONFIGPHY_ESTCOMM_LOCAL_COMPLETE 0x43 19662306a36Sopenharmony_ci#define PLS_CONFIGPHY_OPTEQ 0x44 19762306a36Sopenharmony_ci#define PLS_CONFIGPHY_OPTEQ_OPTIMIZING 0x44 19862306a36Sopenharmony_ci#define PLS_CONFIGPHY_OPTEQ_LOCAL_COMPLETE 0x45 19962306a36Sopenharmony_ci#define PLS_CONFIGPHY_VERIFYCAP 0x46 20062306a36Sopenharmony_ci#define PLS_CONFIGPHY_VERIFYCAP_EXCHANGE 0x46 20162306a36Sopenharmony_ci#define PLS_CONFIGPHY_VERIFYCAP_LOCAL_COMPLETE 0x47 20262306a36Sopenharmony_ci#define PLS_CONFIGLT 0x48 20362306a36Sopenharmony_ci#define PLS_CONFIGLT_CONFIGURE 0x48 20462306a36Sopenharmony_ci#define PLS_CONFIGLT_LINK_TRANSFER_ACTIVE 0x49 20562306a36Sopenharmony_ci#define PLS_LINKUP 0x50 20662306a36Sopenharmony_ci#define PLS_PHYTEST 0xB0 20762306a36Sopenharmony_ci#define PLS_INTERNAL_SERDES_LOOPBACK 0xe1 20862306a36Sopenharmony_ci#define PLS_QUICK_LINKUP 0xe2 20962306a36Sopenharmony_ci 21062306a36Sopenharmony_ci/* DC_DC8051_CFG_HOST_CMD_0.REQ_TYPE - 8051 host commands */ 21162306a36Sopenharmony_ci#define HCMD_LOAD_CONFIG_DATA 0x01 21262306a36Sopenharmony_ci#define HCMD_READ_CONFIG_DATA 0x02 21362306a36Sopenharmony_ci#define HCMD_CHANGE_PHY_STATE 0x03 21462306a36Sopenharmony_ci#define HCMD_SEND_LCB_IDLE_MSG 0x04 21562306a36Sopenharmony_ci#define HCMD_MISC 0x05 21662306a36Sopenharmony_ci#define HCMD_READ_LCB_IDLE_MSG 0x06 21762306a36Sopenharmony_ci#define HCMD_READ_LCB_CSR 0x07 21862306a36Sopenharmony_ci#define HCMD_WRITE_LCB_CSR 0x08 21962306a36Sopenharmony_ci#define HCMD_INTERFACE_TEST 0xff 22062306a36Sopenharmony_ci 22162306a36Sopenharmony_ci/* DC_DC8051_CFG_HOST_CMD_1.RETURN_CODE - 8051 host command return */ 22262306a36Sopenharmony_ci#define HCMD_SUCCESS 2 22362306a36Sopenharmony_ci 22462306a36Sopenharmony_ci/* DC_DC8051_DBG_ERR_INFO_SET_BY_8051.ERROR - error flags */ 22562306a36Sopenharmony_ci#define SPICO_ROM_FAILED BIT(0) 22662306a36Sopenharmony_ci#define UNKNOWN_FRAME BIT(1) 22762306a36Sopenharmony_ci#define TARGET_BER_NOT_MET BIT(2) 22862306a36Sopenharmony_ci#define FAILED_SERDES_INTERNAL_LOOPBACK BIT(3) 22962306a36Sopenharmony_ci#define FAILED_SERDES_INIT BIT(4) 23062306a36Sopenharmony_ci#define FAILED_LNI_POLLING BIT(5) 23162306a36Sopenharmony_ci#define FAILED_LNI_DEBOUNCE BIT(6) 23262306a36Sopenharmony_ci#define FAILED_LNI_ESTBCOMM BIT(7) 23362306a36Sopenharmony_ci#define FAILED_LNI_OPTEQ BIT(8) 23462306a36Sopenharmony_ci#define FAILED_LNI_VERIFY_CAP1 BIT(9) 23562306a36Sopenharmony_ci#define FAILED_LNI_VERIFY_CAP2 BIT(10) 23662306a36Sopenharmony_ci#define FAILED_LNI_CONFIGLT BIT(11) 23762306a36Sopenharmony_ci#define HOST_HANDSHAKE_TIMEOUT BIT(12) 23862306a36Sopenharmony_ci#define EXTERNAL_DEVICE_REQ_TIMEOUT BIT(13) 23962306a36Sopenharmony_ci 24062306a36Sopenharmony_ci#define FAILED_LNI (FAILED_LNI_POLLING | FAILED_LNI_DEBOUNCE \ 24162306a36Sopenharmony_ci | FAILED_LNI_ESTBCOMM | FAILED_LNI_OPTEQ \ 24262306a36Sopenharmony_ci | FAILED_LNI_VERIFY_CAP1 \ 24362306a36Sopenharmony_ci | FAILED_LNI_VERIFY_CAP2 \ 24462306a36Sopenharmony_ci | FAILED_LNI_CONFIGLT | HOST_HANDSHAKE_TIMEOUT \ 24562306a36Sopenharmony_ci | EXTERNAL_DEVICE_REQ_TIMEOUT) 24662306a36Sopenharmony_ci 24762306a36Sopenharmony_ci/* DC_DC8051_DBG_ERR_INFO_SET_BY_8051.HOST_MSG - host message flags */ 24862306a36Sopenharmony_ci#define HOST_REQ_DONE BIT(0) 24962306a36Sopenharmony_ci#define BC_PWR_MGM_MSG BIT(1) 25062306a36Sopenharmony_ci#define BC_SMA_MSG BIT(2) 25162306a36Sopenharmony_ci#define BC_BCC_UNKNOWN_MSG BIT(3) 25262306a36Sopenharmony_ci#define BC_IDLE_UNKNOWN_MSG BIT(4) 25362306a36Sopenharmony_ci#define EXT_DEVICE_CFG_REQ BIT(5) 25462306a36Sopenharmony_ci#define VERIFY_CAP_FRAME BIT(6) 25562306a36Sopenharmony_ci#define LINKUP_ACHIEVED BIT(7) 25662306a36Sopenharmony_ci#define LINK_GOING_DOWN BIT(8) 25762306a36Sopenharmony_ci#define LINK_WIDTH_DOWNGRADED BIT(9) 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_ci/* DC_DC8051_CFG_EXT_DEV_1.REQ_TYPE - 8051 host requests */ 26062306a36Sopenharmony_ci#define HREQ_LOAD_CONFIG 0x01 26162306a36Sopenharmony_ci#define HREQ_SAVE_CONFIG 0x02 26262306a36Sopenharmony_ci#define HREQ_READ_CONFIG 0x03 26362306a36Sopenharmony_ci#define HREQ_SET_TX_EQ_ABS 0x04 26462306a36Sopenharmony_ci#define HREQ_SET_TX_EQ_REL 0x05 26562306a36Sopenharmony_ci#define HREQ_ENABLE 0x06 26662306a36Sopenharmony_ci#define HREQ_LCB_RESET 0x07 26762306a36Sopenharmony_ci#define HREQ_CONFIG_DONE 0xfe 26862306a36Sopenharmony_ci#define HREQ_INTERFACE_TEST 0xff 26962306a36Sopenharmony_ci 27062306a36Sopenharmony_ci/* DC_DC8051_CFG_EXT_DEV_0.RETURN_CODE - 8051 host request return codes */ 27162306a36Sopenharmony_ci#define HREQ_INVALID 0x01 27262306a36Sopenharmony_ci#define HREQ_SUCCESS 0x02 27362306a36Sopenharmony_ci#define HREQ_NOT_SUPPORTED 0x03 27462306a36Sopenharmony_ci#define HREQ_FEATURE_NOT_SUPPORTED 0x04 /* request specific feature */ 27562306a36Sopenharmony_ci#define HREQ_REQUEST_REJECTED 0xfe 27662306a36Sopenharmony_ci#define HREQ_EXECUTION_ONGOING 0xff 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci/* MISC host command functions */ 27962306a36Sopenharmony_ci#define HCMD_MISC_REQUEST_LCB_ACCESS 0x1 28062306a36Sopenharmony_ci#define HCMD_MISC_GRANT_LCB_ACCESS 0x2 28162306a36Sopenharmony_ci 28262306a36Sopenharmony_ci/* idle flit message types */ 28362306a36Sopenharmony_ci#define IDLE_PHYSICAL_LINK_MGMT 0x1 28462306a36Sopenharmony_ci#define IDLE_CRU 0x2 28562306a36Sopenharmony_ci#define IDLE_SMA 0x3 28662306a36Sopenharmony_ci#define IDLE_POWER_MGMT 0x4 28762306a36Sopenharmony_ci 28862306a36Sopenharmony_ci/* idle flit message send fields (both send and read) */ 28962306a36Sopenharmony_ci#define IDLE_PAYLOAD_MASK 0xffffffffffull /* 40 bits */ 29062306a36Sopenharmony_ci#define IDLE_PAYLOAD_SHIFT 8 29162306a36Sopenharmony_ci#define IDLE_MSG_TYPE_MASK 0xf 29262306a36Sopenharmony_ci#define IDLE_MSG_TYPE_SHIFT 0 29362306a36Sopenharmony_ci 29462306a36Sopenharmony_ci/* idle flit message read fields */ 29562306a36Sopenharmony_ci#define READ_IDLE_MSG_TYPE_MASK 0xf 29662306a36Sopenharmony_ci#define READ_IDLE_MSG_TYPE_SHIFT 0 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_ci/* SMA idle flit payload commands */ 29962306a36Sopenharmony_ci#define SMA_IDLE_ARM 1 30062306a36Sopenharmony_ci#define SMA_IDLE_ACTIVE 2 30162306a36Sopenharmony_ci 30262306a36Sopenharmony_ci/* DC_DC8051_CFG_MODE.GENERAL bits */ 30362306a36Sopenharmony_ci#define DISABLE_SELF_GUID_CHECK 0x2 30462306a36Sopenharmony_ci 30562306a36Sopenharmony_ci/* Bad L2 frame error code */ 30662306a36Sopenharmony_ci#define BAD_L2_ERR 0x6 30762306a36Sopenharmony_ci 30862306a36Sopenharmony_ci/* 30962306a36Sopenharmony_ci * Eager buffer minimum and maximum sizes supported by the hardware. 31062306a36Sopenharmony_ci * All power-of-two sizes in between are supported as well. 31162306a36Sopenharmony_ci * MAX_EAGER_BUFFER_TOTAL is the maximum size of memory 31262306a36Sopenharmony_ci * allocatable for Eager buffer to a single context. All others 31362306a36Sopenharmony_ci * are limits for the RcvArray entries. 31462306a36Sopenharmony_ci */ 31562306a36Sopenharmony_ci#define MIN_EAGER_BUFFER (4 * 1024) 31662306a36Sopenharmony_ci#define MAX_EAGER_BUFFER (256 * 1024) 31762306a36Sopenharmony_ci#define MAX_EAGER_BUFFER_TOTAL (64 * (1 << 20)) /* max per ctxt 64MB */ 31862306a36Sopenharmony_ci#define MAX_EXPECTED_BUFFER (2048 * 1024) 31962306a36Sopenharmony_ci#define HFI1_MIN_HDRQ_EGRBUF_CNT 32 32062306a36Sopenharmony_ci#define HFI1_MAX_HDRQ_EGRBUF_CNT 16352 32162306a36Sopenharmony_ci 32262306a36Sopenharmony_ci/* 32362306a36Sopenharmony_ci * Receive expected base and count and eager base and count increment - 32462306a36Sopenharmony_ci * the CSR fields hold multiples of this value. 32562306a36Sopenharmony_ci */ 32662306a36Sopenharmony_ci#define RCV_SHIFT 3 32762306a36Sopenharmony_ci#define RCV_INCREMENT BIT(RCV_SHIFT) 32862306a36Sopenharmony_ci 32962306a36Sopenharmony_ci/* 33062306a36Sopenharmony_ci * Receive header queue entry increment - the CSR holds multiples of 33162306a36Sopenharmony_ci * this value. 33262306a36Sopenharmony_ci */ 33362306a36Sopenharmony_ci#define HDRQ_SIZE_SHIFT 5 33462306a36Sopenharmony_ci#define HDRQ_INCREMENT BIT(HDRQ_SIZE_SHIFT) 33562306a36Sopenharmony_ci 33662306a36Sopenharmony_ci/* 33762306a36Sopenharmony_ci * Freeze handling flags 33862306a36Sopenharmony_ci */ 33962306a36Sopenharmony_ci#define FREEZE_ABORT 0x01 /* do not do recovery */ 34062306a36Sopenharmony_ci#define FREEZE_SELF 0x02 /* initiate the freeze */ 34162306a36Sopenharmony_ci#define FREEZE_LINK_DOWN 0x04 /* link is down */ 34262306a36Sopenharmony_ci 34362306a36Sopenharmony_ci/* 34462306a36Sopenharmony_ci * Chip implementation codes. 34562306a36Sopenharmony_ci */ 34662306a36Sopenharmony_ci#define ICODE_RTL_SILICON 0x00 34762306a36Sopenharmony_ci#define ICODE_RTL_VCS_SIMULATION 0x01 34862306a36Sopenharmony_ci#define ICODE_FPGA_EMULATION 0x02 34962306a36Sopenharmony_ci#define ICODE_FUNCTIONAL_SIMULATOR 0x03 35062306a36Sopenharmony_ci 35162306a36Sopenharmony_ci/* 35262306a36Sopenharmony_ci * 8051 data memory size. 35362306a36Sopenharmony_ci */ 35462306a36Sopenharmony_ci#define DC8051_DATA_MEM_SIZE 0x1000 35562306a36Sopenharmony_ci 35662306a36Sopenharmony_ci/* 35762306a36Sopenharmony_ci * 8051 firmware registers 35862306a36Sopenharmony_ci */ 35962306a36Sopenharmony_ci#define NUM_GENERAL_FIELDS 0x17 36062306a36Sopenharmony_ci#define NUM_LANE_FIELDS 0x8 36162306a36Sopenharmony_ci 36262306a36Sopenharmony_ci/* 8051 general register Field IDs */ 36362306a36Sopenharmony_ci#define LINK_OPTIMIZATION_SETTINGS 0x00 36462306a36Sopenharmony_ci#define LINK_TUNING_PARAMETERS 0x02 36562306a36Sopenharmony_ci#define DC_HOST_COMM_SETTINGS 0x03 36662306a36Sopenharmony_ci#define TX_SETTINGS 0x06 36762306a36Sopenharmony_ci#define VERIFY_CAP_LOCAL_PHY 0x07 36862306a36Sopenharmony_ci#define VERIFY_CAP_LOCAL_FABRIC 0x08 36962306a36Sopenharmony_ci#define VERIFY_CAP_LOCAL_LINK_MODE 0x09 37062306a36Sopenharmony_ci#define LOCAL_DEVICE_ID 0x0a 37162306a36Sopenharmony_ci#define RESERVED_REGISTERS 0x0b 37262306a36Sopenharmony_ci#define LOCAL_LNI_INFO 0x0c 37362306a36Sopenharmony_ci#define REMOTE_LNI_INFO 0x0d 37462306a36Sopenharmony_ci#define MISC_STATUS 0x0e 37562306a36Sopenharmony_ci#define VERIFY_CAP_REMOTE_PHY 0x0f 37662306a36Sopenharmony_ci#define VERIFY_CAP_REMOTE_FABRIC 0x10 37762306a36Sopenharmony_ci#define VERIFY_CAP_REMOTE_LINK_WIDTH 0x11 37862306a36Sopenharmony_ci#define LAST_LOCAL_STATE_COMPLETE 0x12 37962306a36Sopenharmony_ci#define LAST_REMOTE_STATE_COMPLETE 0x13 38062306a36Sopenharmony_ci#define LINK_QUALITY_INFO 0x14 38162306a36Sopenharmony_ci#define REMOTE_DEVICE_ID 0x15 38262306a36Sopenharmony_ci#define LINK_DOWN_REASON 0x16 /* first byte of offset 0x16 */ 38362306a36Sopenharmony_ci#define VERSION_PATCH 0x16 /* last byte of offset 0x16 */ 38462306a36Sopenharmony_ci 38562306a36Sopenharmony_ci/* 8051 lane specific register field IDs */ 38662306a36Sopenharmony_ci#define TX_EQ_SETTINGS 0x00 38762306a36Sopenharmony_ci#define CHANNEL_LOSS_SETTINGS 0x05 38862306a36Sopenharmony_ci 38962306a36Sopenharmony_ci/* Lane ID for general configuration registers */ 39062306a36Sopenharmony_ci#define GENERAL_CONFIG 4 39162306a36Sopenharmony_ci 39262306a36Sopenharmony_ci/* LINK_TUNING_PARAMETERS fields */ 39362306a36Sopenharmony_ci#define TUNING_METHOD_SHIFT 24 39462306a36Sopenharmony_ci 39562306a36Sopenharmony_ci/* LINK_OPTIMIZATION_SETTINGS fields */ 39662306a36Sopenharmony_ci#define ENABLE_EXT_DEV_CONFIG_SHIFT 24 39762306a36Sopenharmony_ci 39862306a36Sopenharmony_ci/* LOAD_DATA 8051 command shifts and fields */ 39962306a36Sopenharmony_ci#define LOAD_DATA_FIELD_ID_SHIFT 40 40062306a36Sopenharmony_ci#define LOAD_DATA_FIELD_ID_MASK 0xfull 40162306a36Sopenharmony_ci#define LOAD_DATA_LANE_ID_SHIFT 32 40262306a36Sopenharmony_ci#define LOAD_DATA_LANE_ID_MASK 0xfull 40362306a36Sopenharmony_ci#define LOAD_DATA_DATA_SHIFT 0x0 40462306a36Sopenharmony_ci#define LOAD_DATA_DATA_MASK 0xffffffffull 40562306a36Sopenharmony_ci 40662306a36Sopenharmony_ci/* READ_DATA 8051 command shifts and fields */ 40762306a36Sopenharmony_ci#define READ_DATA_FIELD_ID_SHIFT 40 40862306a36Sopenharmony_ci#define READ_DATA_FIELD_ID_MASK 0xffull 40962306a36Sopenharmony_ci#define READ_DATA_LANE_ID_SHIFT 32 41062306a36Sopenharmony_ci#define READ_DATA_LANE_ID_MASK 0xffull 41162306a36Sopenharmony_ci#define READ_DATA_DATA_SHIFT 0x0 41262306a36Sopenharmony_ci#define READ_DATA_DATA_MASK 0xffffffffull 41362306a36Sopenharmony_ci 41462306a36Sopenharmony_ci/* TX settings fields */ 41562306a36Sopenharmony_ci#define ENABLE_LANE_TX_SHIFT 0 41662306a36Sopenharmony_ci#define ENABLE_LANE_TX_MASK 0xff 41762306a36Sopenharmony_ci#define TX_POLARITY_INVERSION_SHIFT 8 41862306a36Sopenharmony_ci#define TX_POLARITY_INVERSION_MASK 0xff 41962306a36Sopenharmony_ci#define RX_POLARITY_INVERSION_SHIFT 16 42062306a36Sopenharmony_ci#define RX_POLARITY_INVERSION_MASK 0xff 42162306a36Sopenharmony_ci#define MAX_RATE_SHIFT 24 42262306a36Sopenharmony_ci#define MAX_RATE_MASK 0xff 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ci/* verify capability PHY fields */ 42562306a36Sopenharmony_ci#define CONTINIOUS_REMOTE_UPDATE_SUPPORT_SHIFT 0x4 42662306a36Sopenharmony_ci#define CONTINIOUS_REMOTE_UPDATE_SUPPORT_MASK 0x1 42762306a36Sopenharmony_ci#define POWER_MANAGEMENT_SHIFT 0x0 42862306a36Sopenharmony_ci#define POWER_MANAGEMENT_MASK 0xf 42962306a36Sopenharmony_ci 43062306a36Sopenharmony_ci/* 8051 lane register Field IDs */ 43162306a36Sopenharmony_ci#define SPICO_FW_VERSION 0x7 /* SPICO firmware version */ 43262306a36Sopenharmony_ci 43362306a36Sopenharmony_ci/* SPICO firmware version fields */ 43462306a36Sopenharmony_ci#define SPICO_ROM_VERSION_SHIFT 0 43562306a36Sopenharmony_ci#define SPICO_ROM_VERSION_MASK 0xffff 43662306a36Sopenharmony_ci#define SPICO_ROM_PROD_ID_SHIFT 16 43762306a36Sopenharmony_ci#define SPICO_ROM_PROD_ID_MASK 0xffff 43862306a36Sopenharmony_ci 43962306a36Sopenharmony_ci/* verify capability fabric fields */ 44062306a36Sopenharmony_ci#define VAU_SHIFT 0 44162306a36Sopenharmony_ci#define VAU_MASK 0x0007 44262306a36Sopenharmony_ci#define Z_SHIFT 3 44362306a36Sopenharmony_ci#define Z_MASK 0x0001 44462306a36Sopenharmony_ci#define VCU_SHIFT 4 44562306a36Sopenharmony_ci#define VCU_MASK 0x0007 44662306a36Sopenharmony_ci#define VL15BUF_SHIFT 8 44762306a36Sopenharmony_ci#define VL15BUF_MASK 0x0fff 44862306a36Sopenharmony_ci#define CRC_SIZES_SHIFT 20 44962306a36Sopenharmony_ci#define CRC_SIZES_MASK 0x7 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_ci/* verify capability local link width fields */ 45262306a36Sopenharmony_ci#define LINK_WIDTH_SHIFT 0 /* also for remote link width */ 45362306a36Sopenharmony_ci#define LINK_WIDTH_MASK 0xffff /* also for remote link width */ 45462306a36Sopenharmony_ci#define LOCAL_FLAG_BITS_SHIFT 16 45562306a36Sopenharmony_ci#define LOCAL_FLAG_BITS_MASK 0xff 45662306a36Sopenharmony_ci#define MISC_CONFIG_BITS_SHIFT 24 45762306a36Sopenharmony_ci#define MISC_CONFIG_BITS_MASK 0xff 45862306a36Sopenharmony_ci 45962306a36Sopenharmony_ci/* verify capability remote link width fields */ 46062306a36Sopenharmony_ci#define REMOTE_TX_RATE_SHIFT 16 46162306a36Sopenharmony_ci#define REMOTE_TX_RATE_MASK 0xff 46262306a36Sopenharmony_ci 46362306a36Sopenharmony_ci/* LOCAL_DEVICE_ID fields */ 46462306a36Sopenharmony_ci#define LOCAL_DEVICE_REV_SHIFT 0 46562306a36Sopenharmony_ci#define LOCAL_DEVICE_REV_MASK 0xff 46662306a36Sopenharmony_ci#define LOCAL_DEVICE_ID_SHIFT 8 46762306a36Sopenharmony_ci#define LOCAL_DEVICE_ID_MASK 0xffff 46862306a36Sopenharmony_ci 46962306a36Sopenharmony_ci/* REMOTE_DEVICE_ID fields */ 47062306a36Sopenharmony_ci#define REMOTE_DEVICE_REV_SHIFT 0 47162306a36Sopenharmony_ci#define REMOTE_DEVICE_REV_MASK 0xff 47262306a36Sopenharmony_ci#define REMOTE_DEVICE_ID_SHIFT 8 47362306a36Sopenharmony_ci#define REMOTE_DEVICE_ID_MASK 0xffff 47462306a36Sopenharmony_ci 47562306a36Sopenharmony_ci/* local LNI link width fields */ 47662306a36Sopenharmony_ci#define ENABLE_LANE_RX_SHIFT 16 47762306a36Sopenharmony_ci#define ENABLE_LANE_RX_MASK 0xff 47862306a36Sopenharmony_ci 47962306a36Sopenharmony_ci/* mask, shift for reading 'mgmt_enabled' value from REMOTE_LNI_INFO field */ 48062306a36Sopenharmony_ci#define MGMT_ALLOWED_SHIFT 23 48162306a36Sopenharmony_ci#define MGMT_ALLOWED_MASK 0x1 48262306a36Sopenharmony_ci 48362306a36Sopenharmony_ci/* mask, shift for 'link_quality' within LINK_QUALITY_INFO field */ 48462306a36Sopenharmony_ci#define LINK_QUALITY_SHIFT 24 48562306a36Sopenharmony_ci#define LINK_QUALITY_MASK 0x7 48662306a36Sopenharmony_ci 48762306a36Sopenharmony_ci/* 48862306a36Sopenharmony_ci * mask, shift for reading 'planned_down_remote_reason_code' 48962306a36Sopenharmony_ci * from LINK_QUALITY_INFO field 49062306a36Sopenharmony_ci */ 49162306a36Sopenharmony_ci#define DOWN_REMOTE_REASON_SHIFT 16 49262306a36Sopenharmony_ci#define DOWN_REMOTE_REASON_MASK 0xff 49362306a36Sopenharmony_ci 49462306a36Sopenharmony_ci#define HOST_INTERFACE_VERSION 1 49562306a36Sopenharmony_ci#define HOST_INTERFACE_VERSION_SHIFT 16 49662306a36Sopenharmony_ci#define HOST_INTERFACE_VERSION_MASK 0xff 49762306a36Sopenharmony_ci 49862306a36Sopenharmony_ci/* verify capability PHY power management bits */ 49962306a36Sopenharmony_ci#define PWRM_BER_CONTROL 0x1 50062306a36Sopenharmony_ci#define PWRM_BANDWIDTH_CONTROL 0x2 50162306a36Sopenharmony_ci 50262306a36Sopenharmony_ci/* 8051 link down reasons */ 50362306a36Sopenharmony_ci#define LDR_LINK_TRANSFER_ACTIVE_LOW 0xa 50462306a36Sopenharmony_ci#define LDR_RECEIVED_LINKDOWN_IDLE_MSG 0xb 50562306a36Sopenharmony_ci#define LDR_RECEIVED_HOST_OFFLINE_REQ 0xc 50662306a36Sopenharmony_ci 50762306a36Sopenharmony_ci/* verify capability fabric CRC size bits */ 50862306a36Sopenharmony_cienum { 50962306a36Sopenharmony_ci CAP_CRC_14B = (1 << 0), /* 14b CRC */ 51062306a36Sopenharmony_ci CAP_CRC_48B = (1 << 1), /* 48b CRC */ 51162306a36Sopenharmony_ci CAP_CRC_12B_16B_PER_LANE = (1 << 2) /* 12b-16b per lane CRC */ 51262306a36Sopenharmony_ci}; 51362306a36Sopenharmony_ci 51462306a36Sopenharmony_ci#define SUPPORTED_CRCS (CAP_CRC_14B | CAP_CRC_48B) 51562306a36Sopenharmony_ci 51662306a36Sopenharmony_ci/* misc status version fields */ 51762306a36Sopenharmony_ci#define STS_FM_VERSION_MINOR_SHIFT 16 51862306a36Sopenharmony_ci#define STS_FM_VERSION_MINOR_MASK 0xff 51962306a36Sopenharmony_ci#define STS_FM_VERSION_MAJOR_SHIFT 24 52062306a36Sopenharmony_ci#define STS_FM_VERSION_MAJOR_MASK 0xff 52162306a36Sopenharmony_ci#define STS_FM_VERSION_PATCH_SHIFT 24 52262306a36Sopenharmony_ci#define STS_FM_VERSION_PATCH_MASK 0xff 52362306a36Sopenharmony_ci 52462306a36Sopenharmony_ci/* LCB_CFG_CRC_MODE TX_VAL and RX_VAL CRC mode values */ 52562306a36Sopenharmony_ci#define LCB_CRC_16B 0x0 /* 16b CRC */ 52662306a36Sopenharmony_ci#define LCB_CRC_14B 0x1 /* 14b CRC */ 52762306a36Sopenharmony_ci#define LCB_CRC_48B 0x2 /* 48b CRC */ 52862306a36Sopenharmony_ci#define LCB_CRC_12B_16B_PER_LANE 0x3 /* 12b-16b per lane CRC */ 52962306a36Sopenharmony_ci 53062306a36Sopenharmony_ci/* 53162306a36Sopenharmony_ci * the following enum is (almost) a copy/paste of the definition 53262306a36Sopenharmony_ci * in the OPA spec, section 20.2.2.6.8 (PortInfo) 53362306a36Sopenharmony_ci */ 53462306a36Sopenharmony_cienum { 53562306a36Sopenharmony_ci PORT_LTP_CRC_MODE_NONE = 0, 53662306a36Sopenharmony_ci PORT_LTP_CRC_MODE_14 = 1, /* 14-bit LTP CRC mode (optional) */ 53762306a36Sopenharmony_ci PORT_LTP_CRC_MODE_16 = 2, /* 16-bit LTP CRC mode */ 53862306a36Sopenharmony_ci PORT_LTP_CRC_MODE_48 = 4, 53962306a36Sopenharmony_ci /* 48-bit overlapping LTP CRC mode (optional) */ 54062306a36Sopenharmony_ci PORT_LTP_CRC_MODE_PER_LANE = 8 54162306a36Sopenharmony_ci /* 12 to 16 bit per lane LTP CRC mode (optional) */ 54262306a36Sopenharmony_ci}; 54362306a36Sopenharmony_ci 54462306a36Sopenharmony_ci/* timeouts */ 54562306a36Sopenharmony_ci#define LINK_RESTART_DELAY 1000 /* link restart delay, in ms */ 54662306a36Sopenharmony_ci#define TIMEOUT_8051_START 5000 /* 8051 start timeout, in ms */ 54762306a36Sopenharmony_ci#define DC8051_COMMAND_TIMEOUT 1000 /* DC8051 command timeout, in ms */ 54862306a36Sopenharmony_ci#define FREEZE_STATUS_TIMEOUT 20 /* wait for freeze indicators, in ms */ 54962306a36Sopenharmony_ci#define VL_STATUS_CLEAR_TIMEOUT 5000 /* per-VL status clear, in ms */ 55062306a36Sopenharmony_ci#define CCE_STATUS_TIMEOUT 10 /* time to clear CCE Status, in ms */ 55162306a36Sopenharmony_ci 55262306a36Sopenharmony_ci/* cclock tick time, in picoseconds per tick: 1/speed * 10^12 */ 55362306a36Sopenharmony_ci#define ASIC_CCLOCK_PS 1242 /* 805 MHz */ 55462306a36Sopenharmony_ci#define FPGA_CCLOCK_PS 30300 /* 33 MHz */ 55562306a36Sopenharmony_ci 55662306a36Sopenharmony_ci/* 55762306a36Sopenharmony_ci * Mask of enabled MISC errors. Do not enable the two RSA engine errors - 55862306a36Sopenharmony_ci * see firmware.c:run_rsa() for details. 55962306a36Sopenharmony_ci */ 56062306a36Sopenharmony_ci#define DRIVER_MISC_MASK \ 56162306a36Sopenharmony_ci (~(MISC_ERR_STATUS_MISC_FW_AUTH_FAILED_ERR_SMASK \ 56262306a36Sopenharmony_ci | MISC_ERR_STATUS_MISC_KEY_MISMATCH_ERR_SMASK)) 56362306a36Sopenharmony_ci 56462306a36Sopenharmony_ci/* valid values for the loopback module parameter */ 56562306a36Sopenharmony_ci#define LOOPBACK_NONE 0 /* no loopback - default */ 56662306a36Sopenharmony_ci#define LOOPBACK_SERDES 1 56762306a36Sopenharmony_ci#define LOOPBACK_LCB 2 56862306a36Sopenharmony_ci#define LOOPBACK_CABLE 3 /* external cable */ 56962306a36Sopenharmony_ci 57062306a36Sopenharmony_ci/* set up bits in MISC_CONFIG_BITS */ 57162306a36Sopenharmony_ci#define LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT 0 57262306a36Sopenharmony_ci#define EXT_CFG_LCB_RESET_SUPPORTED_SHIFT 3 57362306a36Sopenharmony_ci 57462306a36Sopenharmony_ci/* read and write hardware registers */ 57562306a36Sopenharmony_ciu64 read_csr(const struct hfi1_devdata *dd, u32 offset); 57662306a36Sopenharmony_civoid write_csr(const struct hfi1_devdata *dd, u32 offset, u64 value); 57762306a36Sopenharmony_ci 57862306a36Sopenharmony_ci/* 57962306a36Sopenharmony_ci * The *_kctxt_* flavor of the CSR read/write functions are for 58062306a36Sopenharmony_ci * per-context or per-SDMA CSRs that are not mappable to user-space. 58162306a36Sopenharmony_ci * Their spacing is not a PAGE_SIZE multiple. 58262306a36Sopenharmony_ci */ 58362306a36Sopenharmony_cistatic inline u64 read_kctxt_csr(const struct hfi1_devdata *dd, int ctxt, 58462306a36Sopenharmony_ci u32 offset0) 58562306a36Sopenharmony_ci{ 58662306a36Sopenharmony_ci /* kernel per-context CSRs are separated by 0x100 */ 58762306a36Sopenharmony_ci return read_csr(dd, offset0 + (0x100 * ctxt)); 58862306a36Sopenharmony_ci} 58962306a36Sopenharmony_ci 59062306a36Sopenharmony_cistatic inline void write_kctxt_csr(struct hfi1_devdata *dd, int ctxt, 59162306a36Sopenharmony_ci u32 offset0, u64 value) 59262306a36Sopenharmony_ci{ 59362306a36Sopenharmony_ci /* kernel per-context CSRs are separated by 0x100 */ 59462306a36Sopenharmony_ci write_csr(dd, offset0 + (0x100 * ctxt), value); 59562306a36Sopenharmony_ci} 59662306a36Sopenharmony_ci 59762306a36Sopenharmony_ciint read_lcb_csr(struct hfi1_devdata *dd, u32 offset, u64 *data); 59862306a36Sopenharmony_ciint write_lcb_csr(struct hfi1_devdata *dd, u32 offset, u64 data); 59962306a36Sopenharmony_ci 60062306a36Sopenharmony_civoid __iomem *get_csr_addr( 60162306a36Sopenharmony_ci const struct hfi1_devdata *dd, 60262306a36Sopenharmony_ci u32 offset); 60362306a36Sopenharmony_ci 60462306a36Sopenharmony_cistatic inline void __iomem *get_kctxt_csr_addr( 60562306a36Sopenharmony_ci const struct hfi1_devdata *dd, 60662306a36Sopenharmony_ci int ctxt, 60762306a36Sopenharmony_ci u32 offset0) 60862306a36Sopenharmony_ci{ 60962306a36Sopenharmony_ci return get_csr_addr(dd, offset0 + (0x100 * ctxt)); 61062306a36Sopenharmony_ci} 61162306a36Sopenharmony_ci 61262306a36Sopenharmony_ci/* 61362306a36Sopenharmony_ci * The *_uctxt_* flavor of the CSR read/write functions are for 61462306a36Sopenharmony_ci * per-context CSRs that are mappable to user space. All these CSRs 61562306a36Sopenharmony_ci * are spaced by a PAGE_SIZE multiple in order to be mappable to 61662306a36Sopenharmony_ci * different processes without exposing other contexts' CSRs 61762306a36Sopenharmony_ci */ 61862306a36Sopenharmony_cistatic inline u64 read_uctxt_csr(const struct hfi1_devdata *dd, int ctxt, 61962306a36Sopenharmony_ci u32 offset0) 62062306a36Sopenharmony_ci{ 62162306a36Sopenharmony_ci /* user per-context CSRs are separated by 0x1000 */ 62262306a36Sopenharmony_ci return read_csr(dd, offset0 + (0x1000 * ctxt)); 62362306a36Sopenharmony_ci} 62462306a36Sopenharmony_ci 62562306a36Sopenharmony_cistatic inline void write_uctxt_csr(struct hfi1_devdata *dd, int ctxt, 62662306a36Sopenharmony_ci u32 offset0, u64 value) 62762306a36Sopenharmony_ci{ 62862306a36Sopenharmony_ci /* user per-context CSRs are separated by 0x1000 */ 62962306a36Sopenharmony_ci write_csr(dd, offset0 + (0x1000 * ctxt), value); 63062306a36Sopenharmony_ci} 63162306a36Sopenharmony_ci 63262306a36Sopenharmony_cistatic inline u32 chip_rcv_contexts(struct hfi1_devdata *dd) 63362306a36Sopenharmony_ci{ 63462306a36Sopenharmony_ci return read_csr(dd, RCV_CONTEXTS); 63562306a36Sopenharmony_ci} 63662306a36Sopenharmony_ci 63762306a36Sopenharmony_cistatic inline u32 chip_send_contexts(struct hfi1_devdata *dd) 63862306a36Sopenharmony_ci{ 63962306a36Sopenharmony_ci return read_csr(dd, SEND_CONTEXTS); 64062306a36Sopenharmony_ci} 64162306a36Sopenharmony_ci 64262306a36Sopenharmony_cistatic inline u32 chip_sdma_engines(struct hfi1_devdata *dd) 64362306a36Sopenharmony_ci{ 64462306a36Sopenharmony_ci return read_csr(dd, SEND_DMA_ENGINES); 64562306a36Sopenharmony_ci} 64662306a36Sopenharmony_ci 64762306a36Sopenharmony_cistatic inline u32 chip_pio_mem_size(struct hfi1_devdata *dd) 64862306a36Sopenharmony_ci{ 64962306a36Sopenharmony_ci return read_csr(dd, SEND_PIO_MEM_SIZE); 65062306a36Sopenharmony_ci} 65162306a36Sopenharmony_ci 65262306a36Sopenharmony_cistatic inline u32 chip_sdma_mem_size(struct hfi1_devdata *dd) 65362306a36Sopenharmony_ci{ 65462306a36Sopenharmony_ci return read_csr(dd, SEND_DMA_MEM_SIZE); 65562306a36Sopenharmony_ci} 65662306a36Sopenharmony_ci 65762306a36Sopenharmony_cistatic inline u32 chip_rcv_array_count(struct hfi1_devdata *dd) 65862306a36Sopenharmony_ci{ 65962306a36Sopenharmony_ci return read_csr(dd, RCV_ARRAY_CNT); 66062306a36Sopenharmony_ci} 66162306a36Sopenharmony_ci 66262306a36Sopenharmony_ciu8 encode_rcv_header_entry_size(u8 size); 66362306a36Sopenharmony_ciint hfi1_validate_rcvhdrcnt(struct hfi1_devdata *dd, uint thecnt); 66462306a36Sopenharmony_civoid set_hdrq_regs(struct hfi1_devdata *dd, u8 ctxt, u8 entsize, u16 hdrcnt); 66562306a36Sopenharmony_ci 66662306a36Sopenharmony_ciu64 create_pbc(struct hfi1_pportdata *ppd, u64 flags, int srate_mbs, u32 vl, 66762306a36Sopenharmony_ci u32 dw_len); 66862306a36Sopenharmony_ci 66962306a36Sopenharmony_ci/* firmware.c */ 67062306a36Sopenharmony_ci#define SBUS_MASTER_BROADCAST 0xfd 67162306a36Sopenharmony_ci#define NUM_PCIE_SERDES 16 /* number of PCIe serdes on the SBus */ 67262306a36Sopenharmony_ciextern const u8 pcie_serdes_broadcast[]; 67362306a36Sopenharmony_ciextern const u8 pcie_pcs_addrs[2][NUM_PCIE_SERDES]; 67462306a36Sopenharmony_ci 67562306a36Sopenharmony_ci/* SBus commands */ 67662306a36Sopenharmony_ci#define RESET_SBUS_RECEIVER 0x20 67762306a36Sopenharmony_ci#define WRITE_SBUS_RECEIVER 0x21 67862306a36Sopenharmony_ci#define READ_SBUS_RECEIVER 0x22 67962306a36Sopenharmony_civoid sbus_request(struct hfi1_devdata *dd, 68062306a36Sopenharmony_ci u8 receiver_addr, u8 data_addr, u8 command, u32 data_in); 68162306a36Sopenharmony_ciint sbus_request_slow(struct hfi1_devdata *dd, 68262306a36Sopenharmony_ci u8 receiver_addr, u8 data_addr, u8 command, u32 data_in); 68362306a36Sopenharmony_civoid set_sbus_fast_mode(struct hfi1_devdata *dd); 68462306a36Sopenharmony_civoid clear_sbus_fast_mode(struct hfi1_devdata *dd); 68562306a36Sopenharmony_ciint hfi1_firmware_init(struct hfi1_devdata *dd); 68662306a36Sopenharmony_ciint load_pcie_firmware(struct hfi1_devdata *dd); 68762306a36Sopenharmony_ciint load_firmware(struct hfi1_devdata *dd); 68862306a36Sopenharmony_civoid dispose_firmware(void); 68962306a36Sopenharmony_ciint acquire_hw_mutex(struct hfi1_devdata *dd); 69062306a36Sopenharmony_civoid release_hw_mutex(struct hfi1_devdata *dd); 69162306a36Sopenharmony_ci 69262306a36Sopenharmony_ci/* 69362306a36Sopenharmony_ci * Bitmask of dynamic access for ASIC block chip resources. Each HFI has its 69462306a36Sopenharmony_ci * own range of bits for the resource so it can clear its own bits on 69562306a36Sopenharmony_ci * starting and exiting. If either HFI has the resource bit set, the 69662306a36Sopenharmony_ci * resource is in use. The separate bit ranges are: 69762306a36Sopenharmony_ci * HFI0 bits 7:0 69862306a36Sopenharmony_ci * HFI1 bits 15:8 69962306a36Sopenharmony_ci */ 70062306a36Sopenharmony_ci#define CR_SBUS 0x01 /* SBUS, THERM, and PCIE registers */ 70162306a36Sopenharmony_ci#define CR_EPROM 0x02 /* EEP, GPIO registers */ 70262306a36Sopenharmony_ci#define CR_I2C1 0x04 /* QSFP1_OE register */ 70362306a36Sopenharmony_ci#define CR_I2C2 0x08 /* QSFP2_OE register */ 70462306a36Sopenharmony_ci#define CR_DYN_SHIFT 8 /* dynamic flag shift */ 70562306a36Sopenharmony_ci#define CR_DYN_MASK ((1ull << CR_DYN_SHIFT) - 1) 70662306a36Sopenharmony_ci 70762306a36Sopenharmony_ci/* 70862306a36Sopenharmony_ci * Bitmask of static ASIC states these are outside of the dynamic ASIC 70962306a36Sopenharmony_ci * block chip resources above. These are to be set once and never cleared. 71062306a36Sopenharmony_ci * Must be holding the SBus dynamic flag when setting. 71162306a36Sopenharmony_ci */ 71262306a36Sopenharmony_ci#define CR_THERM_INIT 0x010000 71362306a36Sopenharmony_ci 71462306a36Sopenharmony_ciint acquire_chip_resource(struct hfi1_devdata *dd, u32 resource, u32 mswait); 71562306a36Sopenharmony_civoid release_chip_resource(struct hfi1_devdata *dd, u32 resource); 71662306a36Sopenharmony_cibool check_chip_resource(struct hfi1_devdata *dd, u32 resource, 71762306a36Sopenharmony_ci const char *func); 71862306a36Sopenharmony_civoid init_chip_resources(struct hfi1_devdata *dd); 71962306a36Sopenharmony_civoid finish_chip_resources(struct hfi1_devdata *dd); 72062306a36Sopenharmony_ci 72162306a36Sopenharmony_ci/* ms wait time for access to an SBus resoure */ 72262306a36Sopenharmony_ci#define SBUS_TIMEOUT 4000 /* long enough for a FW download and SBR */ 72362306a36Sopenharmony_ci 72462306a36Sopenharmony_ci/* ms wait time for a qsfp (i2c) chain to become available */ 72562306a36Sopenharmony_ci#define QSFP_WAIT 20000 /* long enough for FW update to the F4 uc */ 72662306a36Sopenharmony_ci 72762306a36Sopenharmony_civoid fabric_serdes_reset(struct hfi1_devdata *dd); 72862306a36Sopenharmony_ciint read_8051_data(struct hfi1_devdata *dd, u32 addr, u32 len, u64 *result); 72962306a36Sopenharmony_ci 73062306a36Sopenharmony_ci/* chip.c */ 73162306a36Sopenharmony_civoid read_misc_status(struct hfi1_devdata *dd, u8 *ver_major, u8 *ver_minor, 73262306a36Sopenharmony_ci u8 *ver_patch); 73362306a36Sopenharmony_ciint write_host_interface_version(struct hfi1_devdata *dd, u8 version); 73462306a36Sopenharmony_civoid read_guid(struct hfi1_devdata *dd); 73562306a36Sopenharmony_ciint wait_fm_ready(struct hfi1_devdata *dd, u32 mstimeout); 73662306a36Sopenharmony_civoid set_link_down_reason(struct hfi1_pportdata *ppd, u8 lcl_reason, 73762306a36Sopenharmony_ci u8 neigh_reason, u8 rem_reason); 73862306a36Sopenharmony_ciint set_link_state(struct hfi1_pportdata *, u32 state); 73962306a36Sopenharmony_ciint port_ltp_to_cap(int port_ltp); 74062306a36Sopenharmony_civoid handle_verify_cap(struct work_struct *work); 74162306a36Sopenharmony_civoid handle_freeze(struct work_struct *work); 74262306a36Sopenharmony_civoid handle_link_up(struct work_struct *work); 74362306a36Sopenharmony_civoid handle_link_down(struct work_struct *work); 74462306a36Sopenharmony_civoid handle_link_downgrade(struct work_struct *work); 74562306a36Sopenharmony_civoid handle_link_bounce(struct work_struct *work); 74662306a36Sopenharmony_civoid handle_start_link(struct work_struct *work); 74762306a36Sopenharmony_civoid handle_sma_message(struct work_struct *work); 74862306a36Sopenharmony_ciint reset_qsfp(struct hfi1_pportdata *ppd); 74962306a36Sopenharmony_civoid qsfp_event(struct work_struct *work); 75062306a36Sopenharmony_civoid start_freeze_handling(struct hfi1_pportdata *ppd, int flags); 75162306a36Sopenharmony_ciint send_idle_sma(struct hfi1_devdata *dd, u64 message); 75262306a36Sopenharmony_ciint load_8051_config(struct hfi1_devdata *, u8, u8, u32); 75362306a36Sopenharmony_ciint read_8051_config(struct hfi1_devdata *, u8, u8, u32 *); 75462306a36Sopenharmony_ciint start_link(struct hfi1_pportdata *ppd); 75562306a36Sopenharmony_ciint bringup_serdes(struct hfi1_pportdata *ppd); 75662306a36Sopenharmony_civoid set_intr_state(struct hfi1_devdata *dd, u32 enable); 75762306a36Sopenharmony_cibool apply_link_downgrade_policy(struct hfi1_pportdata *ppd, 75862306a36Sopenharmony_ci bool refresh_widths); 75962306a36Sopenharmony_civoid update_usrhead(struct hfi1_ctxtdata *rcd, u32 hd, u32 updegr, u32 egrhd, 76062306a36Sopenharmony_ci u32 intr_adjust, u32 npkts); 76162306a36Sopenharmony_ciint stop_drain_data_vls(struct hfi1_devdata *dd); 76262306a36Sopenharmony_ciint open_fill_data_vls(struct hfi1_devdata *dd); 76362306a36Sopenharmony_ciu32 ns_to_cclock(struct hfi1_devdata *dd, u32 ns); 76462306a36Sopenharmony_ciu32 cclock_to_ns(struct hfi1_devdata *dd, u32 cclock); 76562306a36Sopenharmony_civoid get_linkup_link_widths(struct hfi1_pportdata *ppd); 76662306a36Sopenharmony_civoid read_ltp_rtt(struct hfi1_devdata *dd); 76762306a36Sopenharmony_civoid clear_linkup_counters(struct hfi1_devdata *dd); 76862306a36Sopenharmony_ciu32 hdrqempty(struct hfi1_ctxtdata *rcd); 76962306a36Sopenharmony_ciint is_ax(struct hfi1_devdata *dd); 77062306a36Sopenharmony_ciint is_bx(struct hfi1_devdata *dd); 77162306a36Sopenharmony_cibool is_urg_masked(struct hfi1_ctxtdata *rcd); 77262306a36Sopenharmony_ciu32 read_physical_state(struct hfi1_devdata *dd); 77362306a36Sopenharmony_ciu32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate); 77462306a36Sopenharmony_ciconst char *opa_lstate_name(u32 lstate); 77562306a36Sopenharmony_ciconst char *opa_pstate_name(u32 pstate); 77662306a36Sopenharmony_ciu32 driver_pstate(struct hfi1_pportdata *ppd); 77762306a36Sopenharmony_ciu32 driver_lstate(struct hfi1_pportdata *ppd); 77862306a36Sopenharmony_ci 77962306a36Sopenharmony_ciint acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok); 78062306a36Sopenharmony_ciint release_lcb_access(struct hfi1_devdata *dd, int sleep_ok); 78162306a36Sopenharmony_ci#define LCB_START DC_LCB_CSRS 78262306a36Sopenharmony_ci#define LCB_END DC_8051_CSRS /* next block is 8051 */ 78362306a36Sopenharmony_ciextern uint num_vls; 78462306a36Sopenharmony_ci 78562306a36Sopenharmony_ciextern uint disable_integrity; 78662306a36Sopenharmony_ciu64 read_dev_cntr(struct hfi1_devdata *dd, int index, int vl); 78762306a36Sopenharmony_ciu64 write_dev_cntr(struct hfi1_devdata *dd, int index, int vl, u64 data); 78862306a36Sopenharmony_ciu64 read_port_cntr(struct hfi1_pportdata *ppd, int index, int vl); 78962306a36Sopenharmony_ciu64 write_port_cntr(struct hfi1_pportdata *ppd, int index, int vl, u64 data); 79062306a36Sopenharmony_ciu32 read_logical_state(struct hfi1_devdata *dd); 79162306a36Sopenharmony_civoid force_recv_intr(struct hfi1_ctxtdata *rcd); 79262306a36Sopenharmony_ci 79362306a36Sopenharmony_ci/* Per VL indexes */ 79462306a36Sopenharmony_cienum { 79562306a36Sopenharmony_ci C_VL_0 = 0, 79662306a36Sopenharmony_ci C_VL_1, 79762306a36Sopenharmony_ci C_VL_2, 79862306a36Sopenharmony_ci C_VL_3, 79962306a36Sopenharmony_ci C_VL_4, 80062306a36Sopenharmony_ci C_VL_5, 80162306a36Sopenharmony_ci C_VL_6, 80262306a36Sopenharmony_ci C_VL_7, 80362306a36Sopenharmony_ci C_VL_15, 80462306a36Sopenharmony_ci C_VL_COUNT 80562306a36Sopenharmony_ci}; 80662306a36Sopenharmony_ci 80762306a36Sopenharmony_cistatic inline int vl_from_idx(int idx) 80862306a36Sopenharmony_ci{ 80962306a36Sopenharmony_ci return (idx == C_VL_15 ? 15 : idx); 81062306a36Sopenharmony_ci} 81162306a36Sopenharmony_ci 81262306a36Sopenharmony_cistatic inline int idx_from_vl(int vl) 81362306a36Sopenharmony_ci{ 81462306a36Sopenharmony_ci return (vl == 15 ? C_VL_15 : vl); 81562306a36Sopenharmony_ci} 81662306a36Sopenharmony_ci 81762306a36Sopenharmony_ci/* Per device counter indexes */ 81862306a36Sopenharmony_cienum { 81962306a36Sopenharmony_ci C_RCV_OVF = 0, 82062306a36Sopenharmony_ci C_RX_LEN_ERR, 82162306a36Sopenharmony_ci C_RX_SHORT_ERR, 82262306a36Sopenharmony_ci C_RX_ICRC_ERR, 82362306a36Sopenharmony_ci C_RX_EBP, 82462306a36Sopenharmony_ci C_RX_TID_FULL, 82562306a36Sopenharmony_ci C_RX_TID_INVALID, 82662306a36Sopenharmony_ci C_RX_TID_FLGMS, 82762306a36Sopenharmony_ci C_RX_CTX_EGRS, 82862306a36Sopenharmony_ci C_RCV_TID_FLSMS, 82962306a36Sopenharmony_ci C_CCE_PCI_CR_ST, 83062306a36Sopenharmony_ci C_CCE_PCI_TR_ST, 83162306a36Sopenharmony_ci C_CCE_PIO_WR_ST, 83262306a36Sopenharmony_ci C_CCE_ERR_INT, 83362306a36Sopenharmony_ci C_CCE_SDMA_INT, 83462306a36Sopenharmony_ci C_CCE_MISC_INT, 83562306a36Sopenharmony_ci C_CCE_RCV_AV_INT, 83662306a36Sopenharmony_ci C_CCE_RCV_URG_INT, 83762306a36Sopenharmony_ci C_CCE_SEND_CR_INT, 83862306a36Sopenharmony_ci C_DC_UNC_ERR, 83962306a36Sopenharmony_ci C_DC_RCV_ERR, 84062306a36Sopenharmony_ci C_DC_FM_CFG_ERR, 84162306a36Sopenharmony_ci C_DC_RMT_PHY_ERR, 84262306a36Sopenharmony_ci C_DC_DROPPED_PKT, 84362306a36Sopenharmony_ci C_DC_MC_XMIT_PKTS, 84462306a36Sopenharmony_ci C_DC_MC_RCV_PKTS, 84562306a36Sopenharmony_ci C_DC_XMIT_CERR, 84662306a36Sopenharmony_ci C_DC_RCV_CERR, 84762306a36Sopenharmony_ci C_DC_RCV_FCC, 84862306a36Sopenharmony_ci C_DC_XMIT_FCC, 84962306a36Sopenharmony_ci C_DC_XMIT_FLITS, 85062306a36Sopenharmony_ci C_DC_RCV_FLITS, 85162306a36Sopenharmony_ci C_DC_XMIT_PKTS, 85262306a36Sopenharmony_ci C_DC_RCV_PKTS, 85362306a36Sopenharmony_ci C_DC_RX_FLIT_VL, 85462306a36Sopenharmony_ci C_DC_RX_PKT_VL, 85562306a36Sopenharmony_ci C_DC_RCV_FCN, 85662306a36Sopenharmony_ci C_DC_RCV_FCN_VL, 85762306a36Sopenharmony_ci C_DC_RCV_BCN, 85862306a36Sopenharmony_ci C_DC_RCV_BCN_VL, 85962306a36Sopenharmony_ci C_DC_RCV_BBL, 86062306a36Sopenharmony_ci C_DC_RCV_BBL_VL, 86162306a36Sopenharmony_ci C_DC_MARK_FECN, 86262306a36Sopenharmony_ci C_DC_MARK_FECN_VL, 86362306a36Sopenharmony_ci C_DC_TOTAL_CRC, 86462306a36Sopenharmony_ci C_DC_CRC_LN0, 86562306a36Sopenharmony_ci C_DC_CRC_LN1, 86662306a36Sopenharmony_ci C_DC_CRC_LN2, 86762306a36Sopenharmony_ci C_DC_CRC_LN3, 86862306a36Sopenharmony_ci C_DC_CRC_MULT_LN, 86962306a36Sopenharmony_ci C_DC_TX_REPLAY, 87062306a36Sopenharmony_ci C_DC_RX_REPLAY, 87162306a36Sopenharmony_ci C_DC_SEQ_CRC_CNT, 87262306a36Sopenharmony_ci C_DC_ESC0_ONLY_CNT, 87362306a36Sopenharmony_ci C_DC_ESC0_PLUS1_CNT, 87462306a36Sopenharmony_ci C_DC_ESC0_PLUS2_CNT, 87562306a36Sopenharmony_ci C_DC_REINIT_FROM_PEER_CNT, 87662306a36Sopenharmony_ci C_DC_SBE_CNT, 87762306a36Sopenharmony_ci C_DC_MISC_FLG_CNT, 87862306a36Sopenharmony_ci C_DC_PRF_GOOD_LTP_CNT, 87962306a36Sopenharmony_ci C_DC_PRF_ACCEPTED_LTP_CNT, 88062306a36Sopenharmony_ci C_DC_PRF_RX_FLIT_CNT, 88162306a36Sopenharmony_ci C_DC_PRF_TX_FLIT_CNT, 88262306a36Sopenharmony_ci C_DC_PRF_CLK_CNTR, 88362306a36Sopenharmony_ci C_DC_PG_DBG_FLIT_CRDTS_CNT, 88462306a36Sopenharmony_ci C_DC_PG_STS_PAUSE_COMPLETE_CNT, 88562306a36Sopenharmony_ci C_DC_PG_STS_TX_SBE_CNT, 88662306a36Sopenharmony_ci C_DC_PG_STS_TX_MBE_CNT, 88762306a36Sopenharmony_ci C_SW_CPU_INTR, 88862306a36Sopenharmony_ci C_SW_CPU_RCV_LIM, 88962306a36Sopenharmony_ci C_SW_CTX0_SEQ_DROP, 89062306a36Sopenharmony_ci C_SW_VTX_WAIT, 89162306a36Sopenharmony_ci C_SW_PIO_WAIT, 89262306a36Sopenharmony_ci C_SW_PIO_DRAIN, 89362306a36Sopenharmony_ci C_SW_KMEM_WAIT, 89462306a36Sopenharmony_ci C_SW_TID_WAIT, 89562306a36Sopenharmony_ci C_SW_SEND_SCHED, 89662306a36Sopenharmony_ci C_SDMA_DESC_FETCHED_CNT, 89762306a36Sopenharmony_ci C_SDMA_INT_CNT, 89862306a36Sopenharmony_ci C_SDMA_ERR_CNT, 89962306a36Sopenharmony_ci C_SDMA_IDLE_INT_CNT, 90062306a36Sopenharmony_ci C_SDMA_PROGRESS_INT_CNT, 90162306a36Sopenharmony_ci/* MISC_ERR_STATUS */ 90262306a36Sopenharmony_ci C_MISC_PLL_LOCK_FAIL_ERR, 90362306a36Sopenharmony_ci C_MISC_MBIST_FAIL_ERR, 90462306a36Sopenharmony_ci C_MISC_INVALID_EEP_CMD_ERR, 90562306a36Sopenharmony_ci C_MISC_EFUSE_DONE_PARITY_ERR, 90662306a36Sopenharmony_ci C_MISC_EFUSE_WRITE_ERR, 90762306a36Sopenharmony_ci C_MISC_EFUSE_READ_BAD_ADDR_ERR, 90862306a36Sopenharmony_ci C_MISC_EFUSE_CSR_PARITY_ERR, 90962306a36Sopenharmony_ci C_MISC_FW_AUTH_FAILED_ERR, 91062306a36Sopenharmony_ci C_MISC_KEY_MISMATCH_ERR, 91162306a36Sopenharmony_ci C_MISC_SBUS_WRITE_FAILED_ERR, 91262306a36Sopenharmony_ci C_MISC_CSR_WRITE_BAD_ADDR_ERR, 91362306a36Sopenharmony_ci C_MISC_CSR_READ_BAD_ADDR_ERR, 91462306a36Sopenharmony_ci C_MISC_CSR_PARITY_ERR, 91562306a36Sopenharmony_ci/* CceErrStatus */ 91662306a36Sopenharmony_ci /* 91762306a36Sopenharmony_ci * A special counter that is the aggregate count 91862306a36Sopenharmony_ci * of all the cce_err_status errors. The remainder 91962306a36Sopenharmony_ci * are actual bits in the CceErrStatus register. 92062306a36Sopenharmony_ci */ 92162306a36Sopenharmony_ci C_CCE_ERR_STATUS_AGGREGATED_CNT, 92262306a36Sopenharmony_ci C_CCE_MSIX_CSR_PARITY_ERR, 92362306a36Sopenharmony_ci C_CCE_INT_MAP_UNC_ERR, 92462306a36Sopenharmony_ci C_CCE_INT_MAP_COR_ERR, 92562306a36Sopenharmony_ci C_CCE_MSIX_TABLE_UNC_ERR, 92662306a36Sopenharmony_ci C_CCE_MSIX_TABLE_COR_ERR, 92762306a36Sopenharmony_ci C_CCE_RXDMA_CONV_FIFO_PARITY_ERR, 92862306a36Sopenharmony_ci C_CCE_RCPL_ASYNC_FIFO_PARITY_ERR, 92962306a36Sopenharmony_ci C_CCE_SEG_WRITE_BAD_ADDR_ERR, 93062306a36Sopenharmony_ci C_CCE_SEG_READ_BAD_ADDR_ERR, 93162306a36Sopenharmony_ci C_LA_TRIGGERED, 93262306a36Sopenharmony_ci C_CCE_TRGT_CPL_TIMEOUT_ERR, 93362306a36Sopenharmony_ci C_PCIC_RECEIVE_PARITY_ERR, 93462306a36Sopenharmony_ci C_PCIC_TRANSMIT_BACK_PARITY_ERR, 93562306a36Sopenharmony_ci C_PCIC_TRANSMIT_FRONT_PARITY_ERR, 93662306a36Sopenharmony_ci C_PCIC_CPL_DAT_Q_UNC_ERR, 93762306a36Sopenharmony_ci C_PCIC_CPL_HD_Q_UNC_ERR, 93862306a36Sopenharmony_ci C_PCIC_POST_DAT_Q_UNC_ERR, 93962306a36Sopenharmony_ci C_PCIC_POST_HD_Q_UNC_ERR, 94062306a36Sopenharmony_ci C_PCIC_RETRY_SOT_MEM_UNC_ERR, 94162306a36Sopenharmony_ci C_PCIC_RETRY_MEM_UNC_ERR, 94262306a36Sopenharmony_ci C_PCIC_N_POST_DAT_Q_PARITY_ERR, 94362306a36Sopenharmony_ci C_PCIC_N_POST_H_Q_PARITY_ERR, 94462306a36Sopenharmony_ci C_PCIC_CPL_DAT_Q_COR_ERR, 94562306a36Sopenharmony_ci C_PCIC_CPL_HD_Q_COR_ERR, 94662306a36Sopenharmony_ci C_PCIC_POST_DAT_Q_COR_ERR, 94762306a36Sopenharmony_ci C_PCIC_POST_HD_Q_COR_ERR, 94862306a36Sopenharmony_ci C_PCIC_RETRY_SOT_MEM_COR_ERR, 94962306a36Sopenharmony_ci C_PCIC_RETRY_MEM_COR_ERR, 95062306a36Sopenharmony_ci C_CCE_CLI1_ASYNC_FIFO_DBG_PARITY_ERR, 95162306a36Sopenharmony_ci C_CCE_CLI1_ASYNC_FIFO_RXDMA_PARITY_ERR, 95262306a36Sopenharmony_ci C_CCE_CLI1_ASYNC_FIFO_SDMA_HD_PARITY_ERR, 95362306a36Sopenharmony_ci C_CCE_CLI1_ASYNC_FIFO_PIO_CRDT_PARITY_ERR, 95462306a36Sopenharmony_ci C_CCE_CLI2_ASYNC_FIFO_PARITY_ERR, 95562306a36Sopenharmony_ci C_CCE_CSR_CFG_BUS_PARITY_ERR, 95662306a36Sopenharmony_ci C_CCE_CLI0_ASYNC_FIFO_PARTIY_ERR, 95762306a36Sopenharmony_ci C_CCE_RSPD_DATA_PARITY_ERR, 95862306a36Sopenharmony_ci C_CCE_TRGT_ACCESS_ERR, 95962306a36Sopenharmony_ci C_CCE_TRGT_ASYNC_FIFO_PARITY_ERR, 96062306a36Sopenharmony_ci C_CCE_CSR_WRITE_BAD_ADDR_ERR, 96162306a36Sopenharmony_ci C_CCE_CSR_READ_BAD_ADDR_ERR, 96262306a36Sopenharmony_ci C_CCE_CSR_PARITY_ERR, 96362306a36Sopenharmony_ci/* RcvErrStatus */ 96462306a36Sopenharmony_ci C_RX_CSR_PARITY_ERR, 96562306a36Sopenharmony_ci C_RX_CSR_WRITE_BAD_ADDR_ERR, 96662306a36Sopenharmony_ci C_RX_CSR_READ_BAD_ADDR_ERR, 96762306a36Sopenharmony_ci C_RX_DMA_CSR_UNC_ERR, 96862306a36Sopenharmony_ci C_RX_DMA_DQ_FSM_ENCODING_ERR, 96962306a36Sopenharmony_ci C_RX_DMA_EQ_FSM_ENCODING_ERR, 97062306a36Sopenharmony_ci C_RX_DMA_CSR_PARITY_ERR, 97162306a36Sopenharmony_ci C_RX_RBUF_DATA_COR_ERR, 97262306a36Sopenharmony_ci C_RX_RBUF_DATA_UNC_ERR, 97362306a36Sopenharmony_ci C_RX_DMA_DATA_FIFO_RD_COR_ERR, 97462306a36Sopenharmony_ci C_RX_DMA_DATA_FIFO_RD_UNC_ERR, 97562306a36Sopenharmony_ci C_RX_DMA_HDR_FIFO_RD_COR_ERR, 97662306a36Sopenharmony_ci C_RX_DMA_HDR_FIFO_RD_UNC_ERR, 97762306a36Sopenharmony_ci C_RX_RBUF_DESC_PART2_COR_ERR, 97862306a36Sopenharmony_ci C_RX_RBUF_DESC_PART2_UNC_ERR, 97962306a36Sopenharmony_ci C_RX_RBUF_DESC_PART1_COR_ERR, 98062306a36Sopenharmony_ci C_RX_RBUF_DESC_PART1_UNC_ERR, 98162306a36Sopenharmony_ci C_RX_HQ_INTR_FSM_ERR, 98262306a36Sopenharmony_ci C_RX_HQ_INTR_CSR_PARITY_ERR, 98362306a36Sopenharmony_ci C_RX_LOOKUP_CSR_PARITY_ERR, 98462306a36Sopenharmony_ci C_RX_LOOKUP_RCV_ARRAY_COR_ERR, 98562306a36Sopenharmony_ci C_RX_LOOKUP_RCV_ARRAY_UNC_ERR, 98662306a36Sopenharmony_ci C_RX_LOOKUP_DES_PART2_PARITY_ERR, 98762306a36Sopenharmony_ci C_RX_LOOKUP_DES_PART1_UNC_COR_ERR, 98862306a36Sopenharmony_ci C_RX_LOOKUP_DES_PART1_UNC_ERR, 98962306a36Sopenharmony_ci C_RX_RBUF_NEXT_FREE_BUF_COR_ERR, 99062306a36Sopenharmony_ci C_RX_RBUF_NEXT_FREE_BUF_UNC_ERR, 99162306a36Sopenharmony_ci C_RX_RBUF_FL_INIT_WR_ADDR_PARITY_ERR, 99262306a36Sopenharmony_ci C_RX_RBUF_FL_INITDONE_PARITY_ERR, 99362306a36Sopenharmony_ci C_RX_RBUF_FL_WRITE_ADDR_PARITY_ERR, 99462306a36Sopenharmony_ci C_RX_RBUF_FL_RD_ADDR_PARITY_ERR, 99562306a36Sopenharmony_ci C_RX_RBUF_EMPTY_ERR, 99662306a36Sopenharmony_ci C_RX_RBUF_FULL_ERR, 99762306a36Sopenharmony_ci C_RX_RBUF_BAD_LOOKUP_ERR, 99862306a36Sopenharmony_ci C_RX_RBUF_CTX_ID_PARITY_ERR, 99962306a36Sopenharmony_ci C_RX_RBUF_CSR_QEOPDW_PARITY_ERR, 100062306a36Sopenharmony_ci C_RX_RBUF_CSR_Q_NUM_OF_PKT_PARITY_ERR, 100162306a36Sopenharmony_ci C_RX_RBUF_CSR_Q_T1_PTR_PARITY_ERR, 100262306a36Sopenharmony_ci C_RX_RBUF_CSR_Q_HD_PTR_PARITY_ERR, 100362306a36Sopenharmony_ci C_RX_RBUF_CSR_Q_VLD_BIT_PARITY_ERR, 100462306a36Sopenharmony_ci C_RX_RBUF_CSR_Q_NEXT_BUF_PARITY_ERR, 100562306a36Sopenharmony_ci C_RX_RBUF_CSR_Q_ENT_CNT_PARITY_ERR, 100662306a36Sopenharmony_ci C_RX_RBUF_CSR_Q_HEAD_BUF_NUM_PARITY_ERR, 100762306a36Sopenharmony_ci C_RX_RBUF_BLOCK_LIST_READ_COR_ERR, 100862306a36Sopenharmony_ci C_RX_RBUF_BLOCK_LIST_READ_UNC_ERR, 100962306a36Sopenharmony_ci C_RX_RBUF_LOOKUP_DES_COR_ERR, 101062306a36Sopenharmony_ci C_RX_RBUF_LOOKUP_DES_UNC_ERR, 101162306a36Sopenharmony_ci C_RX_RBUF_LOOKUP_DES_REG_UNC_COR_ERR, 101262306a36Sopenharmony_ci C_RX_RBUF_LOOKUP_DES_REG_UNC_ERR, 101362306a36Sopenharmony_ci C_RX_RBUF_FREE_LIST_COR_ERR, 101462306a36Sopenharmony_ci C_RX_RBUF_FREE_LIST_UNC_ERR, 101562306a36Sopenharmony_ci C_RX_RCV_FSM_ENCODING_ERR, 101662306a36Sopenharmony_ci C_RX_DMA_FLAG_COR_ERR, 101762306a36Sopenharmony_ci C_RX_DMA_FLAG_UNC_ERR, 101862306a36Sopenharmony_ci C_RX_DC_SOP_EOP_PARITY_ERR, 101962306a36Sopenharmony_ci C_RX_RCV_CSR_PARITY_ERR, 102062306a36Sopenharmony_ci C_RX_RCV_QP_MAP_TABLE_COR_ERR, 102162306a36Sopenharmony_ci C_RX_RCV_QP_MAP_TABLE_UNC_ERR, 102262306a36Sopenharmony_ci C_RX_RCV_DATA_COR_ERR, 102362306a36Sopenharmony_ci C_RX_RCV_DATA_UNC_ERR, 102462306a36Sopenharmony_ci C_RX_RCV_HDR_COR_ERR, 102562306a36Sopenharmony_ci C_RX_RCV_HDR_UNC_ERR, 102662306a36Sopenharmony_ci C_RX_DC_INTF_PARITY_ERR, 102762306a36Sopenharmony_ci C_RX_DMA_CSR_COR_ERR, 102862306a36Sopenharmony_ci/* SendPioErrStatus */ 102962306a36Sopenharmony_ci C_PIO_PEC_SOP_HEAD_PARITY_ERR, 103062306a36Sopenharmony_ci C_PIO_PCC_SOP_HEAD_PARITY_ERR, 103162306a36Sopenharmony_ci C_PIO_LAST_RETURNED_CNT_PARITY_ERR, 103262306a36Sopenharmony_ci C_PIO_CURRENT_FREE_CNT_PARITY_ERR, 103362306a36Sopenharmony_ci C_PIO_RSVD_31_ERR, 103462306a36Sopenharmony_ci C_PIO_RSVD_30_ERR, 103562306a36Sopenharmony_ci C_PIO_PPMC_SOP_LEN_ERR, 103662306a36Sopenharmony_ci C_PIO_PPMC_BQC_MEM_PARITY_ERR, 103762306a36Sopenharmony_ci C_PIO_VL_FIFO_PARITY_ERR, 103862306a36Sopenharmony_ci C_PIO_VLF_SOP_PARITY_ERR, 103962306a36Sopenharmony_ci C_PIO_VLF_V1_LEN_PARITY_ERR, 104062306a36Sopenharmony_ci C_PIO_BLOCK_QW_COUNT_PARITY_ERR, 104162306a36Sopenharmony_ci C_PIO_WRITE_QW_VALID_PARITY_ERR, 104262306a36Sopenharmony_ci C_PIO_STATE_MACHINE_ERR, 104362306a36Sopenharmony_ci C_PIO_WRITE_DATA_PARITY_ERR, 104462306a36Sopenharmony_ci C_PIO_HOST_ADDR_MEM_COR_ERR, 104562306a36Sopenharmony_ci C_PIO_HOST_ADDR_MEM_UNC_ERR, 104662306a36Sopenharmony_ci C_PIO_PKT_EVICT_SM_OR_ARM_SM_ERR, 104762306a36Sopenharmony_ci C_PIO_INIT_SM_IN_ERR, 104862306a36Sopenharmony_ci C_PIO_PPMC_PBL_FIFO_ERR, 104962306a36Sopenharmony_ci C_PIO_CREDIT_RET_FIFO_PARITY_ERR, 105062306a36Sopenharmony_ci C_PIO_V1_LEN_MEM_BANK1_COR_ERR, 105162306a36Sopenharmony_ci C_PIO_V1_LEN_MEM_BANK0_COR_ERR, 105262306a36Sopenharmony_ci C_PIO_V1_LEN_MEM_BANK1_UNC_ERR, 105362306a36Sopenharmony_ci C_PIO_V1_LEN_MEM_BANK0_UNC_ERR, 105462306a36Sopenharmony_ci C_PIO_SM_PKT_RESET_PARITY_ERR, 105562306a36Sopenharmony_ci C_PIO_PKT_EVICT_FIFO_PARITY_ERR, 105662306a36Sopenharmony_ci C_PIO_SBRDCTRL_CRREL_FIFO_PARITY_ERR, 105762306a36Sopenharmony_ci C_PIO_SBRDCTL_CRREL_PARITY_ERR, 105862306a36Sopenharmony_ci C_PIO_PEC_FIFO_PARITY_ERR, 105962306a36Sopenharmony_ci C_PIO_PCC_FIFO_PARITY_ERR, 106062306a36Sopenharmony_ci C_PIO_SB_MEM_FIFO1_ERR, 106162306a36Sopenharmony_ci C_PIO_SB_MEM_FIFO0_ERR, 106262306a36Sopenharmony_ci C_PIO_CSR_PARITY_ERR, 106362306a36Sopenharmony_ci C_PIO_WRITE_ADDR_PARITY_ERR, 106462306a36Sopenharmony_ci C_PIO_WRITE_BAD_CTXT_ERR, 106562306a36Sopenharmony_ci/* SendDmaErrStatus */ 106662306a36Sopenharmony_ci C_SDMA_PCIE_REQ_TRACKING_COR_ERR, 106762306a36Sopenharmony_ci C_SDMA_PCIE_REQ_TRACKING_UNC_ERR, 106862306a36Sopenharmony_ci C_SDMA_CSR_PARITY_ERR, 106962306a36Sopenharmony_ci C_SDMA_RPY_TAG_ERR, 107062306a36Sopenharmony_ci/* SendEgressErrStatus */ 107162306a36Sopenharmony_ci C_TX_READ_PIO_MEMORY_CSR_UNC_ERR, 107262306a36Sopenharmony_ci C_TX_READ_SDMA_MEMORY_CSR_UNC_ERR, 107362306a36Sopenharmony_ci C_TX_EGRESS_FIFO_COR_ERR, 107462306a36Sopenharmony_ci C_TX_READ_PIO_MEMORY_COR_ERR, 107562306a36Sopenharmony_ci C_TX_READ_SDMA_MEMORY_COR_ERR, 107662306a36Sopenharmony_ci C_TX_SB_HDR_COR_ERR, 107762306a36Sopenharmony_ci C_TX_CREDIT_OVERRUN_ERR, 107862306a36Sopenharmony_ci C_TX_LAUNCH_FIFO8_COR_ERR, 107962306a36Sopenharmony_ci C_TX_LAUNCH_FIFO7_COR_ERR, 108062306a36Sopenharmony_ci C_TX_LAUNCH_FIFO6_COR_ERR, 108162306a36Sopenharmony_ci C_TX_LAUNCH_FIFO5_COR_ERR, 108262306a36Sopenharmony_ci C_TX_LAUNCH_FIFO4_COR_ERR, 108362306a36Sopenharmony_ci C_TX_LAUNCH_FIFO3_COR_ERR, 108462306a36Sopenharmony_ci C_TX_LAUNCH_FIFO2_COR_ERR, 108562306a36Sopenharmony_ci C_TX_LAUNCH_FIFO1_COR_ERR, 108662306a36Sopenharmony_ci C_TX_LAUNCH_FIFO0_COR_ERR, 108762306a36Sopenharmony_ci C_TX_CREDIT_RETURN_VL_ERR, 108862306a36Sopenharmony_ci C_TX_HCRC_INSERTION_ERR, 108962306a36Sopenharmony_ci C_TX_EGRESS_FIFI_UNC_ERR, 109062306a36Sopenharmony_ci C_TX_READ_PIO_MEMORY_UNC_ERR, 109162306a36Sopenharmony_ci C_TX_READ_SDMA_MEMORY_UNC_ERR, 109262306a36Sopenharmony_ci C_TX_SB_HDR_UNC_ERR, 109362306a36Sopenharmony_ci C_TX_CREDIT_RETURN_PARITY_ERR, 109462306a36Sopenharmony_ci C_TX_LAUNCH_FIFO8_UNC_OR_PARITY_ERR, 109562306a36Sopenharmony_ci C_TX_LAUNCH_FIFO7_UNC_OR_PARITY_ERR, 109662306a36Sopenharmony_ci C_TX_LAUNCH_FIFO6_UNC_OR_PARITY_ERR, 109762306a36Sopenharmony_ci C_TX_LAUNCH_FIFO5_UNC_OR_PARITY_ERR, 109862306a36Sopenharmony_ci C_TX_LAUNCH_FIFO4_UNC_OR_PARITY_ERR, 109962306a36Sopenharmony_ci C_TX_LAUNCH_FIFO3_UNC_OR_PARITY_ERR, 110062306a36Sopenharmony_ci C_TX_LAUNCH_FIFO2_UNC_OR_PARITY_ERR, 110162306a36Sopenharmony_ci C_TX_LAUNCH_FIFO1_UNC_OR_PARITY_ERR, 110262306a36Sopenharmony_ci C_TX_LAUNCH_FIFO0_UNC_OR_PARITY_ERR, 110362306a36Sopenharmony_ci C_TX_SDMA15_DISALLOWED_PACKET_ERR, 110462306a36Sopenharmony_ci C_TX_SDMA14_DISALLOWED_PACKET_ERR, 110562306a36Sopenharmony_ci C_TX_SDMA13_DISALLOWED_PACKET_ERR, 110662306a36Sopenharmony_ci C_TX_SDMA12_DISALLOWED_PACKET_ERR, 110762306a36Sopenharmony_ci C_TX_SDMA11_DISALLOWED_PACKET_ERR, 110862306a36Sopenharmony_ci C_TX_SDMA10_DISALLOWED_PACKET_ERR, 110962306a36Sopenharmony_ci C_TX_SDMA9_DISALLOWED_PACKET_ERR, 111062306a36Sopenharmony_ci C_TX_SDMA8_DISALLOWED_PACKET_ERR, 111162306a36Sopenharmony_ci C_TX_SDMA7_DISALLOWED_PACKET_ERR, 111262306a36Sopenharmony_ci C_TX_SDMA6_DISALLOWED_PACKET_ERR, 111362306a36Sopenharmony_ci C_TX_SDMA5_DISALLOWED_PACKET_ERR, 111462306a36Sopenharmony_ci C_TX_SDMA4_DISALLOWED_PACKET_ERR, 111562306a36Sopenharmony_ci C_TX_SDMA3_DISALLOWED_PACKET_ERR, 111662306a36Sopenharmony_ci C_TX_SDMA2_DISALLOWED_PACKET_ERR, 111762306a36Sopenharmony_ci C_TX_SDMA1_DISALLOWED_PACKET_ERR, 111862306a36Sopenharmony_ci C_TX_SDMA0_DISALLOWED_PACKET_ERR, 111962306a36Sopenharmony_ci C_TX_CONFIG_PARITY_ERR, 112062306a36Sopenharmony_ci C_TX_SBRD_CTL_CSR_PARITY_ERR, 112162306a36Sopenharmony_ci C_TX_LAUNCH_CSR_PARITY_ERR, 112262306a36Sopenharmony_ci C_TX_ILLEGAL_CL_ERR, 112362306a36Sopenharmony_ci C_TX_SBRD_CTL_STATE_MACHINE_PARITY_ERR, 112462306a36Sopenharmony_ci C_TX_RESERVED_10, 112562306a36Sopenharmony_ci C_TX_RESERVED_9, 112662306a36Sopenharmony_ci C_TX_SDMA_LAUNCH_INTF_PARITY_ERR, 112762306a36Sopenharmony_ci C_TX_PIO_LAUNCH_INTF_PARITY_ERR, 112862306a36Sopenharmony_ci C_TX_RESERVED_6, 112962306a36Sopenharmony_ci C_TX_INCORRECT_LINK_STATE_ERR, 113062306a36Sopenharmony_ci C_TX_LINK_DOWN_ERR, 113162306a36Sopenharmony_ci C_TX_EGRESS_FIFO_UNDERRUN_OR_PARITY_ERR, 113262306a36Sopenharmony_ci C_TX_RESERVED_2, 113362306a36Sopenharmony_ci C_TX_PKT_INTEGRITY_MEM_UNC_ERR, 113462306a36Sopenharmony_ci C_TX_PKT_INTEGRITY_MEM_COR_ERR, 113562306a36Sopenharmony_ci/* SendErrStatus */ 113662306a36Sopenharmony_ci C_SEND_CSR_WRITE_BAD_ADDR_ERR, 113762306a36Sopenharmony_ci C_SEND_CSR_READ_BAD_ADD_ERR, 113862306a36Sopenharmony_ci C_SEND_CSR_PARITY_ERR, 113962306a36Sopenharmony_ci/* SendCtxtErrStatus */ 114062306a36Sopenharmony_ci C_PIO_WRITE_OUT_OF_BOUNDS_ERR, 114162306a36Sopenharmony_ci C_PIO_WRITE_OVERFLOW_ERR, 114262306a36Sopenharmony_ci C_PIO_WRITE_CROSSES_BOUNDARY_ERR, 114362306a36Sopenharmony_ci C_PIO_DISALLOWED_PACKET_ERR, 114462306a36Sopenharmony_ci C_PIO_INCONSISTENT_SOP_ERR, 114562306a36Sopenharmony_ci/*SendDmaEngErrStatus */ 114662306a36Sopenharmony_ci C_SDMA_HEADER_REQUEST_FIFO_COR_ERR, 114762306a36Sopenharmony_ci C_SDMA_HEADER_STORAGE_COR_ERR, 114862306a36Sopenharmony_ci C_SDMA_PACKET_TRACKING_COR_ERR, 114962306a36Sopenharmony_ci C_SDMA_ASSEMBLY_COR_ERR, 115062306a36Sopenharmony_ci C_SDMA_DESC_TABLE_COR_ERR, 115162306a36Sopenharmony_ci C_SDMA_HEADER_REQUEST_FIFO_UNC_ERR, 115262306a36Sopenharmony_ci C_SDMA_HEADER_STORAGE_UNC_ERR, 115362306a36Sopenharmony_ci C_SDMA_PACKET_TRACKING_UNC_ERR, 115462306a36Sopenharmony_ci C_SDMA_ASSEMBLY_UNC_ERR, 115562306a36Sopenharmony_ci C_SDMA_DESC_TABLE_UNC_ERR, 115662306a36Sopenharmony_ci C_SDMA_TIMEOUT_ERR, 115762306a36Sopenharmony_ci C_SDMA_HEADER_LENGTH_ERR, 115862306a36Sopenharmony_ci C_SDMA_HEADER_ADDRESS_ERR, 115962306a36Sopenharmony_ci C_SDMA_HEADER_SELECT_ERR, 116062306a36Sopenharmony_ci C_SMDA_RESERVED_9, 116162306a36Sopenharmony_ci C_SDMA_PACKET_DESC_OVERFLOW_ERR, 116262306a36Sopenharmony_ci C_SDMA_LENGTH_MISMATCH_ERR, 116362306a36Sopenharmony_ci C_SDMA_HALT_ERR, 116462306a36Sopenharmony_ci C_SDMA_MEM_READ_ERR, 116562306a36Sopenharmony_ci C_SDMA_FIRST_DESC_ERR, 116662306a36Sopenharmony_ci C_SDMA_TAIL_OUT_OF_BOUNDS_ERR, 116762306a36Sopenharmony_ci C_SDMA_TOO_LONG_ERR, 116862306a36Sopenharmony_ci C_SDMA_GEN_MISMATCH_ERR, 116962306a36Sopenharmony_ci C_SDMA_WRONG_DW_ERR, 117062306a36Sopenharmony_ci DEV_CNTR_LAST /* Must be kept last */ 117162306a36Sopenharmony_ci}; 117262306a36Sopenharmony_ci 117362306a36Sopenharmony_ci/* Per port counter indexes */ 117462306a36Sopenharmony_cienum { 117562306a36Sopenharmony_ci C_TX_UNSUP_VL = 0, 117662306a36Sopenharmony_ci C_TX_INVAL_LEN, 117762306a36Sopenharmony_ci C_TX_MM_LEN_ERR, 117862306a36Sopenharmony_ci C_TX_UNDERRUN, 117962306a36Sopenharmony_ci C_TX_FLOW_STALL, 118062306a36Sopenharmony_ci C_TX_DROPPED, 118162306a36Sopenharmony_ci C_TX_HDR_ERR, 118262306a36Sopenharmony_ci C_TX_PKT, 118362306a36Sopenharmony_ci C_TX_WORDS, 118462306a36Sopenharmony_ci C_TX_WAIT, 118562306a36Sopenharmony_ci C_TX_FLIT_VL, 118662306a36Sopenharmony_ci C_TX_PKT_VL, 118762306a36Sopenharmony_ci C_TX_WAIT_VL, 118862306a36Sopenharmony_ci C_RX_PKT, 118962306a36Sopenharmony_ci C_RX_WORDS, 119062306a36Sopenharmony_ci C_SW_LINK_DOWN, 119162306a36Sopenharmony_ci C_SW_LINK_UP, 119262306a36Sopenharmony_ci C_SW_UNKNOWN_FRAME, 119362306a36Sopenharmony_ci C_SW_XMIT_DSCD, 119462306a36Sopenharmony_ci C_SW_XMIT_DSCD_VL, 119562306a36Sopenharmony_ci C_SW_XMIT_CSTR_ERR, 119662306a36Sopenharmony_ci C_SW_RCV_CSTR_ERR, 119762306a36Sopenharmony_ci C_SW_IBP_LOOP_PKTS, 119862306a36Sopenharmony_ci C_SW_IBP_RC_RESENDS, 119962306a36Sopenharmony_ci C_SW_IBP_RNR_NAKS, 120062306a36Sopenharmony_ci C_SW_IBP_OTHER_NAKS, 120162306a36Sopenharmony_ci C_SW_IBP_RC_TIMEOUTS, 120262306a36Sopenharmony_ci C_SW_IBP_PKT_DROPS, 120362306a36Sopenharmony_ci C_SW_IBP_DMA_WAIT, 120462306a36Sopenharmony_ci C_SW_IBP_RC_SEQNAK, 120562306a36Sopenharmony_ci C_SW_IBP_RC_DUPREQ, 120662306a36Sopenharmony_ci C_SW_IBP_RDMA_SEQ, 120762306a36Sopenharmony_ci C_SW_IBP_UNALIGNED, 120862306a36Sopenharmony_ci C_SW_IBP_SEQ_NAK, 120962306a36Sopenharmony_ci C_SW_IBP_RC_CRWAITS, 121062306a36Sopenharmony_ci C_SW_CPU_RC_ACKS, 121162306a36Sopenharmony_ci C_SW_CPU_RC_QACKS, 121262306a36Sopenharmony_ci C_SW_CPU_RC_DELAYED_COMP, 121362306a36Sopenharmony_ci C_RCV_HDR_OVF_0, 121462306a36Sopenharmony_ci C_RCV_HDR_OVF_1, 121562306a36Sopenharmony_ci C_RCV_HDR_OVF_2, 121662306a36Sopenharmony_ci C_RCV_HDR_OVF_3, 121762306a36Sopenharmony_ci C_RCV_HDR_OVF_4, 121862306a36Sopenharmony_ci C_RCV_HDR_OVF_5, 121962306a36Sopenharmony_ci C_RCV_HDR_OVF_6, 122062306a36Sopenharmony_ci C_RCV_HDR_OVF_7, 122162306a36Sopenharmony_ci C_RCV_HDR_OVF_8, 122262306a36Sopenharmony_ci C_RCV_HDR_OVF_9, 122362306a36Sopenharmony_ci C_RCV_HDR_OVF_10, 122462306a36Sopenharmony_ci C_RCV_HDR_OVF_11, 122562306a36Sopenharmony_ci C_RCV_HDR_OVF_12, 122662306a36Sopenharmony_ci C_RCV_HDR_OVF_13, 122762306a36Sopenharmony_ci C_RCV_HDR_OVF_14, 122862306a36Sopenharmony_ci C_RCV_HDR_OVF_15, 122962306a36Sopenharmony_ci C_RCV_HDR_OVF_16, 123062306a36Sopenharmony_ci C_RCV_HDR_OVF_17, 123162306a36Sopenharmony_ci C_RCV_HDR_OVF_18, 123262306a36Sopenharmony_ci C_RCV_HDR_OVF_19, 123362306a36Sopenharmony_ci C_RCV_HDR_OVF_20, 123462306a36Sopenharmony_ci C_RCV_HDR_OVF_21, 123562306a36Sopenharmony_ci C_RCV_HDR_OVF_22, 123662306a36Sopenharmony_ci C_RCV_HDR_OVF_23, 123762306a36Sopenharmony_ci C_RCV_HDR_OVF_24, 123862306a36Sopenharmony_ci C_RCV_HDR_OVF_25, 123962306a36Sopenharmony_ci C_RCV_HDR_OVF_26, 124062306a36Sopenharmony_ci C_RCV_HDR_OVF_27, 124162306a36Sopenharmony_ci C_RCV_HDR_OVF_28, 124262306a36Sopenharmony_ci C_RCV_HDR_OVF_29, 124362306a36Sopenharmony_ci C_RCV_HDR_OVF_30, 124462306a36Sopenharmony_ci C_RCV_HDR_OVF_31, 124562306a36Sopenharmony_ci C_RCV_HDR_OVF_32, 124662306a36Sopenharmony_ci C_RCV_HDR_OVF_33, 124762306a36Sopenharmony_ci C_RCV_HDR_OVF_34, 124862306a36Sopenharmony_ci C_RCV_HDR_OVF_35, 124962306a36Sopenharmony_ci C_RCV_HDR_OVF_36, 125062306a36Sopenharmony_ci C_RCV_HDR_OVF_37, 125162306a36Sopenharmony_ci C_RCV_HDR_OVF_38, 125262306a36Sopenharmony_ci C_RCV_HDR_OVF_39, 125362306a36Sopenharmony_ci C_RCV_HDR_OVF_40, 125462306a36Sopenharmony_ci C_RCV_HDR_OVF_41, 125562306a36Sopenharmony_ci C_RCV_HDR_OVF_42, 125662306a36Sopenharmony_ci C_RCV_HDR_OVF_43, 125762306a36Sopenharmony_ci C_RCV_HDR_OVF_44, 125862306a36Sopenharmony_ci C_RCV_HDR_OVF_45, 125962306a36Sopenharmony_ci C_RCV_HDR_OVF_46, 126062306a36Sopenharmony_ci C_RCV_HDR_OVF_47, 126162306a36Sopenharmony_ci C_RCV_HDR_OVF_48, 126262306a36Sopenharmony_ci C_RCV_HDR_OVF_49, 126362306a36Sopenharmony_ci C_RCV_HDR_OVF_50, 126462306a36Sopenharmony_ci C_RCV_HDR_OVF_51, 126562306a36Sopenharmony_ci C_RCV_HDR_OVF_52, 126662306a36Sopenharmony_ci C_RCV_HDR_OVF_53, 126762306a36Sopenharmony_ci C_RCV_HDR_OVF_54, 126862306a36Sopenharmony_ci C_RCV_HDR_OVF_55, 126962306a36Sopenharmony_ci C_RCV_HDR_OVF_56, 127062306a36Sopenharmony_ci C_RCV_HDR_OVF_57, 127162306a36Sopenharmony_ci C_RCV_HDR_OVF_58, 127262306a36Sopenharmony_ci C_RCV_HDR_OVF_59, 127362306a36Sopenharmony_ci C_RCV_HDR_OVF_60, 127462306a36Sopenharmony_ci C_RCV_HDR_OVF_61, 127562306a36Sopenharmony_ci C_RCV_HDR_OVF_62, 127662306a36Sopenharmony_ci C_RCV_HDR_OVF_63, 127762306a36Sopenharmony_ci C_RCV_HDR_OVF_64, 127862306a36Sopenharmony_ci C_RCV_HDR_OVF_65, 127962306a36Sopenharmony_ci C_RCV_HDR_OVF_66, 128062306a36Sopenharmony_ci C_RCV_HDR_OVF_67, 128162306a36Sopenharmony_ci C_RCV_HDR_OVF_68, 128262306a36Sopenharmony_ci C_RCV_HDR_OVF_69, 128362306a36Sopenharmony_ci C_RCV_HDR_OVF_70, 128462306a36Sopenharmony_ci C_RCV_HDR_OVF_71, 128562306a36Sopenharmony_ci C_RCV_HDR_OVF_72, 128662306a36Sopenharmony_ci C_RCV_HDR_OVF_73, 128762306a36Sopenharmony_ci C_RCV_HDR_OVF_74, 128862306a36Sopenharmony_ci C_RCV_HDR_OVF_75, 128962306a36Sopenharmony_ci C_RCV_HDR_OVF_76, 129062306a36Sopenharmony_ci C_RCV_HDR_OVF_77, 129162306a36Sopenharmony_ci C_RCV_HDR_OVF_78, 129262306a36Sopenharmony_ci C_RCV_HDR_OVF_79, 129362306a36Sopenharmony_ci C_RCV_HDR_OVF_80, 129462306a36Sopenharmony_ci C_RCV_HDR_OVF_81, 129562306a36Sopenharmony_ci C_RCV_HDR_OVF_82, 129662306a36Sopenharmony_ci C_RCV_HDR_OVF_83, 129762306a36Sopenharmony_ci C_RCV_HDR_OVF_84, 129862306a36Sopenharmony_ci C_RCV_HDR_OVF_85, 129962306a36Sopenharmony_ci C_RCV_HDR_OVF_86, 130062306a36Sopenharmony_ci C_RCV_HDR_OVF_87, 130162306a36Sopenharmony_ci C_RCV_HDR_OVF_88, 130262306a36Sopenharmony_ci C_RCV_HDR_OVF_89, 130362306a36Sopenharmony_ci C_RCV_HDR_OVF_90, 130462306a36Sopenharmony_ci C_RCV_HDR_OVF_91, 130562306a36Sopenharmony_ci C_RCV_HDR_OVF_92, 130662306a36Sopenharmony_ci C_RCV_HDR_OVF_93, 130762306a36Sopenharmony_ci C_RCV_HDR_OVF_94, 130862306a36Sopenharmony_ci C_RCV_HDR_OVF_95, 130962306a36Sopenharmony_ci C_RCV_HDR_OVF_96, 131062306a36Sopenharmony_ci C_RCV_HDR_OVF_97, 131162306a36Sopenharmony_ci C_RCV_HDR_OVF_98, 131262306a36Sopenharmony_ci C_RCV_HDR_OVF_99, 131362306a36Sopenharmony_ci C_RCV_HDR_OVF_100, 131462306a36Sopenharmony_ci C_RCV_HDR_OVF_101, 131562306a36Sopenharmony_ci C_RCV_HDR_OVF_102, 131662306a36Sopenharmony_ci C_RCV_HDR_OVF_103, 131762306a36Sopenharmony_ci C_RCV_HDR_OVF_104, 131862306a36Sopenharmony_ci C_RCV_HDR_OVF_105, 131962306a36Sopenharmony_ci C_RCV_HDR_OVF_106, 132062306a36Sopenharmony_ci C_RCV_HDR_OVF_107, 132162306a36Sopenharmony_ci C_RCV_HDR_OVF_108, 132262306a36Sopenharmony_ci C_RCV_HDR_OVF_109, 132362306a36Sopenharmony_ci C_RCV_HDR_OVF_110, 132462306a36Sopenharmony_ci C_RCV_HDR_OVF_111, 132562306a36Sopenharmony_ci C_RCV_HDR_OVF_112, 132662306a36Sopenharmony_ci C_RCV_HDR_OVF_113, 132762306a36Sopenharmony_ci C_RCV_HDR_OVF_114, 132862306a36Sopenharmony_ci C_RCV_HDR_OVF_115, 132962306a36Sopenharmony_ci C_RCV_HDR_OVF_116, 133062306a36Sopenharmony_ci C_RCV_HDR_OVF_117, 133162306a36Sopenharmony_ci C_RCV_HDR_OVF_118, 133262306a36Sopenharmony_ci C_RCV_HDR_OVF_119, 133362306a36Sopenharmony_ci C_RCV_HDR_OVF_120, 133462306a36Sopenharmony_ci C_RCV_HDR_OVF_121, 133562306a36Sopenharmony_ci C_RCV_HDR_OVF_122, 133662306a36Sopenharmony_ci C_RCV_HDR_OVF_123, 133762306a36Sopenharmony_ci C_RCV_HDR_OVF_124, 133862306a36Sopenharmony_ci C_RCV_HDR_OVF_125, 133962306a36Sopenharmony_ci C_RCV_HDR_OVF_126, 134062306a36Sopenharmony_ci C_RCV_HDR_OVF_127, 134162306a36Sopenharmony_ci C_RCV_HDR_OVF_128, 134262306a36Sopenharmony_ci C_RCV_HDR_OVF_129, 134362306a36Sopenharmony_ci C_RCV_HDR_OVF_130, 134462306a36Sopenharmony_ci C_RCV_HDR_OVF_131, 134562306a36Sopenharmony_ci C_RCV_HDR_OVF_132, 134662306a36Sopenharmony_ci C_RCV_HDR_OVF_133, 134762306a36Sopenharmony_ci C_RCV_HDR_OVF_134, 134862306a36Sopenharmony_ci C_RCV_HDR_OVF_135, 134962306a36Sopenharmony_ci C_RCV_HDR_OVF_136, 135062306a36Sopenharmony_ci C_RCV_HDR_OVF_137, 135162306a36Sopenharmony_ci C_RCV_HDR_OVF_138, 135262306a36Sopenharmony_ci C_RCV_HDR_OVF_139, 135362306a36Sopenharmony_ci C_RCV_HDR_OVF_140, 135462306a36Sopenharmony_ci C_RCV_HDR_OVF_141, 135562306a36Sopenharmony_ci C_RCV_HDR_OVF_142, 135662306a36Sopenharmony_ci C_RCV_HDR_OVF_143, 135762306a36Sopenharmony_ci C_RCV_HDR_OVF_144, 135862306a36Sopenharmony_ci C_RCV_HDR_OVF_145, 135962306a36Sopenharmony_ci C_RCV_HDR_OVF_146, 136062306a36Sopenharmony_ci C_RCV_HDR_OVF_147, 136162306a36Sopenharmony_ci C_RCV_HDR_OVF_148, 136262306a36Sopenharmony_ci C_RCV_HDR_OVF_149, 136362306a36Sopenharmony_ci C_RCV_HDR_OVF_150, 136462306a36Sopenharmony_ci C_RCV_HDR_OVF_151, 136562306a36Sopenharmony_ci C_RCV_HDR_OVF_152, 136662306a36Sopenharmony_ci C_RCV_HDR_OVF_153, 136762306a36Sopenharmony_ci C_RCV_HDR_OVF_154, 136862306a36Sopenharmony_ci C_RCV_HDR_OVF_155, 136962306a36Sopenharmony_ci C_RCV_HDR_OVF_156, 137062306a36Sopenharmony_ci C_RCV_HDR_OVF_157, 137162306a36Sopenharmony_ci C_RCV_HDR_OVF_158, 137262306a36Sopenharmony_ci C_RCV_HDR_OVF_159, 137362306a36Sopenharmony_ci PORT_CNTR_LAST /* Must be kept last */ 137462306a36Sopenharmony_ci}; 137562306a36Sopenharmony_ci 137662306a36Sopenharmony_ciu64 get_all_cpu_total(u64 __percpu *cntr); 137762306a36Sopenharmony_civoid hfi1_start_cleanup(struct hfi1_devdata *dd); 137862306a36Sopenharmony_civoid hfi1_clear_tids(struct hfi1_ctxtdata *rcd); 137962306a36Sopenharmony_civoid hfi1_init_ctxt(struct send_context *sc); 138062306a36Sopenharmony_civoid hfi1_put_tid(struct hfi1_devdata *dd, u32 index, 138162306a36Sopenharmony_ci u32 type, unsigned long pa, u16 order); 138262306a36Sopenharmony_civoid hfi1_quiet_serdes(struct hfi1_pportdata *ppd); 138362306a36Sopenharmony_civoid hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, 138462306a36Sopenharmony_ci struct hfi1_ctxtdata *rcd); 138562306a36Sopenharmony_ciu32 hfi1_read_cntrs(struct hfi1_devdata *dd, char **namep, u64 **cntrp); 138662306a36Sopenharmony_ciu32 hfi1_read_portcntrs(struct hfi1_pportdata *ppd, char **namep, u64 **cntrp); 138762306a36Sopenharmony_ciint hfi1_get_ib_cfg(struct hfi1_pportdata *ppd, int which); 138862306a36Sopenharmony_ciint hfi1_set_ib_cfg(struct hfi1_pportdata *ppd, int which, u32 val); 138962306a36Sopenharmony_ciint hfi1_set_ctxt_jkey(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd, 139062306a36Sopenharmony_ci u16 jkey); 139162306a36Sopenharmony_ciint hfi1_clear_ctxt_jkey(struct hfi1_devdata *dd, struct hfi1_ctxtdata *ctxt); 139262306a36Sopenharmony_ciint hfi1_set_ctxt_pkey(struct hfi1_devdata *dd, struct hfi1_ctxtdata *ctxt, 139362306a36Sopenharmony_ci u16 pkey); 139462306a36Sopenharmony_ciint hfi1_clear_ctxt_pkey(struct hfi1_devdata *dd, struct hfi1_ctxtdata *ctxt); 139562306a36Sopenharmony_civoid hfi1_read_link_quality(struct hfi1_devdata *dd, u8 *link_quality); 139662306a36Sopenharmony_civoid hfi1_init_vnic_rsm(struct hfi1_devdata *dd); 139762306a36Sopenharmony_civoid hfi1_deinit_vnic_rsm(struct hfi1_devdata *dd); 139862306a36Sopenharmony_ci 139962306a36Sopenharmony_ciirqreturn_t general_interrupt(int irq, void *data); 140062306a36Sopenharmony_ciirqreturn_t sdma_interrupt(int irq, void *data); 140162306a36Sopenharmony_ciirqreturn_t receive_context_interrupt(int irq, void *data); 140262306a36Sopenharmony_ciirqreturn_t receive_context_thread(int irq, void *data); 140362306a36Sopenharmony_ciirqreturn_t receive_context_interrupt_napi(int irq, void *data); 140462306a36Sopenharmony_ci 140562306a36Sopenharmony_ciint set_intr_bits(struct hfi1_devdata *dd, u16 first, u16 last, bool set); 140662306a36Sopenharmony_civoid init_qsfp_int(struct hfi1_devdata *dd); 140762306a36Sopenharmony_civoid clear_all_interrupts(struct hfi1_devdata *dd); 140862306a36Sopenharmony_civoid remap_intr(struct hfi1_devdata *dd, int isrc, int msix_intr); 140962306a36Sopenharmony_civoid remap_sdma_interrupts(struct hfi1_devdata *dd, int engine, int msix_intr); 141062306a36Sopenharmony_civoid reset_interrupts(struct hfi1_devdata *dd); 141162306a36Sopenharmony_ciu8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx); 141262306a36Sopenharmony_civoid hfi1_init_aip_rsm(struct hfi1_devdata *dd); 141362306a36Sopenharmony_civoid hfi1_deinit_aip_rsm(struct hfi1_devdata *dd); 141462306a36Sopenharmony_ci 141562306a36Sopenharmony_ci/* 141662306a36Sopenharmony_ci * Interrupt source table. 141762306a36Sopenharmony_ci * 141862306a36Sopenharmony_ci * Each entry is an interrupt source "type". It is ordered by increasing 141962306a36Sopenharmony_ci * number. 142062306a36Sopenharmony_ci */ 142162306a36Sopenharmony_cistruct is_table { 142262306a36Sopenharmony_ci int start; /* interrupt source type start */ 142362306a36Sopenharmony_ci int end; /* interrupt source type end */ 142462306a36Sopenharmony_ci /* routine that returns the name of the interrupt source */ 142562306a36Sopenharmony_ci char *(*is_name)(char *name, size_t size, unsigned int source); 142662306a36Sopenharmony_ci /* routine to call when receiving an interrupt */ 142762306a36Sopenharmony_ci void (*is_int)(struct hfi1_devdata *dd, unsigned int source); 142862306a36Sopenharmony_ci}; 142962306a36Sopenharmony_ci 143062306a36Sopenharmony_ci#endif /* _CHIP_H */ 1431