Skip to contentSkip to conversation

: imx: mx6: use OTP for temperature grade and freq grade

PATCH New Tim Harvey 7 participants 21 messages Apr 28, 2015 – May 11, 2015

Subsystems (3)
lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

The MX6 has OTP bits specifying the processor speed grade as well as temperature grade.

This series adds functions to return this information as well as adds the details to the CPU info displayed.

Additionally we use the temperature grade to replace the hard-coded limits in imx_thermal.c

I expect some possible discussion/debate regarding the displaying of this info, but perhaps adding the functions to obtain the info and use it for imx_thermal is beyond debate. Please let me know.

Tim Harvey (4):
imx: mx6: display max cpu frequency in print_cpuinfo()
mx6: add OTP bank1 registers
imx: mx6: add display of temperature grade of processor in
cpu_printinfo()
thermal: imx_thermal: use CPU temperature grade for trip points

 arch/arm/cpu/armv7/mx6/soc.c              | 58 +++++++++++++++++++++++++++++++
 arch/arm/imx-common/cpu.c                 | 37 +++++++++++++++++++-
 arch/arm/include/asm/arch-mx6/imx-regs.h  | 19 ++++++++++
 arch/arm/include/asm/arch-mx6/sys_proto.h |  2 ++
 arch/arm/include/asm/proc                 |  1 +
 drivers/thermal/imx_thermal.c             | 29 ++++++++++------
 include/imx_thermal.h                     |  6 ++++
 7 files changed, 141 insertions(+), 11 deletions(-)
 create mode 120000 arch/arm/include/asm/proc
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/4 imx: mx6: display max cpu frequency in print_cpuinfo()

The IMX6 has four different speed grades determined by eFUSE SPEED_GRADING (OCOTP_CFG3[17:16]).

Display this value to make it clear the difference regarding the CPU speed currently running at vs the max speed allowed per grade. Note that the power on CPU speed is determined by OCOTP_CFG4[18].

I see no indication in the IMX6SX reference manual that it has the same CPU speed grades in this OTP register.

---
 arch/arm/cpu/armv7/mx6/soc.c              | 26 ++++++++++++++++++++++++++
 arch/arm/imx-common/cpu.c                 | 17 +++++++++++++++++
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 arch/arm/include/asm/proc                 |  1 +
 4 files changed, 45 insertions(+)
 create mode 120000 arch/arm/include/asm/proc
arch/arm/cpu/armv7/mx6/soc.c +26 -0
index dd34138..dc422a6 100644
@@ -83,6 +83,32 @@ u32 get_cpu_rev(void)
 	return (type << 12) | (reg + 0x10);
 }
 
+#define OCOTP_CFG3_SPEED_SHIFT          16
+#define OCOTP_CFG3_SPEED_1P2GHZ         0x3
+#define OCOTP_CFG3_SPEED_996MHZ         0x2
+#define OCOTP_CFG3_SPEED_852MHZ         0x1
+
+u32 get_cpu_speed_grade_hz(void)
+{
+	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+	struct fuse_bank *bank = &ocotp->bank[0];
+	struct fuse_bank0_regs *fuse =
+		(struct fuse_bank0_regs *)bank->fuse_regs;
+	uint32_t val;
+
+	val = readl(&fuse->cfg3);
+	val >>= OCOTP_CFG3_SPEED_SHIFT;
+	val &= 0x3;
+
+	if (val == OCOTP_CFG3_SPEED_1P2GHZ)
+		return 1200000000;
+	if (val == OCOTP_CFG3_SPEED_996MHZ)
+		return 996000000;
+	if (val == OCOTP_CFG3_SPEED_852MHZ)
+		return 852000000;
+	return 792000000;
+}
+
 #ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
arch/arm/imx-common/cpu.c +17 -0
index 067d08f..ead7f08 100644
@@ -151,11 +151,28 @@ int print_cpuinfo(void)
 
 	cpurev = get_cpu_rev();
 
+#if defined(CONFIG_MX6)
+	printf("CPU:   Freescale i.MX%s rev%d.%d",
+		get_imx_type((cpurev & 0xFF000) >> 12),
+		(cpurev & 0x000F0) >> 4,
+		(cpurev & 0x0000F) >> 0);
+	if (is_cpu_type(MXC_CPU_MX6SX))
+		printf(" at %d MHz", mxc_get_clock(MXC_ARM_CLK) / 1000000);
+	else {
+		printf(" %d MHz", get_cpu_speed_grade_hz() / 1000000);
+		if (get_cpu_speed_grade_hz() != mxc_get_clock(MXC_ARM_CLK)) {
+			printf(" (at %d MHz)",
+			       mxc_get_clock(MXC_ARM_CLK) / 1000000);
+		}
+	}
+	puts("\n");
+#else
 	printf("CPU:   Freescale i.MX%s rev%d.%d at %d MHz\n",
 		get_imx_type((cpurev & 0xFF000) >> 12),
 		(cpurev & 0x000F0) >> 4,
 		(cpurev & 0x0000F) >> 0,
 		mxc_get_clock(MXC_ARM_CLK) / 1000000);
+#endif
 
 #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
 	ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev);
arch/arm/include/asm/arch-mx6/sys_proto.h +1 -0
index 28ba844..a2cd0a9 100644
@@ -16,6 +16,7 @@
 
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
+u32 get_cpu_speed_grade_hz(void);
 
 /* returns MXC_CPU_ value */
 #define cpu_type(rev) (((rev) >> 12)&0xff)
arch/arm/include/asm/proc new file +1 -0
new file mode 120000
index 0000000..c7f3c20
@@ -0,0 +1 @@
+proc-armv
\ No newline at end of file
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/4 imx: mx6: display max cpu frequency in print_cpuinfo()

Hello Tim,

Am 28.04.2015 um 17:44 schrieb Tim Harvey:

Quoted 10 lines

The IMX6 has four different speed grades determined by eFUSE SPEED_GRADING (OCOTP_CFG3[17:16]).

Display this value to make it clear the difference regarding the CPU speed currently running at vs the max speed allowed per grade. Note that the power on CPU speed is determined by OCOTP_CFG4[18].

I see no indication in the IMX6SX reference manual that it has the same CPU speed grades in this OTP register.

AFAIK there is no speed grading info for i.MX6 Solo / DualLight in OTP.

Quoted 100 lines
---
 arch/arm/cpu/armv7/mx6/soc.c              | 26 ++++++++++++++++++++++++++
 arch/arm/imx-common/cpu.c                 | 17 +++++++++++++++++
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 arch/arm/include/asm/proc                 |  1 +
 4 files changed, 45 insertions(+)
 create mode 120000 arch/arm/include/asm/proc
arch/arm/cpu/armv7/mx6/soc.c +26 -0
index dd34138..dc422a6 100644
@@ -83,6 +83,32 @@ u32 get_cpu_rev(void)
 	return (type << 12) | (reg + 0x10);
 }
 
+#define OCOTP_CFG3_SPEED_SHIFT          16
+#define OCOTP_CFG3_SPEED_1P2GHZ         0x3
+#define OCOTP_CFG3_SPEED_996MHZ         0x2
+#define OCOTP_CFG3_SPEED_852MHZ         0x1
+
+u32 get_cpu_speed_grade_hz(void)
+{
+	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+	struct fuse_bank *bank = &ocotp->bank[0];
+	struct fuse_bank0_regs *fuse =
+		(struct fuse_bank0_regs *)bank->fuse_regs;
+	uint32_t val;
+
+	val = readl(&fuse->cfg3);
+	val >>= OCOTP_CFG3_SPEED_SHIFT;
+	val &= 0x3;
+
+	if (val == OCOTP_CFG3_SPEED_1P2GHZ)
+		return 1200000000;
+	if (val == OCOTP_CFG3_SPEED_996MHZ)
+		return 996000000;
+	if (val == OCOTP_CFG3_SPEED_852MHZ)
+		return 852000000;
+	return 792000000;
+}
+
 #ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
arch/arm/imx-common/cpu.c +17 -0
index 067d08f..ead7f08 100644
@@ -151,11 +151,28 @@ int print_cpuinfo(void)
 
 	cpurev = get_cpu_rev();
 
+#if defined(CONFIG_MX6)
+	printf("CPU:   Freescale i.MX%s rev%d.%d",
+		get_imx_type((cpurev & 0xFF000) >> 12),
+		(cpurev & 0x000F0) >> 4,
+		(cpurev & 0x0000F) >> 0);
+	if (is_cpu_type(MXC_CPU_MX6SX))
+		printf(" at %d MHz", mxc_get_clock(MXC_ARM_CLK) / 1000000);
+	else {
+		printf(" %d MHz", get_cpu_speed_grade_hz() / 1000000);
+		if (get_cpu_speed_grade_hz() != mxc_get_clock(MXC_ARM_CLK)) {
+			printf(" (at %d MHz)",
+			       mxc_get_clock(MXC_ARM_CLK) / 1000000);
+		}
+	}
+	puts("\n");
+#else
 	printf("CPU:   Freescale i.MX%s rev%d.%d at %d MHz\n",
 		get_imx_type((cpurev & 0xFF000) >> 12),
 		(cpurev & 0x000F0) >> 4,
 		(cpurev & 0x0000F) >> 0,
 		mxc_get_clock(MXC_ARM_CLK) / 1000000);
+#endif
 
 #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
 	ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev);
arch/arm/include/asm/arch-mx6/sys_proto.h +1 -0
index 28ba844..a2cd0a9 100644
@@ -16,6 +16,7 @@
 
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
+u32 get_cpu_speed_grade_hz(void);
 
 /* returns MXC_CPU_ value */
 #define cpu_type(rev) (((rev) >> 12)&0xff)
arch/arm/include/asm/proc new file +1 -0
new file mode 120000
index 0000000..c7f3c20
@@ -0,0 +1 @@
+proc-armv
\ No newline at end of file
author
#3 lore raw

PATCH 2/4 mx6: add OTP bank1 registers

In reply to Tim Harvey
---
 arch/arm/include/asm/arch-mx6/imx-regs.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/include/asm/arch-mx6/imx-regs.h +19 -0
index 9a4ad8b..35bb005 100644
@@ -640,6 +640,25 @@ struct fuse_bank0_regs {
 	u32	rsvd7[3];
 };
 
+struct fuse_bank1_regs {
+	u32	mem0;
+	u32	rsvd0[3];
+	u32	mem1;
+	u32	rsvd1[3];
+	u32	mem2;
+	u32	rsvd2[3];
+	u32	mem3;
+	u32	rsvd3[3];
+	u32	mem4;
+	u32	rsvd4[3];
+	u32	ana0;
+	u32	rsvd5[3];
+	u32	ana1;
+	u32	rsvd6[3];
+	u32	ana2;
+	u32	rsvd7[3];
+};
+
 #ifdef CONFIG_MX6SX
 struct fuse_bank4_regs {
 	u32 sjc_resp_low;
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 3/4 imx: mx6: add display of temperature grade of processor in cpu_printinfo()

In reply to Tim Harvey

The MX6 has a temperature grade defined by OCOTP_MEM0[7:6].

While the MX6SX also has temperature grades, I see no mention in the reference manual where that information is stored in the OTP.

---
 arch/arm/cpu/armv7/mx6/soc.c              | 32 +++++++++++++++++++++++++++++++
 arch/arm/imx-common/cpu.c                 | 28 ++++++++++++++++++++++-----
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 include/imx_thermal.h                     |  6 ++++++
 4 files changed, 62 insertions(+), 5 deletions(-)
arch/arm/cpu/armv7/mx6/soc.c +32 -0
index dc422a6..8d41c47 100644
@@ -109,6 +109,38 @@ u32 get_cpu_speed_grade_hz(void)
 	return 792000000;
 }
 
+#define OCOTP_MEM0_TEMP_SHIFT          6
+
+u32 get_cpu_temp_grade(int *minc, int *maxc)
+{
+	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+	struct fuse_bank *bank = &ocotp->bank[1];
+	struct fuse_bank1_regs *fuse =
+		(struct fuse_bank1_regs *)bank->fuse_regs;
+	uint32_t val;
+
+	val = readl(&fuse->mem0);
+	val >>= OCOTP_MEM0_TEMP_SHIFT;
+	val &= 0x3;
+
+	if (minc && maxc) {
+		if (val == TEMP_AUTOMOTIVE) {
+			*minc = -40;
+			*maxc = 125;
+		} else if (val == TEMP_INDUSTRIAL) {
+			*minc = -40;
+			*maxc = 105;
+		} else if (val == TEMP_EXTCOMMERCIAL) {
+			*minc = -20;
+			*maxc = 105;
+		} else {
+			*minc = 0;
+			*maxc = 95;
+		}
+	}
+	return val;
+}
+
 #ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
arch/arm/imx-common/cpu.c +23 -5
index ead7f08..a1045db 100644
@@ -16,6 +16,7 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/crm_regs.h>
+#include <imx_thermal.h>
 #include <ipu_pixfmt.h>
 #include <thermal.h>
 #include <sata.h>
@@ -146,24 +147,41 @@ int print_cpuinfo(void)
 
 #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
 	struct udevice *thermal_dev;
