From patchwork Thu May 14 12:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 245818 List-Id: U-Boot discussion From: michael at walle.cc (Michael Walle) Date: Thu, 14 May 2020 14:38:31 +0200 Subject: [PATCH 4/4] efi_loader: call smp_kick_all_cpus() In-Reply-To: <20200514123831.30157-1-michael@walle.cc> References: <20200514123831.30157-1-michael@walle.cc> Message-ID: <20200514123831.30157-5-michael@walle.cc> On some architectures, specifically the layerscape, the secondary cores wait for an interrupt before entering the spin-tables. This applies only to boards which doesn't have PSCI provided by TF-a and u-boot does the secondary cores handling. bootm/booti already call that function for ARM architecture; also add it to bootelf before switching to EL2. Additionally, provide a weak noop function so we don't have to have "#ifdef CONFIG_ARM64" guards. Signed-off-by: Michael Walle --- common/bootm.c | 9 +++++++++ lib/efi_loader/efi_setup.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/common/bootm.c b/common/bootm.c index db4362a643..65adf29329 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -816,6 +816,15 @@ void __weak switch_to_non_secure_mode(void) { } +/** + * smp_kick_all_cpus() - kick all CPUs + * + * This routine is overridden by architectures requiring this feature. + */ +void __weak smp_kick_all_cpus(void) +{ +} + #else /* USE_HOSTCC */ #if defined(CONFIG_FIT_SIGNATURE) diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 26a7423203..7e5364adc5 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -132,6 +132,12 @@ efi_status_t efi_init_obj_list(void) /* Allow unaligned memory access */ allow_unaligned(); + /* + * Some architectures need to kick secondary cores to enter their + * spin table. + */ + smp_kick_all_cpus(); + /* On ARM switch from EL3 or secure mode to EL2 or non-secure mode */ switch_to_non_secure_mode();