]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: amlogic: g12b: fix cluster A parent data
authorJerome Brunet <jbrunet@baylibre.com>
Fri, 13 Dec 2024 14:30:17 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:30:57 +0000 (14:30 +0200)
[ Upstream commit 8995f8f108c3ac5ad52b12a6cfbbc7b3b32e9a58 ]

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: 25e682a02d91 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/meson/g12a.c

index 2876bb83d9d0edc1b7c8c728b8b6f1846a4701da..870cac6dd04537c85a6d4bb1f44b46e9439852ef 100644 (file)
@@ -1135,8 +1135,18 @@ static struct clk_regmap g12a_cpu_clk_div16_en = {
        .hw.init = &(struct clk_init_data) {
                .name = "cpu_clk_div16_en",
                .ops = &clk_regmap_gate_ro_ops,
-               .parent_hws = (const struct clk_hw *[]) {
-                       &g12a_cpu_clk.hw
+               .parent_data = &(const struct clk_parent_data) {
+                       /*
+                        * Note:
+                        * G12A and G12B have different cpu clocks (with
+                        * different struct clk_hw). We fallback to the global
+                        * naming string mechanism so this clock picks
+                        * up the appropriate one. Same goes for the other
+                        * clock using cpu cluster A clock output and present
+                        * on both G12 variant.
+                        */
+                       .name = "cpu_clk",
+                       .index = -1,
                },
                .num_parents = 1,
                /*
@@ -1201,7 +1211,10 @@ static struct clk_regmap g12a_cpu_clk_apb_div = {
        .hw.init = &(struct clk_init_data){
                .name = "cpu_clk_apb_div",
                .ops = &clk_regmap_divider_ro_ops,
-               .parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
+               .parent_data = &(const struct clk_parent_data) {
+                       .name = "cpu_clk",
+                       .index = -1,
+               },
                .num_parents = 1,
        },
 };
@@ -1235,7 +1248,10 @@ static struct clk_regmap g12a_cpu_clk_atb_div = {
        .hw.init = &(struct clk_init_data){
                .name = "cpu_clk_atb_div",
                .ops = &clk_regmap_divider_ro_ops,
-               .parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
+               .parent_data = &(const struct clk_parent_data) {
+                       .name = "cpu_clk",
+                       .index = -1,
+               },
                .num_parents = 1,
        },
 };
@@ -1269,7 +1285,10 @@ static struct clk_regmap g12a_cpu_clk_axi_div = {
        .hw.init = &(struct clk_init_data){
                .name = "cpu_clk_axi_div",
                .ops = &clk_regmap_divider_ro_ops,
-               .parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
+               .parent_data = &(const struct clk_parent_data) {
+                       .name = "cpu_clk",
+                       .index = -1,
+               },
                .num_parents = 1,
        },
 };
@@ -1304,13 +1323,6 @@ static struct clk_regmap g12a_cpu_clk_trace_div = {
                .name = "cpu_clk_trace_div",
                .ops = &clk_regmap_divider_ro_ops,
                .parent_data = &(const struct clk_parent_data) {
-                       /*
-                        * Note:
-                        * G12A and G12B have different cpu_clks (with
-                        * different struct clk_hw). We fallback to the global
-                        * naming string mechanism so cpu_clk_trace_div picks
-                        * up the appropriate one.
-                        */
                        .name = "cpu_clk",
                        .index = -1,
                },