diff --git a/docs/components/ven-el3-service.rst b/docs/components/ven-el3-service.rst index fdafa58cd..10c4380f7 100644 --- a/docs/components/ven-el3-service.rst +++ b/docs/components/ven-el3-service.rst @@ -28,8 +28,8 @@ Vendor-specific EL3 monitor services are as follows: +-----------------------------------+ | | 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 89eeb2200..38841d9d9 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 3c7c29884..ac7f53a81 100644 --- a/lib/pmf/pmf_smc.c +++ b/lib/pmf/pmf_smc.c @@ -49,6 +49,10 @@ uintptr_t pmf_smc_handler(unsigned int smc_fid, 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 @@ uintptr_t pmf_smc_handler(unsigned int smc_fid, (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);