Skip to content

Commit bef6e36

Browse files
committed
ipq807x: UBI related clock fixes
Add the missing PPE Crypto clock and fix the UBI clock enablement. This is a prerequisite for the NSS work. Signed-off-by: Robert Marko <[email protected]>
1 parent ea3930c commit bef6e36

File tree

2 files changed

+173
-0
lines changed

2 files changed

+173
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
From f05295ef5e58a042f3a66490f6e75c6af83a329f Mon Sep 17 00:00:00 2001
2+
From: Robert Marko <[email protected]>
3+
Date: Sun, 13 Mar 2022 12:46:28 +0100
4+
Subject: [PATCH] clk: qcom: ipq8074: add PPE crypto clock
5+
6+
The built-in PPE engine has a dedicated clock for the EIP-197 crypto
7+
engine.
8+
9+
So, since the required clock currently missing add support for it.
10+
11+
Signed-off-by: Robert Marko <[email protected]>
12+
---
13+
drivers/clk/qcom/gcc-ipq8074.c | 19 +++++++++++++++++++
14+
include/dt-bindings/clock/qcom,gcc-ipq8074.h | 1 +
15+
2 files changed, 20 insertions(+)
16+
17+
diff --git a/drivers/clk/qcom/gcc-ipq8074.c b/drivers/clk/qcom/gcc-ipq8074.c
18+
index c24e33321f72..6ece246f54a9 100644
19+
--- a/drivers/clk/qcom/gcc-ipq8074.c
20+
+++ b/drivers/clk/qcom/gcc-ipq8074.c
21+
@@ -3182,6 +3182,24 @@ static struct clk_branch gcc_nss_ptp_ref_clk = {
22+
},
23+
};
24+
25+
+static struct clk_branch gcc_crypto_ppe_clk = {
26+
+ .halt_reg = 0x68310,
27+
+ .halt_bit = 31,
28+
+ .clkr = {
29+
+ .enable_reg = 0x68310,
30+
+ .enable_mask = BIT(0),
31+
+ .hw.init = &(struct clk_init_data){
32+
+ .name = "gcc_crypto_ppe_clk",
33+
+ .parent_names = (const char *[]){
34+
+ "nss_ppe_clk_src"
35+
+ },
36+
+ .num_parents = 1,
37+
+ .flags = CLK_SET_RATE_PARENT,
38+
+ .ops = &clk_branch2_ops,
39+
+ },
40+
+ },
41+
+};
42+
+
43+
static struct clk_branch gcc_nssnoc_ce_apb_clk = {
44+
.halt_reg = 0x6830c,
45+
.clkr = {
46+
@@ -4644,6 +4662,7 @@ static struct clk_regmap *gcc_ipq8074_clks[] = {
47+
[GCC_PCIE0_RCHNG_CLK_SRC] = &pcie0_rchng_clk_src.clkr,
48+
[GCC_PCIE0_RCHNG_CLK] = &gcc_pcie0_rchng_clk.clkr,
49+
[GCC_PCIE0_AXI_S_BRIDGE_CLK] = &gcc_pcie0_axi_s_bridge_clk.clkr,
50+
+ [GCC_CRYPTO_PPE_CLK] = &gcc_crypto_ppe_clk.clkr,
51+
};
52+
53+
static const struct qcom_reset_map gcc_ipq8074_resets[] = {
54+
diff --git a/include/dt-bindings/clock/qcom,gcc-ipq8074.h b/include/dt-bindings/clock/qcom,gcc-ipq8074.h
55+
index 07402d970959..3ed155969c5d 100644
56+
--- a/include/dt-bindings/clock/qcom,gcc-ipq8074.h
57+
+++ b/include/dt-bindings/clock/qcom,gcc-ipq8074.h
58+
@@ -233,6 +233,7 @@
59+
#define GCC_PCIE0_AXI_S_BRIDGE_CLK 224
60+
#define GCC_PCIE0_RCHNG_CLK_SRC 225
61+
#define GCC_PCIE0_RCHNG_CLK 226
62+
+#define GCC_CRYPTO_PPE_CLK 227
63+
64+
#define GCC_BLSP1_BCR 0
65+
#define GCC_BLSP1_QUP1_BCR 1
66+
--
67+
2.35.1
68+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
From 28a3cea6641607c7fd717516c38351d891d3e5cb Mon Sep 17 00:00:00 2001
2+
From: Robert Marko <[email protected]>
3+
Date: Sun, 13 Mar 2022 13:01:55 +0100
4+
Subject: [PATCH] clk: qcom: ipq8074: set BRANCH_HALT_DELAY flag for UBI clocks
5+
6+
Currently, attempting to enable the UBI clocks will cause the stuck at
7+
off warning to be printed and clk_enable will fail.
8+
9+
[ 14.936694] gcc_ubi1_ahb_clk status stuck at 'off'
10+
11+
Downstream 5.4 QCA kernel has fixed this by seting the BRANCH_HALT_DELAY
12+
flag on UBI clocks, so lets do the same.
13+
14+
Signed-off-by: Robert Marko <[email protected]>
15+
---
16+
drivers/clk/qcom/gcc-ipq8074.c | 10 ++++++++++
17+
1 file changed, 10 insertions(+)
18+
19+
diff --git a/drivers/clk/qcom/gcc-ipq8074.c b/drivers/clk/qcom/gcc-ipq8074.c
20+
index 6ece246f54a9..25859c4cdeea 100644
21+
--- a/drivers/clk/qcom/gcc-ipq8074.c
22+
+++ b/drivers/clk/qcom/gcc-ipq8074.c
23+
@@ -3372,6 +3372,7 @@ static struct clk_branch gcc_nssnoc_ubi1_ahb_clk = {
24+
25+
static struct clk_branch gcc_ubi0_ahb_clk = {
26+
.halt_reg = 0x6820c,
27+
+ .halt_check = BRANCH_HALT_DELAY,
28+
.clkr = {
29+
.enable_reg = 0x6820c,
30+
.enable_mask = BIT(0),
31+
@@ -3389,6 +3390,7 @@ static struct clk_branch gcc_ubi0_ahb_clk = {
32+
33+
static struct clk_branch gcc_ubi0_axi_clk = {
34+
.halt_reg = 0x68200,
35+
+ .halt_check = BRANCH_HALT_DELAY,
36+
.clkr = {
37+
.enable_reg = 0x68200,
38+
.enable_mask = BIT(0),
39+
@@ -3406,6 +3408,7 @@ static struct clk_branch gcc_ubi0_axi_clk = {
40+
41+
static struct clk_branch gcc_ubi0_nc_axi_clk = {
42+
.halt_reg = 0x68204,
43+
+ .halt_check = BRANCH_HALT_DELAY,
44+
.clkr = {
45+
.enable_reg = 0x68204,
46+
.enable_mask = BIT(0),
47+
@@ -3423,6 +3426,7 @@ static struct clk_branch gcc_ubi0_nc_axi_clk = {
48+
49+
static struct clk_branch gcc_ubi0_core_clk = {
50+
.halt_reg = 0x68210,
51+
+ .halt_check = BRANCH_HALT_DELAY,
52+
.clkr = {
53+
.enable_reg = 0x68210,
54+
.enable_mask = BIT(0),
55+
@@ -3440,6 +3444,7 @@ static struct clk_branch gcc_ubi0_core_clk = {
56+
57+
static struct clk_branch gcc_ubi0_mpt_clk = {
58+
.halt_reg = 0x68208,
59+
+ .halt_check = BRANCH_HALT_DELAY,
60+
.clkr = {
61+
.enable_reg = 0x68208,
62+
.enable_mask = BIT(0),
63+
@@ -3457,6 +3462,7 @@ static struct clk_branch gcc_ubi0_mpt_clk = {
64+
65+
static struct clk_branch gcc_ubi1_ahb_clk = {
66+
.halt_reg = 0x6822c,
67+
+ .halt_check = BRANCH_HALT_DELAY,
68+
.clkr = {
69+
.enable_reg = 0x6822c,
70+
.enable_mask = BIT(0),
71+
@@ -3474,6 +3480,7 @@ static struct clk_branch gcc_ubi1_ahb_clk = {
72+
73+
static struct clk_branch gcc_ubi1_axi_clk = {
74+
.halt_reg = 0x68220,
75+
+ .halt_check = BRANCH_HALT_DELAY,
76+
.clkr = {
77+
.enable_reg = 0x68220,
78+
.enable_mask = BIT(0),
79+
@@ -3491,6 +3498,7 @@ static struct clk_branch gcc_ubi1_axi_clk = {
80+
81+
static struct clk_branch gcc_ubi1_nc_axi_clk = {
82+
.halt_reg = 0x68224,
83+
+ .halt_check = BRANCH_HALT_DELAY,
84+
.clkr = {
85+
.enable_reg = 0x68224,
86+
.enable_mask = BIT(0),
87+
@@ -3508,6 +3516,7 @@ static struct clk_branch gcc_ubi1_nc_axi_clk = {
88+
89+
static struct clk_branch gcc_ubi1_core_clk = {
90+
.halt_reg = 0x68230,
91+
+ .halt_check = BRANCH_HALT_DELAY,
92+
.clkr = {
93+
.enable_reg = 0x68230,
94+
.enable_mask = BIT(0),
95+
@@ -3525,6 +3534,7 @@ static struct clk_branch gcc_ubi1_core_clk = {
96+
97+
static struct clk_branch gcc_ubi1_mpt_clk = {
98+
.halt_reg = 0x68228,
99+
+ .halt_check = BRANCH_HALT_DELAY,
100+
.clkr = {
101+
.enable_reg = 0x68228,
102+
.enable_mask = BIT(0),
103+
--
104+
2.35.1
105+

0 commit comments

Comments
 (0)