mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-15 05:49:17 +00:00
hv: use the CONFIG_SERIAL_REG_WIDTH
Tracked-On: #8721 Signed-off-by: Wei6 Zhang <wei6.zhang@intel.com>
This commit is contained in:
@@ -28,26 +28,38 @@ struct console_uart {
|
|||||||
uint32_t reg_width;
|
uint32_t reg_width;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef CONFIG_SERIAL_REG_WIDTH
|
||||||
|
#if defined(CONFIG_SERIAL_PIO_BASE)
|
||||||
|
#define CONFIG_SERIAL_REG_WIDTH 1
|
||||||
|
#elif defined(CONFIG_SERIAL_PCI_BDF)
|
||||||
|
#define CONFIG_SERIAL_REG_WIDTH 4
|
||||||
|
#elif defined(CONFIG_SERIAL_MMIO_BASE)
|
||||||
|
#define CONFIG_SERIAL_REG_WIDTH 1
|
||||||
|
#else
|
||||||
|
#define CONFIG_SERIAL_REG_WIDTH 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SERIAL_PIO_BASE)
|
#if defined(CONFIG_SERIAL_PIO_BASE)
|
||||||
static struct console_uart uart = {
|
static struct console_uart uart = {
|
||||||
.enabled = true,
|
.enabled = true,
|
||||||
.type = PIO,
|
.type = PIO,
|
||||||
.port_address = CONFIG_SERIAL_PIO_BASE,
|
.port_address = CONFIG_SERIAL_PIO_BASE,
|
||||||
.reg_width = 1,
|
.reg_width = CONFIG_SERIAL_REG_WIDTH,
|
||||||
};
|
};
|
||||||
#elif defined(CONFIG_SERIAL_PCI_BDF)
|
#elif defined(CONFIG_SERIAL_PCI_BDF)
|
||||||
static struct console_uart uart = {
|
static struct console_uart uart = {
|
||||||
.enabled = true,
|
.enabled = true,
|
||||||
.type = PCI,
|
.type = PCI,
|
||||||
.bdf.value = CONFIG_SERIAL_PCI_BDF,
|
.bdf.value = CONFIG_SERIAL_PCI_BDF,
|
||||||
.reg_width = 4,
|
.reg_width = CONFIG_SERIAL_REG_WIDTH,
|
||||||
};
|
};
|
||||||
#elif defined(CONFIG_SERIAL_MMIO_BASE)
|
#elif defined(CONFIG_SERIAL_MMIO_BASE)
|
||||||
static struct console_uart uart = {
|
static struct console_uart uart = {
|
||||||
.enabled = true,
|
.enabled = true,
|
||||||
.type = MMIO,
|
.type = MMIO,
|
||||||
.mmio_base_vaddr = (void *)CONFIG_SERIAL_MMIO_BASE,
|
.mmio_base_vaddr = (void *)CONFIG_SERIAL_MMIO_BASE,
|
||||||
.reg_width = 1,
|
.reg_width = CONFIG_SERIAL_REG_WIDTH,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user