2018-03-21 22:20:12 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2017, Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __STRATIX10_CLK_H
|
|
|
|
#define __STRATIX10_CLK_H
|
|
|
|
|
|
|
|
struct stratix10_clock_data {
|
2021-03-03 05:41:51 +08:00
|
|
|
struct clk_hw_onecell_data clk_data;
|
2018-03-21 22:20:12 +08:00
|
|
|
void __iomem *base;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct stratix10_pll_clock {
|
|
|
|
unsigned int id;
|
|
|
|
const char *name;
|
2020-05-13 02:16:43 +08:00
|
|
|
const struct clk_parent_data *parent_data;
|
2018-03-21 22:20:12 +08:00
|
|
|
u8 num_parents;
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct stratix10_perip_c_clock {
|
|
|
|
unsigned int id;
|
|
|
|
const char *name;
|
|
|
|
const char *parent_name;
|
2020-05-13 02:16:43 +08:00
|
|
|
const struct clk_parent_data *parent_data;
|
2018-03-21 22:20:12 +08:00
|
|
|
u8 num_parents;
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long offset;
|
|
|
|
};
|
|
|
|
|
2021-02-12 22:30:59 +08:00
|
|
|
struct n5x_perip_c_clock {
|
|
|
|
unsigned int id;
|
|
|
|
const char *name;
|
|
|
|
const char *parent_name;
|
|
|
|
const char *const *parent_names;
|
|
|
|
u8 num_parents;
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long offset;
|
|
|
|
unsigned long shift;
|
|
|
|
};
|
|
|
|
|
2018-03-21 22:20:12 +08:00
|
|
|
struct stratix10_perip_cnt_clock {
|
|
|
|
unsigned int id;
|
|
|
|
const char *name;
|
|
|
|
const char *parent_name;
|
2020-05-13 02:16:43 +08:00
|
|
|
const struct clk_parent_data *parent_data;
|
2018-03-21 22:20:12 +08:00
|
|
|
u8 num_parents;
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long offset;
|
|
|
|
u8 fixed_divider;
|
|
|
|
unsigned long bypass_reg;
|
|
|
|
unsigned long bypass_shift;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct stratix10_gate_clock {
|
|
|
|
unsigned int id;
|
|
|
|
const char *name;
|
|
|
|
const char *parent_name;
|
2020-05-13 02:16:43 +08:00
|
|
|
const struct clk_parent_data *parent_data;
|
2018-03-21 22:20:12 +08:00
|
|
|
u8 num_parents;
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long gate_reg;
|
|
|
|
u8 gate_idx;
|
|
|
|
unsigned long div_reg;
|
|
|
|
u8 div_offset;
|
|
|
|
u8 div_width;
|
|
|
|
unsigned long bypass_reg;
|
|
|
|
u8 bypass_shift;
|
|
|
|
u8 fixed_div;
|
|
|
|
};
|
|
|
|
|
2021-03-03 05:41:51 +08:00
|
|
|
struct clk_hw *s10_register_pll(const struct stratix10_pll_clock *clks,
|
2021-02-12 22:30:59 +08:00
|
|
|
void __iomem *reg);
|
2021-03-03 05:41:51 +08:00
|
|
|
struct clk_hw *agilex_register_pll(const struct stratix10_pll_clock *clks,
|
2021-02-12 22:30:59 +08:00
|
|
|
void __iomem *reg);
|
2021-03-03 05:41:51 +08:00
|
|
|
struct clk_hw *n5x_register_pll(const struct stratix10_pll_clock *clks,
|
|
|
|
void __iomem *reg);
|
|
|
|
struct clk_hw *s10_register_periph(const struct stratix10_perip_c_clock *clks,
|
|
|
|
void __iomem *reg);
|
|
|
|
struct clk_hw *n5x_register_periph(const struct n5x_perip_c_clock *clks,
|
2021-02-12 22:30:59 +08:00
|
|
|
void __iomem *reg);
|
2021-03-03 05:41:51 +08:00
|
|
|
struct clk_hw *s10_register_cnt_periph(const struct stratix10_perip_cnt_clock *clks,
|
|
|
|
void __iomem *reg);
|
|
|
|
struct clk_hw *s10_register_gate(const struct stratix10_gate_clock *clks,
|
|
|
|
void __iomem *reg);
|
2021-06-11 10:52:00 +08:00
|
|
|
struct clk_hw *agilex_register_gate(const struct stratix10_gate_clock *clks,
|
|
|
|
void __iomem *reg);
|
2018-03-21 22:20:12 +08:00
|
|
|
#endif /* __STRATIX10_CLK_H */
|