3 Copyright (c) 2014-2017, Linaro Limited. All rights reserved.
5 This program and the accompanying materials are licensed and made available
6 under the terms and conditions of the BSD License which accompanies this
7 distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Library/ArmLib.h>
17 #include <Library/DebugLib.h>
19 STATIC ARM_MEMORY_REGION_DESCRIPTOR mVirtualMemoryTable
[2];
27 Return the Virtual Memory Map of your platform
29 This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU
32 @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR
33 describing a Physical-to-Virtual Memory
34 mapping. This array must be ended by a
35 zero-filled entry. The allocated memory
42 OUT ARM_MEMORY_REGION_DESCRIPTOR
**VirtualMemoryMap
45 ASSERT (VirtualMemoryMap
!= NULL
);
48 // Map the entire physical memory space as cached. The only device
49 // we care about is the GIC, which will be stage 2 mapped as a device
50 // by the hypervisor, overriding the cached mapping we install here.
52 mVirtualMemoryTable
[0].PhysicalBase
= 0x0;
53 mVirtualMemoryTable
[0].VirtualBase
= 0x0;
54 mVirtualMemoryTable
[0].Length
= ArmGetPhysAddrTop ();
55 mVirtualMemoryTable
[0].Attributes
= ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK
;
57 mVirtualMemoryTable
[1].PhysicalBase
= 0x0;
58 mVirtualMemoryTable
[1].VirtualBase
= 0x0;
59 mVirtualMemoryTable
[1].Length
= 0x0;
60 mVirtualMemoryTable
[1].Attributes
= 0x0;
62 *VirtualMemoryMap
= mVirtualMemoryTable
;