From 39da9d86e66ad9d616f5eadef94694e885789730 Mon Sep 17 00:00:00 2001 From: "r.tyminski" Date: Mon, 30 Oct 2017 12:56:18 +0100 Subject: [PATCH] spl: serial_bcm283x: set GPIO before enabling uart to remove rx There was some garbage on uart input during boot, so if uart wasn't connected, we end up in u-boot command line. Set GPIO before enabling uart to remove uart Rx setup and this makes SPL use only Tx. Note: Chip documentation warns that order of commands is important. Change-Id: I896d8b719c7b9170ad481767f8b27835d81f4af1 Signed-off-by: Rafal Tyminski [sw0312.kim: adjust commit-msg] Signed-off-by: Seung-Woo Kim --- drivers/serial/serial_bcm283x_mu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index 5bed94ab4a..69d6696fcd 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -231,10 +231,6 @@ static inline void _debug_uart_init(void) { int i; - AUX_ENB |= 1; /* Enable mini-uart */ - MU_LCR = 3; /* 8 bit. */ - MU_BAUD = 270; /* 115200 baud.(0x10e) */ - GPFSEL1 &= ~((7<<12) | (7 << 15)); /* GPIO14 & 15 : alt5 */ GPFSEL1 |= (2 << 12) | (2 << 15); @@ -242,13 +238,17 @@ static inline void _debug_uart_init(void) GPPUD = 0; for (i = 0; i < 150; i++) __asm__ __volatile__("nop"); - GPPUDCLK0 = (2 << 14) | (2 << 15); + GPPUDCLK0 = (2 << 14); for (i = 0; i < 150; i++) __asm__ __volatile__("nop"); GPPUDCLK0 = 0; - MU_CNTL = 3; /* Enable Tx & Rx */ + AUX_ENB |= 1; /* Enable mini-uart */ + MU_LCR = 3; /* 8 bit. */ + MU_BAUD = 270; /* 115200 baud.(0x10e) */ + + MU_CNTL = 2; /* Enable Tx */ } static inline void _debug_uart_putc(int ch) -- 2.34.1