2 * ADM5120 specific early printk support
4 * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
12 #include <linux/init.h>
15 #include <asm/addrspace.h>
16 #include <asm/mach-adm5120/adm5120_defs.h>
17 #include <asm/mach-adm5120/adm5120_uart.h>
19 #define UART_READ(r) \
20 __raw_readl((void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
21 #define UART_WRITE(r, v) \
22 __raw_writel((v), (void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
24 void __init prom_putchar(char ch)
26 while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0)
28 UART_WRITE(UART_REG_DATA, ch);
29 while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0)