mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 05:54:08 +00:00
spe: 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: I75dbfafb67849833b3f7b5047e237651e3f553cd Signed-off-by: Andre Przywara <andre.przywara@arm.com>
This commit is contained in:
parent
9536a25e03
commit
7b8fe2de31
3 changed files with 7 additions and 12 deletions
|
@ -49,14 +49,14 @@
|
||||||
/* -------------------------------------------------
|
/* -------------------------------------------------
|
||||||
* int console_spe_register(uintptr_t baseaddr,
|
* int console_spe_register(uintptr_t baseaddr,
|
||||||
* uint32_t clock, uint32_t baud,
|
* uint32_t clock, uint32_t baud,
|
||||||
* console_spe_t *console);
|
* console_t *console);
|
||||||
* Function to initialize and register a new spe
|
* Function to initialize and register a new spe
|
||||||
* console. Storage passed in for the console struct
|
* console. Storage passed in for the console struct
|
||||||
* *must* be persistent (i.e. not from the stack).
|
* *must* be persistent (i.e. not from the stack).
|
||||||
* In: x0 - UART register base address
|
* In: x0 - UART register base address
|
||||||
* w1 - UART clock in Hz
|
* w1 - UART clock in Hz
|
||||||
* w2 - Baud rate
|
* w2 - Baud rate
|
||||||
* x3 - pointer to empty console_spe_t struct
|
* x3 - pointer to empty console_t struct
|
||||||
* Out: return 1 on success, 0 on error
|
* Out: return 1 on success, 0 on error
|
||||||
* Clobber list : x0, x1, x2, x6, x7, x14
|
* Clobber list : x0, x1, x2, x6, x7, x14
|
||||||
* -------------------------------------------------
|
* -------------------------------------------------
|
||||||
|
@ -122,7 +122,7 @@ putc_error:
|
||||||
endfunc console_spe_core_putc
|
endfunc console_spe_core_putc
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
* int console_spe_putc(int c, console_spe_t *console)
|
* int console_spe_putc(int c, console_t *console)
|
||||||
* Function to output a character over the console. It
|
* Function to output a character over the console. It
|
||||||
* returns the character printed on success or -1 on error.
|
* returns the character printed on success or -1 on error.
|
||||||
* In : w0 - character to be printed
|
* In : w0 - character to be printed
|
||||||
|
@ -137,7 +137,7 @@ func console_spe_putc
|
||||||
endfunc console_spe_putc
|
endfunc console_spe_putc
|
||||||
|
|
||||||
/* ---------------------------------------------
|
/* ---------------------------------------------
|
||||||
* int console_spe_getc(console_spe_t *console)
|
* int console_spe_getc(console_t *console)
|
||||||
* Function to get a character from the console.
|
* Function to get a character from the console.
|
||||||
* It returns the character grabbed on success
|
* It returns the character grabbed on success
|
||||||
* or -1 if no character is available.
|
* or -1 if no character is available.
|
||||||
|
@ -174,7 +174,7 @@ flush_error:
|
||||||
endfunc console_spe_core_flush
|
endfunc console_spe_core_flush
|
||||||
|
|
||||||
/* ---------------------------------------------
|
/* ---------------------------------------------
|
||||||
* int console_spe_flush(console_spe_t *console)
|
* int console_spe_flush(console_t *console)
|
||||||
* Function to force a write of all buffered
|
* Function to force a write of all buffered
|
||||||
* data that hasn't been output.
|
* data that hasn't been output.
|
||||||
* In : x0 - pointer to console_t structure
|
* In : x0 - pointer to console_t structure
|
||||||
|
|
|
@ -11,11 +11,6 @@
|
||||||
|
|
||||||
#include <drivers/console.h>
|
#include <drivers/console.h>
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
console_t console;
|
|
||||||
uintptr_t base;
|
|
||||||
} console_spe_t;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize a new spe console instance and register it with the console
|
* Initialize a new spe console instance and register it with the console
|
||||||
* framework. The |console| pointer must point to storage that will be valid
|
* framework. The |console| pointer must point to storage that will be valid
|
||||||
|
@ -23,6 +18,6 @@ typedef struct {
|
||||||
* Its contents will be reinitialized from scratch.
|
* Its contents will be reinitialized from scratch.
|
||||||
*/
|
*/
|
||||||
int console_spe_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
|
int console_spe_register(uintptr_t baseaddr, uint32_t clock, uint32_t baud,
|
||||||
console_spe_t *console);
|
console_t *console);
|
||||||
|
|
||||||
#endif /* SPE_H */
|
#endif /* SPE_H */
|
||||||
|
|
|
@ -163,7 +163,7 @@ void plat_enable_console(int32_t id)
|
||||||
uint32_t console_clock = 0U;
|
uint32_t console_clock = 0U;
|
||||||
|
|
||||||
#if ENABLE_CONSOLE_SPE
|
#if ENABLE_CONSOLE_SPE
|
||||||
static console_spe_t spe_console;
|
static console_t spe_console;
|
||||||
|
|
||||||
if (id == TEGRA_CONSOLE_SPE_ID) {
|
if (id == TEGRA_CONSOLE_SPE_ID) {
|
||||||
(void)console_spe_register(TEGRA_CONSOLE_SPE_BASE,
|
(void)console_spe_register(TEGRA_CONSOLE_SPE_BASE,
|
||||||
|
|
Loading…
Add table
Reference in a new issue