2018-10-20 03:15:26 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
/* Copyright (c) 2016-2017 Hisilicon Limited. */
|
|
|
|
|
|
|
|
#ifndef __HCLGE_ERR_H
|
|
|
|
#define __HCLGE_ERR_H
|
|
|
|
|
|
|
|
#include "hclge_main.h"
|
|
|
|
|
|
|
|
#define HCLGE_RAS_PF_OTHER_INT_STS_REG 0x20B00
|
|
|
|
#define HCLGE_RAS_REG_NFE_MASK 0xFF00
|
2018-12-08 05:08:11 +08:00
|
|
|
#define HCLGE_RAS_REG_ROCEE_ERR_MASK 0x3000000
|
2018-10-20 03:15:26 +08:00
|
|
|
|
2018-12-08 05:08:06 +08:00
|
|
|
#define HCLGE_VECTOR0_PF_OTHER_INT_STS_REG 0x20800
|
|
|
|
#define HCLGE_VECTOR0_REG_MSIX_MASK 0x1FF00
|
|
|
|
|
2018-10-20 03:15:29 +08:00
|
|
|
#define HCLGE_IMP_TCM_ECC_ERR_INT_EN 0xFFFF0000
|
|
|
|
#define HCLGE_IMP_TCM_ECC_ERR_INT_EN_MASK 0xFFFF0000
|
|
|
|
#define HCLGE_IMP_ITCM4_ECC_ERR_INT_EN 0x300
|
|
|
|
#define HCLGE_IMP_ITCM4_ECC_ERR_INT_EN_MASK 0x300
|
|
|
|
#define HCLGE_CMDQ_NIC_ECC_ERR_INT_EN 0xFFFF
|
|
|
|
#define HCLGE_CMDQ_NIC_ECC_ERR_INT_EN_MASK 0xFFFF
|
|
|
|
#define HCLGE_CMDQ_ROCEE_ECC_ERR_INT_EN 0xFFFF0000
|
|
|
|
#define HCLGE_CMDQ_ROCEE_ECC_ERR_INT_EN_MASK 0xFFFF0000
|
|
|
|
#define HCLGE_IMP_RD_POISON_ERR_INT_EN 0x0100
|
|
|
|
#define HCLGE_IMP_RD_POISON_ERR_INT_EN_MASK 0x0100
|
|
|
|
#define HCLGE_TQP_ECC_ERR_INT_EN 0x0FFF
|
|
|
|
#define HCLGE_TQP_ECC_ERR_INT_EN_MASK 0x0FFF
|
2018-12-08 05:08:04 +08:00
|
|
|
#define HCLGE_MSIX_SRAM_ECC_ERR_INT_EN_MASK 0x0F000000
|
|
|
|
#define HCLGE_MSIX_SRAM_ECC_ERR_INT_EN 0x0F000000
|
2018-10-20 03:15:30 +08:00
|
|
|
#define HCLGE_IGU_ERR_INT_EN 0x0000066F
|
|
|
|
#define HCLGE_IGU_ERR_INT_EN_MASK 0x000F
|
|
|
|
#define HCLGE_IGU_TNL_ERR_INT_EN 0x0002AABF
|
|
|
|
#define HCLGE_IGU_TNL_ERR_INT_EN_MASK 0x003F
|
2018-10-20 03:15:31 +08:00
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT0_EN 0xFFFFFFFF
|
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT0_EN_MASK 0xFFFFFFFF
|
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT1_EN 0xFFFFFFFF
|
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT1_EN_MASK 0xFFFFFFFF
|
|
|
|
#define HCLGE_PPP_PF_ERR_INT_EN 0x0003
|
|
|
|
#define HCLGE_PPP_PF_ERR_INT_EN_MASK 0x0003
|
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT2_EN 0x003F
|
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT2_EN_MASK 0x003F
|
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT3_EN 0x003F
|
|
|
|
#define HCLGE_PPP_MPF_ECC_ERR_INT3_EN_MASK 0x003F
|
2018-10-20 03:15:32 +08:00
|
|
|
#define HCLGE_TM_SCH_ECC_ERR_INT_EN 0x3
|
|
|
|
#define HCLGE_TM_QCN_MEM_ERR_INT_EN 0xFFFFFF
|
2018-10-20 03:15:30 +08:00
|
|
|
#define HCLGE_NCSI_ERR_INT_EN 0x3
|
|
|
|
#define HCLGE_NCSI_ERR_INT_TYPE 0x9
|
2018-12-08 05:08:07 +08:00
|
|
|
#define HCLGE_MAC_COMMON_ERR_INT_EN GENMASK(7, 0)
|
|
|
|
#define HCLGE_MAC_COMMON_ERR_INT_EN_MASK GENMASK(7, 0)
|
2018-12-08 05:08:09 +08:00
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT0_EN GENMASK(31, 0)
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT0_EN_MASK GENMASK(31, 0)
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT1_EN GENMASK(31, 0)
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT1_EN_MASK GENMASK(31, 0)
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT2_EN 0x3FFF3FFF
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT2_EN_MASK 0x3FFF3FFF
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT2_EN2 0xB
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT2_EN2_MASK 0xB
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT3_EN GENMASK(7, 0)
|
|
|
|
#define HCLGE_PPU_MPF_ABNORMAL_INT3_EN_MASK GENMASK(23, 16)
|
|
|
|
#define HCLGE_PPU_PF_ABNORMAL_INT_EN GENMASK(5, 0)
|
|
|
|
#define HCLGE_PPU_PF_ABNORMAL_INT_EN_MASK GENMASK(5, 0)
|
2018-12-08 05:08:10 +08:00
|
|
|
#define HCLGE_SSU_1BIT_ECC_ERR_INT_EN GENMASK(31, 0)
|
|
|
|
#define HCLGE_SSU_1BIT_ECC_ERR_INT_EN_MASK GENMASK(31, 0)
|
|
|
|
#define HCLGE_SSU_MULTI_BIT_ECC_ERR_INT_EN GENMASK(31, 0)
|
|
|
|
#define HCLGE_SSU_MULTI_BIT_ECC_ERR_INT_EN_MASK GENMASK(31, 0)
|
|
|
|
#define HCLGE_SSU_BIT32_ECC_ERR_INT_EN 0x0101
|
|
|
|
#define HCLGE_SSU_BIT32_ECC_ERR_INT_EN_MASK 0x0101
|
|
|
|
#define HCLGE_SSU_COMMON_INT_EN GENMASK(9, 0)
|
|
|
|
#define HCLGE_SSU_COMMON_INT_EN_MASK GENMASK(9, 0)
|
|
|
|
#define HCLGE_SSU_PORT_BASED_ERR_INT_EN 0x0BFF
|
|
|
|
#define HCLGE_SSU_PORT_BASED_ERR_INT_EN_MASK 0x0BFF0000
|
|
|
|
#define HCLGE_SSU_FIFO_OVERFLOW_ERR_INT_EN GENMASK(23, 0)
|
|
|
|
#define HCLGE_SSU_FIFO_OVERFLOW_ERR_INT_EN_MASK GENMASK(23, 0)
|
2018-10-20 03:15:29 +08:00
|
|
|
|
2018-12-08 05:08:10 +08:00
|
|
|
#define HCLGE_SSU_COMMON_ERR_INT_MASK GENMASK(9, 0)
|
|
|
|
#define HCLGE_SSU_PORT_INT_MSIX_MASK 0x7BFF
|
2018-12-08 05:08:04 +08:00
|
|
|
#define HCLGE_IGU_INT_MASK GENMASK(3, 0)
|
|
|
|
#define HCLGE_IGU_EGU_TNL_INT_MASK GENMASK(5, 0)
|
|
|
|
#define HCLGE_PPP_MPF_INT_ST3_MASK GENMASK(5, 0)
|
2018-12-08 05:08:09 +08:00
|
|
|
#define HCLGE_PPU_MPF_INT_ST3_MASK GENMASK(7, 0)
|
|
|
|
#define HCLGE_PPU_MPF_INT_ST2_MSIX_MASK GENMASK(29, 28)
|
|
|
|
#define HCLGE_PPU_PF_INT_MSIX_MASK 0x27
|
2018-12-08 05:08:04 +08:00
|
|
|
#define HCLGE_QCN_FIFO_INT_MASK GENMASK(17, 0)
|
|
|
|
#define HCLGE_QCN_ECC_INT_MASK GENMASK(21, 0)
|
|
|
|
#define HCLGE_NCSI_ECC_INT_MASK GENMASK(1, 0)
|
|
|
|
|
2018-12-08 05:08:11 +08:00
|
|
|
#define HCLGE_ROCEE_RAS_NFE_INT_EN 0xF
|
|
|
|
#define HCLGE_ROCEE_RAS_CE_INT_EN 0x1
|
|
|
|
#define HCLGE_ROCEE_RAS_NFE_INT_EN_MASK 0xF
|
|
|
|
#define HCLGE_ROCEE_RAS_CE_INT_EN_MASK 0x1
|
|
|
|
#define HCLGE_ROCEE_RERR_INT_MASK BIT(0)
|
|
|
|
#define HCLGE_ROCEE_BERR_INT_MASK BIT(1)
|
|
|
|
#define HCLGE_ROCEE_ECC_INT_MASK BIT(2)
|
|
|
|
#define HCLGE_ROCEE_OVF_INT_MASK BIT(3)
|
|
|
|
#define HCLGE_ROCEE_OVF_ERR_INT_MASK 0x10000
|
|
|
|
#define HCLGE_ROCEE_OVF_ERR_TYPE_MASK 0x3F
|
|
|
|
|
2018-10-20 03:15:26 +08:00
|
|
|
enum hclge_err_int_type {
|
|
|
|
HCLGE_ERR_INT_MSIX = 0,
|
|
|
|
HCLGE_ERR_INT_RAS_CE = 1,
|
|
|
|
HCLGE_ERR_INT_RAS_NFE = 2,
|
|
|
|
HCLGE_ERR_INT_RAS_FE = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hclge_hw_blk {
|
|
|
|
u32 msk;
|
|
|
|
const char *name;
|
2018-12-08 05:07:59 +08:00
|
|
|
int (*config_err_int)(struct hclge_dev *hdev, bool en);
|
2018-10-20 03:15:26 +08:00
|
|
|
};
|
|
|
|
|
2018-10-20 03:15:29 +08:00
|
|
|
struct hclge_hw_error {
|
|
|
|
u32 int_msk;
|
|
|
|
const char *msg;
|
|
|
|
};
|
|
|
|
|
2018-10-20 03:15:28 +08:00
|
|
|
int hclge_hw_error_set_state(struct hclge_dev *hdev, bool state);
|
2018-12-08 05:08:02 +08:00
|
|
|
pci_ers_result_t hclge_handle_hw_ras_error(struct hnae3_ae_dev *ae_dev);
|
2018-12-08 05:08:06 +08:00
|
|
|
int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
|
|
|
|
unsigned long *reset_requests);
|
2018-10-20 03:15:26 +08:00
|
|
|
#endif
|