feat((smccc): add version FID for PMF
Introduce a version FID for PMF.
Change-Id: I6b0a7f54aefc2839704e03c5da2243d7c85f8a49
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
diff --git a/docs/components/ven-el3-service.rst b/docs/components/ven-el3-service.rst
index fdafa58..10c4380 100644
--- a/docs/components/ven-el3-service.rst
+++ b/docs/components/ven-el3-service.rst
@@ -28,8 +28,8 @@
+-----------------------------------+ | | 12 - 15 are reserved for future expansion.|
| 0xC7000010 - 0xC700001F (SMC64) | | |
+-----------------------------------+-----------------------+---------------------------------------------+
-| 0x87000020 - 0x8700002F (SMC32) | Performance | | 0 is in use. |
-+-----------------------------------+ Measurement Framework | | 1 - 15 are reserved for future expansion. |
+| 0x87000020 - 0x8700002F (SMC32) | Performance | | 0,1 is in use. |
++-----------------------------------+ Measurement Framework | | 2 - 15 are reserved for future expansion. |
| 0xC7000020 - 0xC700002F (SMC64) | (PMF) | |
+-----------------------------------+-----------------------+---------------------------------------------+
diff --git a/include/lib/pmf/pmf.h b/include/lib/pmf/pmf.h
index 89eeb22..38841d9 100644
--- a/include/lib/pmf/pmf.h
+++ b/include/lib/pmf/pmf.h
@@ -54,6 +54,11 @@
#define PMF_SMC_GET_TIMESTAMP_64 U(0xC7000020)
#define PMF_NUM_SMC_CALLS 2
+#define PMF_SMC_GET_VERSION_32 U(0x87000021)
+#define PMF_SMC_GET_VERSION_64 U(0xC7000021)
+
+#define PMF_SMC_VERSION U(0x00000001)
+
/*
* The macros below are used to identify
* PMF calls from the SMC function ID.
diff --git a/lib/pmf/pmf_smc.c b/lib/pmf/pmf_smc.c
index 3c7c298..ac7f53a 100644
--- a/lib/pmf/pmf_smc.c
+++ b/lib/pmf/pmf_smc.c
@@ -49,6 +49,10 @@
SMC_RET3(handle, rc, (uint32_t)ts_value,
(uint32_t)(ts_value >> 32));
}
+
+ if (smc_fid == PMF_SMC_GET_VERSION_32) {
+ SMC_RET2(handle, SMC_OK, PMF_SMC_VERSION);
+ }
} else {
if (smc_fid == PMF_SMC_GET_TIMESTAMP_64 ||
smc_fid == PMF_SMC_GET_TIMESTAMP_64_DEP) {
@@ -62,6 +66,10 @@
(unsigned int)x3, &ts_value);
SMC_RET2(handle, rc, ts_value);
}
+
+ if (smc_fid == PMF_SMC_GET_VERSION_64) {
+ SMC_RET2(handle, SMC_OK, PMF_SMC_VERSION);
+ }
}
WARN("Unimplemented PMF Call: 0x%x \n", smc_fid);