spl: serial_bcm283x: set GPIO before enabling uart to remove rx
authorr.tyminski <r.tyminski@partner.samsung.com>
Mon, 30 Oct 2017 11:56:18 +0000 (12:56 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 10 Oct 2019 04:38:40 +0000 (13:38 +0900)
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 <r.tyminski@partner.samsung.com>
[sw0312.kim: adjust commit-msg]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/serial/serial_bcm283x_mu.c

index 5bed94ab4a297986b002b8c26906281e27ccb49a..69d6696fcdb84fc935eac30b1dd6b809afd13e03 100644 (file)
@@ -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)