diff options
author | Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> | 2020-08-06 12:42:54 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-08-14 15:18:30 -0400 |
commit | c850674ff74b1625c17a77a454acec0e9cc6ec36 (patch) | |
tree | 20c947ce82954b9d7f1e619e21e193c6e19a9ff1 /board/xen | |
parent | 60e49ff1f8a0b8d48b0d12bad94d0dfb8fdbeec8 (diff) | |
download | u-boot-c850674ff74b1625c17a77a454acec0e9cc6ec36.tar.gz |
xen: Port Xen grant table driver from mini-os
Make required updates to run on u-boot.
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Diffstat (limited to 'board/xen')
-rw-r--r-- | board/xen/xenguest_arm64/xenguest_arm64.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/board/xen/xenguest_arm64/xenguest_arm64.c b/board/xen/xenguest_arm64/xenguest_arm64.c index c87ef70769..cd3693892a 100644 --- a/board/xen/xenguest_arm64/xenguest_arm64.c +++ b/board/xen/xenguest_arm64/xenguest_arm64.c @@ -21,6 +21,7 @@ #include <linux/compiler.h> +#include <xen/gnttab.h> #include <xen/hvm.h> DECLARE_GLOBAL_DATA_PTR; @@ -63,6 +64,8 @@ static int setup_mem_map(void) struct fdt_resource res; const void *blob = gd->fdt_blob; u64 gfn; + phys_addr_t gnttab_base; + phys_size_t gnttab_sz; /* * Add "magic" region which is used by Xen to provide some essentials @@ -96,6 +99,16 @@ static int setup_mem_map(void) PTE_BLOCK_INNER_SHARE); i++; + /* Get Xen's suggested physical page assignments for the grant table. */ + get_gnttab_base(&gnttab_base, &gnttab_sz); + + xen_mem_map[i].virt = gnttab_base; + xen_mem_map[i].phys = gnttab_base; + xen_mem_map[i].size = gnttab_sz; + xen_mem_map[i].attrs = (PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE); + i++; + mem = get_next_memory_node(blob, -1); if (mem < 0) { printf("%s: Missing /memory node\n", __func__); |