summaryrefslogtreecommitdiff
path: root/plat/xilinx
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@amd.com>2023-02-20 12:53:31 +0100
committerMichal Simek <michal.simek@amd.com>2023-02-20 13:06:34 +0100
commitacbae3998bd829ae4b31ea9da59055e3624991a5 (patch)
treee002a1ed9cf2c8a3c13597981ce623a1e383023c /plat/xilinx
parente6af3c715463f10303a5f1f6bd3117feed269b9a (diff)
downloadarm-trusted-firmware-acbae3998bd829ae4b31ea9da59055e3624991a5.tar.gz
fix(zynqmp): move EM SMC range to SIP range
EM SMC where out of SIP range which is 15:0 bits only. EM was used 19:17 bits which is wrong but no code was checking it. That's why vove EM SMC to SIP range. Change-Id: I83f998a17a8b82b2c25ea8c9b247e42642c82178 Signed-off-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'plat/xilinx')
-rw-r--r--plat/xilinx/zynqmp/pm_service/pm_defs.h2
-rw-r--r--plat/xilinx/zynqmp/sip_svc_setup.c15
2 files changed, 9 insertions, 8 deletions
diff --git a/plat/xilinx/zynqmp/pm_service/pm_defs.h b/plat/xilinx/zynqmp/pm_service/pm_defs.h
index 2fc713103..f0a8d0389 100644
--- a/plat/xilinx/zynqmp/pm_service/pm_defs.h
+++ b/plat/xilinx/zynqmp/pm_service/pm_defs.h
@@ -359,7 +359,7 @@ enum pm_clock_div_id {
* EM API IDs
*/
enum em_api_id {
- EM_SET_ACTION = 1,
+ EM_SET_ACTION = 0x3001,
EM_REMOVE_ACTION,
EM_SEND_ERRORS,
};
diff --git a/plat/xilinx/zynqmp/sip_svc_setup.c b/plat/xilinx/zynqmp/sip_svc_setup.c
index 8b0adc696..c928e43bd 100644
--- a/plat/xilinx/zynqmp/sip_svc_setup.c
+++ b/plat/xilinx/zynqmp/sip_svc_setup.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2023, Advanced Micro Devices Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -29,7 +30,7 @@
#define XLNX_FID_MASK GENMASK(23, 12)
#define PM_FID_VALUE 0u
#define IPI_FID_VALUE 0x1000u
-#define EM_FID_VALUE 0xE0000u
+#define EM_FID_VALUE 0x3000u
#define is_em_fid(_fid) (((_fid) & XLNX_FID_MASK) == EM_FID_VALUE)
#define is_pm_fid(_fid) (((_fid) & XLNX_FID_MASK) == PM_FID_VALUE)
#define is_ipi_fid(_fid) (((_fid) & XLNX_FID_MASK) == IPI_FID_VALUE)
@@ -68,17 +69,17 @@ static uintptr_t sip_svc_smc_handler(uint32_t smc_fid,
VERBOSE("SMCID: 0x%08x, x1: 0x%016" PRIx64 ", x2: 0x%016" PRIx64 ", x3: 0x%016" PRIx64 ", x4: 0x%016" PRIx64 "\n",
smc_fid, x1, x2, x3, x4);
- /* Let EM SMC handler deal with EM-related requests */
- if (is_em_fid(smc_fid)) {
- return em_smc_handler(smc_fid, x1, x2, x3, x4, cookie, handle,
- flags);
- }
-
if (smc_fid & SIP_FID_MASK) {
WARN("SMC out of SiP assinged range: 0x%x\n", smc_fid);
SMC_RET1(handle, SMC_UNK);
}
+ /* Let EM SMC handler deal with EM-related requests */
+ if (is_em_fid(smc_fid)) {
+ return em_smc_handler(smc_fid, x1, x2, x3, x4, cookie, handle,
+ flags);
+ }
+
/* Let PM SMC handler deal with PM-related requests */
if (is_pm_fid(smc_fid)) {
return pm_smc_handler(smc_fid, x1, x2, x3, x4, cookie, handle,