[U-Boot] [PATCH v2] timer: add High Precision Event Timers (HPET) support

Andy Shevchenko andy.shevchenko at gmail.com
Sat Mar 31 12:31:03 UTC 2018


On Sat, Mar 31, 2018 at 4:03 AM, Ivan Gorinov <ivan.gorinov at intel.com> wrote:
> On Fri, Mar 30, 2018 at 10:46:40PM +0300, Andy Shevchenko wrote:
>
>> > +       writel(0, regs + HPET_MAIN_COUNT_L);
>> > +       writel(0, regs + HPET_MAIN_COUNT_H);
>>
>> Can we use writeq() here?
>
> I don't see readq/writeq defined for x86, even x86_64.
>

read_le64() and write_le64() in U-Boot source code.

Besides that there are memcpy_toio() / memcpy_fromio() defined (didn't
check if they are really implemented).

>> > +               tl = readl(regs + HPET_MAIN_COUNT_L);
>> > +               th = readl(regs + HPET_MAIN_COUNT_H);
>>
>> Ditto.
>
> If readq() is defined as two read operations in 32-bit code, main counter
> rollover (low part overflow, high part increment) can happen between them.

And how this contradicts ther current code?

-- 
With Best Regards,
Andy Shevchenko


More information about the U-Boot mailing list