From 09ed710aab26073c0f066d6c06093a89b19ed338 Mon Sep 17 00:00:00 2001 From: Alexei Fedorov Date: Thu, 30 Jan 2020 14:06:28 +0000 Subject: TF-TF: Store boot parameters This patch adds support for storing fw_config and hw_config addresses passed as arg0 and arg1 parameters in x0, x1 from BL31. Signed-off-by: Alexei Fedorov Change-Id: I58ae379bb4a7ef1b6ce60a4e252c65d34dc14464 --- tftf/framework/aarch64/entrypoint.S | 26 +++++++++++++++++++++++++- tftf/framework/main.c | 4 ++++ 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'tftf') diff --git a/tftf/framework/aarch64/entrypoint.S b/tftf/framework/aarch64/entrypoint.S index 81fd207..6aa5645 100644 --- a/tftf/framework/aarch64/entrypoint.S +++ b/tftf/framework/aarch64/entrypoint.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, Arm Limited. All rights reserved. + * Copyright (c) 2018-2020, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -17,6 +17,13 @@ * ---------------------------------------------------------------------------- */ func tftf_entrypoint + /* -------------------------------------------------------------------- + * Save arguments x0, x1 from the previous Boot loader + * -------------------------------------------------------------------- + */ + mov x20, x0 + mov x21, x1 + bl arch_init /* -------------------------------------------------------------------- @@ -71,6 +78,15 @@ func tftf_entrypoint mrs x0, mpidr_el1 bl platform_set_stack + /* -------------------------------------------------------------------- + * Save fw_config and hw_config addresses passed in x0, x1 from the + * previous boot loader + * -------------------------------------------------------------------- + */ + mov x0, x20 + mov x1, x21 + bl save_fw_hw_configs + /* -------------------------------------------------------------------- * tftf_cold_boot_main() will perform the remaining architectural and * platform setup, initialise the test framework's state, then run the @@ -187,3 +203,11 @@ el1_setup: isb ret endfunc arch_init + +/* Set fw_config and hw_config addresses passed in x0, x1 */ +func save_fw_hw_configs + adrp x2, fw_config_base + str x0, [x2, :lo12:fw_config_base] + str x1, [x2, :lo12:hw_config_base] + ret +endfunc save_fw_hw_configs diff --git a/tftf/framework/main.c b/tftf/framework/main.c index a2e84b7..2523a97 100644 --- a/tftf/framework/main.c +++ b/tftf/framework/main.c @@ -41,6 +41,10 @@ static u_register_t cpu_on_ctx_id_arr[PLATFORM_CORE_COUNT]; static unsigned int test_is_rebooting; +/* Parameters arg0 and arg1 passed from BL31 */ +u_register_t fw_config_base; +u_register_t hw_config_base; + static inline const test_suite_t *current_testsuite(void) { test_ref_t test_to_run; -- cgit v1.2.3