Lines Matching +full:use +full:- +full:parity

1 /*-
5 * Redistribution and use in source and binary forms, with or without
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 #define RBR_PAR_ERR_DET (1 << 13) /* Parity Error Detect */
59 #define CTRL_PAR_EN (1 << 10) /* Parity Enable */
61 #define CTRL_TX_HALF_INT (1 << 8) /* TX Half-Full Interrupt Enable */
62 #define CTRL_RX_HALF_INT (1 << 7) /* RX Half-Full Interrupt Enable */
68 #define CTRL_PAR_ERR_INT (1 << 1) /* Parity Error Interrupt Enable */
88 #define STAT_PAR_ERR (1 << 1) /* Parity Error */
127 * Low-level UART interface.
168 int parity) in uart_mvebu_param() argument
189 switch (parity) { in uart_mvebu_param()
190 case 3: /* Even parity bit */ in uart_mvebu_param()
199 divisor = uart_mvebu_divisor(bas->rclk, baudrate); in uart_mvebu_param()
222 int parity) in uart_mvebu_init() argument
225 bas->rclk = DEFAULT_RCLK; in uart_mvebu_init()
232 uart_mvebu_param(bas, baudrate, databits, stopbits, parity); in uart_mvebu_init()
306 "mvebu-uart",
317 {"marvell,armada-3700-uart", (uintptr_t)&uart_mvebu_class},
328 bas = &sc->sc_bas; in uart_mvebu_bus_attach()
329 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_attach()
341 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_attach()
359 bas = &sc->sc_bas; in uart_mvebu_bus_flush()
360 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_flush()
385 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_flush()
403 bas = &sc->sc_bas; in uart_mvebu_bus_ioctl()
404 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_ioctl()
418 baudrate = bas->rclk/(divisor * 16); in uart_mvebu_bus_ioctl()
426 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_ioctl()
437 bas = &sc->sc_bas; in uart_mvebu_bus_ipend()
438 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_ipend()
457 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_ipend()
464 int stopbits, int parity) in uart_mvebu_bus_param() argument
468 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_param()
469 ret = uart_mvebu_param(&sc->sc_bas, baudrate, databits, stopbits, parity); in uart_mvebu_bus_param()
470 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_param()
478 if (!ofw_bus_status_okay(sc->sc_dev)) in uart_mvebu_bus_probe()
481 if (!ofw_bus_search_compatible(sc->sc_dev, compat_data)->ocd_data) in uart_mvebu_bus_probe()
484 device_set_desc(sc->sc_dev, "Marvell Armada 3700 UART"); in uart_mvebu_bus_probe()
486 sc->sc_txfifosz = 32; in uart_mvebu_bus_probe()
487 sc->sc_rxfifosz = 64; in uart_mvebu_bus_probe()
488 sc->sc_hwiflow = 0; in uart_mvebu_bus_probe()
489 sc->sc_hwoflow = 0; in uart_mvebu_bus_probe()
501 bas = &sc->sc_bas; in uart_mvebu_bus_receive()
502 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_receive()
506 sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; in uart_mvebu_bus_receive()
535 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_receive()
552 bas = &sc->sc_bas; in uart_mvebu_bus_transmit()
553 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_transmit()
560 for (i = 0; i < sc->sc_txdatasz; i++) { in uart_mvebu_bus_transmit()
561 uart_setreg(bas, UART_TSH, sc->sc_txbuf[i] & 0xff); in uart_mvebu_bus_transmit()
573 sc->sc_txbusy = 1; in uart_mvebu_bus_transmit()
575 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_transmit()
583 struct uart_bas *bas = &sc->sc_bas; in uart_mvebu_bus_grab()
587 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_grab()
589 msc->intrm = ctrl & CTRL_INTR_MASK; in uart_mvebu_bus_grab()
592 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_grab()
599 struct uart_bas *bas = &sc->sc_bas; in uart_mvebu_bus_ungrab()
603 uart_lock(sc->sc_hwmtx); in uart_mvebu_bus_ungrab()
605 uart_setreg(bas, UART_CTRL, ctrl | msc->intrm); in uart_mvebu_bus_ungrab()
607 uart_unlock(sc->sc_hwmtx); in uart_mvebu_bus_ungrab()