raw/ntb: add PPD status check for Sapphire Rapids
authorJunfeng Guo <junfeng.guo@intel.com>
Thu, 30 Jun 2022 08:56:16 +0000 (08:56 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 5 Jul 2022 19:55:24 +0000 (21:55 +0200)
commit834d99f388ca99507b124d1fb49059c265dfa18e
treec70f469c627bc625b6e1d0c7127d95ee97fcb7fb
parentb29427649b6d51b3b49187cbaeaa6587ce80ce72
raw/ntb: add PPD status check for Sapphire Rapids

Add PPD (PCIe Port Definition) status check for SPR (Sapphire Rapids).

Note that NTB on SPR has the same device id with that on ICX, while
the field offsets of PPD Control Register are different. Here, we use
the PCI device revision id to distinguish the HW platform (ICX/SPR)
and check the Port Config Status and Port Definition accordingly.

+---------------------------+--------------------+--------------------+
|          Fields           | Bit Range (on ICX) | Bit Range (on SPR) |
+---------------------------+--------------------+--------------------+
| Port Configuration Status | 12                 | 14                 |
| Port Definition           | 9:8                | 10:8               |
+---------------------------+--------------------+--------------------+

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
drivers/raw/ntb/ntb.h
drivers/raw/ntb/ntb_hw_intel.c
drivers/raw/ntb/ntb_hw_intel.h