diff mbox

[v2,04/11] Device-Tree(DT) entry for DIMM rate

Message ID 1437460731-32342-5-git-send-email-maddy@linux.vnet.ibm.com
State Superseded
Headers show

Commit Message

maddy July 21, 2015, 6:38 a.m. UTC
Patch creates a DT entry to pass the information about the DIMM
rate to kernel. This is needed to calculate % memory bandwidth
utilisation metrics.

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
 hw/nest.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox

Patch

diff --git a/hw/nest.c b/hw/nest.c
index 1091983514b9..e3b0a4ffca75 100644
--- a/hw/nest.c
+++ b/hw/nest.c
@@ -163,5 +163,24 @@  void nest_pmu_init(int loaded)
 		dt_add_property(chip_dev, "ibm,ima-chip", NULL, 0);
 	}
 
+	/*
+	 * Dimm rate DT Entry. Needed for % utilisation calculation.
+	 */
+	chip = get_chip(this_cpu()->chip_id);
+	switch (chip->type) {
+	case PROC_CHIP_P8_MURANO:
+		dt_add_property_cells(dev,"dimm", MURANO_CENTAUR_DIMM);
+		break;
+	case PROC_CHIP_P8_VENICE:
+		dt_add_property_cells(dev,"dimm", VENICE_CENTAUR_DIMM);
+		break;
+	case PROC_CHIP_P8_NAPLES:
+		dt_add_property_cells(dev,"dimm", VENICE_CENTAUR_DIMM);
+		break;
+	default:
+		prlog(PR_DEBUG,"Nest_IMA: Unknown chip type,skipping dimm file\n");
+		break;
+	}
+
 	return;
 }