Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 1 | From ba3ed154863d1acd0996178beaf3a2bc693b938c Mon Sep 17 00:00:00 2001 |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 2 | From: sahil <sahil@arm.com> |
| 3 | Date: Wed, 20 Apr 2022 12:24:41 +0530 |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 4 | Subject: [PATCH] Platform/ARM/N1Sdp: Fix RemoteDdrSize cast |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 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> |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 13 | Change-Id: Ic51269a8d67669684a5f056701cfbef6beb23da2 |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 14 | --- |
| 15 | .../ConfigurationManagerDxe/ConfigurationManager.c | 2 +- |
| 16 | Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c | 2 +- |
| 17 | 2 files changed, 2 insertions(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 20 | index c15020f5..b11c0425 100644 |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 21 | --- 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;
|
| 32 | diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame^] | 33 | index 1d53ec75..5cacd437 100644 |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 34 | --- 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,
|