summaryrefslogtreecommitdiff
path: root/plat
diff options
context:
space:
mode:
authorPrasad Kummari <prasad.kummari@amd.com>2023-09-19 22:16:12 +0530
committerPrasad Kummari <prasad.kummari@amd.com>2023-10-10 14:54:52 +0530
commit7c36fbcc13793899390a01a9b4a623ff2fbf7ee1 (patch)
tree8fd30272f159312fbc74debb5fce2cc02caf35ba /plat
parentc1e84aca3831c8a768b862061ab95b22168c0564 (diff)
feat(versal): retrieval of console information from dtb
Introduces functionality to retrieve console information from the device tree (DTB) and use it in TF-A code. Comparing early console information and the data populated from the DTB. In case of a mistmatch, the changes takes care of unregistering the build time console configuration and registering the DTB-based console. Reorganizes the console configuration setup in BL31 by moving it to a dedicated function called setup_console() in the plat_console.c file. This change improves code readability by isolating console-related settings, making it easier to manage and extend the console configuration in the future. Signed-off-by: Prasad Kummari <prasad.kummari@amd.com> Change-Id: I617c846d753e73d2433edf15b3286f1a650f01b3
Diffstat (limited to 'plat')
-rw-r--r--plat/xilinx/versal/bl31_versal_setup.c28
-rw-r--r--plat/xilinx/versal/platform.mk2
2 files changed, 4 insertions, 26 deletions
diff --git a/plat/xilinx/versal/bl31_versal_setup.c b/plat/xilinx/versal/bl31_versal_setup.c
index 8106db805..48f774dfe 100644
--- a/plat/xilinx/versal/bl31_versal_setup.c
+++ b/plat/xilinx/versal/bl31_versal_setup.c
@@ -12,13 +12,11 @@
#include <bl31/bl31.h>
#include <common/bl_common.h>
#include <common/debug.h>
-#include <drivers/arm/dcc.h>
-#include <drivers/arm/pl011.h>
-#include <drivers/console.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <plat/common/platform.h>
#include <plat_arm.h>
+#include <plat_console.h>
#include <plat_fdt.h>
#include <plat_private.h>
@@ -73,30 +71,8 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
uint32_t payload[PAYLOAD_ARG_CNT], max_size = HANDOFF_PARAMS_MAX_SIZE;
enum pm_ret_status ret_status;
uint64_t addr[HANDOFF_PARAMS_MAX_SIZE];
- uint32_t uart_clk = get_uart_clk();
-
- if (CONSOLE_IS(pl011) || (CONSOLE_IS(pl011_1))) {
- static console_t versal_runtime_console;
- /* Initialize the console to provide early debug support */
- int32_t rc = console_pl011_register((uintptr_t)UART_BASE,
- uart_clk,
- (uint32_t)UART_BAUDRATE,
- &versal_runtime_console);
- if (rc == 0) {
- panic();
- }
- console_set_scope(&versal_runtime_console, (uint32_t)(CONSOLE_FLAG_BOOT |
- CONSOLE_FLAG_RUNTIME | CONSOLE_FLAG_CRASH));
- } else if (CONSOLE_IS(dcc)) {
- /* Initialize the dcc console for debug */
- int32_t rc = console_dcc_register();
- if (rc == 0) {
- panic();
- }
- } else {
- /* No console device found. */
- }
+ setup_console();
/* Initialize the platform config for future decision making */
versal_config_setup();
diff --git a/plat/xilinx/versal/platform.mk b/plat/xilinx/versal/platform.mk
index a0527134f..494c30df3 100644
--- a/plat/xilinx/versal/platform.mk
+++ b/plat/xilinx/versal/platform.mk
@@ -88,9 +88,11 @@ $(eval $(call add_define_val,VERSAL_CONSOLE,VERSAL_CONSOLE_ID_${VERSAL_CONSOLE})
BL31_SOURCES += drivers/arm/cci/cci.c \
lib/cpus/aarch64/cortex_a72.S \
+ common/fdt_wrappers.c \
plat/common/plat_psci_common.c \
plat/xilinx/common/ipi.c \
plat/xilinx/common/plat_fdt.c \
+ plat/xilinx/common/plat_console.c \
plat/xilinx/common/plat_startup.c \
plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c \
plat/xilinx/common/pm_service/pm_ipi.c \