xen: Update xen_4.18.imx.bb to commit 9befb6e

Integrate xen for i.MX95 on Q2 release [YOCIMX-7596]

Signed-off-by: Zelan Zou <zelan.zou@nxp.com>
This commit is contained in:
Zelan Zou 2024-04-10 14:55:17 +09:00
parent 7bc7ca714b
commit 87ed712e0e
8 changed files with 161 additions and 1 deletions

View File

@ -157,6 +157,7 @@ OPTEE_BOOT_IMAGE:mx8-nxp-bsp ?= "tee.bin"
IMAGE_INSTALL:append = " \
${@bb.utils.contains('COMBINED_FEATURES', 'jailhouse', 'jailhouse', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'packagegroup-fsl-optee-imx', '', d)} \
${@bb.utils.contains('COMBINED_FEATURES', 'xen', 'xen xen-tools', '', d)} \
"
# To add a new array override for a specific upstream machine, set the

View File

@ -52,4 +52,5 @@ IMAGE_BOOT_FILES:append = " \
imx95-19x19-evk_m7_TCM_netc_share_sm.bin \
imx95-19x19-evk_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote_sm.bin \
imx95-19x19-evk_m7_TCM_rpmsg_lite_str_echo_rtos.bin \
${@bb.utils.contains('COMBINED_FEATURES', 'xen', 'xen', '', d)} \
"

View File

@ -2,7 +2,7 @@ require conf/machine/include/imx-base.inc
require conf/machine/include/arm/armv8-2a/tune-cortexa55.inc
MACHINE_FEATURES += "pci wifi bluetooth optee"
MACHINE_FEATURES:append:use-nxp-bsp = " nxpwifi-all-pcie nxpwifi-all-sdio jailhouse dpdk"
MACHINE_FEATURES:append:use-nxp-bsp = " nxpwifi-all-pcie nxpwifi-all-sdio jailhouse dpdk xen"
KERNEL_DEVICETREE = " \
freescale/${KERNEL_DEVICETREE_BASENAME}.dtb \

View File

@ -22,6 +22,10 @@ BBFILES_DYNAMIC += " \
\
qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/*/*/*.bb \
qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/*/*/*.bbappend \
\
virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/*/*/*.bb \
virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/*/*/*.bbappend \
virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/*/*/*.inc \
"
BBMASK += " \

View File

@ -0,0 +1,6 @@
SRCBRANCH = "imx_4.18.y"
XEN_SRC ?= "git://github.com/nxp-imx/imx-xen.git;protocol=https"
SRC_URI = " ${XEN_SRC};branch=${SRCBRANCH}"
SRCREV = "9befb6e131450f0a379d95fde585f07e52d3eac4"
XEN_REL = "4.18.imx"
PV = "${XEN_REL}+stable"

View File

