Lines Matching refs:bas
58 static int lowrisc_uart_probe(struct uart_bas *bas);
59 static void lowrisc_uart_init(struct uart_bas *bas, int, int, int, int);
60 static void lowrisc_uart_term(struct uart_bas *bas);
61 static void lowrisc_uart_putc(struct uart_bas *bas, int);
62 static int lowrisc_uart_rxready(struct uart_bas *bas);
63 static int lowrisc_uart_getc(struct uart_bas *bas, struct mtx *);
75 lowrisc_uart_probe(struct uart_bas *bas) in lowrisc_uart_probe() argument
82 lowrisc_uart_getbaud(struct uart_bas *bas) in lowrisc_uart_getbaud() argument
89 lowrisc_uart_init(struct uart_bas *bas, int baudrate, int databits, in lowrisc_uart_init() argument
97 lowrisc_uart_term(struct uart_bas *bas) in lowrisc_uart_term() argument
104 lowrisc_uart_putc(struct uart_bas *bas, int c) in lowrisc_uart_putc() argument
107 while (GETREG(bas, UART_DR) & DR_TX_FIFO_FULL) in lowrisc_uart_putc()
110 SETREG(bas, UART_DR, c); in lowrisc_uart_putc()
114 lowrisc_uart_rxready(struct uart_bas *bas) in lowrisc_uart_rxready() argument
117 if (GETREG(bas, UART_DR) & DR_RX_FIFO_EMPTY) in lowrisc_uart_rxready()
124 lowrisc_uart_getc(struct uart_bas *bas, struct mtx *hwmtx) in lowrisc_uart_getc() argument
129 SETREG(bas, UART_INT_STATUS, INT_STATUS_ACK); in lowrisc_uart_getc()
130 reg = GETREG(bas, UART_DR); in lowrisc_uart_getc()
193 struct uart_bas *bas; in lowrisc_uart_bus_attach() local
196 bas = &sc->sc_bas; in lowrisc_uart_bus_attach()
199 lowrisc_uart_init(bas, di->baudrate, di->databits, di->stopbits, in lowrisc_uart_bus_attach()
202 lowrisc_uart_init(bas, DEFAULT_BAUD_RATE, 8, 1, 0); in lowrisc_uart_bus_attach()
241 struct uart_bas *bas; in lowrisc_uart_bus_ioctl() local
244 bas = &sc->sc_bas; in lowrisc_uart_bus_ioctl()
252 *(u_int*)data = lowrisc_uart_getbaud(bas); in lowrisc_uart_bus_ioctl()
266 struct uart_bas *bas; in lowrisc_uart_bus_ipend() local
269 bas = &sc->sc_bas; in lowrisc_uart_bus_ipend()
274 if ((GETREG(bas, UART_DR) & DR_RX_FIFO_EMPTY) == 0) in lowrisc_uart_bus_ipend()
276 SETREG(bas, UART_INT_STATUS, INT_STATUS_ACK); in lowrisc_uart_bus_ipend()
320 struct uart_bas *bas; in lowrisc_uart_bus_receive() local
323 bas = &sc->sc_bas; in lowrisc_uart_bus_receive()
333 reg = GETREG(bas, UART_DR); in lowrisc_uart_bus_receive()
334 SETREG(bas, UART_INT_STATUS, INT_STATUS_ACK); in lowrisc_uart_bus_receive()
353 struct uart_bas *bas; in lowrisc_uart_bus_transmit() local
356 bas = &sc->sc_bas; in lowrisc_uart_bus_transmit()
360 while (GETREG(bas, UART_DR) & DR_TX_FIFO_FULL) in lowrisc_uart_bus_transmit()
362 SETREG(bas, UART_DR, sc->sc_txbuf[i] & 0xff); in lowrisc_uart_bus_transmit()