Skip to content

Commit 07fbf0e

Browse files
committed
Merge tag 'clk-meson-v5.8-1' of https://github.com/BayLibre/clk-meson into clk-amlogic
Pull Amlogic clk driver updates from Jerome Brunet: - Meson8b: Updates and fixup HDMI and video clocks - Meson8b: Fixup reset polarity - Meson gx and g12: fix GPU glitch free mux switch * tag 'clk-meson-v5.8-1' of https://github.com/BayLibre/clk-meson: clk: meson: meson8b: Don't rely on u-boot to init all GP_PLL registers clk: meson: meson8b: Make the CCF use the glitch-free VPU mux clk: meson: meson8b: Fix the vclk_div{1, 2, 4, 6, 12}_en gate bits clk: meson: meson8b: Fix the polarity of the RESET_N lines clk: meson: meson8b: Fix the first parent of vid_pll_in_sel clk: meson: g12a: Prepare the GPU clock tree to change at runtime clk: meson: gxbb: Prepare the GPU clock tree to change at runtime clk: meson: meson8b: make the hdmi_sys clock tree mutable clk: meson8b: export the HDMI system clock
2 parents 8f3d9f3 + a29ae86 commit 07fbf0e

File tree

5 files changed

+134
-62
lines changed

5 files changed

+134
-62
lines changed

drivers/clk/meson/g12a.c

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,7 +3702,9 @@ static struct clk_regmap g12a_hdmi = {
37023702

37033703
/*
37043704
* The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
3705-
* muxed by a glitch-free switch.
3705+
* muxed by a glitch-free switch. The CCF can manage this glitch-free
3706+
* mux because it does top-to-bottom updates the each clock tree and
3707+
* switches to the "inactive" one when CLK_SET_RATE_GATE is set.
37063708
*/
37073709
static const struct clk_parent_data g12a_mali_0_1_parent_data[] = {
37083710
{ .fw_name = "xtal", },
@@ -3726,7 +3728,13 @@ static struct clk_regmap g12a_mali_0_sel = {
37263728
.ops = &clk_regmap_mux_ops,
37273729
.parent_data = g12a_mali_0_1_parent_data,
37283730
.num_parents = 8,
3729-
.flags = CLK_SET_RATE_NO_REPARENT,
3731+
/*
3732+
* Don't request the parent to change the rate because
3733+
* all GPU frequencies can be derived from the fclk_*
3734+
* clocks and one special GP0_PLL setting. This is
3735+
* important because we need the MPLL clocks for audio.
3736+
*/
3737+
.flags = 0,
37303738
},
37313739
};
37323740

@@ -3743,7 +3751,7 @@ static struct clk_regmap g12a_mali_0_div = {
37433751
&g12a_mali_0_sel.hw
37443752
},
37453753
.num_parents = 1,
3746-
.flags = CLK_SET_RATE_NO_REPARENT,
3754+
.flags = CLK_SET_RATE_PARENT,
37473755
},
37483756
};
37493757

@@ -3759,7 +3767,7 @@ static struct clk_regmap g12a_mali_0 = {
37593767
&g12a_mali_0_div.hw
37603768
},
37613769
.num_parents = 1,
3762-
.flags = CLK_SET_RATE_PARENT,
3770+
.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
37633771
},
37643772
};
37653773

@@ -3774,7 +3782,13 @@ static struct clk_regmap g12a_mali_1_sel = {
37743782
.ops = &clk_regmap_mux_ops,
37753783
.parent_data = g12a_mali_0_1_parent_data,
37763784
.num_parents = 8,
3777-
.flags = CLK_SET_RATE_NO_REPARENT,
3785+
/*
3786+
* Don't request the parent to change the rate because
3787+
* all GPU frequencies can be derived from the fclk_*
3788+
* clocks and one special GP0_PLL setting. This is
3789+
* important because we need the MPLL clocks for audio.
3790+
*/
3791+
.flags = 0,
37783792
},
37793793
};
37803794

@@ -3791,7 +3805,7 @@ static struct clk_regmap g12a_mali_1_div = {
37913805
&g12a_mali_1_sel.hw
37923806
},
37933807
.num_parents = 1,
3794-
.flags = CLK_SET_RATE_NO_REPARENT,
3808+
.flags = CLK_SET_RATE_PARENT,
37953809
},
37963810
};
37973811

@@ -3807,7 +3821,7 @@ static struct clk_regmap g12a_mali_1 = {
38073821
&g12a_mali_1_div.hw
38083822
},
38093823
.num_parents = 1,
3810-
.flags = CLK_SET_RATE_PARENT,
3824+
.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
38113825
},
38123826
};
38133827

