1*e7300d04SMaxime Bizon /* 2*e7300d04SMaxime Bizon * This file is subject to the terms and conditions of the GNU General Public 3*e7300d04SMaxime Bizon * License. See the file "COPYING" in the main directory of this archive 4*e7300d04SMaxime Bizon * for more details. 5*e7300d04SMaxime Bizon * 6*e7300d04SMaxime Bizon * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr> 7*e7300d04SMaxime Bizon */ 8*e7300d04SMaxime Bizon 9*e7300d04SMaxime Bizon #include <linux/init.h> 10*e7300d04SMaxime Bizon #include <bcm63xx_io.h> 11*e7300d04SMaxime Bizon #include <bcm63xx_regs.h> 12*e7300d04SMaxime Bizon 13*e7300d04SMaxime Bizon static void __init wait_xfered(void) 14*e7300d04SMaxime Bizon { 15*e7300d04SMaxime Bizon unsigned int val; 16*e7300d04SMaxime Bizon 17*e7300d04SMaxime Bizon /* wait for any previous char to be transmitted */ 18*e7300d04SMaxime Bizon do { 19*e7300d04SMaxime Bizon val = bcm_uart0_readl(UART_IR_REG); 20*e7300d04SMaxime Bizon if (val & UART_IR_STAT(UART_IR_TXEMPTY)) 21*e7300d04SMaxime Bizon break; 22*e7300d04SMaxime Bizon } while (1); 23*e7300d04SMaxime Bizon } 24*e7300d04SMaxime Bizon 25*e7300d04SMaxime Bizon void __init prom_putchar(char c) 26*e7300d04SMaxime Bizon { 27*e7300d04SMaxime Bizon wait_xfered(); 28*e7300d04SMaxime Bizon bcm_uart0_writel(c, UART_FIFO_REG); 29*e7300d04SMaxime Bizon wait_xfered(); 30*e7300d04SMaxime Bizon } 31