| 138 | } |
| 139 | |
| 140 | static int |
| 141 | intel_ntb4_check_ppd(struct ntb_hw *hw) |
| 142 | { |
| 143 | uint8_t revision_id; |
| 144 | uint32_t reg_val; |
| 145 | int ret; |
| 146 | |
| 147 | ret = rte_pci_read_config(hw->pci_dev, &revision_id, |
| 148 | NTB_PCI_DEV_REVISION_ID_LEN, |
| 149 | NTB_PCI_DEV_REVISION_ID_REG); |
| 150 | if (ret != NTB_PCI_DEV_REVISION_ID_LEN) { |
| 151 | NTB_LOG(ERR, "Cannot get NTB PCI Device Revision ID."); |
| 152 | return -EIO; |
| 153 | } |
| 154 | |
| 155 | reg_val = rte_read32(hw->hw_addr + XEON_GEN4_PPD1_OFFSET); |
| 156 | |
| 157 | /* Distinguish HW platform (ICX/SPR) via PCI Revision ID */ |
| 158 | if (revision_id > NTB_PCI_DEV_REVISION_ICX_MAX) |
| 159 | ret = intel_ntb4_check_ppd_for_SPR(hw, reg_val); |
| 160 | else if (revision_id >= NTB_PCI_DEV_REVISION_ICX_MIN) |
| 161 | ret = intel_ntb4_check_ppd_for_ICX(hw, reg_val); |
| 162 | else { |
| 163 | NTB_LOG(ERR, "Invalid NTB PCI Device Revision ID."); |
| 164 | return -EIO; |
| 165 | } |
| 166 | |
| 167 | return ret; |
| 168 | } |
| 169 | |
| 170 | static int |
| 171 | intel_ntb_dev_init(const struct rte_rawdev *dev) |
no test coverage detected