summaryrefslogtreecommitdiffstats
path: root/include/npu2.h
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2018-09-14 13:46:24 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-09-17 21:39:01 -0500
commit68415d5e38ef04e647ad36d59f90c008a0414f56 (patch)
treed8834d1d88bd4eb4b33bf4dd310d454edb289f1c /include/npu2.h
parent7ecb29651c311e35e30fbbebc675cae3e97c8d53 (diff)
downloadblackbird-skiboot-68415d5e38ef04e647ad36d59f90c008a0414f56.tar.gz
blackbird-skiboot-68415d5e38ef04e647ad36d59f90c008a0414f56.zip
hw/npu2: Common NPU2 init routine between NVLink and OpenCAPI
Replace probe_npu2() and probe_npu2_opencapi() with a new shared probe_npu2(). Refactor some of the common NPU setup code into shared code. No functional change. This patch does not implement support for using both types of devices simultaneously on the same NPU - we expect to add this sometime in the future. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'include/npu2.h')
-rw-r--r--include/npu2.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/npu2.h b/include/npu2.h
index 10742031..0e07d77b 100644
--- a/include/npu2.h
+++ b/include/npu2.h
@@ -167,6 +167,7 @@ struct npu2 {
/* NVLink */
struct phb phb_nvlink;
+ uint32_t phb_index;
};
static inline struct npu2 *phb_to_npu2_nvlink(struct phb *phb)
@@ -193,6 +194,10 @@ static inline struct phb *npu2_dev_to_phb(struct npu2_dev *ndev)
}
}
+int npu2_opencapi_init_npu(struct npu2 *npu);
+int npu2_nvlink_init_npu(struct npu2 *npu);
+void npu2_nvlink_create_phb(struct npu2 *npu, struct dt_node *dn);
+
enum npu2_dev_type npu2_dt_link_dev_type(struct dt_node *link);
void npu2_write_4b(struct npu2 *p, uint64_t reg, uint32_t val);
uint32_t npu2_read_4b(struct npu2 *p, uint64_t reg);
OpenPOWER on IntegriCloud