From: Michal Simek <michal.simek@amd.com>
To: Tomas Melin <tomas.melin@vaisala.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Harini T <harini.t@amd.com>
Subject: Re: [PATCH v4 0/5] rtc: zynqmp: fixes for read and set offset
Date: Thu, 29 Jan 2026 11:11:52 +0100 [thread overview]
Message-ID: <739e70b2-b4d1-457a-9f00-d19766f0ef76@amd.com> (raw)
In-Reply-To: <20260122-zynqmp-rtc-updates-v4-0-d4edb966b499@vaisala.com>
On 1/22/26 14:53, Tomas Melin wrote:
> Add improvements for read and set offset functions.
> The basic functionality is still the same, but offset correction values
> are now updated to match with expected.
>
> The RTC calibration value operates with full ticks,
> and fractional ticks which are a 1/16 of a full tick.
> The 16 lowest bits in the calibration registers are for the full ticks
> and value matches the external oscillator in Hz. Through that,
> the maximum and minimum offset values can be calculated dynamically,
> as they depend on the input frequency used.
>
> For docs on the calibration register, see
> https://docs.amd.com/r/en-US/ug1087-zynq-ultrascale-registers/CALIB_READ-RTC-Register
>
> Due to rounding errors (different number of fract ticks),
> offset readback will differ slightly depending on
> if the offset is negative or positive. This is however well below the granularity
> provided by the hardware.
>
> For example
> $ echo 34335 > offset
> $ cat offset
> 34335
> $ echo -34335 > offset
> $ cat offset
> -34326
>
> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
> ---
> Changes in v4:
> - Do not limit building to zynqmp arch as building on other platforms
> might be needed. Implies dropping commit.
> - No need for RTC_PPB to be 64 bit value, use 32 bit instead
> - Link to v3: https://lore.kernel.org/r/20260119-zynqmp-rtc-updates-v3-0-acd902fdeab1@vaisala.com
>
> Changes in v3:
> - Add commit for limiting building of driver to zynqmp arch.
> - Reorder variable declarations in set_offset
> - Link to v2: https://lore.kernel.org/r/20260108-zynqmp-rtc-updates-v2-0-864c161fa83d@vaisala.com
>
> Changes in v2:
> - Add commit introducing check for calibration value overflow
> - Update comments
> - Align data types across set and read
> - Rename fract_tick as fract_data conforming to data sheet
> - Further improve on set offset calculation logic
> - Link to v1: https://lore.kernel.org/r/20251201-zynqmp-rtc-updates-v1-0-33875c1e385b@vaisala.com
>
> ---
> Tomas Melin (5):
> rtc: zynqmp: correct frequency value
> rtc: zynqmp: check calibration max value
> rtc: zynqmp: rework read_offset
> rtc: zynqmp: rework set_offset
> rtc: zynqmp: use dynamic max and min offset ranges
>
> drivers/rtc/rtc-zynqmp.c | 75 ++++++++++++++++++++++++++----------------------
> 1 file changed, 41 insertions(+), 34 deletions(-)
> ---
> base-commit: cd635e33b0113287c94021be53d2a7c61a1614e9
> change-id: 20251201-zynqmp-rtc-updates-d260364cc01b
>
> Best regards,
Acked-by: Michal Simek <michal.simek@amd.com>
Thanks,
Michal
next prev parent reply other threads:[~2026-01-29 10:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 13:53 [PATCH v4 0/5] rtc: zynqmp: fixes for read and set offset Tomas Melin
2026-01-22 13:53 ` [PATCH v4 1/5] rtc: zynqmp: correct frequency value Tomas Melin
2026-01-22 13:53 ` [PATCH v4 2/5] rtc: zynqmp: check calibration max value Tomas Melin
2026-01-22 13:53 ` [PATCH v4 3/5] rtc: zynqmp: rework read_offset Tomas Melin
2026-01-22 13:53 ` [PATCH v4 4/5] rtc: zynqmp: rework set_offset Tomas Melin
2026-01-29 9:33 ` T, Harini
2026-01-22 13:53 ` [PATCH v4 5/5] rtc: zynqmp: use dynamic max and min offset ranges Tomas Melin
2026-01-29 9:36 ` [PATCH v4 0/5] rtc: zynqmp: fixes for read and set offset T, Harini
2026-01-29 10:11 ` Michal Simek [this message]
2026-01-30 22:59 ` Alexandre Belloni
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=739e70b2-b4d1-457a-9f00-d19766f0ef76@amd.com \
--to=michal.simek@amd.com \
--cc=alexandre.belloni@bootlin.com \
--cc=harini.t@amd.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=tomas.melin@vaisala.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