Fix TX FIFO on Tegra

This commit is contained in:
jmcneill 2015-12-14 23:57:30 +00:00
parent 21e70d0c91
commit 54369b5127
1 changed files with 16 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: com.c,v 1.337 2015/11/02 17:45:13 christos Exp $ */
/* $NetBSD: com.c,v 1.338 2015/12/14 23:57:30 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.337 2015/11/02 17:45:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.338 2015/12/14 23:57:30 jmcneill Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -467,6 +467,14 @@ 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 = 8;
fifo_msg = "Tegra UART, working fifo";
SET(sc->sc_hwflags, COM_HW_FIFO);
CSR_WRITE_1(regsp, COM_REG_FIFO,
FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1);
goto fifodelay;
}
sc->sc_fifolen = 1;
@ -1468,17 +1476,20 @@ comparam(struct tty *tp, struct termios *t)
* overflows.
* * Otherwise set it a bit higher.
*/
if (sc->sc_type == COM_TYPE_HAYESP)
if (sc->sc_type == COM_TYPE_HAYESP) {
sc->sc_fifo = FIFO_DMA_MODE | FIFO_ENABLE | FIFO_TRIGGER_8;
else if (ISSET(sc->sc_hwflags, COM_HW_FIFO)) {
} else if (sc->sc_type == COM_TYPE_TEGRA) {
sc->sc_fifo = FIFO_ENABLE | FIFO_TRIGGER_1;
} else if (ISSET(sc->sc_hwflags, COM_HW_FIFO)) {
if (t->c_ospeed <= 1200)
sc->sc_fifo = FIFO_ENABLE | FIFO_TRIGGER_1;
else if (t->c_ospeed <= 38400)
sc->sc_fifo = FIFO_ENABLE | FIFO_TRIGGER_8;
else
sc->sc_fifo = FIFO_ENABLE | FIFO_TRIGGER_4;
} else
} else {
sc->sc_fifo = 0;
}
if (sc->sc_type == COM_TYPE_INGENIC)
sc->sc_fifo |= FIFO_UART_ON;