stratix10-clk.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2017, Intel Corporation
  4. */
  5. #ifndef __STRATIX10_CLK_H
  6. #define __STRATIX10_CLK_H
  7. struct stratix10_clock_data {
  8. void __iomem *base;
  9. /* Must be last */
  10. struct clk_hw_onecell_data clk_data;
  11. };
  12. struct stratix10_pll_clock {
  13. unsigned int id;
  14. const char *name;
  15. const struct clk_parent_data *parent_data;
  16. u8 num_parents;
  17. unsigned long flags;
  18. unsigned long offset;
  19. };
  20. struct stratix10_perip_c_clock {
  21. unsigned int id;
  22. const char *name;
  23. const char *parent_name;
  24. const struct clk_parent_data *parent_data;
  25. u8 num_parents;
  26. unsigned long flags;
  27. unsigned long offset;
  28. };
  29. struct n5x_perip_c_clock {
  30. unsigned int id;
  31. const char *name;
  32. const char *parent_name;
  33. const char *const *parent_names;
  34. u8 num_parents;
  35. unsigned long flags;
  36. unsigned long offset;
  37. unsigned long shift;
  38. };
  39. struct stratix10_perip_cnt_clock {
  40. unsigned int id;
  41. const char *name;
  42. const char *parent_name;
  43. const struct clk_parent_data *parent_data;
  44. u8 num_parents;
  45. unsigned long flags;
  46. unsigned long offset;
  47. u8 fixed_divider;
  48. unsigned long bypass_reg;
  49. unsigned long bypass_shift;
  50. };
  51. struct stratix10_gate_clock {
  52. unsigned int id;
  53. const char *name;
  54. const char *parent_name;
  55. const struct clk_parent_data *parent_data;
  56. u8 num_parents;
  57. unsigned long flags;
  58. unsigned long gate_reg;
  59. u8 gate_idx;
  60. unsigned long div_reg;
  61. u8 div_offset;
  62. u8 div_width;
  63. unsigned long bypass_reg;
  64. u8 bypass_shift;
  65. u8 fixed_div;
  66. };
  67. struct clk_hw *s10_register_pll(const struct stratix10_pll_clock *clks,
  68. void __iomem *reg);
  69. struct clk_hw *agilex_register_pll(const struct stratix10_pll_clock *clks,
  70. void __iomem *reg);
  71. struct clk_hw *n5x_register_pll(const struct stratix10_pll_clock *clks,
  72. void __iomem *reg);
  73. struct clk_hw *s10_register_periph(const struct stratix10_perip_c_clock *clks,
  74. void __iomem *reg);
  75. struct clk_hw *n5x_register_periph(const struct n5x_perip_c_clock *clks,
  76. void __iomem *reg);
  77. struct clk_hw *s10_register_cnt_periph(const struct stratix10_perip_cnt_clock *clks,
  78. void __iomem *reg);
  79. struct clk_hw *s10_register_gate(const struct stratix10_gate_clock *clks,
  80. void __iomem *reg);
  81. struct clk_hw *agilex_register_gate(const struct stratix10_gate_clock *clks,
  82. void __iomem *reg);
  83. #endif /* __STRATIX10_CLK_H */