diff --git a/.oebuild/features/xen.yaml b/.oebuild/features/xen.yaml index e5da81ea1a943c13fd556fc10444f7b5c1be5376..3a795dc7997f8d1b065d49ea2355174d83b52529 100644 --- a/.oebuild/features/xen.yaml +++ b/.oebuild/features/xen.yaml @@ -4,3 +4,4 @@ support: qemu-aarch64|raspberrypi4-64|kp920 local_conf: | DISTRO_FEATURES:append = " xen" + MCS_FEATURES:kp920:append = " zephyr" diff --git a/meta-openeuler/recipes-mcs/xen/files/cfg/xen-kp920-zephyr.cfg b/meta-openeuler/recipes-mcs/xen/files/cfg/xen-kp920-zephyr.cfg new file mode 100644 index 0000000000000000000000000000000000000000..0fcfccb5a30e932a989e8e231061091cc5273c56 --- /dev/null +++ b/meta-openeuler/recipes-mcs/xen/files/cfg/xen-kp920-zephyr.cfg @@ -0,0 +1,5 @@ +name = "zephyr" +memory = 512 +vcpus = 1 +kernel = "/lib/firmware/zephyr.bin" +gic_version = "v3" diff --git a/meta-openeuler/recipes-mcs/xen/xen-openeuler.inc b/meta-openeuler/recipes-mcs/xen/xen-openeuler.inc index ea63d18747760c910d179967208d6033ef6f8afd..92e20097a75078c6761c75c3ad4377e854d561bf 100644 --- a/meta-openeuler/recipes-mcs/xen/xen-openeuler.inc +++ b/meta-openeuler/recipes-mcs/xen/xen-openeuler.inc @@ -5,6 +5,7 @@ OPENEULER_LOCAL_NAME = "xen" SRC_URI = " \ file://RELEASE-${PV}.tar.gz \ file://xen.cfg \ + file://cfg/ \ " # xen-tools also uses the xen source pkg, so specify "xen" instead of "BPN". diff --git a/meta-openeuler/recipes-mcs/xen/xen-tools.inc b/meta-openeuler/recipes-mcs/xen/xen-tools.inc index 5f010a5d8a7218b5c8d8d2e2785605f2b7be7741..cd0b43b833fe08e90bb5523f762743b20c28edf4 100644 --- a/meta-openeuler/recipes-mcs/xen/xen-tools.inc +++ b/meta-openeuler/recipes-mcs/xen/xen-tools.inc @@ -400,6 +400,7 @@ FILES:${PN} = "\ ${sysconfdir}/xen/auto \ ${sysconfdir}/xen/cpupool \ ${localstatedir}/xen/dump \ + ${sysconfdir}/xen/*.cfg \ " FILES:${PN}-console = "\ @@ -824,6 +825,8 @@ do_install() { rm -f ${D}/${systemd_unitdir}/system/xenstored.service rm -f ${D}/${systemd_unitdir}/system/var-lib-xenstored.mount fi + + install -m 0644 ${WORKDIR}/cfg/*.cfg ${D}${sysconfdir}/xen/ } pkg_postinst:${PN}-volatiles() { diff --git a/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/files/boards-xenvm-return-separate-defconfig-for-xenvm-wit.patch b/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/files/boards-xenvm-return-separate-defconfig-for-xenvm-wit.patch new file mode 100644 index 0000000000000000000000000000000000000000..38f1e706e3de67faf1cd9630686a4747af20dbcb --- /dev/null +++ b/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/files/boards-xenvm-return-separate-defconfig-for-xenvm-wit.patch @@ -0,0 +1,44 @@ +From f01498ec4db65a626df1906b58446a2f6dbc2b26 Mon Sep 17 00:00:00 2001 +From: Dmytro Firsov +Date: Mon, 2 Dec 2024 18:25:49 +0200 +Subject: [PATCH 1/2] boards: xenvm: return separate defconfig for xenvm with + GICv3 + +During migration to HWMv2 separate specific defconfig file was removed +for GICv3 version of virtual xenvm boards. It worked fine before +commit 0be0d2175bdb ("cmake: modules: extensions: Revert using common +board files") significantly changed build behavior, but did not return +previously removed file. This led to build/runtime issues, when some of +the Kconfig options were not selected. + +Return GICv3 specific defconfig to board directory to fix configuration +problems. + +Signed-off-by: Dmytro Firsov +--- + boards/xen/xenvm/xenvm_xenvm_gicv3_defconfig | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + create mode 100644 boards/xen/xenvm/xenvm_xenvm_gicv3_defconfig + +diff --git a/boards/xen/xenvm/xenvm_xenvm_gicv3_defconfig b/boards/xen/xenvm/xenvm_xenvm_gicv3_defconfig +new file mode 100644 +index 00000000000..2115f9175bd +--- /dev/null ++++ b/boards/xen/xenvm/xenvm_xenvm_gicv3_defconfig +@@ -0,0 +1,13 @@ ++# Enable UART driver ++CONFIG_SERIAL=y ++ ++CONFIG_MAX_XLAT_TABLES=24 ++ ++# Enable console ++CONFIG_CONSOLE=y ++CONFIG_UART_CONSOLE=y ++ ++# Enable logging subsys ++CONFIG_LOG=y ++CONFIG_LOG_MODE_MINIMAL=n ++CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y +-- +2.34.1 + diff --git a/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-image.bb b/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-image.bb index fe0946cb07229a2281100109cf389a2ad32bde00..0d1687e2ce54c5035ca239a6f6c903608fb74bef 100644 --- a/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-image.bb +++ b/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-image.bb @@ -2,7 +2,7 @@ SUMMARY = "The Zephyr OS image" DESCRIPTION = "This recipe is a bridge to build zephyr image in openEuler Embedded" # currently compatible machines -COMPATIBLE_MACHINE = "qemu-aarch64|raspberrypi4-64" +COMPATIBLE_MACHINE = "qemu-aarch64|raspberrypi4-64|kp920" # common part to build zephyr image include zephyr-image.inc @@ -15,6 +15,7 @@ ZEPHYR_APP_DIR ?= "${ZEPHYR_BASE}/samples/subsys/shell/devmem_load" python () { machine = d.getVar('MACHINE').split() mcs_features = d.getVar('MCS_FEATURES').split() + distro_features = d.getVar('DISTRO_FEATURES').split() # qemu-aarch64 related handling if 'qemu-aarch64' in machine: @@ -27,5 +28,9 @@ python () { d.setVar('ZEPHYR_BOARD', 'rpi_4b/rpi_4b/remote') elif 'jailhouse' in mcs_features: d.setVar('ZEPHYR_BOARD', 'rpi_4b/rpi_4b/ivshmem') + elif 'kp920' in machine: + if 'xen' in distro_features: + d.setVar('ZEPHYR_BOARD', 'xenvm/xenvm/gicv3') + d.setVar('ZEPHYR_APP_DIR', "${ZEPHYR_BASE}/samples/synchronization") } diff --git a/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc b/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc index cb1ccb86cb711bfc0f886f7630a91b8d7a473863..f3e365a4cd5e7b9261ac52bb02de95187282d276 100644 --- a/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +++ b/rtos/meta-zephyr/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc @@ -17,6 +17,7 @@ SRC_URI = "\ file://lts3-zephyr-${ZEPHYR_VERSION}.tar.gz;subdir=zephyr_project \ file://lts3-zephyr-modules-${ZEPHYR_VERSION}.tar.gz;subdir=zephyr_project \ file://zephyr_openeuler_mcs.patch;patchdir=zephyr-${ZEPHYR_VERSION} \ + file://boards-xenvm-return-separate-defconfig-for-xenvm-wit.patch;patchdir=zephyr-${ZEPHYR_VERSION} \ " # This file might be included from other places (like other layers) and not