]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
rcar: 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: I836e26ff1771abf21fd460d0ee40e90a452e9b43
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
drivers/renesas/rcar/console/rcar_console.S
drivers/renesas/rcar/scif/scif.S
include/drivers/renesas/rcar/console/console.h
plat/renesas/rcar/rcar_common.c

index 859efeceb43f25f645b2f78be4511af1f2c9ed0b..4d006b703fcbd1a3184ca3e1ee6bd11398fdc631 100644 (file)
        /* -----------------------------------------------
         * int console_rcar_register(
         *      uintptr_t base, uint32_t clk, uint32_t baud,
-        *      console_rcar_t *console)
+        *      console_t *console)
         * Function to initialize and register a new rcar
         * 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_rcar_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
         * -----------------------------------------------
@@ -36,7 +36,7 @@ func console_rcar_register
        mov     x7, x30
        mov     x6, x3
        cbz     x6, register_fail
-       str     x0, [x6, #CONSOLE_T_RCAR_BASE]
+       str     x0, [x6, #CONSOLE_T_BASE]
 
        bl      rcar_log_init
        cbz     x0, register_fail
@@ -68,11 +68,11 @@ func console_rcar_init
 endfunc console_rcar_init
 
        /* --------------------------------------------------------
-        * int console_rcar_putc(int c, console_rcar_t *console)
+        * int console_rcar_putc(int c, console_t *console)
         * 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
-        *      x1 - pointer to console_rcar_t structure
+        *      x1 - pointer to console_t structure
         * Out : return -1 on error else return character.
         * Clobber list : x2
         * --------------------------------------------------------
index 8309bb26e051fd95765644c944e88e970428ebed..064aba471c01aca516b18fedad3a5d66e1ae09d3 100644 (file)
        /* -----------------------------------------------
         * int console_rcar_register(
         *      uintptr_t base, uint32_t clk, uint32_t baud,
-        *      console_rcar_t *console)
+        *      console_t *console)
         * Function to initialize and register a new rcar
         * 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_rcar_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
         * -----------------------------------------------
@@ -142,7 +142,7 @@ func console_rcar_register
        mov     x7, x30
        mov     x6, x3
        cbz     x6, register_fail
-       str     x0, [x6, #CONSOLE_T_RCAR_BASE]
+       str     x0, [x6, #CONSOLE_T_BASE]
 
        bl      console_rcar_init
 
index 0e4ed8f356761826875729645f953a8846507046..7d5b5d3ceb50e4b7cf8d4b7eb74d3efadde11024 100644 (file)
@@ -7,17 +7,10 @@
 #ifndef RCAR_PRINTF_H
 #define RCAR_PRINTF_H
 
-#define CONSOLE_T_RCAR_BASE    CONSOLE_T_DRVDATA
-
 #ifndef __ASSEMBLER__
 
 #include <stdint.h>
 
-typedef struct {
-       console_t console;
-       uintptr_t base;
-} console_rcar_t;
-
 /*
  * Initialize a new rcar console instance and register it with the console
  * framework. The |console| pointer must point to storage that will be valid
@@ -25,7 +18,7 @@ typedef struct {
  * Its contents will be reinitialized from scratch.
  */
 int console_rcar_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
-                         console_rcar_t *console);
+                         console_t *console);
 
 #endif /*__ASSEMBLER__*/
 
index 4ea753f2db8c1eeb70e224b5c31299ba1970e9e7..dec7229b3076c85421b459affd7a512678d07b70 100644 (file)
@@ -70,8 +70,8 @@ void plat_ea_handler(unsigned int ea_reason, uint64_t syndrome, void *cookie,
 
 #include <drivers/renesas/rcar/console/console.h>
 
-static console_rcar_t rcar_boot_console;
-static console_rcar_t rcar_runtime_console;
+static console_t rcar_boot_console;
+static console_t rcar_runtime_console;
 
 void rcar_console_boot_init(void)
 {
@@ -81,7 +81,7 @@ void rcar_console_boot_init(void)
        if (!ret)
                panic();
 
-       console_set_scope(&rcar_boot_console.console, CONSOLE_FLAG_BOOT);
+       console_set_scope(&rcar_boot_console, CONSOLE_FLAG_BOOT);
 }
 
 void rcar_console_boot_end(void)
@@ -96,7 +96,7 @@ void rcar_console_runtime_init(void)
        if (!ret)
                panic();
 
-       console_set_scope(&rcar_boot_console.console, CONSOLE_FLAG_RUNTIME);
+       console_set_scope(&rcar_boot_console, CONSOLE_FLAG_RUNTIME);
 }
 
 void rcar_console_runtime_end(void)