From 4efc9e3ef9fb17f399afad76be13f56c6da98cb9 Mon Sep 17 00:00:00 2001 From: Conghui Chen Date: Tue, 30 Apr 2019 02:04:34 +0800 Subject: [PATCH] HV: remove 'vuart' from debug command list Remove debug command 'vuart' which is used to change VM's console's base and irq before bringing up with uefi. But after vuart's resuffle, the gloable variables vuart_com_irq and vuart_com_base is not used anymore, vuart gets the base and irq from its configuration. So the command can not work. Tracked-On: #2987 Signed-off-by: Conghui Chen Acked-by: Eddie Dong --- hypervisor/debug/dbg_cmd.c | 10 ---------- hypervisor/dm/vuart.c | 19 ------------------- hypervisor/include/dm/vuart.h | 5 ++--- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/hypervisor/debug/dbg_cmd.c b/hypervisor/debug/dbg_cmd.c index 287ab4582..9e2d30e49 100644 --- a/hypervisor/debug/dbg_cmd.c +++ b/hypervisor/debug/dbg_cmd.c @@ -8,7 +8,6 @@ #include #include #include -#include #define MAX_PORT 0x10000 /* port 0 - 64K */ #define DEFAULT_UART_PORT 0x3F8 @@ -19,19 +18,12 @@ static const char * const cmd_list[] = { "uart=disabled", /* to disable uart */ "uart=port@", /* like uart=port@0x3F8 */ "uart=bdf@", /*like: uart=bdf@0:18.2, it is for ttyS2 */ - - /* format: vuart=ttySx@irqN, like vuart=ttyS1@irq6; better to unify - * uart & vuart & SOS console the same one, and irq same with the native. - * ttySx range (0-3), irqN (0-255) - */ - "vuart=ttyS", }; enum IDX_CMD_DBG { IDX_DISABLE_UART, IDX_PORT_UART, IDX_PCI_UART, - IDX_SET_VUART, IDX_MAX_CMD, }; @@ -65,8 +57,6 @@ bool handle_dbg_cmd(const char *cmd, int32_t len) } else if (i == IDX_PCI_UART) { uart16550_set_property(true, false, (uint64_t)(cmd+tmp)); - } else if (i == IDX_SET_VUART) { - vuart_set_property(cmd+tmp); } else { /* No other state currently, do nothing */ } diff --git a/hypervisor/dm/vuart.c b/hypervisor/dm/vuart.c index 47f5a6ef3..1dbbe9c2d 100644 --- a/hypervisor/dm/vuart.c +++ b/hypervisor/dm/vuart.c @@ -36,9 +36,6 @@ #include #include -static uint32_t vuart_com_irq = CONFIG_COM_IRQ; -static uint16_t vuart_com_base = CONFIG_COM_BASE; - #define vuart_lock_init(vu) spinlock_init(&((vu)->lock)) #define vuart_lock(vu) spinlock_obtain(&((vu)->lock)) #define vuart_unlock(vu) spinlock_release(&((vu)->lock)) @@ -494,19 +491,3 @@ void vuart_deinit(struct acrn_vm *vm) vuart_deinit_connect(&vm->vuart[i]); } } - -/* vuart=ttySx@irqN, like vuart=ttyS1@irq6 head "vuart=ttyS" is parsed */ -void vuart_set_property(const char *vuart_info) -{ - const uint16_t com_map[4] = {0x3f8, 0x2F8, 0x3E8, 0x2E8}; /* map to ttyS0-ttyS3 */ - uint8_t com_idx; - - com_idx = (uint8_t)(vuart_info[0] - '0'); - if (com_idx < 4) { - vuart_com_base = com_map[com_idx]; - } - - if (strncmp(vuart_info + 1, "@irq", 4) == 0) { - vuart_com_irq = (uint8_t)strtol_deci(vuart_info + 5); - } -} diff --git a/hypervisor/include/dm/vuart.h b/hypervisor/include/dm/vuart.h index 0fd3bad2a..b268b012e 100644 --- a/hypervisor/include/dm/vuart.h +++ b/hypervisor/include/dm/vuart.h @@ -68,8 +68,8 @@ struct acrn_vuart { uint8_t dll; /* Baudrate divisor latch LSB */ uint8_t dlh; /* Baudrate divisor latch MSB */ - struct fifo rxfifo; - struct fifo txfifo; + struct vuart_fifo rxfifo; + struct vuart_fifo txfifo; uint16_t port_base; uint32_t irq; char vuart_rx_buf[RX_BUF_SIZE]; @@ -89,5 +89,4 @@ char vuart_getchar(struct acrn_vuart *vu); void vuart_toggle_intr(const struct acrn_vuart *vu); bool is_vuart_intx(struct acrn_vm *vm, uint32_t intx_pin); -void vuart_set_property(const char *vuart_info); #endif /* VUART_H */