imx9: scmi: Fix temperature range for Extended industrial parts
Subsystems (3)
PATCH 1/4 imx9: scmi: Fix temperature range for Extended industrial parts
The value '01' in MARKET_SEGMENT fuse is Extended industrial on iMX95/952/94. Fix its temperature range to -40C to 125C
01` - Ext. Industrial -40C to 125C
--- arch/arm/mach-imx/imx9/scmi/soc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-imx/imx9/scmi/soc.c +3 -2
@@ -186,8 +186,9 @@ u32 get_cpu_temp_grade(int *minc, int *maxc) *minc =-40 ; *maxc =105 ; }else if (val ==TEMP_EXTCOMMERCIAL ) { - *minc =-20 ; - *maxc =105 ; +/* Map to Ext industrial */ + *minc =-40 ; + *maxc =125 ; }else { *minc =0 ; *maxc =95 ;
Signature · 1 line
2.50.1
PATCH 2/4 imx9: scmi: Print CPU part number name
Decode the CPU part number from PART_NUM fuse and print it in CPU name.
For iMX95 and iMX952 Part number fuse is defined as:
[7:6] : Package description
[5:2] : Segment
[1:0] : Number of A55 cores
For iMX94, the PART_NUM[7:0] fuse directly reflects the part number value.
--- arch/arm/mach-imx/imx9/scmi/soc.c | 88 ++++++++++++++++++++++++++++--- drivers/cpu/imx8_cpu.c | 12 ++++- 2 files changed, 92 insertions(+), 8 deletions(-)
arch/arm/mach-imx/imx9/scmi/soc.c +81 -7
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2025 NXP +* Copyright 2025-2026 NXP * * Peng Fan <[email protected]> */
@@ -709,14 +709,88 @@ int get_reset_reason(bool sys, bool lm)return 0 ; } -const char *get_imx_type (u32 imxtype) +const char *get_cpu_variant_type_name (u32 type) { -switch (imxtype) { -case SCMI_CPU : -return IMX_PLAT_STR ; -default : -return "??" ; +u32 val, core_num, part_num; +int ret; + + ret =fuse_read (2 ,1 , &val); +if (ret) +return NULL ; + +/* Get part num */ + part_num = (val >>4 ) &0xff ; +if (!part_num) +return NULL ; + +if (type ==MXC_CPU_IMX95 || type ==MXC_CPU_IMX952 ) { +u32 segment; +static char name[8 ] ="95294" ; +char pn[2 ]; + + core_num = part_num &0x3 ; + segment = (part_num >>2 ) &0xf ; + +switch (segment) { +case 0xa : + pn[0 ] ='T' ; +break ; +case 0xb : + pn[0 ] ='V' ; +break ; +case 0xc : + pn[0 ] ='C' ; +break ; +case 0xd : + pn[0 ] ='G' ; +break ; +case 0xe : + pn[0 ] ='I' ; +break ; +case 0xf : + pn[0 ] ='N' ; +break ; +default : + pn[0 ] = segment +'0' ; +break ; + } + + pn[1 ] = core_num *2 +'0' ; + +if (type ==MXC_CPU_IMX95 ) +sprintf (name,"95%c%c" , pn[0 ], pn[1 ]); +else +sprintf (name,"952%c%c" , pn[0 ], pn[1 ]); + +return name; + }else if (type ==MXC_CPU_IMX94 ) { +static char *name ="94398" ; + + core_num =8 ; + + ret =fuse_read (2 ,2 , &val); +if (ret) +return NULL ; + +if (part_num >30 ) {/* 943 */ +/* A55 2 & 3 disabled */ +if ((val &0x18 ) ==0x18 ) + core_num =6 ; + }else if (part_num >20 ) {/* 942 */ + core_num =5 ; + +/* m7_0 disabled */ +if ((val &0x200 ) ==0x200 ) + core_num =4 ; + }else if (part_num >10 ) {/* 941 */ + core_num =5 ; + } +sprintf (name,"94%u%u" , part_num, core_num); + +return name; } + +return NULL ; }void build_info (void )
drivers/cpu/imx8_cpu.c +11 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2019, 2024 NXP +* Copyright 2019, 2024-2026 NXP */ #include <cpu.h>
@@ -28,8 +28,18 @@ struct cpu_imx_plat {u32 mpidr; }; +__weak const char *get_cpu_variant_type_name (u32 type) +{ +return NULL ; +} +static const char *get_imx_type_str (u32 imxtype) { +const char *name =get_cpu_variant_type_name (imxtype); + +if (name) +return name; +switch (imxtype) {case MXC_CPU_IMX8MM :return "8MMQ" ;/* Quad-core version of the imx8mm */
Signature · 1 line
2.50.1
PATCH 3/4 iMX9: scmi: Disable fused modules for iMX95/94/952
In reply to Ye LiDisable relevant modules in kernel FDT and u-boot FDT according to fuse settings on iMX95/94/952.
For u-boot FDT fixup, introduce a common function that each board needs this fixup could select OF_BOARD_FIXUP and implement board_fix_fdt to call imx9_uboot_fixup_by_fuse.
--- arch/arm/include/asm/arch-imx9/sys_proto.h | 1 + arch/arm/mach-imx/imx9/scmi/Makefile | 2 +- arch/arm/mach-imx/imx9/scmi/fdt.c | 644 +++++++++++++++++++++ arch/arm/mach-imx/imx9/scmi/soc.c | 12 - 4 files changed, 646 insertions(+), 13 deletions(-) create mode 100644 arch/arm/mach-imx/imx9/scmi/fdt.c
arch/arm/include/asm/arch-imx9/sys_proto.h +1 -0
@@ -22,6 +22,7 @@ int low_drive_freq_update(void *blob);enum imx9_soc_voltage_mode soc_target_voltage_mode (void );int get_reset_reason (bool sys,bool lm); +int imx9_uboot_fixup_by_fuse (void *fdt);#define is_voltage_mode (mode) (soc_target_voltage_mode() == (mode))
arch/arm/mach-imx/imx9/scmi/Makefile +1 -1
@@ -5,5 +5,5 @@ # Add include path for NXP device tree header files from Linux. ccflags-y += -I$(srctree)/dts/upstream/src/arm64/freescale/ -obj-y += soc.o +obj-y += soc.o fdt.o obj-y += clock_scmi.o clock.o
arch/arm/mach-imx/imx9/scmi/fdt.c new file +644 -0
644 lines not on this page · raw message
arch/arm/mach-imx/imx9/scmi/soc.c +0 -12
@@ -826,18 +826,6 @@ int arch_misc_init(void)return 0 ; } -#if defined(CONFIG_OF_BOARD_FIXUP ) && !defined(CONFIG_SPL_BUILD ) -int board_fix_fdt (void *fdt) -{ -return 0 ; -} -#endif - -int ft_system_setup (void *blob,struct bd_info *bd) -{ -return 0 ; -} -#if IS_ENABLED (CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG )void get_board_serial (struct tag_serialnr *serialnr) {
Signature · 1 line
2.50.1
PATCH 4/4 nxp: imx[95,94,952]_evk: Implement board_fix_fdt
In reply to Ye LiSelect the OF_BOARD_FIXUP and implement board_fix_fdt in board codes of iMX95/952/94 EVK to handle fuse setting on various part numbers.
--- arch/arm/mach-imx/imx9/Kconfig | 4 ++++ board/nxp/imx94_evk/imx94_evk.c | 10 +++++++++- board/nxp/imx952_evk/imx952_evk.c | 8 ++++++++ board/nxp/imx95_evk/imx95_evk.c | 10 +++++++++- configs/imx943_evk_defconfig | 1 - configs/imx952_evk_defconfig | 1 - 6 files changed, 30 insertions(+), 4 deletions(-)
arch/arm/mach-imx/imx9/Kconfig +4 -0
@@ -146,6 +146,7 @@ config TARGET_PHYCORE_IMX93 config TARGET_IMX95_19X19_EVK bool "imx95_19x19_evk" + select OF_BOARD_FIXUP select IMX95 imply BOOTSTD_BOOTCOMMAND imply BOOTSTD_FULL
@@ -153,6 +154,7 @@ config TARGET_IMX95_19X19_EVK config TARGET_IMX95_15X15_EVK bool "imx95_15x15_evk" + select OF_BOARD_FIXUP select IMX95 imply BOOTSTD_BOOTCOMMAND imply BOOTSTD_FULL
@@ -160,6 +162,7 @@ config TARGET_IMX95_15X15_EVK config TARGET_IMX943_EVK bool "imx943_evk" + select OF_BOARD_FIXUP select IMX94 imply BOOTSTD_BOOTCOMMAND imply BOOTSTD_FULL
@@ -176,6 +179,7 @@ config TARGET_VERDIN_IMX95 config TARGET_IMX952_EVK bool "imx952_evk" + select OF_BOARD_FIXUP select IMX_SM_CPU select IMX_SM_LMM select IMX952
board/nxp/imx94_evk/imx94_evk.c +9 -1
@@ -7,7 +7,7 @@#include <fdt_support.h> #include <asm/gpio.h> #include <asm/arch/clock.h> -#include <asm/mach-imx/sys_proto.h> +#include <asm/arch/sys_proto.h> int board_init (void ) {
@@ -26,3 +26,11 @@ int board_late_init(void)return 0 ; } + +#if IS_ENABLED (CONFIG_OF_BOARD_FIXUP ) +int board_fix_fdt (void *fdt) +{ +/* Remove nodes based on fuses. */ +return imx9_uboot_fixup_by_fuse (fdt); +} +#endif
board/nxp/imx952_evk/imx952_evk.c +8 -0
@@ -24,3 +24,11 @@ int board_late_init(void)return 0 ; } + +#if IS_ENABLED (CONFIG_OF_BOARD_FIXUP ) +int board_fix_fdt (void *fdt) +{ +/* Remove nodes based on fuses. */ +return imx9_uboot_fixup_by_fuse (fdt); +} +#endif
board/nxp/imx95_evk/imx95_evk.c +9 -1
@@ -5,7 +5,7 @@#include <asm/gpio.h> #include <asm/arch/clock.h> -#include <asm/mach-imx/sys_proto.h> +#include <asm/arch/sys_proto.h> int board_late_init (void ) {
@@ -14,3 +14,11 @@ int board_late_init(void)return 0 ; } + +#if IS_ENABLED (CONFIG_OF_BOARD_FIXUP ) +int board_fix_fdt (void *fdt) +{ +/* Remove nodes based on fuses. */ +return imx9_uboot_fixup_by_fuse (fdt); +} +#endif
configs/imx943_evk_defconfig +0 -1
@@ -26,7 +26,6 @@ CONFIG_SYS_LOAD_ADDR=0x90400000 CONFIG_SPL=y CONFIG_SPL_RECOVER_DATA_SECTION=y CONFIG_PCI=y -CONFIG_OF_BOARD_FIXUP=y CONFIG_SYS_MEMTEST_START=0x90000000 CONFIG_SYS_MEMTEST_END=0xA0000000 CONFIG_REMAKE_ELF=y
configs/imx952_evk_defconfig +0 -1
@@ -28,7 +28,6 @@ CONFIG_SPL_OF_LIBFDT_ASSUME_MASK=0x0 CONFIG_SPL=y CONFIG_SPL_RECOVER_DATA_SECTION=y CONFIG_PCI=y -CONFIG_OF_BOARD_FIXUP=y CONFIG_SYS_MEMTEST_START=0x90000000 CONFIG_SYS_MEMTEST_END=0xA0000000 CONFIG_REMAKE_ELF=y
Signature · 1 line
2.50.1
Quoted 6 lines · Ye Li
The value '01' in
MARKET_SEGMENTfuse is Extended industrial on iMX95/952/94. Fix its temperature range to -40C to 125C01` - Ext. Industrial -40C to 125C
Signed-off-by Ye Li <[email protected]>
Re: [PATCH 2/4] imx9: scmi: Print CPU part number name
In reply to Ye LiQuoted 11 lines · Ye Li
Decode the CPU part number from
PART_NUMfuse and print it in CPU name.For iMX95 and iMX952 Part number fuse is defined as:
[7:6] : Package description
[5:2] : Segment
[1:0] : Number of A55 coresFor iMX94, the PART_NUM[7:0] fuse directly reflects the part number value.
Signed-off-by Ye Li <[email protected]>
Re: [PATCH 3/4] iMX9: scmi: Disable fused modules for iMX95/94/952
In reply to Ye LiQuoted 7 lines · Ye Li
Disable relevant modules in kernel FDT and u-boot FDT according to fuse settings on iMX95/94/952.
For u-boot FDT fixup, introduce a common function that each board needs this fixup could selectOF_BOARD_FIXUPand implementboard_fix_fdtto callimx9_uboot_fixup_by_fuse.Signed-off-by Ye Li <[email protected]>
Re: [PATCH 4/4] nxp: imx[95,94,952]_evk: Implement board_fix_fdt
In reply to Ye LiQuoted 4 lines · Ye Li
Select the
OF_BOARD_FIXUPand implementboard_fix_fdtin board codes of iMX95/952/94 EVK to handle fuse setting on various part numbers.Signed-off-by Ye Li <[email protected]>
Peng Fan
AppliedQuoted 6 lines · Ye Li
The value '01' in
MARKET_SEGMENTfuse is Extended industrial on iMX95/952/94. Fix its temperature range to -40C to 125C01` - Ext. Industrial -40C to 125C
Signed-off-by Ye Li <[email protected]>
Applied to fsl-qoirq/next.
Thanks,
Peng