Skip to contentSkip to conversation

cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU

PATCH In review Adam Ford 2 participants 7 messages Mar 19, 2025 Arm i.MX and Layerscape

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/4 cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU

Much of the data that is display by imx8_cpu.c is also displayed from arch/arm/mach-imx/cpu.c, except the speed grade and temperature unless the SoC is an i.MX9. Expand this to include checks for IMX_THERMAL or IMX_TMU in the same way it's done for mach-imx/cpu.c.

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 +3 -1
index 53d31b3c0bf..facd561022f 100644
@@ -177,7 +177,9 @@ 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_IMX9) ||
+	    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
author
#1 lore raw

PATCH 2/4 arm64: imx: imx8mm-beacon: Enable CPU_IMX

Enable CPU_IMX to register the ARM core and identify the speed and temperature information using the driver model.

configs/imx8mm_beacon_defconfig +2 -0
index 56e18893b77..bcb60a63795 100644
@@ -84,6 +84,8 @@ CONFIG_SPL_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SPL_CLK_IMX8MM=y
 CONFIG_CLK_IMX8MM=y
+CONFIG_CPU=y
+CONFIG_CPU_IMX=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x42800000
 CONFIG_FASTBOOT_BUF_SIZE=0x20000000
Signature · 1 line
2.45.2
author
#2 lore raw

PATCH 3/4 arm64: imx: imx8mn-beacon: Enable CPU_IMX

In reply to Adam Ford

Enable CPU_IMX to register the ARM core and identify the speed and temperature information using the driver model.

configs/imx8mn_beacon_defconfig +2 -0
index 69af7cee092..93b32155aa9 100644
@@ -93,6 +93,8 @@ CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_SPL_CLK_IMX8MN=y
 CONFIG_CLK_IMX8MN=y
+CONFIG_CPU=y
+CONFIG_CPU_IMX=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x42800000
 CONFIG_FASTBOOT_BUF_SIZE=0x40000000
Signature · 1 line
2.45.2
author
#3 lore raw

PATCH 4/4 arm64: imx: imx8mp-beacon: Enable CPU_IMX

In reply to Adam Ford

Enable CPU_IMX to register the ARM core and identify the speed and temperature information using the driver model.

configs/imx8mp_beacon_defconfig +2 -0
index 9709f628f9c..2893270d0c1 100644
@@ -88,6 +88,8 @@ CONFIG_SPL_DM=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SPL_CLK_IMX8MP=y
 CONFIG_CLK_IMX8MP=y
+CONFIG_CPU=y
+CONFIG_CPU_IMX=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x42800000
 CONFIG_FASTBOOT_BUF_SIZE=0x20000000
Signature · 1 line
2.45.2
#4 lore raw
In reply to Adam Ford
Quoted 22 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 speed grade and temperature unless the SoC is an i.MX9. Expand this to include checks for IMX_THERMAL or IMX_TMU in the same way it's done for mach-imx/cpu.c.

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 +0 -0
index 53d31b3c0bf..facd561022f 100644

drivers/cpu/imx8_cpu.c static int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size) · line 182

Quoted 7 lines
drivers/cpu/imx8_cpu.c +3 -1
@@ -177,7 +177,9 @@ 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_IMX9) ||
+	    IS_ENABLED(CONFIG_IMX_THERMAL) ||
+	    IS_ENABLED(CONFIG_IMX_TMU)) {

Can CONFIG_IMX9 instead select CONFIG_IMX_THERMAL or CONFIG_IMX_TMU , so the SoC specific check could be removed from here ?

author
#5 lore raw
Quoted 27 lines · Marek Vasut
Quoted 25 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 speed grade and temperature unless the SoC is an i.MX9. Expand this to include checks for IMX_THERMAL or IMX_TMU in the same way it's done for mach-imx/cpu.c.

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 +0 -0
index 53d31b3c0bf..facd561022f 100644
@@ -177,7 +177,9 @@ 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);
 
Quoted 7 lines

drivers/cpu/imx8_cpu.c static int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size) · line 182

Quoted 4 lines
drivers/cpu/imx8_cpu.c +3 -1
-     if (IS_ENABLED(CONFIG_IMX9)) {
+     if (IS_ENABLED(CONFIG_IMX9) ||
+         IS_ENABLED(CONFIG_IMX_THERMAL) ||
+         IS_ENABLED(CONFIG_IMX_TMU)) {

Can CONFIG_IMX9 instead select CONFIG_IMX_THERMAL or CONFIG_IMX_TMU , so the SoC specific check could be removed from here ?

Any idea which of IMX_THERMAL or IMX_TMU should be selected or implied? I don't have an IMX9 to test.

adam

#6 lore raw
Quoted 36 lines · Adam Ford
Quoted 27 lines · Marek Vasut
Quoted 25 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 speed grade and temperature unless the SoC is an i.MX9. Expand this to include checks for IMX_THERMAL or IMX_TMU in the same way it's done for mach-imx/cpu.c.

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 +0 -0
index 53d31b3c0bf..facd561022f 100644
@@ -177,7 +177,9 @@ 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);
 
Quoted 7 lines

drivers/cpu/imx8_cpu.c static int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size) · line 182

Quoted 4 lines
drivers/cpu/imx8_cpu.c +3 -1
-     if (IS_ENABLED(CONFIG_IMX9)) {
+     if (IS_ENABLED(CONFIG_IMX9) ||
+         IS_ENABLED(CONFIG_IMX_THERMAL) ||
+         IS_ENABLED(CONFIG_IMX_TMU)) {

Can CONFIG_IMX9 instead select CONFIG_IMX_THERMAL or CONFIG_IMX_TMU , so the SoC specific check could be removed from here ?

Quoted 2 lines

Any idea which of IMX_THERMAL or IMX_TMU should be selected or implied? I don't have an IMX9 to test.

git grep says:

drivers/thermal/imx_tmu.c: { .compatible = "fsl,imx93-tmu", .data = FLAGS_VER4, },