]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformPeiLib/PlatformPeiLib.c
ArmPlatformPkg: Increase more ARM address Pcd entries to 64-bit.
[mirror_edk2.git] / ArmPlatformPkg / ArmVirtualizationPkg / Library / PlatformPeiLib / PlatformPeiLib.c
CommitLineData
433b31dd
AB
1/** @file\r
2*\r
bb5420bb 3* Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
433b31dd
AB
4* Copyright (c) 2014, Linaro Limited. All rights reserved.\r
5*\r
6* This program and the accompanying materials\r
7* are licensed and made available under the terms and conditions of the BSD License\r
8* which accompanies this distribution. The full text of the license may be found at\r
9* http://opensource.org/licenses/bsd-license.php\r
10*\r
11* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13*\r
14**/\r
15\r
16#include <PiPei.h>\r
17\r
18#include <Library/MemoryAllocationLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/HobLib.h>\r
21#include <Library/PcdLib.h>\r
22#include <libfdt.h>\r
23\r
24EFI_STATUS\r
25EFIAPI\r
26PlatformPeim (\r
27 VOID\r
28 )\r
29{\r
30 VOID *Base;\r
31 VOID *NewBase;\r
32 UINTN FdtSize;\r
33\r
34 Base = (VOID*)(UINTN)FixedPcdGet64 (PcdDeviceTreeInitialBaseAddress);\r
35 ASSERT (fdt_check_header (Base) == 0);\r
36\r
37 FdtSize = fdt_totalsize (Base);\r
38 NewBase = AllocatePages (EFI_SIZE_TO_PAGES (FdtSize));\r
39 ASSERT (NewBase != NULL);\r
40\r
41 CopyMem (NewBase, Base, FdtSize);\r
42 PcdSet64 (PcdDeviceTreeBaseAddress, (UINT64)(UINTN)NewBase);\r
43\r
bb5420bb 44 BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize));\r
433b31dd
AB
45\r
46 return EFI_SUCCESS;\r
47}\r