summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2023-07-27 17:22:29 -0600
committerBruce Ashfield <bruce.ashfield@gmail.com>2023-08-01 14:41:45 -0400
commit7332b594729085c5cd74fdad516ff977578017fc (patch)
tree27fb5c3f081dde9f48460d45fa8bcd6e83b110f6 /dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr
parentc9b65ee0e53cba999b8061b72039f108187b9600 (diff)
downloadmeta-virtualization-7332b594729085c5cd74fdad516ff977578017fc.tar.gz
recipes-bsp: Add u-boot-xlnx scripts for Xen support
Add new boot.cmd.xen to u-boot-xlnx-scr bbappend to enable Xen support for ZynqMP and Versal devices. User can enable xen u-boot script by adding below variable from configuration file. BOOTMODE = "xen" This u-boot script also supports to configure below Xen params from configuration file params variable assignment ------ ------------------- duart XEN_SERIAL_CONSOLES = "serial0" dom0_mem DOM0_MEM = "1500M" dom0_max_vcpus DOM0_MAX_VCPUS = "1" extra params XEN_CMDLINE_APPEND = "loglvl=all" Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr')
-rw-r--r--dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.xen80
1 files changed, 80 insertions, 0 deletions
diff --git a/dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.xen b/dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.xen
new file mode 100644
index 00000000..25e5842c
--- /dev/null
+++ b/dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr/boot.cmd.xen
@@ -0,0 +1,80 @@
1# This is a boot script for U-Boot with Xen parameters used by yocto machine
2# configuration file.
3# Generate boot.scr:
4# mkimage -c none -A arm -T script -d boot.cmd.xen boot.scr
5#
6################
7xen_name=@@XEN_IMAGE_NAME@@
8kernel_name=@@KERNEL_IMAGE@@
9rootfs_name=@@RAMDISK_IMAGE@@
10@@PRE_BOOTENV@@
11
12for boot_target in ${boot_targets};
13do
14 echo "Trying to load boot images from ${boot_target}"
15 if test "${boot_target}" = "jtag" ; then
16 tftpboot @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}
17 setenv kernel_size 0x$filesize;
18 tftpboot @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}
19 setenv ramdisk_size 0x$filesize;
20 tftpboot @@XEN_LOAD_ADDRESS@@ ${xen_name}
21 tftpboot @@DEVICETREE_ADDRESS@@ system.dtb
22 fi
23 if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" || test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then
24 if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1"; then
25 setenv bootdev mmcblk${devnum}p
26 fi
27 if test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then
28 setenv bootdev sda
29 fi
30 echo "Checking for /${xen_name}"
31 if test -e ${devtype} ${devnum}:${distro_bootpart} /${xen_name}; then
32 echo "Loading ${xen_name}";
33 fatload ${devtype} ${devnum}:${distro_bootpart} @@XEN_LOAD_ADDRESS@@ ${xen_name};
34 fi
35 echo "Checking for /${kernel_name}"
36 if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then
37 echo "Loading ${kernel_name}";
38 fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name};
39 setenv kernel_size 0x$filesize;
40 fi
41 echo "Checking for /system.dtb"
42 if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then
43 echo "Loading system.dtb";
44 fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb;
45 fi
46 echo "Checking for /${rootfs_name}"
47 if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then
48 echo "Loading ${rootfs_name}";
49 fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name};
50 setenv ramdisk_size 0x$filesize;
51 fi
52 fi
53 fdt addr @@DEVICETREE_ADDRESS@@
54 fdt resize 0x1000
55 fdt get value bootargs /chosen bootargs
56 fdt set /chosen \#address-cells <0x2>
57 fdt set /chosen \#size-cells <0x2>
58 setenv xen_bootargs "console=dtuart dtuart=@@XEN_SERIAL_CONSOLES@@ dom0_mem=@@DOM0_MEM@@ dom0_max_vcpus=@@DOM0_MAX_VCPUS@@ bootscrub=0 vwfi=native @@XEN_CMDLINE_APPEND@@"
59 fdt set /chosen xen,xen-bootargs \"${xen_bootargs}\"
60
61 # Check that env $ramdisk_size is 0 or not.
62 if test -n ${ramdisk_size}; then
63 fdt mknod /chosen dom0-ramdisk
64 fdt set /chosen/dom0-ramdisk compatible "xen,linux-initrd" "xen,multiboot-module" "multiboot,module"
65 fdt set /chosen/dom0-ramdisk reg <0x0 @@RAMDISK_IMAGE_ADDRESS@@ 0x0 ${ramdisk_size}>
66 setenv rootfs_param @@KERNEL_ROOT_RAMDISK@@
67 else
68 setenv rootfs_param @@KERNEL_ROOT_SD@@
69 fi
70
71 fdt mknod /chosen dom0
72 fdt set /chosen/dom0 compatible "xen,linux-zimage" "xen,multiboot-module" "multiboot,module"
73 fdt set /chosen/dom0 reg <0x0 @@KERNEL_LOAD_ADDRESS@@ 0x0 ${kernel_size}>
74 setenv dom0_bootargs "console=hvc0 earlycon=xen earlyprintk=xen clk_ignore_unused ${rootfs_param}"
75 fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\"
76
77 setenv fdt_high 0xffffffffffffffff
78
79 @@KERNEL_BOOTCMD@@ @@XEN_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@
80done