Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame^] | 1 | From cc58709b32d74273736886ccfc08e4723a436ea4 Mon Sep 17 00:00:00 2001 |
| 2 | From: sahil <sahil@arm.com> |
| 3 | Date: Thu, 17 Mar 2022 16:28:05 +0530 |
| 4 | Subject: [PATCH] Platform/ARM/N1sdp: Add support to parse NT_FW_CONFIG |
| 5 | |
| 6 | NT_FW_CONFIG DTB contains platform information passed by |
| 7 | Tf-A boot stage. |
| 8 | This information is used for Virtual memory map generation |
| 9 | during PEI phase and passed on to DXE phase as a HOB, where |
| 10 | it is used in ConfigurationManagerDxe. |
| 11 | |
| 12 | Upstream-Status: Pending |
| 13 | Signed-off-by: Adam Johnston <adam.johnston@arm.com> |
| 14 | Signed-off-by: sahil <sahil@arm.com> |
| 15 | Change-Id: Ib82571280bf1ca5febe5766e618de09e7b70bb02 |
| 16 | |
| 17 | --- |
| 18 | .../ConfigurationManager.c | 24 ++-- |
| 19 | .../ConfigurationManagerDxe.inf | 3 +- |
| 20 | .../ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h | 16 +-- |
| 21 | .../Library/PlatformLib/AArch64/Helper.S | 4 +- |
| 22 | .../Library/PlatformLib/PlatformLib.c | 12 +- |
| 23 | .../Library/PlatformLib/PlatformLib.inf | 8 +- |
| 24 | .../Library/PlatformLib/PlatformLibMem.c | 103 +++++++++++++++++- |
| 25 | Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec | 7 +- |
| 26 | 8 files changed, 152 insertions(+), 25 deletions(-) |
| 27 | |
| 28 | diff --git a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c |
| 29 | index f50623ae3f..e023d47cfd 100644 |
| 30 | --- a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c |
| 31 | +++ b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c |
| 32 | @@ -1,7 +1,7 @@ |
| 33 | /** @file
|
| 34 | Configuration Manager Dxe
|
| 35 |
|
| 36 | - Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
|
| 37 | + Copyright (c) 2021 - 2022, ARM Limited. All rights reserved.<BR>
|
| 38 |
|
| 39 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 40 |
|
| 41 | @@ -16,6 +16,7 @@ |
| 42 | #include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
|
| 43 | #include <Library/ArmLib.h>
|
| 44 | #include <Library/DebugLib.h>
|
| 45 | +#include <Library/HobLib.h>
|
| 46 | #include <Library/IoLib.h>
|
| 47 | #include <Library/PcdLib.h>
|
| 48 | #include <Library/UefiBootServicesTableLib.h>
|
| 49 | @@ -28,6 +29,7 @@ |
| 50 | #include "Platform.h"
|
| 51 |
|
| 52 | extern struct EFI_ACPI_HETEROGENEOUS_MEMORY_ATTRIBUTE_TABLE Hmat;
|
| 53 | +static NEOVERSEN1SOC_PLAT_INFO *PlatInfo;
|
| 54 |
|
| 55 | /** The platform configuration repository information.
|
| 56 | */
|
| 57 | @@ -1242,13 +1244,11 @@ InitializePlatformRepository ( |
| 58 | IN EDKII_PLATFORM_REPOSITORY_INFO * CONST PlatRepoInfo
|
| 59 | )
|
| 60 | {
|
| 61 | - NEOVERSEN1SOC_PLAT_INFO *PlatInfo;
|
| 62 | UINT64 Dram2Size;
|
| 63 | UINT64 RemoteDdrSize;
|
| 64 |
|
| 65 | RemoteDdrSize = 0;
|
| 66 |
|
| 67 | - PlatInfo = (NEOVERSEN1SOC_PLAT_INFO *)NEOVERSEN1SOC_PLAT_INFO_STRUCT_BASE;
|
| 68 | Dram2Size = ((PlatInfo->LocalDdrSize - 2) * SIZE_1GB);
|
| 69 |
|
| 70 | PlatRepoInfo->MemAffInfo[LOCAL_DDR_REGION2].Length = Dram2Size;
|
| 71 | @@ -1512,7 +1512,6 @@ GetGicCInfo ( |
| 72 | )
|
| 73 | {
|
| 74 | EDKII_PLATFORM_REPOSITORY_INFO * PlatformRepo;
|
| 75 | - NEOVERSEN1SOC_PLAT_INFO *PlatInfo;
|
| 76 | UINT32 TotalObjCount;
|
| 77 | UINT32 ObjIndex;
|
| 78 |
|
| 79 | @@ -1523,7 +1522,6 @@ GetGicCInfo ( |
| 80 | }
|
| 81 |
|
| 82 | PlatformRepo = This->PlatRepoInfo;
|
| 83 | - PlatInfo = (NEOVERSEN1SOC_PLAT_INFO *)NEOVERSEN1SOC_PLAT_INFO_STRUCT_BASE;
|
| 84 |
|
| 85 | if (PlatInfo->MultichipMode == 1) {
|
| 86 | TotalObjCount = PLAT_CPU_COUNT * 2;
|
| 87 | @@ -1623,7 +1621,6 @@ GetStandardNameSpaceObject ( |
| 88 | {
|
| 89 | EFI_STATUS Status;
|
| 90 | EDKII_PLATFORM_REPOSITORY_INFO * PlatformRepo;
|
| 91 | - NEOVERSEN1SOC_PLAT_INFO *PlatInfo;
|
| 92 | UINT32 AcpiTableCount;
|
| 93 |
|
| 94 | if ((This == NULL) || (CmObject == NULL)) {
|
| 95 | @@ -1634,7 +1631,7 @@ GetStandardNameSpaceObject ( |
| 96 |
|
| 97 | Status = EFI_NOT_FOUND;
|
| 98 | PlatformRepo = This->PlatRepoInfo;
|
| 99 | - PlatInfo = (NEOVERSEN1SOC_PLAT_INFO *)NEOVERSEN1SOC_PLAT_INFO_STRUCT_BASE;
|
| 100 | +
|
| 101 | AcpiTableCount = ARRAY_SIZE (PlatformRepo->CmAcpiTableList);
|
| 102 | if (PlatInfo->MultichipMode == 0)
|
| 103 | AcpiTableCount -= 1;
|
| 104 | @@ -1697,7 +1694,6 @@ GetArmNameSpaceObject ( |
| 105 | {
|
| 106 | EFI_STATUS Status;
|
| 107 | EDKII_PLATFORM_REPOSITORY_INFO * PlatformRepo;
|
| 108 | - NEOVERSEN1SOC_PLAT_INFO *PlatInfo;
|
| 109 | UINT32 GicRedistCount;
|
| 110 | UINT32 GicCpuCount;
|
| 111 | UINT32 ProcHierarchyInfoCount;
|
| 112 | @@ -1718,8 +1714,6 @@ GetArmNameSpaceObject ( |
| 113 | Status = EFI_NOT_FOUND;
|
| 114 | PlatformRepo = This->PlatRepoInfo;
|
| 115 |
|
| 116 | - // Probe for multi chip information
|
| 117 | - PlatInfo = (NEOVERSEN1SOC_PLAT_INFO *)NEOVERSEN1SOC_PLAT_INFO_STRUCT_BASE;
|
| 118 | if (PlatInfo->MultichipMode == 1) {
|
| 119 | GicRedistCount = 2;
|
| 120 | GicCpuCount = PLAT_CPU_COUNT * 2;
|
| 121 | @@ -2162,8 +2156,18 @@ ConfigurationManagerDxeInitialize ( |
| 122 | IN EFI_SYSTEM_TABLE * SystemTable
|
| 123 | )
|
| 124 | {
|
| 125 | + VOID *PlatInfoHob;
|
| 126 | EFI_STATUS Status;
|
| 127 |
|
| 128 | + PlatInfoHob = GetFirstGuidHob (&gArmNeoverseN1SocPlatformInfoDescriptorGuid);
|
| 129 | +
|
| 130 | + if (PlatInfoHob == NULL) {
|
| 131 | + DEBUG ((DEBUG_ERROR, "Platform HOB is NULL\n"));
|
| 132 | + return EFI_NOT_FOUND;
|
| 133 | + }
|
| 134 | +
|
| 135 | + PlatInfo = (NEOVERSEN1SOC_PLAT_INFO *)GET_GUID_HOB_DATA (PlatInfoHob);
|
| 136 | +
|
| 137 | // Initialize the Platform Configuration Repository before installing the
|
| 138 | // Configuration Manager Protocol
|
| 139 | Status = InitializePlatformRepository (
|
| 140 | diff --git a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf |
| 141 | index 4f8e7f1302..fb59c29501 100644 |
| 142 | --- a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf |
| 143 | +++ b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf |
| 144 | @@ -1,7 +1,7 @@ |
| 145 | ## @file
|
| 146 | # Configuration Manager Dxe
|
| 147 | #
|
| 148 | -# Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
|
| 149 | +# Copyright (c) 2021 - 2022, ARM Limited. All rights reserved.<BR>
|
| 150 | #
|
| 151 | # SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 152 | #
|
| 153 | @@ -42,6 +42,7 @@ |
| 154 |
|
| 155 | [LibraryClasses]
|
| 156 | ArmPlatformLib
|
| 157 | + HobLib
|
| 158 | PrintLib
|
| 159 | UefiBootServicesTableLib
|
| 160 | UefiDriverEntryPoint
|
| 161 | diff --git a/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h b/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h |
| 162 | index 097160c7e2..63cebaf0e0 100644 |
| 163 | --- a/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h |
| 164 | +++ b/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h |
| 165 | @@ -1,6 +1,6 @@ |
| 166 | /** @file
|
| 167 | *
|
| 168 | -* Copyright (c) 2018 - 2020, ARM Limited. All rights reserved.
|
| 169 | +* Copyright (c) 2018 - 2022, ARM Limited. All rights reserved.
|
| 170 | *
|
| 171 | * SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 172 | *
|
| 173 | @@ -41,11 +41,6 @@ |
| 174 | #define NEOVERSEN1SOC_EXP_PERIPH_BASE0 0x1C000000
|
| 175 | #define NEOVERSEN1SOC_EXP_PERIPH_BASE0_SZ 0x1300000
|
| 176 |
|
| 177 | -// Base address to a structure of type NEOVERSEN1SOC_PLAT_INFO which is
|
| 178 | -// pre-populated by a earlier boot stage
|
| 179 | -#define NEOVERSEN1SOC_PLAT_INFO_STRUCT_BASE (NEOVERSEN1SOC_NON_SECURE_SRAM_BASE + \
|
| 180 | - 0x00008000)
|
| 181 | -
|
| 182 | /*
|
| 183 | * Platform information structure stored in Non-secure SRAM. Platform
|
| 184 | * information are passed from the trusted firmware with the below structure
|
| 185 | @@ -55,12 +50,17 @@ |
| 186 | typedef struct {
|
| 187 | /*! 0 - Single Chip, 1 - Chip to Chip (C2C) */
|
| 188 | UINT8 MultichipMode;
|
| 189 | - /*! Slave count in C2C mode */
|
| 190 | - UINT8 SlaveCount;
|
| 191 | + /*! Secondary chip count in C2C mode */
|
| 192 | + UINT8 SecondaryChipCount;
|
| 193 | /*! Local DDR memory size in GigaBytes */
|
| 194 | UINT8 LocalDdrSize;
|
| 195 | /*! Remote DDR memory size in GigaBytes */
|
| 196 | UINT8 RemoteDdrSize;
|
| 197 | } NEOVERSEN1SOC_PLAT_INFO;
|
| 198 |
|
| 199 | +// NT_FW_CONFIG DT structure
|
| 200 | +typedef struct {
|
| 201 | + UINT64 NtFwConfigDtAddr;
|
| 202 | +} NEOVERSEN1SOC_NT_FW_CONFIG_INFO_PPI;
|
| 203 | +
|
| 204 | #endif
|
| 205 | diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/AArch64/Helper.S b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/AArch64/Helper.S |
| 206 | index 8d2069dea8..88ed640d29 100644 |
| 207 | --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/AArch64/Helper.S |
| 208 | +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/AArch64/Helper.S |
| 209 | @@ -1,6 +1,6 @@ |
| 210 | /** @file
|
| 211 | *
|
| 212 | -* Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.
|
| 213 | +* Copyright (c) 2019 - 2022, ARM Limited. All rights reserved.
|
| 214 | *
|
| 215 | * SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 216 | *
|
| 217 | @@ -25,6 +25,8 @@ GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore) |
| 218 | // the UEFI firmware through the CPU registers.
|
| 219 | //
|
| 220 | ASM_PFX(ArmPlatformPeiBootAction):
|
| 221 | + adr x10, NtFwConfigDtBlob
|
| 222 | + str x0, [x10]
|
| 223 | ret
|
| 224 |
|
| 225 | //
|
| 226 | diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c |
| 227 | index c0effd37f3..fabe902cd0 100644 |
| 228 | --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c |
| 229 | +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c |
| 230 | @@ -1,6 +1,6 @@ |
| 231 | /** @file
|
| 232 |
|
| 233 | - Copyright (c) 2018-2021, ARM Limited. All rights reserved.<BR>
|
| 234 | + Copyright (c) 2018 - 2022, ARM Limited. All rights reserved.<BR>
|
| 235 |
|
| 236 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 237 |
|
| 238 | @@ -8,8 +8,12 @@ |
| 239 |
|
| 240 | #include <Library/ArmPlatformLib.h>
|
| 241 | #include <Library/BaseLib.h>
|
| 242 | +#include <NeoverseN1Soc.h>
|
| 243 | #include <Ppi/ArmMpCoreInfo.h>
|
| 244 |
|
| 245 | +UINT64 NtFwConfigDtBlob;
|
| 246 | +STATIC NEOVERSEN1SOC_NT_FW_CONFIG_INFO_PPI mNtFwConfigDtInfoPpi;
|
| 247 | +
|
| 248 | STATIC ARM_CORE_INFO mCoreInfoTable[] = {
|
| 249 | { 0x0, 0x0 }, // Cluster 0, Core 0
|
| 250 | { 0x0, 0x1 }, // Cluster 0, Core 1
|
| 251 | @@ -46,6 +50,7 @@ ArmPlatformInitialize ( |
| 252 | IN UINTN MpId
|
| 253 | )
|
| 254 | {
|
| 255 | + mNtFwConfigDtInfoPpi.NtFwConfigDtAddr = NtFwConfigDtBlob;
|
| 256 | return RETURN_SUCCESS;
|
| 257 | }
|
| 258 |
|
| 259 | @@ -80,6 +85,11 @@ EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = { |
| 260 | EFI_PEI_PPI_DESCRIPTOR_PPI,
|
| 261 | &gArmMpCoreInfoPpiGuid,
|
| 262 | &mMpCoreInfoPpi
|
| 263 | + },
|
| 264 | + {
|
| 265 | + EFI_PEI_PPI_DESCRIPTOR_PPI,
|
| 266 | + &gNtFwConfigDtInfoPpiGuid,
|
| 267 | + &mNtFwConfigDtInfoPpi
|
| 268 | }
|
| 269 | };
|
| 270 |
|
| 271 | diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf |
| 272 | index 96e590cdd8..6f9c9d5ab6 100644 |
| 273 | --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf |
| 274 | +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf |
| 275 | @@ -1,7 +1,7 @@ |
| 276 | ## @file
|
| 277 | # Platform Library for N1Sdp.
|
| 278 | #
|
| 279 | -# Copyright (c) 2018-2021, ARM Limited. All rights reserved.<BR>
|
| 280 | +# Copyright (c) 2018 - 2022, ARM Limited. All rights reserved.<BR>
|
| 281 | #
|
| 282 | # SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 283 | #
|
| 284 | @@ -18,10 +18,14 @@ |
| 285 | [Packages]
|
| 286 | ArmPkg/ArmPkg.dec
|
| 287 | ArmPlatformPkg/ArmPlatformPkg.dec
|
| 288 | + EmbeddedPkg/EmbeddedPkg.dec
|
| 289 | MdeModulePkg/MdeModulePkg.dec
|
| 290 | MdePkg/MdePkg.dec
|
| 291 | Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
|
| 292 |
|
| 293 | +[LibraryClasses]
|
| 294 | + FdtLib
|
| 295 | +
|
| 296 | [Sources.common]
|
| 297 | PlatformLibMem.c
|
| 298 | PlatformLib.c
|
| 299 | @@ -59,7 +63,9 @@ |
| 300 | gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
| 301 |
|
| 302 | [Guids]
|
| 303 | + gArmNeoverseN1SocPlatformInfoDescriptorGuid
|
| 304 | gEfiHobListGuid ## CONSUMES ## SystemTable
|
| 305 |
|
| 306 | [Ppis]
|
| 307 | gArmMpCoreInfoPpiGuid
|
| 308 | + gNtFwConfigDtInfoPpiGuid
|
| 309 | diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c |
| 310 | index 339fa07b32..b58bda4b76 100644 |
| 311 | --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c |
| 312 | +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c |
| 313 | @@ -1,6 +1,6 @@ |
| 314 | /** @file
|
| 315 |
|
| 316 | - Copyright (c) 2018 - 2021, ARM Limited. All rights reserved.<BR>
|
| 317 | + Copyright (c) 2018 - 2022, ARM Limited. All rights reserved.<BR>
|
| 318 |
|
| 319 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 320 |
|
| 321 | @@ -10,11 +10,95 @@ |
| 322 | #include <Library/DebugLib.h>
|
| 323 | #include <Library/HobLib.h>
|
| 324 | #include <Library/MemoryAllocationLib.h>
|
| 325 | +#include <Library/PeiServicesLib.h>
|
| 326 | +#include <libfdt.h>
|
| 327 | #include <NeoverseN1Soc.h>
|
| 328 |
|
| 329 | // The total number of descriptors, including the final "end-of-table" descriptor.
|
| 330 | #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 19
|
| 331 |
|
| 332 | +/** A helper function to locate the NtFwConfig PPI and get the base address of
|
| 333 | + NT_FW_CONFIG DT from which values are obtained using FDT helper functions.
|
| 334 | +
|
| 335 | + @param [out] plat_info Pointer to the NeoverseN1Soc PLATFORM_INFO HOB
|
| 336 | +
|
| 337 | + @retval EFI_SUCCESS Success.
|
| 338 | + returns EFI_INVALID_PARAMETER A parameter is invalid.
|
| 339 | +**/
|
| 340 | +EFI_STATUS
|
| 341 | +GetNeoverseN1SocPlatInfo (
|
| 342 | + OUT NEOVERSEN1SOC_PLAT_INFO *plat_info
|
| 343 | + )
|
| 344 | +{
|
| 345 | + CONST UINT32 *Property;
|
| 346 | + INT32 Offset;
|
| 347 | + CONST VOID *NtFwCfgDtBlob;
|
| 348 | + NEOVERSEN1SOC_NT_FW_CONFIG_INFO_PPI *NtFwConfigInfoPpi;
|
| 349 | + EFI_STATUS Status;
|
| 350 | +
|
| 351 | + Status = PeiServicesLocatePpi (
|
| 352 | + &gNtFwConfigDtInfoPpiGuid,
|
| 353 | + 0,
|
| 354 | + NULL,
|
| 355 | + (VOID **)&NtFwConfigInfoPpi
|
| 356 | + );
|
| 357 | +
|
| 358 | + if (EFI_ERROR (Status)) {
|
| 359 | + DEBUG ((
|
| 360 | + DEBUG_ERROR,
|
| 361 | + "PeiServicesLocatePpi failed with error %r\n",
|
| 362 | + Status
|
| 363 | + ));
|
| 364 | + return EFI_INVALID_PARAMETER;
|
| 365 | + }
|
| 366 | +
|
| 367 | + NtFwCfgDtBlob = (VOID *)(UINTN)NtFwConfigInfoPpi->NtFwConfigDtAddr;
|
| 368 | + if (fdt_check_header (NtFwCfgDtBlob) != 0) {
|
| 369 | + DEBUG ((DEBUG_ERROR, "Invalid DTB file %p passed\n", NtFwCfgDtBlob));
|
| 370 | + return EFI_INVALID_PARAMETER;
|
| 371 | + }
|
| 372 | +
|
| 373 | + Offset = fdt_subnode_offset (NtFwCfgDtBlob, 0, "platform-info");
|
| 374 | + if (Offset == -FDT_ERR_NOTFOUND) {
|
| 375 | + DEBUG ((DEBUG_ERROR, "Invalid DTB : platform-info node not found\n"));
|
| 376 | + return EFI_INVALID_PARAMETER;
|
| 377 | + }
|
| 378 | +
|
| 379 | + Property = fdt_getprop (NtFwCfgDtBlob, Offset, "local-ddr-size", NULL);
|
| 380 | + if (Property == NULL) {
|
| 381 | + DEBUG ((DEBUG_ERROR, "local-ddr-size property not found\n"));
|
| 382 | + return EFI_INVALID_PARAMETER;
|
| 383 | + }
|
| 384 | +
|
| 385 | + plat_info->LocalDdrSize = fdt32_to_cpu (*Property);
|
| 386 | +
|
| 387 | + Property = fdt_getprop (NtFwCfgDtBlob, Offset, "remote-ddr-size", NULL);
|
| 388 | + if (Property == NULL) {
|
| 389 | + DEBUG ((DEBUG_ERROR, "remote-ddr-size property not found\n"));
|
| 390 | + return EFI_INVALID_PARAMETER;
|
| 391 | + }
|
| 392 | +
|
| 393 | + plat_info->RemoteDdrSize = fdt32_to_cpu (*Property);
|
| 394 | +
|
| 395 | + Property = fdt_getprop (NtFwCfgDtBlob, Offset, "secondary-chip-count", NULL);
|
| 396 | + if (Property == NULL) {
|
| 397 | + DEBUG ((DEBUG_ERROR, "secondary-chip-count property not found\n"));
|
| 398 | + return EFI_INVALID_PARAMETER;
|
| 399 | + }
|
| 400 | +
|
| 401 | + plat_info->SecondaryChipCount = fdt32_to_cpu (*Property);
|
| 402 | +
|
| 403 | + Property = fdt_getprop (NtFwCfgDtBlob, Offset, "multichip-mode", NULL);
|
| 404 | + if (Property == NULL) {
|
| 405 | + DEBUG ((DEBUG_ERROR, "multichip-mode property not found\n"));
|
| 406 | + return EFI_INVALID_PARAMETER;
|
| 407 | + }
|
| 408 | +
|
| 409 | + plat_info->MultichipMode = fdt32_to_cpu (*Property);
|
| 410 | +
|
| 411 | + return EFI_SUCCESS;
|
| 412 | +}
|
| 413 | +
|
| 414 | /**
|
| 415 | Returns the Virtual Memory Map of the platform.
|
| 416 |
|
| 417 | @@ -36,9 +120,24 @@ ArmPlatformGetVirtualMemoryMap ( |
| 418 | NEOVERSEN1SOC_PLAT_INFO *PlatInfo;
|
| 419 | UINT64 DramBlock2Size;
|
| 420 | UINT64 RemoteDdrSize;
|
| 421 | + EFI_STATUS Status;
|
| 422 |
|
| 423 | Index = 0;
|
| 424 | - PlatInfo = (NEOVERSEN1SOC_PLAT_INFO *)NEOVERSEN1SOC_PLAT_INFO_STRUCT_BASE;
|
| 425 | +
|
| 426 | + // Create platform info HOB
|
| 427 | + PlatInfo = (NEOVERSEN1SOC_PLAT_INFO *)BuildGuidHob (
|
| 428 | + &gArmNeoverseN1SocPlatformInfoDescriptorGuid,
|
| 429 | + sizeof (NEOVERSEN1SOC_PLAT_INFO)
|
| 430 | + );
|
| 431 | +
|
| 432 | + if (PlatInfo == NULL) {
|
| 433 | + DEBUG ((DEBUG_ERROR, "Platform HOB is NULL\n"));
|
| 434 | + ASSERT (FALSE);
|
| 435 | + return;
|
| 436 | + }
|
| 437 | +
|
| 438 | + Status = GetNeoverseN1SocPlatInfo (PlatInfo);
|
| 439 | + ASSERT (Status == 0);
|
| 440 | DramBlock2Size = ((UINT64)(PlatInfo->LocalDdrSize -
|
| 441 | NEOVERSEN1SOC_DRAM_BLOCK1_SIZE / SIZE_1GB) *
|
| 442 | (UINT64)SIZE_1GB);
|
| 443 | diff --git a/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec b/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec |
| 444 | index d59f25a5b9..4dea8fe1e8 100644 |
| 445 | --- a/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec |
| 446 | +++ b/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec |
| 447 | @@ -1,7 +1,7 @@ |
| 448 | ## @file
|
| 449 | # Describes the entire platform configuration.
|
| 450 | #
|
| 451 | -# Copyright (c) 2018 - 2021, ARM Limited. All rights reserved.<BR>
|
| 452 | +# Copyright (c) 2018 - 2022, ARM Limited. All rights reserved.<BR>
|
| 453 | #
|
| 454 | # SPDX-License-Identifier: BSD-2-Clause-Patent
|
| 455 | #
|
| 456 | @@ -22,6 +22,8 @@ |
| 457 | Include # Root include for the package
|
| 458 |
|
| 459 | [Guids.common]
|
| 460 | + # ARM NeoverseN1Soc Platform Info descriptor
|
| 461 | + gArmNeoverseN1SocPlatformInfoDescriptorGuid = { 0x095cb024, 0x1e00, 0x4d6f, { 0xaa, 0x34, 0x4a, 0xf8, 0xaf, 0x0e, 0xad, 0x99 } }
|
| 462 | gArmNeoverseN1SocTokenSpaceGuid = { 0xab93eb78, 0x60d7, 0x4099, { 0xac, 0xeb, 0x6d, 0xb5, 0x02, 0x58, 0x7c, 0x24 } }
|
| 463 |
|
| 464 | [PcdsFixedAtBuild]
|
| 465 | @@ -83,3 +85,6 @@ |
| 466 | gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieMmio32Translation|0x40000000000|UINT64|0x0000004F
|
| 467 | gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieMmio64Translation|0x40000000000|UINT64|0x00000050
|
| 468 | gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieSegmentNumber|2|UINT32|0x00000051
|
| 469 | +
|
| 470 | +[Ppis]
|
| 471 | + gNtFwConfigDtInfoPpiGuid = { 0xb50dee0e, 0x577f, 0x47fb, { 0x83, 0xd0, 0x41, 0x78, 0x61, 0x8b, 0x33, 0x8a } }
|
| 472 | -- |
| 473 | 2.17.1 |
| 474 | |