Skip to contentSkip to conversation

Migrate IMX8, IMX8M and IMX9 to use imx8_cpu

PATCH Superseded Adam Ford 2 participants 17 messages Mar 22, 2025 – Mar 23, 2025

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

v3 cover Migrate IMX8, IMX8M and IMX9 to use imx8_cpu

The imx8_cpu driver uses the driver model to represent the processor cores in the dm tree as well as display the processor type and speed on boot. Currently, the imx8_cpu driver only displays the temperature grade of the processor if the processor is IMX9, so in order to display that info, the check in imx8_cpu is changed to check for IMX_TMU and IMX_TMU is implied for IMX8, IMX8M and IMX9 SoC familes. If users want to fall back to the older method to display the SoC type or remove the temperature grade information, they can. Doing this at the SoC family level reduces the number of duplicated config options for each board, and was done at the request of the IMX U-Boot custodian.

Any testing on an i.MX8Q or i.MX9 would be appreciated as I don't have a board that runs either of these platforms.

V3: Added the imply IMX_TMU for the 8M family and added the imply for
CPU and CPU_IMX to IMX8, IMX8M and IMX9 families

V2: Changed the check in imx8_cpu to drop the IMX9 check and instead
imply IMX_TMU in the IMX9 family

Adam Ford (6):
imx: imx9: Imply IMX_TMU
imx: imx8m: Imply IMX_TMU
cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU
imx: imx8m: Imply CPU_IMX by default
imx: imx8: Imply CPU_IMX by default
imx: imx9: Imply CPU_IMX by default

 arch/arm/mach-imx/imx8/Kconfig  | 2 ++
 arch/arm/mach-imx/imx8m/Kconfig | 4 ++++
 arch/arm/mach-imx/imx9/Kconfig  | 3 +++
 drivers/cpu/imx8_cpu.c          | 2 +-
 4 files changed, 10 insertions(+), 1 deletion(-)
Signature · 1 line
2.45.2
author
#1 lore raw

PATCH v3 1/6 imx: imx9: Imply IMX_TMU

If the CPU Information is displayed from imx8_cpu, it displays the cpu temperature grade and operating temperature if CONFIG_IMX9 is defined. This behavior is similar to what happens arch/arm/mach-imx/cpu.c except that the latter checks for CONFIG_IMX_THERMAL or CONFIG_IMX_TMU.
In preparation to make imx8_cpu act like the previous implementation for any CPU, make IMX9 imply IMX_TMU, so it will be always displayed unless a user decides to disable it.

---
 arch/arm/mach-imx/imx9/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-imx/imx9/Kconfig +1 -0
index 49220c0955e..c3e758e103a 100644
@@ -10,6 +10,7 @@ config IMX9
 	select BINMAN
 	select HAS_CAAM
 	select ROM_UNIFIED_SECTIONS
+	imply IMX_TMU
 
 config IMX93
 	bool
Signature · 1 line
2.45.2
Reviewed-by on v3 1/6
#2 lore raw

Re: [PATCH V3 1/6] imx: imx9: Imply IMX_TMU

Quoted 11 lines · Adam Ford

If the CPU Information is displayed from imx8_cpu, it displays the cpu temperature grade and operating temperature if CONFIG_IMX9 is defined. This behavior is similar to what happens arch/arm/mach-imx/cpu.c except that the latter checks for CONFIG_IMX_THERMAL or CONFIG_IMX_TMU.
In preparation to make imx8_cpu act like the previous implementation for any CPU, make IMX9 imply IMX_TMU, so it will be always displayed unless a user decides to disable it.

author
#3 lore raw

PATCH v3 2/6 imx: imx8m: Imply IMX_TMU

In reply to Adam Ford

If the CPU Information is displayed from imx8_cpu, it displays the cpu temperature grade and operating temperature if CONFIG_IMX9 is defined. This behavior is similar to what happens mach-imx/cpu.c, except that the latter checks for IMX_THERMAL or IMX_TMU.

