aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2016-07-06 13:20:01 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-20 18:16:11 +1000
commit9363dca0f4ad0a3f88271e4d6ac33d3de9948d2f (patch)
treeba0433c95d1f6e09e9e4ce066ac0c39459721e49 /hw
parent62bf371705955b4e32da9f3d18897333a0a34869 (diff)
downloadskiboot-9363dca0f4ad0a3f88271e4d6ac33d3de9948d2f.zip
skiboot-9363dca0f4ad0a3f88271e4d6ac33d3de9948d2f.tar.gz
skiboot-9363dca0f4ad0a3f88271e4d6ac33d3de9948d2f.tar.bz2
hw/npu: Get number of links from NPU node property
The NPU device node property "ibm,npu-links" indicates number of NPU links supported. This retrieves the number of links from the properties instead of counting its child device nodes. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/npu.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/npu.c b/hw/npu.c
index aa2194a..5301bc1 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -1277,7 +1277,7 @@ static void npu_probe_phb(struct dt_node *dn)
struct dt_node *np;
uint32_t gcid, index, phb_index, xscom;
uint64_t at_bar[2], mm_win[2], val;
- uint32_t links = 0;
+ uint32_t links;
char *path;
/* Retrieve chip id */
@@ -1285,9 +1285,7 @@ static void npu_probe_phb(struct dt_node *dn)
gcid = dt_get_chip_id(dn);
index = dt_prop_get_u32(dn, "ibm,npu-index");
phb_index = dt_prop_get_u32(dn, "ibm,phb-index");
- dt_for_each_compatible(dn, np, "ibm,npu-link")
- links++;
-
+ links = dt_prop_get_u32(dn, "ibm,npu-links");
prlog(PR_INFO, "Chip %d Found NPU%d (%d links) at %s\n",
gcid, index, links, path);
free(path);