From 57d43efd6bbb052b467df3a19ca84feccdd0649b Mon Sep 17 00:00:00 2001 From: Frederic Barrat Date: Wed, 22 Jan 2020 16:03:34 +0100 Subject: npu3: Don't use the device tree to assign the phb-index of the PHB On Axone, there's a 1-to-1 mapping between virtual PHBs and NPUs. We could keep assigning the phb-index of the virtual PHB from the value found in the npu node of the device tree, but to be consistent with P9/npu2 and avoid confusion, this patch assigns the phb-index when the virtual PHB is created, based on the npu index, similarly to what we do on P9. Reviewed-by: Reza Arbab Reviewed-by: Andrew Donnellan Signed-off-by: Frederic Barrat Signed-off-by: Oliver O'Halloran --- include/npu3.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/npu3.h b/include/npu3.h index 1c657f9..0fdad4d 100644 --- a/include/npu3.h +++ b/include/npu3.h @@ -177,4 +177,10 @@ int64_t npu3_map_lpar(struct phb *phb, uint64_t bdf, uint64_t lparid, int64_t npu3_set_relaxed_order(struct phb *phb, uint32_t gcid, int pec, bool enable); +#define NPU3_PHB_INDEX_BASE 6 /* immediately after real PHBs */ +static inline int npu3_get_phb_index(unsigned int npu_index) +{ + return NPU3_PHB_INDEX_BASE + npu_index; +} + #endif /* __NPU3_H */ -- cgit v1.1