From e9e19fb2fe684a740afc4820b3ee4cc38ad67d70 Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Tue, 17 Dec 2019 11:49:00 -0800 Subject: [PATCH 1/2] Tegra: per-CPU GIC CPU interface init This patch enables per-CPU GIC CPU interfaces during CPU power on. The previous code initialized the distributor for all CPUs, which was not required. Signed-off-by: Varun Wadekar Change-Id: Ifd957b2367da06405b4c3e2225411adbaec35bb8 --- plat/nvidia/tegra/common/tegra_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/nvidia/tegra/common/tegra_pm.c b/plat/nvidia/tegra/common/tegra_pm.c index a8c70eaa5..39dc42c5b 100644 --- a/plat/nvidia/tegra/common/tegra_pm.c +++ b/plat/nvidia/tegra/common/tegra_pm.c @@ -244,7 +244,7 @@ void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state) /* * Initialize the GIC cpu and distributor interfaces */ - tegra_gic_init(); + tegra_gic_pcpu_init(); /* * Check if we are exiting from deep sleep. From 2783205da9a50b41eeb4dbd721e992457bb2151d Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Tue, 17 Dec 2019 21:23:24 -0800 Subject: [PATCH 2/2] Tegra: prepare boot parameters for Trusty This patch saves the boot parameters provided by the previous bootloader during cold boot and passes them to Trusty. Commit 06ff251ec introduced the plat_trusty_set_boot_args() handler, but did not consider the boot parameters passed by the previous bootloader. This patch fixes that anomaly. Change-Id: Ib40dcd02b67c94cea5cefce09edb0be4a998db37 Signed-off-by: Varun Wadekar --- plat/nvidia/tegra/common/tegra_bl31_setup.c | 28 +++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/plat/nvidia/tegra/common/tegra_bl31_setup.c b/plat/nvidia/tegra/common/tegra_bl31_setup.c index a6652766f..25fd84cdc 100644 --- a/plat/nvidia/tegra/common/tegra_bl31_setup.c +++ b/plat/nvidia/tegra/common/tegra_bl31_setup.c @@ -54,8 +54,9 @@ static entry_point_info_t bl33_image_ep_info, bl32_image_ep_info; static plat_params_from_bl2_t plat_bl31_params_from_bl2 = { .tzdram_size = TZDRAM_SIZE }; -static unsigned long bl32_mem_size; -static unsigned long bl32_boot_params; +#ifdef SPD_trusty +static aapcs64_params_t bl32_args; +#endif /******************************************************************************* * This variable holds the non-secure image entry address @@ -155,8 +156,10 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, if (arg_from_bl2->bl32_ep_info != NULL) { bl32_image_ep_info = *arg_from_bl2->bl32_ep_info; - bl32_mem_size = arg_from_bl2->bl32_ep_info->args.arg0; - bl32_boot_params = arg_from_bl2->bl32_ep_info->args.arg2; +#ifdef SPD_trusty + /* save BL32 boot parameters */ + memcpy(&bl32_args, &arg_from_bl2->bl32_ep_info->args, sizeof(bl32_args)); +#endif } /* @@ -273,17 +276,20 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, #ifdef SPD_trusty void plat_trusty_set_boot_args(aapcs64_params_t *args) { - args->arg0 = bl32_mem_size; - args->arg1 = bl32_boot_params; - args->arg2 = TRUSTY_PARAMS_LEN_BYTES; + /* + * arg0 = TZDRAM aperture available for BL32 + * arg1 = BL32 boot params + * arg2 = EKS Blob Length + * arg3 = Boot Profiler Carveout Base + */ + args->arg0 = bl32_args.arg0; + args->arg1 = bl32_args.arg2; /* update EKS size */ - if (args->arg4 != 0U) { - args->arg2 = args->arg4; - } + args->arg2 = bl32_args.arg4; /* Profiler Carveout Base */ - args->arg3 = args->arg5; + args->arg3 = bl32_args.arg5; } #endif