Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * (C) Copyright 2016 - 2018 Xilinx, Inc. |
Michal Simek | a8c9436 | 2023-07-10 14:35:49 +0200 | [diff] [blame] | 4 | * Michal Simek <michal.simek@amd.com> |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 8 | #include <init.h> |
Simon Glass | a9dc068 | 2019-12-28 10:44:59 -0700 | [diff] [blame] | 9 | #include <time.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
| 14 | #ifdef CONFIG_CLOCKS |
| 15 | /** |
| 16 | * set_cpu_clk_info - Initialize clock framework |
| 17 | * |
| 18 | * Return: 0 always. |
| 19 | * |
| 20 | * This function is called from common code after relocation and sets up the |
| 21 | * clock framework. The framework must not be used before this function had been |
| 22 | * called. |
| 23 | */ |
| 24 | int set_cpu_clk_info(void) |
| 25 | { |
| 26 | gd->cpu_clk = get_tbclk(); |
| 27 | |
| 28 | gd->bd->bi_arm_freq = gd->cpu_clk / 1000000; |
| 29 | gd->bd->bi_dsp_freq = 0; |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | #endif |