Page MenuHomeFreeBSD

D17381.1777619051.diff
No OneTemporary

Size
22 KB
Referenced Files
None
Subscribers
None

D17381.1777619051.diff

Index: sys/arm/nvidia/tegra_uart.c
===================================================================
--- sys/arm/nvidia/tegra_uart.c
+++ sys/arm/nvidia/tegra_uart.c
@@ -217,7 +217,7 @@
device_printf(dev, "Cannot enable UART clock: %d\n", rv);
return (ENXIO);
}
- return (uart_bus_probe(dev, shift, (int)freq, 0, 0));
+ return (uart_bus_probe(dev, shift, 0, (int)freq, 0, 0, 0));
}
static int
@@ -248,4 +248,4 @@
};
DRIVER_MODULE(tegra_uart, simplebus, tegra_uart_driver, uart_devclass,
- 0, 0);
\ No newline at end of file
+ 0, 0);
Index: sys/dev/acpica/acpi.c
===================================================================
--- sys/dev/acpica/acpi.c
+++ sys/dev/acpica/acpi.c
@@ -2169,6 +2169,14 @@
ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo)))
return (FALSE);
+ /* 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 */
present = (devinfo->Valid & ACPI_VALID_STA) == 0 ||
ACPI_DEVICE_PRESENT(devinfo->CurrentStatus) ? TRUE : FALSE;
Index: sys/dev/uart/uart.h
===================================================================
--- sys/dev/uart/uart.h
+++ sys/dev/uart/uart.h
@@ -41,9 +41,12 @@
u_int chan;
u_int rclk;
u_int regshft;
+ u_int regiowidth;
+ u_int busy_detect;
};
#define uart_regofs(bas, reg) ((reg) << (bas)->regshft)
+#define uart_regiowidth(bas) ((bas)->regiowidth)
#define uart_getreg(bas, reg) \
bus_space_read_1((bas)->bst, (bas)->bsh, uart_regofs(bas, reg))
Index: sys/dev/uart/uart_bus.h
===================================================================
--- sys/dev/uart/uart_bus.h
+++ sys/dev/uart/uart_bus.h
@@ -54,6 +54,9 @@
#define UART_IOCTL_OFLOW 3
#define UART_IOCTL_BAUD 4
+/* UART quirk flag */
+#define UART_F_BUSY_DETECT 0x1
+
/*
* UART class & instance (=softc)
*/
@@ -63,6 +66,7 @@
u_int uc_range; /* Bus space address range. */
u_int uc_rclk; /* Default rclk for this device. */
u_int uc_rshift; /* Default regshift for this device. */
+ u_int uc_riowidth; /* Default reg io width for this device. */
};
struct uart_softc {
@@ -137,7 +141,7 @@
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 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);
Index: sys/dev/uart/uart_bus_acpi.c
===================================================================
--- sys/dev/uart/uart_bus_acpi.c
+++ sys/dev/uart/uart_bus_acpi.c
@@ -35,10 +35,13 @@
#include <sys/rman.h>
#include <machine/resource.h>
-#include <isa/isavar.h>
-
#include <dev/uart/uart.h>
#include <dev/uart/uart_bus.h>
+#include <dev/uart/uart_cpu_acpi.h>
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <dev/acpica/acpivar.h>
static int uart_acpi_probe(device_t dev);
@@ -57,33 +60,40 @@
sizeof(struct uart_softc),
};
-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}
-};
+static struct acpi_uart_compat_data *
+uart_acpi_find_device(device_t dev)
+{
+ 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) {
+ for (cd_it = *cd; cd_it->cd_hid != NULL; cd_it++) {
+ if (acpi_MatchHid(h, cd_it->cd_hid))
+ return (cd_it);
+ }
+ }
+
+ return (NULL);
+}
static int
uart_acpi_probe(device_t dev)
{
struct uart_softc *sc;
- device_t parent;
+ struct acpi_uart_compat_data *cd;
- parent = device_get_parent(dev);
sc = device_get_softc(dev);
- if (!ISA_PNP_PROBE(parent, dev, acpi_ns8250_ids)) {
- sc->sc_class = &uart_ns8250_class;
- return (uart_bus_probe(dev, 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. */
return (ENXIO);
}
Index: sys/dev/uart/uart_bus_ebus.c
===================================================================
--- sys/dev/uart/uart_bus_ebus.c
+++ sys/dev/uart/uart_bus_ebus.c
@@ -97,7 +97,7 @@
return (ENXIO);
}
sc->sc_class = &uart_ns8250_class;
- return (uart_bus_probe(dev, 0, 0, 0, 0));
+ return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0));
}
return (ENXIO);
Index: sys/dev/uart/uart_bus_fdt.c
===================================================================
--- sys/dev/uart/uart_bus_fdt.c
+++ sys/dev/uart/uart_bus_fdt.c
@@ -90,6 +90,15 @@
return (0);
}
+int
+uart_fdt_get_io_width(phandle_t node, pcell_t *cell)
+{
+
+ if ((OF_getencprop(node, "reg-io-width", cell, sizeof(*cell))) <= 0)
+ return (-1);
+ return (0);
+}
+
static uintptr_t
uart_fdt_find_device(device_t dev)
{
@@ -161,7 +170,7 @@
const char **name;
struct uart_class *class;
phandle_t node, chosen;
- pcell_t br, clk, shift;
+ pcell_t br, clk, shift, iowidth;
char *cp;
int err;
@@ -212,6 +221,9 @@
if (uart_fdt_get_shift(node, &shift) != 0)
shift = uart_getregshift(class);
+ if (uart_fdt_get_io_width(node, &iowidth) != 0)
+ iowidth = uart_getregiowidth(class);
+
if (OF_getencprop(node, "current-speed", &br, sizeof(br)) <= 0)
br = 0;
@@ -232,7 +244,7 @@
{
struct uart_softc *sc;
phandle_t node;
- pcell_t clock, shift;
+ pcell_t clock, shift, iowidth;
int err;
sc = device_get_softc(dev);
@@ -250,8 +262,10 @@
return (err);
if (uart_fdt_get_shift(node, &shift) != 0)
shift = uart_getregshift(sc->sc_class);
+ if (uart_fdt_get_io_width(node, &iowidth) != 0)
+ iowidth = uart_getregiowidth(sc->sc_class);
- return (uart_bus_probe(dev, (int)shift, (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);
Index: sys/dev/uart/uart_bus_isa.c
===================================================================
--- sys/dev/uart/uart_bus_isa.c
+++ sys/dev/uart/uart_bus_isa.c
@@ -185,7 +185,7 @@
#else
sc->sc_class = &uart_ns8250_class;
#endif
- return (uart_bus_probe(dev, 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);
Index: sys/dev/uart/uart_bus_pccard.c
===================================================================
--- sys/dev/uart/uart_bus_pccard.c
+++ sys/dev/uart/uart_bus_pccard.c
@@ -93,7 +93,7 @@
sc = device_get_softc(dev);
sc->sc_class = &uart_ns8250_class;
- error = uart_bus_probe(dev, 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));
Index: sys/dev/uart/uart_bus_pci.c
===================================================================
--- sys/dev/uart/uart_bus_pci.c
+++ sys/dev/uart/uart_bus_pci.c
@@ -202,7 +202,7 @@
return (ENXIO);
match:
- result = uart_bus_probe(dev, id->regshft, 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);
Index: sys/dev/uart/uart_bus_puc.c
===================================================================
--- sys/dev/uart/uart_bus_puc.c
+++ sys/dev/uart/uart_bus_puc.c
@@ -81,7 +81,7 @@
if (BUS_READ_IVAR(parent, dev, PUC_IVAR_CLOCK, &rclk))
rclk = 0;
- return (uart_bus_probe(dev, 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);
Index: sys/dev/uart/uart_bus_scc.c
===================================================================
--- sys/dev/uart/uart_bus_scc.c
+++ sys/dev/uart/uart_bus_scc.c
@@ -112,7 +112,7 @@
BUS_READ_IVAR(parent, dev, SCC_IVAR_REGSHFT, &rs))
return (ENXIO);
- return (uart_bus_probe(dev, rs, 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);
Index: sys/dev/uart/uart_core.c
===================================================================
--- sys/dev/uart/uart_core.c
+++ sys/dev/uart/uart_core.c
@@ -252,6 +252,12 @@
return ((uc != NULL) ? uc->uc_rshift : 0);
}
+u_int
+uart_getregiowidth(struct uart_class *uc)
+{
+ return ((uc != NULL) ? uc->uc_riowidth : 0);
+}
+
/*
* Schedule a soft interrupt. We do this on the 0 to !0 transition
* of the TTY pending interrupt status.
@@ -481,7 +487,7 @@
}
int
-uart_bus_probe(device_t dev, int regshft, 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;
@@ -539,7 +545,9 @@
sc->sc_bas.bst = rman_get_bustag(sc->sc_rres);
sc->sc_bas.chan = chan;
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 &&
Index: sys/dev/uart/uart_cpu.h
===================================================================
--- sys/dev/uart/uart_cpu.h
+++ sys/dev/uart/uart_cpu.h
@@ -80,6 +80,7 @@
struct uart_ops *uart_getops(struct uart_class *);
int uart_getrange(struct uart_class *);
u_int uart_getregshift(struct uart_class *);
+u_int uart_getregiowidth(struct uart_class *);
void uart_add_sysdev(struct uart_devinfo *);
Index: sys/dev/uart/uart_cpu_acpi.h
===================================================================
--- sys/dev/uart/uart_cpu_acpi.h
+++ sys/dev/uart/uart_cpu_acpi.h
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2015 Michal Meloun
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _DEV_UART_CPU_ACPI_H_
+#define _DEV_UART_CPU_ACPI_H_
+
+#include <sys/linker_set.h>
+
+struct uart_class;
+
+struct acpi_uart_compat_data {
+ 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;
+};
+
+/*
+ * If your UART driver implements only uart_class and uses uart_cpu_acpi.c
+ * for device instantiation, then use UART_ACPI_CLASS_AND_DEVICE for its
+ * declaration
+ */
+SET_DECLARE(uart_acpi_class_and_device_set, struct acpi_uart_compat_data);
+#define UART_ACPI_CLASS_AND_DEVICE(data) \
+ DATA_SET(uart_acpi_class_and_device_set, data)
+
+/*
+ * If your UART driver implements uart_class and custom device layer,
+ * then use UART_ACPI_CLASS for its declaration
+ */
+SET_DECLARE(uart_acpi_class_set, struct acpi_uart_compat_data);
+#define UART_ACPI_CLASS(data) \
+ DATA_SET(uart_acpi_class_set, data)
+
+#endif /* _DEV_UART_CPU_ACPI_H_ */
Index: sys/dev/uart/uart_cpu_fdt.h
===================================================================
--- sys/dev/uart/uart_cpu_fdt.h
+++ sys/dev/uart/uart_cpu_fdt.h
@@ -54,5 +54,6 @@
bus_space_handle_t *, int *, u_int *, u_int *);
int uart_fdt_get_clock(phandle_t node, pcell_t *cell);
int uart_fdt_get_shift(phandle_t node, pcell_t *cell);
+int uart_fdt_get_io_width(phandle_t node, pcell_t *cell);
#endif /* _DEV_UART_CPU_FDT_H_ */
Index: sys/dev/uart/uart_dev_ns8250.c
===================================================================
--- sys/dev/uart/uart_dev_ns8250.c
+++ sys/dev/uart/uart_dev_ns8250.c
@@ -24,6 +24,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "opt_acpi.h"
#include "opt_platform.h"
#include "opt_uart.h"
@@ -52,7 +53,9 @@
#include <dev/uart/uart_bus.h>
#include <dev/uart/uart_dev_ns8250.h>
#include <dev/uart/uart_ppstypes.h>
-
+#ifdef DEV_ACPI
+#include <dev/uart/uart_cpu_acpi.h>
+#endif
#include <dev/ic/ns16550.h>
#include "uart_if.h"
@@ -391,6 +394,26 @@
.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},
Index: sys/dev/uart/uart_dev_pl011.c
===================================================================
--- sys/dev/uart/uart_dev_pl011.c
+++ sys/dev/uart/uart_dev_pl011.c
@@ -277,11 +277,22 @@
.uc_rshift = 2
};
+#ifdef FDT
static struct ofw_compat_data compat_data[] = {
{"arm,pl011", (uintptr_t)&uart_pl011_class},
{NULL, (uintptr_t)NULL},
};
UART_FDT_CLASS_AND_DEVICE(compat_data);
+#endif
+
+#ifdef DEV_ACPI
+static struct acpi_uart_compat_data acpi_compat_data[] = {
+ {"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
static int
uart_pl011_bus_attach(struct uart_softc *sc)
Index: sys/dev/uart/uart_dev_snps.c
===================================================================
--- sys/dev/uart/uart_dev_snps.c
+++ sys/dev/uart/uart_dev_snps.c
@@ -61,22 +61,9 @@
#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 */
- sc->ns8250.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_uart_attach),
KOBJMETHOD(uart_detach, ns8250_bus_detach),
KOBJMETHOD(uart_flush, ns8250_bus_flush),
KOBJMETHOD(uart_getsig, ns8250_bus_getsig),
@@ -136,7 +123,7 @@
struct snps_softc *sc;
struct uart_class *uart_class;
phandle_t node;
- uint32_t shift, clock;
+ uint32_t shift, iowidth, clock;
uint64_t freq;
int error;
#ifdef EXT_RESOURCES
@@ -159,6 +146,8 @@
node = ofw_bus_get_node(dev);
if (OF_getencprop(node, "reg-shift", &shift, sizeof(shift)) <= 0)
shift = 0;
+ if (OF_getencprop(node, "reg-io-width", &iowidth, sizeof(iowidth)) <= 0)
+ iowidth = 1;
if (OF_getencprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0)
clock = 0;
@@ -200,7 +189,7 @@
if (bootverbose && clock == 0)
device_printf(dev, "could not determine frequency\n");
- error = uart_bus_probe(dev, (int)shift, (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);
Index: sys/mips/atheros/uart_bus_ar71xx.c
===================================================================
--- sys/mips/atheros/uart_bus_ar71xx.c
+++ sys/mips/atheros/uart_bus_ar71xx.c
@@ -83,7 +83,7 @@
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, freq, 0, 0));
+ return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0));
}
DRIVER_MODULE(uart, apb, uart_ar71xx_driver, uart_devclass, 0, 0);
Index: sys/mips/atheros/uart_bus_ar933x.c
===================================================================
--- sys/mips/atheros/uart_bus_ar933x.c
+++ sys/mips/atheros/uart_bus_ar933x.c
@@ -85,7 +85,7 @@
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, freq, 0, 0));
+ return (uart_bus_probe(dev, 2, 0, freq, 0, 0, 0));
}
DRIVER_MODULE(uart, apb, uart_ar933x_driver, uart_devclass, 0, 0);
Index: sys/mips/broadcom/uart_bus_chipc.c
===================================================================
--- sys/mips/broadcom/uart_bus_chipc.c
+++ sys/mips/broadcom/uart_bus_chipc.c
@@ -63,7 +63,7 @@
/* TODO: UART rate should be calculated from CPU clock speed
* as fetched from bhnd bus */
socinfo = bcm_get_socinfo();
- return (uart_bus_probe(dev, 0, socinfo->uartrate, 0, 0));
+ return (uart_bus_probe(dev, 0, 0, socinfo->uartrate, 0, 0, 0));
}
static device_method_t uart_chipc_methods[] = {
Index: sys/mips/cavium/uart_bus_octeonusart.c
===================================================================
--- sys/mips/cavium/uart_bus_octeonusart.c
+++ sys/mips/cavium/uart_bus_octeonusart.c
@@ -105,7 +105,7 @@
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, 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);
Index: sys/mips/malta/uart_bus_maltausart.c
===================================================================
--- sys/mips/malta/uart_bus_maltausart.c
+++ sys/mips/malta/uart_bus_maltausart.c
@@ -85,7 +85,7 @@
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));
+ return(uart_bus_probe(dev, 0, 0, 0, 0, 0, 0));
}
DRIVER_MODULE(uart, obio, uart_malta_driver, uart_devclass, 0, 0);
Index: sys/modules/uart/Makefile
===================================================================
--- sys/modules/uart/Makefile
+++ 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
@@ -25,15 +30,15 @@
.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_lpc} uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \
uart_dev_z8530.c \
uart_if.c uart_if.h uart_subr.c uart_tty.c
-SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \
+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 <bsd.kmod.mk>
Index: sys/powerpc/psim/uart_iobus.c
===================================================================
--- sys/powerpc/psim/uart_iobus.c
+++ sys/powerpc/psim/uart_iobus.c
@@ -81,7 +81,7 @@
sc->sc_class = &uart_ns8250_class;
device_set_desc(dev, "PSIM serial port");
- return (uart_bus_probe(dev, 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);
Index: sys/sparc64/pci/sbbc.c
===================================================================
--- sys/sparc64/pci/sbbc.c
+++ sys/sparc64/pci/sbbc.c
@@ -618,7 +618,7 @@
sc = device_get_softc(dev);
sc->sc_class = &uart_sbbc_class;
device_set_desc(dev, "Serengeti console");
- return (uart_bus_probe(dev, 0, 0, SBBC_PCI_BAR, 0));
+ return (uart_bus_probe(dev, 0, 0, 0, SBBC_PCI_BAR, 0, 0));
}
/*

File Metadata

Mime Type
text/plain
Expires
Fri, May 1, 7:04 AM (2 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28521596
Default Alt Text
D17381.1777619051.diff (22 KB)

Event Timeline