Hi Andy, > -----Original Message----- > From: Andy Shevchenko [mailto:andy.shevche...@gmail.com] > Sent: Friday, July 26, 2019 7:37 PM > To: Park, Aiden <aiden.p...@intel.com> > Cc: Bin Meng <bmeng...@gmail.com>; U-Boot Mailing List <u- > b...@lists.denx.de>; Simon Glass <s...@chromium.org> > Subject: Re: [PATCH v6 5/8] x86: slimbootloader: Set TSC information for > tsc_timer > > On Fri, Jul 26, 2019 at 10:00 AM Park, Aiden <aiden.p...@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. > -- > With Best Regards, > Andy Shevchenko Best Regards, Aiden _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot