uart: ns16550: use io-mapped DT property for IO port access
The old CONFIG_UART_NS16550_ACCESS_IOPORT has been used to indicate whether to access the NS16550 UART via IO port before device tree is used to describe hardware. Now we have device tree, and we can specify whether a particular UART needs to be accessed via IO port using property io-mapped. Therefore, CONFIG_UART_NS16550_ACCESS_IOPORT is no longer needed (and thus also CONFIG_UART_NS16550_SIMULT_ACCESS). Remove these two kconfigs and modify code to use device tree to figure out how to access the UART hardware. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
3296956331
commit
9f9b4a8afa
15 changed files with 45 additions and 68 deletions
|
@ -11,7 +11,10 @@
|
|||
#include <soc.h>
|
||||
|
||||
|
||||
#ifdef CONFIG_UART_NS16550_ACCESS_IOPORT
|
||||
#define UART_IS_IOPORT_ACCESS \
|
||||
DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_console), io_mapped)
|
||||
|
||||
#if UART_IS_IOPORT_ACCESS
|
||||
/* Legacy I/O Port Access to a NS16550 UART */
|
||||
#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)))
|
||||
|
@ -86,7 +89,7 @@ int arch_printk_char_out(int c)
|
|||
|
||||
void z_x86_early_serial_init(void)
|
||||
{
|
||||
#if defined(DEVICE_MMIO_IS_IN_RAM) && !defined(CONFIG_UART_NS16550_ACCESS_IOPORT)
|
||||
#if defined(DEVICE_MMIO_IS_IN_RAM) && !UART_IS_IOPORT_ACCESS
|
||||
#ifdef X86_SOC_EARLY_SERIAL_PCIDEV
|
||||
struct pcie_bar mbar;
|
||||
pcie_get_mbar(X86_SOC_EARLY_SERIAL_PCIDEV, 0, &mbar);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue