Skip to contentSkip to conversation

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

PATCH Superseded Marek Vasut 2 participants 2 messages Apr 3, 2022 – Apr 12, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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]>
---
 arch/arm/mach-imx/imx8m/soc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-imx/imx8m/soc.c +3 -0
index a41afc5b4f8..6fd4377f1c2 100644
@@ -514,6 +514,9 @@ int arch_cpu_init_dm(void)
 int arch_cpu_init(void)
 {
 	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+
+	icache_enable();
+
 	/*
 	 * ROM might disable clock for SCTR,
 	 * enable the clock before timer_init.
Signature · 1 line
2.35.1
#1 lore raw

Hi Marek,

Quoted 15 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]>
---
  arch/arm/mach-imx/imx8m/soc.c | 3 +++
  1 file changed, 3 insertions(+)
arch/arm/mach-imx/imx8m/soc.c +0 -0
index a41afc5b4f8..6fd4377f1c2 100644

arch/arm/mach-imx/imx8m/soc.c int arch_cpu_init_dm(void) · line 522

Quoted 9 lines
arch/arm/mach-imx/imx8m/soc.c +3 -0
@@ -514,6 +514,9 @@ int arch_cpu_init_dm(void)
  int arch_cpu_init(void)
  {
  	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+
+	icache_enable();
+
  	/*
  	 * ROM might disable clock for SCTR,
  	 * enable the clock before timer_init.

This does not seem enough because many boards do not find icache_enable, for example imx8mp_rsb3720a1_4G (but there are many others). Can you check it and repost ? Thanks !

+====================================================
+aarch64-linux-ld.bfd: arch/arm/mach-imx/imx8m/soc.o: in function `arch_cpu_init':
+arch/arm/mach-imx/imx8m/soc.c:554: undefined reference to `icache_enable' +make[2]: *** [scripts/Makefile.spl:512: spl/u-boot-spl] Error 1 +make[1]: *** [Makefile:2105: spl/u-boot-spl] Error 2
+make: *** [Makefile:177: sub-make] Error 2

Best 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]
=====================================================================