Migrate IMX8, IMX8M and IMX9 to use imx8_cpu
Subsystems (3)
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
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
@@ -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
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 ifCONFIG_IMX9is defined. This behavior is similar to what happensarch/arm/mach-imx/cpu.cexcept that the latter checks forCONFIG_IMX_THERMALorCONFIG_IMX_TMU.
In preparation to makeimx8_cpuact like the previous implementation for any CPU, make IMX9 implyIMX_TMU, so it will be always displayed unless a user decides to disable it.Signed-off-by Adam Ford <[email protected]>
PATCH v3 2/6 imx: imx8m: Imply IMX_TMU
In reply to Adam FordIf 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
@@ -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
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 ifCONFIG_IMX9is defined. This behavior is similar to what happensmach-imx/cpu.c, except that the latter checks forIMX_THERMALorIMX_TMU.In preparation to make
imx8_cpuact like the previous implementation for any CPU, make IMX8M implyIMX_TMUso it will be always displayed unless a user decides to disable it.Signed-off-by Adam Ford <[email protected]>
PATCH v3 3/6 cpu: imx8_cpu: Print Speed grade if IMX_THERMAL or IMX_TMU
In reply to Adam FordMuch 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
@@ -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
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.cis also displayed fromarch/arm/mach-imx/cpu.c, except the temperature grade and active temperature are only displayed when SoC is an i.MX9. Since IMX9 now impliesIMX_TMU, change this to check forIMX_THERMALorIMX_TMUin the same way it's done inmach-imx/cpu.cto 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 kitAfter:
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.
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.cis also displayed fromarch/arm/mach-imx/cpu.c, except the temperature grade and active temperature are only displayed when SoC is an i.MX9. Since IMX9 now impliesIMX_TMU, change this to check forIMX_THERMALorIMX_TMUin the same way it's done inmach-imx/cpu.cto 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 kitAfter:
CPU: NXP i.MX8MP Rev1.1 A53 at 1200 MHz CPU: Industrial temperature grade (-40C to 105C) at 28CThere 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
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.cis also displayed fromarch/arm/mach-imx/cpu.c, except the temperature grade and active temperature are only displayed when SoC is an i.MX9. Since IMX9 now impliesIMX_TMU, change this to check forIMX_THERMALorIMX_TMUin the same way it's done inmach-imx/cpu.cto 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 kitAfter:
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 !
PATCH v3 4/6 imx: imx8m: Imply CPU_IMX by default
In reply to Adam FordThe 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
@@ -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
Re: [PATCH V3 4/6] imx: imx8m: Imply CPU_IMX by default
Quoted 15 lines · Adam Ford
The
imx8_cpudriver is a CPU Driver that supports the i.MX8M family, and when it is enabled, it acts as an alternative toarch/arm/mach-imx/cpu.c, but theimx8_cpusupports the driver model wherecpu.cdoes not. Imply this newer driver by default.Signed-off-by Adam Ford <[email protected]>--- arch/arm/mach-imx/imx8m/Kconfig | 2 ++ 1 file changed, 2 insertions(+)arch/arm/mach-imx/imx8m/Kconfig +0
-0
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 .
PATCH v3 5/6 imx: imx8: Imply CPU_IMX by default
In reply to Adam FordThe 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
@@ -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
Re: [PATCH V3 5/6] imx: imx8: Imply CPU_IMX by default
Quoted 15 lines · Adam Ford
The
imx8_cpudriver is a CPU Driver that supports the i.MX8Q family. When it is enabled, it acts as an alternative toarch/arm/mach-imx/cpu.c, but theimx8_cpusupports the driver model wherecpu.cdoes not. Imply this newer driver by default.Signed-off-by Adam Ford <[email protected]>--- arch/arm/mach-imx/imx8/Kconfig | 2 ++ 1 file changed, 2 insertions(+)arch/arm/mach-imx/imx8/Kconfig +0
-0
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 ?
Re: [PATCH V3 5/6] imx: imx8: Imply CPU_IMX by default
Quoted 12 lines · Marek Vasut
Quoted 10 lines · Adam Ford
The
imx8_cpudriver is a CPU Driver that supports the i.MX8Q family. When it is enabled, it acts as an alternative toarch/arm/mach-imx/cpu.c, but theimx8_cpusupports the driver model wherecpu.cdoes not. Imply this newer driver by default.Signed-off-by Adam Ford <[email protected]>--- 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@@ -9,6 +9,8 @@ config AHAB_BOOT config IMX8 bool select HAS_CAAM + imply CPU + imply CPU_IMXShouldn't
CPU_IMXselect 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
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_cpudriver is a CPU Driver that supports the i.MX8Q family. When it is enabled, it acts as an alternative toarch/arm/mach-imx/cpu.c, but theimx8_cpusupports the driver model wherecpu.cdoes not. Imply this newer driver by default.Signed-off-by Adam Ford <[email protected]>--- 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@@ -9,6 +9,8 @@ config AHAB_BOOT config IMX8 bool select HAS_CAAM + imply CPU + imply CPU_IMXShouldn't
CPU_IMXselect CPU ?
Quoted 3 lines
It does not currently. Right now, it depends on CPU being set. There is another
Kconfigoption forCPU_ARMV8that also depends on CPU, and I would prefer not to change both of them.
Hum, OK, thanks for clarifying.
PATCH v3 6/6 imx: imx9: Imply CPU_IMX by default
In reply to Adam FordThe 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
@@ -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
Re: [PATCH V3 6/6] imx: imx9: Imply CPU_IMX by default
Quoted 15 lines · Adam Ford
The
imx8_cpudriver is a CPU Driver that supports the i.MX9 family. When it is enabled, it acts as an alternative toarch/arm/mach-imx/cpu.c, but theimx8_cpusupports the driver model wherecpu.cdoes not. Imply this newer driver by default.Signed-off-by Adam Ford <[email protected]>--- arch/arm/mach-imx/imx9/Kconfig | 2 ++ 1 file changed, 2 insertions(+)arch/arm/mach-imx/imx9/Kconfig +0
-0
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.