clock.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #ifdef CONFIG_SOC_K2L
  19. #include <asm/arch/clock-k2l.h>
  20. #endif
  21. #define MAIN_PLL CORE_PLL
  22. #include <asm/types.h>
  23. #define GENERATE_ENUM(NUM, ENUM) ENUM = NUM,
  24. #define GENERATE_INDX_STR(NUM, STRING) #NUM"\t- "#STRING"\n"
  25. #define CLOCK_INDEXES_LIST CLK_LIST(GENERATE_INDX_STR)
  26. enum clk_e {
  27. CLK_LIST(GENERATE_ENUM)
  28. };
  29. struct keystone_pll_regs {
  30. u32 reg0;
  31. u32 reg1;
  32. };
  33. /* PLL configuration data */
  34. struct pll_init_data {
  35. int pll;
  36. int pll_m; /* PLL Multiplier */
  37. int pll_d; /* PLL divider */
  38. int pll_od; /* PLL output divider */
  39. };
  40. extern const struct keystone_pll_regs keystone_pll_regs[];
  41. extern int dev_speeds[];
  42. extern int arm_speeds[];
  43. void init_plls(int num_pll, struct pll_init_data *config);
  44. void init_pll(const struct pll_init_data *data);
  45. unsigned long clk_get_rate(unsigned int clk);
  46. unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
  47. int clk_set_rate(unsigned int clk, unsigned long hz);
  48. void pass_pll_pa_clk_enable(void);
  49. int get_max_dev_speed(void);
  50. int get_max_arm_speed(void);
  51. #endif
  52. #endif