All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joao Paulo Goncalves <jpaulo.silvagoncalves@gmail.com>
To: Andrew Davis <afd@ti.com>, Bryan Brattlof <bb@ti.com>,
	Nishanth Menon <nm@ti.com>, Suman Anna <s-anna@ti.com>
Cc: Joao Paulo Goncalves <joao.goncalves@toradex.com>,
	Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de
Subject: [RFC PATCH 1/1] arm: mach-k3: Enable icache on am625 to boot faster
Date: Thu,  9 Nov 2023 11:09:58 -0300	[thread overview]
Message-ID: <20231109140958.1093235-1-joao.goncalves@toradex.com> (raw)

Enable the am625 instruction cache on SPL and U-boot earlier for the A53
to execute code a bit faster. For normal boot flow, it was possible to
gain about 2 seconds on boot time.

Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
---
Hello all, 

We are trying to optimize boot time on our AM62 devices and on TI community
forum [1] someone advised to enable ICACHE for am625. We enabled it, tested and got 
around 2 seconds faster boot on storage media and about 5 seconds with DFU
for downloading images from A53 SPL. However, we don't know if this is the correct 
solution and want more comments on this or why the ICACHE was not enabled by TI in 
the first place.

[1] https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1217839/am625-boot-time-between-a53-spl-and-a53-u-boot

Regards,
Joao Paulo Goncalves

 arch/arm/mach-k3/am625_init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c
index 8fa36f7b91..d665d07b0b 100644
--- a/arch/arm/mach-k3/am625_init.c
+++ b/arch/arm/mach-k3/am625_init.c
@@ -210,6 +210,9 @@ void board_init_f(ulong dummy)
 			panic("DRAM init failed: %d\n", ret);
 	}
 	spl_enable_dcache();
+
+	if (!IS_ENABLED(CONFIG_CPU_V7R) && !IS_ENABLED(CONFIG_SYS_ICACHE_OFF))
+		icache_enable();
 }
 
 u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
-- 
2.34.1

             reply	other threads:[~2023-11-09 16:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 14:09 Joao Paulo Goncalves [this message]
2023-11-09 17:37 ` [RFC PATCH 1/1] arm: mach-k3: Enable icache on am625 to boot faster Nishanth Menon
2023-11-09 18:44   ` Andrew Davis
2023-11-09 18:51     ` Tom Rini
2023-11-10  8:59       ` Francesco Dolcini
2023-11-10 12:12         ` Nishanth Menon

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=20231109140958.1093235-1-joao.goncalves@toradex.com \
    --to=jpaulo.silvagoncalves@gmail.com \
    --cc=afd@ti.com \
    --cc=bb@ti.com \
    --cc=joao.goncalves@toradex.com \
    --cc=nm@ti.com \
    --cc=s-anna@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.