diff --git a/arch/arm64/core/CMakeLists.txt b/arch/arm64/core/CMakeLists.txt index 56d6413034..1804556c1a 100644 --- a/arch/arm64/core/CMakeLists.txt +++ b/arch/arm64/core/CMakeLists.txt @@ -54,4 +54,4 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") zephyr_cc_option(-moverride=tune=no_ldp_stp_qregs) endif() -add_subdirectory_ifdef(CONFIG_SOC_XENVM xen) +add_subdirectory_ifdef(CONFIG_XEN xen) diff --git a/arch/arm64/core/Kconfig b/arch/arm64/core/Kconfig index cd34eb0256..e096321123 100644 --- a/arch/arm64/core/Kconfig +++ b/arch/arm64/core/Kconfig @@ -197,6 +197,8 @@ config ARMV8_A so that it can support some features included in the AArch64 state. It supports the T32 and A32 instruction sets. +rsource "xen/Kconfig" + endif # CPU_CORTEX_A if CPU_AARCH64_CORTEX_R diff --git a/arch/arm64/core/xen/Kconfig b/arch/arm64/core/xen/Kconfig new file mode 100644 index 0000000000..ea9489d442 --- /dev/null +++ b/arch/arm64/core/xen/Kconfig @@ -0,0 +1,20 @@ +# Xen hypervisor configuration options + +# Copyright (c) 2023 EPAM Systems +# SPDX-License-Identifier: Apache-2.0 + +config XEN + bool + default y + depends on ARMV8_A + depends on DT_HAS_XEN_XEN_ENABLED + help + Enables support of Xen hypervisor on arm64 platform. Get enabled + when board device tree contains "hypervisor" node with "xen,xen" + compatible enabled. + +config XEN_DOM0 + bool "Zephyr as Xen Domain 0" + depends on XEN + help + Built binary will be used as Xen privileged domain (Domain 0). diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index b255b2b638..891041f2de 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -15,7 +15,7 @@ add_subdirectory(usb_c) add_subdirectory_ifdef(CONFIG_ADC adc) add_subdirectory_ifdef(CONFIG_AUDIO audio) add_subdirectory_ifdef(CONFIG_BBRAM bbram) -add_subdirectory_ifdef(CONFIG_BOARD_XENVM xen) +add_subdirectory_ifdef(CONFIG_XEN xen) add_subdirectory_ifdef(CONFIG_BT_DRIVERS bluetooth) add_subdirectory_ifdef(CONFIG_CACHE_MANAGEMENT cache) add_subdirectory_ifdef(CONFIG_CAN can) diff --git a/drivers/serial/Kconfig.xen b/drivers/serial/Kconfig.xen index 010541f77d..89fe3f5419 100644 --- a/drivers/serial/Kconfig.xen +++ b/drivers/serial/Kconfig.xen @@ -1,6 +1,6 @@ # Xen hypervisor console via UART setup # -# Copyright (c) 2021 EPAM Systems +# Copyright (c) 2021-2023 EPAM Systems # SPDX-License-Identifier: Apache-2.0 # @@ -10,7 +10,7 @@ config UART_XEN_HVC depends on DT_HAS_XEN_HVC_UART_ENABLED select SERIAL_HAS_DRIVER select SERIAL_SUPPORT_INTERRUPT - depends on !XEN_INITIAL_DOMAIN + depends on XEN && !XEN_DOM0 help Enable Xen ring buffer based hypervisor console driver. Used for Zephyr as unprivileged domain. @@ -18,8 +18,7 @@ config UART_XEN_HVC config UART_XEN_HVC_CONSOLEIO bool "Xen hypervisor Dom0 console UART driver" select SERIAL_HAS_DRIVER - depends on BOARD_XENVM - depends on XEN_INITIAL_DOMAIN + depends on XEN_DOM0 default y help Enable Xen hypervisor console driver. Used for Zephyr as @@ -35,7 +34,6 @@ config XEN_HVC_INIT_PRIORITY config XEN_EARLY_CONSOLEIO bool "Early printk/stdout through console_io Xen interface" - depends on BOARD_XENVM depends on UART_XEN_HVC help Enable setting of console_io symbol hook for stdout and printk. diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 547b3a7f9e..361c71a353 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2022 EPAM Systems +# Copyright (c) 2022-2023 EPAM Systems -if SOC_XENVM +if XEN menu "Xen drivers" @@ -22,4 +22,4 @@ config XEN_GRANT_TABLE_INIT_PRIORITY endmenu -endif # SOC_XENVM +endif # XEN diff --git a/soc/arm64/xenvm/Kconfig.soc b/soc/arm64/xenvm/Kconfig.soc index 89f90ed5c7..00f1bf0ca3 100644 --- a/soc/arm64/xenvm/Kconfig.soc +++ b/soc/arm64/xenvm/Kconfig.soc @@ -6,9 +6,3 @@ config SOC_XENVM select ARM64 select ARM_ARCH_TIMER if SYS_CLOCK_EXISTS select CPU_CORTEX_A72 - -config XEN_INITIAL_DOMAIN - bool "Zephyr as Xen Domain 0" - depends on SOC_XENVM - help - Built binary will be used as Xen privileged domain.