HV: fix bug adapt uart mmio to bdf for HV cmdline

now PCI uart changed from MMIO configure to BDF configure,
it need change this interface too; this interface is used
to dynamically configure debug uart by HV command line.

Tracked-On: #2031
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Minggui Cao
2018-12-07 19:39:59 +08:00
committed by wenlingz
parent 23c2166aa9
commit b319e654c1
2 changed files with 17 additions and 14 deletions

View File

@@ -214,7 +214,13 @@ void uart16550_set_property(bool enabled, bool port_mapped, uint64_t base_addr)
{
uart_enabled = enabled;
serial_port_mapped = port_mapped;
uart_base_address = base_addr;
if (port_mapped) {
uart_base_address = base_addr;
} else {
const char *bdf = (const char *)base_addr;
strncpy_s(pci_bdf_info, MAX_BDF_LEN, bdf, MAX_BDF_LEN);
}
}
bool is_pci_dbg_uart(union pci_bdf bdf_value)