clk.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. *
  4. * Copyright (C) 2010 John Crispin <[email protected]>
  5. */
  6. #ifndef _LTQ_CLK_H__
  7. #define _LTQ_CLK_H__
  8. #include <linux/clkdev.h>
  9. /* clock speeds */
  10. #define CLOCK_33M 33333333
  11. #define CLOCK_60M 60000000
  12. #define CLOCK_62_5M 62500000
  13. #define CLOCK_83M 83333333
  14. #define CLOCK_83_5M 83500000
  15. #define CLOCK_98_304M 98304000
  16. #define CLOCK_100M 100000000
  17. #define CLOCK_111M 111111111
  18. #define CLOCK_125M 125000000
  19. #define CLOCK_133M 133333333
  20. #define CLOCK_150M 150000000
  21. #define CLOCK_166M 166666666
  22. #define CLOCK_167M 166666667
  23. #define CLOCK_196_608M 196608000
  24. #define CLOCK_200M 200000000
  25. #define CLOCK_222M 222000000
  26. #define CLOCK_240M 240000000
  27. #define CLOCK_250M 250000000
  28. #define CLOCK_266M 266666666
  29. #define CLOCK_288M 288888888
  30. #define CLOCK_300M 300000000
  31. #define CLOCK_333M 333333333
  32. #define CLOCK_360M 360000000
  33. #define CLOCK_393M 393215332
  34. #define CLOCK_400M 400000000
  35. #define CLOCK_432M 432000000
  36. #define CLOCK_450M 450000000
  37. #define CLOCK_500M 500000000
  38. #define CLOCK_600M 600000000
  39. #define CLOCK_666M 666666666
  40. #define CLOCK_720M 720000000
  41. /* clock out speeds */
  42. #define CLOCK_32_768K 32768
  43. #define CLOCK_1_536M 1536000
  44. #define CLOCK_2_5M 2500000
  45. #define CLOCK_12M 12000000
  46. #define CLOCK_24M 24000000
  47. #define CLOCK_25M 25000000
  48. #define CLOCK_30M 30000000
  49. #define CLOCK_40M 40000000
  50. #define CLOCK_48M 48000000
  51. #define CLOCK_50M 50000000
  52. #define CLOCK_60M 60000000
  53. struct clk {
  54. struct clk_lookup cl;
  55. unsigned long rate;
  56. unsigned long *rates;
  57. unsigned int module;
  58. unsigned int bits;
  59. unsigned long (*get_rate) (void);
  60. int (*enable) (struct clk *clk);
  61. void (*disable) (struct clk *clk);
  62. int (*activate) (struct clk *clk);
  63. void (*deactivate) (struct clk *clk);
  64. void (*reboot) (struct clk *clk);
  65. };
  66. extern void clkdev_add_static(unsigned long cpu, unsigned long fpi,
  67. unsigned long io, unsigned long ppe);
  68. extern unsigned long ltq_danube_cpu_hz(void);
  69. extern unsigned long ltq_danube_fpi_hz(void);
  70. extern unsigned long ltq_danube_pp32_hz(void);
  71. extern unsigned long ltq_ar9_cpu_hz(void);
  72. extern unsigned long ltq_ar9_fpi_hz(void);
  73. extern unsigned long ltq_vr9_cpu_hz(void);
  74. extern unsigned long ltq_vr9_fpi_hz(void);
  75. extern unsigned long ltq_vr9_pp32_hz(void);
  76. extern unsigned long ltq_ar10_cpu_hz(void);
  77. extern unsigned long ltq_ar10_fpi_hz(void);
  78. extern unsigned long ltq_ar10_pp32_hz(void);
  79. extern unsigned long ltq_grx390_cpu_hz(void);
  80. extern unsigned long ltq_grx390_fpi_hz(void);
  81. extern unsigned long ltq_grx390_pp32_hz(void);
  82. #endif