From 381388b9c48b07b08199b07b7657d46e8fcb59b0 Mon Sep 17 00:00:00 2001 From: Matt Macy Date: Sun, 19 Aug 2018 21:10:21 +0000 Subject: [PATCH] add snps IP uart support / genaralize UART This is an amalgam of a patch by Doug Ambrisko to generalize uart_acpi_find_device, imp moving the ACPI table to uart_dev_ns8250.c and advice by jhb to work around a bug in the EPYC 3151 BIOS (the BIOS incorrectly marks the serial ports as disabled) Reviewed by: imp MFC after: 8 weeks Differential Revision: https://reviews.freebsd.org/D16432 --- sys/arm/nvidia/tegra_uart.c | 2 +- sys/dev/acpica/acpi.c | 9 +++++ sys/dev/uart/uart_bus.h | 5 ++- sys/dev/uart/uart_bus_acpi.c | 49 ++++++----------------- sys/dev/uart/uart_bus_ebus.c | 2 +- sys/dev/uart/uart_bus_fdt.c | 2 +- sys/dev/uart/uart_bus_isa.c | 2 +- sys/dev/uart/uart_bus_pccard.c | 2 +- sys/dev/uart/uart_bus_pci.c | 2 +- sys/dev/uart/uart_bus_puc.c | 2 +- sys/dev/uart/uart_bus_scc.c | 2 +- sys/dev/uart/uart_core.c | 3 +- sys/dev/uart/uart_cpu_acpi.h | 12 ++++-- sys/dev/uart/uart_cpu_arm64.c | 10 ++--- sys/dev/uart/uart_dev_ns8250.c | 24 +++++++++++ sys/dev/uart/uart_dev_pl011.c | 6 +-- sys/dev/uart/uart_dev_snps.c | 17 +------- sys/mips/atheros/ar531x/uart_bus_ar5315.c | 2 +- sys/mips/atheros/uart_bus_ar71xx.c | 2 +- sys/mips/atheros/uart_bus_ar933x.c | 2 +- sys/mips/broadcom/uart_bus_chipc.c | 2 +- sys/mips/cavium/uart_bus_octeonusart.c | 2 +- sys/mips/ingenic/jz4780_uart.c | 2 +- sys/mips/malta/uart_bus_maltausart.c | 2 +- sys/modules/uart/Makefile | 9 ++++- sys/powerpc/psim/uart_iobus.c | 2 +- sys/sparc64/pci/sbbc.c | 2 +- 27 files changed, 95 insertions(+), 83 deletions(-) diff --git a/sys/arm/nvidia/tegra_uart.c b/sys/arm/nvidia/tegra_uart.c index 1bc81fdb99cf..fc4e722824ea 100644 --- a/sys/arm/nvidia/tegra_uart.c +++ b/sys/arm/nvidia/tegra_uart.c @@ -216,7 +216,7 @@ tegra_uart_probe(device_t dev) device_printf(dev, "Cannot enable UART clock: %d\n", rv); return (ENXIO); } - return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0)); + return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0, 0)); } static int diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index c1bfd880c896..f55a0048e4b6 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2221,6 +2221,15 @@ acpi_DeviceIsPresent(device_t dev) return (FALSE); status = acpi_GetInteger(h, "_STA", &s); + /* + * Onboard serial ports on certain AMD motherboards have an invalid _STA + * method that always returns 0. Force them to always be treated as present. + * + * This may solely be a quirk of a preproduction BIOS. + */ + if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) + return (TRUE); + /* If no _STA method, must be present */ if (ACPI_FAILURE(status)) return (status == AE_NOT_FOUND ? TRUE : FALSE); diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h index 556a9228493c..2bc33734cfb5 100644 --- a/sys/dev/uart/uart_bus.h +++ b/sys/dev/uart/uart_bus.h @@ -56,6 +56,9 @@ #define UART_IOCTL_OFLOW 3 #define UART_IOCTL_BAUD 4 +/* UART quirk flags */ +#define UART_F_BUSY_DETECT 0x1 + /* * UART class & instance (=softc) */ @@ -140,7 +143,7 @@ int uart_bus_detach(device_t dev); int uart_bus_resume(device_t dev); serdev_intr_t *uart_bus_ihand(device_t dev, int ipend); int uart_bus_ipend(device_t dev); -int uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan); +int uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan, int quirks); int uart_bus_sysdev(device_t dev); void uart_sched_softih(struct uart_softc *, uint32_t); diff --git a/sys/dev/uart/uart_bus_acpi.c b/sys/dev/uart/uart_bus_acpi.c index 88b1480064f4..a711c0c6a675 100644 --- a/sys/dev/uart/uart_bus_acpi.c +++ b/sys/dev/uart/uart_bus_acpi.c @@ -37,17 +37,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include - -#ifdef __aarch64__ #include #include #include -#endif + static int uart_acpi_probe(device_t dev); @@ -66,59 +62,40 @@ static driver_t uart_acpi_driver = { sizeof(struct uart_softc), }; -#if defined(__i386__) || defined(__amd64__) -static struct isa_pnp_id acpi_ns8250_ids[] = { - {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ - {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ - {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */ - {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */ - {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */ - {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */ - {0x0ef0235c, "Wacom Tablet PC Screen 00e"}, /* WACF00e */ - {0xe502aa1a, "Wacom Tablet at FuS Lifebook T"}, /* FUJ02E5 */ - {0} -}; -#endif - -#ifdef __aarch64__ -static struct uart_class * +static struct acpi_uart_compat_data * uart_acpi_find_device(device_t dev) { - struct acpi_uart_compat_data **cd; + struct acpi_uart_compat_data **cd, *cd_it; ACPI_HANDLE h; if ((h = acpi_get_handle(dev)) == NULL) return (NULL); SET_FOREACH(cd, uart_acpi_class_and_device_set) { - if (acpi_MatchHid(h, (*cd)->hid)) { - return ((*cd)->clas); + for (cd_it = *cd; cd_it->cd_hid != NULL; cd_it++) { + if (acpi_MatchHid(h, cd_it->cd_hid)) + return (cd_it); } } return (NULL); } -#endif static int uart_acpi_probe(device_t dev) { struct uart_softc *sc; + struct acpi_uart_compat_data *cd; sc = device_get_softc(dev); -#if defined(__i386__) || defined(__amd64__) - if (!ISA_PNP_PROBE(device_get_parent(dev), dev, acpi_ns8250_ids)) { - sc->sc_class = &uart_ns8250_class; - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + if ((cd = uart_acpi_find_device(dev)) != NULL) { + sc->sc_class = cd->cd_class; + if (cd->cd_desc != NULL) + device_set_desc(dev, cd->cd_desc); + return (uart_bus_probe(dev, cd->cd_regshft, cd->cd_regiowidth, + cd->cd_rclk, 0, 0, cd->cd_quirks)); } - - /* Add checks for non-ns8250 IDs here. */ -#elif defined(__aarch64__) - if ((sc->sc_class = uart_acpi_find_device(dev)) != NULL) - return (uart_bus_probe(dev, 2, 0, 0, 0, 0)); -#endif - return (ENXIO); } diff --git a/sys/dev/uart/uart_bus_ebus.c b/sys/dev/uart/uart_bus_ebus.c index dead7733d0cf..dd50ff83596f 100644 --- a/sys/dev/uart/uart_bus_ebus.c +++ b/sys/dev/uart/uart_bus_ebus.c @@ -99,7 +99,7 @@ uart_ebus_probe(device_t dev) return (ENXIO); } sc->sc_class = &uart_ns8250_class; - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } return (ENXIO); diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c index 8efb7d7b2290..34c600301e64 100644 --- a/sys/dev/uart/uart_bus_fdt.c +++ b/sys/dev/uart/uart_bus_fdt.c @@ -278,7 +278,7 @@ uart_fdt_probe(device_t dev) if (uart_fdt_get_io_width(node, &iowidth) != 0) iowidth = uart_getregiowidth(sc->sc_class); - return (uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0)); + return (uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0, 0)); } DRIVER_MODULE(uart, simplebus, uart_fdt_driver, uart_devclass, 0, 0); diff --git a/sys/dev/uart/uart_bus_isa.c b/sys/dev/uart/uart_bus_isa.c index 759d4f92a9a9..5085ff66fe10 100644 --- a/sys/dev/uart/uart_bus_isa.c +++ b/sys/dev/uart/uart_bus_isa.c @@ -168,7 +168,7 @@ uart_isa_probe(device_t dev) /* Probe PnP _and_ non-PnP ns8250 here. */ sc->sc_class = &uart_ns8250_class; - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } DRIVER_MODULE(uart, isa, uart_isa_driver, uart_devclass, 0, 0); diff --git a/sys/dev/uart/uart_bus_pccard.c b/sys/dev/uart/uart_bus_pccard.c index 894240ee344b..3a8446a871f6 100644 --- a/sys/dev/uart/uart_bus_pccard.c +++ b/sys/dev/uart/uart_bus_pccard.c @@ -95,7 +95,7 @@ uart_pccard_attach(device_t dev) sc = device_get_softc(dev); sc->sc_class = &uart_ns8250_class; - error = uart_bus_probe(dev, 0, 0, 0, 0, 0); + error = uart_bus_probe(dev, 0, 0, 0, 0, 0, 0); if (error > 0) return (error); return (uart_bus_attach(dev)); diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index a8b8a7ec9ae1..f4be108ab7b2 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -206,7 +206,7 @@ uart_pci_probe(device_t dev) return (ENXIO); match: - result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid, 0); + result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid, 0, 0); /* Bail out on error. */ if (result > 0) return (result); diff --git a/sys/dev/uart/uart_bus_puc.c b/sys/dev/uart/uart_bus_puc.c index 36419d43f355..a90e01628f40 100644 --- a/sys/dev/uart/uart_bus_puc.c +++ b/sys/dev/uart/uart_bus_puc.c @@ -83,7 +83,7 @@ uart_puc_probe(device_t dev) if (BUS_READ_IVAR(parent, dev, PUC_IVAR_CLOCK, &rclk)) rclk = 0; - return (uart_bus_probe(dev, 0, 0, rclk, 0, 0)); + return (uart_bus_probe(dev, 0, 0, rclk, 0, 0, 0)); } DRIVER_MODULE(uart, puc, uart_puc_driver, uart_devclass, 0, 0); diff --git a/sys/dev/uart/uart_bus_scc.c b/sys/dev/uart/uart_bus_scc.c index 80f590610d9d..6666a35e272e 100644 --- a/sys/dev/uart/uart_bus_scc.c +++ b/sys/dev/uart/uart_bus_scc.c @@ -114,7 +114,7 @@ uart_scc_probe(device_t dev) BUS_READ_IVAR(parent, dev, SCC_IVAR_REGSHFT, &rs)) return (ENXIO); - return (uart_bus_probe(dev, rs, 0, cl, 0, ch)); + return (uart_bus_probe(dev, rs, 0, cl, 0, ch, 0)); } DRIVER_MODULE(uart, scc, uart_scc_driver, uart_devclass, 0, 0); diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c index fe722cb3eb2d..87874e4d11d0 100644 --- a/sys/dev/uart/uart_core.c +++ b/sys/dev/uart/uart_core.c @@ -493,7 +493,7 @@ uart_bus_sysdev(device_t dev) } int -uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan) +uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int chan, int quirks) { struct uart_softc *sc; struct uart_devinfo *sysdev; @@ -553,6 +553,7 @@ uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int sc->sc_bas.regshft = regshft; sc->sc_bas.regiowidth = regiowidth; sc->sc_bas.rclk = (rclk == 0) ? sc->sc_class->uc_rclk : rclk; + sc->sc_bas.busy_detect = !!(quirks & UART_F_BUSY_DETECT); SLIST_FOREACH(sysdev, &uart_sysdevs, next) { if (chan == sysdev->bas.chan && diff --git a/sys/dev/uart/uart_cpu_acpi.h b/sys/dev/uart/uart_cpu_acpi.h index 30cfa4e19388..416ff48f9266 100644 --- a/sys/dev/uart/uart_cpu_acpi.h +++ b/sys/dev/uart/uart_cpu_acpi.h @@ -38,9 +38,15 @@ struct uart_class; struct acpi_uart_compat_data { - const char *hid; - struct uart_class *clas; - uint16_t port_subtype; + const char *cd_hid; + struct uart_class *cd_class; + + uint16_t cd_port_subtype; + int cd_regshft; + int cd_regiowidth; + int cd_rclk; + int cd_quirks; + const char *cd_desc; }; /* diff --git a/sys/dev/uart/uart_cpu_arm64.c b/sys/dev/uart/uart_cpu_arm64.c index 56a88f73b2bf..5a323a38ac4e 100644 --- a/sys/dev/uart/uart_cpu_arm64.c +++ b/sys/dev/uart/uart_cpu_arm64.c @@ -88,16 +88,16 @@ uart_cpu_acpi_scan(uint8_t interface_type) SET_FOREACH(cd, uart_acpi_class_and_device_set) { curcd = *cd; - for (i = 0; curcd[i].hid != NULL; i++) { - if (curcd[i].port_subtype == interface_type) + for (i = 0; curcd[i].cd_hid != NULL; i++) { + if (curcd[i].cd_port_subtype == interface_type) return (&curcd[i]); } } SET_FOREACH(cd, uart_acpi_class_set) { curcd = *cd; - for (i = 0; curcd[i].hid != NULL; i++) { - if (curcd[i].port_subtype == interface_type) + for (i = 0; curcd[i].cd_hid != NULL; i++) { + if (curcd[i].cd_port_subtype == interface_type) return (&curcd[i]); } } @@ -147,7 +147,7 @@ uart_cpu_acpi_probe(struct uart_class **classp, bus_space_tag_t *bst, if (err != 0) goto out; - *classp = cd->clas; + *classp = cd->cd_class; *rclk = 0; *shiftp = 2; *iowidthp = spcr->SerialPort.BitWidth / 8; diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index 03792f8f6598..7f87b111f502 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -26,6 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_acpi.h" #include "opt_platform.h" #include "opt_uart.h" @@ -54,6 +55,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef DEV_ACPI +#include +#endif #include @@ -404,6 +408,26 @@ struct uart_class uart_ns8250_class = { .uc_rshift = 0 }; +/* + * XXX -- refactor out ACPI and FDT ifdefs + */ +#ifdef DEV_ACPI +static struct acpi_uart_compat_data acpi_compat_data[] = { + {"AMD0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"AMDI0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"PNP0500", &uart_ns8250_class, 0, 0, 0, 0, 0, "Standard PC COM port"}, + {"PNP0501", &uart_ns8250_class, 0, 0, 0, 0, 0, "16550A-compatible COM port"}, + {"PNP0502", &uart_ns8250_class, 0, 0, 0, 0, 0, "Multiport serial device (non-intelligent 16550)"}, + {"PNP0510", &uart_ns8250_class, 0, 0, 0, 0, 0, "Generic IRDA-compatible device"}, + {"PNP0511", &uart_ns8250_class, 0, 0, 0, 0, 0, "Generic IRDA-compatible device"}, + {"WACF004", &uart_ns8250_class, 0, 0, 0, 0, 0, "Wacom Tablet PC Screen"}, + {"WACF00E", &uart_ns8250_class, 0, 0, 0, 0, 0, "Wacom Tablet PC Screen 00e"}, + {"FUJ02E5", &uart_ns8250_class, 0, 0, 0, 0, 0, "Wacom Tablet at FuS Lifebook T"}, + {NULL, NULL, 0, 0 , 0, 0, 0, NULL}, +}; +UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); +#endif + #ifdef FDT static struct ofw_compat_data compat_data[] = { {"ns16550", (uintptr_t)&uart_ns8250_class}, diff --git a/sys/dev/uart/uart_dev_pl011.c b/sys/dev/uart/uart_dev_pl011.c index 0b55b6a217db..08905d13c1e6 100644 --- a/sys/dev/uart/uart_dev_pl011.c +++ b/sys/dev/uart/uart_dev_pl011.c @@ -342,9 +342,9 @@ UART_FDT_CLASS_AND_DEVICE(fdt_compat_data); #ifdef DEV_ACPI static struct acpi_uart_compat_data acpi_compat_data[] = { - {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011}, - {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC}, - {NULL, NULL, 0}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011, 2, 0, 0, 0, "uart plo11"}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC, 2, 0, 0, 0, "uart plo11"}, + {NULL, NULL, 0, 0, 0, 0, 0, NULL}, }; UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); #endif diff --git a/sys/dev/uart/uart_dev_snps.c b/sys/dev/uart/uart_dev_snps.c index 26696621c7d2..d8fc114824f8 100644 --- a/sys/dev/uart/uart_dev_snps.c +++ b/sys/dev/uart/uart_dev_snps.c @@ -99,22 +99,9 @@ early_putc_t *early_putc = uart_snps_early_putc; #endif /* EARLY_PRINTF */ #endif -static int -snps_uart_attach(struct uart_softc *uart_sc) -{ - struct snps_softc *sc; - - sc = (struct snps_softc *)uart_sc; - - /* UART requires to read USR reg when IIR_BUSY */ - uart_sc->sc_bas.busy_detect = 1; - - return (ns8250_bus_attach(uart_sc)); -} - static kobj_method_t snps_methods[] = { KOBJMETHOD(uart_probe, ns8250_bus_probe), - KOBJMETHOD(uart_attach, snps_uart_attach), + KOBJMETHOD(uart_attach, ns8250_bus_attach), KOBJMETHOD(uart_detach, ns8250_bus_detach), KOBJMETHOD(uart_flush, ns8250_bus_flush), KOBJMETHOD(uart_getsig, ns8250_bus_getsig), @@ -238,7 +225,7 @@ snps_probe(device_t dev) if (bootverbose && clock == 0) device_printf(dev, "could not determine frequency\n"); - error = uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0); + error = uart_bus_probe(dev, (int)shift, (int)iowidth, (int)clock, 0, 0, UART_F_BUSY_DETECT); if (error != 0) return (error); diff --git a/sys/mips/atheros/ar531x/uart_bus_ar5315.c b/sys/mips/atheros/ar531x/uart_bus_ar5315.c index 823dd863e0b7..425b3849e0dc 100644 --- a/sys/mips/atheros/ar531x/uart_bus_ar5315.c +++ b/sys/mips/atheros/ar531x/uart_bus_ar5315.c @@ -83,7 +83,7 @@ uart_ar5315_probe(device_t dev) sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = ar531x_uart_addr() + 3; - return (uart_bus_probe(dev, 2, 0, freq, 0, 0)); + return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0)); } DRIVER_MODULE(uart, apb, uart_ar5315_driver, uart_devclass, 0, 0); diff --git a/sys/mips/atheros/uart_bus_ar71xx.c b/sys/mips/atheros/uart_bus_ar71xx.c index b3c098686028..2c38a4dedbe1 100644 --- a/sys/mips/atheros/uart_bus_ar71xx.c +++ b/sys/mips/atheros/uart_bus_ar71xx.c @@ -85,7 +85,7 @@ uart_ar71xx_probe(device_t dev) sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(AR71XX_UART_ADDR) + 3; - return (uart_bus_probe(dev, 2, 0, freq, 0, 0)); + return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0)); } #ifdef EARLY_PRINTF diff --git a/sys/mips/atheros/uart_bus_ar933x.c b/sys/mips/atheros/uart_bus_ar933x.c index c71d47a771b0..3f0314302600 100644 --- a/sys/mips/atheros/uart_bus_ar933x.c +++ b/sys/mips/atheros/uart_bus_ar933x.c @@ -90,7 +90,7 @@ uart_ar933x_probe(device_t dev) sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(AR71XX_UART_ADDR); - return (uart_bus_probe(dev, 2, 0, freq, 0, 0)); + return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0)); } /* diff --git a/sys/mips/broadcom/uart_bus_chipc.c b/sys/mips/broadcom/uart_bus_chipc.c index 132819846553..b796c371da3d 100644 --- a/sys/mips/broadcom/uart_bus_chipc.c +++ b/sys/mips/broadcom/uart_bus_chipc.c @@ -61,7 +61,7 @@ uart_chipc_probe(device_t dev) sc->sc_class = &uart_ns8250_class; rclk = bcm_get_uart_rclk(bcm_get_platform()); - return (uart_bus_probe(dev, 0, 0, rclk, 0, 0)); + return (uart_bus_probe(dev, 0, 0, rclk, 0, 0, 0)); } static device_method_t uart_chipc_methods[] = { diff --git a/sys/mips/cavium/uart_bus_octeonusart.c b/sys/mips/cavium/uart_bus_octeonusart.c index 4d50f91fdac6..8569f4fdc03d 100644 --- a/sys/mips/cavium/uart_bus_octeonusart.c +++ b/sys/mips/cavium/uart_bus_octeonusart.c @@ -107,7 +107,7 @@ uart_octeon_probe(device_t dev) if (bus_space_map(sc->sc_bas.bst, CVMX_MIO_UARTX_RBR(0), uart_getrange(sc->sc_class), 0, &sc->sc_bas.bsh) != 0) return (ENXIO); - return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, 0, unit)); + return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, 0, unit, 0)); } DRIVER_MODULE(uart, obio, uart_octeon_driver, uart_devclass, 0, 0); diff --git a/sys/mips/ingenic/jz4780_uart.c b/sys/mips/ingenic/jz4780_uart.c index ccc8137c04db..38d15493c155 100644 --- a/sys/mips/ingenic/jz4780_uart.c +++ b/sys/mips/ingenic/jz4780_uart.c @@ -179,7 +179,7 @@ jz4780_uart_probe(device_t dev) device_printf(dev, "got UART clock: %lld\n", freq); sc->ns8250_base.base.sc_class = (struct uart_class *)cd->ocd_data; shift = jz4780_uart_get_shift(dev); - return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0)); + return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0, 0)); } static int diff --git a/sys/mips/malta/uart_bus_maltausart.c b/sys/mips/malta/uart_bus_maltausart.c index 0bd11282cea4..a3fdf77f879c 100644 --- a/sys/mips/malta/uart_bus_maltausart.c +++ b/sys/mips/malta/uart_bus_maltausart.c @@ -87,7 +87,7 @@ uart_malta_probe(device_t dev) sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); - return(uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return(uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } DRIVER_MODULE(uart, obio, uart_malta_driver, uart_devclass, 0, 0); diff --git a/sys/modules/uart/Makefile b/sys/modules/uart/Makefile index f16d59aa7f6e..0b878c09187d 100644 --- a/sys/modules/uart/Makefile +++ b/sys/modules/uart/Makefile @@ -2,6 +2,11 @@ .PATH: ${SRCTOP}/sys/dev/uart +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" +uart_bus_acpi=uart_bus_acpi.c +.endif + .if ${MACHINE_CPUARCH} == "sparc64" uart_bus_ebus= uart_bus_ebus.c .endif @@ -27,7 +32,7 @@ uart_dev_mu=uart_dev_mu.c .endif KMOD= uart -SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ +SRCS= ${uart_bus_acpi} ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ ${uart_dev_mvebu} uart_dev_ns8250.c ${uart_dev_mu} \ @@ -37,6 +42,6 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \ pci_if.h \ power_if.h pccarddevs.h serdev_if.h -SRCS+= opt_platform.h opt_uart.h +SRCS+= opt_acpi.h opt_platform.h opt_uart.h .include diff --git a/sys/powerpc/psim/uart_iobus.c b/sys/powerpc/psim/uart_iobus.c index 5cceef76377f..7da09ebdbf3e 100644 --- a/sys/powerpc/psim/uart_iobus.c +++ b/sys/powerpc/psim/uart_iobus.c @@ -83,7 +83,7 @@ uart_iobus_probe(device_t dev) sc->sc_class = &uart_ns8250_class; device_set_desc(dev, "PSIM serial port"); - return (uart_bus_probe(dev, 0, 0, 0, 0, 0)); + return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); } DRIVER_MODULE(uart, iobus, uart_iobus_driver, uart_devclass, 0, 0); diff --git a/sys/sparc64/pci/sbbc.c b/sys/sparc64/pci/sbbc.c index f4a100ec5621..a5975fff82a3 100644 --- a/sys/sparc64/pci/sbbc.c +++ b/sys/sparc64/pci/sbbc.c @@ -620,7 +620,7 @@ sbbc_uart_sbbc_probe(device_t dev) sc = device_get_softc(dev); sc->sc_class = &uart_sbbc_class; device_set_desc(dev, "Serengeti console"); - return (uart_bus_probe(dev, 0, 0, 0, SBBC_PCI_BAR, 0)); + return (uart_bus_probe(dev, 0, 0, 0, SBBC_PCI_BAR, 0, 0)); } /*