From: r.tyminski Date: Mon, 30 Oct 2017 11:56:18 +0000 (+0100) Subject: spl: serial_bcm283x: set GPIO before enabling uart to remove rx X-Git-Tag: submit/tizen/20171031.014243^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1dac2248ae24ba833069679734f966f0e481b5a;p=platform%2Fkernel%2Fu-boot.git 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 --- diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index c3d6d70aac..85d5555e9b 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -211,10 +211,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); @@ -222,13 +218,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)