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