diff options
author | 2016-09-03 14:43:37 +0000 | |
---|---|---|
committer | 2016-09-03 14:43:37 +0000 | |
commit | c87e16c3d51eccd337bc321a05f2eaa417457f01 (patch) | |
tree | f758b66d5676ec67a2eb06655a4d5add40215b1b | |
parent | switch from EVP_{En,De}cryptInit & EVP_{En,De}cryptFinal to their _ex (diff) | |
download | wireguard-openbsd-c87e16c3d51eccd337bc321a05f2eaa417457f01.tar.xz wireguard-openbsd-c87e16c3d51eccd337bc321a05f2eaa417457f01.zip |
de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev
-rw-r--r-- | sys/dev/ic/com.c | 147 | ||||
-rw-r--r-- | sys/dev/ic/comreg.h | 6 | ||||
-rw-r--r-- | sys/dev/ic/comvar.h | 5 |
3 files changed, 4 insertions, 154 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index b378ffc3696..cd11b2453e5 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.159 2016/08/16 08:15:04 kettenis Exp $ */ +/* $OpenBSD: com.c,v 1.160 2016/09/03 14:43:37 jsg Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -93,16 +93,6 @@ #include <dev/ic/ns16550reg.h> #define com_lcr com_cfcr -#ifdef COM_PXA2X0 -#define com_isr 8 -#define ISR_SEND (ISR_RXPL | ISR_XMODE | ISR_XMITIR) -#define ISR_RECV (ISR_RXPL | ISR_XMODE | ISR_RCVEIR) -#endif - -#ifdef __zaurus__ -#include <arch/zaurus/dev/zaurus_scoopvar.h> -#endif - cdev_decl(com); static u_char tiocm_xxx2mcr(int); @@ -116,9 +106,6 @@ struct cfdriver com_cd = { }; int comdefaultrate = TTYDEF_SPEED; -#ifdef COM_PXA2X0 -bus_addr_t comsiraddr; -#endif #ifdef COM_CONSOLE int comconsfreq; int comconsrate = TTYDEF_SPEED; @@ -351,9 +338,6 @@ comopen(dev_t dev, int flag, int mode, struct proc *p) case COM_UART_TI16750: bus_space_write_1(iot, ioh, com_ier, 0); break; - case COM_UART_PXA2X0: - bus_space_write_1(iot, ioh, com_ier, IER_EUART); - break; } } @@ -410,10 +394,6 @@ comopen(dev_t dev, int flag, int mode, struct proc *p) SET(sc->sc_mcr, MCR_IENABLE); bus_space_write_1(iot, ioh, com_mcr, sc->sc_mcr); sc->sc_ier = IER_ERXRDY | IER_ERLS | IER_EMSC; -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0) - sc->sc_ier |= IER_EUART | IER_ERXTOUT; -#endif bus_space_write_1(iot, ioh, com_ier, sc->sc_ier); sc->sc_msr = bus_space_read_1(iot, ioh, com_msr); @@ -422,15 +402,6 @@ comopen(dev_t dev, int flag, int mode, struct proc *p) SET(tp->t_state, TS_CARR_ON); else CLR(tp->t_state, TS_CARR_ON); -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0 && - ISSET(sc->sc_hwflags, COM_HW_SIR)) { - bus_space_write_1(iot, ioh, com_isr, ISR_RECV); -#ifdef __zaurus__ - scoop_set_irled(1); -#endif - } -#endif } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) return EBUSY; else @@ -563,15 +534,6 @@ compwroff(struct com_softc *sc) case COM_UART_TI16750: bus_space_write_1(iot, ioh, com_ier, IER_SLEEP); break; -#ifdef COM_PXA2X0 - case COM_UART_PXA2X0: - bus_space_write_1(iot, ioh, com_ier, 0); -#ifdef __zaurus__ - if (ISSET(sc->sc_hwflags, COM_HW_SIR)) - scoop_set_irled(0); -#endif - break; -#endif } } } @@ -608,9 +570,6 @@ com_resume(struct com_softc *sc) case COM_UART_TI16750: bus_space_write_1(iot, ioh, com_ier, 0); break; - case COM_UART_PXA2X0: - bus_space_write_1(iot, ioh, com_ier, IER_EUART); - break; } } @@ -671,16 +630,6 @@ com_resume(struct com_softc *sc) /* You turn me on, baby! */ bus_space_write_1(iot, ioh, com_mcr, sc->sc_mcr); bus_space_write_1(iot, ioh, com_ier, sc->sc_ier); - -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0 && - ISSET(sc->sc_hwflags, COM_HW_SIR)) { - bus_space_write_1(iot, ioh, com_isr, ISR_RECV); -#ifdef __zaurus__ - scoop_set_irled(1); -#endif - } -#endif } void @@ -1006,13 +955,6 @@ comstart(struct tty *tp) goto stopped; SET(tp->t_state, TS_BUSY); -#ifdef COM_PXA2X0 - /* Enable transmitter slow infrared mode. */ - if (sc->sc_uarttype == COM_UART_PXA2X0 && - ISSET(sc->sc_hwflags, COM_HW_SIR)) - bus_space_write_1(iot, ioh, com_isr, ISR_SEND); -#endif - /* Enable transmit completion interrupts. */ if (!ISSET(sc->sc_ier, IER_ETXRDY)) { SET(sc->sc_ier, IER_ETXRDY); @@ -1038,21 +980,6 @@ stopped: if (ISSET(sc->sc_ier, IER_ETXRDY)) { CLR(sc->sc_ier, IER_ETXRDY); bus_space_write_1(iot, ioh, com_ier, sc->sc_ier); -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0 && - ISSET(sc->sc_hwflags, COM_HW_SIR)) { - int timo; - - /* Wait for empty transmit shift register. */ - timo = 20000; - while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), - LSR_TSRE) && --timo) - delay(1); - - /* Enable receiver slow infrared mode. */ - bus_space_write_1(iot, ioh, com_isr, ISR_RECV); - } -#endif } splx(s); } @@ -1302,13 +1229,6 @@ comintr(void *arg) (*linesw[tp->t_line].l_start)(tp); } -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0 && - ISSET(sc->sc_hwflags, COM_HW_SIR) && - ISSET(lsr, LSR_TXRDY) && ISSET(lsr, LSR_TSRE)) - bus_space_write_1(iot, ioh, com_isr, ISR_RECV); -#endif - if (ISSET(bus_space_read_1(iot, ioh, com_iir), IIR_NOPEND)) return (1); } @@ -1325,11 +1245,6 @@ com_common_getc(bus_space_tag_t iot, bus_space_handle_t ioh) int s = splhigh(); u_char stat, c; -#ifdef COM_PXA2X0 - if (com_is_console(iot, comsiraddr)) - bus_space_write_1(iot, ioh, com_isr, ISR_RECV); -#endif - /* Block until a character becomes available. */ while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_RXRDY)) continue; @@ -1353,10 +1268,6 @@ com_common_putc(bus_space_tag_t iot, bus_space_handle_t ioh, int c) while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo) delay(1); -#ifdef COM_PXA2X0 - if (com_is_console(iot, comsiraddr)) - bus_space_write_1(iot, ioh, com_isr, ISR_SEND); -#endif bus_space_write_1(iot, ioh, com_data, (u_int8_t)(c & 0xff)); bus_space_barrier(iot, ioh, 0, COM_NPORTS, (BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE)); @@ -1366,18 +1277,6 @@ com_common_putc(bus_space_tag_t iot, bus_space_handle_t ioh, int c) while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo) delay(1); -#ifdef COM_PXA2X0 - if (com_is_console(iot, comsiraddr)) { - /* Wait for transmit shift register to become empty. */ - timo = 20000; - while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TSRE) - && --timo) - delay(1); - - bus_space_write_1(iot, ioh, com_isr, ISR_RECV); - } -#endif - splx(s); } @@ -1393,12 +1292,7 @@ cominit(bus_space_tag_t iot, bus_space_handle_t ioh, int rate, int frequency) bus_space_write_1(iot, ioh, com_dlbh, rate >> 8); bus_space_write_1(iot, ioh, com_lcr, LCR_8BITS); bus_space_write_1(iot, ioh, com_mcr, MCR_DTR | MCR_RTS); -#ifdef COM_PXA2X0 - /* XXX */ - bus_space_write_1(iot, ioh, com_ier, IER_EUART); /* Make sure they are off */ -#else bus_space_write_1(iot, ioh, com_ier, 0); /* Make sure they are off */ -#endif bus_space_write_1(iot, ioh, com_fifo, FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1); stat = bus_space_read_1(iot, ioh, com_iir); @@ -1537,21 +1431,6 @@ com_kgdb_putc(void *arg, int c) } #endif /* KGDB */ -#ifdef COM_PXA2X0 -int -com_is_console(bus_space_tag_t iot, bus_addr_t iobase) -{ - - if (comconsiot == iot && comconsaddr == iobase) - return (1); -#ifdef KGDB - else if (com_kgdb_iot == iot && com_kgdb_addr == iobase) - return (1); -#endif - return (0); -} -#endif /* COM_PXA2X0 */ - void com_enable_debugport(struct com_softc *); void com_fifo_probe(struct com_softc *); @@ -1565,10 +1444,6 @@ com_enable_debugport(struct com_softc *sc) s = splhigh(); #ifdef KGDB SET(sc->sc_ier, IER_ERXRDY); -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0) - sc->sc_ier |= IER_EUART | IER_ERXTOUT; -#endif bus_space_write_1(sc->sc_iot, sc->sc_ioh, com_ier, sc->sc_ier); #endif SET(sc->sc_mcr, MCR_DTR | MCR_RTS | MCR_IENABLE); @@ -1587,10 +1462,6 @@ com_attach_subr(struct com_softc *sc) u_int8_t lcr; sc->sc_ier = 0; -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0) - sc->sc_ier |= IER_EUART; -#endif /* disable interrupts */ bus_space_write_1(iot, ioh, com_ier, sc->sc_ier); @@ -1730,18 +1601,6 @@ com_attach_subr(struct com_softc *sc) printf(": ns16550a, %d byte fifo\n", sc->sc_fifolen); SET(sc->sc_hwflags, COM_HW_FIFO); break; -#ifdef COM_PXA2X0 - case COM_UART_PXA2X0: - printf(": pxa2x0, 32 byte fifo"); - SET(sc->sc_hwflags, COM_HW_FIFO); - sc->sc_fifolen = 32; - if (sc->sc_iobase == comsiraddr) { - SET(sc->sc_hwflags, COM_HW_SIR); - printf(" (SIR)"); - } - printf("\n"); - break; -#endif case COM_UART_ST16650: printf(": st16650, no working fifo\n"); break; @@ -1859,10 +1718,6 @@ com_fifo_probe(struct com_softc *sc) return; ier = 0; -#ifdef COM_PXA2X0 - if (sc->sc_uarttype == COM_UART_PXA2X0) - ier |= IER_EUART; -#endif bus_space_write_1(iot, ioh, com_ier, ier); bus_space_write_1(iot, ioh, com_lcr, LCR_DLAB); bus_space_write_1(iot, ioh, com_dlbl, 3); diff --git a/sys/dev/ic/comreg.h b/sys/dev/ic/comreg.h index 60846988f46..8771c454f44 100644 --- a/sys/dev/ic/comreg.h +++ b/sys/dev/ic/comreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: comreg.h,v 1.16 2008/06/08 13:55:06 kettenis Exp $ */ +/* $OpenBSD: comreg.h,v 1.17 2016/09/03 14:43:37 jsg Exp $ */ /* $NetBSD: comreg.h,v 1.8 1996/02/05 23:01:50 scottr Exp $ */ /* @@ -180,11 +180,7 @@ #define ISR_TXPL 0x08 /* negative transmit data polarity */ #define ISR_RXPL 0x10 /* negative receive data polarity */ -#ifdef COM_PXA2X0 -#define COM_NPORTS 9 -#else #define COM_NPORTS 8 -#endif /* * WARNING: Serial console is assumed to be at COM1 address diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h index 893ffde9a21..28b0f6b99f7 100644 --- a/sys/dev/ic/comvar.h +++ b/sys/dev/ic/comvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: comvar.h,v 1.51 2012/05/12 18:02:33 kettenis Exp $ */ +/* $OpenBSD: comvar.h,v 1.52 2016/09/03 14:43:37 jsg Exp $ */ /* $NetBSD: comvar.h,v 1.5 1996/05/05 19:50:47 christos Exp $ */ /* @@ -100,8 +100,7 @@ struct com_softc { #define COM_UART_TI16750 0x07 /* 64 byte fifo */ #define COM_UART_ST16C654 0x08 /* 64 bytes fifo */ #define COM_UART_XR16850 0x10 /* 128 byte fifo */ -#define COM_UART_PXA2X0 0x11 /* 16 byte fifo */ -#define COM_UART_OX16C950 0x12 /* 128 byte fifo */ +#define COM_UART_OX16C950 0x11 /* 128 byte fifo */ u_char sc_hwflags; #define COM_HW_NOIEN 0x01 |