linux/drivers/net/ethernet/marvell/prestera/prestera_pci.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/* Copyright (c) 2019-2020 Marvell International Ltd. All rights reserved */

#include <linux/bitfield.h>
#include <linux/circ_buf.h>
#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>

#include "prestera.h"

#define PRESTERA_MSG_MAX_SIZE

#define PRESTERA_SUPP_FW_MAJ_VER
#define PRESTERA_SUPP_FW_MIN_VER

#define PRESTERA_PREV_FW_MAJ_VER
#define PRESTERA_PREV_FW_MIN_VER

#define PRESTERA_FW_PATH_FMT
#define PRESTERA_FW_ARM64_PATH_FMT

#define PRESTERA_FW_HDR_MAGIC
#define PRESTERA_FW_DL_TIMEOUT_MS
#define PRESTERA_FW_BLK_SZ

#define PRESTERA_FW_VER_MAJ_MUL
#define PRESTERA_FW_VER_MIN_MUL

#define PRESTERA_FW_VER_MAJ(v)

#define PRESTERA_FW_VER_MIN(v)

#define PRESTERA_FW_VER_PATCH(v)

enum prestera_pci_bar_t {};

struct prestera_fw_header {};

struct prestera_ldr_regs {};

#define PRESTERA_LDR_REG_OFFSET(f)

#define PRESTERA_LDR_READY_MAGIC

#define PRESTERA_LDR_STATUS_IMG_DL
#define PRESTERA_LDR_STATUS_START_FW
#define PRESTERA_LDR_STATUS_INVALID_IMG
#define PRESTERA_LDR_STATUS_NOMEM

#define PRESTERA_LDR_REG_BASE(fw)
#define PRESTERA_LDR_REG_ADDR(fw, reg)

/* fw loader registers */
#define PRESTERA_LDR_READY_REG
#define PRESTERA_LDR_IMG_SIZE_REG
#define PRESTERA_LDR_CTL_REG
#define PRESTERA_LDR_BUF_SIZE_REG
#define PRESTERA_LDR_BUF_OFFS_REG
#define PRESTERA_LDR_BUF_RD_REG
#define PRESTERA_LDR_BUF_WR_REG
#define PRESTERA_LDR_STATUS_REG

#define PRESTERA_LDR_CTL_DL_START

#define PRESTERA_EVT_QNUM_MAX

struct prestera_fw_evtq_regs {};

#define PRESTERA_CMD_QNUM_MAX

struct prestera_fw_cmdq_regs {};

struct prestera_fw_regs {};

#define PRESTERA_FW_REG_OFFSET(f)

#define PRESTERA_FW_READY_MAGIC

/* fw registers */
#define PRESTERA_FW_READY_REG

#define PRESTERA_CMD_BUF_OFFS_REG
#define PRESTERA_CMD_BUF_LEN_REG
#define PRESTERA_CMD_QNUM_REG
#define PRESTERA_EVT_BUF_OFFS_REG
#define PRESTERA_EVT_QNUM_REG

#define PRESTERA_CMDQ_REG_OFFSET(q, f)

#define PRESTERA_CMDQ_REQ_CTL_REG(q)
#define PRESTERA_CMDQ_REQ_LEN_REG(q)
#define PRESTERA_CMDQ_RCV_CTL_REG(q)
#define PRESTERA_CMDQ_RCV_LEN_REG(q)
#define PRESTERA_CMDQ_OFFS_REG(q)
#define PRESTERA_CMDQ_LEN_REG(q)

#define PRESTERA_FW_STATUS_REG
#define PRESTERA_RX_STATUS_REG

/* PRESTERA_CMD_REQ_CTL_REG flags */
#define PRESTERA_CMD_F_REQ_SENT
#define PRESTERA_CMD_F_REPL_RCVD

/* PRESTERA_CMD_RCV_CTL_REG flags */
#define PRESTERA_CMD_F_REPL_SENT

#define PRESTERA_FW_EVT_CTL_STATUS_MASK

#define PRESTERA_FW_EVT_CTL_STATUS_ON
#define PRESTERA_FW_EVT_CTL_STATUS_OFF

#define PRESTERA_EVTQ_REG_OFFSET(q, f)

#define PRESTERA_EVTQ_RD_IDX_REG(q)
#define PRESTERA_EVTQ_WR_IDX_REG(q)
#define PRESTERA_EVTQ_OFFS_REG(q)
#define PRESTERA_EVTQ_LEN_REG(q)

#define PRESTERA_FW_REG_BASE(fw)
#define PRESTERA_FW_REG_ADDR(fw, reg)

#define PRESTERA_FW_CMD_DEFAULT_WAIT_MS
#define PRESTERA_FW_READY_WAIT_MS

#define PRESTERA_DEV_ID_AC3X_98DX_55
#define PRESTERA_DEV_ID_AC3X_98DX_65
#define PRESTERA_DEV_ID_ALDRIN2
#define PRESTERA_DEV_ID_98DX7312M
#define PRESTERA_DEV_ID_98DX3500
#define PRESTERA_DEV_ID_98DX3501
#define PRESTERA_DEV_ID_98DX3510
#define PRESTERA_DEV_ID_98DX3520

