diff options
author | Manish V Badarkhe <Manish.Badarkhe@arm.com> | 2020-02-22 08:43:00 +0000 |
---|---|---|
committer | Manish V Badarkhe <Manish.Badarkhe@arm.com> | 2020-03-17 10:14:35 +0000 |
commit | 0e753437e75b68476b524d32c7e9db7f28d2ad85 (patch) | |
tree | 5fb7659f153f6305f355b7abc702abdf7160ee85 /services | |
parent | bb37363bd30f5ccc625f47350d3ae56ddcddb236 (diff) | |
download | trusted-firmware-a-0e753437e75b68476b524d32c7e9db7f28d2ad85.tar.gz |
Implement SMCCC_ARCH_SOC_ID SMC call
Implemented SMCCC_ARCH_SOC_ID call in order to get below
SOC information:
1. SOC revision
2. SOC version
Implementation done using below SMCCC specification document:
https://developer.arm.com/docs/den0028/c
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ie0595f1c345a6429a6fb4a7f05534a0ca9c9a48b
Diffstat (limited to 'services')
-rw-r--r-- | services/arm_arch_svc/arm_arch_svc_setup.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/services/arm_arch_svc/arm_arch_svc_setup.c b/services/arm_arch_svc/arm_arch_svc_setup.c index 6dac56ec81..ba539309de 100644 --- a/services/arm_arch_svc/arm_arch_svc_setup.c +++ b/services/arm_arch_svc/arm_arch_svc_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -12,18 +12,27 @@ #include <lib/smccc.h> #include <services/arm_arch_svc.h> #include <smccc_helpers.h> +#include <plat/common/platform.h> static int32_t smccc_version(void) { return MAKE_SMCCC_VERSION(SMCCC_MAJOR_VERSION, SMCCC_MINOR_VERSION); } -static int32_t smccc_arch_features(u_register_t arg) +static int32_t smccc_arch_features(u_register_t arg1, u_register_t arg2) { - switch (arg) { + switch (arg1) { case SMCCC_VERSION: case SMCCC_ARCH_FEATURES: return SMC_OK; + case SMCCC_ARCH_SOC_ID: + if (arg2 == SMCCC_GET_SOC_REVISION) { + return plat_get_soc_revision(); + } + if (arg2 == SMCCC_GET_SOC_VERSION) { + return plat_get_soc_version(); + } + return SMC_ARCH_CALL_INVAL_PARAM; #if WORKAROUND_CVE_2017_5715 case SMCCC_ARCH_WORKAROUND_1: if (check_wa_cve_2017_5715() == ERRATA_NOT_APPLIES) @@ -94,7 +103,7 @@ static uintptr_t arm_arch_svc_smc_handler(uint32_t smc_fid, case SMCCC_VERSION: SMC_RET1(handle, smccc_version()); case SMCCC_ARCH_FEATURES: - SMC_RET1(handle, smccc_arch_features(x1)); + SMC_RET1(handle, smccc_arch_features(x1, x2)); #if WORKAROUND_CVE_2017_5715 case SMCCC_ARCH_WORKAROUND_1: /* |