-	int cpu_tmp, ret;
+	int cpu_tmp, minc, maxc, ret;
 #endif
 
 	cpurev = get_cpu_rev();
 
 #if defined(CONFIG_MX6)
 	printf("CPU:   Freescale i.MX%s rev%d.%d",
-		get_imx_type((cpurev & 0xFF000) >> 12),
-		(cpurev & 0x000F0) >> 4,
-		(cpurev & 0x0000F) >> 0);
+	       get_imx_type((cpurev & 0xFF000) >> 12),
+	       (cpurev & 0x000F0) >> 4,
+	       (cpurev & 0x0000F) >> 0);
 	if (is_cpu_type(MXC_CPU_MX6SX))
 		printf(" at %d MHz", mxc_get_clock(MXC_ARM_CLK) / 1000000);
 	else {
+#if defined(CONFIG_IMX6_THERMAL)
+		switch (get_cpu_temp_grade(&minc, &maxc)) {
+		case TEMP_AUTOMOTIVE:
+			puts(" automotive");
+			break;
+		case TEMP_INDUSTRIAL:
+			puts(" industrial");
+			break;
+		case TEMP_EXTCOMMERCIAL:
+			puts(" extended commercial");
+			break;
+		default:
+			puts(" commercial");
+			break;
+		}
+		printf(" (%dC to %dC)", minc, maxc);
 		printf(" %d MHz", get_cpu_speed_grade_hz() / 1000000);
 		if (get_cpu_speed_grade_hz() != mxc_get_clock(MXC_ARM_CLK)) {
 			printf(" (at %d MHz)",
 			       mxc_get_clock(MXC_ARM_CLK) / 1000000);
 		}
+#endif /* #if defined(CONFIG_IMX6_THERMAL) */
 	}
 	puts("\n");
 #else
@@ -172,7 +190,7 @@ int print_cpuinfo(void)
 		(cpurev & 0x000F0) >> 4,
 		(cpurev & 0x0000F) >> 0,
 		mxc_get_clock(MXC_ARM_CLK) / 1000000);
-#endif
+#endif /* #if defined(CONFIG_MX6) */
 
 #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL)
 	ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev);
arch/arm/include/asm/arch-mx6/sys_proto.h +1 -0
index a2cd0a9..c583291 100644
@@ -17,6 +17,7 @@
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
 u32 get_cpu_speed_grade_hz(void);
+u32 get_cpu_temp_grade(int *minc, int *maxc);
 
 /* returns MXC_CPU_ value */
 #define cpu_type(rev) (((rev) >> 12)&0xff)
include/imx_thermal.h +6 -0
index be13652..8ce333c 100644
@@ -8,6 +8,12 @@
 #ifndef _IMX_THERMAL_H_
 #define _IMX_THERMAL_H_
 
