xref: /optee_os/core/arch/arm/plat-aspeed/platform_ast2700.c (revision 55ab8f06a831946a49717446cd2e4495a2b5d659)
1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3  * Copyright (c) 2023, Aspeed Technology Inc.
4  */
5 
6 #include <console.h>
7 #include <drivers/gic.h>
8 #include <drivers/serial8250_uart.h>
9 #include <io.h>
10 #include <kernel/boot.h>
11 #include <mm/core_mmu.h>
12 #include <platform_config.h>
13 
14 register_phys_mem(MEM_AREA_IO_SEC, UART_BASE, SMALL_PAGE_SIZE);
15 register_phys_mem(MEM_AREA_IO_SEC, GICD_BASE, GIC_DIST_REG_SIZE);
16 register_phys_mem(MEM_AREA_IO_SEC, GICR_BASE, GICR_SIZE);
17 
18 register_ddr(CFG_DRAM_BASE, CFG_DRAM_SIZE);
19 
20 static struct serial8250_uart_data console_data;
21 
boot_primary_init_intc(void)22 void boot_primary_init_intc(void)
23 {
24 	gic_init_v3(0, GICD_BASE, GICR_BASE);
25 }
26 
boot_secondary_init_intc(void)27 void boot_secondary_init_intc(void)
28 {
29 	gic_init_per_cpu();
30 }
31 
plat_console_init(void)32 void plat_console_init(void)
33 {
34 	serial8250_uart_init(&console_data, CONSOLE_UART_BASE,
35 			     CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE);
36 	register_serial_console(&console_data.chip);
37 }
38