aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ntb/hw/intel/ntb_hw_intel.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2018-01-29 15:22:24 -0500
committerJon Mason <jdmason@kudzu.us>2018-06-11 15:20:59 -0400
commitf6e51c354b60c177a4287f236d353b430d3dc6c1 (patch)
tree05ac8d016d9d9ccde66a105183d3e73a6b851bcf /drivers/ntb/hw/intel/ntb_hw_intel.h
parenta9065055ed09fe6e59e5bbfd12c8de629c53005d (diff)
ntb: intel: split out the gen3 code
Move the Intel hw gen3 code to its own source file. The ntb_hw_intel.c was getting too large and makes it hard to maintain with future hardware changes. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb/hw/intel/ntb_hw_intel.h')
-rw-r--r--drivers/ntb/hw/intel/ntb_hw_intel.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.h b/drivers/ntb/hw/intel/ntb_hw_intel.h
index bdfa302e0152..46d757c3850e 100644
--- a/drivers/ntb/hw/intel/ntb_hw_intel.h
+++ b/drivers/ntb/hw/intel/ntb_hw_intel.h
@@ -187,4 +187,64 @@ struct intel_ntb_dev {
187#define hb_ndev(__work) container_of(__work, struct intel_ntb_dev, \ 187#define hb_ndev(__work) container_of(__work, struct intel_ntb_dev, \
188 hb_timer.work) 188 hb_timer.work)
189 189
190static inline int pdev_is_xeon(struct pci_dev *pdev)
191{
192 switch (pdev->device) {
193 case PCI_DEVICE_ID_INTEL_NTB_SS_JSF:
194 case PCI_DEVICE_ID_INTEL_NTB_SS_SNB:
195 case PCI_DEVICE_ID_INTEL_NTB_SS_IVT:
196 case PCI_DEVICE_ID_INTEL_NTB_SS_HSX:
197 case PCI_DEVICE_ID_INTEL_NTB_SS_BDX:
198 case PCI_DEVICE_ID_INTEL_NTB_PS_JSF:
199 case PCI_DEVICE_ID_INTEL_NTB_PS_SNB:
200 case PCI_DEVICE_ID_INTEL_NTB_PS_IVT:
201 case PCI_DEVICE_ID_INTEL_NTB_PS_HSX:
202 case PCI_DEVICE_ID_INTEL_NTB_PS_BDX:
203 case PCI_DEVICE_ID_INTEL_NTB_B2B_JSF:
204 case PCI_DEVICE_ID_INTEL_NTB_B2B_SNB:
205 case PCI_DEVICE_ID_INTEL_NTB_B2B_IVT:
206 case PCI_DEVICE_ID_INTEL_NTB_B2B_HSX:
207 case PCI_DEVICE_ID_INTEL_NTB_B2B_BDX:
208 return 1;
209 }
210 return 0;
211}
212
213static inline int pdev_is_skx_xeon(struct pci_dev *pdev)
214{
215 if (pdev->device == PCI_DEVICE_ID_INTEL_NTB_B2B_SKX)
216 return 1;
217
218 return 0;
219}
220
221#ifndef ioread64
222#ifdef readq
223#define ioread64 readq
224#else
225#define ioread64 _ioread64
226static inline u64 _ioread64(void __iomem *mmio)
227{
228 u64 low, high;
229
230 low = ioread32(mmio);
231 high = ioread32(mmio + sizeof(u32));
232 return low | (high << 32);
233}
234#endif
235#endif
236
237#ifndef iowrite64
238#ifdef writeq
239#define iowrite64 writeq
240#else
241#define iowrite64 _iowrite64
242static inline void _iowrite64(u64 val, void __iomem *mmio)
243{
244 iowrite32(val, mmio);
245 iowrite32(val >> 32, mmio + sizeof(u32));
246}
247#endif
248#endif
249
190#endif 250#endif