<?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: imx6ull RTC adjustment in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1172985#M164024</link>
    <description>&lt;P&gt;Hi Igor,&lt;/P&gt;&lt;P&gt;I got hwclock adjtime-file to work well after add BR2_PACKAGE_UTIL_LINUX_HWCLOCK [=y] package to buildroot and it's much easier to control drift when disable RTC_SYSTOHC [=n] from kernel.&lt;/P&gt;&lt;P&gt;I think that better way is to adjust offset value straight to rtc chip. Our devices can be installed to places where isn't network at all, so the better way is to adjust drift in factory. I think that it's easier to control kernel update also, if adjust has done to rtc chip.&lt;/P&gt;&lt;P&gt;Manual says that there can be adjust offset in chapter 8.2.3 "Register Offset".&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/data-sheet/PCF85063TP.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/data-sheet/PCF85063TP.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and there is pcf85063_set_offset()-function in driver where offset can be set.&lt;/P&gt;&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/rtc/rtc-pcf85063.c?h=imx_5.4.3_2.0.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/rtc/rtc-pcf85063.c?h=imx_5.4.3_2.0.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;How can I call this funcfion?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Janne&lt;/P&gt;</description>
    <pubDate>Mon, 26 Oct 2020 08:53:56 GMT</pubDate>
    <dc:creator>Ypi</dc:creator>
    <dc:date>2020-10-26T08:53:56Z</dc:date>
    <item>
      <title>imx6ull RTC adjustment</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1171730#M163888</link>
      <description>&lt;P&gt;How I can adjust RTC offset to NXP Pcf85063tp?&lt;/P&gt;&lt;P&gt;I have custom imx6ull board and it is built from buildroot.&lt;/P&gt;&lt;P&gt;Hwclock read and write functions works correct and NTP '11 minute mode' is written clock correctly.&lt;/P&gt;&lt;P&gt;Hwclock(8) man says that it can adjust with hwclock --adjustment function. But I cant find it at all. I can't find /etc/adjtime file also.&lt;/P&gt;&lt;PRE&gt;# hwclock --help&lt;BR /&gt;BusyBox v1.31.1 (2020-10-22 09:46:51 EEST) multi-call binary.&lt;BR /&gt;&lt;BR /&gt;Usage: hwclock [-r|--show] [-s|--hctosys] [-w|--systohc] [--systz] [--localtime] [-u|--utc] [-f|--rtc FILE]&lt;BR /&gt;&lt;BR /&gt;Query and set hardware clock (RTC)&lt;BR /&gt;&lt;BR /&gt;-r Show hardware clock time&lt;BR /&gt;-s Set system time from hardware clock&lt;BR /&gt;-w Set hardware clock from system time&lt;BR /&gt;--systz Set in-kernel timezone, correct system time&lt;BR /&gt;if hardware clock is in local time&lt;BR /&gt;-u Assume hardware clock is kept in UTC&lt;BR /&gt;--localtime Assume hardware clock is kept in local time&lt;BR /&gt;-f FILE Use specified device (e.g. /dev/rtc2)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added printk debug to driver code&lt;/P&gt;&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/rtc/rtc-pcf85063.c?h=imx_5.4.3_2.0.0" target="_blank" rel="noopener"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/rtc/rtc-pcf85063.c?h=imx_5.4.3_2.0.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and I can see cf85063_read_offset debug, but I have no idea how to set offset.&lt;/P&gt;&lt;PRE&gt;# cat /sys/class/rtc/rtc0/offset&lt;BR /&gt;[ 940.317834] DEBUG: pcf85063_read_offset&lt;BR /&gt;0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something which block to adjustment manually, or do I need add more packages to buildroot, kernel or busybox?&lt;/P&gt;&lt;P&gt;-Janne&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 09:20:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1171730#M163888</guid>
      <dc:creator>Ypi</dc:creator>
      <dc:date>2020-10-22T09:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: imx6ull RTC adjustment</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1172081#M163919</link>
      <description>&lt;P&gt;Hi janne_terho&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for external rtc usage one can look at examples on:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="https://variwiki.com/index.php?title=IMX_RTC" target="_blank"&gt;https://variwiki.com/index.php?title=IMX_RTC&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://github.com/varigit/linux-imx/blob/imx_4.19.35_1.1.0_var01/arch/arm/boot/dts/imx6q-var-dt6customboard.dts" target="_blank"&gt;https://github.com/varigit/linux-imx/blob/imx_4.19.35_1.1.0_var01/arch/arm/boot/dts/imx6q-var-dt6customboard.dts&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 23:49:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1172081#M163919</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2020-10-22T23:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: imx6ull RTC adjustment</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1172985#M164024</link>
      <description>&lt;P&gt;Hi Igor,&lt;/P&gt;&lt;P&gt;I got hwclock adjtime-file to work well after add BR2_PACKAGE_UTIL_LINUX_HWCLOCK [=y] package to buildroot and it's much easier to control drift when disable RTC_SYSTOHC [=n] from kernel.&lt;/P&gt;&lt;P&gt;I think that better way is to adjust offset value straight to rtc chip. Our devices can be installed to places where isn't network at all, so the better way is to adjust drift in factory. I think that it's easier to control kernel update also, if adjust has done to rtc chip.&lt;/P&gt;&lt;P&gt;Manual says that there can be adjust offset in chapter 8.2.3 "Register Offset".&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/data-sheet/PCF85063TP.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/data-sheet/PCF85063TP.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and there is pcf85063_set_offset()-function in driver where offset can be set.&lt;/P&gt;&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/rtc/rtc-pcf85063.c?h=imx_5.4.3_2.0.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/rtc/rtc-pcf85063.c?h=imx_5.4.3_2.0.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;How can I call this funcfion?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Janne&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 08:53:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1172985#M164024</guid>
      <dc:creator>Ypi</dc:creator>
      <dc:date>2020-10-26T08:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: imx6ull RTC adjustment</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1173147#M164040</link>
      <description>&lt;P&gt;Hi Janne&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;linux provides standard ways for handling rtc described in documentation&lt;/P&gt;
&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/admin-guide/rtc.rst?h=imx_5.4.47_2.2.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/admin-guide/rtc.rst?h=imx_5.4.47_2.2.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If one wishes to access driver directly it is necessary to write custom application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 13:29:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1173147#M164040</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2020-10-26T13:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: imx6ull RTC adjustment</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1177294#M164450</link>
      <description>&lt;P&gt;Hi Igor&lt;/P&gt;&lt;P&gt;I found way to write PCF85063TP offset register. For 1ppm drift just use&lt;/P&gt;&lt;PRE&gt;echo 4340 &amp;gt; /sys/class/rtc/rtc0/offset&lt;/PRE&gt;&lt;P&gt;I didn't try it before, because I read, that those are read only attributes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Janne&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 12:46:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6ull-RTC-adjustment/m-p/1177294#M164450</guid>
      <dc:creator>Ypi</dc:creator>
      <dc:date>2020-11-03T12:46:45Z</dc:date>
    </item>
  </channel>
</rss>

