aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd
blob: 24cfb1658e6d6315b2e0a29045c773c7597cc230 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2020, MERA
#
# Author: Leonid Lazarev
#
# Xen Boot Script
#
# https://www.raspberrypi.org/documentation/configuration/device-tree.md
# We do not set fdt_addr, because device tree initially is loaded by raspberry pi firmware loader and the particular
# modification are performed. The prepared DTS is propagated to u-boot and this prepared device tree has to be reused.

setenv kernel_addr_r  0x00480000  # 16M
setenv xen_addr_r     0x00200000 # 2M

# Load xen to ${xen_addr_r}.
fatload mmc 0:1 ${xen_addr_r} /xen-@@MACHINE@@

#configure dom0
fdt addr ${fdt_addr}

#read prepared bootargs, rapsberry pi prepared initial list of the parameters for loading
fdt get value bootargs /chosen bootargs
fdt resize 8192

# add device type for raspberry
fdt set pcie0 device_type "pci"

fdt chosen
fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>

# Load Linux Image to ${kernel_addr_r}
fatload mmc 0:1 ${kernel_addr_r} /@@KERNEL_IMAGETYPE@@

# we load dom0 with 1512 MB of memory
fdt mknod /chosen dom0
fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/soc/serial@7e215040 sync_console dom0_mem=1512M bootscrub=0"
fdt set /chosen xen,dom0-bootargs "${bootargs}"

fdt set /chosen/dom0 compatible "xen,linux-zimage", "xen,multiboot-module"
fdt set /chosen/dom0 reg <${kernel_addr_r} 0x${filesize} >

@@KERNEL_BOOTCMD@@ ${xen_addr_r} - ${fdt_addr}