HV: vuart: refine vuart config

Add vuart config in acrn_vm_config struct, support configuring 2 vuarts for
each VM. The first vuart is used to work as VM's console. The second vuart
is used to connect to other VM's vuart. When the port base for a vuart
is set to 0, hypervisor will not create this vuart.

Tracked-On: #2987
Signed-off-by: Victor Sun <victor.sun@intel.com>
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Conghui Chen
2019-04-17 12:47:44 +08:00
committed by ACRN System Integration
parent 1234f4f7b1
commit 3c92d7bbc7
5 changed files with 87 additions and 4 deletions

View File

@@ -7,6 +7,7 @@
#include <vm_config.h>
#include <vm_configurations.h>
#include <acrn_common.h>
#include <vuart.h>
extern struct acrn_vm_pci_ptdev_config vm0_pci_ptdevs[VM0_CONFIG_PCI_PTDEV_NUM];
extern struct acrn_vm_pci_ptdev_config vm1_pci_ptdevs[VM1_CONFIG_PCI_PTDEV_NUM];
@@ -37,6 +38,18 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
consoleblank=0 tsc=reliable xapic_phys"
},
.vm_vuart = true,
.vuart[0] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = COM1_BASE,
.irq = COM1_IRQ,
},
.vuart[1] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = COM2_BASE,
.irq = COM2_IRQ,
.t_vuart.vm_id = 1U,
.t_vuart.vuart_id = 1U,
},
.pci_ptdev_num = VM0_CONFIG_PCI_PTDEV_NUM,
.pci_ptdevs = vm0_pci_ptdevs,
.mptable = &vm_mptables[0],
@@ -65,6 +78,18 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
consoleblank=0 tsc=reliable xapic_phys"
},
.vm_vuart = true,
.vuart[0] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = COM1_BASE,
.irq = COM1_IRQ,
},
.vuart[1] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = COM2_BASE,
.irq = COM2_IRQ,
.t_vuart.vm_id = 0U,
.t_vuart.vuart_id = 1U,
},
.pci_ptdev_num = VM1_CONFIG_PCI_PTDEV_NUM,
.pci_ptdevs = vm1_pci_ptdevs,
.mptable = &vm_mptables[1],

View File

@@ -7,6 +7,7 @@
#include <vm_config.h>
#include <vm_configurations.h>
#include <acrn_common.h>
#include <vuart.h>
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
{
@@ -24,11 +25,29 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
.os_config = {
.name = "ACRN Service OS",
},
.vuart[0] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = CONFIG_COM_BASE,
.irq = CONFIG_COM_IRQ,
},
.vuart[1] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = INVALID_COM_BASE,
}
},
{
.type = NORMAL_VM,
.uuid = {0xd2U, 0x79U, 0x54U, 0x38U, 0x25U, 0xd6U, 0x11U, 0xe8U, \
0x86U, 0x4eU, 0xcbU, 0x7aU, 0x18U, 0xb3U, 0x46U, 0x43U},
/* d2795438-25d6-11e8-864e-cb7a18b34643 */
.vuart[0] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = INVALID_COM_BASE,
},
.vuart[1] = {
.type = VUART_LEGACY_PIO,
.addr.port_base = INVALID_COM_BASE,
}
}
};