]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
uniphier: Use generic console_t data structure
authorAndre Przywara <andre.przywara@arm.com>
Sat, 25 Jan 2020 00:58:35 +0000 (00:58 +0000)
committerAndre Przywara <andre.przywara@arm.com>
Tue, 25 Feb 2020 09:34:38 +0000 (09:34 +0000)
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>
plat/socionext/uniphier/uniphier_console.S
plat/socionext/uniphier/uniphier_console_setup.c

index 1113c6e81efe7af7f4fd9225a6d242141f0b09d6..f3dde0cc1c23b484363809d7c0f6852d9ca9f834 100644 (file)
@@ -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]
index 1851e4da54a15c7dd7f986d8804ba109500ad395..e2ae8bf2864e6813a30e71e5558a38706fd09aba 100644 (file)
 #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