xref: /optee_os/core/arch/arm/plat-amlogic/main.c (revision 5b25c76ac40f830867e3d60800120ffd7874e8dc)
1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3  * Copyright (c) 2020 Carlo Caione <ccaione@baylibre.com>
4  */
5 
6 #include <console.h>
7 #include <kernel/generic_boot.h>
8 #include <kernel/panic.h>
9 #include <kernel/pm_stubs.h>
10 #include <mm/core_memprot.h>
11 #include <platform_config.h>
12 #include <stdint.h>
13 #include <tee/entry_std.h>
14 #include <tee/entry_fast.h>
15 #include <drivers/amlogic_uart.h>
16 
17 static const struct thread_handlers handlers = {
18 	.cpu_on = cpu_on_handler,
19 	.cpu_off = pm_do_nothing,
20 	.cpu_suspend = pm_do_nothing,
21 	.cpu_resume = pm_do_nothing,
22 	.system_off = pm_do_nothing,
23 	.system_reset = pm_do_nothing,
24 };
25 
26 const struct thread_handlers *generic_boot_get_handlers(void)
27 {
28 	return &handlers;
29 }
30 
31 static struct amlogic_uart_data console_data;
32 register_phys_mem_pgdir(MEM_AREA_IO_SEC, CONSOLE_UART_BASE,
33 			CORE_MMU_PGDIR_SIZE);
34 
35 void console_init(void)
36 {
37 	amlogic_uart_init(&console_data, CONSOLE_UART_BASE);
38 	register_serial_console(&console_data.chip);
39 }
40