Commit 896d684d authored by Mark Dykes's avatar Mark Dykes Committed by TrustedFirmware Code Review
Browse files

Merge changes from topic "console_t_cleanup" into integration

* changes:
  marvell: Consolidate console register calls
  uniphier: Use generic console_t data structure
  spe: Use generic console_t data structure
  LS 16550: Use generic console_t data structure
  stm32: Use generic console_t data structure
  rcar: Use generic console_t data structure
  a3700: Use generic console_t data structure
  16550: Use generic console_t data structure
  imx: Use generic console_t data structure
parents c723ef01 7db9a0b9
...@@ -52,7 +52,7 @@ unsigned int plat_is_my_cpu_primary(void); ...@@ -52,7 +52,7 @@ unsigned int plat_is_my_cpu_primary(void);
void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1, void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3) u_register_t arg2, u_register_t arg3)
{ {
static console_16550_t console; static console_t console;
params_early_setup(arg1); params_early_setup(arg1);
......
...@@ -102,7 +102,7 @@ static const mmap_region_t plat_rpi3_mmap[] = { ...@@ -102,7 +102,7 @@ static const mmap_region_t plat_rpi3_mmap[] = {
/******************************************************************************* /*******************************************************************************
* Function that sets up the console * Function that sets up the console
******************************************************************************/ ******************************************************************************/
static console_16550_t rpi3_console; static console_t rpi3_console;
void rpi3_console_init(unsigned int base_clk_rate) void rpi3_console_init(unsigned int base_clk_rate)
{ {
...@@ -123,7 +123,7 @@ void rpi3_console_init(unsigned int base_clk_rate) ...@@ -123,7 +123,7 @@ void rpi3_console_init(unsigned int base_clk_rate)
panic(); panic();
} }
console_set_scope(&rpi3_console.console, console_scope); console_set_scope(&rpi3_console, console_scope);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
*/ */
.globl uniphier_console_putc .globl uniphier_console_putc
func 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 */ /* Wait until the transmitter FIFO gets empty */
0: ldr w2, [x1, #UNIPHIER_UART_LSR] 0: ldr w2, [x1, #UNIPHIER_UART_LSR]
...@@ -36,7 +36,7 @@ endfunc uniphier_console_putc ...@@ -36,7 +36,7 @@ endfunc uniphier_console_putc
*/ */
.globl uniphier_console_getc .globl uniphier_console_getc
func 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] ldr w1, [x0, #UNIPHIER_UART_LSR]
tbz w1, #UNIPHIER_UART_LSR_DR_BIT, 0f tbz w1, #UNIPHIER_UART_LSR_DR_BIT, 0f
...@@ -55,7 +55,7 @@ endfunc uniphier_console_getc ...@@ -55,7 +55,7 @@ endfunc uniphier_console_getc
*/ */
.global uniphier_console_flush .global uniphier_console_flush
func 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 */ /* wait until the transmitter gets empty */
0: ldr w1, [x0, #UNIPHIER_UART_LSR] 0: ldr w1, [x0, #UNIPHIER_UART_LSR]
......
...@@ -17,18 +17,12 @@ ...@@ -17,18 +17,12 @@
#define UNIPHIER_UART_OFFSET 0x100 #define UNIPHIER_UART_OFFSET 0x100
#define UNIPHIER_UART_NR_PORTS 4 #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 */ /* These callbacks are implemented in assembly to use crash_console_helpers.S */
int uniphier_console_putc(int character, struct console *console); int uniphier_console_putc(int character, struct console *console);
int uniphier_console_getc(struct console *console); int uniphier_console_getc(struct console *console);
int uniphier_console_flush(struct console *console); int uniphier_console_flush(struct console *console);
static struct uniphier_console uniphier_console = { static console_t uniphier_console = {
.console = {
.flags = CONSOLE_FLAG_BOOT | .flags = CONSOLE_FLAG_BOOT |
#if DEBUG #if DEBUG
CONSOLE_FLAG_RUNTIME | CONSOLE_FLAG_RUNTIME |
...@@ -38,7 +32,6 @@ static struct uniphier_console uniphier_console = { ...@@ -38,7 +32,6 @@ static struct uniphier_console uniphier_console = {
.putc = uniphier_console_putc, .putc = uniphier_console_putc,
.getc = uniphier_console_getc, .getc = uniphier_console_getc,
.flush = uniphier_console_flush, .flush = uniphier_console_flush,
},
}; };
static const uintptr_t uniphier_uart_base[] = { static const uintptr_t uniphier_uart_base[] = {
...@@ -86,7 +79,7 @@ void uniphier_console_setup(unsigned int soc) ...@@ -86,7 +79,7 @@ void uniphier_console_setup(unsigned int soc)
plat_error_handler(-EINVAL); plat_error_handler(-EINVAL);
uniphier_console.base = base; uniphier_console.base = base;
console_register(&uniphier_console.console); console_register(&uniphier_console);
/* /*
* The hardware might be still printing characters queued up in the * The hardware might be still printing characters queued up in the
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <stm32mp1_context.h> #include <stm32mp1_context.h>
#include <stm32mp1_dbgmcu.h> #include <stm32mp1_dbgmcu.h>
static struct console_stm32 console; static console_t console;
static struct stm32mp_auth_ops stm32mp1_auth_ops; static struct stm32mp_auth_ops stm32mp1_auth_ops;
static void print_reset_reason(void) static void print_reset_reason(void)
...@@ -273,7 +273,7 @@ void bl2_el3_plat_arch_setup(void) ...@@ -273,7 +273,7 @@ void bl2_el3_plat_arch_setup(void)
panic(); panic();
} }
console_set_scope(&console.console, CONSOLE_FLAG_BOOT | console_set_scope(&console, CONSOLE_FLAG_BOOT |
CONSOLE_FLAG_CRASH | CONSOLE_FLAG_TRANSLATE_CRLF); CONSOLE_FLAG_CRASH | CONSOLE_FLAG_TRANSLATE_CRLF);
stm32mp_print_cpuinfo(); stm32mp_print_cpuinfo();
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
******************************************************************************/ ******************************************************************************/
static entry_point_info_t bl33_image_ep_info; static entry_point_info_t bl33_image_ep_info;
static struct console_stm32 console; static console_t console;
/******************************************************************************* /*******************************************************************************
* Interrupt handler for FIQ (secure IRQ) * Interrupt handler for FIQ (secure IRQ)
...@@ -142,7 +142,7 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1, ...@@ -142,7 +142,7 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
#ifdef DEBUG #ifdef DEBUG
console_flags |= CONSOLE_FLAG_RUNTIME; console_flags |= CONSOLE_FLAG_RUNTIME;
#endif #endif
console_set_scope(&console.console, console_flags); console_set_scope(&console, console_flags);
} }
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
void bl31_console_setup(void) void bl31_console_setup(void)
{ {
static console_16550_t console; static console_t console;
/* Initialize the console to provide early debug support */ /* Initialize the console to provide early debug support */
console_16550_register(K3_USART_BASE, K3_USART_CLK_SPEED, console_16550_register(K3_USART_BASE, K3_USART_CLK_SPEED,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment