summaryrefslogtreecommitdiff
path: root/plat/nvidia
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2018-05-07 11:21:57 -0700
committerVarun Wadekar <vwadekar@nvidia.com>2019-02-05 08:27:43 -0800
commit843d0aad8077fc2ce2ee6dcb32e58a5d8381465d (patch)
tree89611cd266a692c24fe900cc9e4964791ee92d84 /plat/nvidia
parent07faf4d8c5823700bb2e87606ad365a26512c3cd (diff)
Tegra: spe: prepend '\r' to '\n'
This patch udpates the SPE console driver to prepend '\r' to '\n'. This fixes the alignment of prints seen by the host machines on their UART ports. Tested by collecting the logs from host PC using Cutecom Reported by: Mustafa Bilgen <mbilgen@nvidia.com> Change-Id: I6e0b412bd71ff5eb889582071df8c157da5175ed Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'plat/nvidia')
-rw-r--r--plat/nvidia/tegra/common/drivers/spe/shared_console.S18
1 files changed, 17 insertions, 1 deletions
diff --git a/plat/nvidia/tegra/common/drivers/spe/shared_console.S b/plat/nvidia/tegra/common/drivers/spe/shared_console.S
index a9f0334f..c1fbc842 100644
--- a/plat/nvidia/tegra/common/drivers/spe/shared_console.S
+++ b/plat/nvidia/tegra/common/drivers/spe/shared_console.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -63,12 +63,28 @@ func console_core_putc
/* Check the input parameter */
cbz x1, putc_error
+ /* Prepend '\r' to '\n' */
+ cmp w0, #0xA
+ b.ne 2f
+
/* wait until spe is ready */
1: ldr w2, [x1]
and w2, w2, #CONSOLE_IS_BUSY
cbnz w2, 1b
/* spe is ready */
+ mov w2, #0xD /* '\r' */
+ and w2, w2, #0xFF
+ mov w3, #(CONSOLE_WRITE | (1 << CONSOLE_NUM_BYTES_SHIFT))
+ orr w2, w2, w3
+ str w2, [x1]
+
+ /* wait until spe is ready */
+2: ldr w2, [x1]
+ and w2, w2, #CONSOLE_IS_BUSY
+ cbnz w2, 2b
+
+ /* spe is ready */
mov w2, w0
and w2, w2, #0xFF
mov w3, #(CONSOLE_WRITE | (1 << CONSOLE_NUM_BYTES_SHIFT))