diff --git a/MAINTAINERS b/MAINTAINERS index 17fc5f9eecd1..026aa25a5393 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -245,7 +245,6 @@ S: Supported L: xen-devel@lists.xenproject.org F: docs/misc/arm/ F: xen/arch/arm/ -F: xen/drivers/char/arm-uart.c F: xen/drivers/char/cadence-uart.c F: xen/drivers/char/exynos4210-uart.c F: xen/drivers/char/imx-lpuart.c diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 15b2e4a22728..23bbc91aad88 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -12,6 +12,7 @@ config ARM_64 config ARM def_bool y select FUNCTION_ALIGNMENT_4B + select GENERIC_UART_INIT select HAS_ALTERNATIVE if HAS_VMAP select HAS_DEVICE_TREE select HAS_PASSTHROUGH diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 71ebaa77ca94..2e27af4560a5 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -361,7 +361,7 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr) gic_preinit(); - arm_uart_init(); + uart_init(); console_init_preirq(); console_init_ring(); diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig index e175d07c022b..e6e12bb41397 100644 --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -1,3 +1,6 @@ +config GENERIC_UART_INIT + bool + config HAS_NS16550 bool "NS16550 UART driver" if ARM default n if RISCV diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile index d3b987da1de9..8cbbffdca89b 100644 --- a/xen/drivers/char/Makefile +++ b/xen/drivers/char/Makefile @@ -11,7 +11,7 @@ obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o obj-$(CONFIG_XHCI) += xhci-dbc.o obj-$(CONFIG_HAS_IMX_LPUART) += imx-lpuart.o obj-$(CONFIG_HAS_LINFLEX) += linflex-uart.o -obj-$(CONFIG_ARM) += arm-uart.o +obj-$(CONFIG_GENERIC_UART_INIT) += uart-init.o obj-y += serial.o obj-$(CONFIG_XEN_GUEST) += xen_pv_console.o obj-$(CONFIG_PV_SHIM) += consoled.o diff --git a/xen/drivers/char/arm-uart.c b/xen/drivers/char/uart-init.c similarity index 85% rename from xen/drivers/char/arm-uart.c rename to xen/drivers/char/uart-init.c index 91f13a41368d..a2181399389f 100644 --- a/xen/drivers/char/arm-uart.c +++ b/xen/drivers/char/uart-init.c @@ -1,20 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + /* + * Derived from: * xen/drivers/char/arm-uart.c * * Generic uart retrieved via the device tree or ACPI * * Julien Grall * Copyright (c) 2013 Linaro Limited. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include @@ -126,7 +119,7 @@ static void __init acpi_uart_init(void) static void __init acpi_uart_init(void) { } #endif -void __init arm_uart_init(void) +void __init uart_init(void) { if ( acpi_disabled ) dt_uart_init(); diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h index 3d21207a3d7a..63a82b032dde 100644 --- a/xen/include/xen/serial.h +++ b/xen/include/xen/serial.h @@ -166,7 +166,7 @@ void xhci_dbc_uart_init(void); static void inline xhci_dbc_uart_init(void) {} #endif -void arm_uart_init(void); +void uart_init(void); struct physdev_dbgp_op; int dbgp_op(const struct physdev_dbgp_op *op);