[PATCH V6 2/2] rtc: zynqmp: Add calibration set and get support

Neeli, Srinivas srinivas.neeli at amd.com
Fri Jun 10 03:02:47 PDT 2022


[AMD Official Use Only - General]

Hi,

> -----Original Message-----
> From: Peter Korsgaard <peter at korsgaard.com>
> Sent: Thursday, June 9, 2022 8:30 PM
> To: Alexandre Belloni <alexandre.belloni at bootlin.com>
> Cc: Srinivas Neeli <srinivas.neeli at xilinx.com>; a.zummo at towertech.it;
> robh+dt at kernel.org; krzysztof.kozlowski+dt at linaro.org;
> michal.simek at xilinx.com; sgoud at xilinx.com; shubhraj at xilinx.com; Neeli,
> Srinivas <srinivas.neeli at amd.com>; neelisrinivas18 at gmail.com;
> devicetree at vger.kernel.org; linux-rtc at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; linux-kernel at vger.kernel.org; git at xilinx.com
> Subject: Re: [PATCH V6 2/2] rtc: zynqmp: Add calibration set and get support
>
> >>>>> "Alexandre" == Alexandre Belloni <alexandre.belloni at bootlin.com>
> writes:
>
>  > On 09/06/2022 16:50:03+0200, Peter Korsgaard wrote:
>  >> >>>>> "Srinivas" == Srinivas Neeli <srinivas.neeli at xilinx.com> writes:
>  >>
>  >> > Zynqmp RTC controller has a calibration feature to compensate  >> >
> time deviation due to input clock inaccuracy.
>  >> > Set and get calibration API's are used for setting and getting  >> >
> calibration value from the controller calibration register.
>  >> > As per RTC spec default calibration value is 0x7FFF.
>  >>
>  >> Where do you see that? ug1085 rev2.2 still lists:
>  >>
>  >> Programming Sequences
>  >> init rtc
>  >> 1. Write the value 0019_8231h into the calibration register, CALIB_WRITE.
>  >>
>
>  > This is a very weird value. Last time I had a look, I couldn't find an  >
> explanation for it.
>
> Agreed. I am not arguing that it is sensible, I just wondered where this new
> value comes from?
>
This information is missing in our TRM, as per the internal RTC IP design specification document, the calibration value should be crystal clock frequency minus one.
For a crystal oscillator of 32.768KHz(0x8000) frequency, the calibration value will be 0x7FFF.

Will update TRM with the required information.

> --
> Bye, Peter Korsgaard



More information about the linux-arm-kernel mailing list