feat(rme): add dev granules tests
Add tests for RMI_GRANULE_DELEGATE and
RMI_GRANULE_UNDELEGATE commands using
device granules.
Add plat_get_dev_region() function to
retrieve platform PCIe memory region info.
Change-Id: Ie59361dd28e11db348c30b033c156de044aa0ffc
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
diff --git a/plat/arm/fvp/fvp_pcie.c b/plat/arm/fvp/fvp_pcie.c
index c43e42d..38bdf39 100644
--- a/plat/arm/fvp/fvp_pcie.c
+++ b/plat/arm/fvp/fvp_pcie.c
@@ -1,9 +1,10 @@
/*
- * Copyright (c) 2024, Arm Limited. All rights reserved.
+ * Copyright (c) 2024-2025, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
#include <pcie.h>
#include <platform.h>
@@ -25,3 +26,32 @@
{
return &fvp_pcie_cfg;
}
+
+/*
+ * Retrieve platform PCIe memory region (Base Platform RevC only)
+ */
+int plat_get_dev_region(uint64_t *base, size_t *size,
+ uint32_t type, uint32_t idx)
+{
+#ifdef __aarch64__
+ assert((base != NULL) && (size != NULL));
+
+ if (type == DEV_MEM_NON_COHERENT) {
+ switch (idx) {
+ case 0U:
+ /* PCIe memory region 1 */
+ *base = PCIE_MEM_1_BASE;
+ *size = PCIE_MEM_1_SIZE;
+ return 0;
+ case 1U:
+ /* PCIe memory region 2 */
+ *base = PCIE_MEM_2_BASE;
+ *size = PCIE_MEM_2_SIZE;
+ return 0;
+ default:
+ break;
+ }
+ }
+#endif
+ return -1;
+}