MX6ULL thermal sensor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MX6ULL thermal sensor

595 Views
Milco
Contributor III

Hi all,

we have an issue/doubt about u-boot for our i.MX6ULL processor.

Now our GA BSP has an old u-boot without the patch below, where the 6–4 REFTOP_VBGADJ field is set to 0x6 as constant.

Migrating to a new u-boot where the patch below is applied we are experiencing a great temperature increasing on the processor.

When the patch is applied the REFTOP_VBGADJ field is set to 0x0.. and the temperature reading goes up more than 10°C.

Measuring the case temperature, we don't see a so big change between the two configurations, but cat /sys/class/thermal/thermal_zon0/temp reads more than 10°C above...

The patch reads a value from eFuse to setup the bandgap. Does NXP write this eFuse field during production?.. or we need to perform a calibration on our side?

 

Many thanks for your help.

---
 arch/arm/cpu/armv7/mx6/soc.c             | 31 ++++++++++++++++++++++++++-----
 arch/arm/include/asm/arch-mx6/crm_regs.h |  1 +
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 7b53bfd..dd94797 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -300,9 +300,17 @@ static void clear_mmdc_ch_mask(void)
 	writel(reg, &mxc_ccm->ccdr);
 }
 
+#define OCOTP_MEM0_REFTOP_TRIM_SHIFT          8
+
 static void init_bandgap(void)
 {
 	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+	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;
+
 	/*
 	 * Ensure the bandgap has stabilized.
 	 */
@@ -315,13 +323,26 @@ static void init_bandgap(void)
 	 */
 	writel(BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF, &anatop->ana_misc0_set);
 	/*
-	 * On i.MX6ULL, the LDO 1.2V bandgap voltage is 30mV higher. so set
-	 * VBGADJ bits to 2b'110 to adjust it.
+	 * On i.MX6ULL,we need to set VBGADJ bits according to the
+	 * REFTOP_TRIM[3:0] in fuse table
+	 *	000 - set REFTOP_VBGADJ[2:0] to 3b'110,
+	 *	110 - set REFTOP_VBGADJ[2:0] to 3b'000,
+	 *	001 - set REFTOP_VBGADJ[2:0] to 3b'001,
+	 *	010 - set REFTOP_VBGADJ[2:0] to 3b'010,
+	 *	011 - set REFTOP_VBGADJ[2:0] to 3b'011,
+	 *	100 - set REFTOP_VBGADJ[2:0] to 3b'100,
+	 *	101 - set REFTOP_VBGADJ[2:0] to 3b'101,
+	 *	111 - set REFTOP_VBGADJ[2:0] to 3b'111,
 	 */
-	if (is_mx6ull())
-		writel(BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ, &anatop->ana_misc0_set);
-}
+	if (is_mx6ull()) {
+		val = readl(&fuse->mem0);
+		val >>= OCOTP_MEM0_REFTOP_TRIM_SHIFT;
+		val &= 0x7;
 
+		writel(val << BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ_SHIFT,
+		       &anatop->ana_misc0_set);
+	}
+}

 

0 Kudos
3 Replies

574 Views
Yuri
NXP Employee
NXP Employee

@Milco 
Hello,

  I've sent You some comments via e-mail.

Regards,
Yuri.

0 Kudos

152 Views
george
Senior Contributor II

Hello @karina_valencia,

 

Sorry to contact you directly again.

We are also seeing the same issue now(on i.MX6Q/S), could you please provide some information?

 

Thanks,

George

0 Kudos

143 Views
karina_valencia
NXP Apps Support
NXP Apps Support

@george, can you create a new thread and add this link as a reference?

 

0 Kudos