From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh Bansal Date: Tue, 8 Dec 2015 13:54:26 +0530 Subject: [U-Boot] [PATCH 1/5][v5] armv8: define usec2ticks function Message-ID: <1449563070-5761-1-git-send-email-aneesh.bansal@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de usec2ticks() function has been defined for ARMv8 which will be used by SEC Driver. Signed-off-by: Aneesh Bansal --- Changes in v5: - Commit Subject modified Changes in v4: None Changes in v3: None Changes in v2: None (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; +} -- 1.8.1.4