public inbox for linux-rtc@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Tomas Melin <tomas.melin@vaisala.com>
Cc: Takumi Ando <takumi@spacecubics.com>,
	linux-rtc@vger.kernel.org, michal.simek@amd.com,
	Yasushi SHOJI <yashi@spacecubics.com>,
	kanta tamura <kanta@spacecubics.com>
Subject: Re: [QUESTION] rtc: zynqmp: CALIB_RD reset behavior differs between ZynqMP and Versal
Date: Fri, 6 Mar 2026 12:13:29 +0100	[thread overview]
Message-ID: <202603061113298cbba29d@mail.local> (raw)
In-Reply-To: <9ed6823e-b381-4de5-b1cf-98f5dc54bb7c@vaisala.com>

On 06/03/2026 12:09:40+0200, Tomas Melin wrote:
> > On Zynq UltraScale+ Devices Register Reference (UG1087) [2],
> > CALIB_RD resets to 0, so the current logic works correctly there.
> > However, this assumption does not appear to hold for Versal.
> 
> For Ultrascale+ the calibration register also gives random values after
> reset, perhaps you have noticed this:
> https://adaptivesupport.amd.com/s/article/000036886?language=en_US. Maybe
> the same can occur also on Versal.
> 
> AFAIK there is no way of knowing if the value is correct or not after reset,
> so user space helpers might be needed to maintain the calibration value at a
> desired value.
> 

Userspace is always needed to put the proper calibration, there is no
way for the kernel to know what value to put there. In the support case
above, the crystal will never be exactly 32768Hz and this value will
change over time and also depends on the temperature. The value always
needs to be computed, if your device can do NTP, chrony will provide the
proper offsets. If you don't have a way to measure the deviation, then
userspace can always forcefully set /sys/class/rtc/rtcX/offset if it
doesn't hold the correct value.
There is no need for devmem here.

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2026-03-06 11:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05  9:24 [QUESTION] rtc: zynqmp: CALIB_RD reset behavior differs between ZynqMP and Versal Takumi Ando
2026-03-06 10:09 ` Tomas Melin
2026-03-06 11:13   ` Alexandre Belloni [this message]
2026-03-11  3:19     ` Takumi Ando
2026-03-11  5:22       ` Tomas Melin
2026-03-11  6:52         ` Takumi Ando

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202603061113298cbba29d@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=kanta@spacecubics.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=takumi@spacecubics.com \
    --cc=tomas.melin@vaisala.com \
    --cc=yashi@spacecubics.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox