/* This function is called from common code after relocation and sets up the clock information.  */
int set_cpu_clk_info(void)
/* This function is called from common code after relocation and sets up the clock information.  */
int set_cpu_clk_info(void)
{
	struct clk clk;
	struct udevice *dev;
	ulong rate;
	int i, ret;
	ret = uclass_get_device_by_driver(UCLASS_CLK,
		DM_GET_DRIVER(zynq_clk), &dev);
	if (ret)
		return ret;
	for (i = 0; i < 2; i++) {
		clk.id = i ? ddr3x_clk : cpu_6or4x_clk;
		ret = clk_request(dev, &clk);
		if (ret < 0)
			return ret;
		rate = clk_get_rate(&clk) / 1000000;
		if (i)
			gd->bd->bi_ddr_freq = rate;
		else
			gd->bd->bi_arm_freq = rate;
		clk_free(&clk);
	}
	gd->bd->bi_dsp_freq = 0;
	return 0;
}