Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
0007  */
0008 
0009 #include <bcm63xx_io.h>
0010 #include <linux/serial_bcm63xx.h>
0011 #include <asm/setup.h>
0012 
0013 static void wait_xfered(void)
0014 {
0015     unsigned int val;
0016 
0017     /* wait for any previous char to be transmitted */
0018     do {
0019         val = bcm_uart0_readl(UART_IR_REG);
0020         if (val & UART_IR_STAT(UART_IR_TXEMPTY))
0021             break;
0022     } while (1);
0023 }
0024 
0025 void prom_putchar(char c)
0026 {
0027     wait_xfered();
0028     bcm_uart0_writel(c, UART_FIFO_REG);
0029     wait_xfered();
0030 }