HV: prepare ve820 for apl nuc

Add ve820 table for apl nuc board to enable prelaunched VM on it;

Tracked-On: #3214

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun 2019-06-17 10:27:51 +08:00 committed by wenlingz
parent 2ec1694901
commit f18dfcf522
1 changed files with 35 additions and 2 deletions

View File

@ -6,11 +6,44 @@
#include <vm.h>
#define VE820_ENTRIES_APL_NUC 5U
static const struct e820_entry ve820_entry[VE820_ENTRIES_APL_NUC] = {
{ /* usable RAM under 1MB */
.baseaddr = 0x0UL,
.length = 0xF0000UL, /* 960KB */
.type = E820_TYPE_RAM
},
{ /* mptable */
.baseaddr = 0xF0000UL, /* 960KB */
.length = 0x10000UL, /* 16KB */
.type = E820_TYPE_RESERVED
},
{ /* lowmem */
.baseaddr = 0x100000UL, /* 1MB */
.length = 0x1FF00000UL, /* 511MB */
.type = E820_TYPE_RAM
},
{ /* between lowmem and PCI hole */
.baseaddr = 0x20000000UL, /* 512MB */
.length = 0xA0000000UL, /* 2560MB */
.type = E820_TYPE_RESERVED
},
{ /* between PCI hole and 4GB */
.baseaddr = 0xe0000000UL, /* 3.5GB */
.length = 0x20000000UL, /* 512MB */
.type = E820_TYPE_RESERVED
},
};
/**
* @pre vm != NULL
*/
void create_prelaunched_vm_e820(struct acrn_vm *vm)
{
vm->e820_entry_num = 0U;
vm->e820_entries = NULL;
vm->e820_entry_num = VE820_ENTRIES_APL_NUC;
vm->e820_entries = (struct e820_entry *)ve820_entry;
}