Commit 487461cb authored by Soby Mathew's avatar Soby Mathew
Browse files

Introduce console_uninit() API in ARM Trusted Firmware

Allowing console base address to be set to NULL conveniently
allows console driver to ignore further invocations to console_putc()
and console_getc(). This patch adds `console_uninit()` API to the
console driver which sets console base address as NULL. The BL images can
invoke this API to finish the use of console and ignore any further
invocations to print to the console.

Change-Id: I00a1762b3e0b7c55f2be2f9c4c9bee3967189dde
parent 05a91fb0
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <asm_macros.S> #include <asm_macros.S>
.globl console_init .globl console_init
.globl console_uninit
.globl console_putc .globl console_putc
.globl console_getc .globl console_getc
...@@ -66,6 +67,20 @@ init_fail: ...@@ -66,6 +67,20 @@ init_fail:
ret ret
endfunc console_init endfunc console_init
/* -----------------------------------------------
* void console_uninit(void)
* Function to finish the use of console driver.
* It sets the console_base as NULL so that any
* further invocation of `console_putc` or
* `console_getc` APIs would return error.
* -----------------------------------------------
*/
func console_uninit
mov x0, #0
adrp x3, console_base
str x0, [x3, :lo12:console_base]
endfunc console_uninit
/* --------------------------------------------- /* ---------------------------------------------
* int console_putc(int c) * int console_putc(int c)
* Function to output a character over the * Function to output a character over the
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
int console_init(uintptr_t base_addr, int console_init(uintptr_t base_addr,
unsigned int uart_clk, unsigned int baud_rate); unsigned int uart_clk, unsigned int baud_rate);
void console_uninit(void);
int console_putc(int c); int console_putc(int c);
int console_getc(void); int console_getc(void);
......
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