diff --git a/arch/x86/core/early_serial.c b/arch/x86/core/early_serial.c index 2d6a3e340e4..027c88c1a61 100644 --- a/arch/x86/core/early_serial.c +++ b/arch/x86/core/early_serial.c @@ -11,10 +11,10 @@ #include -#ifdef UART_NS16550_ACCESS_IOPORT +#ifdef CONFIG_UART_NS16550_ACCESS_IOPORT /* Legacy I/O Port Access to a NS16550 UART */ -#define IN(reg) sys_in8(reg + UART_NS16550_ACCESS_IOPORT) -#define OUT(reg, val) sys_out8(val, reg + UART_NS16550_ACCESS_IOPORT) +#define IN(reg) sys_in8(reg + DT_REG_ADDR(DT_CHOSEN(zephyr_console))) +#define OUT(reg, val) sys_out8(val, reg + DT_REG_ADDR(DT_CHOSEN(zephyr_console))) #elif defined(X86_SOC_EARLY_SERIAL_PCIDEV) /* "Modern" mapping of a UART into a PCI MMIO device. The registers * are still bytes, but spaced at a 32 bit stride instead of packed @@ -86,7 +86,7 @@ int arch_printk_char_out(int c) void z_x86_early_serial_init(void) { -#if defined(DEVICE_MMIO_IS_IN_RAM) && !defined(UART_NS16550_ACCESS_IOPORT) +#if defined(DEVICE_MMIO_IS_IN_RAM) && !defined(CONFIG_UART_NS16550_ACCESS_IOPORT) #ifdef X86_SOC_EARLY_SERIAL_PCIDEV struct pcie_mbar mbar; pcie_get_mbar(X86_SOC_EARLY_SERIAL_PCIDEV, 0, &mbar);