aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/npu.c8
-rw-r--r--platforms/astbmc/garrison.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/hw/npu.c b/hw/npu.c
index a3898b1..a61dd20 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -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;
diff --git a/platforms/astbmc/garrison.c b/platforms/astbmc/garrison.c
index 57e41d7..bf4bb69 100644
--- a/platforms/astbmc/garrison.c
+++ b/platforms/astbmc/garrison.c
@@ -65,6 +65,10 @@ static void dt_create_npu(void)
npu = dt_new(xscom, namebuf);
dt_add_property_cells(npu, "reg", NPU_BASE, NPU_SIZE);
dt_add_property_strings(npu, "compatible", "ibm,power8-npu");
+
+ /* Use the first available PHB index which is 4 given
+ * there are three normal PHBs. */
+ dt_add_property_cells(npu, "ibm,phb-index", 4);
dt_add_property_cells(npu, "ibm,npu-index", 0);
dt_add_property_cells(npu, "ibm,npu-links", 4);