rcar-gen3-cpg.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * R-Car Gen3 Clock Pulse Generator
  3. *
  4. * Copyright (C) 2015-2016 Glider bvba
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. */
  10. #ifndef __CLK_RENESAS_RCAR_GEN3_CPG_H__
  11. #define __CLK_RENESAS_RCAR_GEN3_CPG_H__
  12. enum rcar_gen3_clk_types {
  13. CLK_TYPE_GEN3_MAIN = CLK_TYPE_CUSTOM,
  14. CLK_TYPE_GEN3_PLL0,
  15. CLK_TYPE_GEN3_PLL1,
  16. CLK_TYPE_GEN3_PLL2,
  17. CLK_TYPE_GEN3_PLL3,
  18. CLK_TYPE_GEN3_PLL4,
  19. CLK_TYPE_GEN3_SD,
  20. CLK_TYPE_GEN3_R,
  21. };
  22. #define DEF_GEN3_SD(_name, _id, _parent, _offset) \
  23. DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
  24. struct rcar_gen3_cpg_pll_config {
  25. unsigned int extal_div;
  26. unsigned int pll1_mult;
  27. unsigned int pll3_mult;
  28. };
  29. #define CPG_RCKCR 0x240
  30. u32 rcar_gen3_read_mode_pins(void);
  31. struct clk *rcar_gen3_cpg_clk_register(struct device *dev,
  32. const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
  33. struct clk **clks, void __iomem *base);
  34. int rcar_gen3_cpg_init(const struct rcar_gen3_cpg_pll_config *config,
  35. unsigned int clk_extalr);
  36. #endif