diff options
author | Joanna Farley <joanna.farley@arm.com> | 2023-02-17 17:49:29 +0100 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2023-02-17 17:49:29 +0100 |
commit | 9c571fb0d20b01e1111e2973461ec14830e0724a (patch) | |
tree | d4eab25fecf22a7baf8752fb317c8780f2e7e24b /plat/xilinx | |
parent | a6bdf778e0843d0a077d5b44480292317f082a4b (diff) | |
parent | 496d708154d893fb9f412390acd433337faccecc (diff) | |
download | arm-trusted-firmware-9c571fb0d20b01e1111e2973461ec14830e0724a.tar.gz |
Merge "feat(zynqmp): add support for custom sip service" into integration
Diffstat (limited to 'plat/xilinx')
-rw-r--r-- | plat/xilinx/zynqmp/custom_sip_svc.c | 17 | ||||
-rw-r--r-- | plat/xilinx/zynqmp/include/custom_svc.h | 16 | ||||
-rw-r--r-- | plat/xilinx/zynqmp/platform.mk | 6 | ||||
-rw-r--r-- | plat/xilinx/zynqmp/sip_svc_setup.c | 6 |
4 files changed, 45 insertions, 0 deletions
diff --git a/plat/xilinx/zynqmp/custom_sip_svc.c b/plat/xilinx/zynqmp/custom_sip_svc.c new file mode 100644 index 000000000..459aa39f2 --- /dev/null +++ b/plat/xilinx/zynqmp/custom_sip_svc.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2022-2023, Advanced Micro Devices Inc. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <common/bl_common.h> +#include <common/debug.h> +#include <smccc_helpers.h> + +uint64_t custom_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, + uint64_t x3, uint64_t x4, void *cookie, + void *handle, uint64_t flags) +{ + WARN("Unimplemented SiP Service Call: 0x%x\n", smc_fid); + SMC_RET1(handle, SMC_UNK); +} diff --git a/plat/xilinx/zynqmp/include/custom_svc.h b/plat/xilinx/zynqmp/include/custom_svc.h new file mode 100644 index 000000000..389a7bcd7 --- /dev/null +++ b/plat/xilinx/zynqmp/include/custom_svc.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022-2023, Advanced Micro Devices Inc. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +#ifndef CUSTOM_SVC_H +#define CUSTOM_SVC_H + +#define ZYNQMP_SIP_SVC_CUSTOM U(0x82002000) +#define ZYNQMP_SIP_SVC64_CUSTOM U(0xC2002000) + +uint64_t custom_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, + uint64_t x3, uint64_t x4, void *cookie, + void *handle, uint64_t flags); + +#endif /* CUSTOM_SVC_H */ diff --git a/plat/xilinx/zynqmp/platform.mk b/plat/xilinx/zynqmp/platform.mk index b751de8e5..38e740802 100644 --- a/plat/xilinx/zynqmp/platform.mk +++ b/plat/xilinx/zynqmp/platform.mk @@ -139,6 +139,12 @@ endif BL31_CPPFLAGS += -fno-jump-tables TF_CFLAGS_aarch64 += -mbranch-protection=none +ifdef CUSTOM_PKG_PATH +include $(CUSTOM_PKG_PATH)/custom_pkg.mk +else +BL31_SOURCES += plat/xilinx/zynqmp/custom_sip_svc.c +endif + ifneq (${RESET_TO_BL31},1) $(error "Using BL31 as the reset vector is only one option supported on ZynqMP. Please set RESET_TO_BL31 to 1.") endif diff --git a/plat/xilinx/zynqmp/sip_svc_setup.c b/plat/xilinx/zynqmp/sip_svc_setup.c index 4ce9b8a5d..997cb1e1b 100644 --- a/plat/xilinx/zynqmp/sip_svc_setup.c +++ b/plat/xilinx/zynqmp/sip_svc_setup.c @@ -9,6 +9,7 @@ #include <common/runtime_svc.h> #include <tools_share/uuid.h> +#include <custom_svc.h> #include "ipi_mailbox_svc.h" #include "pm_svc_main.h" @@ -89,6 +90,11 @@ static uintptr_t sip_svc_smc_handler(uint32_t smc_fid, case ZYNQMP_SIP_SVC_VERSION: SMC_RET2(handle, SIP_SVC_VERSION_MAJOR, SIP_SVC_VERSION_MINOR); + case ZYNQMP_SIP_SVC_CUSTOM: + case ZYNQMP_SIP_SVC64_CUSTOM: + return custom_smc_handler(smc_fid, x1, x2, x3, x4, cookie, + handle, flags); + default: WARN("Unimplemented SiP Service Call: 0x%x\n", smc_fid); SMC_RET1(handle, SMC_UNK); |