Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame^] | 1 | From 73aab76042ae34fa4b07414c1830129e572dcd65 Mon Sep 17 00:00:00 2001 |
| 2 | From: sahil <sahil@arm.com> |
| 3 | Date: Wed, 20 Apr 2022 12:24:41 +0530 |
| 4 | Subject: [PATCH 2/3] Platform/ARM/N1Sdp: Fix RemoteDdrSize cast |
| 5 | |
| 6 | RemoteDdrSize calculation wraps around when booting N1Sdp in |
| 7 | multichip mode. Casting it to UINT64 to fix the issue. |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-off-by: Adam Johnston <adam.johnston@arm.com> |
| 11 | Signed-off-by: Xueliang Zhong <xueliang.zhong@arm.com> |
| 12 | Signed-off-by: sahil <sahil@arm.com> |
| 13 | Change-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 | |
| 20 | diff --git a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c |
| 21 | index 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;
|
| 33 | diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c |
| 34 | index 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 | -- |
| 47 | 2.37.2 |
| 48 | |