diff options
Diffstat (limited to 'dynamic-layers/xilinx/recipes-bsp')
10 files changed, 394 insertions, 0 deletions
diff --git a/dynamic-layers/xilinx/recipes-bsp/device-tree/device-tree.bbappend b/dynamic-layers/xilinx/recipes-bsp/device-tree/device-tree.bbappend new file mode 100644 index 00000000..e2358262 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/device-tree/device-tree.bbappend @@ -0,0 +1,19 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +ENABLE_XEN_DTSI ?= "" +ENABLE_XEN_QEMU_DTSI ?= "" + +XEN_EXTRA_OVERLAYS = "" +XEN_EXTRA_QEMU_OVERLAYS = "" + +XEN_EXTRA_OVERLAYS:zynqmp = "zynqmp-xen.dtsi" +XEN_EXTRA_QEMU_OVERLAYS:zynqmp = "zynqmp-xen.dtsi zynqmp-xen-qemu.dtsi" + +XEN_EXTRA_OVERLAYS:versal = "versal-xen.dtsi" +XEN_EXTRA_QEMU_OVERLAYS:versal = "versal-xen.dtsi versal-xen-qemu.dtsi" + +XEN_EXTRA_OVERLAYS:versal-net = "versal-net-xen.dtsi" +XEN_EXTRA_QEMU_OVERLAYS:versal-net = "versal-net-xen.dtsi versal-net-xen-qemu.dtsi" + +EXTRA_OVERLAYS:append = "${@' ${XEN_EXTRA_OVERLAYS}' if d.getVar('ENABLE_XEN_DTSI') == '1' else ''}" +EXTRA_OVERLAYS:append = "${@' ${XEN_EXTRA_QEMU_OVERLAYS}' if d.getVar('ENABLE_XEN_QEMU_DTSI') == '1' else ''}" diff --git a/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-net-xen-qemu.dtsi b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-net-xen-qemu.dtsi new file mode 100644 index 00000000..336d7a25 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-net-xen-qemu.dtsi @@ -0,0 +1,2 @@ +/ { +}; diff --git a/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-net-xen.dtsi b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-net-xen.dtsi new file mode 100644 index 00000000..7da1f9f1 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-net-xen.dtsi @@ -0,0 +1,67 @@ +&smmu { + status = "okay"; +}; + +&adma0 { + iommus = <&smmu 0x210>; +}; + +&adma1 { + iommus = <&smmu 0x212>; +}; + +&adma2 { + iommus = <&smmu 0x214>; +}; + +&adma3 { + iommus = <&smmu 0x216>; +}; + +&adma4 { + iommus = <&smmu 0x218>; +}; + +&adma5 { + iommus = <&smmu 0x21a>; +}; + +&adma6 { + iommus = <&smmu 0x21c>; +}; + +&adma7 { + iommus = <&smmu 0x21e>; +}; + +&dwc3_0 { + iommus = <&smmu 0x230>; +}; + +&dwc3_1 { + iommus = <&smmu 0x232>; +}; + +&gem0 { + iommus = <&smmu 0x234>; +}; + +&gem1 { + iommus = <&smmu 0x235>; +}; + +&sdhci0 { + iommus = <&smmu 0x242>; +}; + +&sdhci1 { + iommus = <&smmu 0x243>; +}; + +&qspi { + iommus = <&smmu 0x244>; +}; + +&ospi { + iommus = <&smmu 0x245>; +}; diff --git a/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-xen-qemu.dtsi b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-xen-qemu.dtsi new file mode 100644 index 00000000..336d7a25 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-xen-qemu.dtsi @@ -0,0 +1,2 @@ +/ { +}; diff --git a/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-xen.dtsi b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-xen.dtsi new file mode 100644 index 00000000..6782e925 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/versal-xen.dtsi @@ -0,0 +1,59 @@ +&smmu { + status = "okay"; +}; + +&gem0 { + iommus = <&smmu 0x234>; +}; + +&gem1 { + iommus = <&smmu 0x235>; +}; + +&dwc3_0 { + iommus = <&smmu 0x230>; +}; + +&qspi { + iommus = <&smmu 0x244>; +}; + +&lpd_dma_chan0 { + iommus = <&smmu 0x210>; +}; + +&lpd_dma_chan1 { + iommus = <&smmu 0x212>; +}; + +&lpd_dma_chan2 { + iommus = <&smmu 0x214>; +}; + +&lpd_dma_chan3 { + iommus = <&smmu 0x216>; +}; + +&lpd_dma_chan4 { + iommus = <&smmu 0x218>; +}; + +&lpd_dma_chan5 { + iommus = <&smmu 0x21a>; +}; + +&lpd_dma_chan6 { + iommus = <&smmu 0x21c>; +}; + +&lpd_dma_chan7 { + iommus = <&smmu 0x21e>; +}; + +&sdhci0 { + iommus = <&smmu 0x242>; +}; + +&sdhci1 { + iommus = <&smmu 0x243>; +}; diff --git a/dynamic-layers/xilinx/recipes-bsp/device-tree/files/zynqmp-xen-qemu.dtsi b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/zynqmp-xen-qemu.dtsi new file mode 100644 index 00000000..336d7a25 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/zynqmp-xen-qemu.dtsi @@ -0,0 +1,2 @@ +/ { +}; diff --git a/dynamic-layers/xilinx/recipes-bsp/device-tree/files/zynqmp-xen.dtsi b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/zynqmp-xen.dtsi new file mode 100644 index 00000000..3d75be65 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/device-tree/files/zynqmp-xen.dtsi @@ -0,0 +1,123 @@ +&smmu { + status = "okay"; +}; + +&gem0 { + iommus = <&smmu 0x874>; +}; + +&gem1 { + iommus = <&smmu 0x875>; +}; + +&gem2 { + iommus = <&smmu 0x876>; +}; + +&gem3 { + iommus = <&smmu 0x877>; +}; + +&dwc3_0 { + iommus = <&smmu 0x860>; +}; + +&dwc3_1 { + iommus = <&smmu 0x861>; +}; + +&qspi { + iommus = <&smmu 0x873>; +}; + +&lpd_dma_chan1 { + iommus = <&smmu 0x868>; +}; + +&lpd_dma_chan2 { + iommus = <&smmu 0x869>; +}; + +&lpd_dma_chan3 { + iommus = <&smmu 0x86a>; +}; + +&lpd_dma_chan4 { + iommus = <&smmu 0x86b>; +}; + +&lpd_dma_chan5 { + iommus = <&smmu 0x86c>; +}; + +&lpd_dma_chan6 { + iommus = <&smmu 0x86d>; +}; + +&lpd_dma_chan7 { + iommus = <&smmu 0x86e>; +}; + +&lpd_dma_chan8 { + iommus = <&smmu 0x86f>; +}; + +&fpd_dma_chan1 { + iommus = <&smmu 0x14e8>; +}; + +&fpd_dma_chan2 { + iommus = <&smmu 0x14e9>; +}; + +&fpd_dma_chan3 { + iommus = <&smmu 0x14ea>; +}; + +&fpd_dma_chan4 { + iommus = <&smmu 0x14eb>; +}; + +&fpd_dma_chan5 { + iommus = <&smmu 0x14ec>; +}; + +&fpd_dma_chan6 { + iommus = <&smmu 0x14ed>; +}; + +&fpd_dma_chan7 { + iommus = <&smmu 0x14ee>; +}; + +&fpd_dma_chan8 { + iommus = <&smmu 0x14ef>; +}; + +&sdhci0 { + iommus = <&smmu 0x870>; +}; + +&sdhci1 { + iommus = <&smmu 0x871>; +}; + +&nand0 { + iommus = <&smmu 0x872>; +}; + +&pcie { + iommus = <&smmu 0x4d0>; +}; + +&zynqmp_dpsub { + iommus = <&smmu 0xce3>; +}; + +&zynqmp_dpdma { + iommus = <&smmu 0xce4>; +}; + +&sata { + iommus = <&smmu 0x4c0>, <&smmu 0x4c1>, <&smmu 0x4c2>, <&smmu 0x4c3>; +}; diff --git a/dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr.bbappend b/dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr.bbappend new file mode 100644 index 00000000..ae847cbc --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/u-boot/u-boot-xlnx-scr.bbappend @@ -0,0 +1,2 @@ +# Include xen-boot-cmd.inc only if xen distro features is enabled. +include ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen-boot-cmd.inc', '', d)} 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 @@ +# This is a boot script for U-Boot with Xen parameters used by yocto machine +# configuration file. +# Generate boot.scr: +# mkimage -c none -A arm -T script -d boot.cmd.xen boot.scr +# +################ +xen_name=@@XEN_IMAGE_NAME@@ +kernel_name=@@KERNEL_IMAGE@@ +rootfs_name=@@RAMDISK_IMAGE@@ +@@PRE_BOOTENV@@ + +for boot_target in ${boot_targets}; +do + echo "Trying to load boot images from ${boot_target}" + if test "${boot_target}" = "jtag" ; then + tftpboot @@KERNEL_LOAD_ADDRESS@@ ${kernel_name} + setenv kernel_size 0x$filesize; + tftpboot @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name} + setenv ramdisk_size 0x$filesize; + tftpboot @@XEN_LOAD_ADDRESS@@ ${xen_name} + tftpboot @@DEVICETREE_ADDRESS@@ system.dtb + fi + if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" || test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then + if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1"; then + setenv bootdev mmcblk${devnum}p + fi + if test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then + setenv bootdev sda + fi + echo "Checking for /${xen_name}" + if test -e ${devtype} ${devnum}:${distro_bootpart} /${xen_name}; then + echo "Loading ${xen_name}"; + fatload ${devtype} ${devnum}:${distro_bootpart} @@XEN_LOAD_ADDRESS@@ ${xen_name}; + fi + echo "Checking for /${kernel_name}" + if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then + echo "Loading ${kernel_name}"; + fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}; + setenv kernel_size 0x$filesize; + fi + echo "Checking for /system.dtb" + if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then + echo "Loading system.dtb"; + fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; + fi + echo "Checking for /${rootfs_name}" + if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then + echo "Loading ${rootfs_name}"; + fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}; + setenv ramdisk_size 0x$filesize; + fi + fi + fdt addr @@DEVICETREE_ADDRESS@@ + fdt resize 0x1000 + fdt get value bootargs /chosen bootargs + fdt set /chosen \#address-cells <0x2> + fdt set /chosen \#size-cells <0x2> + 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@@" + fdt set /chosen xen,xen-bootargs \"${xen_bootargs}\" + + # Check that env $ramdisk_size is 0 or not. + if test -n ${ramdisk_size}; then + fdt mknod /chosen dom0-ramdisk + fdt set /chosen/dom0-ramdisk compatible "xen,linux-initrd" "xen,multiboot-module" "multiboot,module" + fdt set /chosen/dom0-ramdisk reg <0x0 @@RAMDISK_IMAGE_ADDRESS@@ 0x0 ${ramdisk_size}> + setenv rootfs_param @@KERNEL_ROOT_RAMDISK@@ + else + setenv rootfs_param @@KERNEL_ROOT_SD@@ + fi + + fdt mknod /chosen dom0 + fdt set /chosen/dom0 compatible "xen,linux-zimage" "xen,multiboot-module" "multiboot,module" + fdt set /chosen/dom0 reg <0x0 @@KERNEL_LOAD_ADDRESS@@ 0x0 ${kernel_size}> + setenv dom0_bootargs "console=hvc0 earlycon=xen earlyprintk=xen clk_ignore_unused ${rootfs_param}" + fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\" + + setenv fdt_high 0xffffffffffffffff + + @@KERNEL_BOOTCMD@@ @@XEN_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ +done diff --git a/dynamic-layers/xilinx/recipes-bsp/u-boot/xen-boot-cmd.inc b/dynamic-layers/xilinx/recipes-bsp/u-boot/xen-boot-cmd.inc new file mode 100644 index 00000000..7a4e41a6 --- /dev/null +++ b/dynamic-layers/xilinx/recipes-bsp/u-boot/xen-boot-cmd.inc @@ -0,0 +1,38 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/u-boot-xlnx-scr" + +SRC_URI += "file://boot.cmd.xen" + +# Image offsets for Xen boot +KERNEL_OFFSET:zynqmp ?= "0xE00000" +KERNEL_OFFSET:versal ?= "0xE00000" + +DEVICETREE_OFFSET:zynqmp ?= "0xC000000" +DEVICETREE_OFFSET:versal ?= "0xC000000" + +RAMDISK_OFFSET:zynqmp ?= "0x2600000" +RAMDISK_OFFSET:versal ?= "0x2600000" + +XEN_OFFSET:zynqmp ?= "0xBA00000" +XEN_OFFSET:versal ?= "0xBA00000" +XEN_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('XEN_OFFSET'))}" + +# If dom0-ramdisk is used for Xen boot then set RAMDISK image to cpio.gz +XEN_IMAGE_NAME ?= "xen" +RAMDISK_IMAGE ?= "rootfs.cpio.gz" + +# Set the amount of memory for dom0 depending on total available memory size(DDR). +DOM0_MEM ?= "1500M" + +# Specify which UART console Xen should use. You can sepecify the devicetree +# alias or full path to a node in the devicetree +# XEN_SERIAL_CONSOLES ?= "serial0" or XEN_SERIAL_CONSOLES ?= "/axi/serial@ff000000" +XEN_SERIAL_CONSOLES ?= "serial0" + +# Specify additional Xen paramaters which will be appended to xen-bootargs +# This can alos be used for debugging purposes. +# Examples: XEN_CMDLINE_APPEND ?= "sched=credit loglvl=all guest_loglvl=debug" +XEN_CMDLINE_APPEND ?= "" + +# Specify the max number of vcpus for dom0 +# Example usage: DOM0_MAX_VCPUS = "2" or DOM0_MAX_VCPUS = "2-4" +DOM0_MAX_VCPUS ?= "1" |