linux/drivers/edac/skx_base.c

// SPDX-License-Identifier: GPL-2.0
/*
 * EDAC driver for Intel(R) Xeon(R) Skylake processors
 * Copyright (c) 2016, Intel Corporation.
 */

#include <linux/kernel.h>
#include <linux/processor.h>
#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include <asm/mce.h>

#include "edac_module.h"
#include "skx_common.h"

#define EDAC_MOD_STR

/*
 * Debug macros
 */
#define skx_printk(level, fmt, arg...)

#define skx_mc_printk(mci, level, fmt, arg...)

static struct list_head *skx_edac_list;

static u64 skx_tolm, skx_tohm;
static int skx_num_sockets;
static unsigned int nvdimm_count;

#define MASK26
#define MASK29

static struct skx_dev *get_skx_dev(struct pci_bus *bus, u8 idx)
{}

enum munittype {};

struct munit {};

/*
 * List of PCI device ids that we need together with some device
 * number and function numbers to tell which memory controller the
 * device belongs to.
 */
static const struct munit skx_all_munits[] =;

static int get_all_munits(const struct munit *m)
{}

static struct res_config skx_cfg =;

static const struct x86_cpu_id skx_cpuids[] =;
MODULE_DEVICE_TABLE(x86cpu, skx_cpuids);

static bool skx_check_ecc(u32 mcmtr)
{}

static int skx_get_dimm_config(struct mem_ctl_info *mci, struct res_config *cfg)
{}

#define SKX_MAX_SAD

#define SKX_GET_SAD(d, i, reg)
#define SKX_GET_ILV(d, i, reg)

#define SKX_SAD_MOD3MODE(sad)
#define SKX_SAD_MOD3(sad)
#define SKX_SAD_LIMIT(sad)
#define SKX_SAD_MOD3ASMOD2(sad)
#define SKX_SAD_ATTR(sad)
#define SKX_SAD_INTERLEAVE(sad)
#define SKX_SAD_ENABLE(sad)

#define SKX_ILV_REMOTE(tgt)
#define SKX_ILV_TARGET(tgt)

static void skx_show_retry_rd_err_log(struct decoded_addr *res,
				      char *msg, int len,
				      bool scrub_err)
{}

static bool skx_sad_decode(struct decoded_addr *res)
{}

#define SKX_MAX_TAD

#define SKX_GET_TADBASE(d, mc, i, reg)
#define SKX_GET_TADWAYNESS(d, mc, i, reg)
#define SKX_GET_TADCHNILVOFFSET(d, mc, ch, i, reg)

#define SKX_TAD_BASE(b)
#define SKX_TAD_SKT_GRAN(b)
#define SKX_TAD_CHN_GRAN(b)
#define SKX_TAD_LIMIT(b)
#define SKX_TAD_OFFSET(b)
#define SKX_TAD_SKTWAYS(b)
#define SKX_TAD_CHNWAYS(b)

/* which bit used for both socket and channel interleave */
static int skx_granularity[] =;

static u64 skx_do_interleave(u64 addr, int shift, int ways, u64 lowbits)
{}

static bool skx_tad_decode(struct decoded_addr *res)
{}

#define SKX_MAX_RIR

#define SKX_GET_RIRWAYNESS(d, mc, ch, i, reg)
#define SKX_GET_RIRILV(d, mc, ch, idx, i, reg)

#define SKX_RIR_VALID(b)
#define SKX_RIR_LIMIT(b)
#define SKX_RIR_WAYS(b)
#define SKX_RIR_CHAN_RANK(b)
#define SKX_RIR_OFFSET(b)

static bool skx_rir_decode(struct decoded_addr *res)
{}

static u8 skx_close_row[] =;

static u8 skx_close_column[] =;

static u8 skx_open_row[] =;

static u8 skx_open_column[] =;

static u8 skx_open_fine_column[] =;

static int skx_bits(u64 addr, int nbits, u8 *bits)
{}

static int skx_bank_bits(u64 addr, int b0, int b1, int do_xor, int x0, int x1)
{}

static bool skx_mad_decode(struct decoded_addr *r)
{}

static bool skx_decode(struct decoded_addr *res)
{}

static struct notifier_block skx_mce_dec =;

#ifdef CONFIG_EDAC_DEBUG
/*
 * Debug feature.
 * Exercise the address decode logic by writing an address to
 * /sys/kernel/debug/edac/skx_test/addr.
 */
static struct dentry *skx_test;

static int debugfs_u64_set(void *data, u64 val)
{}
DEFINE_SIMPLE_ATTRIBUTE();

static void setup_skx_debug(void)
{}

static void teardown_skx_debug(void)
{}
#else
static inline void setup_skx_debug(void) {}
static inline void teardown_skx_debug(void) {}
#endif /*CONFIG_EDAC_DEBUG*/

/*
 * skx_init:
 *	make sure we are running on the correct cpu model
 *	search for all the devices we need
 *	check which DIMMs are present.
 */
static int __init skx_init(void)
{}

static void __exit skx_exit(void)
{}

module_init();
module_exit(skx_exit);

module_param(edac_op_state, int, 0444);
MODULE_PARM_DESC();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();