clock.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * keystone2: common clock header file
  3. *
  4. * (C) Copyright 2012-2014
  5. * Texas Instruments Incorporated, <www.ti.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __ASM_ARCH_CLOCK_H
  10. #define __ASM_ARCH_CLOCK_H
  11. #ifndef __ASSEMBLY__
  12. #ifdef CONFIG_SOC_K2HK
  13. #include <asm/arch/clock-k2hk.h>
  14. #endif
  15. #ifdef CONFIG_SOC_K2E
  16. #include <asm/arch/clock-k2e.h>
  17. #endif
  18. #define MAIN_PLL CORE_PLL
  19. #include <asm/types.h>
  20. struct keystone_pll_regs {
  21. u32 reg0;
  22. u32 reg1;
  23. };
  24. /* PLL configuration data */
  25. struct pll_init_data {
  26. int pll;
  27. int pll_m; /* PLL Multiplier */
  28. int pll_d; /* PLL divider */
  29. int pll_od; /* PLL output divider */
  30. };
  31. extern const struct keystone_pll_regs keystone_pll_regs[];
  32. extern int dev_speeds[];
  33. extern int arm_speeds[];
  34. void init_plls(int num_pll, struct pll_init_data *config);
  35. void init_pll(const struct pll_init_data *data);
  36. unsigned long clk_get_rate(unsigned int clk);
  37. unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
  38. int clk_set_rate(unsigned int clk, unsigned long hz);
  39. int get_max_dev_speed(void);
  40. int get_max_arm_speed(void);
  41. #endif
  42. #endif