From: 黄涛 Date: Tue, 18 Sep 2012 09:21:47 +0000 (+0800) Subject: rk: sram: add default sram_printch implementation X-Git-Tag: firefly_0821_release~8607 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bde7cce9ea576114e07152d77ae25f3df5a72c60;p=firefly-linux-kernel-4.4.55.git rk: sram: add default sram_printch implementation --- diff --git a/arch/arm/plat-rk/sram.c b/arch/arm/plat-rk/sram.c index 0edbf2f82c63..ec667094aa54 100644 --- a/arch/arm/plat-rk/sram.c +++ b/arch/arm/plat-rk/sram.c @@ -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) {