From fd16aff64d9ad822c3b2d30248c1ea0dcd3159f4 Mon Sep 17 00:00:00 2001 From: Alistair Popple Date: Fri, 5 May 2017 17:37:15 +1000 Subject: npu2: Do not attempt to initialise non DD1 hardware There are significant changes to hardware register addresses and meanings on newer chip revisions making them unlikely to work correctly with the existing code. Better to fail clearly and early. Suggested-by: Michael Neuling Signed-off-by: Alistair Popple Signed-off-by: Stewart Smith --- hw/npu2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/npu2.c b/hw/npu2.c index 6498198..dc1a238 100644 --- a/hw/npu2.c +++ b/hw/npu2.c @@ -1183,6 +1183,7 @@ static void assign_mmio_bars(uint64_t gcid, uint32_t scom, uint64_t reg[2], uint */ static void npu2_probe_phb(struct dt_node *dn) { + struct proc_chip *proc_chip; struct dt_node *np; uint32_t gcid, scom, index, phb_index, links; uint64_t reg[2], mm_win[2]; @@ -1191,6 +1192,12 @@ static void npu2_probe_phb(struct dt_node *dn) /* Retrieve chip id */ path = dt_get_path(dn); gcid = dt_get_chip_id(dn); + assert(proc_chip = get_chip(gcid)); + if ((proc_chip->ec_level & 0xf0) != 0x10) { + prerror("NPU2: unsupported ec level on Chip 0x%x!\n", gcid); + return; + } + index = dt_prop_get_u32(dn, "ibm,npu-index"); phb_index = dt_prop_get_u32(dn, "ibm,phb-index"); links = dt_prop_get_u32(dn, "ibm,npu-links"); -- cgit v1.1