Skip to content

Commit 72ceafb

Browse files
Md Sadre Alamandersson
authored andcommitted
clk: qcom: gcc-ipq9574: Add BRANCH_HALT_VOTED flag
The crypto_ahb and crypto_axi clks are hardware voteable. This means that the halt bit isn't reliable because some other voter in the system, e.g. TrustZone, could be keeping the clk enabled when the kernel turns it off from clk_disable(). Make these clks use voting mode by changing the halt check to BRANCH_HALT_VOTED and toggle the voting bit in the voting register instead of directly controlling the branch by writing to the branch register. This fixes stuck clk warnings seen on ipq9574 and saves power by actually turning the clk off. Also changes the CRYPTO_AHB_CLK_ENA & CRYPTO_AXI_CLK_ENA offset to 0xb004 from 0x16014. Cc: [email protected] Fixes: f6b2bd9 ("clk: qcom: gcc-ipq9574: Enable crypto clocks") Signed-off-by: Md Sadre Alam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 2ba8425 commit 72ceafb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/clk/qcom/gcc-ipq9574.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,9 +2140,10 @@ static struct clk_rcg2 pcnoc_bfdcd_clk_src = {
21402140

21412141
static struct clk_branch gcc_crypto_axi_clk = {
21422142
.halt_reg = 0x16010,
2143+
.halt_check = BRANCH_HALT_VOTED,
21432144
.clkr = {
2144-
.enable_reg = 0x16010,
2145-
.enable_mask = BIT(0),
2145+
.enable_reg = 0xb004,
2146+
.enable_mask = BIT(15),
21462147
.hw.init = &(const struct clk_init_data) {
21472148
.name = "gcc_crypto_axi_clk",
21482149
.parent_hws = (const struct clk_hw *[]) {
@@ -2156,9 +2157,10 @@ static struct clk_branch gcc_crypto_axi_clk = {
21562157

21572158
static struct clk_branch gcc_crypto_ahb_clk = {
21582159
.halt_reg = 0x16014,
2160+
.halt_check = BRANCH_HALT_VOTED,
21592161
.clkr = {
2160-
.enable_reg = 0x16014,
2161-
.enable_mask = BIT(0),
2162+
.enable_reg = 0xb004,
2163+
.enable_mask = BIT(16),
21622164
.hw.init = &(const struct clk_init_data) {
21632165
.name = "gcc_crypto_ahb_clk",
21642166
.parent_hws = (const struct clk_hw *[]) {

0 commit comments

Comments
 (0)