u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: Simon Glass <sjg@chromium.org>
Cc: "Michael Walle" <michael@walle.cc>,
	"U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Pali Rohár" <pali@kernel.org>, "Tony Dinh" <mibodhi@gmail.com>
Subject: Re: [PATCH 2/6] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
Date: Thu, 1 Sep 2022 07:33:35 +0200	[thread overview]
Message-ID: <b9612ef3-509a-8156-8613-4921d2c00523@denx.de> (raw)
In-Reply-To: <CAPnjgZ1PqFOJrgpTiGyfLVFDCh95R-eq=ux4e8fxwusTC=4xEQ@mail.gmail.com>

Hi Simon,

On 31.08.22 19:44, Simon Glass wrote:

<snip>

>>> It is needed because bootstage is called before driver model is ready.
>>> In fact it can be used to time driver model things.
>>
>> I see, makes sense. This brings up my next questions though, why isn't
>> CONFIG_TIMER_EARLY enough in this case? AFAICT it's targeted exactly
>> for this early (pre DM) bootstage. From drivers/timer/Kconfig:
>>
>> config TIMER_EARLY
>>          bool "Allow timer to be used early in U-Boot"
>>          depends on TIMER
>>          # initr_bootstage() requires a timer and is called before initr_dm()
>>          # so only the early timer is available
>>          default y if X86 && BOOTSTAGE
>>          help
>>            In some cases the timer must be accessible before driver model is
>>            active. Examples include when using CONFIG_TRACE to trace U-Boot's
>>            execution before driver model is set up. Enable this option to
>>            use an early timer. These functions must be supported by your timer
>>            driver: timer_early_get_count() and timer_early_get_rate().
>>
>> So again, do we really need timer_get_boot_us() or isn't it enough
>> to select TIMER_EARLY when BOOTSTAGE is enabled?
> 
> The timer is for milliseconds but for bootstage we need microseconds.
> 
> Perhaps the ultimate solution here is to support a microsecond timer
> through the TIMER api and use the TIMER_EARLY thing to provide
> timer_get_boot_us(), perhaps renaming to timer_early_get_us() ?

Yes, sounds like a plan. We should consolidate these implementations.
Let me think about it and perhaps do some basic implementations and
tests for a while.

Thanks,
Stefan

  reply	other threads:[~2022-09-01  5:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 11:53 [PATCH 0/6] Enable CONFIG_TIMER for all Kirwood / MVEBU boards Stefan Roese
2022-08-30 11:53 ` [PATCH 1/6] timer: orion-timer: Add support for other Armada SoC's Stefan Roese
2022-08-30 11:53 ` [PATCH 2/6] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support Stefan Roese
2022-08-30 12:00   ` Michael Walle
2022-08-30 12:08     ` Stefan Roese
2022-08-30 15:56       ` Simon Glass
2022-08-31  5:57         ` Stefan Roese
2022-08-31 17:44           ` Simon Glass
2022-09-01  5:33             ` Stefan Roese [this message]
2022-08-30 11:53 ` [PATCH 3/6] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms Stefan Roese
2022-08-30 12:04   ` Michael Walle
2022-08-30 12:11     ` Stefan Roese
2022-08-30 11:53 ` [PATCH 4/6] arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step Stefan Roese
2022-08-30 11:53 ` [PATCH 5/6] arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1 Stefan Roese
2022-08-30 11:53 ` [PATCH 6/6] arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node Stefan Roese
2022-08-30 22:15 ` [PATCH 0/6] Enable CONFIG_TIMER for all Kirwood / MVEBU boards Tony Dinh
2022-08-31  5:02   ` Stefan Roese
2022-08-31  5:08     ` Stefan Roese
2022-08-31  6:12       ` Stefan Roese
2022-08-31  6:45         ` Tony Dinh
2022-08-31  6:30       ` Tony Dinh
2022-08-31  7:22         ` Stefan Roese
2022-08-31 15:08           ` Tony Dinh
2022-08-31 21:53             ` Tony Dinh
2022-09-01  1:38               ` Tony Dinh
2022-09-01  2:27                 ` Simon Glass
2022-09-01  7:39                   ` Tony Dinh
2022-09-01  9:27                     ` Stefan Roese
2022-09-01 11:52                       ` Stefan Herbrechtsmeier
2022-09-02  5:38                         ` Stefan Roese
2022-09-01 14:34                       ` Simon Glass
2022-09-01 23:46                         ` Tony Dinh
2022-09-02  2:51                           ` Tony Dinh
2022-09-02  3:49                             ` 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=b9612ef3-509a-8156-8613-4921d2c00523@denx.de \
    --to=sr@denx.de \
    --cc=mibodhi@gmail.com \
    --cc=michael@walle.cc \
    --cc=pali@kernel.org \
    --cc=sjg@chromium.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).