exynos-cpufreq.h 1.3 KB

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