clk.c 601 B

123456789101112131415161718192021222324252627282930
  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. DECLARE_GLOBAL_DATA_PTR;
  8. #ifdef CONFIG_CLOCKS
  9. /**
  10. * set_cpu_clk_info - Initialize clock framework
  11. *
  12. * Return: 0 always.
  13. *
  14. * This function is called from common code after relocation and sets up the
  15. * clock framework. The framework must not be used before this function had been
  16. * called.
  17. */
  18. int set_cpu_clk_info(void)
  19. {
  20. gd->cpu_clk = get_tbclk();
  21. gd->bd->bi_arm_freq = gd->cpu_clk / 1000000;
  22. gd->bd->bi_dsp_freq = 0;
  23. return 0;
  24. }
  25. #endif