<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MX6ULL thermal sensor in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1202957#M166838</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;we have an issue/doubt about u-boot for our i.MX6ULL processor.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Migrating to a new u-boot where the patch below is applied we are experiencing a great temperature increasing on the processor.&lt;/P&gt;&lt;P&gt;When the patch is applied the REFTOP_VBGADJ field is set to 0x0.. and the temperature reading goes up more than 10°C.&lt;/P&gt;&lt;P&gt;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...&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help.&lt;/P&gt;&lt;PRE&gt;---
 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, &amp;amp;mxc_ccm-&amp;gt;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 = &amp;amp;ocotp-&amp;gt;bank[1];
+	struct fuse_bank1_regs *fuse =
+		(struct fuse_bank1_regs *)bank-&amp;gt;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, &amp;amp;anatop-&amp;gt;ana_misc0_set);
 	/*
&lt;FONT color="#FF0000"&gt;-	 * On i.MX6ULL, the LDO 1.2V bandgap voltage is 30mV higher. so set
-	 * VBGADJ bits to 2b'110 to adjust it.&lt;/FONT&gt;
+	 * 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,
 	 */
&lt;FONT color="#FF0000"&gt;-	if (is_mx6ull())
-		writel(BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ, &amp;amp;anatop-&amp;gt;ana_misc0_set);
-}&lt;/FONT&gt;
+	if (is_mx6ull()) {
+		val = readl(&amp;amp;fuse-&amp;gt;mem0);
+		val &amp;gt;&amp;gt;= OCOTP_MEM0_REFTOP_TRIM_SHIFT;
+		val &amp;amp;= 0x7;
 
+		writel(val &amp;lt;&amp;lt; BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ_SHIFT,
+		       &amp;amp;anatop-&amp;gt;ana_misc0_set);
+	}
+}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2020 08:30:20 GMT</pubDate>
    <dc:creator>Milco</dc:creator>
    <dc:date>2020-12-22T08:30:20Z</dc:date>
    <item>
      <title>MX6ULL thermal sensor</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1202957#M166838</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;we have an issue/doubt about u-boot for our i.MX6ULL processor.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Migrating to a new u-boot where the patch below is applied we are experiencing a great temperature increasing on the processor.&lt;/P&gt;&lt;P&gt;When the patch is applied the REFTOP_VBGADJ field is set to 0x0.. and the temperature reading goes up more than 10°C.&lt;/P&gt;&lt;P&gt;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...&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help.&lt;/P&gt;&lt;PRE&gt;---
 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, &amp;amp;mxc_ccm-&amp;gt;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 = &amp;amp;ocotp-&amp;gt;bank[1];
+	struct fuse_bank1_regs *fuse =
+		(struct fuse_bank1_regs *)bank-&amp;gt;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, &amp;amp;anatop-&amp;gt;ana_misc0_set);
 	/*
&lt;FONT color="#FF0000"&gt;-	 * On i.MX6ULL, the LDO 1.2V bandgap voltage is 30mV higher. so set
-	 * VBGADJ bits to 2b'110 to adjust it.&lt;/FONT&gt;
+	 * 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,
 	 */
&lt;FONT color="#FF0000"&gt;-	if (is_mx6ull())
-		writel(BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ, &amp;amp;anatop-&amp;gt;ana_misc0_set);
-}&lt;/FONT&gt;
+	if (is_mx6ull()) {
+		val = readl(&amp;amp;fuse-&amp;gt;mem0);
+		val &amp;gt;&amp;gt;= OCOTP_MEM0_REFTOP_TRIM_SHIFT;
+		val &amp;amp;= 0x7;
 
+		writel(val &amp;lt;&amp;lt; BM_ANADIG_ANA_MISC0_REFTOP_VBGADJ_SHIFT,
+		       &amp;amp;anatop-&amp;gt;ana_misc0_set);
+	}
+}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 08:30:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1202957#M166838</guid>
      <dc:creator>Milco</dc:creator>
      <dc:date>2020-12-22T08:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: MX6ULL thermal sensor</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1204021#M166934</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/55505"&gt;@Milco&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I've sent You some comments via e-mail.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Yuri.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 07:20:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1204021#M166934</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2020-12-24T07:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: MX6ULL thermal sensor</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1803052#M219732</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/31115"&gt;@karina_valencia&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry to contact you directly again.&lt;/P&gt;&lt;P&gt;We are also seeing the same issue now(on i.MX6Q/S), could you please provide some information?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 01:36:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1803052#M219732</guid>
      <dc:creator>george</dc:creator>
      <dc:date>2024-02-07T01:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: MX6ULL thermal sensor</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1803517#M219773</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/39147"&gt;@george&lt;/a&gt;,&amp;nbsp;can you create a new thread and add this link as a reference?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 16:50:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MX6ULL-thermal-sensor/m-p/1803517#M219773</guid>
      <dc:creator>karina_valencia</dc:creator>
      <dc:date>2024-02-07T16:50:48Z</dc:date>
    </item>
  </channel>
</rss>

