• Home
  • Raw
  • Download

Lines Matching refs:uart

30 static int mcf_serial_init_common(uart_t *uart, int port_idx, int baudrate)  in mcf_serial_init_common()  argument
37 writeb(UART_UCR_RESET_RX, &uart->ucr); in mcf_serial_init_common()
38 writeb(UART_UCR_RESET_TX, &uart->ucr); in mcf_serial_init_common()
39 writeb(UART_UCR_RESET_ERROR, &uart->ucr); in mcf_serial_init_common()
40 writeb(UART_UCR_RESET_MR, &uart->ucr); in mcf_serial_init_common()
43 writeb(0, &uart->uimr); in mcf_serial_init_common()
46 writeb(UART_UCSR_RCS_SYS_CLK | UART_UCSR_TCS_SYS_CLK, &uart->ucsr); in mcf_serial_init_common()
48 writeb(UART_UMR_BC_8 | UART_UMR_PM_NONE, &uart->umr); in mcf_serial_init_common()
49 writeb(UART_UMR_SB_STOP_BITS_1, &uart->umr); in mcf_serial_init_common()
56 writeb((u8)((counter & 0xff00) >> 8), &uart->ubg1); in mcf_serial_init_common()
58 writeb((u8)(counter & 0x00ff), &uart->ubg2); in mcf_serial_init_common()
60 writeb(UART_UCR_RX_ENABLED | UART_UCR_TX_ENABLED, &uart->ucr); in mcf_serial_init_common()
65 static void mcf_serial_setbrg_common(uart_t *uart, int baudrate) in mcf_serial_setbrg_common() argument
74 writeb(((counter & 0xff00) >> 8), &uart->ubg1); in mcf_serial_setbrg_common()
76 writeb((counter & 0x00ff), &uart->ubg2); in mcf_serial_setbrg_common()
78 writeb(UART_UCR_RESET_RX, &uart->ucr); in mcf_serial_setbrg_common()
79 writeb(UART_UCR_RESET_TX, &uart->ucr); in mcf_serial_setbrg_common()
81 writeb(UART_UCR_RX_ENABLED | UART_UCR_TX_ENABLED, &uart->ucr); in mcf_serial_setbrg_common()
95 uart_t *uart = (uart_t *)plat->base; in coldfire_serial_putc() local
98 if (!(readb(&uart->usr) & UART_USR_TXRDY)) in coldfire_serial_putc()
101 writeb(ch, &uart->utb); in coldfire_serial_putc()
109 uart_t *uart = (uart_t *)(plat->base); in coldfire_serial_getc() local
112 if (!(readb(&uart->usr) & UART_USR_RXRDY)) in coldfire_serial_getc()
115 return readb(&uart->urb); in coldfire_serial_getc()
121 uart_t *uart = (uart_t *)(plat->base); in coldfire_serial_setbrg() local
123 mcf_serial_setbrg_common(uart, baudrate); in coldfire_serial_setbrg()
131 uart_t *uart = (uart_t *)(plat->base); in coldfire_serial_pending() local
134 return readb(&uart->usr) & UART_USR_RXRDY ? 1 : 0; in coldfire_serial_pending()
136 return readb(&uart->usr) & UART_USR_TXRDY ? 0 : 1; in coldfire_serial_pending()