clk.c 896 B

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