1 /*
2  * Copyright (c) 2017, Linaro Limited
3  * SPDX-License-Identifier: BSD-2-Clause
4  */
5 
6 #include <console.h>
7 #include <drivers/pl011.h>
8 #ifdef CFG_PL061
9 #include <drivers/pl061_gpio.h>
10 #endif
11 #include <kernel/panic.h>
12 #include <mm/tee_pager.h>
13 #include <mm/core_memprot.h>
14 #include <platform_config.h>
15 #include <stdint.h>
16 
17 static struct pl011_data console_data;
18 
19 register_phys_mem_pgdir(MEM_AREA_IO_NSEC, CONSOLE_UART_BASE, PL011_REG_SIZE);
20 /* for dynamic shared memory */
21 register_dynamic_shm(DRAM0_BASE_NSEC, DRAM0_SIZE_NSEC);
22 
console_init(void)23 void console_init(void)
24 {
25 	pl011_init(&console_data, CONSOLE_UART_BASE,
26 		CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE);
27 	register_serial_console(&console_data.chip);
28 }
29