[PATCH v2 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
Pali Rohár
pali at kernel.org
Sun Sep 4 11:41:45 CEST 2022
On Saturday 03 September 2022 19:36:03 Tony Dinh wrote:
> Hi Pali,
>
> On Sat, Sep 3, 2022 at 6:08 PM Pali Rohár <pali at kernel.org> wrote:
> >
> > On Saturday 03 September 2022 17:38:01 Tony Dinh wrote:
> > > Hi Pali,
> > >
> > > Is there a way to get the CPU frequency from the board upon start up?
> > >
> > > Thanks,
> > > Tony
> >
> > Hello! Each SoC has either fixed CPU frequency or has some bits in SAR
> > register which say on which frequency is CPU running. SAR bits are SoC
> > specific and are documented either in Functional Specifications or in
> > Hardware Specifications (both documents are available for free all
> > 32-bit Marvell SoCs except 375 and 39x).
>
> Thanks for the recap. I do remember you posted a patch for that detection.
> https://lists.denx.de/pipermail/u-boot/2022-August/492034.html
>
> Just want to make sure that the SAR register is the only way we can
> detect it in u-boot. The Kirkwood 6192 SoC on this Pogo V4 board can
> run at 200 Mhz and 800 Mhz with frequency scaling in Linux.
>
> Thanks,
> Tony
Well, All those SoCs have more clocks which are used for different
peripherals. TCLK is something like base block and CPU is connected to
different clock. Settings for it CPU clock is also in SAR register
(different bits). And then there can be something like CPU scaling and
cpufreq driver with configuration via different registers which can
modify divisor of the main CPU clock. Which effectively can lower CPU
speed. This cpufreq part is not implemented in U-Boot and IIRC CPU clock
divisor should be at 1 = full CPU speed.
More information about the U-Boot
mailing list