clk.c 666 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2016 - 2018 Xilinx, Inc.
  4. * Michal Simek <michal.simek@xilinx.com>
  5. */
  6. #include <common.h>
  7. #include <init.h>
  8. #include <time.h>
  9. #include <asm/global_data.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. #ifdef CONFIG_CLOCKS
  12. /**
  13. * set_cpu_clk_info - Initialize clock framework
  14. *
  15. * Return: 0 always.
  16. *
  17. * This function is called from common code after relocation and sets up the
  18. * clock framework. The framework must not be used before this function had been
  19. * called.
  20. */
  21. int set_cpu_clk_info(void)
  22. {
  23. gd->cpu_clk = get_tbclk();
  24. gd->bd->bi_arm_freq = gd->cpu_clk / 1000000;
  25. gd->bd->bi_dsp_freq = 0;
  26. return 0;
  27. }
  28. #endif