dm: lpc: support emulating UART COM3 and COM4

Extend the devicemodel lpc uart emulation support to COM4. Since
COM1 is usually used for hv console and COM2 is taken by S5 feature,
only COM1 and COM2 is not enough.

Tracked-On: #8537
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
This commit is contained in:
Jiaqing Zhao 2023-11-13 08:06:25 +00:00 committed by acrnsi-robot
parent ba80272503
commit c3e40801dc
2 changed files with 8 additions and 2 deletions

View File

@ -59,7 +59,7 @@ SYSRES_IO(NMISC_PORT, 1);
static struct pci_vdev *lpc_bridge;
#define LPC_UART_NUM 2
#define LPC_UART_NUM 4
static struct lpc_uart_vdev {
struct uart_vdev *uart;
const char *opts;
@ -68,7 +68,7 @@ static struct lpc_uart_vdev {
int enabled;
} lpc_uart_vdev[LPC_UART_NUM];
static const char *lpc_uart_names[LPC_UART_NUM] = { "COM1", "COM2" };
static const char *lpc_uart_names[LPC_UART_NUM] = { "COM1", "COM2", "COM3", "COM4" };
/*
* LPC device configuration is in the following form:

View File

@ -52,6 +52,10 @@
#define COM1_IRQ 4
#define COM2_BASE 0x2F8
#define COM2_IRQ 3
#define COM3_BASE 0x3E8
#define COM3_IRQ 6
#define COM4_BASE 0x2E8
#define COM4_IRQ 7
#define DEFAULT_RCLK 1843200
#define DEFAULT_BAUD 9600
@ -83,6 +87,8 @@ static struct {
} uart_lres[] = {
{ COM1_BASE, COM1_IRQ, false},
{ COM2_BASE, COM2_IRQ, false},
{ COM3_BASE, COM3_IRQ, false},
{ COM4_BASE, COM4_IRQ, false},
};
#define UART_NLDEVS (ARRAY_SIZE(uart_lres))