All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5][v5] armv8: define usec2ticks function
@ 2015-12-08  8:24 Aneesh Bansal
  2015-12-08  8:24 ` [U-Boot] [PATCH 2/5][v5] armv8: Make SEC read/write as snoopable for LS1043 Aneesh Bansal
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Aneesh Bansal @ 2015-12-08  8:24 UTC (permalink / raw)
  To: u-boot

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 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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-12-16  3:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08  8:24 [U-Boot] [PATCH 1/5][v5] armv8: define usec2ticks function Aneesh Bansal
2015-12-08  8:24 ` [U-Boot] [PATCH 2/5][v5] armv8: Make SEC read/write as snoopable for LS1043 Aneesh Bansal
2015-12-15  1:07   ` York Sun
2015-12-08  8:24 ` [U-Boot] [PATCH 3/5][v5] include/linux: move typdef for uintptr_t Aneesh Bansal
2015-12-08 16:45   ` York Sun
2015-12-14  2:08     ` York Sun
2015-12-14  2:10     ` York Sun
2015-12-15  1:07   ` York Sun
2015-12-16  3:48   ` York Sun
2015-12-08  8:24 ` [U-Boot] [PATCH 4/5][v5] armv8/ls1043ardb: add SECURE BOOT target for NOR Aneesh Bansal
2015-12-15  1:10   ` York Sun
2015-12-08  8:24 ` [U-Boot] [PATCH 5/5][v5] drivers/crypto/fsl: fix endianness issue in RNG Aneesh Bansal
2015-12-15  1:12   ` York Sun
2015-12-15  1:06 ` [U-Boot] [PATCH 1/5][v5] armv8: define usec2ticks function York Sun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.