Lines Matching refs:bas

68 static int imx_uart_probe(struct uart_bas *bas);
69 static void imx_uart_init(struct uart_bas *bas, int, int, int, int);
70 static void imx_uart_term(struct uart_bas *bas);
71 static void imx_uart_putc(struct uart_bas *bas, int);
72 static int imx_uart_rxready(struct uart_bas *bas);
73 static int imx_uart_getc(struct uart_bas *bas, struct mtx *);
86 dumpregs(struct uart_bas *bas, const char * msg)
93 msg, bas->bsh,
94 GETREG(bas, REG(UCR1)), GETREG(bas, REG(UCR2)),
95 GETREG(bas, REG(UCR3)), GETREG(bas, REG(UCR4)),
96 GETREG(bas, REG(USR1)), GETREG(bas, REG(USR2)));
101 imx_uart_probe(struct uart_bas *bas) in imx_uart_probe() argument
108 imx_uart_getbaud(struct uart_bas *bas) in imx_uart_getbaud() argument
126 i = (GETREG(bas, REG(UFCR)) & IMXUART_UFCR_RFDIV_MASK) >> in imx_uart_getbaud()
129 ubir = GETREG(bas, REG(UBIR)) + 1; in imx_uart_getbaud()
130 ubmr = GETREG(bas, REG(UBMR)) + 1; in imx_uart_getbaud()
147 imx_uart_init(struct uart_bas *bas, int baudrate, int databits, in imx_uart_init() argument
153 SET(bas, REG(UCR1), FLD(UCR1, UARTEN)); in imx_uart_init()
154 SET(bas, REG(UCR2), FLD(UCR2, RXEN) | FLD(UCR2, TXEN)); in imx_uart_init()
157 DIS(bas, UCR2, WS); in imx_uart_init()
159 ENA(bas, UCR2, WS); in imx_uart_init()
162 ENA(bas, UCR2, STPB); in imx_uart_init()
164 DIS(bas, UCR2, STPB); in imx_uart_init()
168 DIS(bas, UCR2, PROE); in imx_uart_init()
169 ENA(bas, UCR2, PREN); in imx_uart_init()
172 ENA(bas, UCR2, PROE); in imx_uart_init()
173 ENA(bas, UCR2, PREN); in imx_uart_init()
180 DIS(bas, UCR2, PREN); in imx_uart_init()
198 reg = GETREG(bas, REG(UFCR)); in imx_uart_init()
200 SETREG(bas, REG(UFCR), reg); in imx_uart_init()
201 SETREG(bas, REG(UBIR), 15); in imx_uart_init()
202 SETREG(bas, REG(UBMR), (baseclk / baudrate) - 1); in imx_uart_init()
210 reg = GETREG(bas, REG(UFCR)); in imx_uart_init()
214 SETREG(bas, REG(UFCR), reg); in imx_uart_init()
218 imx_uart_term(struct uart_bas *bas) in imx_uart_term() argument
224 imx_uart_putc(struct uart_bas *bas, int c) in imx_uart_putc() argument
227 while (!(IS(bas, USR1, TRDY))) in imx_uart_putc()
229 SETREG(bas, REG(UTXD), c); in imx_uart_putc()
233 imx_uart_rxready(struct uart_bas *bas) in imx_uart_rxready() argument
236 return ((IS(bas, USR2, RDR)) ? 1 : 0); in imx_uart_rxready()
240 imx_uart_getc(struct uart_bas *bas, struct mtx *hwmtx) in imx_uart_getc() argument
245 while (!(IS(bas, USR2, RDR))) in imx_uart_getc()
248 c = GETREG(bas, REG(URXD)); in imx_uart_getc()
329 struct uart_bas *bas; in imx_uart_bus_attach() local
332 bas = &sc->sc_bas; in imx_uart_bus_attach()
335 imx_uart_init(bas, di->baudrate, di->databits, di->stopbits, in imx_uart_bus_attach()
338 imx_uart_init(bas, 115200, 8, 1, 0); in imx_uart_bus_attach()
344 SETREG(bas, REG(USR1), 0xffff); in imx_uart_bus_attach()
345 SETREG(bas, REG(USR2), 0xffff); in imx_uart_bus_attach()
347 DIS(bas, UCR4, DREN); in imx_uart_bus_attach()
348 ENA(bas, UCR1, RRDYEN); in imx_uart_bus_attach()
349 DIS(bas, UCR1, IDEN); in imx_uart_bus_attach()
350 DIS(bas, UCR3, RXDSEN); in imx_uart_bus_attach()
351 ENA(bas, UCR2, ATEN); in imx_uart_bus_attach()
352 DIS(bas, UCR1, TXMPTYEN); in imx_uart_bus_attach()
353 DIS(bas, UCR1, TRDYEN); in imx_uart_bus_attach()
354 DIS(bas, UCR4, TCEN); in imx_uart_bus_attach()
355 DIS(bas, UCR4, OREN); in imx_uart_bus_attach()
356 ENA(bas, UCR4, BKEN); in imx_uart_bus_attach()
357 DIS(bas, UCR4, WKEN); in imx_uart_bus_attach()
358 DIS(bas, UCR1, ADEN); in imx_uart_bus_attach()
359 DIS(bas, UCR3, ACIEN); in imx_uart_bus_attach()
360 DIS(bas, UCR2, ESCI); in imx_uart_bus_attach()
361 DIS(bas, UCR4, ENIRI); in imx_uart_bus_attach()
362 DIS(bas, UCR3, AIRINTEN); in imx_uart_bus_attach()
363 DIS(bas, UCR3, AWAKEN); in imx_uart_bus_attach()
364 DIS(bas, UCR3, FRAERREN); in imx_uart_bus_attach()
365 DIS(bas, UCR3, PARERREN); in imx_uart_bus_attach()
366 DIS(bas, UCR1, RTSDEN); in imx_uart_bus_attach()
367 DIS(bas, UCR2, RTSEN); in imx_uart_bus_attach()
368 DIS(bas, UCR3, DTREN); in imx_uart_bus_attach()
369 DIS(bas, UCR3, RI); in imx_uart_bus_attach()
370 DIS(bas, UCR3, DCD); in imx_uart_bus_attach()
371 DIS(bas, UCR3, DTRDEN); in imx_uart_bus_attach()
372 ENA(bas, UCR2, IRTS); in imx_uart_bus_attach()
373 ENA(bas, UCR3, RXDMUXSEL); in imx_uart_bus_attach()
418 struct uart_bas *bas; in imx_uart_bus_ioctl() local
421 bas = &sc->sc_bas; in imx_uart_bus_ioctl()
429 *(u_int*)data = imx_uart_getbaud(bas); in imx_uart_bus_ioctl()
443 struct uart_bas *bas; in imx_uart_bus_ipend() local
448 bas = &sc->sc_bas; in imx_uart_bus_ipend()
454 usr1 = GETREG(bas, REG(USR1)); in imx_uart_bus_ipend()
455 usr2 = GETREG(bas, REG(USR2)); in imx_uart_bus_ipend()
457 SETREG(bas, REG(USR1), usr1); in imx_uart_bus_ipend()
458 SETREG(bas, REG(USR2), usr2); in imx_uart_bus_ipend()
460 ucr1 = GETREG(bas, REG(UCR1)); in imx_uart_bus_ipend()
461 ucr2 = GETREG(bas, REG(UCR2)); in imx_uart_bus_ipend()
462 ucr4 = GETREG(bas, REG(UCR4)); in imx_uart_bus_ipend()
466 DIS(bas, UCR1, TRDYEN); in imx_uart_bus_ipend()
477 DIS(bas, UCR1, RRDYEN); in imx_uart_bus_ipend()
478 DIS(bas, UCR2, ATEN); in imx_uart_bus_ipend()
527 struct uart_bas *bas; in imx_uart_bus_receive() local
530 bas = &sc->sc_bas; in imx_uart_bus_receive()
539 while (IS(bas, USR2, RDR)) { in imx_uart_bus_receive()
545 xc = GETREG(bas, REG(URXD)); in imx_uart_bus_receive()
558 ENA(bas, UCR1, RRDYEN); in imx_uart_bus_receive()
559 ENA(bas, UCR2, ATEN); in imx_uart_bus_receive()
575 struct uart_bas *bas = &sc->sc_bas; in imx_uart_bus_transmit() local
578 bas = &sc->sc_bas; in imx_uart_bus_transmit()
588 SETREG(bas, REG(UTXD), sc->sc_txbuf[i] & 0xff); in imx_uart_bus_transmit()
591 ENA(bas, UCR1, TRDYEN); in imx_uart_bus_transmit()
601 struct uart_bas *bas = &sc->sc_bas; in imx_uart_bus_grab() local
603 bas = &sc->sc_bas; in imx_uart_bus_grab()
605 DIS(bas, UCR1, RRDYEN); in imx_uart_bus_grab()
606 DIS(bas, UCR2, ATEN); in imx_uart_bus_grab()
613 struct uart_bas *bas = &sc->sc_bas; in imx_uart_bus_ungrab() local
615 bas = &sc->sc_bas; in imx_uart_bus_ungrab()
617 ENA(bas, UCR1, RRDYEN); in imx_uart_bus_ungrab()
618 ENA(bas, UCR2, ATEN); in imx_uart_bus_ungrab()