summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkunhuahuang <huangkunhua@gmail.com>2015-04-28 02:25:45 +0800
committerTom Rini <trini@konsulko.com>2015-05-10 07:29:38 -0400
commit85e5f5b7a7f8d889271f94791606cde62d81d53f (patch)
treef4b1f77bd8550d758051c0baaa2630b59c501bdd
parentecb301394b8745f335dee66546a60dc13edba4d8 (diff)
downloadu-boot-imx-85e5f5b7a7f8d889271f94791606cde62d81d53f.zip
u-boot-imx-85e5f5b7a7f8d889271f94791606cde62d81d53f.tar.gz
u-boot-imx-85e5f5b7a7f8d889271f94791606cde62d81d53f.tar.bz2
stm32f4: fix serial output
This patch fix the serial output. The source is from Kamil Lulko's "stm32f429-discovery board support" Thanks, Varcain. I learned a lot. Signed-off-by: kunhuahuang <huangkunhua@gmail.com>
-rw-r--r--drivers/serial/serial_stm32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index 3c80096..8c613db 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -81,6 +81,10 @@ static int stm32_serial_getc(void)
static void stm32_serial_putc(const char c)
{
struct stm32_serial *usart = (struct stm32_serial *)USART_BASE;
+
+ if (c == '\n')
+ stm32_serial_putc('\r');
+
while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
;
writel(c, &usart->dr);