1 /* 2 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #include <drivers/delay_timer.h> 8 #include <lib/mmio.h> 9 10 #include <tegra_def.h> 11 #include <tegra_private.h> 12 tegra_timerus_get_value(void)13static uint32_t tegra_timerus_get_value(void) 14 { 15 return mmio_read_32(TEGRA_TMRUS_BASE); 16 } 17 18 /* 19 * Initialise the on-chip free rolling us counter as the delay 20 * timer. 21 */ tegra_delay_timer_init(void)22void tegra_delay_timer_init(void) 23 { 24 static const timer_ops_t tegra_timer_ops = { 25 .get_timer_value = tegra_timerus_get_value, 26 .clk_mult = 1, 27 .clk_div = 1, 28 }; 29 30 timer_init(&tegra_timer_ops); 31 } 32