lede/target/linux/ipq60xx/patches-5.15/1003-clk-qcom-ipq6018-add-missing-clock-flags.patch
2023-12-18 22:25:24 +08:00

148 lines
4.6 KiB
Diff

From a9179aeead3fe0737b47d11ef687edc2dc15c964 Mon Sep 17 00:00:00 2001
From: Kathiravan T <kathirav@codeaurora.org>
Date: Fri, 6 Nov 2020 12:18:37 +0530
Subject: [PATCH 1003/1011] clk: qcom: ipq6018: add missing clock flags
The downstream QCA 5.4 kernel sets several extra clock flags. From
their reasoning:
Add the CLK_IS_CRITICAL, CLK_RCG2_HW_CONTROLLED for the required clocks.
Without the critical flag, below warning is seen when QDSS
components are enabled.
[ 1.712722] ------------[ cut here ]------------
[ 1.719039] gcc_qdss_dap_clk status stuck at 'on'
[ 1.719084] WARNING: CPU: 1 PID: 1 at drivers/clk/qcom/clk-branch.c:92 clk_branch_toggle+0x160/0x178
Signed-off-by: Kathiravan T <kathirav@codeaurora.org>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
drivers/clk/qcom/gcc-ipq6018.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
--- a/drivers/clk/qcom/gcc-ipq6018.c
+++ b/drivers/clk/qcom/gcc-ipq6018.c
@@ -62,6 +62,7 @@ static struct clk_alpha_pll gpll0_main =
},
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
+ .flags = CLK_IS_CRITICAL,
},
},
};
@@ -148,6 +149,7 @@ static struct clk_alpha_pll gpll6_main =
},
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
+ .flags = CLK_IS_CRITICAL,
},
},
};
@@ -178,6 +180,7 @@ static struct clk_alpha_pll gpll4_main =
},
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
+ .flags = CLK_IS_CRITICAL,
},
},
};
@@ -207,6 +210,7 @@ static struct clk_rcg2 pcnoc_bfdcd_clk_s
.freq_tbl = ftbl_pcnoc_bfdcd_clk_src,
.hid_width = 5,
.parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
+ .flags = CLK_RCG2_HW_CONTROLLED,
.clkr.hw.init = &(struct clk_init_data){
.name = "pcnoc_bfdcd_clk_src",
.parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
@@ -228,6 +232,7 @@ static struct clk_alpha_pll gpll2_main =
},
.num_parents = 1,
.ops = &clk_alpha_pll_ops,
+ .flags = CLK_IS_CRITICAL,
},
},
};
@@ -450,6 +455,7 @@ static struct clk_branch gcc_sleep_clk_s
},
.num_parents = 1,
.ops = &clk_branch2_ops,
+ .flags = CLK_IS_CRITICAL,
},
},
};
@@ -954,6 +960,7 @@ static struct clk_rcg2 nss_crypto_clk_sr
.mnd_width = 16,
.hid_width = 5,
.parent_map = gcc_xo_nss_crypto_pll_gpll0_map,
+ .flags = CLK_RCG2_HW_CONTROLLED,
.clkr.hw.init = &(struct clk_init_data){
.name = "nss_crypto_clk_src",
.parent_data = gcc_xo_nss_crypto_pll_gpll0,
@@ -1125,6 +1132,7 @@ static struct clk_rcg2 nss_ubi0_clk_src
.freq_tbl = ftbl_nss_ubi_clk_src,
.hid_width = 5,
.parent_map = gcc_xo_ubi32_gpll0_gpll2_gpll4_gpll6_map,
+ .flags = CLK_RCG2_HW_CONTROLLED,
.clkr.hw.init = &(struct clk_init_data){
.name = "nss_ubi0_clk_src",
.parent_data = gcc_xo_ubi32_pll_gpll0_gpll2_gpll4_gpll6,
@@ -1863,7 +1871,7 @@ static struct clk_branch gcc_apss_ahb_cl
.parent_hws = (const struct clk_hw *[]){
&apss_ahb_postdiv_clk_src.clkr.hw },
.num_parents = 1,
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
.ops = &clk_branch2_ops,
},
},
@@ -1885,11 +1893,13 @@ static struct clk_rcg2 system_noc_bfdcd_
.freq_tbl = ftbl_system_noc_bfdcd_clk_src,
.hid_width = 5,
.parent_map = gcc_xo_gpll0_gpll6_gpll0_out_main_div2_map,
+ .flags = CLK_RCG2_HW_CONTROLLED,
.clkr.hw.init = &(struct clk_init_data){
.name = "system_noc_bfdcd_clk_src",
.parent_data = gcc_xo_gpll0_gpll6_gpll0_out_main_div2,
.num_parents = 4,
.ops = &clk_rcg2_ops,
+ .flags = CLK_IS_CRITICAL,
},
};
@@ -1939,7 +1949,7 @@ static struct clk_branch gcc_apss_axi_cl
.parent_hws = (const struct clk_hw *[]){
&apss_axi_clk_src.clkr.hw },
.num_parents = 1,
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
.ops = &clk_branch2_ops,
},
},
@@ -2308,7 +2318,7 @@ static struct clk_branch gcc_xo_clk = {
.parent_hws = (const struct clk_hw *[]){
&gcc_xo_clk_src.clkr.hw },
.num_parents = 1,
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
.ops = &clk_branch2_ops,
},
},
@@ -3157,6 +3167,7 @@ static struct clk_branch gcc_nssnoc_ppe_
.name = "gcc_nssnoc_ppe_cfg_clk",
.parent_hws = (const struct clk_hw *[]){
&nss_ppe_clk_src.clkr.hw },
+ .num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
@@ -3515,7 +3526,7 @@ static struct clk_branch gcc_qdss_dap_cl
.parent_hws = (const struct clk_hw *[]){
&qdss_dap_sync_clk_src.hw },
.num_parents = 1,
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
.ops = &clk_branch2_ops,
},
},