linux/drivers/crypto/cavium/cpt/cpt_common.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2016 Cavium, Inc.
 */

#ifndef __CPT_COMMON_H
#define __CPT_COMMON_H

#include <asm/byteorder.h>
#include <linux/delay.h>
#include <linux/pci.h>

#include "cpt_hw_types.h"

/* Device ID */
#define CPT_81XX_PCI_PF_DEVICE_ID
#define CPT_81XX_PCI_VF_DEVICE_ID

/* flags to indicate the features supported */
#define CPT_FLAG_SRIOV_ENABLED
#define CPT_FLAG_VF_DRIVER
#define CPT_FLAG_DEVICE_READY

#define cpt_sriov_enabled(cpt)
#define cpt_vf_driver(cpt)
#define cpt_device_ready(cpt)

#define CPT_MBOX_MSG_TYPE_ACK
#define CPT_MBOX_MSG_TYPE_NACK
#define CPT_MBOX_MSG_TIMEOUT
#define VF_STATE_DOWN
#define VF_STATE_UP

/*
 * CPT Registers map for 81xx
 */

/* PF registers */
#define CPTX_PF_CONSTANTS(a)
#define CPTX_PF_RESET(a)
#define CPTX_PF_DIAG(a)
#define CPTX_PF_BIST_STATUS(a)
#define CPTX_PF_ECC0_CTL(a)
#define CPTX_PF_ECC0_FLIP(a)
#define CPTX_PF_ECC0_INT(a)
#define CPTX_PF_ECC0_INT_W1S(a)
#define CPTX_PF_ECC0_ENA_W1S(a)
#define CPTX_PF_ECC0_ENA_W1C(a)
#define CPTX_PF_MBOX_INTX(a, b)
#define CPTX_PF_MBOX_INT_W1SX(a, b)
#define CPTX_PF_MBOX_ENA_W1CX(a, b)
#define CPTX_PF_MBOX_ENA_W1SX(a, b)
#define CPTX_PF_EXEC_INT(a)
#define CPTX_PF_EXEC_INT_W1S(a)
#define CPTX_PF_EXEC_ENA_W1C(a)
#define CPTX_PF_EXEC_ENA_W1S(a)
#define CPTX_PF_GX_EN(a, b)
#define CPTX_PF_EXEC_INFO(a)
#define CPTX_PF_EXEC_BUSY(a)
#define CPTX_PF_EXEC_INFO0(a)
#define CPTX_PF_EXEC_INFO1(a)
#define CPTX_PF_INST_REQ_PC(a)
#define CPTX_PF_INST_LATENCY_PC(a)
#define CPTX_PF_RD_REQ_PC(a)
#define CPTX_PF_RD_LATENCY_PC(a)
#define CPTX_PF_RD_UC_PC(a)
#define CPTX_PF_ACTIVE_CYCLES_PC(a)
#define CPTX_PF_EXE_CTL(a)
#define CPTX_PF_EXE_STATUS(a)
#define CPTX_PF_EXE_CLK(a)
#define CPTX_PF_EXE_DBG_CTL(a)
#define CPTX_PF_EXE_DBG_DATA(a)
#define CPTX_PF_EXE_BIST_STATUS(a)
#define CPTX_PF_EXE_REQ_TIMER(a)
#define CPTX_PF_EXE_MEM_CTL(a)
#define CPTX_PF_EXE_PERF_CTL(a)
#define CPTX_PF_EXE_DBG_CNTX(a, b)
#define CPTX_PF_EXE_PERF_EVENT_CNT(a)
#define CPTX_PF_EXE_EPCI_INBX_CNT(a, b)
#define CPTX_PF_EXE_EPCI_OUTBX_CNT(a, b)
#define CPTX_PF_ENGX_UCODE_BASE(a, b)
#define CPTX_PF_QX_CTL(a, b)
#define CPTX_PF_QX_GMCTL(a, b)
#define CPTX_PF_QX_CTL2(a, b)
#define CPTX_PF_VFX_MBOXX(a, b, c)

/* VF registers */
#define CPTX_VQX_CTL(a, b)
#define CPTX_VQX_SADDR(a, b)
#define CPTX_VQX_DONE_WAIT(a, b)
#define CPTX_VQX_INPROG(a, b)
#define CPTX_VQX_DONE(a, b)
#define CPTX_VQX_DONE_ACK(a, b)
#define CPTX_VQX_DONE_INT_W1S(a, b)
#define CPTX_VQX_DONE_INT_W1C(a, b)
#define CPTX_VQX_DONE_ENA_W1S(a, b)
#define CPTX_VQX_DONE_ENA_W1C(a, b)
#define CPTX_VQX_MISC_INT(a, b)
#define CPTX_VQX_MISC_INT_W1S(a, b)
#define CPTX_VQX_MISC_ENA_W1S(a, b)
#define CPTX_VQX_MISC_ENA_W1C(a, b)
#define CPTX_VQX_DOORBELL(a, b)
#define CPTX_VFX_PF_MBOXX(a, b, c)

enum vftype {};

/* Max CPT devices supported */
enum cpt_mbox_opcode {};

/* CPT mailbox structure */
struct cpt_mbox {};

/* Register read/write APIs */
static inline void cpt_write_csr64(u8 __iomem *hw_addr, u64 offset,
				   u64 val)
{}

static inline u64 cpt_read_csr64(u8 __iomem *hw_addr, u64 offset)
{}
#endif /* __CPT_COMMON_H */