speed.c 627 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. *
  4. * (C) Copyright 2000-2003
  5. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6. *
  7. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  8. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  9. */
  10. #include <common.h>
  11. #include <clock_legacy.h>
  12. #include <asm/global_data.h>
  13. #include <asm/processor.h>
  14. #include <asm/immap.h>
  15. DECLARE_GLOBAL_DATA_PTR;
  16. /*
  17. * get_clocks() fills in gd->cpu_clock and gd->bus_clk
  18. */
  19. int get_clocks(void)
  20. {
  21. gd->bus_clk = CONFIG_SYS_CLK;
  22. gd->cpu_clk = (gd->bus_clk * 2);
  23. #ifdef CONFIG_SYS_I2C_FSL
  24. gd->arch.i2c1_clk = gd->bus_clk;
  25. #endif
  26. return (0);
  27. }