1 From 512ea2edfe15ffa2cd839b3a31d768145f2edc20 Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Sat, 26 Feb 2022 14:52:27 +0100
4 Subject: [PATCH 07/14] clk: qcom: gcc-ipq806x: add additional freq nss cores
6 Ipq8065 SoC (an evolution of ipq8064 SoC) contains nss cores that can be
7 clocked to 800MHz. Add these missing freq to the gcc driver.
8 Set the freq_tbl for the ubi32_cores to the correct values based on the
11 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
12 Reviewed-by: Stephen Boyd <sboyd@kernel.org>
13 Tested-by: Jonathan McDowell <noodles@earth.li>
14 Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
15 Link: https://lore.kernel.org/r/20220226135235.10051-8-ansuelsmth@gmail.com
17 drivers/clk/qcom/gcc-ipq806x.c | 24 +++++++++++++++++++++---
18 1 file changed, 21 insertions(+), 3 deletions(-)
20 --- a/drivers/clk/qcom/gcc-ipq806x.c
21 +++ b/drivers/clk/qcom/gcc-ipq806x.c
22 @@ -232,7 +232,9 @@ static struct clk_regmap pll14_vote = {
24 static struct pll_freq_tbl pll18_freq_tbl[] = {
25 NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
26 + NSS_PLL_RATE(600000000, 48, 0, 1, 0x01495625),
27 NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
28 + NSS_PLL_RATE(800000000, 64, 0, 1, 0x01495625),
31 static struct clk_pll pll18 = {
32 @@ -2698,7 +2700,7 @@ static struct clk_branch nss_tcm_clk = {
36 -static const struct freq_tbl clk_tbl_nss[] = {
37 +static const struct freq_tbl clk_tbl_nss_ipq8064[] = {
38 { 110000000, P_PLL18, 1, 1, 5 },
39 { 275000000, P_PLL18, 2, 0, 0 },
40 { 550000000, P_PLL18, 1, 0, 0 },
41 @@ -2706,6 +2708,14 @@ static const struct freq_tbl clk_tbl_nss
45 +static const struct freq_tbl clk_tbl_nss_ipq8065[] = {
46 + { 110000000, P_PLL18, 1, 1, 5 },
47 + { 275000000, P_PLL18, 2, 0, 0 },
48 + { 600000000, P_PLL18, 1, 0, 0 },
49 + { 800000000, P_PLL18, 1, 0, 0 },
53 static struct clk_dyn_rcg ubi32_core1_src_clk = {
56 @@ -2745,7 +2755,7 @@ static struct clk_dyn_rcg ubi32_core1_sr
60 - .freq_tbl = clk_tbl_nss,
61 + /* nss freq table is selected based on the SoC compatible */
64 .enable_mask = BIT(1),
65 @@ -2798,7 +2808,7 @@ static struct clk_dyn_rcg ubi32_core2_sr
69 - .freq_tbl = clk_tbl_nss,
70 + /* nss freq table is selected based on the SoC compatible */
73 .enable_mask = BIT(1),
74 @@ -3131,6 +3141,14 @@ static int gcc_ipq806x_probe(struct plat
78 + if (of_machine_is_compatible("qcom,ipq8065")) {
79 + ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
80 + ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
82 + ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8064;
83 + ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8064;
86 ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);