new file mode 100644
@@ -0,0 +1,26 @@
+OPAL_NEST_IMA_CONTROL
+----------------------
+
+This OPAL call allows the host OS to start or stop the PORE SLW IMA engine for
+Nest instrumentation. List of supported Nest PMU units and their events are
+part of Hardware meta-data file called "Catalogue". Engine programs these
+pre-defined events to the Nest PMU and periodically captures the data from the
+Nest counter and moves the data to a specific memory (which is part of
+HOMER region). HOMER Region has a reserved offset for PORE SLW IMA Engine to
+dump the Nest Counter data. Host OS should map this region to get the counter
+data.
+
+OPAL_NEST_IMA_CONTROL call accepts two parameters:
+
+ Mode (uint64_t):
+ Currently only production mode is supported by the PORE SLW IMA
+ Engine. "SLW_IMA_MODE_PRODUCTION" macro defined in "nest.h"
+ used for this.
+
+ Value (uint64_6):
+ Value to start and stop the engine.
+ 0x0 -- Stop
+ 0x1 -- Start
+
+OPAL_NEST_IMA_CONTROL will return:
+ OPAL_SUCCESS on success and IMA_PTS_ERROR on failure.
@@ -426,3 +426,25 @@ void nest_pmu_init(int loaded)
return;
}
+
+static int64_t opal_nest_ima_control(uint64_t mode, uint64_t value)
+{
+ struct proc_chip *chip;
+
+ chip = get_chip(this_cpu()->chip_id);
+ if (mode == SLW_IMA_MODE_PRODUCTION) {
+ if (value)
+ xscom_write(chip->id, IMA_PTS_SCOM, IMA_PTS_ENABLE);
+ else
+ xscom_write(chip->id, IMA_PTS_SCOM, IMA_PTS_DISABLE);
+ } else {
+ /* Unknown/Unsupported SLW IMA mode */
+ goto fail;
+ }
+
+ return OPAL_SUCCESS;
+
+fail:
+ return IMA_PTS_ERROR;
+}
+opal_call (OPAL_NEST_IMA_CONTROL, opal_nest_ima_control, 2);
@@ -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 */
Patch adds a new OPAL call to start and stop PORE Thread Scheduler(PTS) for Nest PMU Counter collection. Also creates a opal-api doc for this call. Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> --- doc/opal-api/opal-nest-ima.txt | 26 ++++++++++++++++++++++++++ hw/nest.c | 22 ++++++++++++++++++++++ include/opal-api.h | 3 ++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 doc/opal-api/opal-nest-ima.txt