From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 10 May 2016 15:20:53 +0200 Subject: [U-Boot] [PATCH] arm: imx-common: introduce back usec2ticks In-Reply-To: <20160510093003.GA2939@linux-7smt.suse> References: <1461894969-3856-1-git-send-email-van.freenix@gmail.com> <20160510093003.GA2939@linux-7smt.suse> Message-ID: <5731E035.6030801@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Peng, On 10/05/2016 11:30, Peng Fan wrote: > Hi Stefano, > > Kindly ping.. > I have maybe misunderstood the thread and I have supposed you want to send a V2 with the stuff related to secure moved to Kconfig, as requested by Tom. For that reason, you find your patch tagged with "Changes requested" in patchwork. Anyway, this can be done in a follow up patch. I will completely agree if this is done separately. Best regards, Stefano > 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 >> Cc: Stefano Babic >> --- >> 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 >> -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================