aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cadence/uart
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cadence/uart')
-rw-r--r--drivers/cadence/uart/aarch64/cdns_console.S35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/cadence/uart/aarch64/cdns_console.S b/drivers/cadence/uart/aarch64/cdns_console.S
index ecd0c478d..4c1a80efc 100644
--- a/drivers/cadence/uart/aarch64/cdns_console.S
+++ b/drivers/cadence/uart/aarch64/cdns_console.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -56,14 +56,14 @@ endfunc console_cdns_core_init
/* -----------------------------------------------
* int console_cdns_register(uintptr_t baseaddr,
* uint32_t clock, uint32_t baud,
- * console_cdns_t *console);
+ * console_t *console);
* Function to initialize and register a new CDNS
* console. Storage passed in for the console struct
* *must* be persistent (i.e. not from the stack).
* In: x0 - UART register base address
* w1 - UART clock in Hz
* w2 - Baud rate
- * x3 - pointer to empty console_16550_t struct
+ * x3 - pointer to empty console_t struct
* Out: return 1 on success, 0 on error
* Clobber list : x0, x1, x2, x6, x7, x14
* -----------------------------------------------
@@ -72,7 +72,7 @@ func console_cdns_register
mov x7, x30
mov x6, x3
cbz x6, register_fail
- str x0, [x6, #CONSOLE_T_CDNS_BASE]
+ str x0, [x6, #CONSOLE_T_BASE]
bl console_cdns_core_init
cbz x0, register_fail
@@ -105,21 +105,21 @@ func console_cdns_core_putc
cmp w0, #0xA
b.ne 2f
1:
- /* Check if the transmit FIFO is full */
+ /* Check if the transmit FIFO is empty */
ldr w2, [x1, #R_UART_SR]
- tbnz w2, #UART_SR_INTR_TFUL_BIT, 1b
+ tbz w2, #UART_SR_INTR_TEMPTY_BIT, 1b
mov w2, #0xD
str w2, [x1, #R_UART_TX]
2:
- /* Check if the transmit FIFO is full */
+ /* Check if the transmit FIFO is empty */
ldr w2, [x1, #R_UART_SR]
- tbnz w2, #UART_SR_INTR_TFUL_BIT, 2b
+ tbz w2, #UART_SR_INTR_TEMPTY_BIT, 2b
str w0, [x1, #R_UART_TX]
ret
endfunc console_cdns_core_putc
/* --------------------------------------------------------
- * int console_cdns_putc(int c, console_cdns_t *cdns)
+ * int console_cdns_putc(int c, console_t *cdns)
* Function to output a character over the console. It
* returns the character printed on success or -1 on error.
* In : w0 - character to be printed
@@ -133,7 +133,7 @@ func console_cdns_putc
cmp x1, #0
ASM_ASSERT(ne)
#endif /* ENABLE_ASSERTIONS */
- ldr x1, [x1, #CONSOLE_T_CDNS_BASE]
+ ldr x1, [x1, #CONSOLE_T_BASE]
b console_cdns_core_putc
endfunc console_cdns_putc
@@ -165,7 +165,7 @@ no_char:
endfunc console_cdns_core_getc
/* ---------------------------------------------
- * int console_cdns_getc(console_cdns_t *console)
+ * int console_cdns_getc(console_t *console)
* Function to get a character from the console.
* It returns the character grabbed on success
* or -1 if no character is available.
@@ -179,16 +179,16 @@ func console_cdns_getc
cmp x0, #0
ASM_ASSERT(ne)
#endif /* ENABLE_ASSERTIONS */
- ldr x0, [x0, #CONSOLE_T_CDNS_BASE]
+ ldr x0, [x0, #CONSOLE_T_BASE]
b console_cdns_core_getc
endfunc console_cdns_getc
/* ---------------------------------------------
- * int console_cdns_core_flush(uintptr_t base_addr)
+ * void 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
- * Out : return -1 on error else return 0.
+ * Out : void
* Clobber list : x0, x1
* ---------------------------------------------
*/
@@ -198,16 +198,15 @@ func console_cdns_core_flush
ASM_ASSERT(ne)
#endif /* ENABLE_ASSERTIONS */
/* Placeholder */
- mov w0, #0
ret
endfunc console_cdns_core_flush
/* ---------------------------------------------
- * int console_cdns_flush(console_pl011_t *console)
+ * void console_cdns_flush(console_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.
+ * Out : void.
* Clobber list : x0, x1
* ---------------------------------------------
*/
@@ -216,6 +215,6 @@ func console_cdns_flush
cmp x0, #0
ASM_ASSERT(ne)
#endif /* ENABLE_ASSERTIONS */
- ldr x0, [x0, #CONSOLE_T_CDNS_BASE]
+ ldr x0, [x0, #CONSOLE_T_BASE]
b console_cdns_core_flush
endfunc console_cdns_flush