mirror of
https://github.com/CTCaer/switch-l4t-atf.git
synced 2025-03-03 07:57:22 +00:00
uniphier: Use generic console_t data structure
Since now the generic console_t structure holds the UART base address as well, let's use that generic location and drop the UART driver specific data structure at all. Change-Id: Ia9d996bb45ff3a7f1b240f12fd75805b48a048e9 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
This commit is contained in:
parent
7b8fe2de31
commit
af1e8fda23
@ -17,7 +17,7 @@
|
||||
*/
|
||||
.globl uniphier_console_putc
|
||||
func uniphier_console_putc
|
||||
ldr x1, [x1, #CONSOLE_T_DRVDATA]
|
||||
ldr x1, [x1, #CONSOLE_T_BASE]
|
||||
|
||||
/* Wait until the transmitter FIFO gets empty */
|
||||
0: ldr w2, [x1, #UNIPHIER_UART_LSR]
|
||||
@ -36,7 +36,7 @@ endfunc uniphier_console_putc
|
||||
*/
|
||||
.globl uniphier_console_getc
|
||||
func uniphier_console_getc
|
||||
ldr x0, [x0, #CONSOLE_T_DRVDATA]
|
||||
ldr x0, [x0, #CONSOLE_T_BASE]
|
||||
|
||||
ldr w1, [x0, #UNIPHIER_UART_LSR]
|
||||
tbz w1, #UNIPHIER_UART_LSR_DR_BIT, 0f
|
||||
@ -55,7 +55,7 @@ endfunc uniphier_console_getc
|
||||
*/
|
||||
.global uniphier_console_flush
|
||||
func uniphier_console_flush
|
||||
ldr x0, [x0, #CONSOLE_T_DRVDATA]
|
||||
ldr x0, [x0, #CONSOLE_T_BASE]
|
||||
|
||||
/* wait until the transmitter gets empty */
|
||||
0: ldr w1, [x0, #UNIPHIER_UART_LSR]
|
||||
|
@ -17,28 +17,21 @@
|
||||
#define UNIPHIER_UART_OFFSET 0x100
|
||||
#define UNIPHIER_UART_NR_PORTS 4
|
||||
|
||||
struct uniphier_console {
|
||||
struct console console;
|
||||
uintptr_t base;
|
||||
};
|
||||
|
||||
/* These callbacks are implemented in assembly to use crash_console_helpers.S */
|
||||
int uniphier_console_putc(int character, struct console *console);
|
||||
int uniphier_console_getc(struct console *console);
|
||||
int uniphier_console_flush(struct console *console);
|
||||
|
||||
static struct uniphier_console uniphier_console = {
|
||||
.console = {
|
||||
.flags = CONSOLE_FLAG_BOOT |
|
||||
static console_t uniphier_console = {
|
||||
.flags = CONSOLE_FLAG_BOOT |
|
||||
#if DEBUG
|
||||
CONSOLE_FLAG_RUNTIME |
|
||||
CONSOLE_FLAG_RUNTIME |
|
||||
#endif
|
||||
CONSOLE_FLAG_CRASH |
|
||||
CONSOLE_FLAG_TRANSLATE_CRLF,
|
||||
.putc = uniphier_console_putc,
|
||||
.getc = uniphier_console_getc,
|
||||
.flush = uniphier_console_flush,
|
||||
},
|
||||
CONSOLE_FLAG_CRASH |
|
||||
CONSOLE_FLAG_TRANSLATE_CRLF,
|
||||
.putc = uniphier_console_putc,
|
||||
.getc = uniphier_console_getc,
|
||||
.flush = uniphier_console_flush,
|
||||
};
|
||||
|
||||
static const uintptr_t uniphier_uart_base[] = {
|
||||
@ -86,7 +79,7 @@ void uniphier_console_setup(unsigned int soc)
|
||||
plat_error_handler(-EINVAL);
|
||||
|
||||
uniphier_console.base = base;
|
||||
console_register(&uniphier_console.console);
|
||||
console_register(&uniphier_console);
|
||||
|
||||
/*
|
||||
* The hardware might be still printing characters queued up in the
|
||||
|
Loading…
x
Reference in New Issue
Block a user