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