All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Dinh <mibodhi@gmail.com>
To: Stefan Roese <sr@denx.de>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Pali Rohár" <pali@kernel.org>,
	"Michael Walle" <michael@walle.cc>,
	"Simon Glass" <sjg@chromium.org>
Subject: Re: [PATCH v2 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
Date: Sat, 3 Sep 2022 17:38:01 -0700	[thread overview]
Message-ID: <CAJaLiFzyVFBtd9yQNE7yJbW3wS0L95O0seFTjz6H+Lno1Jd5Hw@mail.gmail.com> (raw)
In-Reply-To: <CAJaLiFzHPxJCUwfaqFOKHbVZowX0OLp0WVgg13vLnjoZVw8kqQ@mail.gmail.com>

Hi Pali,

On Sat, Sep 3, 2022 at 5:02 PM Tony Dinh <mibodhi@gmail.com> wrote:
>
> Hi Stefan,
>
> Sorry, that message was prematurely sent (fat finger). Please see the
> continuation below.
>
> On Sat, Sep 3, 2022 at 4:43 PM Tony Dinh <mibodhi@gmail.com> wrote:
> >
> > Hi Stefan,
> >
> > On Sat, Sep 3, 2022 at 3:44 AM Stefan Roese <sr@denx.de> wrote:
> > >
> > > Hi Tony,
> > >
> > > On 03.09.22 11:44, Tony Dinh wrote:
> > > > Hi Stefan,
> > > >
> > > > On Thu, Sep 1, 2022 at 11:25 PM Stefan Roese <sr@denx.de> wrote:
> > > >>
> > > >> Add timer_get_boot_us() to support boards, that have CONFIG_BOOTSTAGE
> > > >> enabled, like pogo_v4.
> > > >>
> > > >> Signed-off-by: Stefan Roese <sr@denx.de>
> > > >> ---
> > > >> v2:
> > > >> - Change timer_get_boot_us() to use the timer_early functions
> > > >> - Remove #if CONFIG_IS_ENABLED(BOOTSTAGE)
> > > >>
> > > >> Simon, I'm currently looking into this timer_get_boot_us() to using
> > > >> timer_early_get_count() etc consolidation.
> > > >
> > > > Indeed, as you've mentioned above, I think timer_early_get_count() and
> > > > timer_early_get_rate() do need to take into consideration  what the
> > > > input_clock_type is for Kirkwood boards with CONFIG_BOOTSTAGE such as
> > > > the Pogo V4.
> > > >
> > > > I'm seeing on the Pogo V4 test, the timer command reports time about 6
> > > > times slower than it should. It does seem to jive with the fact that
> > > > the Pogo V4 CONFIG_SYS_TCLK is 166Mhz, versus MVEBU 25MHz clock rate.
> > >
> > > Ah, I've missing updating the early functions to also differentiate
> > > between fixed clocks and TCLK timer.
> > >
> > > Please give the attached patch a try - should be applied on top of this
> > > latest patchset.
> >
>
> That looks promising, but I think we are still missing something.
> After applying the attached patch, I ran the test again and it behaved
> the same way (clock rate 6 times slower). So I did another test.
>
> --- Test 1
> Pogo_V4> timer start; sleep 60; timer get; sleep 30; timer get
> 60.000
> 90.000
>
> So apparently the sleep cmd has reset the correct clock rate.
>
> --- Test 2
>
> Pogo_V4> timer start; sleep 30; timer get; sleep 30; timer get
> 30.000
> 60.000
>
> And then wait for 30 seconds, do another "timer get" (I expected to
> see about 90 to 95 seconds).
>
> Pogo_V4> timer get
> 66.237
>
> The different call tree with the timer vs the sleep command made a
> difference. But I could not see where.
>
> --- Test 3
>
> Then I recalled about CONFIG_TIMER_EARLY. It is not selected by
> default in Kconfig currently. So I enabled that to see the behavior.
> But running this build hangs right off the bat. No u-boot version
> banner is printed out.
>

Is there a way to get the CPU frequency from the board upon start up?

Thanks,
Tony

  reply	other threads:[~2022-09-04  0:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  6:25 [PATCH v2 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
2022-09-02  6:25 ` [PATCH v2 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around Stefan Roese
2022-09-02  7:44   ` Michael Walle
2022-09-02  7:45     ` Stefan Roese
2022-09-02  6:25 ` [PATCH v2 2/8] timer: orion-timer: Add support for other Armada SoC's Stefan Roese
2022-09-02  6:25 ` [PATCH v2 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support Stefan Roese
2022-09-03  9:44   ` Tony Dinh
2022-09-03 10:44     ` Stefan Roese
2022-09-03 23:43       ` Tony Dinh
2022-09-04  0:02         ` Tony Dinh
2022-09-04  0:38           ` Tony Dinh [this message]
2022-09-04  1:08             ` Pali Rohár
2022-09-04  2:36               ` Tony Dinh
2022-09-04  9:41                 ` Pali Rohár
2022-09-04  8:54           ` Michael Walle
2022-09-04 19:47             ` Tony Dinh
2022-09-02  6:25 ` [PATCH v2 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms Stefan Roese
2022-09-02  6:25 ` [PATCH v2 5/8] arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step Stefan Roese
2022-09-02  6:25 ` [PATCH v2 6/8] arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1 Stefan Roese
2022-09-02  6:25 ` [PATCH v2 7/8] arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node Stefan Roese
2022-09-02  6:25 ` [PATCH v2 8/8] kirkwood: lsxl: Sync defconfigs Stefan Roese
2022-09-03  0:10 ` [PATCH v2 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Tony Dinh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJaLiFzyVFBtd9yQNE7yJbW3wS0L95O0seFTjz6H+Lno1Jd5Hw@mail.gmail.com \
    --to=mibodhi@gmail.com \
    --cc=michael@walle.cc \
    --cc=pali@kernel.org \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.