mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 20:59:41 +02:00

Add a new xen-rpi-u-boot-scr recipe to PROVIDE u-boot-default-script instead of using a bbappend to rpi-u-boot-scr. This allows the new recipe to be selected by indicating it as PREFERRED_PROVIDER of u-boot-default-script, and then do that in the Xen on Raspberry Pi 4 config file, xen-raspberrypi4-64.inc. Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
56 lines
1.7 KiB
Plaintext
56 lines
1.7 KiB
Plaintext
# Set the fdt address to what came from the GPU, so we can edit it
|
|
fdt addr ${fdt_addr}
|
|
|
|
# Pull the bootargs that the GPU has edited
|
|
fdt get value bootargs /chosen bootargs
|
|
|
|
# Set module load addresses
|
|
setenv xen_loadaddr "0x00200000"
|
|
setenv kernel_loadaddr "0x00400000"
|
|
|
|
# Add some space to the fdt so we can edit it
|
|
fdt resize 0x1000
|
|
echo Add boot arguments for Xen
|
|
fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/soc/serial@7e215040 dom0_mem='@@RPI_DOM0_MEM@@' @@RPI_DEBUG_XEN_ARGS@@"
|
|
|
|
echo Add boot arguments for dom0
|
|
setenv dom0_bootargs "console=hvc0 earlycon=xenboot debug root=/dev/mmcblk0p2 rootwait"
|
|
fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\"
|
|
|
|
echo Add a dom0 node to chosen to put Linux boot information in
|
|
fdt mknode /chosen dom0
|
|
|
|
echo Set this for the Linux boot command
|
|
fdt set /chosen/dom0 compatible "multiboot,module"
|
|
|
|
# Tell Xen where PCI is
|
|
fdt set /scb/pcie@7d500000 device_type "pci"
|
|
# Workaround to fix:
|
|
# "Unable to retrieve address 0 for /scb/pcie@7d500000/pci@1,0/usb@1,0"
|
|
fdt rm /scb/pcie@7d500000/pci@1,0/usb@1,0
|
|
|
|
echo Delay to allow the MMC card to be ready
|
|
sleep 1
|
|
|
|
echo Load Xen into memory
|
|
fatload mmc 1:1 ${xen_loadaddr} xen
|
|
echo Xen loaded, size: 0x$filesize
|
|
|
|
echo Load Linux kernel into memory
|
|
fatload mmc 1:1 ${kernel_loadaddr} Image
|
|
setenv kernel_size 0x$filesize
|
|
echo Linux loaded, size: 0x$filesize
|
|
|
|
echo Set the address and size for the Linux kernel so Xen can pick it up
|
|
fdt set /chosen/dom0 reg <${kernel_loadaddr} ${kernel_size}>
|
|
|
|
# Define the size and address cells
|
|
fdt set /chosen '#size-cells' <1>
|
|
fdt set /chosen '#address-cells' <1>
|
|
|
|
# Display the chosen fdt section - can be important for debugging
|
|
fdt print /chosen
|
|
|
|
echo Boot Xen
|
|
booti ${xen_loadaddr} - ${fdt_addr}
|