clk: meson: add fdiv clock gates
Fdiv fixed dividers clocks of the fixed_pll can actually gate independently. We never had an issue so far because these clocks were provided 'enabled' by the bootloader. Add these gates to enable/disable the clocks when required. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:

committed by
Neil Armstrong

parent
513b67ac39
commit
05f814402d
@@ -490,61 +490,126 @@ static struct clk_regmap gxl_gp0_pll = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div2 = {
|
||||
static struct clk_fixed_factor gxbb_fclk_div2_div = {
|
||||
.mult = 1,
|
||||
.div = 2,
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div2",
|
||||
.name = "fclk_div2_div",
|
||||
.ops = &clk_fixed_factor_ops,
|
||||
.parent_names = (const char *[]){ "fixed_pll" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div3 = {
|
||||
static struct clk_regmap gxbb_fclk_div2 = {
|
||||
.data = &(struct clk_regmap_gate_data){
|
||||
.offset = HHI_MPLL_CNTL6,
|
||||
.bit_idx = 27,
|
||||
},
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div2",
|
||||
.ops = &clk_regmap_gate_ops,
|
||||
.parent_names = (const char *[]){ "fclk_div2_div" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div3_div = {
|
||||
.mult = 1,
|
||||
.div = 3,
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div3",
|
||||
.name = "fclk_div3_div",
|
||||
.ops = &clk_fixed_factor_ops,
|
||||
.parent_names = (const char *[]){ "fixed_pll" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div4 = {
|
||||
static struct clk_regmap gxbb_fclk_div3 = {
|
||||
.data = &(struct clk_regmap_gate_data){
|
||||
.offset = HHI_MPLL_CNTL6,
|
||||
.bit_idx = 28,
|
||||
},
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div3",
|
||||
.ops = &clk_regmap_gate_ops,
|
||||
.parent_names = (const char *[]){ "fclk_div3_div" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div4_div = {
|
||||
.mult = 1,
|
||||
.div = 4,
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div4",
|
||||
.name = "fclk_div4_div",
|
||||
.ops = &clk_fixed_factor_ops,
|
||||
.parent_names = (const char *[]){ "fixed_pll" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div5 = {
|
||||
static struct clk_regmap gxbb_fclk_div4 = {
|
||||
.data = &(struct clk_regmap_gate_data){
|
||||
.offset = HHI_MPLL_CNTL6,
|
||||
.bit_idx = 29,
|
||||
},
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div4",
|
||||
.ops = &clk_regmap_gate_ops,
|
||||
.parent_names = (const char *[]){ "fclk_div4_div" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div5_div = {
|
||||
.mult = 1,
|
||||
.div = 5,
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div5",
|
||||
.name = "fclk_div5_div",
|
||||
.ops = &clk_fixed_factor_ops,
|
||||
.parent_names = (const char *[]){ "fixed_pll" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div7 = {
|
||||
static struct clk_regmap gxbb_fclk_div5 = {
|
||||
.data = &(struct clk_regmap_gate_data){
|
||||
.offset = HHI_MPLL_CNTL6,
|
||||
.bit_idx = 30,
|
||||
},
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div5",
|
||||
.ops = &clk_regmap_gate_ops,
|
||||
.parent_names = (const char *[]){ "fclk_div5_div" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_fixed_factor gxbb_fclk_div7_div = {
|
||||
.mult = 1,
|
||||
.div = 7,
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div7",
|
||||
.name = "fclk_div7_div",
|
||||
.ops = &clk_fixed_factor_ops,
|
||||
.parent_names = (const char *[]){ "fixed_pll" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_regmap gxbb_fclk_div7 = {
|
||||
.data = &(struct clk_regmap_gate_data){
|
||||
.offset = HHI_MPLL_CNTL6,
|
||||
.bit_idx = 31,
|
||||
},
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "fclk_div7",
|
||||
.ops = &clk_regmap_gate_ops,
|
||||
.parent_names = (const char *[]){ "fclk_div7_div" },
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_regmap gxbb_mpll_prediv = {
|
||||
.data = &(struct clk_regmap_div_data){
|
||||
.offset = HHI_MPLL_CNTL5,
|
||||
@@ -1718,6 +1783,11 @@ static struct clk_hw_onecell_data gxbb_hw_onecell_data = {
|
||||
[CLKID_MPLL1_DIV] = &gxbb_mpll1_div.hw,
|
||||
[CLKID_MPLL2_DIV] = &gxbb_mpll2_div.hw,
|
||||
[CLKID_MPLL_PREDIV] = &gxbb_mpll_prediv.hw,
|
||||
[CLKID_FCLK_DIV2_DIV] = &gxbb_fclk_div2_div.hw,
|
||||
[CLKID_FCLK_DIV3_DIV] = &gxbb_fclk_div3_div.hw,
|
||||
[CLKID_FCLK_DIV4_DIV] = &gxbb_fclk_div4_div.hw,
|
||||
[CLKID_FCLK_DIV5_DIV] = &gxbb_fclk_div5_div.hw,
|
||||
[CLKID_FCLK_DIV7_DIV] = &gxbb_fclk_div7_div.hw,
|
||||
[NR_CLKS] = NULL,
|
||||
},
|
||||
.num = NR_CLKS,
|
||||
@@ -1869,6 +1939,11 @@ static struct clk_hw_onecell_data gxl_hw_onecell_data = {
|
||||
[CLKID_MPLL1_DIV] = &gxbb_mpll1_div.hw,
|
||||
[CLKID_MPLL2_DIV] = &gxbb_mpll2_div.hw,
|
||||
[CLKID_MPLL_PREDIV] = &gxbb_mpll_prediv.hw,
|
||||
[CLKID_FCLK_DIV2_DIV] = &gxbb_fclk_div2_div.hw,
|
||||
[CLKID_FCLK_DIV3_DIV] = &gxbb_fclk_div3_div.hw,
|
||||
[CLKID_FCLK_DIV4_DIV] = &gxbb_fclk_div4_div.hw,
|
||||
[CLKID_FCLK_DIV5_DIV] = &gxbb_fclk_div5_div.hw,
|
||||
[CLKID_FCLK_DIV7_DIV] = &gxbb_fclk_div7_div.hw,
|
||||
[NR_CLKS] = NULL,
|
||||
},
|
||||
.num = NR_CLKS,
|
||||
@@ -2022,6 +2097,11 @@ static struct clk_regmap *const gx_clk_regmaps[] = {
|
||||
&gxbb_fixed_pll,
|
||||
&gxbb_sys_pll,
|
||||
&gxbb_mpll_prediv,
|
||||
&gxbb_fclk_div2,
|
||||
&gxbb_fclk_div3,
|
||||
&gxbb_fclk_div4,
|
||||
&gxbb_fclk_div5,
|
||||
&gxbb_fclk_div7,
|
||||
};
|
||||
|
||||
struct clkc_data {
|
||||
|
Reference in New Issue
Block a user