@ -0,0 +1,115 @@
SUMMARY = "Xen hypervisor"
DESCRIPTION = "The Xen hypervisor"
# This recipe is for just the Xen hypervisor.
# Separate recipes are used to build Xen and its components:
# this allows for varying the target architecture or toolchain used
# to build the different components. eg. 32-bit tools and a 64-bit hypervisor.
# The Xen hypervisor has a narrower compatible platform range than the Xen tools
COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
inherit deploy python3native cml1
PACKAGES = " \
${PN} \
${PN}-dbg \
${PN}-efi \
"
FILES:${PN} = " \
/boot/xen-* \
/boot/xen \
/boot/xen-*.gz \
/boot/xen.gz \
/boot/xen-syms-* \
"
FILES:${PN}-dbg += "${libdir}/debug/*"
FILES:${PN}-efi = " \
/boot/xen.efi \
${exec_prefix}/lib64/efi/xen* \
"
do_configure() {
do_configure_common
# Handle the config fragments
cfgs="${@' '.join(find_cfgs(d))}"
if [ -n "${cfgs}" ]; then
# If .config is not present generate one in order
# to use the merge_config.sh
if [ ! -f "${S}/xen/.config" ] ; then
oe_runmake -C ${S}/xen defconfig
fi
${S}/xen/tools/kconfig/merge_config.sh -m -O \
${S}/xen ${S}/xen/.config "${cfgs}"
fi
}
# The hypervisor binary for arm must not be built with the hard floating point
# ABI. Override CC and CPP when invoking make so that they do not contain
# TUNE_CCARGS.
EXTRA_OEMAKE:arm += "CC='${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} \
${CC_REPRODUCIBLE_OPTIONS}' \
CPP='${CCACHE}${HOST_PREFIX}gcc -E ${TOOLCHAIN_OPTIONS} \
${CC_REPRODUCIBLE_OPTIONS}'"
do_compile() {
oe_runmake xen PYTHON="${PYTHON}" \
EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}"
}
do_install() {
oe_runmake DESTDIR="${D}" install-xen
}
# The do_install also ships files in /boot and /usr/lib64
SYSROOT_DIRS += "/boot ${exec_prefix}/lib64"
do_deploy() {
install -d ${DEPLOYDIR}
if [ -f ${B}/xen/xen ]; then
install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen
fi
if [ -f ${B}/xen/xen.gz ]; then
install -m 0644 ${B}/xen/xen.gz ${DEPLOYDIR}/xen.gz
fi
if [ -f ${B}/xen/xen.efi ]; then
install -m 0644 ${B}/xen/xen.efi ${DEPLOYDIR}/xen.efi
fi
}
# Scheduling the do_deploy task:
# - deploy copies files from ${B} that are written during do_compile so must
# at least run afer that task has completed
# - the hypervisor binaries may be included in the image filesystem, so we
# must ensure that the binaries deployed match what is staged in the sysroot:
# so do deploy must run after do_populate_sysroot -- which is always after
# do_compile, so that handles 'after do_compile' too
# - add the task before do_build to ensure that deployment has completed when
# the recipe build done stamp is written
addtask deploy after do_populate_sysroot before do_build
# To ensure that a deployed hypervisor has matching tools, add a dependency to
# make sure that the tools have built and been staged:
do_deploy[depends] += "xen-tools:do_populate_sysroot"
# Also ensure anything that the tools recipe needs to deploy, such as a
# XSM policy file, has been deployed first:
do_deploy[depends] += "xen-tools:do_deploy"
# Enable use of menuconfig directly from bitbake and also within the devshell
do_devshell[depends] += "ncurses-native:do_populate_sysroot"
# Pass the native library path for kconfig build when running the do_menuconfig
# task
CROSS_CURSES_LIB += "-L${STAGING_LIBDIR_NATIVE}"
# Specify the root dir of the .config file for do_menuconfig and do_diffconfig
# tasks
KCONFIG_CONFIG_ROOTDIR = "${S}/xen"
# Xen is setting all CC flags on its own. Make sure that they are not modified
# for aarch64, e.g. with architecture-specific optimizations.
TUNE_CCARGS:aarch64=""

View File

@ -0,0 +1,17 @@
# Copyright 2024 NXP
HOMEPAGE = "http://xen.org"
LICENSE = "GPL-2.0-only"
SECTION = "console/tools"
LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9"
S = "${WORKDIR}/git"
DEFAULT_PREFERENCE ??= "-1"
DEPENDS:apennd = "qemu"
require recipes-extended/xen/xen.inc
require recipes-extended/xen/xen-tools.inc
require xen-common.inc
FILES:${PN}:append = " \
${sysconfdir}/xen/imx95.conf \
"

View File

@ -0,0 +1,16 @@
# Copyright 2024 NXP
HOMEPAGE = "http://xen.org"
LICENSE = "GPL-2.0-only"
SECTION = "console/tools"
LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9"
require recipes-extended/xen/xen.inc
require xen-hypervisor.inc
require xen-common.inc
DEPENDS:apennd = "qemu"
S = "${WORKDIR}/git"
DEFAULT_PREFERENCE ??= "-1"
COMPATIBLE_MACHINE = "(mx95-nxp-bsp)"