diff options
author | Alistair Popple <alistair@popple.id.au> | 2016-04-22 13:35:25 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-04-27 08:01:17 +1000 |
commit | c814ef51febb2c3a65086c09f8cee8c3c5e16a51 (patch) | |
tree | d8a0e1b7400e14d49f75adfaffd2b8ffdd5c7fdb /hw | |
parent | d729ddbfd8cb7b5dc60f336bf7208214c96a3233 (diff) | |
download | skiboot-c814ef51febb2c3a65086c09f8cee8c3c5e16a51.zip skiboot-c814ef51febb2c3a65086c09f8cee8c3c5e16a51.tar.gz skiboot-c814ef51febb2c3a65086c09f8cee8c3c5e16a51.tar.bz2 |
hw/npu.c: Add ibm, npu-index property to npu device tree
The PHB slot location code ueses the ibm,phb-index property to find
slot location names. As the NPU is implemented as a different PHB type
it means the phb-index property overlaps with the other PHBs in the
system.
This patch changes the existing usage of phb-index to npu-index which
allows the phb-index property to be assigned a unique value which can
then be matched by the PHB slot location code.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/npu.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1235,7 +1235,7 @@ static void assign_mmio_bars(uint32_t gcid, uint32_t xscom, static void npu_probe_phb(struct dt_node *dn) { struct dt_node *np; - uint32_t gcid, index, xscom; + uint32_t gcid, index, phb_index, xscom; uint64_t at_bar[2], mm_win[2], val; uint32_t links = 0; char *path; @@ -1244,6 +1244,7 @@ static void npu_probe_phb(struct dt_node *dn) path = dt_get_path(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++; @@ -1283,7 +1284,8 @@ static void npu_probe_phb(struct dt_node *dn) dt_add_property_strings(np, "device_type", "pciex"); dt_add_property(np, "reg", at_bar, sizeof(at_bar)); - dt_add_property_cells(np, "ibm,phb-index", index); + dt_add_property_cells(np, "ibm,phb-index", phb_index); + dt_add_property_cells(np, "ibm,npu-index", index); dt_add_property_cells(np, "ibm,chip-id", gcid); dt_add_property_cells(np, "ibm,xscom-base", xscom); dt_add_property_cells(np, "ibm,npcq", dn->phandle); @@ -1764,7 +1766,7 @@ static void npu_create_phb(struct dt_node *dn) /* Populate PHB */ p = pmem; - p->index = dt_prop_get_u32(dn, "ibm,phb-index"); + p->index = dt_prop_get_u32(dn, "ibm,npu-index"); p->chip_id = dt_prop_get_u32(dn, "ibm,chip-id"); p->xscom_base = dt_prop_get_u32(dn, "ibm,xscom-base"); p->total_devices = links; |