summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
diff options
context:
space:
mode:
authorMartin Aberg <maberg@gaisler.com>2017-03-10 15:32:38 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2017-05-02 12:34:46 +0200
commitf164a294706afeea3507559ef4cb4b273ef4a96b (patch)
tree3e90fed176c676cfd13b40c69c0a720f77b4e4a6 /c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
parentleon, apbuart: Assign proper device name (diff)
downloadrtems-f164a294706afeea3507559ef4cb4b273ef4a96b.tar.bz2
leon, apbuart: Inherit HW parameters on sysconsole
The cons layer decides which of the registered console device is granted as system console. When a device specific console driver performs its first_open, it inherits UART parameters from boot loader only if it is the system console.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c')
-rw-r--r--c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
index 5f8de746cc..3b74ae1f5d 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
@@ -440,10 +440,12 @@ static bool first_open(
uart->tty = tty;
- /* Preserve values set by bootloader */
- get_attributes(base, term);
- term->c_oflag |= ONLCR;
- set_attributes(base, term);
+ /* Inherit UART hardware parameters from bootloader on system console */
+ if (uart->condev.flags & CONSOLE_FLAG_SYSCON_GRANT) {
+ get_attributes(base, term);
+ term->c_oflag |= ONLCR;
+ set_attributes(base, term);
+ }
/* Enable TX/RX */
uart->regs->ctrl |= APBUART_CTRL_RE | APBUART_CTRL_TE;