<?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 Re: iMX6 SRTC cannot set time in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764234#M118726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more question, there is no "iim" command in my u-boot. Is there a way to read the fuse value in Linux kernel (similar to this&amp;nbsp;&lt;A href="https://community.nxp.com/thread/342524"&gt;SEC_CONFIG mode&lt;/A&gt;&amp;nbsp;discussion)?&amp;nbsp;Does reading&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;/sys/fsl_otp/HW_OCOTP_CFG5 give me SEC_CONFIG values?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeffrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2018 03:50:27 GMT</pubDate>
    <dc:creator>jeffreychang</dc:creator>
    <dc:date>2018-03-28T03:50:27Z</dc:date>
    <item>
      <title>iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764229#M118721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have enabled&amp;nbsp;CONFIG_RTC_DRV_SNVS configuration to build the SNVS SRTC driver "rtc-snvs.c" in my Android project. When the system boots up, I can see SRTC is working, the command "cat&amp;nbsp;/sys/class/rtc/rtc1/time" returns the time. However when I try to set time from Android, it calls&amp;nbsp;snvs_rtc_set_time() to set the time and the call hangs in the infinite loop waiting for SRTC to be re-enabled. Why does this happen? How to fix it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;int snvs_rtc_set_time(struct device *dev, struct rtc_time *tm)&lt;BR /&gt;{&lt;BR /&gt; struct rtc_drv_data *pdata = dev_get_drvdata(dev);&lt;BR /&gt; void __iomem *ioaddr = pdata-&amp;gt;ioaddr;&lt;BR /&gt; unsigned long time;&lt;BR /&gt; int ret;&lt;BR /&gt; u32 lp_cr;&lt;BR /&gt; u64 old_time_47bit, new_time_47bit;&lt;BR /&gt;&lt;BR /&gt; printk("+-+-+-+-%s\n", __FUNCTION__);&lt;/P&gt;&lt;P&gt;ret = rtc_tm_to_time(tm, &amp;amp;time);&lt;BR /&gt; if (ret != 0)&lt;BR /&gt; return ret;&lt;/P&gt;&lt;P&gt;old_time_47bit = (((u64) (__raw_readl(ioaddr + SNVS_LPSRTCMR) &amp;amp;&lt;BR /&gt; ((0x1 &amp;lt;&amp;lt; CNTR_TO_SECS_SH) - 1)) &amp;lt;&amp;lt; 32) |&lt;BR /&gt; ((u64) __raw_readl(ioaddr + SNVS_LPSRTCLR)));&lt;/P&gt;&lt;P&gt;/* Disable RTC first */&lt;BR /&gt; lp_cr = __raw_readl(ioaddr + SNVS_LPCR) &amp;amp; ~SNVS_LPCR_SRTC_ENV;&lt;BR /&gt; __raw_writel(lp_cr, ioaddr + SNVS_LPCR);&lt;BR /&gt; printk("1\n");&lt;BR /&gt; while (__raw_readl(ioaddr + SNVS_LPCR) &amp;amp; SNVS_LPCR_SRTC_ENV)&lt;BR /&gt; ;&lt;/P&gt;&lt;P&gt;/* Write 32-bit time to 47-bit timer, leaving 15 LSBs blank */&lt;BR /&gt; __raw_writel(time &amp;lt;&amp;lt; CNTR_TO_SECS_SH, ioaddr + SNVS_LPSRTCLR);&lt;BR /&gt; __raw_writel(time &amp;gt;&amp;gt; (32 - CNTR_TO_SECS_SH), ioaddr + SNVS_LPSRTCMR);&lt;/P&gt;&lt;P&gt;/* Enable RTC again */&lt;BR /&gt; __raw_writel(lp_cr | SNVS_LPCR_SRTC_ENV, ioaddr + SNVS_LPCR);&lt;BR /&gt; printk("2\n");&lt;BR /&gt; &lt;STRONG&gt;while (!(__raw_readl(ioaddr + SNVS_LPCR) &amp;amp; SNVS_LPCR_SRTC_ENV)) // hangs here&lt;/STRONG&gt;&lt;BR /&gt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 09:30:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764229#M118721</guid>
      <dc:creator>jeffreychang</dc:creator>
      <dc:date>2018-03-16T09:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764230#M118722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please note that if fuse value SEC_CONFIG[1] bit is 0, it causes SNVS SRTC can't be accessed.&lt;BR /&gt;You need to set it to 1, open mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Victor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 04:15:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764230#M118722</guid>
      <dc:creator>b36401</dc:creator>
      <dc:date>2018-03-20T04:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764231#M118723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I read and write the fuse&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;SEC_CONFIG[1]? In the driver rtc-snvs.c file, I cannot find ways to do it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Jeffrey&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 06:34:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764231#M118723</guid>
      <dc:creator>jeffreychang</dc:creator>
      <dc:date>2018-03-27T06:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764232#M118724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The eFuses in i.MX6 processor are internal one-time programmable bits used for the configuration.&lt;BR /&gt;You can manage eFuses with "iim" u-boot command. Type "iim help" for the details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The address of SEC_CONFIG fuse is 0x460.&lt;BR /&gt;Please refer the table 5-9 "Fusemap Descriptions" of i.MX 6 Reference Manual for the details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Victor&lt;BR /&gt; &lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 06:54:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764232#M118724</guid>
      <dc:creator>b36401</dc:creator>
      <dc:date>2018-03-27T06:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764233#M118725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the prompt response. I will take a look at the "iim" command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if the&amp;nbsp;SEC_CONFIG[1] is set to closed position, then the SNVS SRTC cannot be used anymore?&lt;/P&gt;&lt;P&gt;In this case, what RTC can be used to to implement the alarm which wakes up iMX6 from suspend?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Jeffrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 07:00:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764233#M118725</guid>
      <dc:creator>jeffreychang</dc:creator>
      <dc:date>2018-03-27T07:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764234#M118726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more question, there is no "iim" command in my u-boot. Is there a way to read the fuse value in Linux kernel (similar to this&amp;nbsp;&lt;A href="https://community.nxp.com/thread/342524"&gt;SEC_CONFIG mode&lt;/A&gt;&amp;nbsp;discussion)?&amp;nbsp;Does reading&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;/sys/fsl_otp/HW_OCOTP_CFG5 give me SEC_CONFIG values?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeffrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 03:50:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764234#M118726</guid>
      <dc:creator>jeffreychang</dc:creator>
      <dc:date>2018-03-28T03:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764235#M118727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Linux the fuses are accessible with its sysfs under /sys/class/misc/fuse point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Victor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2018 03:57:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764235#M118727</guid>
      <dc:creator>b36401</dc:creator>
      <dc:date>2018-03-30T03:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6 SRTC cannot set time</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764236#M118728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Why does the SNVS RTC driver only use SNVS_LP but not SNVS_HP?&lt;/LI&gt;&lt;LI&gt;Can we use SNVS_HP to wake up the system from suspend? Where can I find SNVS_HP driver source code?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeffrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2018 06:05:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-SRTC-cannot-set-time/m-p/764236#M118728</guid>
      <dc:creator>jeffreychang</dc:creator>
      <dc:date>2018-03-30T06:05:51Z</dc:date>
    </item>
  </channel>
</rss>

