From a92681d9264467e98042f94df36a2184a5cf8270 Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Wed, 21 Dec 2022 23:03:35 -0800 Subject: [PATCH] refactor(xilinx): move versal files to common place Moved necessary files to common place so that it can be used for Versal NET. Signed-off-by: Jay Buddhabhatti Change-Id: I611fa849207b082e6599acfb65c55d27b9c99435 --- .../{versal/pm_service => common/include}/pm_api_sys.h | 2 +- plat/xilinx/{versal/pm_service => common/include}/pm_node.h | 1 + .../{versal/pm_service => common/include}/pm_svc_main.h | 1 + plat/xilinx/{versal => common}/pm_service/pm_api_sys.c | 2 +- plat/xilinx/{versal => common}/pm_service/pm_svc_main.c | 2 +- plat/xilinx/versal/platform.mk | 5 +++-- plat/xilinx/versal_net/platform.mk | 6 +++--- plat/xilinx/zynqmp/aarch64/zynqmp_common.c | 4 ++-- plat/xilinx/zynqmp/libpm.mk | 4 ++-- plat/xilinx/zynqmp/plat_psci.c | 3 ++- plat/xilinx/zynqmp/pm_service/pm_api_clock.c | 3 ++- plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c | 3 ++- plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c | 3 ++- plat/xilinx/zynqmp/pm_service/pm_client.c | 3 ++- .../zynqmp/pm_service/{pm_api_sys.c => zynqmp_pm_api_sys.c} | 2 +- .../zynqmp/pm_service/{pm_api_sys.h => zynqmp_pm_api_sys.h} | 6 +++--- .../pm_service/{pm_svc_main.c => zynqmp_pm_svc_main.c} | 2 +- .../pm_service/{pm_svc_main.h => zynqmp_pm_svc_main.h} | 6 +++--- plat/xilinx/zynqmp/sip_svc_setup.c | 2 +- 19 files changed, 34 insertions(+), 26 deletions(-) rename plat/xilinx/{versal/pm_service => common/include}/pm_api_sys.h (98%) rename plat/xilinx/{versal/pm_service => common/include}/pm_node.h (98%) rename plat/xilinx/{versal/pm_service => common/include}/pm_svc_main.h (85%) rename plat/xilinx/{versal => common}/pm_service/pm_api_sys.c (99%) rename plat/xilinx/{versal => common}/pm_service/pm_svc_main.c (99%) rename plat/xilinx/zynqmp/pm_service/{pm_api_sys.c => zynqmp_pm_api_sys.c} (99%) rename plat/xilinx/zynqmp/pm_service/{pm_api_sys.h => zynqmp_pm_api_sys.h} (98%) rename plat/xilinx/zynqmp/pm_service/{pm_svc_main.c => zynqmp_pm_svc_main.c} (99%) rename plat/xilinx/zynqmp/pm_service/{pm_svc_main.h => zynqmp_pm_svc_main.h} (81%) diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.h b/plat/xilinx/common/include/pm_api_sys.h similarity index 98% rename from plat/xilinx/versal/pm_service/pm_api_sys.h rename to plat/xilinx/common/include/pm_api_sys.h index 8625e9568..e7b1567dd 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.h +++ b/plat/xilinx/common/include/pm_api_sys.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved. - * Copyright (c) 2022, Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ diff --git a/plat/xilinx/versal/pm_service/pm_node.h b/plat/xilinx/common/include/pm_node.h similarity index 98% rename from plat/xilinx/versal/pm_service/pm_node.h rename to plat/xilinx/common/include/pm_node.h index 1b82ec70d..371c72d7e 100644 --- a/plat/xilinx/versal/pm_service/pm_node.h +++ b/plat/xilinx/common/include/pm_node.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2019, Xilinx, Inc. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ diff --git a/plat/xilinx/versal/pm_service/pm_svc_main.h b/plat/xilinx/common/include/pm_svc_main.h similarity index 85% rename from plat/xilinx/versal/pm_service/pm_svc_main.h rename to plat/xilinx/common/include/pm_svc_main.h index b6e764f2c..1a27bdfae 100644 --- a/plat/xilinx/versal/pm_service/pm_svc_main.h +++ b/plat/xilinx/common/include/pm_svc_main.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.c b/plat/xilinx/common/pm_service/pm_api_sys.c similarity index 99% rename from plat/xilinx/versal/pm_service/pm_api_sys.c rename to plat/xilinx/common/pm_service/pm_api_sys.c index cc99f1197..6ff61af9e 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.c +++ b/plat/xilinx/common/pm_service/pm_api_sys.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved. - * Copyright (c) 2022, Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ diff --git a/plat/xilinx/versal/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c similarity index 99% rename from plat/xilinx/versal/pm_service/pm_svc_main.c rename to plat/xilinx/common/pm_service/pm_svc_main.c index 185bfdb65..6fd7f0d52 100644 --- a/plat/xilinx/versal/pm_service/pm_svc_main.c +++ b/plat/xilinx/common/pm_service/pm_svc_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved. - * Copyright (c) 2022, Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ diff --git a/plat/xilinx/versal/platform.mk b/plat/xilinx/versal/platform.mk index 8087297a2..71f680261 100644 --- a/plat/xilinx/versal/platform.mk +++ b/plat/xilinx/versal/platform.mk @@ -1,4 +1,5 @@ # Copyright (c) 2018-2021, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause @@ -82,6 +83,8 @@ BL31_SOURCES += drivers/arm/cci/cci.c \ plat/xilinx/common/plat_startup.c \ plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c \ plat/xilinx/common/pm_service/pm_ipi.c \ + plat/xilinx/common/pm_service/pm_api_sys.c \ + plat/xilinx/common/pm_service/pm_svc_main.c \ plat/xilinx/versal/bl31_versal_setup.c \ plat/xilinx/versal/plat_psci.c \ plat/xilinx/versal/plat_versal.c \ @@ -89,8 +92,6 @@ BL31_SOURCES += drivers/arm/cci/cci.c \ plat/xilinx/versal/sip_svc_setup.c \ plat/xilinx/versal/versal_gicv3.c \ plat/xilinx/versal/versal_ipi.c \ - plat/xilinx/versal/pm_service/pm_svc_main.c \ - plat/xilinx/versal/pm_service/pm_api_sys.c \ plat/xilinx/versal/pm_service/pm_client.c ifeq ($(HARDEN_SLS_ALL), 1) diff --git a/plat/xilinx/versal_net/platform.mk b/plat/xilinx/versal_net/platform.mk index 28e329519..0bc5925b1 100644 --- a/plat/xilinx/versal_net/platform.mk +++ b/plat/xilinx/versal_net/platform.mk @@ -1,6 +1,6 @@ # Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved. # Copyright (c) 2021-2022, Xilinx, Inc. All rights reserved. -# Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause @@ -87,10 +87,10 @@ BL31_SOURCES += drivers/arm/cci/cci.c \ lib/cpus/aarch64/cortex_a78.S \ plat/common/plat_psci_common.c ifeq ($(TFA_NO_PM), 0) -BL31_SOURCES += plat/xilinx/versal/pm_service/pm_api_sys.c \ +BL31_SOURCES += plat/xilinx/common/pm_service/pm_api_sys.c \ plat/xilinx/common/pm_service/pm_ipi.c \ ${PLAT_PATH}/plat_psci_pm.c \ - plat/xilinx/versal/pm_service/pm_svc_main.c \ + plat/xilinx/common/pm_service/pm_svc_main.c \ ${PLAT_PATH}/pm_service/pm_client.c \ ${PLAT_PATH}/versal_net_ipi.c else diff --git a/plat/xilinx/zynqmp/aarch64/zynqmp_common.c b/plat/xilinx/zynqmp/aarch64/zynqmp_common.c index 95a266e74..8f2863615 100644 --- a/plat/xilinx/zynqmp/aarch64/zynqmp_common.c +++ b/plat/xilinx/zynqmp/aarch64/zynqmp_common.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. - * Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -19,7 +19,7 @@ #include #include -#include "pm_api_sys.h" +#include "zynqmp_pm_api_sys.h" /* * Table of regions to map using the MMU. diff --git a/plat/xilinx/zynqmp/libpm.mk b/plat/xilinx/zynqmp/libpm.mk index 4ceb5765a..db3c74260 100644 --- a/plat/xilinx/zynqmp/libpm.mk +++ b/plat/xilinx/zynqmp/libpm.mk @@ -8,8 +8,8 @@ LIBPM_SRCS := $(addprefix plat/xilinx/common/pm_service/, \ pm_ipi.c) LIBPM_SRCS += $(addprefix plat/xilinx/zynqmp/pm_service/, \ - pm_svc_main.c \ - pm_api_sys.c \ + zynqmp_pm_svc_main.c \ + zynqmp_pm_api_sys.c \ pm_api_pinctrl.c \ pm_api_ioctl.c \ pm_api_clock.c \ diff --git a/plat/xilinx/zynqmp/plat_psci.c b/plat/xilinx/zynqmp/plat_psci.c index b7408b1da..5211ace82 100644 --- a/plat/xilinx/zynqmp/plat_psci.c +++ b/plat/xilinx/zynqmp/plat_psci.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -16,8 +17,8 @@ #include #include -#include "pm_api_sys.h" #include "pm_client.h" +#include "zynqmp_pm_api_sys.h" static uintptr_t zynqmp_sec_entry; diff --git a/plat/xilinx/zynqmp/pm_service/pm_api_clock.c b/plat/xilinx/zynqmp/pm_service/pm_api_clock.c index e61310aad..9f4278d6d 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_api_clock.c +++ b/plat/xilinx/zynqmp/pm_service/pm_api_clock.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -16,10 +17,10 @@ #include #include "pm_api_clock.h" -#include "pm_api_sys.h" #include "pm_client.h" #include "pm_common.h" #include "pm_ipi.h" +#include "zynqmp_pm_api_sys.h" #define CLK_NODE_MAX (6U) diff --git a/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c b/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c index c0bfd51e7..45038b063 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c +++ b/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -16,10 +17,10 @@ #include "pm_api_clock.h" #include "pm_api_ioctl.h" -#include "pm_api_sys.h" #include "pm_client.h" #include "pm_common.h" #include "pm_ipi.h" +#include "zynqmp_pm_api_sys.h" /** * pm_ioctl_get_rpu_oper_mode () - Get current RPU operation mode diff --git a/plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c b/plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c index 8f373418c..847ec2c5d 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c +++ b/plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -14,10 +15,10 @@ #include #include "pm_api_pinctrl.h" -#include "pm_api_sys.h" #include "pm_client.h" #include "pm_common.h" #include "pm_ipi.h" +#include "zynqmp_pm_api_sys.h" struct pinctrl_function { char name[FUNCTION_NAME_LEN]; diff --git a/plat/xilinx/zynqmp/pm_service/pm_client.c b/plat/xilinx/zynqmp/pm_service/pm_client.c index 7217fa145..f752525a2 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_client.c +++ b/plat/xilinx/zynqmp/pm_service/pm_client.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -21,9 +22,9 @@ #include #include -#include "pm_api_sys.h" #include "pm_client.h" #include "pm_ipi.h" +#include "zynqmp_pm_api_sys.h" #define IRQ_MAX 84U #define NUM_GICD_ISENABLER ((IRQ_MAX >> 5U) + 1U) diff --git a/plat/xilinx/zynqmp/pm_service/pm_api_sys.c b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_api_sys.c similarity index 99% rename from plat/xilinx/zynqmp/pm_service/pm_api_sys.c rename to plat/xilinx/zynqmp/pm_service/zynqmp_pm_api_sys.c index 58491a07a..d11d6ff7a 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_api_sys.c +++ b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_api_sys.c @@ -16,10 +16,10 @@ #include "pm_api_clock.h" #include "pm_api_ioctl.h" #include "pm_api_pinctrl.h" -#include "pm_api_sys.h" #include "pm_client.h" #include "pm_common.h" #include "pm_ipi.h" +#include "zynqmp_pm_api_sys.h" #define PM_QUERY_FEATURE_BITMASK ( \ (1ULL << (uint64_t)PM_QID_CLOCK_GET_NAME) | \ diff --git a/plat/xilinx/zynqmp/pm_service/pm_api_sys.h b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_api_sys.h similarity index 98% rename from plat/xilinx/zynqmp/pm_service/pm_api_sys.h rename to plat/xilinx/zynqmp/pm_service/zynqmp_pm_api_sys.h index 1341e7b37..7d2655499 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_api_sys.h +++ b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_api_sys.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef PM_API_SYS_H -#define PM_API_SYS_H +#ifndef ZYNQMP_PM_API_SYS_H +#define ZYNQMP_PM_API_SYS_H #include @@ -192,4 +192,4 @@ enum pm_ret_status pm_feature_check(uint32_t api_id, uint32_t *version, uint32_t *bit_mask, uint8_t len); enum pm_ret_status check_api_dependency(uint8_t id); -#endif /* PM_API_SYS_H */ +#endif /* ZYNQMP_PM_API_SYS_H */ diff --git a/plat/xilinx/zynqmp/pm_service/pm_svc_main.c b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_svc_main.c similarity index 99% rename from plat/xilinx/zynqmp/pm_service/pm_svc_main.c rename to plat/xilinx/zynqmp/pm_service/zynqmp_pm_svc_main.c index b35859d5d..b54936e01 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_svc_main.c +++ b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_svc_main.c @@ -22,10 +22,10 @@ #endif #include -#include "pm_api_sys.h" #include "pm_client.h" #include "pm_defs.h" #include "pm_ipi.h" +#include "zynqmp_pm_api_sys.h" /* pm_up = !0 - UP, pm_up = 0 - DOWN */ static int32_t pm_up, ipi_irq_flag; diff --git a/plat/xilinx/zynqmp/pm_service/pm_svc_main.h b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_svc_main.h similarity index 81% rename from plat/xilinx/zynqmp/pm_service/pm_svc_main.h rename to plat/xilinx/zynqmp/pm_service/zynqmp_pm_svc_main.h index 3c3082faf..03ff6d3d8 100644 --- a/plat/xilinx/zynqmp/pm_service/pm_svc_main.h +++ b/plat/xilinx/zynqmp/pm_service/zynqmp_pm_svc_main.h @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef PM_SVC_MAIN_H -#define PM_SVC_MAIN_H +#ifndef ZYNQMP_PM_SVC_MAIN_H +#define ZYNQMP_PM_SVC_MAIN_H #include "pm_common.h" @@ -14,4 +14,4 @@ int32_t pm_setup(void); uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, const void *cookie, void *handle, uint64_t flags); -#endif /* PM_SVC_MAIN_H */ +#endif /* ZYNQMP_PM_SVC_MAIN_H */ diff --git a/plat/xilinx/zynqmp/sip_svc_setup.c b/plat/xilinx/zynqmp/sip_svc_setup.c index c55784e3f..6ec7ed492 100644 --- a/plat/xilinx/zynqmp/sip_svc_setup.c +++ b/plat/xilinx/zynqmp/sip_svc_setup.c @@ -14,7 +14,7 @@ #include #include "ipi_mailbox_svc.h" -#include "pm_svc_main.h" +#include "zynqmp_pm_svc_main.h" /* SMC function IDs for SiP Service queries */ #define ZYNQMP_SIP_SVC_CALL_COUNT U(0x8200ff00)