feat(xilinx): fix IPI calculation for Versal/NET
Fix buffer calculation logic for Versal and Versal NET to use
LOCAL/REMOTE_ID.
Change-Id: Icf6985a19183cc8e51f3a536130695e00c32c736
Signed-off-by: Michal Simek <michal.simek@amd.com>
diff --git a/plat/xilinx/versal/include/plat_ipi.h b/plat/xilinx/versal/include/plat_ipi.h
index da77ccc..e4922e4 100644
--- a/plat/xilinx/versal/include/plat_ipi.h
+++ b/plat/xilinx/versal/include/plat_ipi.h
@@ -32,11 +32,11 @@
#define IPI_LOCAL_ID IPI_ID_APU
#define IPI_REMOTE_ID IPI_ID_PMC
-#define IPI_BUFFER_LOCAL_BASE (IPI_BUFFER_BASEADDR + 0x400U)
-#define IPI_BUFFER_REMOTE_BASE (IPI_BUFFER_BASEADDR + 0x200U)
+#define IPI_BUFFER_LOCAL_BASE (IPI_BUFFER_BASEADDR + (IPI_LOCAL_ID * 0x200U))
+#define IPI_BUFFER_REMOTE_BASE (IPI_BUFFER_BASEADDR + (IPI_REMOTE_ID * 0x200U))
-#define IPI_BUFFER_TARGET_LOCAL_OFFSET 0x80U
-#define IPI_BUFFER_TARGET_REMOTE_OFFSET 0x40U
+#define IPI_BUFFER_TARGET_LOCAL_OFFSET (IPI_LOCAL_ID * 0x40U)
+#define IPI_BUFFER_TARGET_REMOTE_OFFSET (IPI_REMOTE_ID * 0x40U)
#define IPI_BUFFER_MAX_WORDS 8
diff --git a/plat/xilinx/versal_net/include/plat_ipi.h b/plat/xilinx/versal_net/include/plat_ipi.h
index 007e984..9f9947e 100644
--- a/plat/xilinx/versal_net/include/plat_ipi.h
+++ b/plat/xilinx/versal_net/include/plat_ipi.h
@@ -34,11 +34,11 @@
#define IPI_LOCAL_ID IPI_ID_APU
#define IPI_REMOTE_ID IPI_ID_PMC
-#define IPI_BUFFER_LOCAL_BASE (IPI_BUFFER_BASEADDR + 0x400U)
-#define IPI_BUFFER_REMOTE_BASE (IPI_BUFFER_BASEADDR + 0x200U)
+#define IPI_BUFFER_LOCAL_BASE (IPI_BUFFER_BASEADDR + (IPI_LOCAL_ID * 0x200U))
+#define IPI_BUFFER_REMOTE_BASE (IPI_BUFFER_BASEADDR + (IPI_REMOTE_ID * 0x200U))
-#define IPI_BUFFER_TARGET_LOCAL_OFFSET 0x80U
-#define IPI_BUFFER_TARGET_REMOTE_OFFSET 0x40U
+#define IPI_BUFFER_TARGET_LOCAL_OFFSET (IPI_LOCAL_ID * 0x40U)
+#define IPI_BUFFER_TARGET_REMOTE_OFFSET (IPI_REMOTE_ID * 0x40U)
#define IPI_BUFFER_MAX_WORDS 8