Re: [PATCH 3.18 052/144] ARM: dra7xx: Fix counter frequency drift for AM572x errata i856

From: Lennart Sorensen
Date: Fri Nov 09 2018 - 11:08:35 EST


On Thu, Nov 08, 2018 at 01:50:23PM -0800, Greg Kroah-Hartman wrote:
> 3.18-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> [ Upstream commit afc9d590b8a150cfeaac0078ef5de6fb21a5ea6a ]
>
> Errata i856 for the AM572x (DRA7xx) points out that the 32.768KHz external
> crystal is not enabled at power up. Instead the CPU falls back to using
> an emulation for the 32KHz clock which is SYSCLK1/610. SYSCLK1 is usually
> 20MHz on boards so far (which gives an emulated frequency of 32.786KHz),
> but can also be 19.2 or 27MHz which result in much larger drift.
>
> Since this is used to drive the master counter at 32.768KHz * 375 /
> 2 = 6.144MHz, the emulated speed for 20MHz is of by 570ppm, or about 43
> seconds per day, and more than the 500ppm NTP is able to tolerate.
>
> Checking the CTRL_CORE_BOOTSTRAP register can determine if the CPU
> is using the real 32.768KHz crystal or the emulated SYSCLK1/610, and
> by known that the real counter frequency can be determined and used.
> The real speed is then SYSCLK1 / 610 * 375 / 2 or SYSCLK1 * 75 / 244.

I certainly can't see a problem including it. Of course I doubt there
really are any DRA7 systems running that old a kernel (certainly the
beaglebone X15 seems to require a newer kernel to even have a DTB
included). The RuggedCom RX1400 might still be running 3.14 kernel,
but already has the patch applied (because I did it).

So certainly nothing wrong with adding the patch, but I doubt anyone
will notice.

--
Len Sorensen