In preparation to make imx8_cpu act like the previous implementation for any CPU, make IMX8M imply IMX_TMU so it will be always displayed unless a user decides to disable it.

---
 arch/arm/mach-imx/imx8m/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-imx/imx8m/Kconfig +1 -0
index 89f2b50c8a2..8ee699a343c 100644
@@ -8,6 +8,7 @@ config IMX8M
 	select LTO
 	select ROM_UNIFIED_SECTIONS
 	select ARMV8_CRYPTO
+	imply IMX_TMU
 
 config IMX8MQ
 	bool
Signature · 1 line
2.45.2
Reviewed-by on v3 2/6
#4 lore raw

Re: [PATCH V3 2/6] imx: imx8m: Imply IMX_TMU

Quoted 10 lines · Adam Ford

If the CPU Information is displayed from imx8_cpu, it displays the cpu temperature grade and operating temperature if CONFIG_IMX9 is defined. This behavior is similar to what happens mach-imx/cpu.c, except that the latter checks for IMX_THERMAL or IMX_TMU.

In preparation to make imx8_cpu act like the previous implementation for any CPU, make IMX8M imply IMX_TMU so it will be always displayed unless a user decides to disable it.

author
#5 lore raw

PATCH v3 3/6 cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU

In reply to Adam Ford

Much of the data that is display by imx8_cpu.c is also displayed from arch/arm/mach-imx/cpu.c, except the temperature grade and active temperature are only displayed when SoC is an i.MX9. Since IMX9 now implies IMX_TMU, change this to check for IMX_THERMAL or IMX_TMU in the same way it's done in mach-imx/cpu.c to enable displaying this information for any SoC with either of these configs enabled.

Before:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
Model: Beacon EmbeddedWorks i.MX8MPlus Development kit

After:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
CPU:   Industrial temperature grade  (-40C to 105C) at 28C
Model: Beacon EmbeddedWorks i.MX8MPlus Development kit
---
 drivers/cpu/imx8_cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpu/imx8_cpu.c +1 -1
index 53d31b3c0bf..faa6a0704a6 100644
@@ -177,7 +177,7 @@ static int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size)
 	ret = snprintf(buf, size, "NXP i.MX%s Rev%s %s at %u MHz",
 		       plat->type, plat->rev, plat->name, plat->freq_mhz);
 
