diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2016-08-11 12:12:38 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-09-02 15:31:42 +1000 |
commit | 0736df56df7c457f4cdfe3e4ad85180877d00569 (patch) | |
tree | be82e089a1bb23d738e3e345bf75566bc85a4aca /include | |
parent | 85daa7f00c5001593f28eb0e975b94921f3cd023 (diff) | |
download | skiboot-0736df56df7c457f4cdfe3e4ad85180877d00569.zip skiboot-0736df56df7c457f4cdfe3e4ad85180877d00569.tar.gz skiboot-0736df56df7c457f4cdfe3e4ad85180877d00569.tar.bz2 |
hw/npu: Use PCI virtual device
This rmoves the codes for emulated PCI config space as it can be
supported by generic PCI virtual device:
* The PCI virtual device and NPU device are created at same time.
* Uses PCI virtual device and filter to access NPU (PCI) device's
config space.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/npu.h | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/include/npu.h b/include/npu.h index d92d3ed..0768155 100644 --- a/include/npu.h +++ b/include/npu.h @@ -113,20 +113,14 @@ struct npu_dev { struct npu_dev_bar bar; struct phb *phb; - /* Device and function numbers are allocated based on GPU - * association */ - uint32_t bdfn; - /* The link@x node */ struct dt_node *dt_node; - /* The GPU PCI device this NPU device is associated with */ + /* PCI virtual device and the associated GPU device */ + struct pci_virt_device *pvd; struct pci_device *pd; - struct npu *npu; - uint8_t *config[NPU_DEV_CFG_MAX]; struct list_head capabilities; - struct list_head traps; /* Which PHY lanes this device is associated with */ uint16_t lane_mask; @@ -194,15 +188,9 @@ static inline void npu_ioda_sel(struct npu *p, uint32_t table, void npu_scom_init(struct npu_dev *dev); -int64_t npu_dev_procedure_read(struct npu_dev_trap *trap, - uint32_t offset, - uint32_t size, - uint32_t *data); - -int64_t npu_dev_procedure_write(struct npu_dev_trap *trap, - uint32_t offset, - uint32_t size, - uint32_t data); +int64_t npu_dev_procedure(void *dev, struct pci_cfg_reg_filter *pcrf, + uint32_t offset, uint32_t len, uint32_t *data, + bool write); void npu_set_fence_state(struct npu *p, bool fence); |