Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /* Copyright (c) 2015-2016 Quantenna Communications */
0003 
0004 #ifndef _QTN_FMAC_PCIE_IPC_H_
0005 #define _QTN_FMAC_PCIE_IPC_H_
0006 
0007 #include <linux/types.h>
0008 
0009 #include "shm_ipc_defs.h"
0010 
0011 /* bitmap for EP status and flags: updated by EP, read by RC */
0012 #define QTN_EP_HAS_UBOOT    BIT(0)
0013 #define QTN_EP_HAS_FIRMWARE BIT(1)
0014 #define QTN_EP_REQ_UBOOT    BIT(2)
0015 #define QTN_EP_REQ_FIRMWARE BIT(3)
0016 #define QTN_EP_ERROR_UBOOT  BIT(4)
0017 #define QTN_EP_ERROR_FIRMWARE   BIT(5)
0018 
0019 #define QTN_EP_FW_LOADRDY   BIT(8)
0020 #define QTN_EP_FW_SYNC      BIT(9)
0021 #define QTN_EP_FW_RETRY     BIT(10)
0022 #define QTN_EP_FW_QLINK_DONE    BIT(15)
0023 #define QTN_EP_FW_DONE      BIT(16)
0024 
0025 /* bitmap for RC status and flags: updated by RC, read by EP */
0026 #define QTN_RC_PCIE_LINK    BIT(0)
0027 #define QTN_RC_NET_LINK     BIT(1)
0028 #define QTN_RC_FW_FLASHBOOT BIT(5)
0029 #define QTN_RC_FW_QLINK     BIT(7)
0030 #define QTN_RC_FW_LOADRDY   BIT(8)
0031 #define QTN_RC_FW_SYNC      BIT(9)
0032 
0033 #define PCIE_HDP_INT_RX_BITS (0     \
0034     | PCIE_HDP_INT_EP_TXDMA     \
0035     | PCIE_HDP_INT_EP_TXEMPTY   \
0036     | PCIE_HDP_INT_HHBM_UF      \
0037     )
0038 
0039 #define PCIE_HDP_INT_TX_BITS (0     \
0040     | PCIE_HDP_INT_EP_RXDMA     \
0041     )
0042 
0043 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
0044 #define QTN_HOST_HI32(a)    ((u32)(((u64)a) >> 32))
0045 #define QTN_HOST_LO32(a)    ((u32)(((u64)a) & 0xffffffffUL))
0046 #define QTN_HOST_ADDR(h, l) ((((u64)h) << 32) | ((u64)l))
0047 #else
0048 #define QTN_HOST_HI32(a)    0
0049 #define QTN_HOST_LO32(a)    ((u32)(((u32)a) & 0xffffffffUL))
0050 #define QTN_HOST_ADDR(h, l) ((u32)l)
0051 #endif
0052 
0053 #define QTN_PCIE_BDA_VERSION        0x1002
0054 
0055 #define PCIE_BDA_NAMELEN        32
0056 #define PCIE_HHBM_MAX_SIZE      2048
0057 
0058 #define QTN_PCIE_BOARDFLG   "PCIEQTN"
0059 #define QTN_PCIE_FW_DLMASK  0xF
0060 #define QTN_PCIE_FW_BUFSZ   2048
0061 
0062 #define QTN_ENET_ADDR_LENGTH    6
0063 
0064 #define QTN_TXDONE_MASK     ((u32)0x80000000)
0065 #define QTN_GET_LEN(x)      ((x) & 0xFFFF)
0066 
0067 #define QTN_PCIE_TX_DESC_LEN_MASK   0xFFFF
0068 #define QTN_PCIE_TX_DESC_LEN_SHIFT  0
0069 #define QTN_PCIE_TX_DESC_PORT_MASK  0xF
0070 #define QTN_PCIE_TX_DESC_PORT_SHIFT 16
0071 #define QTN_PCIE_TX_DESC_TQE_BIT    BIT(24)
0072 
0073 #define QTN_EP_LHOST_TQE_PORT   4
0074 
0075 enum qtnf_fw_loadtype {
0076     QTN_FW_DBEGIN,
0077     QTN_FW_DSUB,
0078     QTN_FW_DEND,
0079     QTN_FW_CTRL
0080 };
0081 
0082 #endif /* _QTN_FMAC_PCIE_IPC_H_ */