clk.c 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * (C) Copyright 2014 - 2015 Xilinx, Inc.
  3. * Michal Simek <michal.simek@xilinx.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <asm/arch/hardware.h>
  9. #include <asm/arch/sys_proto.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. unsigned long get_uart_clk(int dev_id)
  12. {
  13. u32 ver = zynqmp_get_silicon_version();
  14. switch (ver) {
  15. case ZYNQMP_CSU_VERSION_EP108:
  16. return 25000000;
  17. }
  18. return 133000000;
  19. }
  20. #ifdef CONFIG_CLOCKS
  21. /**
  22. * set_cpu_clk_info() - Initialize clock framework
  23. * Always returns zero.
  24. *
  25. * This function is called from common code after relocation and sets up the
  26. * clock framework. The framework must not be used before this function had been
  27. * called.
  28. */
  29. int set_cpu_clk_info(void)
  30. {
  31. gd->cpu_clk = get_tbclk();
  32. /* Support Veloce to show at least 1MHz via bdi */
  33. if (gd->cpu_clk > 1000000)
  34. gd->bd->bi_arm_freq = gd->cpu_clk / 1000000;
  35. else
  36. gd->bd->bi_arm_freq = 1;
  37. gd->bd->bi_dsp_freq = 0;
  38. return 0;
  39. }
  40. #endif