drivers: cadence: cdns: Fix flush function
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Mon, 24 Sep 2018 21:07:58 +0000 (22:07 +0100)
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Fri, 28 Sep 2018 14:31:53 +0000 (15:31 +0100)
It is still a placeholder, but now it is registered correctly by the
macro finish_console_register.

Change-Id: Ic78c966d9be606cbc1a53cec43ead23b32963afe
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
drivers/cadence/uart/aarch64/cdns_console.S

index fc357f8a409f5c41f0a15231c356536a7f4f7fc6..6732631970792166c649ae414d9ba6f247d4ee2e 100644 (file)
        .globl console_cdns_core_init
        .globl console_cdns_core_putc
        .globl console_cdns_core_getc
+       .globl console_cdns_core_flush
 
        .globl  console_cdns_putc
        .globl  console_cdns_getc
+       .globl  console_cdns_flush
 
        /* -----------------------------------------------
         * int console_cdns_core_init(uintptr_t base_addr)
@@ -87,6 +89,7 @@ endfunc console_cdns_register
        .equ console_core_init,console_cdns_core_init
        .equ console_core_putc,console_cdns_core_putc
        .equ console_core_getc,console_cdns_core_getc
+       .equ console_core_flush,console_cdns_core_flush
 #endif
 
        /* --------------------------------------------------------
@@ -188,8 +191,7 @@ func console_cdns_getc
 endfunc console_cdns_getc
 
        /* ---------------------------------------------
-        * int console_core_flush(uintptr_t base_addr)
-        * DEPRECATED: Not used with MULTI_CONSOLE_API!
+        * int console_cdns_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
@@ -197,8 +199,30 @@ endfunc console_cdns_getc
         * Clobber list : x0, x1
         * ---------------------------------------------
         */
-func console_core_flush
+func console_cdns_core_flush
+#if ENABLE_ASSERTIONS
+       cmp     x0, #0
+       ASM_ASSERT(ne)
+#endif /* ENABLE_ASSERTIONS */
        /* Placeholder */
        mov     w0, #0
        ret
-endfunc console_core_flush
+endfunc console_cdns_core_flush
+
+       /* ---------------------------------------------
+        * int console_cdns_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_cdns_flush
+#if ENABLE_ASSERTIONS
+       cmp     x0, #0
+       ASM_ASSERT(ne)
+#endif /* ENABLE_ASSERTIONS */
+       ldr     x0, [x0, #CONSOLE_T_CDNS_BASE]
+       b       console_cdns_core_flush
+endfunc console_cdns_flush