@@ -3827,7 +3841,7 @@ static struct clk_regmap g12a_mali = {
38273841
.ops = &clk_regmap_mux_ops,
38283842
.parent_hws = g12a_mali_parent_hws,
38293843
.num_parents = 2,
3830-
.flags = CLK_SET_RATE_NO_REPARENT,
3844+
.flags = CLK_SET_RATE_PARENT,
38313845
},
38323846
};
38333847

drivers/clk/meson/gxbb.c

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,9 @@ static struct clk_regmap gxbb_sar_adc_clk = {
957957

958958
/*
959959
* The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
960-
* muxed by a glitch-free switch.
960+
* muxed by a glitch-free switch. The CCF can manage this glitch-free
961+
* mux because it does top-to-bottom updates the each clock tree and
962+
* switches to the "inactive" one when CLK_SET_RATE_GATE is set.
961963
*/
962964

963965
static const struct clk_parent_data gxbb_mali_0_1_parent_data[] = {
@@ -980,14 +982,15 @@ static struct clk_regmap gxbb_mali_0_sel = {
980982
.hw.init = &(struct clk_init_data){
981983
.name = "mali_0_sel",
982984
.ops = &clk_regmap_mux_ops,
983-
/*
984-
* bits 10:9 selects from 8 possible parents:
985-
* xtal, gp0_pll, mpll2, mpll1, fclk_div7,
986-
* fclk_div4, fclk_div3, fclk_div5
987-
*/
988985
.parent_data = gxbb_mali_0_1_parent_data,
989986
.num_parents = 8,
990-
.flags = CLK_SET_RATE_NO_REPARENT,
987+
/*
988+
* Don't request the parent to change the rate because
989+
* all GPU frequencies can be derived from the fclk_*
990+
* clocks and one special GP0_PLL setting. This is
991+
* important because we need the MPLL clocks for audio.
992+
*/
993+
.flags = 0,
991994
},
992995
};
993996

@@ -1004,7 +1007,7 @@ static struct clk_regmap gxbb_mali_0_div = {
10041007
&gxbb_mali_0_sel.hw
10051008
},
10061009
.num_parents = 1,
1007-
.flags = CLK_SET_RATE_NO_REPARENT,
1010+
.flags = CLK_SET_RATE_PARENT,
10081011
},
10091012
};
10101013

@@ -1020,7 +1023,7 @@ static struct clk_regmap gxbb_mali_0 = {
10201023
&gxbb_mali_0_div.hw
10211024
},
10221025
.num_parents = 1,
1023-
.flags = CLK_SET_RATE_PARENT,
1026+
.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
10241027
},
10251028
};
10261029

@@ -1033,14 +1036,15 @@ static struct clk_regmap gxbb_mali_1_sel = {
10331036
.hw.init = &(struct clk_init_data){
10341037
.name = "mali_1_sel",
10351038
.ops = &clk_regmap_mux_ops,
1036-
/*
1037-
* bits 10:9 selects from 8 possible parents:
1038-
* xtal, gp0_pll, mpll2, mpll1, fclk_div7,
1039-
* fclk_div4, fclk_div3, fclk_div5
1040-
*/
10411039
.parent_data = gxbb_mali_0_1_parent_data,
10421040
.num_parents = 8,
1043-
.flags = CLK_SET_RATE_NO_REPARENT,
1041+
/*
1042+
* Don't request the parent to change the rate because
1043+
* all GPU frequencies can be derived from the fclk_*
1044+
* clocks and one special GP0_PLL setting. This is
1045+
* important because we need the MPLL clocks for audio.
1046+
*/
1047+
.flags = 0,
10441048
},
10451049
};
10461050

@@ -1057,7 +1061,7 @@ static struct clk_regmap gxbb_mali_1_div = {
10571061
&gxbb_mali_1_sel.hw
10581062
},
10591063
.num_parents = 1,
1060-
.flags = CLK_SET_RATE_NO_REPARENT,
1064+
.flags = CLK_SET_RATE_PARENT,
10611065
},
10621066
};
10631067

@@ -1073,7 +1077,7 @@ static struct clk_regmap gxbb_mali_1 = {
10731077
&gxbb_mali_1_div.hw
10741078
},
10751079
.num_parents = 1,
1076-
.flags = CLK_SET_RATE_PARENT,
1080+
.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
10771081
},
10781082
};
10791083

@@ -1093,7 +1097,7 @@ static struct clk_regmap gxbb_mali = {
10931097
.ops = &clk_regmap_mux_ops,
10941098
.parent_hws = gxbb_mali_parent_hws,
10951099
.num_parents = 2,
1096-
.flags = CLK_SET_RATE_NO_REPARENT,
1100+
.flags = CLK_SET_RATE_PARENT,
10971101
},
10981102
};
10991103

0 commit comments

Comments
 (0)