Module Name: src Committed By: jmcneill Date: Mon May 4 22:59:36 UTC 2015
Modified Files: src/sys/dev/ic: com.c Log Message: For Tegra K1, set IE_RX_TIMEOUT (bit 4) in IER register. RX_TIMEOUT occurs when data has been sitting in the Rx FIFO for more than 4 character times without being read because there is not enough data to reach the trigger level. With this change, enable FIFO usage for Tegra UARTs. To generate a diff of this commit: cvs rdiff -u -r1.335 -r1.336 src/sys/dev/ic/com.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/com.c diff -u src/sys/dev/ic/com.c:1.335 src/sys/dev/ic/com.c:1.336 --- src/sys/dev/ic/com.c:1.335 Mon May 4 20:25:48 2015 +++ src/sys/dev/ic/com.c Mon May 4 22:59:36 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.335 2015/05/04 20:25:48 macallan Exp $ */ +/* $NetBSD: com.c,v 1.336 2015/05/04 22:59:36 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.335 2015/05/04 20:25:48 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.336 2015/05/04 22:59:36 jmcneill Exp $"); #include "opt_com.h" #include "opt_ddb.h" @@ -380,7 +380,8 @@ com_enable_debugport(struct com_softc *s sc->sc_ier = IER_ERXRDY; if (sc->sc_type == COM_TYPE_PXA2x0) sc->sc_ier |= IER_EUART | IER_ERXTOUT; - if (sc->sc_type == COM_TYPE_INGENIC) + if (sc->sc_type == COM_TYPE_INGENIC || + sc->sc_type == COM_TYPE_TEGRA) sc->sc_ier |= IER_ERXTOUT; CSR_WRITE_1(&sc->sc_regs, COM_REG_IER, sc->sc_ier); SET(sc->sc_mcr, MCR_DTR | MCR_RTS); @@ -466,11 +467,6 @@ com_attach_subr(struct com_softc *sc) SET(sc->sc_hwflags, COM_HW_FIFO); SET(sc->sc_hwflags, COM_HW_NOIEN); goto fifodelay; - - case COM_TYPE_TEGRA: - sc->sc_fifolen = 1; - fifo_msg = "Tegra UART, broken fifo"; - goto fifodelay; } sc->sc_fifolen = 1; @@ -818,7 +814,8 @@ com_shutdown(struct com_softc *sc) if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) { sc->sc_ier = IER_ERXRDY; /* interrupt on break */ if ((sc->sc_type == COM_TYPE_PXA2x0) || - (sc->sc_type == COM_TYPE_INGENIC)) + (sc->sc_type == COM_TYPE_INGENIC) || + (sc->sc_type == COM_TYPE_TEGRA)) sc->sc_ier |= IER_ERXTOUT; } else sc->sc_ier = 0; @@ -900,7 +897,8 @@ comopen(dev_t dev, int flag, int mode, s if (sc->sc_type == COM_TYPE_PXA2x0) sc->sc_ier |= IER_EUART | IER_ERXTOUT; - else if (sc->sc_type == COM_TYPE_INGENIC) + else if (sc->sc_type == COM_TYPE_INGENIC || + sc->sc_type == COM_TYPE_TEGRA) sc->sc_ier |= IER_ERXTOUT; CSR_WRITE_1(&sc->sc_regs, COM_REG_IER, sc->sc_ier); @@ -1909,7 +1907,8 @@ com_rxsoft(struct com_softc *sc, struct if (sc->sc_type == COM_TYPE_PXA2x0) SET(sc->sc_ier, IER_ERXTOUT); #endif - if (sc->sc_type == COM_TYPE_INGENIC) + if (sc->sc_type == COM_TYPE_INGENIC || + sc->sc_type == COM_TYPE_TEGRA) SET(sc->sc_ier, IER_ERXTOUT); CSR_WRITE_1(&sc->sc_regs, COM_REG_IER, @@ -2115,7 +2114,8 @@ again: do { CLR(sc->sc_ier, IER_ERXRDY|IER_ERXTOUT); else #endif - if (sc->sc_type == COM_TYPE_INGENIC) + if (sc->sc_type == COM_TYPE_INGENIC || + sc->sc_type == COM_TYPE_TEGRA) CLR(sc->sc_ier, IER_ERXRDY | IER_ERXTOUT); else