[U-Boot] [PATCH v6 1/2] x86: Add TSC-specific timer functions

Bin Meng bmeng.cn at gmail.com
Tue Apr 24 08:41:02 UTC 2018


Hi Ivan,

On Tue, Apr 24, 2018 at 7:56 AM, Ivan Gorinov <ivan.gorinov at intel.com> wrote:
> Hi Bin,
>
> On Mon, Apr 23, 2018 at 01:38:05AM -0600, Bin Meng wrote:
>> > Coreboot timestamp functions and Quark memory reference code use
>> > get_tbclk() to get TSC frequency. This will not work if another
>> > early timer is selected.
>>
>> Thanks for working on this. But get_tbclk() is one API provided by the
>> timer library. The get_tbclk_mhz() is something that is implemented by
>> the TSC timer driver, so can we get rid of the get_tbclk_mhz() and use
>> the get_tbclk() instead in coreboot/timestamp.c and quark/mrc_util.c?
>
> The Coreboot timestamp code and Quark MRC specifically use rdtsc().
> We can replace it with timer_early_get_count() or provide a function
> to get the TSC frequency even when another early timer is selected.
>

Good catch. Yes, we should fix coreboot timestamp code and Quark MRC
codes to not explicitly call rdtsc.

Another driver that explicitly calls rdtsc() is hw_watchdog_reset() in
watchdog/tangier_wdt.c driver. We need fix that too.

Regards,
Bin


More information about the U-Boot mailing list