Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40179C433EF for ; Sun, 2 Jan 2022 19:38:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CCDD582FB5; Sun, 2 Jan 2022 20:38:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=svenschwermer.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=svenschwermer.de header.i=@svenschwermer.de header.b="Lmq3Xp4W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D5B682F5E; Sun, 2 Jan 2022 20:38:31 +0100 (CET) Received: from mail.schwermer.no (mail.schwermer.no [49.12.228.226]) (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 5BC8E82FB5 for ; Sun, 2 Jan 2022 20:38:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=svenschwermer.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sven@svenschwermer.de From: Sven Schwermer DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=svenschwermer.de; s=mail; t=1641152307; bh=VDn8dV18X2gNQ+i+HjzlrlwsiAje2EK7bVdDe9KsGnI=; h=From:To:Cc:Subject; b=Lmq3Xp4WXRuEnqh89A+gBdozVAEfVsmD9ekiWoRdA+lYA4p+rbdU2LZ74fVxE0bQF OqauRuA/f8opipDNNFeZH0z103Mle3QZaXhAO44QsE+PCGgz5Sb/kUbHaHp89OoTWO +OmY3w6RbPJtlAcqDuDt6r0L7vprZv3Fni7/26DDHqVzKOu1llu3H15HZI42QSgM9Y 8iURzYFAE/H1PwssVYR3f+02jqhsFCUmuBEEJcn69Ff03TYWEzTtJlDH8AMMxc3XVL Tzc/yF3iuKQzdZku+23+70iX1aiHDc3i+aaTqcklouXPOhhZJ2+kAnTomnNv6LJiQV e+Sq1Bsh/nviQ== To: u-boot@lists.denx.de Cc: Sven Schwermer , Fabio Estevam , Harald Seiler , Jorge Ramirez-Ortiz , "NXP i.MX U-Boot Team" , Oleksandr Suvorov , Ricardo Salveti , Sean Anderson , Simon Glass , Stefano Babic , Wolfgang Denk , Ye Li Subject: [PATCH v2] imx: Enable ACTLR.SMP in SPL for i.MX6/7 Date: Sun, 2 Jan 2022 20:36:56 +0100 Message-Id: <20220102193656.102407-1-sven@svenschwermer.de> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.103.2 at phobos.denx.de X-Virus-Status: Clean Similar to what has been done before with c5437e5b for u-boot proper, we enable the SMP bit for SPL as well. This is necessary when SDP booting straight into Linux, i.e. falcon boot. When SDP boot mode is active, the ROM code does not set this bit which makes the caches not work once activated in Linux. On an i.MX6ULL (528MHz), this reduces a minimal kernel's boot time into an initramfs shell from ~6.1s down to ~1.2s. Signed-off-by: Sven Schwermer --- Changes in v2: - Apply fix for i.MX7(ULP) as well - Document quantitive improvement in boot time arch/arm/include/asm/mach-imx/sys_proto.h | 5 +++++ arch/arm/mach-imx/cache.c | 2 +- arch/arm/mach-imx/mx6/soc.c | 3 +++ arch/arm/mach-imx/mx7/soc.c | 3 +++ arch/arm/mach-imx/mx7ulp/soc.c | 2 ++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 444834995e..3f66d225c8 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -236,4 +236,9 @@ unsigned long call_imx_sip_ret2(unsigned long id, unsigned long reg0, unsigned long reg3); void imx_get_mac_from_fuse(int dev_id, unsigned char *mac); + +#if defined(CONFIG_MX6) || defined(CONFIG_MX7) || defined(CONFIG_MX7ULP) +void enable_ca7_smp(void); +#endif + #endif diff --git a/arch/arm/mach-imx/cache.c b/arch/arm/mach-imx/cache.c index 4e3b49a3fd..ab9b621a2a 100644 --- a/arch/arm/mach-imx/cache.c +++ b/arch/arm/mach-imx/cache.c @@ -11,7 +11,7 @@ #include #include -static void enable_ca7_smp(void) +void enable_ca7_smp(void) { u32 val; diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c index aacfc854a2..41f1a6e64e 100644 --- a/arch/arm/mach-imx/mx6/soc.c +++ b/arch/arm/mach-imx/mx6/soc.c @@ -487,6 +487,9 @@ int arch_cpu_init(void) if (is_mx6dqp()) noc_setup(); #endif + + enable_ca7_smp(); + return 0; } diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index 21690072e1..f6aec5a3aa 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -323,6 +324,8 @@ int arch_cpu_init(void) imx_gpcv2_init(); + enable_ca7_smp(); + return 0; } #else diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c index c90ce22404..bc41cbc687 100644 --- a/arch/arm/mach-imx/mx7ulp/soc.c +++ b/arch/arm/mach-imx/mx7ulp/soc.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -77,6 +78,7 @@ enum bt_mode get_boot_mode(void) int arch_cpu_init(void) { + enable_ca7_smp(); return 0; } -- 2.34.1