#include <linux/units.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/pci-doe.h>
#include <linux/aer.h>
#include <cxlpci.h>
#include <cxlmem.h>
#include <cxl.h>
#include "core.h"
#include "trace.h"
static unsigned short media_ready_timeout = …;
module_param(media_ready_timeout, ushort, 0644);
MODULE_PARM_DESC(…) …;
struct cxl_walk_context { … };
static int match_add_dports(struct pci_dev *pdev, void *data)
{ … }
int devm_cxl_port_enumerate_dports(struct cxl_port *port)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static int cxl_dvsec_mem_range_valid(struct cxl_dev_state *cxlds, int id)
{ … }
static int cxl_dvsec_mem_range_active(struct cxl_dev_state *cxlds, int id)
{ … }
int cxl_await_media_ready(struct cxl_dev_state *cxlds)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static int cxl_set_mem_enable(struct cxl_dev_state *cxlds, u16 val)
{ … }
static void clear_mem_enable(void *cxlds)
{ … }
static int devm_cxl_enable_mem(struct device *host, struct cxl_dev_state *cxlds)
{ … }
static int dvsec_range_allowed(struct device *dev, void *arg)
{ … }
static void disable_hdm(void *_cxlhdm)
{ … }
static int devm_cxl_enable_hdm(struct device *host, struct cxl_hdm *cxlhdm)
{ … }
int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
struct cxl_endpoint_dvsec_info *info)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int cxl_hdm_decode_init(struct cxl_dev_state *cxlds, struct cxl_hdm *cxlhdm,
struct cxl_endpoint_dvsec_info *info)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
#define CXL_DOE_TABLE_ACCESS_REQ_CODE …
#define CXL_DOE_TABLE_ACCESS_REQ_CODE_READ …
#define CXL_DOE_TABLE_ACCESS_TABLE_TYPE …
#define CXL_DOE_TABLE_ACCESS_TABLE_TYPE_CDATA …
#define CXL_DOE_TABLE_ACCESS_ENTRY_HANDLE …
#define CXL_DOE_TABLE_ACCESS_LAST_ENTRY …
#define CXL_DOE_PROTOCOL_TABLE_ACCESS …
#define CDAT_DOE_REQ(entry_handle) …
static int cxl_cdat_get_length(struct device *dev,
struct pci_doe_mb *doe_mb,
size_t *length)
{ … }
static int cxl_cdat_read_table(struct device *dev,
struct pci_doe_mb *doe_mb,
struct cdat_doe_rsp *rsp, size_t *length)
{ … }
static unsigned char cdat_checksum(void *buf, size_t size)
{ … }
void read_cdat_data(struct cxl_port *port)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static void __cxl_handle_cor_ras(struct cxl_dev_state *cxlds,
void __iomem *ras_base)
{ … }
static void cxl_handle_endpoint_cor_ras(struct cxl_dev_state *cxlds)
{ … }
static void header_log_copy(void __iomem *ras_base, u32 *log)
{ … }
static bool __cxl_handle_ras(struct cxl_dev_state *cxlds,
void __iomem *ras_base)
{ … }
static bool cxl_handle_endpoint_ras(struct cxl_dev_state *cxlds)
{ … }
#ifdef CONFIG_PCIEAER_CXL
static void cxl_dport_map_rch_aer(struct cxl_dport *dport)
{ … }
static void cxl_dport_map_ras(struct cxl_dport *dport)
{ … }
static void cxl_disable_rch_root_ints(struct cxl_dport *dport)
{ … }
void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static void cxl_handle_rdport_cor_ras(struct cxl_dev_state *cxlds,
struct cxl_dport *dport)
{ … }
static bool cxl_handle_rdport_ras(struct cxl_dev_state *cxlds,
struct cxl_dport *dport)
{ … }
static bool cxl_rch_get_aer_info(void __iomem *aer_base,
struct aer_capability_regs *aer_regs)
{ … }
static bool cxl_rch_get_aer_severity(struct aer_capability_regs *aer_regs,
int *severity)
{ … }
static void cxl_handle_rdport_errors(struct cxl_dev_state *cxlds)
{ … }
#else
static void cxl_handle_rdport_errors(struct cxl_dev_state *cxlds) { }
#endif
void cxl_cor_error_detected(struct pci_dev *pdev)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
pci_ers_result_t cxl_error_detected(struct pci_dev *pdev,
pci_channel_state_t state)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
static int cxl_flit_size(struct pci_dev *pdev)
{ … }
long cxl_pci_get_latency(struct pci_dev *pdev)
{ … }
static int __cxl_endpoint_decoder_reset_detected(struct device *dev, void *data)
{ … }
bool cxl_endpoint_decoder_reset_detected(struct cxl_port *port)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int cxl_pci_get_bandwidth(struct pci_dev *pdev, struct access_coordinate *c)
{ … }