cpufreq.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* linux/arch/arm/mach-exynos/include/mach/cpufreq.h
  2. *
  3. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com
  5. *
  6. * EXYNOS - CPUFreq support
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. enum cpufreq_level_index {
  13. L0, L1, L2, L3, L4,
  14. L5, L6, L7, L8, L9,
  15. L10, L11, L12, L13, L14,
  16. L15, L16, L17, L18, L19,
  17. L20,
  18. };
  19. #define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s) \
  20. { \
  21. .freq = (f) * 1000, \
  22. .clk_div_cpu0 = ((a0) | (a1) << 4 | (a2) << 8 | (a3) << 12 | \
  23. (a4) << 16 | (a5) << 20 | (a6) << 24 | (a7) << 28), \
  24. .clk_div_cpu1 = (b0 << 0 | b1 << 4 | b2 << 8), \
  25. .mps = ((m) << 16 | (p) << 8 | (s)), \
  26. }
  27. struct apll_freq {
  28. unsigned int freq;
  29. u32 clk_div_cpu0;
  30. u32 clk_div_cpu1;
  31. u32 mps;
  32. };
  33. struct exynos_dvfs_info {
  34. unsigned long mpll_freq_khz;
  35. unsigned int pll_safe_idx;
  36. struct clk *cpu_clk;
  37. unsigned int *volt_table;
  38. struct cpufreq_frequency_table *freq_table;
  39. void (*set_freq)(unsigned int, unsigned int);
  40. bool (*need_apll_change)(unsigned int, unsigned int);
  41. };
  42. extern int exynos4210_cpufreq_init(struct exynos_dvfs_info *);
  43. extern int exynos4x12_cpufreq_init(struct exynos_dvfs_info *);
  44. extern int exynos5250_cpufreq_init(struct exynos_dvfs_info *);