Skip to contentSkip to conversation

ARM: imx: Enable instruction cache early on on i.MX8M

PATCH In review Marek Vasut 2 participants 3 messages Apr 12, 2022 – Apr 13, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: imx: Enable instruction cache early on on i.MX8M

Enable instruction cache early on to speed up the boot process on i.MX8M.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>

---
V2: Protect the icache_enable with !CONFIG_IS_ENABLED(SYS_ICACHE_OFF),
the symbol might be undefined in case CONFIG_(SPL_)SYS_ICACHE_OFF is set

---
 arch/arm/mach-imx/imx8m/soc.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-imx/imx8m/soc.c +5 -0
index bb94ef51492..8171631db10 100644
@@ -550,6 +550,11 @@ EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock);
 int arch_cpu_init(void)
 {
 	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+
+#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
+	icache_enable();
+#endif
+
 	/*
 	 * ROM might disable clock for SCTR,
 	 * enable the clock before timer_init.
Signature · 1 line
2.35.1
#1 lore raw
Quoted 20 lines · Marek Vasut

Enable instruction cache early on to speed up the boot process on i.MX8M.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>

---
V2: Protect the icache_enable with !CONFIG_IS_ENABLED(SYS_ICACHE_OFF),
the symbol might be undefined in case CONFIG_(SPL_)SYS_ICACHE_OFF is set

---
  arch/arm/mach-imx/imx8m/soc.c | 5 +++++
  1 file changed, 5 insertions(+)
arch/arm/mach-imx/imx8m/soc.c +0 -0
index bb94ef51492..8171631db10 100644
@@ -550,6 +550,11 @@ EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock);
  int arch_cpu_init(void)

arch/arm/mach-imx/imx8m/soc.c EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock); · line 560

Quoted 10 lines
arch/arm/mach-imx/imx8m/soc.c +5 -0
  {
  	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+
+#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
+	icache_enable();
+#endif
+
  	/*
  	 * ROM might disable clock for SCTR,
  	 * enable the clock before timer_init.

Thanks for fast fix - I apply this before my PR.

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#2 lore raw

PATCH v2 1/1 ARM: imx: Enable instruction cache early on on i.MX8M

In reply to Marek Vasut
Quoted 5 lines

Enable instruction cache early on to speed up the boot process on i.MX8M.

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================