diff mbox series

[U-Boot] arm64: timer: Create timer_get_bootus for bootstage support

Message ID 6e53830804bf925b0b7b4cd4d0f9b7c2c334d466.1526395620.git.michal.simek@xilinx.com
State Accepted
Commit d0f855f221307dcbaeeef5a58c5ce816d0af6750
Delegated to: Tom Rini
Headers show
Series [U-Boot] arm64: timer: Create timer_get_bootus for bootstage support | expand

Commit Message

Michal Simek May 15, 2018, 2:47 p.m. UTC
Implement timer_get_boot_us() based on available functions to support
bootstage command.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/cpu/armv8/generic_timer.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Tom Rini May 24, 2018, 12:42 p.m. UTC | #1
On Tue, May 15, 2018 at 04:47:02PM +0200, Michal Simek wrote:

> Implement timer_get_boot_us() based on available functions to support
> bootstage command.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c
index 303ba3c00efb..bf07a706a029 100644
--- a/arch/arm/cpu/armv8/generic_timer.c
+++ b/arch/arm/cpu/armv8/generic_timer.c
@@ -61,3 +61,10 @@  unsigned long usec2ticks(unsigned long usec)
 
 	return ticks;
 }
+
+ulong timer_get_boot_us(void)
+{
+	u64 val = get_ticks() * 1000000;
+
+	return val / get_tbclk();
+}