-	if (IS_ENABLED(CONFIG_IMX9)) {
+	if (IS_ENABLED(CONFIG_IMX_THERMAL) || IS_ENABLED(CONFIG_IMX_TMU)) {
 		switch (get_cpu_temp_grade(&minc, &maxc)) {
 		case TEMP_AUTOMOTIVE:
 			grade = "Automotive temperature grade ";
Signature · 1 line
2.45.2
#6 lore raw

Re: [PATCH V3 3/6] cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU

Quoted 7 lines · Adam Ford

Much of the data that is display by imx8_cpu.c is also displayed from arch/arm/mach-imx/cpu.c, except the temperature grade and active temperature are only displayed when SoC is an i.MX9. Since IMX9 now implies IMX_TMU, change this to check for IMX_THERMAL or IMX_TMU in the same way it's done in mach-imx/cpu.c to enable displaying this information for any SoC with either of these configs enabled.

Quoted 7 lines

Before:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
Model: Beacon EmbeddedWorks i.MX8MPlus Development kit

After:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
CPU:   Industrial temperature grade  (-40C to 105C) at 28C

There is an extra space after 'grade' , please fix.

author
#7 lore raw

Re: [PATCH V3 3/6] cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU

Quoted 9 lines · Marek Vasut
Quoted 7 lines · Adam Ford

Much of the data that is display by imx8_cpu.c is also displayed from arch/arm/mach-imx/cpu.c, except the temperature grade and active temperature are only displayed when SoC is an i.MX9. Since IMX9 now implies IMX_TMU, change this to check for IMX_THERMAL or IMX_TMU in the same way it's done in mach-imx/cpu.c to enable displaying this information for any SoC with either of these configs enabled.

Quoted 8 lines
Quoted 7 lines

Before:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
Model: Beacon EmbeddedWorks i.MX8MPlus Development kit

After:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
CPU:   Industrial temperature grade  (-40C to 105C) at 28C

There is an extra space after 'grade' , please fix.

No problem. Should that be its own patch, or can I roll the whitespace change with the #ifdef change? Normally, I like to keep them separate, but it seems silly to me to make a patch solely for a 1-character whitespace change.

adam

#8 lore raw

Re: [PATCH V3 3/6] cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU

Quoted 17 lines · Adam Ford
Quoted 16 lines · Marek Vasut
Quoted 14 lines · Adam Ford

Much of the data that is display by imx8_cpu.c is also displayed from arch/arm/mach-imx/cpu.c, except the temperature grade and active temperature are only displayed when SoC is an i.MX9. Since IMX9 now implies IMX_TMU, change this to check for IMX_THERMAL or IMX_TMU in the same way it's done in mach-imx/cpu.c to enable displaying this information for any SoC with either of these configs enabled.

Before:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
Model: Beacon EmbeddedWorks i.MX8MPlus Development kit

After:

CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
CPU:   Industrial temperature grade  (-40C to 105C) at 28C
Quoted 6 lines
Quoted 1 line

There is an extra space after 'grade' , please fix.

No problem. Should that be its own patch, or can I roll the whitespace change with the #ifdef change? Normally, I like to keep them separate, but it seems silly to me to make a patch solely for a 1-character whitespace change.

Either way works for me, as long as it gets fixed. Thanks !

author
#9 lore raw

PATCH v3 4/6 imx: imx8m: Imply CPU_IMX by default

In reply to Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX8M family, and when it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
 arch/arm/mach-imx/imx8m/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx8m/Kconfig +2 -0
index 8ee699a343c..988495d217a 100644
@@ -9,6 +9,8 @@ config IMX8M
 	select ROM_UNIFIED_SECTIONS
 	select ARMV8_CRYPTO
 	imply IMX_TMU
+	imply CPU
+	imply CPU_IMX
 
 config IMX8MQ
 	bool
Signature · 1 line
2.45.2
#10 lore raw

Re: [PATCH V3 4/6] imx: imx8m: Imply CPU_IMX by default

Quoted 15 lines · Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX8M family, and when it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
  arch/arm/mach-imx/imx8m/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx8m/Kconfig +0 -0
index 8ee699a343c..988495d217a 100644

arch/arm/mach-imx/imx8m/Kconfig config IMX8M · line 13

Quoted 5 lines
arch/arm/mach-imx/imx8m/Kconfig +2 -0
@@ -9,6 +9,8 @@ config IMX8M
  	select ROM_UNIFIED_SECTIONS
  	select ARMV8_CRYPTO
  	imply IMX_TMU
+	imply CPU
+	imply CPU_IMX

Keep the list sorted .

author
#11 lore raw

PATCH v3 5/6 imx: imx8: Imply CPU_IMX by default

In reply to Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX8Q family. When it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
 arch/arm/mach-imx/imx8/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx8/Kconfig +2 -0
index 9a43beda6fa..257c14e61b6 100644
@@ -9,6 +9,8 @@ config AHAB_BOOT
 config IMX8
 	bool
 	select HAS_CAAM
+	imply CPU
+	imply CPU_IMX
 
 config MU_BASE_SPL
 	hex "MU base address used in SPL"
Signature · 1 line
2.45.2
#12 lore raw

Re: [PATCH V3 5/6] imx: imx8: Imply CPU_IMX by default

Quoted 15 lines · Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX8Q family. When it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
  arch/arm/mach-imx/imx8/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx8/Kconfig +0 -0
index 9a43beda6fa..257c14e61b6 100644

arch/arm/mach-imx/imx8/Kconfig config AHAB_BOOT · line 13

Quoted 5 lines
arch/arm/mach-imx/imx8/Kconfig +2 -0
@@ -9,6 +9,8 @@ config AHAB_BOOT
  config IMX8
  	bool
  	select HAS_CAAM
+	imply CPU
+	imply CPU_IMX

Shouldn't CPU_IMX select CPU ?

author
#13 lore raw

Re: [PATCH V3 5/6] imx: imx8: Imply CPU_IMX by default

Quoted 12 lines · Marek Vasut
Quoted 10 lines · Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX8Q family. When it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
  arch/arm/mach-imx/imx8/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
Quoted 11 lines

arch/arm/mach-imx/imx8/Kconfig config AHAB_BOOT · line 13

Quoted 10 lines
arch/arm/mach-imx/imx8/Kconfig +2 -0
index 9a43beda6fa..257c14e61b6 100644
@@ -9,6 +9,8 @@ config AHAB_BOOT
  config IMX8
      bool
      select HAS_CAAM
+     imply CPU
+     imply CPU_IMX

Shouldn't CPU_IMX select CPU ?

It does not currently. Right now, it depends on CPU being set. There is another Kconfig option for CPU_ARMV8 that also depends on CPU, and I would prefer not to change both of them.

adam

#14 lore raw

Re: [PATCH V3 5/6] imx: imx8: Imply CPU_IMX by default

Quoted 25 lines · Adam Ford
Quoted 12 lines · Marek Vasut
Quoted 10 lines · Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX8Q family. When it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
   arch/arm/mach-imx/imx8/Kconfig | 2 ++
   1 file changed, 2 insertions(+)
Quoted 11 lines

arch/arm/mach-imx/imx8/Kconfig config AHAB_BOOT · line 13

Quoted 10 lines
arch/arm/mach-imx/imx8/Kconfig +2 -0
index 9a43beda6fa..257c14e61b6 100644
@@ -9,6 +9,8 @@ config AHAB_BOOT
   config IMX8
       bool
       select HAS_CAAM
+     imply CPU
+     imply CPU_IMX

Shouldn't CPU_IMX select CPU ?

Quoted 3 lines

It does not currently. Right now, it depends on CPU being set. There is another Kconfig option for CPU_ARMV8 that also depends on CPU, and I would prefer not to change both of them.

Hum, OK, thanks for clarifying.

author
#15 lore raw

PATCH v3 6/6 imx: imx9: Imply CPU_IMX by default

In reply to Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX9 family. When it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
 arch/arm/mach-imx/imx9/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx9/Kconfig +2 -0
index c3e758e103a..579432a47fa 100644
@@ -11,6 +11,8 @@ config IMX9
 	select HAS_CAAM
 	select ROM_UNIFIED_SECTIONS
 	imply IMX_TMU
+	imply CPU
+	imply CPU_IMX
 
 config IMX93
 	bool
Signature · 1 line
2.45.2
#16 lore raw

Re: [PATCH V3 6/6] imx: imx9: Imply CPU_IMX by default

Quoted 15 lines · Adam Ford

The imx8_cpu driver is a CPU Driver that supports the i.MX9 family. When it is enabled, it acts as an alternative to arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver model where cpu.c does not. Imply this newer driver by default.

---
  arch/arm/mach-imx/imx9/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx9/Kconfig +0 -0
index c3e758e103a..579432a47fa 100644

arch/arm/mach-imx/imx9/Kconfig config IMX9 · line 15

Quoted 5 lines
arch/arm/mach-imx/imx9/Kconfig +2 -0
@@ -11,6 +11,8 @@ config IMX9
  	select HAS_CAAM
  	select ROM_UNIFIED_SECTIONS
  	imply IMX_TMU
+	imply CPU
+	imply CPU_IMX

Keep the list sorted.