From: Varun Wadekar Date: Mon, 7 May 2018 18:21:57 +0000 (-0700) Subject: Tegra: spe: prepend '\r' to '\n' X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=843d0aad8077fc2ce2ee6dcb32e58a5d8381465d;p=project%2Fbcm63xx%2Fatf.git 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 Change-Id: I6e0b412bd71ff5eb889582071df8c157da5175ed Signed-off-by: Varun Wadekar --- 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,11 +63,27 @@ 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