rk: sram: add default sram_printch implementation
author黄涛 <huangtao@rock-chips.com>
Tue, 18 Sep 2012 09:21:47 +0000 (17:21 +0800)
committer黄涛 <huangtao@rock-chips.com>
Tue, 18 Sep 2012 09:22:01 +0000 (17:22 +0800)
arch/arm/plat-rk/sram.c

index 0edbf2f82c63ddb8d2558e69be368be4db542b05..ec667094aa54d6f5c0c4654170adcac41be8a10d 100644 (file)
@@ -69,6 +69,21 @@ int __init rk29_sram_init(void)
        return 0;
 }
 
+__weak void __sramfunc sram_printch(char byte)
+{
+#ifdef DEBUG_UART_BASE
+       writel_relaxed(byte, DEBUG_UART_BASE);
+       dsb();
+
+       /* loop check LSR[6], Transmitter Empty bit */
+       while (!(readl_relaxed(DEBUG_UART_BASE + 0x14) & 0x40))
+               barrier();
+
+       if (byte == '\n')
+               sram_printch('\r');
+#endif
+}
+
 void __sramfunc sram_printascii(const char *s)
 {
        while (*s) {