Prasad Kummari | 2038bd6 | 2023-12-14 10:52:24 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2023-2024, Advanced Micro Devices, Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | #include <common/debug.h> |
| 7 | #include <plat/common/platform.h> |
| 8 | |
| 9 | #include <platform_def.h> |
| 10 | #include <plat_private.h> |
| 11 | |
| 12 | void set_cnt_freq(void) |
| 13 | { |
| 14 | uint64_t counter_freq; |
| 15 | |
| 16 | /* Configure counter frequency */ |
| 17 | counter_freq = read_cntfrq_el0(); |
| 18 | if (counter_freq == 0U) { |
| 19 | write_cntfrq_el0(plat_get_syscnt_freq2()); |
| 20 | } |
| 21 | } |