Skip to contentSkip to conversation

cpu: imx8_cpu: Fix CPU segment information print

PATCH In review Ye Li 2 participants 4 messages May 22 – Jun 5 Arm i.MX and Layerscape

lore
Share & tools
lore

Ye Li

author
#0 lore raw

PATCH 1/3 cpu: imx8_cpu: Fix CPU segment information print

Should not use CONFIG_IMX_TMU to determine the print of CPU market segment information. Only iMX8 platforms don't have segment fuse. And there is no extended commercial part on iMX9 (91/93/94/95), fix it to extended industrial.

---
 drivers/cpu/imx8_cpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/cpu/imx8_cpu.c +5 -2
index c6bb938e398..0da5d88efb1 100644
@@ -226,7 +226,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_IMX_TMU)) {
+	if (!IS_ENABLED(CONFIG_IMX8)) { /* imx8 does not have segment fuse */
 		switch (get_cpu_temp_grade(&minc, &maxc)) {
 		case TEMP_AUTOMOTIVE:
 			grade = "Automotive temperature grade";
@@ -235,7 +235,10 @@ static int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size)
 			grade = "Industrial temperature grade";
 			break;
 		case TEMP_EXTCOMMERCIAL:
-			grade = "Extended Consumer temperature grade";
+			if (IS_ENABLED(CONFIG_ARCH_IMX9))
+				grade = "Extended Industrial temperature grade";
+			else
+				grade = "Extended Consumer temperature grade";
 			break;
 		default:
 			grade = "Consumer temperature grade";
Signature · 1 line
2.37.1
author
#1 lore raw

PATCH 2/3 cpu: imx8_cpu: Add iMX8MP UltraLite Part cpu type

iMX8MP UltraLite part is missed in the cpu type print

---
 drivers/cpu/imx8_cpu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpu/imx8_cpu.c +2 -0
index 0da5d88efb1..87c13c33ce8 100644
@@ -73,6 +73,8 @@ static const char *get_imx_type_str(u32 imxtype)
 		return "8MP[5]";        /* Quad-core version of the imx8mp, low cost industrial & HMI */
 	case MXC_CPU_IMX8MP6:
 		return "8MP[6]";	/* Quad-core version of the imx8mp, NPU fused */
+	case MXC_CPU_IMX8MPUL:
+		return "8MP UltraLite"; /* Quad-core UltraLite version of the imx8mp */
 	case MXC_CPU_IMX8MQ:
 		return "8MQ";	/* Quad-core version of the imx8mq */
 	case MXC_CPU_IMX8MQL:
Signature · 1 line
2.37.1
author
#2 lore raw

PATCH 3/3 cpu: imx8_cpu: fix the mpidr check

In reply to Ye Li

From: Peng Fan <[email protected]>

The mpidr's type is u32, however dev_read_addr returns a value with type fdt_addr_t(phys_addr_t) which is 64bit long. So the check never fail.

This patch we still keep mpidr as u32 type, because i.MX8 only has max two cluster, the higher 32bit will always be 0. Use a variable addr to do the check, if check pass, assign the lower 32 bit to plat->mpidr.

---
 drivers/cpu/imx8_cpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/cpu/imx8_cpu.c +5 -2
index 87c13c33ce8..2bd76ffa739 100644
@@ -380,6 +380,7 @@ static int imx_cpu_probe(struct udevice *dev)
 {
 	struct cpu_imx_plat *plat = dev_get_plat(dev);
 	u32 cpurev;
+	fdt_addr_t addr;
 
 	set_core_data(dev);
 	cpurev = get_cpu_rev();
@@ -387,12 +388,14 @@ static int imx_cpu_probe(struct udevice *dev)
 	get_imx_rev_str(plat, cpurev & 0xFFF);
 	plat->type = get_imx_type_str((cpurev & 0x1FF000) >> 12);
 	plat->freq_mhz = imx_get_cpu_rate(dev) / 1000000;
-	plat->mpidr = dev_read_addr(dev);
-	if (plat->mpidr == FDT_ADDR_T_NONE) {
+	addr = dev_read_addr(dev);
+	if (addr == FDT_ADDR_T_NONE) {
 		printf("%s: Failed to get CPU reg property\n", __func__);
 		return -EINVAL;
 	}
 
+	plat->mpidr = (u32)addr;
+
 	return 0;
 }
 
Signature · 1 line
2.37.1
reviewer
#3 lore raw
In reply to Ye Li
Quoted 7 lines · Ye Li

Should not use CONFIG_IMX_TMU to determine the print of CPU market segment information. Only iMX8 platforms don't have segment fuse. And there is no extended commercial part on iMX9 (91/93/94/95), fix it to extended industrial.

Applied this one to u-boot-imx/master, thanks.

Patch 2/3 did not apply. Please rebase and resend 2/3 and 3/3.