blob: 5e634175d59d4f84df5e7092edd0b6c1325d2008 [file] [log] [blame]
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001From ba3ed154863d1acd0996178beaf3a2bc693b938c Mon Sep 17 00:00:00 2001
Patrick Williams8dd68482022-10-04 07:57:18 -05002From: sahil <sahil@arm.com>
3Date: Wed, 20 Apr 2022 12:24:41 +0530
Patrick Williams8e7b46e2023-05-01 14:19:06 -05004Subject: [PATCH] Platform/ARM/N1Sdp: Fix RemoteDdrSize cast
Patrick Williams8dd68482022-10-04 07:57:18 -05005
6RemoteDdrSize calculation wraps around when booting N1Sdp in
7multichip mode. Casting it to UINT64 to fix the issue.
8
9Upstream-Status: Pending
10Signed-off-by: Adam Johnston <adam.johnston@arm.com>
11Signed-off-by: Xueliang Zhong <xueliang.zhong@arm.com>
12Signed-off-by: sahil <sahil@arm.com>
Patrick Williams8e7b46e2023-05-01 14:19:06 -050013Change-Id: Ic51269a8d67669684a5f056701cfbef6beb23da2
Patrick Williams8dd68482022-10-04 07:57:18 -050014---
15 .../ConfigurationManagerDxe/ConfigurationManager.c | 2 +-
16 Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c | 2 +-
17 2 files changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
Patrick Williams8e7b46e2023-05-01 14:19:06 -050020index c15020f5..b11c0425 100644
Patrick Williams8dd68482022-10-04 07:57:18 -050021--- a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
22+++ b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
23@@ -1254,7 +1254,7 @@ InitializePlatformRepository (
24 PlatRepoInfo->MemAffInfo[LOCAL_DDR_REGION2].Length = Dram2Size;
25
26 if (PlatInfo->MultichipMode == 1) {
27- RemoteDdrSize = ((PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
28+ RemoteDdrSize = ((UINT64)(PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
29
30 // Update Remote DDR Region1
31 PlatRepoInfo->MemAffInfo[REMOTE_DDR_REGION1].ProximityDomain = 1;
32diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c
Patrick Williams8e7b46e2023-05-01 14:19:06 -050033index 1d53ec75..5cacd437 100644
Patrick Williams8dd68482022-10-04 07:57:18 -050034--- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c
35+++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c
36@@ -157,7 +157,7 @@ ArmPlatformGetVirtualMemoryMap (
37 DramBlock2Size);
38
39 if (PlatInfo->MultichipMode == 1) {
40- RemoteDdrSize = ((PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
41+ RemoteDdrSize = ((UINT64)(PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
42
43 BuildResourceDescriptorHob (
44 EFI_RESOURCE_SYSTEM_MEMORY,