summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in
diff options
context:
space:
mode:
authorChristopher Clark <christopher.w.clark@gmail.com>2020-06-29 18:54:49 -0700
committerBruce Ashfield <bruce.ashfield@gmail.com>2020-07-06 16:25:56 -0400
commit90a01fcbd93d2efc94ca5d296e6a5d45fa9778ec (patch)
treead8428f4f0ad629255fbe5d615a19e049e5275a5 /dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in
parent4c0e161157be1111c03367da82f690ec7cf6c9e2 (diff)
downloadmeta-virtualization-90a01fcbd93d2efc94ca5d296e6a5d45fa9778ec.tar.gz
xen, raspberry pi: add dynamic-layer for Xen configuration for Rpi4
A Xen-specific u-boot script is needed for launching Xen, and the GIC (interrupt controller) needs to be enabled. Since this is both Xen-specific and Raspberry Pi-specific, use a dynamic layer to conditionally enable the recipes when both meta-virtualization and meta-raspberrypi are in use together. Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in')
-rw-r--r--dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in49
1 files changed, 49 insertions, 0 deletions
diff --git a/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in b/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in
new file mode 100644
index 00000000..6c38d7d7
--- /dev/null
+++ b/dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in
@@ -0,0 +1,49 @@
1# Set the fdt address to what came from the GPU, so we can edit it
2fdt addr ${fdt_addr}
3
4# Pull the bootargs that the GPU has edited
5fdt get value bootargs /chosen bootargs
6
7# Set module load addresses
8setenv xen_loadaddr "0x00200000"
9setenv kernel_loadaddr "0x00400000"
10
11# Add some space to the fdt so we can edit it
12fdt resize 0x1000
13echo Add boot arguments for Xen
14fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/soc/serial@7e215040 dom0_mem='@@RPI_DOM0_MEM@@' @@RPI_DEBUG_XEN_ARGS@@"
15
16echo Add boot arguments for dom0
17setenv dom0_bootargs "console=hvc0 earlyprintk=xen debug root=/dev/mmcblk0p2 rootwait"
18fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\"
19
20echo Add a dom0 node to chosen to put Linux boot information in
21fdt mknode /chosen dom0
22
23echo Set this for the Linux boot command
24fdt set /chosen/dom0 compatible "xen,linux-zimage", "xen,multiboot-module"
25
26# Tell Xen where PCI is
27fdt set /scb/pcie@7d500000 device_type "pci"
28
29echo Delay to allow the MMC card to be ready
30sleep 1
31
32echo Load Xen into memory
33fatload mmc 0:1 ${xen_loadaddr} xen
34echo Load Linux kernel into memory
35fatload mmc 0:1 ${kernel_loadaddr} Image
36setenv kernel_size 0x$filesize
37
38echo Set the address and size for the Linux kernel so Xen can pick it up
39fdt set /chosen/dom0 reg <${kernel_loadaddr} ${kernel_size}>
40
41# Define the size and address cells
42fdt set /chosen '#size-cells' <1>
43fdt set /chosen '#address-cells' <1>
44
45# Display the chosen fdt section - can be important for debugging
46fdt print /chosen
47
48echo Boot Xen
49booti ${xen_loadaddr} - ${fdt_addr}