public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sven Schwermer <sven@svenschwermer.de>
To: u-boot@lists.denx.de
Cc: Sven Schwermer <sven@svenschwermer.de>,
	Fabio Estevam <festevam@gmail.com>, Harald Seiler <hws@denx.de>,
	Jorge Ramirez-Ortiz <jorge@foundries.io>,
	"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Oleksandr Suvorov <oleksandr.suvorov@foundries.io>,
	Ricardo Salveti <ricardo@foundries.io>,
	Sean Anderson <sean.anderson@seco.com>,
	Simon Glass <sjg@chromium.org>, Stefano Babic <sbabic@denx.de>,
	Wolfgang Denk <wd@denx.de>, Ye Li <ye.li@nxp.com>
Subject: [PATCH v2] imx: Enable ACTLR.SMP in SPL for i.MX6/7
Date: Sun,  2 Jan 2022 20:36:56 +0100	[thread overview]
Message-ID: <20220102193656.102407-1-sven@svenschwermer.de> (raw)

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 <sven@svenschwermer.de>
---

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 <asm/io.h>
 #include <asm/mach-imx/sys_proto.h>
 
-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 <asm/mach-imx/rdc-sema.h>
 #include <asm/arch/imx-rdc.h>
 #include <asm/mach-imx/boot_mode.h>
+#include <asm/mach-imx/sys_proto.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/bootm.h>
 #include <dm.h>
@@ -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 <asm/arch/sys_proto.h>
 #include <asm/mach-imx/boot_mode.h>
 #include <asm/mach-imx/hab.h>
+#include <asm/mach-imx/sys_proto.h>
 #include <asm/setup.h>
 #include <linux/bitops.h>
 
@@ -77,6 +78,7 @@ enum bt_mode get_boot_mode(void)
 
 int arch_cpu_init(void)
 {
+	enable_ca7_smp();
 	return 0;
 }
 
-- 
2.34.1


             reply	other threads:[~2022-01-02 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 19:36 Sven Schwermer [this message]
2022-01-03 11:45 ` [PATCH v2] imx: Enable ACTLR.SMP in SPL for i.MX6/7 Fabio Estevam
2022-02-05 16:42 ` sbabic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220102193656.102407-1-sven@svenschwermer.de \
    --to=sven@svenschwermer.de \
    --cc=festevam@gmail.com \
    --cc=hws@denx.de \
    --cc=jorge@foundries.io \
    --cc=oleksandr.suvorov@foundries.io \
    --cc=ricardo@foundries.io \
    --cc=sbabic@denx.de \
    --cc=sean.anderson@seco.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=wd@denx.de \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox