xref: /optee_os/core/drivers/ffa_console.c (revision 9f34db38245c9b3a4e6e7e63eb78a75e23ab2da3)
1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3  * Copyright (c) 2024, NVIDIA CORPORATION
4  */
5 
6 #include <compiler.h>
7 #include <console.h>
8 #include <drivers/ffa_console.h>
9 #include <drivers/serial.h>
10 #include <kernel/thread_arch.h>
11 
12 #define FFA_CONSOLE_LOG_32		(0x8400008A)
13 
14 static void ffa_console_putc(struct serial_chip *chip __unused, int ch)
15 {
16 	thread_hvc(FFA_CONSOLE_LOG_32, 1, ch, 0);
17 }
18 
19 static const struct serial_ops ffa_console_ops = {
20 	.putc = ffa_console_putc,
21 };
22 DECLARE_KEEP_PAGER(ffa_console_ops);
23 
24 static struct serial_chip ffa_console = {
25 	.ops = &ffa_console_ops
26 };
27 
28 void ffa_console_init(void)
29 {
30 	register_serial_console(&ffa_console);
31 }
32