git: e5d63cec57a5 - stable/15 - uart: Add support for the Intel XScale controller

Bojan Novković <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a79f75d.3465d.24e6e471__23848.0069486954$1786378205$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by bnovkov:

URL: https://cgit.FreeBSD.org/src/commit/?id=e5d63cec57a57f8403ccb09f73297877ef471175

commit e5d63cec57a57f8403ccb09f73297877ef471175
Author:     Bojan Novković <[email protected]>
AuthorDate: 2026-06-18 02:03:55 +0000
Commit:     Bojan Novković <[email protected]>
CommitDate: 2026-08-10 16:04:06 +0000

    uart: Add support for the Intel XScale controller
    
    The ns8250 driver avoids clearing IER bit 0x10 to account for the
    split "receiver time-out interrupt enable" bit, but it never sets
    it in `ier_rxbits` even though a comment in `ns8250_init` implies so.
    
    Fix this by setting `IER_RXTMOUT` if we've matched an XScale uart.
    
    Differential Revision:  https://reviews.freebsd.org/D57629
    Reviewed by:    imp
    MFC after:      2 weeks
    
    (cherry picked from commit 1665954e508f74588108e96c30b90d1a88807faa)
---
 sys/dev/uart/uart_dev_ns8250.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c
index 6d8097db6581..ca024daa7c33 100644
--- a/sys/dev/uart/uart_dev_ns8250.c
+++ b/sys/dev/uart/uart_dev_ns8250.c
@@ -526,6 +526,7 @@ UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data);
 static struct ofw_compat_data compat_data[] = {
 	{"ns16550",	(uintptr_t)&uart_ns8250_class},
 	{"ns16550a",	(uintptr_t)&uart_ns8250_class},
+	{"intel,xscale-uart",	(uintptr_t)&uart_ns8250_class},
 	{NULL,		(uintptr_t)NULL},
 };
 UART_FDT_CLASS_AND_DEVICE(compat_data);
@@ -611,6 +612,12 @@ ns8250_bus_attach(struct uart_softc *sc)
 
 	/* Get IER RX interrupt bits */
 	ivar = IER_EMSC | IER_ERLS | IER_ERXRDY;
+#ifdef FDT
+	/* Intel XScale models won't work without IER_RXTMOUT set. */
+	if (ofw_bus_is_compatible(sc->sc_dev, "intel,xscale-uart"))
+		ivar |= IER_RXTMOUT;
+#endif
+
 	resource_int_value("uart", device_get_unit(sc->sc_dev), "ier_rxbits",
 	    &ivar);
 	ns8250->ier_rxbits = (uint8_t)(ivar & 0xff);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.