1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3  * Copyright (c) 2016, GlobalLogic
4  * Copyright (c) 2019-2020, Renesas Electronics Corporation
5  */
6 
7 #include <console.h>
8 #include <drivers/gic.h>
9 #include <drivers/scif.h>
10 #include <kernel/panic.h>
11 #include <mm/core_memprot.h>
12 #include <platform_config.h>
13 
14 register_phys_mem_pgdir(MEM_AREA_IO_SEC, CONSOLE_UART_BASE, SCIF_REG_SIZE);
15 register_phys_mem_pgdir(MEM_AREA_IO_SEC, GICD_BASE, GIC_DIST_REG_SIZE);
16 register_phys_mem_pgdir(MEM_AREA_IO_SEC, GICC_BASE, GIC_DIST_REG_SIZE);
17 
18 register_dynamic_shm(NSEC_DDR_0_BASE, NSEC_DDR_0_SIZE);
19 #ifdef NSEC_DDR_1_BASE
20 register_dynamic_shm(NSEC_DDR_1_BASE, NSEC_DDR_1_SIZE);
21 #endif
22 #ifdef NSEC_DDR_2_BASE
23 register_dynamic_shm(NSEC_DDR_2_BASE, NSEC_DDR_2_SIZE);
24 #endif
25 #ifdef NSEC_DDR_3_BASE
26 register_dynamic_shm(NSEC_DDR_3_BASE, NSEC_DDR_3_SIZE);
27 #endif
28 
29 static struct scif_uart_data console_data __nex_bss;
30 
console_init(void)31 void console_init(void)
32 {
33 	scif_uart_init(&console_data, CONSOLE_UART_BASE);
34 	register_serial_console(&console_data.chip);
35 }
36