[Skiboot] [RESEND PATCH v1 10/11]ibm-fsp/firenze: Add OPAL call to enable/disable Nest pmu

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Mon Jul 6 02:55:32 AEST 2015


Patch adds a new OPAL call to start and stop PORE Thread Scheduler(PTS)
for Nest PMU Counter collection.

Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
---
 hw/nest.c          | 15 +++++++++++++++
 include/opal-api.h |  3 ++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/hw/nest.c b/hw/nest.c
index fc83589..4ff9302 100644
--- a/hw/nest.c
+++ b/hw/nest.c
@@ -434,3 +434,18 @@ void nest_ima_init(void)
 
 	return;
 }
+
+static int64_t opal_nest_ima_control(uint32_t value)
+{
+	struct proc_chip *chip;
+	int rc = IMA_PTS_ERROR;
+
+	chip = get_chip(pir_to_chip_id(this_cpu()->pir));
+	if (value)
+		rc = xscom_write(chip->id, IMA_PTS_SCOM, IMA_PTS_ENABLE);
+	else
+		rc = xscom_write(chip->id, IMA_PTS_SCOM, IMA_PTS_DISABLE);
+
+	return rc;
+}
+opal_call (OPAL_NEST_IMA_CONTROL, opal_nest_ima_control, 1);
diff --git a/include/opal-api.h b/include/opal-api.h
index d58c8bf..4f6eda7 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -161,7 +161,8 @@
 #define OPAL_PRD_MSG				113
 #define OPAL_LEDS_GET_INDICATOR			114
 #define OPAL_LEDS_SET_INDICATOR			115
-#define OPAL_LAST				115
+#define OPAL_NEST_IMA_CONTROL			116
+#define OPAL_LAST				116
 
 /* Device tree flags */
 
-- 
1.9.3



More information about the Skiboot mailing list