blob: 56c9851630de4f9291b9ca859cb7fec403e80315 [file] [log] [blame]
Varun Wadekarbc74fec2015-07-16 15:47:03 +05301/*
2 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Varun Wadekarbc74fec2015-07-16 15:47:03 +05305 */
6
7#include <delay_timer.h>
8#include <mmio.h>
9#include <tegra_def.h>
10
11static uint32_t tegra_timerus_get_value(void)
12{
13 return mmio_read_32(TEGRA_TMRUS_BASE);
14}
15
16static const timer_ops_t tegra_timer_ops = {
17 .get_timer_value = tegra_timerus_get_value,
18 .clk_mult = 1,
19 .clk_div = 1,
20};
21
22/*
23 * Initialise the on-chip free rolling us counter as the delay
24 * timer.
25 */
26void tegra_delay_timer_init(void)
27{
28 timer_init(&tegra_timer_ops);
29}