summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSai Varun Venkatapuram <saivarun.venkatapuram@amd.com>2026-08-18 14:24:37 +0530
committerSai Varun Venkatapuram <saivarun.venkatapuram@amd.com>2026-09-02 02:26:20 +0530
commit7bfbe677294ee576e3d0fc9d5f7386d430ae0463 (patch)
tree2a242874ec3d5dd64d58e9182f125326ce67ada9
parentec049085c570e0481cfca21d6b9f98f780375678 (diff)
downloadarm-trusted-firmware-7bfbe677294ee576e3d0fc9d5f7386d430ae0463.tar.gz
arm-trusted-firmware-7bfbe677294ee576e3d0fc9d5f7386d430ae0463.zip
feat(versal-net): add PMC_TAP accessors for SOC ID
Implement get_pmc_tap_idcode() and get_pmc_tap_version() functions to directly read PMC_TAP.IDCODE and PMC_TAP.VERSION registers. On Versal NET, PMC_TAP is covered by the runtime-mapped DEVICE2 region, so direct mmio_read_32 access is safe from the SMCCC handler. Change-Id: I97c2536ef9d8b0c0162d16135aeb5958086bb48e Signed-off-by: Sai Varun Venkatapuram <saivarun.venkatapuram@amd.com>
-rw-r--r--plat/xilinx/versal_net/aarch64/versal_net_common.c17
-rw-r--r--plat/xilinx/versal_net/include/versal_net_def.h3
2 files changed, 18 insertions, 2 deletions
diff --git a/plat/xilinx/versal_net/aarch64/versal_net_common.c b/plat/xilinx/versal_net/aarch64/versal_net_common.c
index 79e44c348..6f7a87022 100644
--- a/plat/xilinx/versal_net/aarch64/versal_net_common.c
+++ b/plat/xilinx/versal_net/aarch64/versal_net_common.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2022, Xilinx, Inc. All rights reserved.
- * Copyright (c) 2022-2025, Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (c) 2022-2026, Advanced Micro Devices, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -184,3 +184,18 @@ void get_boot_mode(uint32_t *mode)
return;
}
#endif
+
+/*
+ * Versal NET-specific implementations of PMC_TAP accessors.
+ * PMC_TAP is mapped in DEVICE2 at runtime on Versal NET, so direct read
+ * is safe.
+ */
+uint32_t get_pmc_tap_idcode(void)
+{
+ return mmio_read_32(PMC_TAP_IDCODE);
+}
+
+uint32_t get_pmc_tap_version(void)
+{
+ return mmio_read_32(PMC_TAP_VERSION);
+}
diff --git a/plat/xilinx/versal_net/include/versal_net_def.h b/plat/xilinx/versal_net/include/versal_net_def.h
index 54f9cc993..6b43e0e51 100644
--- a/plat/xilinx/versal_net/include/versal_net_def.h
+++ b/plat/xilinx/versal_net/include/versal_net_def.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2021-2022, Xilinx, Inc. All rights reserved.
- * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (c) 2022-2026, Advanced Micro Devices, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -42,6 +42,7 @@
/* For platform detection */
#define PMC_TAP U(0xF11A0000)
+#define PMC_TAP_IDCODE PMC_TAP
#define PMC_TAP_VERSION (PMC_TAP + 0x4U)
# define PLATFORM_MASK GENMASK(27U, 24U)
# define PLATFORM_VERSION_MASK GENMASK(31U, 28U)