Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2016 - 2022, Xilinx, Inc. |
| 4 | * Copyright (C) 2022, Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * Michal Simek <michal.simek@amd.com> |
| 7 | */ |
| 8 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 9 | #include <init.h> |
| 10 | #include <time.h> |
| 11 | #include <asm/global_data.h> |
Tom Rini | cfb6aaa | 2024-04-30 07:35:29 -0600 | [diff] [blame] | 12 | #include <asm/u-boot.h> |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
| 16 | #ifdef CONFIG_CLOCKS |
| 17 | /** |
| 18 | * set_cpu_clk_info - Initialize clock framework |
| 19 | * |
| 20 | * Return: 0 always. |
| 21 | * |
| 22 | * This function is called from common code after relocation and sets up the |
| 23 | * clock framework. The framework must not be used before this function had been |
| 24 | * called. |
| 25 | */ |
| 26 | int set_cpu_clk_info(void) |
| 27 | { |
| 28 | gd->cpu_clk = get_tbclk(); |
| 29 | |
| 30 | gd->bd->bi_arm_freq = gd->cpu_clk / 1000000; |
| 31 | gd->bd->bi_dsp_freq = 0; |
| 32 | |
| 33 | return 0; |
| 34 | } |
| 35 | #endif |