X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ArmPlatformPkg%2FMemoryInitPei%2FMemoryInitPeim.c;h=485dad0ac8e1968f599db19ce60e18c7c915ce18;hb=b0663641c977f97bef785c86978603c3a31a3d1c;hp=1de7d38078c506a5684d3f9bf19739a450782c41;hpb=f92b93c9a31a763b2848fda804f1198eea571de7;p=mirror_edk2.git diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c old mode 100755 new mode 100644 index 1de7d38078..485dad0ac8 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c @@ -1,14 +1,8 @@ /** @file * * Copyright (c) 2011, ARM Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the BSD License -* which accompanies this distribution. The full text of the license may be found at -* http://opensource.org/licenses/bsd-license.php * -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +* SPDX-License-Identifier: BSD-2-Clause-Patent * **/ @@ -63,7 +57,7 @@ BuildMemoryTypeInformationHob ( Info[7].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderCode); Info[8].Type = EfiLoaderData; Info[8].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderData); - + // Terminator for the list Info[9].Type = EfiMaxMemoryType; Info[9].NumberOfPages = 0; @@ -75,13 +69,13 @@ BuildMemoryTypeInformationHob ( Routine Description: - + Arguments: FileHandle - Handle of the file being invoked. PeiServices - Describes the list of possible PEI Services. - + Returns: Status - EFI_SUCCESS if the boot mode could be set @@ -96,28 +90,24 @@ InitializeMemory ( { EFI_STATUS Status; UINTN SystemMemoryBase; - UINTN SystemMemoryTop; + UINT64 SystemMemoryTop; UINTN FdBase; UINTN FdTop; UINTN UefiMemoryBase; - DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n")); + DEBUG ((EFI_D_LOAD | EFI_D_INFO, "Memory Init PEIM Loaded\n")); // Ensure PcdSystemMemorySize has been set - ASSERT (FixedPcdGet32 (PcdSystemMemorySize) != 0); - - SystemMemoryBase = (UINTN)FixedPcdGet32 (PcdSystemMemoryBase); - SystemMemoryTop = SystemMemoryBase + (UINTN)FixedPcdGet32 (PcdSystemMemorySize); - FdBase = (UINTN)PcdGet32 (PcdFdBaseAddress); - FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize); + ASSERT (PcdGet64 (PcdSystemMemorySize) != 0); + ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ALLOC_ADDRESS); - // - // Initialize the System Memory (DRAM) - // - if (!FeaturePcdGet (PcdSystemMemoryInitializeInSec)) { - // In case the DRAM has not been initialized by the secure firmware - ArmPlatformInitializeSystemMemory (); + SystemMemoryBase = (UINTN)PcdGet64 (PcdSystemMemoryBase); + SystemMemoryTop = SystemMemoryBase + PcdGet64 (PcdSystemMemorySize); + if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) { + SystemMemoryTop = (UINT64)MAX_ALLOC_ADDRESS + 1; } + FdBase = (UINTN)PcdGet64 (PcdFdBaseAddress); + FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize); // // Declare the UEFI memory to PEI