From 9db58b1e5c031782c442f92775ee75326a7be1b3 Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Thu, 1 Mar 2018 18:57:14 +1100 Subject: npu2-hw-procedures: Add support for OpenCAPI PHY link training Unlike NVLink, which uses the pci-virt framework to fake a PCI configuration space for NVLink devices, the OpenCAPI device model presents us with a real configuration space handled by the device over the OpenCAPI link. As a result, we have to train the OpenCAPI link in skiboot before we do PCI probing, so that config space can be accessed, rather than having link training being triggered by the Linux driver. Add some helper functions to wrap the existing NVLink PHY training sequence so we can easily run it within skiboot. Additionally, we add OpenCAPI-specific lane settings, and a function to "bump" lanes that haven't trained properly (this process isn't documented in the workbook, but the hardware experts assure us that this improves link training reliability...) We also support the PRBS31 pattern that's used for bringup and test purposes. Signed-off-by: Andrew Donnellan Signed-off-by: Frederic Barrat Reviewed-by: Frederic Barrat Acked-by: Reza Arbab Signed-off-by: Stewart Smith --- include/npu2.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/npu2.h') diff --git a/include/npu2.h b/include/npu2.h index c836e6e..58edf70 100644 --- a/include/npu2.h +++ b/include/npu2.h @@ -201,10 +201,14 @@ int64_t npu2_dev_procedure(void *dev, struct pci_cfg_reg_filter *pcrf, uint32_t offset, uint32_t len, uint32_t *data, bool write); void npu2_dev_procedure_reset(struct npu2_dev *dev); + void npu2_set_link_flag(struct npu2_dev *ndev, uint8_t flag); void npu2_clear_link_flag(struct npu2_dev *ndev, uint8_t flag); uint32_t reset_ntl(struct npu2_dev *ndev); extern int nv_zcal_nominal; bool is_p9dd1(void); +void npu2_opencapi_phy_setup(struct npu2_dev *dev); +void npu2_opencapi_phy_prbs31(struct npu2_dev *dev); +void npu2_opencapi_bump_ui_lane(struct npu2_dev *dev); #endif /* __NPU2_H */ -- cgit v1.1