+/* CPU Temperature Grades */
+#define TEMP_COMMERCIAL         0
+#define TEMP_EXTCOMMERCIAL      1
+#define TEMP_INDUSTRIAL         2
+#define TEMP_AUTOMOTIVE         3
+
 struct imx_thermal_plat {
 	void *regs;
 	int fuse_bank;
Signature · 1 line
1.9.1
reviewer
#5 lore raw

PATCH 3/4 imx: mx6: add display of temperature grade of processor in cpu_printinfo()

Hi Tim,

arch/arm/imx-common/cpu.c int print_cpuinfo(void) · line 175

Quoted 13 lines · Tim Harvey
arch/arm/imx-common/cpu.c +13 -0
+#if defined(CONFIG_IMX6_THERMAL)
+               switch (get_cpu_temp_grade(&minc, &maxc)) {
+               case TEMP_AUTOMOTIVE:
+                       puts(" automotive");
+                       break;
+               case TEMP_INDUSTRIAL:
+                       puts(" industrial");
+                       break;
+               case TEMP_EXTCOMMERCIAL:
+                       puts(" extended commercial");
+                       break;
+               default:
+                       puts(" commercial");

Could you please change 'commercial' to 'consumer'?

That's the term we see in the datasheet.

I also agree with Nikolay that it would be better to split the CPU line info in two now.

Thanks,

Fabio Estevam

author
#6 lore raw

PATCH 3/4 imx: mx6: add display of temperature grade of processor in cpu_printinfo()

Quoted 20 lines · Fabio Estevam

Hi Tim,

arch/arm/imx-common/cpu.c int print_cpuinfo(void) · line 175

Quoted 13 lines · Tim Harvey
arch/arm/imx-common/cpu.c +13 -0
+#if defined(CONFIG_IMX6_THERMAL)
+               switch (get_cpu_temp_grade(&minc, &maxc)) {
+               case TEMP_AUTOMOTIVE:
+                       puts(" automotive");
+                       break;
+               case TEMP_INDUSTRIAL:
+                       puts(" industrial");
+                       break;
+               case TEMP_EXTCOMMERCIAL:
+                       puts(" extended commercial");
+                       break;
+               default:
+                       puts(" commercial");

Could you please change 'commercial' to 'consumer'?

Quoted 8 lines

That's the term we see in the datasheet.

I also agree with Nikolay that it would be better to split the CPU line info in two now.

Thanks,

Fabio Estevam

Fabio,

It looks like I convinced you in the thread regarding the similar patch to the kernel
(http://www.spinics.net/lists/arm-kernel/msg417378.html) that the verbiage should remain as is, but I will follow-up with a v2 that puts the thermal information on the line with the current temperature.

Tim

reviewer
#7 lore raw

PATCH 3/4 imx: mx6: add display of temperature grade of processor in cpu_printinfo()

Quoted 7 lines · Tim Harvey

Fabio,

It looks like I convinced you in the thread regarding the similar patch to the kernel
(http://www.spinics.net/lists/arm-kernel/msg417378.html) that the verbiage should remain as is, but I will follow-up with a v2 that puts the thermal information on the line with the current temperature.

Thanks, Tim

author
#8 lore raw

PATCH 4/4 thermal: imx_thermal: use CPU temperature grade for trip points

In reply to Tim Harvey

Replace the hard-coded values for min/max/passive with values derived from the CPU temperature grade.

---
 drivers/thermal/imx_thermal.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)
drivers/thermal/imx_thermal.c +19 -10
index 0bd9cfd..b5dab63 100644
@@ -12,15 +12,13 @@
 #include <fuse.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/sys_proto.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
 #include <thermal.h>
 #include <imx_thermal.h>
 
-#define TEMPERATURE_MIN		-40
-#define TEMPERATURE_HOT		80
-#define TEMPERATURE_MAX		125
 #define FACTOR0			10000000
 #define FACTOR1			15976
 #define FACTOR2			4297157
@@ -34,14 +32,21 @@
 #define MISC0_REFTOP_SELBIASOFF		(1 << 3)
 #define TEMPSENSE1_MEASURE_FREQ		0xffff
 
+struct thermal_data {
+	unsigned int fuse;
+	int passive;
+	int minc;
+	int maxc;
+};
+
 static int read_cpu_temperature(struct udevice *dev)
 {
 	int temperature;
 	unsigned int reg, n_meas;
 	const struct imx_thermal_plat *pdata = dev_get_platdata(dev);
 	struct anatop_regs *anatop = (struct anatop_regs *)pdata->regs;
-	unsigned int *priv = dev_get_priv(dev);
-	u32 fuse = *priv;
+	struct thermal_data *priv = dev_get_priv(dev);
+	u32 fuse = priv->fuse;
 	int t1, n1;
 	u32 c1, c2;
 	u64 temp64;
@@ -119,11 +124,12 @@ static int read_cpu_temperature(struct udevice *dev)
 
 int imx_thermal_get_temp(struct udevice *dev, int *temp)
 {
+	struct thermal_data *priv = dev_get_priv(dev);
 	int cpu_tmp = 0;
 
 	cpu_tmp = read_cpu_temperature(dev);
-	while (cpu_tmp > TEMPERATURE_MIN && cpu_tmp < TEMPERATURE_MAX) {
-		if (cpu_tmp >= TEMPERATURE_HOT) {
+	while (cpu_tmp > priv->minc && cpu_tmp < priv->maxc) {
+		if (cpu_tmp >= priv->passive) {
 			printf("CPU Temperature is %d C, too hot to boot, waiting...\n",
 			       cpu_tmp);
 			udelay(5000000);
@@ -147,7 +153,7 @@ static int imx_thermal_probe(struct udevice *dev)
 	unsigned int fuse = ~0;
 
 	const struct imx_thermal_plat *pdata = dev_get_platdata(dev);
-	unsigned int *priv = dev_get_priv(dev);
+	struct thermal_data *priv = dev_get_priv(dev);
 
 	/* Read Temperature calibration data fuse */
 	fuse_read(pdata->fuse_bank, pdata->fuse_word, &fuse);
@@ -158,7 +164,10 @@ static int imx_thermal_probe(struct udevice *dev)
 		return -EPERM;
 	}
 
-	*priv = fuse;
+	/* set passive cooling temp to max - 20C */
+	get_cpu_temp_grade(&priv->minc, &priv->maxc);
+	priv->passive = priv->maxc - 20;
+	priv->fuse = fuse;
 
 	enable_thermal_clk();
 
@@ -170,6 +179,6 @@ U_BOOT_DRIVER(imx_thermal) = {
 	.id	= UCLASS_THERMAL,
 	.ops	= &imx_thermal_ops,
 	.probe	= imx_thermal_probe,
-	.priv_auto_alloc_size = sizeof(unsigned int),
+	.priv_auto_alloc_size = sizeof(struct thermal_data),
 	.flags  = DM_FLAG_PRE_RELOC,
 };
Signature · 1 line
1.9.1
#9 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

In reply to Tim Harvey

Hi Tim,

Quoted 6 lines · Tim Harvey

The MX6 has OTP bits specifying the processor speed grade as well as temperature grade.

This series adds functions to return this information as well as adds the details to the CPU info displayed.

Quoted 6 lines

Additionally we use the temperature grade to replace the hard-coded limits in imx_thermal.c

I expect some possible discussion/debate regarding the displaying of this info, but perhaps adding the functions to obtain the info and use it for imx_thermal is beyond debate. Please let me know.

Could you please send (or include in the commit text) an example, how these infos are displayed now in the bootup log? Best in comparison to the "old" log. To see the output change resulting from the patchset.

Thanks,
Stefan

author
#10 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Quoted 20 lines · Stefan Roese

Hi Tim,

Quoted 7 lines · Tim Harvey

The MX6 has OTP bits specifying the processor speed grade as well as temperature grade.

This series adds functions to return this information as well as adds the details to the CPU info displayed.

Quoted 8 lines

Additionally we use the temperature grade to replace the hard-coded limits in imx_thermal.c

I expect some possible discussion/debate regarding the displaying of this info,
but perhaps adding the functions to obtain the info and use it for imx_thermal
is beyond debate. Please let me know.

Quoted 7 lines

Could you please send (or include in the commit text) an example, how these infos are displayed now in the bootup log? Best in comparison to the "old" log. To see the output change resulting from the patchset.

Thanks,
Stefan

Stefan,

Good point - as I am guessing there will be debate about the 'amount' of info displayed and am open to suggestions on how to word it and/or how to enable it. In future revs of the patchset I'll be more explicit in the commit logs, but for now with the series applied I get this:

IMX6Q automotive (1GHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
- after Patch 1/4:
CPU: Freescale i.MX6Q rev1.2 996 MHz (at 792 MHz)
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6Q rev1.2 automotive (-40C to 125C) 996 MHz (at 792 MHz)

IMX6S industrial (800MHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6SOLO rev1.2 at 792 MHz
- after Patch 1/4: (max speed == cur speed)
CPU: Freescale i.MX6SOLO rev1.2 792 MHz
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6SOLO rev1.2 industrial (-40C to 105C) 792 MHz

When I submit the next version I will split out adding the functions to get speed-grade and temperature-grade from using those functions in cpu_printinfo() as well as some may not be happy with adding more info to cpu_printinfo() but may find value in setting the thermal limits of imx_thermal properly based on temp-grade (Patch 4/4).

Tim

author
#11 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Quoted 52 lines · Tim Harvey
Quoted 20 lines · Stefan Roese

Hi Tim,

Quoted 7 lines · Tim Harvey

The MX6 has OTP bits specifying the processor speed grade as well as temperature grade.

This series adds functions to return this information as well as adds the details to the CPU info displayed.

Quoted 8 lines

Additionally we use the temperature grade to replace the hard-coded limits in imx_thermal.c

I expect some possible discussion/debate regarding the displaying of this info,
but perhaps adding the functions to obtain the info and use it for imx_thermal
is beyond debate. Please let me know.

Quoted 7 lines

Could you please send (or include in the commit text) an example, how these infos are displayed now in the bootup log? Best in comparison to the "old" log. To see the output change resulting from the patchset.

Thanks,
Stefan

Stefan,

Good point - as I am guessing there will be debate about the 'amount' of info displayed and am open to suggestions on how to word it and/or how to enable it. In future revs of the patchset I'll be more explicit in the commit logs, but for now with the series applied I get this:

IMX6Q automotive (1GHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
- after Patch 1/4:
CPU: Freescale i.MX6Q rev1.2 996 MHz (at 792 MHz)
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6Q rev1.2 automotive (-40C to 125C) 996 MHz (at 792 MHz)

IMX6S industrial (800MHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6SOLO rev1.2 at 792 MHz
- after Patch 1/4: (max speed == cur speed)
CPU: Freescale i.MX6SOLO rev1.2 792 MHz
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6SOLO rev1.2 industrial (-40C to 105C) 792 MHz

Quoted 7 lines

When I submit the next version I will split out adding the functions to get speed-grade and temperature-grade from using those functions in cpu_printinfo() as well as some may not be happy with adding more info to cpu_printinfo() but may find value in setting the thermal limits of imx_thermal properly based on temp-grade (Patch 4/4).

Tim

Stefano,

I've cc'd all the maintainers I could find of MX6 based boards for comment on adding this text to the mx6 print_cpuinfo. I would like to see some ack/review from them otherwise I would think silence is considered a thumbs up ;)

Regards,

Tim

#12 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Quoted 59 lines · Tim Harvey
Quoted 58 lines · Tim Harvey
Quoted 20 lines · Stefan Roese

Hi Tim,

Quoted 7 lines · Tim Harvey

The MX6 has OTP bits specifying the processor speed grade as well as temperature grade.

This series adds functions to return this information as well as adds the details to the CPU info displayed.

Quoted 8 lines

Additionally we use the temperature grade to replace the hard-coded limits in imx_thermal.c

I expect some possible discussion/debate regarding the displaying of this info,
but perhaps adding the functions to obtain the info and use it for imx_thermal
is beyond debate. Please let me know.

Quoted 7 lines

Could you please send (or include in the commit text) an example, how these infos are displayed now in the bootup log? Best in comparison to the "old" log. To see the output change resulting from the patchset.

Thanks,
Stefan

Stefan,

Good point - as I am guessing there will be debate about the 'amount' of info displayed and am open to suggestions on how to word it and/or how to enable it. In future revs of the patchset I'll be more explicit in the commit logs, but for now with the series applied I get this:

IMX6Q automotive (1GHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
- after Patch 1/4:
CPU: Freescale i.MX6Q rev1.2 996 MHz (at 792 MHz)
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6Q rev1.2 automotive (-40C to 125C) 996 MHz (at 792 MHz)

IMX6S industrial (800MHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6SOLO rev1.2 at 792 MHz
- after Patch 1/4: (max speed == cur speed)
CPU: Freescale i.MX6SOLO rev1.2 792 MHz
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6SOLO rev1.2 industrial (-40C to 105C) 792 MHz

When I submit the next version I will split out adding the functions to get speed-grade and temperature-grade from using those functions in cpu_printinfo() as well as some may not be happy with adding more info to cpu_printinfo() but may find value in setting the thermal limits of imx_thermal properly based on temp-grade (Patch 4/4).

Quoted 8 lines
Quoted 1 line

Tim

Stefano,

I've cc'd all the maintainers I could find of MX6 based boards for comment on adding this text to the mx6 print_cpuinfo. I would like to see some ack/review from them otherwise I would think silence is considered a thumbs up ;)

Yep. ;)

Thanks,
Stefan

#13 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

In reply to Tim Harvey

Hi Tim,

Quoted 6 lines · Tim Harvey

Stefano,

I've cc'd all the maintainers I could find of MX6 based boards for comment on adding this text to the mx6 print_cpuinfo. I would like to see some ack/review from them otherwise I would think silence is considered a thumbs up ;)

Yes, agree :-)

From my side:

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#14 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

In reply to Tim Harvey

2015-05-07 17:55 GMT+02:00 Tim Harvey <[email protected]>:

Quoted 59 lines · Tim Harvey
Quoted 58 lines · Stefan Roese
Quoted 20 lines

Hi Tim,

Quoted 7 lines · Tim Harvey

The MX6 has OTP bits specifying the processor speed grade as well as temperature grade.

This series adds functions to return this information as well as adds the details to the CPU info displayed.

Quoted 8 lines

Additionally we use the temperature grade to replace the hard-coded limits in imx_thermal.c

I expect some possible discussion/debate regarding the displaying of this info,
but perhaps adding the functions to obtain the info and use it for imx_thermal
is beyond debate. Please let me know.

Quoted 7 lines

Could you please send (or include in the commit text) an example, how these infos are displayed now in the bootup log? Best in comparison to the "old" log. To see the output change resulting from the patchset.

Thanks,
Stefan

Stefan,

Good point - as I am guessing there will be debate about the 'amount' of info displayed and am open to suggestions on how to word it and/or how to enable it. In future revs of the patchset I'll be more explicit in the commit logs, but for now with the series applied I get this:

IMX6Q automotive (1GHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
- after Patch 1/4:
CPU: Freescale i.MX6Q rev1.2 996 MHz (at 792 MHz)
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6Q rev1.2 automotive (-40C to 125C) 996 MHz (at 792 MHz)

IMX6S industrial (800MHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6SOLO rev1.2 at 792 MHz
- after Patch 1/4: (max speed == cur speed)
CPU: Freescale i.MX6SOLO rev1.2 792 MHz
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6SOLO rev1.2 industrial (-40C to 105C) 792 MHz

When I submit the next version I will split out adding the functions to get speed-grade and temperature-grade from using those functions in cpu_printinfo() as well as some may not be happy with adding more info to cpu_printinfo() but may find value in setting the thermal limits of imx_thermal properly based on temp-grade (Patch 4/4).

Quoted 9 lines
Quoted 1 line

Tim

Stefano,

I've cc'd all the maintainers I could find of MX6 based boards for comment on adding this text to the mx6 print_cpuinfo. I would like to see some ack/review from them otherwise I would think silence is considered a thumbs up ;)

greets
--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner

#15 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

In reply to Tim Harvey

Hello Tim,

Am 07.05.2015 um 17:55 schrieb Tim Harvey:

Quoted 59 lines · Tim Harvey
Quoted 58 lines · Stefan Roese
Quoted 20 lines

Hi Tim,

Quoted 7 lines · Tim Harvey

The MX6 has OTP bits specifying the processor speed grade as well as temperature grade.

This series adds functions to return this information as well as adds the details to the CPU info displayed.

Quoted 8 lines

Additionally we use the temperature grade to replace the hard-coded limits in imx_thermal.c

I expect some possible discussion/debate regarding the displaying of this info,
but perhaps adding the functions to obtain the info and use it for imx_thermal
is beyond debate. Please let me know.

Quoted 7 lines

Could you please send (or include in the commit text) an example, how these infos are displayed now in the bootup log? Best in comparison to the "old" log. To see the output change resulting from the patchset.

Thanks,
Stefan

Stefan,

Good point - as I am guessing there will be debate about the 'amount' of info displayed and am open to suggestions on how to word it and/or how to enable it. In future revs of the patchset I'll be more explicit in the commit logs, but for now with the series applied I get this:

IMX6Q automotive (1GHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
- after Patch 1/4:
CPU: Freescale i.MX6Q rev1.2 996 MHz (at 792 MHz)
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6Q rev1.2 automotive (-40C to 125C) 996 MHz (at 792 MHz)

IMX6S industrial (800MHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6SOLO rev1.2 at 792 MHz
- after Patch 1/4: (max speed == cur speed)
CPU: Freescale i.MX6SOLO rev1.2 792 MHz
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6SOLO rev1.2 industrial (-40C to 105C) 792 MHz

When I submit the next version I will split out adding the functions to get speed-grade and temperature-grade from using those functions in cpu_printinfo() as well as some may not be happy with adding more info to cpu_printinfo() but may find value in setting the thermal limits of imx_thermal properly based on temp-grade (Patch 4/4).

Quoted 9 lines
Quoted 1 line

Tim

Stefano,

I've cc'd all the maintainers I could find of MX6 based boards for comment on adding this text to the mx6 print_cpuinfo. I would like to see some ack/review from them otherwise I would think silence is considered a thumbs up ;)

Where do get the speed grade ant temperature grade information from i.MX6SOLO / DL from? The fusemap in the reference manual says nothing about these info for SOLO / DL and a Freescale FAE stated that these information is not present in the fuses for SOLO / DL.

Regards,

Markus

Quoted 8 lines

Regards,

Tim
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

author
#16 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Quoted 2 lines · Markus Niebel

Hello Tim,

<snip>

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

IMX6Q automotive (1GHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
- after Patch 1/4:
CPU: Freescale i.MX6Q rev1.2 996 MHz (at 792 MHz)
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6Q rev1.2 automotive (-40C to 125C) 996 MHz (at 792 MHz)

IMX6S industrial (800MHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6SOLO rev1.2 at 792 MHz
- after Patch 1/4: (max speed == cur speed)
CPU: Freescale i.MX6SOLO rev1.2 792 MHz
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6SOLO rev1.2 industrial (-40C to 105C) 792 MHz

<snip>

Quoted 9 lines

Where do get the speed grade ant temperature grade information from i.MX6SOLO / DL from? The fusemap in the reference manual says nothing about these info for SOLO / DL and a Freescale FAE stated that these information is not present in the fuses for SOLO / DL.

Regards,

Markus

Markus,

Your right - There is no indication in the IMX6SDLRM that OTP indicates either temperature grade 'or' speed grade, however my testing looks like they implement the same OTP settings for this as the IMX6DUAL/IMX6QUAD as indicated in the IMX6DQRM.

I have tested these patches with the following SoC's I have available:
- MCIMX6S7CVM08AC (IMX6S r1.2, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct)
- MCIMX6S5EVM10AC (IMX6S r1.2, Extended Commercial temp, 1GHz) - shows 'extended commercial (-20C to 105C) 996 MHz (at 792 MHz)' (correct)
- MCIMX6U7CVM08AB (IMX6DL r1.1, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct)
- MCIMX6Q6AVT10AC (IMX6Q r1.2. Automotive temp, 1GHz) - shows 'automotive (-40C to 125C) 996 MHz (at 792 MHz)' (correct)

I'll send our FAE a question to verify - perhaps your FAE simply answered the questions based on the reference manual (which is notoriously lacking info and in some cases wrong).

I encourage anyone with additional parts to test these patches and report if they show accurate information. If anyone has any IMX6SX I would appreciate removing the check that ignores the OTP for that and seeing if the results make sense.

Tim

#17 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Hi Tim,

Quoted 49 lines · Tim Harvey
Quoted 2 lines · Markus Niebel

Hello Tim,

<snip>

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

IMX6Q automotive (1GHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
- after Patch 1/4:
CPU: Freescale i.MX6Q rev1.2 996 MHz (at 792 MHz)
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6Q rev1.2 automotive (-40C to 125C) 996 MHz (at 792 MHz)

IMX6S industrial (800MHz capable) powering up at 800MHz:
- before:
CPU: Freescale i.MX6SOLO rev1.2 at 792 MHz
- after Patch 1/4: (max speed == cur speed)
CPU: Freescale i.MX6SOLO rev1.2 792 MHz
- after Patch 3/4 (if CONFIG_IMX6_THERMAL defined)
CPU: Freescale i.MX6SOLO rev1.2 industrial (-40C to 105C) 792 MHz

<snip>

Quoted 9 lines

Where do get the speed grade ant temperature grade information from i.MX6SOLO / DL from? The fusemap in the reference manual says nothing about these info for SOLO / DL and a Freescale FAE stated that these information is not present in the fuses for SOLO / DL.

Regards,

Markus

Markus,

Your right - There is no indication in the IMX6SDLRM that OTP indicates either temperature grade 'or' speed grade, however my testing looks like they implement the same OTP settings for this as the IMX6DUAL/IMX6QUAD as indicated in the IMX6DQRM.

I have tested these patches with the following SoC's I have available:
- MCIMX6S7CVM08AC (IMX6S r1.2, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct)
- MCIMX6S5EVM10AC (IMX6S r1.2, Extended Commercial temp, 1GHz) - shows 'extended commercial (-20C to 105C) 996 MHz (at 792 MHz)' (correct)
- MCIMX6U7CVM08AB (IMX6DL r1.1, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct)
- MCIMX6Q6AVT10AC (IMX6Q r1.2. Automotive temp, 1GHz) - shows 'automotive (-40C to 125C) 996 MHz (at 792 MHz)' (correct)

Quoted 8 lines

I'll send our FAE a question to verify - perhaps your FAE simply answered the questions based on the reference manual (which is notoriously lacking info and in some cases wrong).

I encourage anyone with additional parts to test these patches and report if they show accurate information. If anyone has any IMX6SX I would appreciate removing the check that ignores the OTP for that and seeing if the results make sense.

Here are the results from riotboard (imx6s) testing with your patches against Stefano's tree:

Before:
CPU: Freescale i.MX6SOLO rev1.1 at 792 MHz

After patch 1:
CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792 MHz)

After patch 2:
CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792 MHz)

After patch 3:
CPU: Freescale i.MX6SOLO rev1.1 // No idea why I lost the MHz values

After patch 4:
CPU: Freescale i.MX6SOLO rev1.1

MHz values are missing after patch 3, and looking diagonally at the code I don't see a reason. Next, riotboard doesn't have CONFIG_IMX6_THERMAL by default. When added, I get this:

$ make u-boot.imx
...
   OBJCOPY examples/standalone/hello_world.bin
   LDS     u-boot.lds
   LD      u-boot
arch/arm/imx-common/built-in.o: In function `print_cpuinfo':
/home/picmaster/work/u-boot-imx/arch/arm/imx-common/cpu.c:196: undefined 
reference to `uclass_get_device'
/home/picmaster/work/u-boot-imx/arch/arm/imx-common/cpu.c:198: undefined 
reference to `thermal_get_temp'
drivers/built-in.o: In function `imx_thermal_probe':
/home/picmaster/work/u-boot-imx/drivers/thermal/imx_thermal.c:155: 
undefined reference to `dev_get_platdata'
/home/picmaster/work/u-boot-imx/drivers/thermal/imx_thermal.c:156: 
undefined reference to `dev_get_priv'
drivers/built-in.o: In function `read_cpu_temperature':
/home/picmaster/work/u-boot-imx/drivers/thermal/imx_thermal.c:46: 
undefined reference to `dev_get_platdata'
/home/picmaster/work/u-boot-imx/drivers/thermal/imx_thermal.c:48: 
undefined reference to `dev_get_priv'
drivers/built-in.o: In function `imx_thermal_get_temp':
/home/picmaster/work/u-boot-imx/drivers/thermal/imx_thermal.c:127: 
undefined reference to `dev_get_priv'
ld.bfd: BFD (GNU Binutils for Debian) 2.22 assertion fail 
../../bfd/elf32-arm.c:7498
ld.bfd: BFD (GNU Binutils for Debian) 2.22 assertion fail 
../../bfd/elf32-arm.c:7498
ld.bfd: BFD (GNU Binutils for Debian) 2.22 assertion fail 
../../bfd/elf32-arm.c:7498
ld.bfd: BFD (GNU Binutils for Debian) 2.22 assertion fail 
../../bfd/elf32-arm.c:7498
ld.bfd: BFD (GNU Binutils for Debian) 2.22 assertion fail 
../../bfd/elf32-arm.c:13830
Segmentation fault
make: *** [u-boot] Error 139

Are there additional CONFIG dependencies?

Regards,
Nikolay

author
#18 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Quoted 5 lines · Nikolay Dimitrov

Hi Tim,

Quoted 1 line · Tim Harvey

<snip>

Quoted 33 lines
Quoted 16 lines

Your right - There is no indication in the IMX6SDLRM that OTP indicates either temperature grade 'or' speed grade, however my testing looks like they implement the same OTP settings for this as the IMX6DUAL/IMX6QUAD as indicated in the IMX6DQRM.

I have tested these patches with the following SoC's I have available:
- MCIMX6S7CVM08AC (IMX6S r1.2, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct)
- MCIMX6S5EVM10AC (IMX6S r1.2, Extended Commercial temp, 1GHz) - shows 'extended commercial (-20C to 105C) 996 MHz (at 792 MHz)' (correct)
- MCIMX6U7CVM08AB (IMX6DL r1.1, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct)
- MCIMX6Q6AVT10AC (IMX6Q r1.2. Automotive temp, 1GHz) - shows 'automotive (-40C to 125C) 996 MHz (at 792 MHz)' (correct)

Quoted 8 lines

I'll send our FAE a question to verify - perhaps your FAE simply answered the questions based on the reference manual (which is notoriously lacking info and in some cases wrong).

I encourage anyone with additional parts to test these patches and report if they show accurate information. If anyone has any IMX6SX I would appreciate removing the check that ignores the OTP for that and seeing if the results make sense.

Here are the results from riotboard (imx6s) testing with your patches against Stefano's tree:

Before:
CPU: Freescale i.MX6SOLO rev1.1 at 792 MHz

Quoted 8 lines

After patch 1:
CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792 MHz)

After patch 2:
CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792 MHz)

After patch 3:
CPU: Freescale i.MX6SOLO rev1.1 // No idea why I lost the MHz values

Nikolay,

thats an issue in my patch if you don't have CONFIG_IMX6_THERMAL. I'll fix in a followup patch version

Quoted 12 lines

After patch 4:
CPU: Freescale i.MX6SOLO rev1.1

MHz values are missing after patch 3, and looking diagonally at the code I don't see a reason. Next, riotboard doesn't have CONFIG_IMX6_THERMAL by default. When added, I get this:

$ make u-boot.imx
...

<snip>

Quoted 2 lines

Are there additional CONFIG dependencies?

Looks like CONFIG_IMX6_THERMAL also needs CONFIG_DM_THERMAL (includes thermal-uclass from drivers/thermal/Makefile)

Thanks for testing this. If you can get it working please let me know what the actual part markings are on the parts you test with.

Tim

Quoted 3 lines

Regards,
Nikolay

#19 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Hi Tim,

Quoted 66 lines · Tim Harvey
Quoted 5 lines · Nikolay Dimitrov

Hi Tim,

Quoted 1 line · Tim Harvey

<snip>

Quoted 32 lines
Quoted 16 lines

Your right - There is no indication in the IMX6SDLRM that OTP indicates either temperature grade 'or' speed grade, however my testing looks like they implement the same OTP settings for this as the IMX6DUAL/IMX6QUAD as indicated in the IMX6DQRM.

I have tested these patches with the following SoC's I have
available: - MCIMX6S7CVM08AC (IMX6S r1.2, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct) - MCIMX6S5EVM10AC (IMX6S r1.2, Extended Commercial temp, 1GHz) - shows 'extended commercial (-20C to 105C) 996 MHz (at 792 MHz)' (correct) - MCIMX6U7CVM08AB (IMX6DL r1.1, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct) - MCIMX6Q6AVT10AC (IMX6Q r1.2. Automotive temp, 1GHz) - shows 'automotive (-40C to 125C) 996 MHz (at 792 MHz)' (correct)

Quoted 8 lines

I'll send our FAE a question to verify - perhaps your FAE simply
answered the questions based on the reference manual (which is
notoriously lacking info and in some cases wrong).

I encourage anyone with additional parts to test these patches and report if they show accurate information. If anyone has any IMX6SX I would appreciate removing the check that ignores the OTP for that and seeing if the results make sense.

Here are the results from riotboard (imx6s) testing with your patches against Stefano's tree:

Before: CPU: Freescale i.MX6SOLO rev1.1 at 792 MHz

Quoted 8 lines

After patch 1: CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792
MHz)

After patch 2: CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792
MHz)

After patch 3: CPU: Freescale i.MX6SOLO rev1.1 // No idea why I
lost the MHz values

Nikolay,

thats an issue in my patch if you don't have CONFIG_IMX6_THERMAL. I'll fix in a followup patch version

Quoted 10 lines

After patch 4: CPU: Freescale i.MX6SOLO rev1.1

MHz values are missing after patch 3, and looking diagonally at the code I don't see a reason. Next, riotboard doesn't have CONFIG_IMX6_THERMAL by default. When added, I get this:

$ make u-boot.imx ...

<snip>

Quoted 1 line
Quoted 7 lines
Quoted 1 line

Are there additional CONFIG dependencies?

Looks like CONFIG_IMX6_THERMAL also needs CONFIG_DM_THERMAL (includes thermal-uclass from drivers/thermal/Makefile)

Thanks for testing this. If you can get it working please let me know what the actual part markings are on the parts you test with.

The updated CONFIGs fixed the build. Here are the outputs of all boards where I can easily run mainline U-Boot.

Riotboard 1, part number MCIMX6S5DVM10AB
========================================
CPU: Freescale i.MX6SOLO rev1.1 commercial (0C to 95C) 996 MHz (at 792
MHz)
CPU: Temperature 53 C

Riotboard 2, part number MCIMX6S5DVM10AC
========================================
CPU: Freescale i.MX6SOLO rev1.2 commercial (0C to 95C) 996 MHz (at 792
MHz)
CPU: Temperature 42 C

Marsboard, part number MCIMX6D5EYM10AC
======================================
CPU: Freescale i.MX6D rev1.2 extended commercial (-20C to 105C) 996
MHz (at 792 MHz)
CPU: Temperature 38 C

Btw, as the information in the "CPU:" line gets bigger and bigger, it's probably worth thinking about splitting it into separate lines. This will simplify the text formatting tricks, can be easily controlled by CONFIG directives and can look neater. But even if you don't change it, it looks fine to me - I like to see info, and if I don't need it, I can always cut it off easily.

Thanks for working on this patch series.

Regards,
Nikolay

PS: I have also some more customer boards with imx6d rev 1.3 and some imx6q with unknown revisions, but can't test there as mainline u-boot has broken spi flash support in SPL since 2014.07 and I hadn't had time to fix it and port it (although I would love to).

#20 lore raw

cover : imx: mx6: use OTP for temperature grade and freq grade

Quoted 105 lines · Nikolay Dimitrov

Hi Tim,

Quoted 67 lines · Tim Harvey
Quoted 5 lines · Nikolay Dimitrov

Hi Tim,

Quoted 1 line · Tim Harvey

<snip>

Quoted 33 lines
Quoted 17 lines

Your right - There is no indication in the IMX6SDLRM that OTP indicates either temperature grade 'or' speed grade, however my testing looks like they implement the same OTP settings for this as the IMX6DUAL/IMX6QUAD as indicated in the IMX6DQRM.

I have tested these patches with the following SoC's I have
available: - MCIMX6S7CVM08AC (IMX6S r1.2, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct)
- MCIMX6S5EVM10AC (IMX6S r1.2, Extended Commercial temp, 1GHz)
- shows 'extended commercial (-20C to 105C) 996 MHz (at 792 MHz)' (correct) - MCIMX6U7CVM08AB (IMX6DL r1.1, Industrial temp, 800MHz) - shows 'industrial (-40C to 105C) 792 MHz' (correct) - MCIMX6Q6AVT10AC (IMX6Q r1.2. Automotive temp, 1GHz)
- shows 'automotive (-40C to 125C) 996 MHz (at 792 MHz)' (correct)

Quoted 8 lines

I'll send our FAE a question to verify - perhaps your FAE simply answered the questions based on the reference manual (which is notoriously lacking info and in some cases wrong).

I encourage anyone with additional parts to test these patches and report if they show accurate information. If anyone has any IMX6SX I would appreciate removing the check that ignores the OTP for that and seeing if the results make sense.

Here are the results from riotboard (imx6s) testing with your patches against Stefano's tree:

Before: CPU: Freescale i.MX6SOLO rev1.1 at 792 MHz

Quoted 8 lines

After patch 1: CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792
MHz)

After patch 2: CPU: Freescale i.MX6SOLO rev1.1 996 MHz (at 792
MHz)

After patch 3: CPU: Freescale i.MX6SOLO rev1.1 // No idea why
I lost the MHz values

Nikolay,

thats an issue in my patch if you don't have CONFIG_IMX6_THERMAL. I'll fix in a followup patch version

Quoted 10 lines

After patch 4: CPU: Freescale i.MX6SOLO rev1.1

MHz values are missing after patch 3, and looking diagonally at the code I don't see a reason. Next, riotboard doesn't have CONFIG_IMX6_THERMAL by default. When added, I get this:

$ make u-boot.imx ...

<snip>

Quoted 1 line
Quoted 7 lines
Quoted 1 line

Are there additional CONFIG dependencies?

Looks like CONFIG_IMX6_THERMAL also needs CONFIG_DM_THERMAL (includes thermal-uclass from drivers/thermal/Makefile)

Thanks for testing this. If you can get it working please let me know what the actual part markings are on the parts you test with.

The updated CONFIGs fixed the build. Here are the outputs of all boards where I can easily run mainline U-Boot.

Riotboard 1, part number MCIMX6S5DVM10AB
======================================== CPU: Freescale i.MX6SOLO
rev1.1 commercial (0C to 95C) 996 MHz (at 792 MHz) CPU: Temperature
53 C

Riotboard 2, part number MCIMX6S5DVM10AC
======================================== CPU: Freescale i.MX6SOLO
rev1.2 commercial (0C to 95C) 996 MHz (at 792 MHz) CPU: Temperature
42 C

Marsboard, part number MCIMX6D5EYM10AC
====================================== CPU: Freescale i.MX6D rev1.2
extended commercial (-20C to 105C) 996 MHz (at 792 MHz) CPU:
Temperature 38 C

Btw, as the information in the "CPU:" line gets bigger and bigger, it's probably worth thinking about splitting it into separate lines. This will simplify the text formatting tricks, can be easily controlled by CONFIG directives and can look neater. But even if you don't change it, it looks fine to me - I like to see info, and if I don't need it, I can always cut it off easily.

Quoted 8 lines

Thanks for working on this patch series.

Regards, Nikolay

PS: I have also some more customer boards with imx6d rev 1.3 and some imx6q with unknown revisions, but can't test there as mainline u-boot has broken spi flash support in SPL since 2014.07 and I hadn't had time to fix it and port it (although I would love to).

Regards,
Nikolay