From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/10] dm: timer: Support 64-bit counter
Date: Sat, 7 Nov 2015 06:40:53 +0800 [thread overview]
Message-ID: <563D2C75.2050803@wytron.com.tw> (raw)
In-Reply-To: <CAEUhbmVgDM_=CiDtvfmwf3dMxrc9m4LbuA2-nROnpWzbjo9nKw@mail.gmail.com>
Hi Bin,
On 2015?11?06? 22:35, Bin Meng wrote:
> Hi Thomas,
>
> On Fri, Nov 6, 2015 at 3:14 PM, Thomas Chou <thomas@wytron.com.tw> wrote:
>> Hi Bin,
>>
>> On 2015?11?05? 22:02, Bin Meng wrote:
>>>
>>> There are timers with a 64-bit counter value but current timer
>>> uclass driver assumes a 32-bit one. Introduce a device tree
>>> property "counter-64bit", and modify timer_get_count() in the
>>> timer uclass driver to handle the 32-bit/64-bit conversion
>>> automatically.
>>>
>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>> ---
>>
>>
>> Thanks a lot. I tested patches [1-4] on nios2 boards with "ut time" and
>> "sleep". It works fine.
>>
>> I would suggest that we do not need the additional "counter-64bit" property
>> by requiring the timer always return 64 bits count. We can provide an inline
>> func to do the 32/64 conversion for all 32 bits timers.
>>
>
> Do you mean we move the following codes:
>
> + /* increment tbh if tbl has rolled over */
> + if (now < gd->timebase_l)
> + gd->timebase_h++;
> + gd->timebase_l = now;
> + *count = ((u64)gd->timebase_h << 32) | gd->timebase_l;
>
> to an inline function, to have 32-bit timer driver to call this inline
> function in their get_count() op?
>
> This looks duplicate to me.
Yes. If we want to support 64 bits count, it should be the driver's
responsibility to return 64 bits count. It would be more natural than
adding a property to tell the uclass to to the conversion. The
"duplicate" you mentioned could be an alternative to the "counter-64bit"
addition. I believe 64 bits hardware counter will become more popular in
the future.
Best regards,
Thomas
next prev parent reply other threads:[~2015-11-06 22:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 14:02 [U-Boot] [PATCH 00/10] dm: timer: x86: 64-bit counter support and tsc timer dm conversion Bin Meng
2015-11-05 14:02 ` [U-Boot] [PATCH 01/10] dm: timer: Fix several nits Bin Meng
2015-11-06 6:59 ` Thomas Chou
2015-11-06 12:06 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 02/10] dm: timer: Implement pre_probe() Bin Meng
2015-11-06 7:00 ` Thomas Chou
2015-11-06 12:08 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 03/10] timer: altera: Remove the codes to get clock frequency Bin Meng
2015-11-06 7:01 ` Thomas Chou
2015-11-06 12:08 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 04/10] dm: timer: Support 64-bit counter Bin Meng
2015-11-06 7:14 ` Thomas Chou
2015-11-06 14:35 ` Bin Meng
2015-11-06 22:40 ` Thomas Chou [this message]
2015-11-10 2:46 ` Bin Meng
2015-11-05 14:02 ` [U-Boot] [PATCH 05/10] x86: Reomve MIN_PORT80_KCLOCKS_DELAY Bin Meng
2015-11-06 12:08 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 06/10] x86: tsc: Use notrace from <linux/compiler.h> Bin Meng
2015-11-06 12:08 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 07/10] x86: tsc: Add driver model timer support Bin Meng
2015-11-06 12:08 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 08/10] x86: Convert to use driver model timer Bin Meng
2015-11-06 12:08 ` Simon Glass
2015-11-06 14:28 ` Bin Meng
2015-11-06 23:58 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 09/10] x86: tsc: Remove legacy timer codes Bin Meng
2015-11-06 12:08 ` Simon Glass
2015-11-05 14:02 ` [U-Boot] [PATCH 10/10] x86: tsc: Move tsc_timer.c to drivers/timer Bin Meng
2015-11-06 12:08 ` Simon Glass
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=563D2C75.2050803@wytron.com.tw \
--to=thomas@wytron.com.tw \
--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