public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peng Fan <van.freenix@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks
Date: Tue, 10 May 2016 17:30:05 +0800	[thread overview]
Message-ID: <20160510093003.GA2939@linux-7smt.suse> (raw)
In-Reply-To: <1461894969-3856-1-git-send-email-van.freenix@gmail.com>

Hi Stefano,

Kindly ping..

Thanks,
Peng.
On Fri, Apr 29, 2016 at 09:56:09AM +0800, Peng Fan wrote:
>This commit "2bb014820c49a63902103bac710bc86b5772e843"
>do some clean up to use the code in lib/time.c.
>But usec2ticks is still being used by security related job ring code.
>Bring back the function to avoid build break.
>
>Signed-off-by: Peng Fan <van.freenix@gmail.com>
>Cc: Stefano Babic <sbabic@denx.de>
>---
> arch/arm/imx-common/timer.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
>diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
>index 92c7218..bde24af 100644
>--- a/arch/arm/imx-common/timer.c
>+++ b/arch/arm/imx-common/timer.c
>@@ -124,3 +124,20 @@ ulong get_tbclk(void)
> {
> 	return gpt_get_clk();
> }
>+
>+/*
>+ * This function is intended for SHORT delays only.
>+ * It will overflow at around 10 seconds @ 400MHz,
>+ * or 20 seconds @ 200MHz.
>+ */
>+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;
>+}
>-- 
>2.6.2
>

  parent reply	other threads:[~2016-05-10  9:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29  1:56 [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks Peng Fan
2016-05-02 23:41 ` Tom Rini
2016-05-03  1:17   ` Peng Fan
2016-05-03  2:04     ` Tom Rini
2016-05-03  2:32       ` Peng Fan
2016-05-10  9:30 ` Peng Fan [this message]
2016-05-10 13:20   ` Stefano Babic

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=20160510093003.GA2939@linux-7smt.suse \
    --to=van.freenix@gmail.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