feat(pcie): add PCIe support to FVP platform

This patch adds PCIe support to FVP platform.

Change-Id: If47077dac50dd090c0e949213688a6427d29872b
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
diff --git a/plat/arm/fvp/fvp_def.h b/plat/arm/fvp/fvp_def.h
index 1d01bb2..3609b86 100644
--- a/plat/arm/fvp/fvp_def.h
+++ b/plat/arm/fvp/fvp_def.h
@@ -11,6 +11,7 @@
 #ifndef __FVP_DEF_H__
 #define __FVP_DEF_H__
 
+#include <common_def.h>
 #include <platform_def.h>
 
 /*******************************************************************************
@@ -42,6 +43,22 @@
 #define LS64_ATOMIC_DEVICE_BASE		0x1d000000
 #define LS64_ATOMIC_DEVICE_SIZE		0x10000
 
+/*
+ * Base Platform RevC only
+ *
+ * PCIe config region
+ */
+#define PCIE_CONFIG_BASE		0x40000000
+#define PCIE_CONFIG_SIZE		SZ_256M
+
+/* PCIe memory region #1 256MB */
+#define PCIE_MEM_1_BASE			0x50000000
+#define PCIE_MEM_1_SIZE			SZ_256M
+
+/* PCIe memory region #2 256GB */
+#define PCIE_MEM_2_BASE			0x4000000000
+#define PCIE_MEM_2_SIZE			(SZ_1G * 256)
+
 /*******************************************************************************
  * GIC-400 & interrupt handling related constants
  ******************************************************************************/
diff --git a/plat/arm/fvp/fvp_pcie.c b/plat/arm/fvp/fvp_pcie.c
new file mode 100644
index 0000000..0569832
--- /dev/null
+++ b/plat/arm/fvp/fvp_pcie.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <pcie.h>
+
+#include <platform.h>
+#include <platform_pcie.h>
+
+CASSERT(PLATFORM_NUM_ECAM != 0, PLATFORM_NUM_ECAM_is_zero);
+
+const pcie_info_table_t fvp_pcie_cfg = {
+	.num_entries = PLATFORM_NUM_ECAM,
+	.block[0] = {
+		PLATFORM_PCIE_ECAM_BASE_ADDR_0,
+		PLATFORM_PCIE_SEGMENT_GRP_NUM_0,
+		PLATFORM_PCIE_START_BUS_NUM_0,
+		PLATFORM_PCIE_END_BUS_NUM_0
+	}
+};
+
+const pcie_info_table_t *plat_pcie_get_info_table(void)
+{
+	return &fvp_pcie_cfg;
+}
diff --git a/plat/arm/fvp/include/platform_pcie.h b/plat/arm/fvp/include/platform_pcie.h
new file mode 100644
index 0000000..c76c7d9
--- /dev/null
+++ b/plat/arm/fvp/include/platform_pcie.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#ifndef PLATFORM_PCIE_H
+#define PLATFORM_PCIE_H
+
+#include <utils_def.h>
+
+#include "../fvp_def.h"
+
+/* PCIE platform config parameters */
+#define PLATFORM_NUM_ECAM		1
+
+/* Platform config parameters for ECAM_0 */
+#define PLATFORM_PCIE_ECAM_BASE_ADDR_0	PCIE_CONFIG_BASE
+#define PLATFORM_PCIE_SEGMENT_GRP_NUM_0	0x0
+#define PLATFORM_PCIE_START_BUS_NUM_0	0x0
+#define PLATFORM_PCIE_END_BUS_NUM_0	0xFF
+
+const pcie_info_table_t *plat_pcie_get_info_table(void);
+
+#endif	/* PLATFORM_PCIE_H */
diff --git a/plat/arm/fvp/plat_setup.c b/plat/arm/fvp/plat_setup.c
index cb6f874..e6e4244 100644
--- a/plat/arm/fvp/plat_setup.c
+++ b/plat/arm/fvp/plat_setup.c
@@ -35,6 +35,9 @@
 #if USE_NVM
 	MAP_REGION_FLAT(FLASH_BASE, FLASH_SIZE, MT_DEVICE | MT_RW | MT_NS),
 #endif
+#if USE_PCIE
+	MAP_REGION_FLAT(PCIE_CONFIG_BASE, PCIE_CONFIG_SIZE, MT_DEVICE | MT_RW | MT_NS),
+#endif
 	MAP_REGION_FLAT(DRAM_BASE, TFTF_BASE - DRAM_BASE, MT_MEMORY | MT_RW | MT_NS),
 	{0}
 };