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: 1290276 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.a=rsa-sha256 header.s=mail2016061301 header.b=CN2h+qqN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49NB2N5fjdz9sPF for ; Thu, 14 May 2020 22:39:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E81F081F27; Thu, 14 May 2020 14:39:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.b="CN2h+qqN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A6AB81F00; Thu, 14 May 2020 14:38:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D40D38116F for ; Thu, 14 May 2020 14:38:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from apollo.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:6257:18ff:fec4:ca34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 507D92305A; Thu, 14 May 2020 14:38:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1589459925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YNW93IZNmFzAFtwcOkmeLA7U76qQK2UMV2IkrnDAmmo=; b=CN2h+qqNkb9XWWFY8iHwUJ5YRceRXjpnSd3hBfDQ7wgslOywe5Nxxz7k4KQKvSEBOcWtni 41Lx72HnVbcm1E2+tfuvlY6DqRDDWatmRmfChKEoLEOFumxvprPlqWG6Jri8Ga7N1TS3pU T4BjxKljKqhjFK5t9/owvW6EZflQyBE= From: Michael Walle To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Alexander Graf , Michael Walle Subject: [PATCH 4/4] efi_loader: call smp_kick_all_cpus() Date: Thu, 14 May 2020 14:38:31 +0200 Message-Id: <20200514123831.30157-5-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200514123831.30157-1-michael@walle.cc> References: <20200514123831.30157-1-michael@walle.cc> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean 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();