[Skiboot] [PATCH 1/2] npu2: Add npu2_clear_link_flag()
Reza Arbab
arbab at linux.vnet.ibm.com
Thu Aug 10 04:29:36 AEST 2017
Add a complement to npu2_set_link_flag().
Signed-off-by: Reza Arbab <arbab at linux.vnet.ibm.com>
---
hw/npu2.c | 7 +++++++
include/npu2.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/hw/npu2.c b/hw/npu2.c
index 74e3325..807c78d 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -147,6 +147,13 @@ void npu2_set_link_flag(struct npu2_dev *ndev, uint8_t flag)
VENDOR_CAP_PCI_DEV_OFFSET, 1, ndev->link_flags);
}
+void npu2_clear_link_flag(struct npu2_dev *ndev, uint8_t flag)
+{
+ ndev->link_flags &= ~flag;
+ PCI_VIRT_CFG_INIT_RO(ndev->pvd, VENDOR_CAP_START +
+ VENDOR_CAP_PCI_DEV_OFFSET, 1, ndev->link_flags);
+}
+
static inline void npu2_ioda_sel(struct npu2 *p, uint32_t table,
uint32_t index, bool autoinc)
{
diff --git a/include/npu2.h b/include/npu2.h
index 544e98e..ef05f46 100644
--- a/include/npu2.h
+++ b/include/npu2.h
@@ -156,5 +156,6 @@ 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_set_link_flag(struct npu2_dev *ndev, uint8_t flag);
+void npu2_clear_link_flag(struct npu2_dev *ndev, uint8_t flag);
extern int nv_zcal_nominal;
#endif /* __NPU2_H */
--
1.8.3.1
More information about the Skiboot
mailing list