1 // SPDX-License-Identifier: GPL-2.0+
4 * Copyright (C) 2013 Xilinx, Inc. All rights reserved.
10 #include <asm/arch/clk.h>
11 #include <asm/global_data.h>
13 DECLARE_GLOBAL_DATA_PTR;
16 * set_cpu_clk_info() - Setup clock information
18 * This function is called from common code after relocation and sets up the
21 int set_cpu_clk_info(void)
28 ret = uclass_get_device_by_driver(UCLASS_CLK,
29 DM_DRIVER_GET(zynq_clk), &dev);
33 for (i = 0; i < 2; i++) {
34 clk.id = i ? ddr3x_clk : cpu_6or4x_clk;
35 ret = clk_request(dev, &clk);
39 rate = clk_get_rate(&clk) / 1000000;
41 gd->bd->bi_ddr_freq = rate;
43 gd->bd->bi_arm_freq = rate;
44 gd->cpu_clk = clk_get_rate(&clk);
47 gd->bd->bi_dsp_freq = 0;