struct prestera_fw_evtq {};

struct prestera_fw_cmdq {};

struct prestera_fw {};

static int prestera_fw_load(struct prestera_fw *fw);

static void prestera_fw_write(struct prestera_fw *fw, u32 reg, u32 val)
{}

static u32 prestera_fw_read(struct prestera_fw *fw, u32 reg)
{}

static u32 prestera_fw_evtq_len(struct prestera_fw *fw, u8 qid)
{}

static u32 prestera_fw_evtq_avail(struct prestera_fw *fw, u8 qid)
{}

static void prestera_fw_evtq_rd_set(struct prestera_fw *fw,
				    u8 qid, u32 idx)
{}

static u8 __iomem *prestera_fw_evtq_buf(struct prestera_fw *fw, u8 qid)
{}

static u32 prestera_fw_evtq_read32(struct prestera_fw *fw, u8 qid)
{}

static ssize_t prestera_fw_evtq_read_buf(struct prestera_fw *fw,
					 u8 qid, void *buf, size_t len)
{}

static u8 prestera_fw_evtq_pick(struct prestera_fw *fw)
{}

static void prestera_fw_evt_ctl_status_set(struct prestera_fw *fw, u32 val)
{}

static void prestera_fw_evt_work_fn(struct work_struct *work)
{}

static int prestera_fw_wait_reg32(struct prestera_fw *fw, u32 reg, u32 cmp,
				  unsigned int waitms)
{}

static void prestera_fw_cmdq_lock(struct prestera_fw *fw, u8 qid)
{}

static void prestera_fw_cmdq_unlock(struct prestera_fw *fw, u8 qid)
{}

static u32 prestera_fw_cmdq_len(struct prestera_fw *fw, u8 qid)
{}

static u8 __iomem *prestera_fw_cmdq_buf(struct prestera_fw *fw, u8 qid)
{}

static int prestera_fw_cmd_send(struct prestera_fw *fw, int qid,
				void *in_msg, size_t in_size,
				void *out_msg, size_t out_size,
				unsigned int waitms)
{}

static int prestera_fw_send_req(struct prestera_device *dev, int qid,
				void *in_msg, size_t in_size, void *out_msg,
				size_t out_size, unsigned int waitms)
{}

static int prestera_fw_init(struct prestera_fw *fw)
{}

static void prestera_fw_uninit(struct prestera_fw *fw)
{}

static irqreturn_t prestera_pci_irq_handler(int irq, void *dev_id)
{}

static void prestera_ldr_write(struct prestera_fw *fw, u32 reg, u32 val)
{}

static u32 prestera_ldr_read(struct prestera_fw *fw, u32 reg)
{}

static int prestera_ldr_wait_reg32(struct prestera_fw *fw,
				   u32 reg, u32 cmp, unsigned int waitms)
{}

static u32 prestera_ldr_wait_buf(struct prestera_fw *fw, size_t len)
{}

static int prestera_ldr_wait_dl_finish(struct prestera_fw *fw)
{}

static void prestera_ldr_wr_idx_move(struct prestera_fw *fw, unsigned int n)
{}

static void prestera_ldr_wr_idx_commit(struct prestera_fw *fw)
{}

static u8 __iomem *prestera_ldr_wr_ptr(struct prestera_fw *fw)
{}

static int prestera_ldr_send(struct prestera_fw *fw, const u8 *buf, size_t len)
{}

static int prestera_ldr_fw_send(struct prestera_fw *fw,
				const char *img, u32 fw_size)
{}

static void prestera_fw_rev_parse(const struct prestera_fw_header *hdr,
				  struct prestera_fw_rev *rev)
{}

static int prestera_fw_rev_check(struct prestera_fw *fw)
{}

static int prestera_fw_hdr_parse(struct prestera_fw *fw)
{}

static const char *prestera_fw_path_fmt_get(struct prestera_fw *fw)
{}

static int prestera_fw_get(struct prestera_fw *fw)
{}

static void prestera_fw_put(struct prestera_fw *fw)
{}

static int prestera_fw_load(struct prestera_fw *fw)
{}

static bool prestera_pci_pp_use_bar2(struct pci_dev *pdev)
{}

static u32 prestera_pci_pp_bar2_offs(struct pci_dev *pdev)
{}

static u32 prestera_pci_fw_bar2_offs(struct pci_dev *pdev)
{}

static int prestera_pci_probe(struct pci_dev *pdev,
			      const struct pci_device_id *id)
{}

static void prestera_pci_remove(struct pci_dev *pdev)
{}

static const struct pci_device_id prestera_pci_devices[] =;
MODULE_DEVICE_TABLE(pci, prestera_pci_devices);

static struct pci_driver prestera_pci_driver =;
module_pci_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();