[U-Boot] [PATCH v6 5/8] x86: slimbootloader: Set TSC information for tsc_timer

Andy Shevchenko andy.shevchenko at gmail.com
Fri Jul 26 21:06:21 UTC 2019


On Fri, Jul 26, 2019 at 3:50 PM Park, Aiden <aiden.park at intel.com> wrote:
> > On Fri, Jul 26, 2019 at 10:00 AM Park, Aiden <aiden.park at intel.com> wrote:
> > >
> > > Slim Bootloader already calibrated TSC and provides it to U-Boot.
> > > Therefore, U-Boot does not have to re-calibrate TSC.
> > > Configuring tsc_base and clock_rate makes x86 tsc_timer driver bypass
> > > TSC calibration and use the provided TSC frequency.
> > > - Get TSC frequency from performance info hob
> > > - Set tsc_base and clock_rate for tsc_timer driver
> >
> > I'm still not convinced to have this. As kernel followed by U-Boot we thrust
> > hardware more than something else.
> > One more layer in between is usually an additional point to be error-prone.
> >
> > So, if something we may get directly from hardware, I consider better to get it
> > from there.
> >
> > Of course, data structures can be left for sake of self-documentation.
> >
> Basically, Providing known information to a payload is Slim Bootloader
> architecture concept. Slim Bootloader does initialize chipset and hardware
> as much as it can, and provides useful information to a payload in HOBs
> to minimize hardware re-initialization in a payload, make it generic
> and make it light-weight.
>
> TSC frequency is specific to CPU or chipset, and the way to get exact TSC
> frequency also varies depending on CPU.
> ex) checking cpuid, platform info MSR, perf MSR for LFM/HFM/Turbo Mode, or FSB.
> All these consideration has already done in Slim Bootloader on each CPUs.
>
> I think that U-Boot tsc_timer also considers this case, and that's why
> tsc_timer skips calibration in its probing time if tsc_base and clock_rate are
> already configured.
>
> Kernel uses many timers like TSC, APIC timer, 8254 timer, HPET and so on.
> I also understand kernel trusts hardware and re-calibrate them because all
> these timers may not be properly configured in boot firmware stage.
> But, HOB information including TSC must be trusted between Slim Bootloader
> and its payload(U-Boot) in Slim Bootloader architecture.

Okay, I didn't remember if this is described in documentation.
If it's not, please, add a section and put there somelike you
expleined to me here.

-- 
With Best Regards,
Andy Shevchenko


More information about the U-Boot mailing list