From 0b9f05fcaea069bff6894d99ec5babc4be29ca67 Mon Sep 17 00:00:00 2001 From: Kalyani Chidambaram Vaidyanathan Date: Mon, 24 Apr 2023 13:32:05 -0700 Subject: [PATCH] fix(tegra): remove dependency on CPU registers to get boot parameters Commit 3e14df6f6 removed the code to clear the CPU registers X0 - X3, which affected the Tegra platforms. Tegra platforms rely on the boot parameters passed through custom mechanisms and do not use these general purpose registers, but maintained sanity checks to support legacy bootloaders. These sanity checks went out of sync due to the code cleanup from bl31_entrypoint(). This patch removes the checks and calls the SOC specific handlers to retrieve the boot parameters. Change-Id: I0cf4d9c0370c33ff7715b48592b6bc0602f3c93e Signed-off-by: Kalyani Chidambaram Vaidyanathan Signed-off-by: Varun Wadekar --- plat/nvidia/tegra/common/tegra_bl31_setup.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/plat/nvidia/tegra/common/tegra_bl31_setup.c b/plat/nvidia/tegra/common/tegra_bl31_setup.c index 6a3eae0dd..050ef52d9 100644 --- a/plat/nvidia/tegra/common/tegra_bl31_setup.c +++ b/plat/nvidia/tegra/common/tegra_bl31_setup.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved. - * Copyright (c) 2020, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2020-2023, NVIDIA Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -92,21 +92,16 @@ plat_params_from_bl2_t *bl31_get_plat_params(void) void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3) { - struct tegra_bl31_params *arg_from_bl2 = (struct tegra_bl31_params *) arg0; - plat_params_from_bl2_t *plat_params = (plat_params_from_bl2_t *)arg1; + struct tegra_bl31_params *arg_from_bl2 = plat_get_bl31_params(); + plat_params_from_bl2_t *plat_params = plat_get_bl31_plat_params(); int32_t ret; /* - * For RESET_TO_BL31 systems, BL31 is the first bootloader to run so - * there's no argument to relay from a previous bootloader. Platforms - * might use custom ways to get arguments. + * Tegra platforms will receive boot parameters through custom + * mechanisms. So, we ignore the input parameters. */ - if (arg_from_bl2 == NULL) { - arg_from_bl2 = plat_get_bl31_params(); - } - if (plat_params == NULL) { - plat_params = plat_get_bl31_plat_params(); - } + (void)arg0; + (void)arg1; /* * Copy BL3-3, BL3-2 entry point information. -- 2.39.5