diff --git a/core/arch/arm/kernel/boot.c b/core/arch/arm/kernel/boot.c index 5eaf67ff529..066668338af 100644 --- a/core/arch/arm/kernel/boot.c +++ b/core/arch/arm/kernel/boot.c @@ -106,6 +106,11 @@ __weak void boot_secondary_init_intc(void) { } +/* May be overridden in plat-$(PLATFORM)/main.c */ +__weak void plat_console_init(void) +{ +} + /* May be overridden in plat-$(PLATFORM)/main.c */ __weak unsigned long plat_get_aslr_seed(void) { diff --git a/core/arch/arm/plat-amlogic/main.c b/core/arch/arm/plat-amlogic/main.c index fd5ede4ae5d..42a32c29771 100644 --- a/core/arch/arm/plat-amlogic/main.c +++ b/core/arch/arm/plat-amlogic/main.c @@ -13,7 +13,7 @@ static struct amlogic_uart_data console_data; register_phys_mem_pgdir(MEM_AREA_IO_SEC, CONSOLE_UART_BASE, CORE_MMU_PGDIR_SIZE); -void console_init(void) +void plat_console_init(void) { amlogic_uart_init(&console_data, CONSOLE_UART_BASE); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-aspeed/platform_ast2600.c b/core/arch/arm/plat-aspeed/platform_ast2600.c index b6132c0229b..8cc3eb394cb 100644 --- a/core/arch/arm/plat-aspeed/platform_ast2600.c +++ b/core/arch/arm/plat-aspeed/platform_ast2600.c @@ -70,7 +70,7 @@ void boot_secondary_init_intc(void) gic_init_per_cpu(); } -void console_init(void) +void plat_console_init(void) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-aspeed/platform_ast2700.c b/core/arch/arm/plat-aspeed/platform_ast2700.c index 106c88df173..d88ec72bbe2 100644 --- a/core/arch/arm/plat-aspeed/platform_ast2700.c +++ b/core/arch/arm/plat-aspeed/platform_ast2700.c @@ -29,7 +29,7 @@ void boot_secondary_init_intc(void) gic_init_per_cpu(); } -void console_init(void) +void plat_console_init(void) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-bcm/main.c b/core/arch/arm/plat-bcm/main.c index d6f37fa1f14..387d9d063b4 100644 --- a/core/arch/arm/plat-bcm/main.c +++ b/core/arch/arm/plat-bcm/main.c @@ -62,7 +62,7 @@ void plat_trace_ext_puts(const char *str) bcm_elog_putchar(*p); } -void console_init(void) +void plat_console_init(void) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-corstone1000/main.c b/core/arch/arm/plat-corstone1000/main.c index b3861c4c88f..67fa5ceadf6 100644 --- a/core/arch/arm/plat-corstone1000/main.c +++ b/core/arch/arm/plat-corstone1000/main.c @@ -31,7 +31,7 @@ void boot_secondary_init_intc(void) gic_init_per_cpu(); } -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-d02/main.c b/core/arch/arm/plat-d02/main.c index 759ca3b9ad1..0e5b9ec3c68 100644 --- a/core/arch/arm/plat-d02/main.c +++ b/core/arch/arm/plat-d02/main.c @@ -16,7 +16,7 @@ static struct hi16xx_uart_data console_data; register_phys_mem_pgdir(MEM_AREA_IO_NSEC, CONSOLE_UART_BASE, HI16XX_UART_REG_SIZE); -void console_init(void) +void plat_console_init(void) { hi16xx_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-d06/main.c b/core/arch/arm/plat-d06/main.c index 77369440117..9b83e75d38a 100644 --- a/core/arch/arm/plat-d06/main.c +++ b/core/arch/arm/plat-d06/main.c @@ -11,7 +11,7 @@ static struct lpc_uart_data console_data __nex_bss; register_phys_mem_pgdir(MEM_AREA_IO_NSEC, LPC_BASE, LPC_SIZE); -void console_init(void) +void plat_console_init(void) { lpc_uart_init(&console_data, LPC_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-hikey/main.c b/core/arch/arm/plat-hikey/main.c index c67d636752d..44707bd6a73 100644 --- a/core/arch/arm/plat-hikey/main.c +++ b/core/arch/arm/plat-hikey/main.c @@ -41,7 +41,7 @@ register_ddr(DRAM1_BASE, DRAM1_SIZE_NSEC); register_ddr(DRAM2_BASE, DRAM2_SIZE_NSEC); #endif -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-hisilicon/main.c b/core/arch/arm/plat-hisilicon/main.c index 4840b98f244..77b8385cc12 100644 --- a/core/arch/arm/plat-hisilicon/main.c +++ b/core/arch/arm/plat-hisilicon/main.c @@ -24,7 +24,7 @@ register_phys_mem(MEM_AREA_IO_SEC, CPU_CRG_BASE, CPU_CRG_SIZE); register_phys_mem(MEM_AREA_IO_SEC, SYS_CTRL_BASE, SYS_CTRL_SIZE); #endif -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-imx/main.c b/core/arch/arm/plat-imx/main.c index 9ae1c7ce531..07b01f76519 100644 --- a/core/arch/arm/plat-imx/main.c +++ b/core/arch/arm/plat-imx/main.c @@ -97,7 +97,7 @@ register_ddr(CFG_DRAM_BASE, CFG_DDR_SIZE); register_ddr(CFG_NSEC_DDR_1_BASE, CFG_NSEC_DDR_1_SIZE); #endif -void console_init(void) +void plat_console_init(void) { #ifdef CONSOLE_UART_BASE imx_uart_init(&console_data, CONSOLE_UART_BASE); diff --git a/core/arch/arm/plat-k3/main.c b/core/arch/arm/plat-k3/main.c index e029554412f..ecfe4837d7a 100644 --- a/core/arch/arm/plat-k3/main.c +++ b/core/arch/arm/plat-k3/main.c @@ -42,7 +42,7 @@ void boot_secondary_init_intc(void) gic_init_per_cpu(); } -void console_init(void) +void plat_console_init(void) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-ls/main.c b/core/arch/arm/plat-ls/main.c index 8358bc13364..b5017374e58 100644 --- a/core/arch/arm/plat-ls/main.c +++ b/core/arch/arm/plat-ls/main.c @@ -112,7 +112,7 @@ void plat_primary_init_early(void) } #endif -void console_init(void) +void plat_console_init(void) { #ifdef CFG_PL011 /* diff --git a/core/arch/arm/plat-marvell/main.c b/core/arch/arm/plat-marvell/main.c index a299b21cb3e..1075c026041 100644 --- a/core/arch/arm/plat-marvell/main.c +++ b/core/arch/arm/plat-marvell/main.c @@ -85,7 +85,7 @@ void boot_primary_init_intc(void) } #endif -void console_init(void) +void plat_console_init(void) { #if defined(PLATFORM_FLAVOR_armada7k8k) serial8250_uart_init(&console_data, CONSOLE_UART_BASE, diff --git a/core/arch/arm/plat-mediatek/main.c b/core/arch/arm/plat-mediatek/main.c index de7e06344fb..4d84e3242bc 100644 --- a/core/arch/arm/plat-mediatek/main.c +++ b/core/arch/arm/plat-mediatek/main.c @@ -33,7 +33,7 @@ void boot_primary_init_intc(void) } #endif -void console_init(void) +void plat_console_init(void) { if (CFG_TEE_CORE_LOG_LEVEL != 0) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, diff --git a/core/arch/arm/plat-nuvoton/main.c b/core/arch/arm/plat-nuvoton/main.c index 88db73db1d4..c5ca4075e7d 100644 --- a/core/arch/arm/plat-nuvoton/main.c +++ b/core/arch/arm/plat-nuvoton/main.c @@ -60,7 +60,7 @@ void boot_primary_init_intc(void) gic_init(GICC_BASE, GICD_BASE); } -void console_init(void) +void plat_console_init(void) { ns16550_init(&console_data, CONSOLE_UART_BASE, IO_WIDTH_U32, 2); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-poplar/main.c b/core/arch/arm/plat-poplar/main.c index ec244ceb53f..a97b6c8b326 100644 --- a/core/arch/arm/plat-poplar/main.c +++ b/core/arch/arm/plat-poplar/main.c @@ -20,7 +20,7 @@ register_phys_mem_pgdir(MEM_AREA_IO_NSEC, CONSOLE_UART_BASE, PL011_REG_SIZE); /* for dynamic shared memory */ register_dynamic_shm(DRAM0_BASE_NSEC, DRAM0_SIZE_NSEC); -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-rcar/main.c b/core/arch/arm/plat-rcar/main.c index 452e05e9709..122ad9b9707 100644 --- a/core/arch/arm/plat-rcar/main.c +++ b/core/arch/arm/plat-rcar/main.c @@ -65,7 +65,7 @@ static struct scif_uart_data console_data __nex_bss; uint32_t rcar_prr_value __nex_bss; #endif -void console_init(void) +void plat_console_init(void) { scif_uart_init(&console_data, CONSOLE_UART_BASE); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-rockchip/main.c b/core/arch/arm/plat-rockchip/main.c index a85900fa314..d50bede2d15 100644 --- a/core/arch/arm/plat-rockchip/main.c +++ b/core/arch/arm/plat-rockchip/main.c @@ -32,7 +32,7 @@ void boot_secondary_init_intc(void) gic_init_per_cpu(); } -void console_init(void) +void plat_console_init(void) { #if defined(CFG_EARLY_CONSOLE) /* diff --git a/core/arch/arm/plat-rpi3/main.c b/core/arch/arm/plat-rpi3/main.c index 3e9021dfaac..5008c1b10d7 100644 --- a/core/arch/arm/plat-rpi3/main.c +++ b/core/arch/arm/plat-rpi3/main.c @@ -39,7 +39,7 @@ register_phys_mem_pgdir(MEM_AREA_IO_NSEC, static struct serial8250_uart_data console_data; -void console_init(void) +void plat_console_init(void) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-rzg/main.c b/core/arch/arm/plat-rzg/main.c index 31dfd084e46..c58ca47b25c 100644 --- a/core/arch/arm/plat-rzg/main.c +++ b/core/arch/arm/plat-rzg/main.c @@ -28,7 +28,7 @@ register_dynamic_shm(NSEC_DDR_3_BASE, NSEC_DDR_3_SIZE); static struct scif_uart_data console_data __nex_bss; -void console_init(void) +void plat_console_init(void) { scif_uart_init(&console_data, CONSOLE_UART_BASE); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-rzn1/main.c b/core/arch/arm/plat-rzn1/main.c index bed02b80f74..025645fedab 100644 --- a/core/arch/arm/plat-rzn1/main.c +++ b/core/arch/arm/plat-rzn1/main.c @@ -34,7 +34,7 @@ register_phys_mem(MEM_AREA_IO_SEC, GIC_BASE, CORE_MMU_PGDIR_SIZE); register_phys_mem(MEM_AREA_IO_SEC, PERIPH_REG_BASE, CORE_MMU_PGDIR_SIZE); register_ddr(DRAM_BASE, DRAM_SIZE); -void console_init(void) +void plat_console_init(void) { ns16550_init(&console_data, CONSOLE_UART_BASE, IO_WIDTH_U32, 2); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-sam/main.c b/core/arch/arm/plat-sam/main.c index 1fffce5884f..c52d8a8f1d6 100644 --- a/core/arch/arm/plat-sam/main.c +++ b/core/arch/arm/plat-sam/main.c @@ -499,7 +499,7 @@ static struct atmel_uart_data console_data; register_phys_mem_pgdir(MEM_AREA_IO_SEC, CONSOLE_UART_BASE, CORE_MMU_PGDIR_SIZE); -void console_init(void) +void plat_console_init(void) { atmel_uart_init(&console_data, CONSOLE_UART_BASE); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-sprd/console.c b/core/arch/arm/plat-sprd/console.c index 15a4b3b9479..eb765ff5ab8 100644 --- a/core/arch/arm/plat-sprd/console.c +++ b/core/arch/arm/plat-sprd/console.c @@ -32,7 +32,7 @@ static struct sprd_uart_data console_data; -void console_init(void) +void plat_console_init(void) { sprd_uart_init(&console_data, CONSOLE_UART_BASE); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-stm/main.c b/core/arch/arm/plat-stm/main.c index f0657cb8308..45e25dcd242 100644 --- a/core/arch/arm/plat-stm/main.c +++ b/core/arch/arm/plat-stm/main.c @@ -56,7 +56,7 @@ TEE_Result tee_entry_std(struct optee_msg_arg *arg, uint32_t num_params) } #endif -void console_init(void) +void plat_console_init(void) { stih_asc_init(&console_data, UART_CONSOLE_BASE); } diff --git a/core/arch/arm/plat-stm32mp1/main.c b/core/arch/arm/plat-stm32mp1/main.c index eed6b77c238..b8bb1f43905 100644 --- a/core/arch/arm/plat-stm32mp1/main.c +++ b/core/arch/arm/plat-stm32mp1/main.c @@ -76,7 +76,7 @@ service_init(platform_banner); */ static struct stm32_uart_pdata console_data; -void console_init(void) +void plat_console_init(void) { /* Early console initialization before MMU setup */ struct uart { diff --git a/core/arch/arm/plat-stm32mp2/main.c b/core/arch/arm/plat-stm32mp2/main.c index 81366e60d24..3601facb281 100644 --- a/core/arch/arm/plat-stm32mp2/main.c +++ b/core/arch/arm/plat-stm32mp2/main.c @@ -58,7 +58,7 @@ service_init(platform_banner); */ static struct stm32_uart_pdata console_data; -void console_init(void) +void plat_console_init(void) { #ifdef CFG_STM32_UART /* Early console initialization before MMU setup */ diff --git a/core/arch/arm/plat-sunxi/main.c b/core/arch/arm/plat-sunxi/main.c index b0f80484f21..5ed2f95c5a8 100644 --- a/core/arch/arm/plat-sunxi/main.c +++ b/core/arch/arm/plat-sunxi/main.c @@ -88,7 +88,7 @@ static void tzpc_init(void); static struct serial8250_uart_data console_data; -void console_init(void) +void plat_console_init(void) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, diff --git a/core/arch/arm/plat-synquacer/main.c b/core/arch/arm/plat-synquacer/main.c index 2ba622f1edc..54d7bee6225 100644 --- a/core/arch/arm/plat-synquacer/main.c +++ b/core/arch/arm/plat-synquacer/main.c @@ -28,7 +28,7 @@ register_phys_mem_pgdir(MEM_AREA_IO_SEC, GIC_BASE, CORE_MMU_PGDIR_SIZE); register_phys_mem_pgdir(MEM_AREA_IO_SEC, THERMAL_SENSOR_BASE, CORE_MMU_PGDIR_SIZE); -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-ti/main.c b/core/arch/arm/plat-ti/main.c index 5b132ae7ec1..7ae0313e1f4 100644 --- a/core/arch/arm/plat-ti/main.c +++ b/core/arch/arm/plat-ti/main.c @@ -108,7 +108,7 @@ void init_sec_mon(unsigned long nsec_entry) memcpy(plat_huk, plat_boot_args->huk, sizeof(plat_boot_args->huk)); } -void console_init(void) +void plat_console_init(void) { serial8250_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-totalcompute/main.c b/core/arch/arm/plat-totalcompute/main.c index c3445c0c0bc..92242822950 100644 --- a/core/arch/arm/plat-totalcompute/main.c +++ b/core/arch/arm/plat-totalcompute/main.c @@ -32,7 +32,7 @@ void boot_primary_init_intc(void) } #endif -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_UART_BAUDRATE); diff --git a/core/arch/arm/plat-uniphier/main.c b/core/arch/arm/plat-uniphier/main.c index 080dd83b972..a01e8ff30ec 100644 --- a/core/arch/arm/plat-uniphier/main.c +++ b/core/arch/arm/plat-uniphier/main.c @@ -40,7 +40,7 @@ void boot_primary_init_intc(void) gic_init(GIC_BASE + GICC_OFFSET, GIC_BASE + GICD_OFFSET); } -void console_init(void) +void plat_console_init(void) { /* Init UART */ serial8250_uart_init(&console_data, CONSOLE_UART_BASE, diff --git a/core/arch/arm/plat-versal/main.c b/core/arch/arm/plat-versal/main.c index 37623cb0d8f..b443269bd4a 100644 --- a/core/arch/arm/plat-versal/main.c +++ b/core/arch/arm/plat-versal/main.c @@ -51,7 +51,7 @@ void boot_primary_init_intc(void) gic_init(GIC_BASE + GICC_OFFSET, GIC_BASE + GICD_OFFSET); } -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-vexpress/main.c b/core/arch/arm/plat-vexpress/main.c index 42116c2f2ae..bf36604232f 100644 --- a/core/arch/arm/plat-vexpress/main.c +++ b/core/arch/arm/plat-vexpress/main.c @@ -80,7 +80,7 @@ void boot_primary_init_intc(void) } #endif -void console_init(void) +void plat_console_init(void) { pl011_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/arm/plat-zynq7k/main.c b/core/arch/arm/plat-zynq7k/main.c index 08af994fd03..5f71a05f28f 100644 --- a/core/arch/arm/plat-zynq7k/main.c +++ b/core/arch/arm/plat-zynq7k/main.c @@ -89,7 +89,7 @@ void plat_primary_init_early(void) io_write32(SLCR_LOCK, SLCR_LOCK_MAGIC); } -void console_init(void) +void plat_console_init(void) { cdns_uart_init(&console_data, CONSOLE_UART_BASE, 0, 0); register_serial_console(&console_data.chip); diff --git a/core/arch/arm/plat-zynqmp/main.c b/core/arch/arm/plat-zynqmp/main.c index dcbf6869ddb..16d7d15182b 100644 --- a/core/arch/arm/plat-zynqmp/main.c +++ b/core/arch/arm/plat-zynqmp/main.c @@ -80,7 +80,7 @@ void boot_primary_init_intc(void) gic_init(GIC_BASE + GICC_OFFSET, GIC_BASE + GICD_OFFSET); } -void console_init(void) +void plat_console_init(void) { cdns_uart_init(&console_data, CONSOLE_UART_BASE, CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE); diff --git a/core/arch/riscv/kernel/boot.c b/core/arch/riscv/kernel/boot.c index 6530a8b5cb7..47c73025ced 100644 --- a/core/arch/riscv/kernel/boot.c +++ b/core/arch/riscv/kernel/boot.c @@ -124,6 +124,11 @@ __weak void boot_secondary_init_intc(void) { } +/* May be overridden in plat-$(PLATFORM)/main.c */ +__weak void plat_console_init(void) +{ +} + void boot_init_primary_early(void) { unsigned long e = PADDR_INVALID; diff --git a/core/arch/riscv/kernel/sbi_console.c b/core/arch/riscv/kernel/sbi_console.c index 18c628d17d8..ce2b5a682cd 100644 --- a/core/arch/riscv/kernel/sbi_console.c +++ b/core/arch/riscv/kernel/sbi_console.c @@ -55,7 +55,7 @@ static void sbi_console_init(struct sbi_console_data *pd) pd->chip.ops = &sbi_console_ops; } -void console_init(void) +void plat_console_init(void) { sbi_console_init(&console_data); register_serial_console(&console_data.chip); diff --git a/core/arch/riscv/plat-spike/main.c b/core/arch/riscv/plat-spike/main.c index 40de072ac01..b1dedf76cb0 100644 --- a/core/arch/riscv/plat-spike/main.c +++ b/core/arch/riscv/plat-spike/main.c @@ -13,7 +13,7 @@ #ifdef CFG_RISCV_M_MODE static struct htif_console_data console_data __nex_bss; -void console_init(void) +void plat_console_init(void) { #ifdef HTIF_BASE htif_console_init(&console_data, HTIF_BASE); diff --git a/core/arch/riscv/plat-virt/main.c b/core/arch/riscv/plat-virt/main.c index edfbf4caaac..f6f6120d13d 100644 --- a/core/arch/riscv/plat-virt/main.c +++ b/core/arch/riscv/plat-virt/main.c @@ -29,7 +29,7 @@ void boot_secondary_init_intc(void) } #endif /* CFG_RISCV_PLIC */ -void console_init(void) +void plat_console_init(void) { ns16550_init(&console_data, UART0_BASE, IO_WIDTH_U8, 0); register_serial_console(&console_data.chip); diff --git a/core/include/kernel/boot.h b/core/include/kernel/boot.h index bf78d5c3808..d6f29f7cfc9 100644 --- a/core/include/kernel/boot.h +++ b/core/include/kernel/boot.h @@ -66,6 +66,7 @@ void init_tee_runtime(void); /* weak routines eventually overridden by platform */ void plat_cpu_reset_early(void); void plat_primary_init_early(void); +void plat_console_init(void); unsigned long plat_get_aslr_seed(void); unsigned long plat_get_freq(void); #if defined(_CFG_CORE_STACK_PROTECTOR) || defined(CFG_WITH_STACK_CANARIES) diff --git a/core/kernel/console.c b/core/kernel/console.c index 1a5306757d9..71845d5bf0a 100644 --- a/core/kernel/console.c +++ b/core/kernel/console.c @@ -6,7 +6,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -17,6 +19,16 @@ static struct serial_chip *serial_console __nex_bss; +void console_init(void) +{ + if (IS_ENABLED(CFG_SEMIHOSTING_CONSOLE)) { + semihosting_console_init("optee.log"); + return; + } + + plat_console_init(); +} + void __weak console_putc(int ch) { if (!serial_console)