0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 #ifndef _NTB_INTEL_GEN3_H_
0045 #define _NTB_INTEL_GEN3_H_
0046
0047 #include "ntb_hw_intel.h"
0048
0049
0050 #define GEN3_IMBAR1SZ_OFFSET 0x00d0
0051 #define GEN3_IMBAR2SZ_OFFSET 0x00d1
0052 #define GEN3_EMBAR1SZ_OFFSET 0x00d2
0053 #define GEN3_EMBAR2SZ_OFFSET 0x00d3
0054 #define GEN3_DEVCTRL_OFFSET 0x0098
0055 #define GEN3_DEVSTS_OFFSET 0x009a
0056 #define GEN3_UNCERRSTS_OFFSET 0x014c
0057 #define GEN3_CORERRSTS_OFFSET 0x0158
0058 #define GEN3_LINK_STATUS_OFFSET 0x01a2
0059
0060 #define GEN3_NTBCNTL_OFFSET 0x0000
0061 #define GEN3_IMBAR1XBASE_OFFSET 0x0010
0062 #define GEN3_IMBAR1XLMT_OFFSET 0x0018
0063 #define GEN3_IMBAR2XBASE_OFFSET 0x0020
0064 #define GEN3_IMBAR2XLMT_OFFSET 0x0028
0065 #define GEN3_IM_INT_STATUS_OFFSET 0x0040
0066 #define GEN3_IM_INT_DISABLE_OFFSET 0x0048
0067 #define GEN3_IM_SPAD_OFFSET 0x0080
0068 #define GEN3_USMEMMISS_OFFSET 0x0070
0069 #define GEN3_INTVEC_OFFSET 0x00d0
0070 #define GEN3_IM_DOORBELL_OFFSET 0x0100
0071 #define GEN3_B2B_SPAD_OFFSET 0x0180
0072 #define GEN3_EMBAR0XBASE_OFFSET 0x4008
0073 #define GEN3_EMBAR1XBASE_OFFSET 0x4010
0074 #define GEN3_EMBAR1XLMT_OFFSET 0x4018
0075 #define GEN3_EMBAR2XBASE_OFFSET 0x4020
0076 #define GEN3_EMBAR2XLMT_OFFSET 0x4028
0077 #define GEN3_EM_INT_STATUS_OFFSET 0x4040
0078 #define GEN3_EM_INT_DISABLE_OFFSET 0x4048
0079 #define GEN3_EM_SPAD_OFFSET 0x4080
0080 #define GEN3_EM_DOORBELL_OFFSET 0x4100
0081 #define GEN3_SPCICMD_OFFSET 0x4504
0082 #define GEN3_EMBAR0_OFFSET 0x4510
0083 #define GEN3_EMBAR1_OFFSET 0x4518
0084 #define GEN3_EMBAR2_OFFSET 0x4520
0085
0086 #define GEN3_DB_COUNT 32
0087 #define GEN3_DB_LINK 32
0088 #define GEN3_DB_LINK_BIT BIT_ULL(GEN3_DB_LINK)
0089 #define GEN3_DB_MSIX_VECTOR_COUNT 33
0090 #define GEN3_DB_MSIX_VECTOR_SHIFT 1
0091 #define GEN3_DB_TOTAL_SHIFT 33
0092 #define GEN3_SPAD_COUNT 16
0093
0094 static inline u64 gen3_db_ioread(const void __iomem *mmio)
0095 {
0096 return ioread64(mmio);
0097 }
0098
0099 static inline void gen3_db_iowrite(u64 bits, void __iomem *mmio)
0100 {
0101 iowrite64(bits, mmio);
0102 }
0103
0104 ssize_t ndev_ntb3_debugfs_read(struct file *filp, char __user *ubuf,
0105 size_t count, loff_t *offp);
0106 int gen3_init_dev(struct intel_ntb_dev *ndev);
0107 int intel_ntb3_link_enable(struct ntb_dev *ntb, enum ntb_speed max_speed,
0108 enum ntb_width max_width);
0109 u64 intel_ntb3_db_read(struct ntb_dev *ntb);
0110 int intel_ntb3_db_clear(struct ntb_dev *ntb, u64 db_bits);
0111 int intel_ntb3_peer_db_set(struct ntb_dev *ntb, u64 db_bits);
0112 int intel_ntb3_peer_db_addr(struct ntb_dev *ntb, phys_addr_t *db_addr,
0113 resource_size_t *db_size,
0114 u64 *db_data, int db_bit);
0115
0116 extern const struct ntb_dev_ops intel_ntb3_ops;
0117
0118 #endif