3 * Copyright (c) 2011-2014, ARM Limited. All rights reserved.
4 * Copyright (c) 2014, Linaro Limited. All rights reserved.
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
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.
18 #include <Library/MemoryAllocationLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/HobLib.h>
21 #include <Library/PcdLib.h>
34 Base
= (VOID
*)(UINTN
)FixedPcdGet64 (PcdDeviceTreeInitialBaseAddress
);
35 ASSERT (fdt_check_header (Base
) == 0);
37 FdtSize
= fdt_totalsize (Base
);
38 NewBase
= AllocatePages (EFI_SIZE_TO_PAGES (FdtSize
));
39 ASSERT (NewBase
!= NULL
);
41 CopyMem (NewBase
, Base
, FdtSize
);
42 PcdSet64 (PcdDeviceTreeBaseAddress
, (UINT64
)(UINTN
)NewBase
);
44 BuildFvHob (PcdGet64 (PcdFvBaseAddress
), PcdGet32 (PcdFvSize
));