1.. SPDX-License-Identifier: GPL-2.0+
2
3Xen guest ARM64 board
4=====================
5
6This board specification
7------------------------
8
9This board is to be run as a virtual Xen [1] guest with U-boot as its primary
10bootloader. Xen is a type 1 hypervisor that allows multiple operating systems
11to run simultaneously on a single physical server. Xen is capable of running
12virtual machines in both full virtualization and para-virtualization (PV)
13modes. Xen runs virtual machines, which are called “domains”.
14
15Paravirtualized drivers are a special type of device drivers that are used in
16a guest system in the Xen domain and perform I/O operations using a special
17interface provided by the virtualization system and the host system.
18
19Xen support for U-boot is implemented by introducing a new Xen guest ARM64
20board and porting essential drivers from MiniOS [3] as well as some of the work
21previously done by NXP [4]:
22
23- PV block device frontend driver with XenStore based device enumeration and
24  UCLASS_PVBLOCK class;
25- PV serial console device frontend driver;
26- Xen hypervisor support with minimal set of the essential headers adapted from
27  the Linux kernel;
28- Xen grant table support;
29- Xen event channel support in polling mode;
30- XenBus support;
31- dynamic RAM size as defined in the device tree instead of the statically
32  defined values;
33- position-independent pre-relocation code is used as we cannot statically
34  define any start addresses at compile time which is up to Xen to choose at
35  run-time;
36- new defconfig introduced: xenguest_arm64_defconfig.
37
38
39Board limitations
40-----------------
41
421. U-boot runs without MMU enabled at the early stages.
43   According to Xen on ARM ABI (xen/include/public/arch-arm.h): all memory
44   which is shared with other entities in the system (including the hypervisor
45   and other guests) must reside in memory which is mapped as Normal Inner
46   Write-Back Outer Write-Back Inner-Shareable.
47   Thus, page attributes must be equally set for all the entities working with
48   that page.
49   Before MMU is set up the data cache is turned off and pages are seen by the
50   vCPU and Xen in different ways - cacheable by Xen and non-cacheable by vCPU.
51   So it means that manual data cache maintenance is required at the early
52   stages.
53
542. No serial console until MMU is up.
55   Because data cache maintenance is required until the MMU setup the
56   early/debug serial console is not implemented. Therefore, we do not have
57   usual prints like U-boot’s banner etc. until the serial driver is
58   initialized.
59
603. Single RAM bank supported.
61   If a Xen guest is given much memory it is possible that Xen allocates two
62   memory banks for it. The first one is allocated under 4GB address space and
63   in some cases may represent the whole guest’s memory. It is assumed that
64   U-boot most likely won’t require high memory bank for its work andlaunching
65   OS, so it is enough to take the first one.
66
67
68Board default configuration
69---------------------------
70
71One can select the configuration as follows:
72
73 - make xenguest_arm64_defconfig
74
75[1] - https://xenproject.org/
76
77[2] - https://wiki.xenproject.org/wiki/Paravirtualization_(PV)
78
79[3] - https://wiki.xenproject.org/wiki/Mini-OS
80
81[4] - https://source.codeaurora.org/external/imx/uboot-imx/tree/?h=imx_v2018.03_4.14.98_2.0.0_ga
82