diff --git a/sys/dev/uart/uart_cpu_acpi.h b/sys/dev/uart/uart_cpu_acpi.h --- a/sys/dev/uart/uart_cpu_acpi.h +++ b/sys/dev/uart/uart_cpu_acpi.h @@ -64,7 +64,7 @@ #define UART_ACPI_CLASS(data) \ DATA_SET(uart_acpi_class_set, data) -/* Try to initialize UART device from SPCR data. */ -int uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di); +/* Try to initialize UART device from ACPI tables */ +int uart_cpu_acpi_setup(int devtype, struct uart_devinfo *di); #endif /* _DEV_UART_CPU_ACPI_H_ */ diff --git a/sys/dev/uart/uart_cpu_acpi.c b/sys/dev/uart/uart_cpu_acpi.c --- a/sys/dev/uart/uart_cpu_acpi.c +++ b/sys/dev/uart/uart_cpu_acpi.c @@ -138,7 +138,7 @@ return (0); } -int +static int uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) { vm_paddr_t spcr_physaddr; @@ -147,10 +147,6 @@ struct uart_class *class; int error = ENXIO; - /* SPCR only tells us about consoles. */ - if (devtype != UART_DEV_CONSOLE) - return (error); - /* Look for the SPCR table. */ spcr_physaddr = acpi_find_table(ACPI_SIG_SPCR); if (spcr_physaddr == 0) @@ -213,3 +209,13 @@ acpi_unmap_table(spcr); return (error); } + +int +uart_cpu_acpi_setup(int devtype, struct uart_devinfo *di) +{ + switch(devtype) { + case UART_DEV_CONSOLE: + return (uart_cpu_acpi_spcr(devtype, di)); + } + return (ENXIO); +} diff --git a/sys/dev/uart/uart_cpu_arm64.c b/sys/dev/uart/uart_cpu_arm64.c --- a/sys/dev/uart/uart_cpu_arm64.c +++ b/sys/dev/uart/uart_cpu_arm64.c @@ -125,7 +125,7 @@ #ifdef DEV_ACPI /* Check if SPCR can tell us what console to use. */ - if (uart_cpu_acpi_spcr(devtype, di) == 0) + if (uart_cpu_acpi_setup(devtype, di) == 0) return (0); #endif #ifdef FDT diff --git a/sys/dev/uart/uart_cpu_x86.c b/sys/dev/uart/uart_cpu_x86.c --- a/sys/dev/uart/uart_cpu_x86.c +++ b/sys/dev/uart/uart_cpu_x86.c @@ -70,7 +70,7 @@ * !late_console, we haven't set up our own page tables yet, so we * can't map ACPI tables to look at them. */ - if (late_console && uart_cpu_acpi_spcr(devtype, di) == 0) + if (late_console && uart_cpu_acpi_setup(devtype, di) == 0) return (0); #endif