common.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Marvell EBU SoC common clock handling
  3. *
  4. * Copyright (C) 2012 Marvell
  5. *
  6. * Gregory CLEMENT <gregory.clement@free-electrons.com>
  7. * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  8. * Andrew Lunn <andrew@lunn.ch>
  9. *
  10. * This file is licensed under the terms of the GNU General Public
  11. * License version 2. This program is licensed "as is" without any
  12. * warranty of any kind, whether express or implied.
  13. */
  14. #ifndef __CLK_MVEBU_COMMON_H_
  15. #define __CLK_MVEBU_COMMON_H_
  16. #include <linux/kernel.h>
  17. struct device_node;
  18. struct coreclk_ratio {
  19. int id;
  20. const char *name;
  21. };
  22. struct coreclk_soc_desc {
  23. u32 (*get_tclk_freq)(void __iomem *sar);
  24. u32 (*get_cpu_freq)(void __iomem *sar);
  25. void (*get_clk_ratio)(void __iomem *sar, int id, int *mult, int *div);
  26. const struct coreclk_ratio *ratios;
  27. int num_ratios;
  28. };
  29. struct clk_gating_soc_desc {
  30. const char *name;
  31. const char *parent;
  32. int bit_idx;
  33. unsigned long flags;
  34. };
  35. void __init mvebu_coreclk_setup(struct device_node *np,
  36. const struct coreclk_soc_desc *desc);
  37. void __init mvebu_clk_gating_setup(struct device_node *np,
  38. const struct clk_gating_soc_desc *desc);
  39. #endif