예제 #1
0
파일: serial.c 프로젝트: alpha-it/u-boot
//SPL_STATIC_FUNC
void serial_putc(const char c)
{
    if (c == '\n')
    {
        while ((readl(P_UART_STATUS(UART_PORT_CONS)) & UART_STAT_MASK_TFIFO_FULL));
        writel('\r', P_UART_WFIFO(UART_PORT_CONS));
    }
    /* Wait till dataTx register is not full */
    while ((readl(P_UART_STATUS(UART_PORT_CONS)) & UART_STAT_MASK_TFIFO_FULL));
    writel(c, P_UART_WFIFO(UART_PORT_CONS));
    /* Wait till dataTx register is empty */
}
예제 #2
0
/*
 * Output a single byte to the serial port.
 */
void serial_putc_port (int port,const char c)
{
	unsigned port_base = port_base_addrs[port];
    if (c == '\n') 
        serial_putc_port(port,'\r');
    
    /* Wait till dataTx register is not full */
    while ((readl(P_UART_STATUS(port_base)) & UART_STAT_MASK_TFIFO_FULL));
 // while(!(readl(P_UART_STATUS(port_base)) & UART_STAT_MASK_TFIFO_EMPTY));  
    writel(c, P_UART_WFIFO(port_base));
    /* Wait till dataTx register is empty */
    while(!(readl(P_UART_STATUS(port_base)) & UART_STAT_MASK_TFIFO_EMPTY));

}