Commit c10db6de authored by Andre Przywara's avatar Andre Przywara
Browse files

stm32: 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: Iea6ca26ff4903c33f0fad27fec96fdbabd4e0a91
Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
parent c01ee06b
......@@ -91,14 +91,14 @@ endfunc console_stm32_core_init
/* -------------------------------------------------------
* int console_stm32_register(uintptr_t baseaddr,
* uint32_t clock, uint32_t baud,
* struct console_stm32 *console);
* console_t *console);
* Function to initialize and register a new STM32
* console. Storage passed in for the console struct
* *must* be persistent (i.e. not from the stack).
* In: r0 - UART register base address
* r1 - UART clock in Hz
* r2 - Baud rate
* r3 - pointer to empty console_stm32 struct
* r3 - pointer to empty console_t struct
* Out: return 1 on success, 0 on error
* Clobber list : r0, r1, r2
* -------------------------------------------------------
......@@ -108,7 +108,7 @@ func console_stm32_register
mov r4, r3
cmp r4, #0
beq register_fail
str r0, [r4, #CONSOLE_T_STM32_BASE]
str r0, [r4, #CONSOLE_T_BASE]
bl console_stm32_core_init
cmp r0, #0
......@@ -157,7 +157,7 @@ putc_error:
endfunc console_stm32_core_putc
/* ------------------------------------------------------------
* int console_stm32_putc(int c, struct console_stm32 *console)
* int console_stm32_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: r0 - character to be printed
......@@ -171,7 +171,7 @@ func console_stm32_putc
cmp r1, #0
ASM_ASSERT(ne)
#endif /* ENABLE_ASSERTIONS */
ldr r1, [r1, #CONSOLE_T_STM32_BASE]
ldr r1, [r1, #CONSOLE_T_BASE]
b console_stm32_core_putc
endfunc console_stm32_putc
......@@ -219,7 +219,7 @@ flush_error:
endfunc console_stm32_core_flush
/* ------------------------------------------------------
* int console_stm32_flush(struct console_stm32 *console)
* int console_stm32_flush(console_t *console)
* Function to force a write of all buffered
* data that hasn't been output.
* In : r0 - pointer to console_t structure
......@@ -232,6 +232,6 @@ func console_stm32_flush
cmp r0, #0
ASM_ASSERT(ne)
#endif /* ENABLE_ASSERTIONS */
ldr r0, [r0, #CONSOLE_T_STM32_BASE]
ldr r0, [r0, #CONSOLE_T_BASE]
b console_stm32_core_flush
endfunc console_stm32_flush
......@@ -9,17 +9,10 @@
#include <drivers/console.h>
#define CONSOLE_T_STM32_BASE CONSOLE_T_DRVDATA
#ifndef __ASSEMBLER__
#include <stdint.h>
struct console_stm32 {
console_t console;
uintptr_t base;
};
/*
* Initialize a new STM32 console instance and register it with the console
* framework. The |console| pointer must point to storage that will be valid
......@@ -27,7 +20,7 @@ struct console_stm32 {
* Its contents will be reinitialized from scratch.
*/
int console_stm32_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
struct console_stm32 *console);
console_t *console);
#endif /*__ASSEMBLER__*/
......
......@@ -31,7 +31,7 @@
#include <stm32mp1_context.h>
#include <stm32mp1_dbgmcu.h>
static struct console_stm32 console;
static console_t console;
static struct stm32mp_auth_ops stm32mp1_auth_ops;
static void print_reset_reason(void)
......@@ -273,7 +273,7 @@ void bl2_el3_plat_arch_setup(void)
panic();
}
console_set_scope(&console.console, CONSOLE_FLAG_BOOT |
console_set_scope(&console, CONSOLE_FLAG_BOOT |
CONSOLE_FLAG_CRASH | CONSOLE_FLAG_TRANSLATE_CRLF);
stm32mp_print_cpuinfo();
......
......@@ -35,7 +35,7 @@
******************************************************************************/
static entry_point_info_t bl33_image_ep_info;
static struct console_stm32 console;
static console_t console;
/*******************************************************************************
* Interrupt handler for FIQ (secure IRQ)
......@@ -142,7 +142,7 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
#ifdef DEBUG
console_flags |= CONSOLE_FLAG_RUNTIME;
#endif
console_set_scope(&console.console, console_flags);
console_set_scope(&console, console_flags);
}
}
......
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