// SPDX-License-Identifier: GPL-2.0-only
/* Copyright(c) 2023 Intel Corporation */
#include "adf_common_drv.h"
#include "adf_gen4_hw_data.h"
#include "adf_gen4_ras.h"
#include "adf_sysfs_ras_counters.h"
#define BITS_PER_REG(_n_) (sizeof(_n_) * BITS_PER_BYTE)
static void enable_errsou_reporting(void __iomem *csr)
{
/* Enable correctable error reporting in ERRSOU0 */
ADF_CSR_WR(csr, ADF_GEN4_ERRMSK0, 0);
/* Enable uncorrectable error reporting in ERRSOU1 */
ADF_CSR_WR(csr, ADF_GEN4_ERRMSK1, 0);
/*
* Enable uncorrectable error reporting in ERRSOU2
* but disable PM interrupt and CFC attention interrupt by default
*/
ADF_CSR_WR(csr, ADF_GEN4_ERRMSK2,
ADF_GEN4_ERRSOU2_PM_INT_BIT |
ADF_GEN4_ERRSOU2_CPP_CFC_ATT_INT_BITMASK);
/*
* Enable uncorrectable error reporting in ERRSOU3
* but disable RLT error interrupt and VFLR notify interrupt by default
*/
ADF_CSR_WR(csr, ADF_GEN4_ERRMSK3,
ADF_GEN4_ERRSOU3_RLTERROR_BIT |
ADF_GEN4_ERRSOU3_VFLRNOTIFY_BIT);
}
static void disable_errsou_reporting(void __iomem *csr)
{
u32 val = 0;
/* Disable correctable error reporting in ERRSOU0 */
ADF_CSR_WR(csr, ADF_GEN4_ERRMSK0,