blob: 1c097fcc7e4d8ef94aeba452768237dd85e405a3 [file] [log] [blame]
Patrick Williams8dd68482022-10-04 07:57:18 -05001From 73aab76042ae34fa4b07414c1830129e572dcd65 Mon Sep 17 00:00:00 2001
2From: sahil <sahil@arm.com>
3Date: Wed, 20 Apr 2022 12:24:41 +0530
4Subject: [PATCH 2/3] Platform/ARM/N1Sdp: Fix RemoteDdrSize cast
5
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>
13Change-Id: I2c2a70c2ab046337236fba92d25dec5905ccd117
14
15---
16 .../ConfigurationManagerDxe/ConfigurationManager.c | 2 +-
17 Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c | 2 +-
18 2 files changed, 2 insertions(+), 2 deletions(-)
19
20diff --git a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
21index e023d47c..36b5fc9e 100644
22--- a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
23+++ b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
24@@ -1254,7 +1254,7 @@ InitializePlatformRepository (
25 PlatRepoInfo->MemAffInfo[LOCAL_DDR_REGION2].Length = Dram2Size;
26
27 if (PlatInfo->MultichipMode == 1) {
28- RemoteDdrSize = ((PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
29+ RemoteDdrSize = ((UINT64)(PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
30
31 // Update Remote DDR Region1
32 PlatRepoInfo->MemAffInfo[REMOTE_DDR_REGION1].ProximityDomain = 1;
33diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c
34index b58bda4b..fbc9b05e 100644
35--- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c
36+++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c
37@@ -157,7 +157,7 @@ ArmPlatformGetVirtualMemoryMap (
38 DramBlock2Size);
39
40 if (PlatInfo->MultichipMode == 1) {
41- RemoteDdrSize = ((PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
42+ RemoteDdrSize = ((UINT64)(PlatInfo->RemoteDdrSize - 2) * SIZE_1GB);
43
44 BuildResourceDescriptorHob (
45 EFI_RESOURCE_SYSTEM_MEMORY,
46--
472.37.2
48