public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5][v2] armv8: usec2ticks function defined
Date: Thu, 19 Nov 2015 08:56:25 -0800	[thread overview]
Message-ID: <564DFF39.30203@freescale.com> (raw)
In-Reply-To: <1447911713-28639-1-git-send-email-aneesh.bansal@freescale.com>

On 11/18/2015 09:41 PM, Aneesh Bansal wrote:
> usec2ticks() function has been defined for ARMv8 which will
> be used by SEC Driver.
> 
> Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
> ---
> Changes in v2:
> New Patch Set created with an additional patch.
> 
>  arch/arm/cpu/armv8/generic_timer.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c
> index 8e60bae..8f47a82 100644
> --- a/arch/arm/cpu/armv8/generic_timer.c
> +++ b/arch/arm/cpu/armv8/generic_timer.c
> @@ -40,3 +40,14 @@ unsigned long timer_read_counter(void)
>  #endif
>  	return cntpct;
>  }
> +
> +unsigned long usec2ticks(unsigned long usec)
> +{
> +	ulong ticks;
> +	if (usec < 1000)
> +		ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000;
> +	else
> +		ticks = ((usec / 10) * (get_tbclk() / 100000));
> +
> +	return ticks;
> +}
> 

Is existing usec_to_tick() in lib/time.c good for you?

York

  parent reply	other threads:[~2015-11-19 16:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19  5:41 [U-Boot] [PATCH 1/5][v2] armv8: usec2ticks function defined Aneesh Bansal
2015-11-19  5:41 ` [U-Boot] [PATCH 2/5][v2] armv8: Make SEC read/write as snoopable for LS1043 Aneesh Bansal
2015-11-19  5:41 ` [U-Boot] [PATCH 3/5] Data type defined for pointer addresses Aneesh Bansal
2015-12-07 16:50   ` York Sun
2015-12-07 17:02     ` Bansal Aneesh
2015-12-07 17:08     ` Tom Rini
2015-12-07 17:14       ` Scott Wood
2015-12-07 17:33         ` York Sun
2015-12-07 17:50           ` Tom Rini
2015-12-07 20:31             ` York Sun
2015-11-19  5:41 ` [U-Boot] [PATCH 4/5][v2] armv8/ls1043ardb: SECURE BOOT target added for NOR Aneesh Bansal
2015-12-02 19:03   ` York Sun
2015-11-19  5:41 ` [U-Boot] [PATCH 5/5][v2] drivers/crypto/fsl: fix endianness issue in RNG Aneesh Bansal
2015-11-19 16:56 ` York Sun [this message]
2015-11-23 18:50   ` [U-Boot] [PATCH 1/5][v2] armv8: usec2ticks function defined Bansal Aneesh

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=564DFF39.30203@freescale.com \
    --to=yorksun@freescale.com \
    --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