From c779b15992b6cbe2b245981576b098af665bf4f8 Mon Sep 17 00:00:00 2001 From: Jerome Forissier <jerome.forissier@linaro.org> Date: Thu, 8 Nov 2018 10:17:47 +0000 Subject: [PATCH] hikey: Use new console APIs Switch to the new console APIs enabled by setting MULTI_CONSOLE_API=1. Enables building with ERROR_DEPRECATED=1. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> --- plat/hisilicon/hikey/aarch64/hikey_helpers.S | 6 +++--- plat/hisilicon/hikey/hikey_bl1_setup.c | 6 ++++-- plat/hisilicon/hikey/hikey_bl2_setup.c | 6 ++++-- plat/hisilicon/hikey/hikey_bl31_setup.c | 6 ++++-- plat/hisilicon/hikey/platform.mk | 1 + 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/plat/hisilicon/hikey/aarch64/hikey_helpers.S b/plat/hisilicon/hikey/aarch64/hikey_helpers.S index 9dfdae49c..1752d3bb9 100644 --- a/plat/hisilicon/hikey/aarch64/hikey_helpers.S +++ b/plat/hisilicon/hikey/aarch64/hikey_helpers.S @@ -46,7 +46,7 @@ func plat_crash_console_init mov_imm x0, CRASH_CONSOLE_BASE mov_imm x1, PL011_UART_CLK_IN_HZ mov_imm x2, PL011_BAUDRATE - b console_core_init + b console_pl011_core_init endfunc plat_crash_console_init /* --------------------------------------------- @@ -58,7 +58,7 @@ endfunc plat_crash_console_init */ func plat_crash_console_putc mov_imm x1, CRASH_CONSOLE_BASE - b console_core_putc + b console_pl011_core_putc endfunc plat_crash_console_putc /* --------------------------------------------- @@ -71,7 +71,7 @@ endfunc plat_crash_console_putc */ func plat_crash_console_flush mov_imm x0, CRASH_CONSOLE_BASE - b console_core_flush + b console_pl011_core_flush endfunc plat_crash_console_flush /* --------------------------------------------- diff --git a/plat/hisilicon/hikey/hikey_bl1_setup.c b/plat/hisilicon/hikey/hikey_bl1_setup.c index 2fc99a06e..6fcb59732 100644 --- a/plat/hisilicon/hikey/hikey_bl1_setup.c +++ b/plat/hisilicon/hikey/hikey_bl1_setup.c @@ -7,7 +7,6 @@ #include <arch_helpers.h> #include <assert.h> #include <bl_common.h> -#include <console.h> #include <debug.h> #include <dw_mmc.h> #include <errno.h> @@ -16,6 +15,7 @@ #include <hikey_layout.h> #include <mmc.h> #include <mmio.h> +#include <pl011.h> #include <platform.h> #include <string.h> #include <tbbr/tbbr_img_desc.h> @@ -25,6 +25,7 @@ /* Data structure which holds the extents of the trusted RAM for BL1 */ static meminfo_t bl1_tzram_layout; +static console_pl011_t console; enum { BOOT_NORMAL = 0, @@ -43,7 +44,8 @@ meminfo_t *bl1_plat_sec_mem_layout(void) void bl1_early_platform_setup(void) { /* Initialize the console to provide early debug support */ - console_init(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, PL011_BAUDRATE); + console_pl011_register(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, + PL011_BAUDRATE, &console); /* Allow BL1 to see the whole Trusted RAM */ bl1_tzram_layout.total_base = BL1_RW_BASE; diff --git a/plat/hisilicon/hikey/hikey_bl2_setup.c b/plat/hisilicon/hikey/hikey_bl2_setup.c index 62cd1f23e..791076c96 100644 --- a/plat/hisilicon/hikey/hikey_bl2_setup.c +++ b/plat/hisilicon/hikey/hikey_bl2_setup.c @@ -7,7 +7,6 @@ #include <arch_helpers.h> #include <assert.h> #include <bl_common.h> -#include <console.h> #include <debug.h> #include <delay_timer.h> #include <desc_image_load.h> @@ -21,6 +20,7 @@ #ifdef SPD_opteed #include <optee_utils.h> #endif +#include <pl011.h> #include <platform.h> #include <platform_def.h> /* also includes hikey_def.h and hikey_layout.h*/ #include <string.h> @@ -49,6 +49,7 @@ #define BL2_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__) static meminfo_t bl2_el3_tzram_layout; +static console_pl011_t console; enum { BOOT_MODE_RECOVERY = 0, @@ -279,7 +280,8 @@ void bl2_el3_early_platform_setup(u_register_t arg1, u_register_t arg2, u_register_t arg3, u_register_t arg4) { /* Initialize the console to provide early debug support */ - console_init(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, PL011_BAUDRATE); + console_pl011_register(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, + PL011_BAUDRATE, &console); /* * Allow BL2 to see the whole Trusted RAM. */ diff --git a/plat/hisilicon/hikey/hikey_bl31_setup.c b/plat/hisilicon/hikey/hikey_bl31_setup.c index 525412c05..0e061e927 100644 --- a/plat/hisilicon/hikey/hikey_bl31_setup.c +++ b/plat/hisilicon/hikey/hikey_bl31_setup.c @@ -8,7 +8,6 @@ #include <assert.h> #include <bl_common.h> #include <cci.h> -#include <console.h> #include <debug.h> #include <errno.h> #include <gicv2.h> @@ -18,6 +17,7 @@ #include <hisi_pwrc.h> #include <interrupt_props.h> #include <mmio.h> +#include <pl011.h> #include <platform_def.h> #include "hikey_private.h" @@ -43,6 +43,7 @@ static entry_point_info_t bl32_ep_info; static entry_point_info_t bl33_ep_info; +static console_pl011_t console; /****************************************************************************** * On a GICv2 system, the Group 1 secure interrupts are treated as Group 0 @@ -92,7 +93,8 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, from_bl2 = (void *) arg0; /* Initialize the console to provide early debug support */ - console_init(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, PL011_BAUDRATE); + console_pl011_register(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, + PL011_BAUDRATE, &console); /* Initialize CCI driver */ cci_init(CCI400_BASE, cci_map, ARRAY_SIZE(cci_map)); diff --git a/plat/hisilicon/hikey/platform.mk b/plat/hisilicon/hikey/platform.mk index c8e760d3f..398b224cf 100644 --- a/plat/hisilicon/hikey/platform.mk +++ b/plat/hisilicon/hikey/platform.mk @@ -20,6 +20,7 @@ endif CONSOLE_BASE := PL011_UART3_BASE CRASH_CONSOLE_BASE := PL011_UART3_BASE +MULTI_CONSOLE_API := 1 PLAT_PARTITION_MAX_ENTRIES := 12 PLAT_PL061_MAX_GPIOS := 160 COLD_BOOT_SINGLE_CPU := 1 -- GitLab