From c8cdc7e807c9f79314b0af5bf40c5a1716810743 Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Wed, 14 Aug 2019 11:52:22 +0800 Subject: [PATCH] HV: move vCOM setting from Kconfig to board configs The settings of SOS VM COM1 which is used for console is board specific, and this result in SOS VM COM2 which used for VM communication is also board specific, so move the configure method from Kconfig to board configs folder. The MACRO definition will be handled by acrn-config tool in future. Tracked-On: #3602 Signed-off-by: Victor Sun Reviewed-by: Eddie Dong --- hypervisor/arch/x86/Kconfig | 14 -------------- hypervisor/arch/x86/configs/apl-mrb.config | 2 -- hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/apl-up2.config | 1 - hypervisor/arch/x86/configs/apl-up2/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/generic/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h | 2 ++ hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h | 2 ++ hypervisor/dm/vuart.c | 4 ++-- hypervisor/scenarios/hybrid/vm_configurations.c | 4 ++-- hypervisor/scenarios/industry/vm_configurations.c | 4 ++-- hypervisor/scenarios/sdc/vm_configurations.c | 4 ++-- hypervisor/scenarios/sdc2/vm_configurations.c | 4 ++-- 14 files changed, 22 insertions(+), 27 deletions(-) diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index 2430ed671..512baa09a 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -146,20 +146,6 @@ config SERIAL_PIO_BASE The base address of the serial ports. This is logically 16-bit but used as a 64-bit integer. -config COM_BASE - hex "Base address of the vuart port" - default 0 if RELEASE - default 0x3f8 if !RELEASE - help - Base address of the vuart port. - -config COM_IRQ - int "IRQ of the vuart port" - default 0 if RELEASE - default 4 if !RELEASE - help - IRQ of the vuart port. - config CONSOLE_LOGLEVEL_DEFAULT int "Default loglevel on the serial console" depends on !RELEASE diff --git a/hypervisor/arch/x86/configs/apl-mrb.config b/hypervisor/arch/x86/configs/apl-mrb.config index 7590ce51b..9ced6362b 100644 --- a/hypervisor/arch/x86/configs/apl-mrb.config +++ b/hypervisor/arch/x86/configs/apl-mrb.config @@ -1,8 +1,6 @@ # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) CONFIG_BOARD="apl-mrb" CONFIG_SERIAL_PCI=y -CONFIG_COM_BASE=0x3e8 -CONFIG_COM_IRQ=6 CONFIG_HV_RAM_START=0x6e000000 CONFIG_HV_RAM_SIZE=0x07800000 CONFIG_PLATFORM_RAM_SIZE=0x200000000 diff --git a/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h index a64ca561f..573e56224 100644 --- a/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-mrb/misc_cfg.h @@ -12,6 +12,8 @@ #define SOS_ROOTFS ROOTFS_1 #define SOS_CONSOLE "console=ttyS2 " +#define SOS_COM1_BASE 0x3E8U +#define SOS_COM1_IRQ 6U #ifndef CONFIG_RELEASE #define BOOTARG_DEBUG "hvlog=2M@0x6de00000 " \ diff --git a/hypervisor/arch/x86/configs/apl-up2.config b/hypervisor/arch/x86/configs/apl-up2.config index f4689d4a8..736010f36 100644 --- a/hypervisor/arch/x86/configs/apl-up2.config +++ b/hypervisor/arch/x86/configs/apl-up2.config @@ -2,5 +2,4 @@ CONFIG_BOARD="apl-up2" CONFIG_SERIAL_PCI=y CONFIG_SERIAL_PCI_BDF="0:18.0" -CONFIG_COM_IRQ=6 CONFIG_HV_RAM_START=0x5e000000 diff --git a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h index 76671a03c..e3caf81e1 100644 --- a/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/apl-up2/misc_cfg.h @@ -12,6 +12,8 @@ #define SOS_ROOTFS ROOTFS_1 #define SOS_CONSOLE "console=ttyS0 " +#define SOS_COM1_BASE 0x3F8U +#define SOS_COM1_IRQ 4U #ifndef CONFIG_RELEASE #define BOOTARG_DEBUG "hvlog=2M@0x6de00000 " \ diff --git a/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h index 7a67e15ac..e191d476f 100644 --- a/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h +++ b/hypervisor/arch/x86/configs/dnv-cb2/misc_cfg.h @@ -11,6 +11,8 @@ #define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#define SOS_COM1_BASE 0x3F8U +#define SOS_COM1_IRQ 4U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/arch/x86/configs/generic/misc_cfg.h b/hypervisor/arch/x86/configs/generic/misc_cfg.h index 01d66b801..36ccda658 100644 --- a/hypervisor/arch/x86/configs/generic/misc_cfg.h +++ b/hypervisor/arch/x86/configs/generic/misc_cfg.h @@ -12,6 +12,8 @@ #define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#define SOS_COM1_BASE 0x3F8U +#define SOS_COM1_IRQ 4U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h index 7a67e15ac..e191d476f 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc6cayh/misc_cfg.h @@ -11,6 +11,8 @@ #define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#define SOS_COM1_BASE 0x3F8U +#define SOS_COM1_IRQ 4U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h b/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h index 52e9a75df..ba909de4a 100644 --- a/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h +++ b/hypervisor/arch/x86/configs/nuc7i7dnb/misc_cfg.h @@ -12,6 +12,8 @@ #define SOS_ROOTFS ROOTFS_0 #define SOS_CONSOLE "console=ttyS0 " +#define SOS_COM1_BASE 0x3F8U +#define SOS_COM1_IRQ 4U #ifndef CONFIG_RELEASE #define SOS_BOOTARGS_DIFF "hvlog=2M@0x1FE00000" diff --git a/hypervisor/dm/vuart.c b/hypervisor/dm/vuart.c index bb5fb89cc..f46b41907 100644 --- a/hypervisor/dm/vuart.c +++ b/hypervisor/dm/vuart.c @@ -161,8 +161,8 @@ void vuart_toggle_intr(const struct acrn_vuart *vu) vioapic_get_rte(vu->vm, vu->irq, &rte); /* TODO: - * Here should assert vuart irq according to CONFIG_COM_IRQ polarity. - * The best way is to get the polarity info from ACIP table. + * Here should assert vuart irq according to vCOM1_IRQ polarity. + * The best way is to get the polarity info from ACPI table. * Here we just get the info from vioapic configuration. * based on this, we can still have irq storm during guest * modify the vioapic setting, as it's only for debug uart, diff --git a/hypervisor/scenarios/hybrid/vm_configurations.c b/hypervisor/scenarios/hybrid/vm_configurations.c index afce353db..9dbb55558 100644 --- a/hypervisor/scenarios/hybrid/vm_configurations.c +++ b/hypervisor/scenarios/hybrid/vm_configurations.c @@ -64,8 +64,8 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { }, .vuart[0] = { .type = VUART_LEGACY_PIO, - .addr.port_base = CONFIG_COM_BASE, - .irq = CONFIG_COM_IRQ, + .addr.port_base = SOS_COM1_BASE, + .irq = SOS_COM1_IRQ, }, .vuart[1] = { .type = VUART_LEGACY_PIO, diff --git a/hypervisor/scenarios/industry/vm_configurations.c b/hypervisor/scenarios/industry/vm_configurations.c index 0151de4cf..68f249d56 100644 --- a/hypervisor/scenarios/industry/vm_configurations.c +++ b/hypervisor/scenarios/industry/vm_configurations.c @@ -29,8 +29,8 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { }, .vuart[0] = { .type = VUART_LEGACY_PIO, - .addr.port_base = CONFIG_COM_BASE, - .irq = CONFIG_COM_IRQ, + .addr.port_base = SOS_COM1_BASE, + .irq = SOS_COM1_IRQ, }, .vuart[1] = { .type = VUART_LEGACY_PIO, diff --git a/hypervisor/scenarios/sdc/vm_configurations.c b/hypervisor/scenarios/sdc/vm_configurations.c index e0969b9e5..d1c1e8ec4 100644 --- a/hypervisor/scenarios/sdc/vm_configurations.c +++ b/hypervisor/scenarios/sdc/vm_configurations.c @@ -31,8 +31,8 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { }, .vuart[0] = { .type = VUART_LEGACY_PIO, - .addr.port_base = CONFIG_COM_BASE, - .irq = CONFIG_COM_IRQ, + .addr.port_base = SOS_COM1_BASE, + .irq = SOS_COM1_IRQ, }, .vuart[1] = { .type = VUART_LEGACY_PIO, diff --git a/hypervisor/scenarios/sdc2/vm_configurations.c b/hypervisor/scenarios/sdc2/vm_configurations.c index b64f7cbe3..c370c8712 100644 --- a/hypervisor/scenarios/sdc2/vm_configurations.c +++ b/hypervisor/scenarios/sdc2/vm_configurations.c @@ -31,8 +31,8 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { }, .vuart[0] = { .type = VUART_LEGACY_PIO, - .addr.port_base = CONFIG_COM_BASE, - .irq = CONFIG_COM_IRQ, + .addr.port_base = SOS_COM1_BASE, + .irq = SOS_COM1_IRQ, }, .vuart[1] = { .type = VUART_LEGACY_PIO,