From 33233bcb7054595098dc6171ab9c4e5e2e661857 Mon Sep 17 00:00:00 2001 From: Athira Rajeev Date: Thu, 14 Sep 2023 22:02:05 +0530 Subject: hw/imc: Update IMC code to use dt_find_by_name_before_addr for checking dt nodes The nest IMC (In Memory Collection) Performance Monitoring Unit(PMU) node names are saved in nest_pmus[] array in the "hw/imc.c" IMC code. Not all the IMC PMUs listed in the device tree may be available. Nest IMC PMU names along with their bit values is represented in imc availability vector. The nest_pmus[] array is used to remove the unavailable nodes by checking this vector. To check node availability, code was using "dt_find_by_substr". But since the node names have format like: "name@offset", dt_find_by_name doesn't return the expected result. Fix this by using dt_find_by_name_before_addr. Also, update the char array to use correct node names. Signed-off-by: Athira Rajeev Signed-off-by: Reza Arbab --- hw/imc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/imc.c b/hw/imc.c index 97e0809..73f25da 100644 --- a/hw/imc.c +++ b/hw/imc.c @@ -67,14 +67,14 @@ static char const *nest_pmus[] = { "mba5", "mba6", "mba7", - "cen0", - "cen1", - "cen2", - "cen3", - "cen4", - "cen5", - "cen6", - "cen7", + "centaur0", + "centaur1", + "centaur2", + "centaur3", + "centaur4", + "centaur5", + "centaur6", + "centaur7", "xlink0", "xlink1", "xlink2", @@ -412,7 +412,7 @@ static void disable_unavailable_units(struct dt_node *dev) for (i = 0; i < ARRAY_SIZE(nest_pmus); i++) { if (!(PPC_BITMASK(i, i) & avl_vec)) { /* Check if the device node exists */ - target = dt_find_by_name(dev, nest_pmus[i]); + target = dt_find_by_name_before_addr(dev, nest_pmus[i]); if (!target) continue; /* Remove the device node */ -- cgit v1.1