Skip to content

Commit 8995f8f

Browse files
committed
clk: amlogic: g12b: fix cluster A parent data
Several clocks used by both g12a and g12b use the g12a cpu A clock hw pointer as clock parent. This is incorrect on g12b since the parents of cluster A cpu clock are different. Also the hw clock provided as parent to these children is not even registered clock on g12b. Fix the problem by reverting to the global namespace and let CCF pick the appropriate, as it is already done for other clocks, such as cpu_clk_trace_div. Fixes: 25e682a ("clk: meson: g12a: migrate to the new parent description method") Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20241213-amlogic-clk-g12a-cpua-parent-fix-v1-1-d8c0f41865fe@baylibre.com Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
1 parent 0079e77 commit 8995f8f

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

drivers/clk/meson/g12a.c

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,18 @@ static struct clk_regmap g12a_cpu_clk_div16_en = {
11371137
.hw.init = &(struct clk_init_data) {
11381138
.name = "cpu_clk_div16_en",
11391139
.ops = &clk_regmap_gate_ro_ops,
1140-
.parent_hws = (const struct clk_hw *[]) {
1141-
&g12a_cpu_clk.hw
1140+
.parent_data = &(const struct clk_parent_data) {
1141+
/*
1142+
* Note:
1143+
* G12A and G12B have different cpu clocks (with
1144+
* different struct clk_hw). We fallback to the global
1145+
* naming string mechanism so this clock picks
1146+
* up the appropriate one. Same goes for the other
1147+
* clock using cpu cluster A clock output and present
1148+
* on both G12 variant.
1149+
*/
1150+
.name = "cpu_clk",
1151+
.index = -1,
11421152
},
11431153
.num_parents = 1,
11441154
/*
@@ -1203,7 +1213,10 @@ static struct clk_regmap g12a_cpu_clk_apb_div = {
12031213
.hw.init = &(struct clk_init_data){
12041214
.name = "cpu_clk_apb_div",
12051215
.ops = &clk_regmap_divider_ro_ops,
1206-
.parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
1216+
.parent_data = &(const struct clk_parent_data) {
1217+
.name = "cpu_clk",
1218+
.index = -1,
1219+
},
12071220
.num_parents = 1,
12081221
},
12091222
};
@@ -1237,7 +1250,10 @@ static struct clk_regmap g12a_cpu_clk_atb_div = {
12371250
.hw.init = &(struct clk_init_data){
12381251
.name = "cpu_clk_atb_div",
12391252
.ops = &clk_regmap_divider_ro_ops,
1240-
.parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
1253+
.parent_data = &(const struct clk_parent_data) {
1254+
.name = "cpu_clk",
1255+
.index = -1,
1256+
},
12411257
.num_parents = 1,
12421258
},
12431259
};
@@ -1271,7 +1287,10 @@ static struct clk_regmap g12a_cpu_clk_axi_div = {
12711287
.hw.init = &(struct clk_init_data){
12721288
.name = "cpu_clk_axi_div",
12731289
.ops = &clk_regmap_divider_ro_ops,
1274-
.parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
1290+
.parent_data = &(const struct clk_parent_data) {
1291+
.name = "cpu_clk",
1292+
.index = -1,
1293+
},
12751294
.num_parents = 1,
12761295
},
12771296
};
@@ -1306,13 +1325,6 @@ static struct clk_regmap g12a_cpu_clk_trace_div = {
13061325
.name = "cpu_clk_trace_div",
13071326
.ops = &clk_regmap_divider_ro_ops,
13081327
.parent_data = &(const struct clk_parent_data) {
1309-
/*
1310-
* Note:
1311-
* G12A and G12B have different cpu_clks (with
1312-
* different struct clk_hw). We fallback to the global
1313-
* naming string mechanism so cpu_clk_trace_div picks
1314-
* up the appropriate one.
1315-
*/
13161328
.name = "cpu_clk",
13171329
.index = -1,
13181330
},

0 commit comments

Comments
 (0)