aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2018-03-29 10:04:06 +0100
committerGitHub <noreply@github.com>2018-03-29 10:04:06 +0100
commit469744e6c2aa3553f16beccf1ba888915847dc00 (patch)
tree899a84205553a2ad21c789199563e91f8a054d1f /drivers
parente74af2afd0886a1b425757ff348396bffd0a580e (diff)
parente0f21f625f518b0f1ece8a7cbe96a5206cf8c7f9 (diff)
downloadplatform_external_arm-trusted-firmware-469744e6c2aa3553f16beccf1ba888915847dc00.tar.gz
platform_external_arm-trusted-firmware-469744e6c2aa3553f16beccf1ba888915847dc00.tar.bz2
platform_external_arm-trusted-firmware-469744e6c2aa3553f16beccf1ba888915847dc00.zip
Merge pull request #1329 from antonio-nino-diaz-arm/an/rpi3-multi-console
rpi3: Migrate to the multi console API
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ti/uart/aarch64/16550_console.S43
1 files changed, 36 insertions, 7 deletions
diff --git a/drivers/ti/uart/aarch64/16550_console.S b/drivers/ti/uart/aarch64/16550_console.S
index b02209dfb..56e7e5c11 100644
--- a/drivers/ti/uart/aarch64/16550_console.S
+++ b/drivers/ti/uart/aarch64/16550_console.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -17,10 +17,11 @@
.globl console_16550_core_init
.globl console_16550_core_putc
.globl console_16550_core_getc
+ .globl console_16550_core_flush
.globl console_16550_putc
.globl console_16550_getc
-
+ .globl console_16550_flush
/* -----------------------------------------------
* int console_16550_core_init(uintptr_t base_addr,
@@ -119,6 +120,7 @@ endfunc console_16550_register
.equ console_core_init,console_16550_core_init
.equ console_core_putc,console_16550_core_putc
.equ console_core_getc,console_16550_core_getc
+ .equ console_core_flush,console_16550_core_flush
#endif
/* --------------------------------------------------------
@@ -222,8 +224,7 @@ func console_16550_getc
endfunc console_16550_getc
/* ---------------------------------------------
- * int console_core_flush(uintptr_t base_addr)
- * DEPRECATED: Not used with MULTI_CONSOLE_API!
+ * int console_16550_core_flush(uintptr_t base_addr)
* Function to force a write of all buffered
* data that hasn't been output.
* In : x0 - console base address
@@ -231,8 +232,36 @@ endfunc console_16550_getc
* Clobber list : x0, x1
* ---------------------------------------------
*/
-func console_core_flush
- /* Placeholder */
+func console_16550_core_flush
+#if ENABLE_ASSERTIONS
+ cmp x0, #0
+ ASM_ASSERT(ne)
+#endif /* ENABLE_ASSERTIONS */
+
+ /* Loop until the transmit FIFO is empty */
+1: ldr w1, [x0, #UARTLSR]
+ and w1, w1, #(UARTLSR_TEMT | UARTLSR_THRE)
+ cmp w1, #(UARTLSR_TEMT | UARTLSR_THRE)
+ b.ne 1b
+
mov w0, #0
ret
-endfunc console_core_flush
+endfunc console_16550_core_flush
+
+ /* ---------------------------------------------
+ * int console_16550_flush(console_pl011_t *console)
+ * Function to force a write of all buffered
+ * data that hasn't been output.
+ * In : x0 - pointer to console_t structure
+ * Out : return -1 on error else return 0.
+ * Clobber list : x0, x1
+ * ---------------------------------------------
+ */
+func console_16550_flush
+#if ENABLE_ASSERTIONS
+ cmp x0, #0
+ ASM_ASSERT(ne)
+#endif /* ENABLE_ASSERTIONS */
+ ldr x0, [x0, #CONSOLE_T_16550_BASE]
+ b console_16550_core_flush
+endfunc console_16550_flush