Skip to content

Commit 512ea2e

Browse files
Ansuelandersson
authored andcommitted
clk: qcom: gcc-ipq806x: add additional freq nss cores
Ipq8065 SoC (an evolution of ipq8064 SoC) contains nss cores that can be clocked to 800MHz. Add these missing freq to the gcc driver. Set the freq_tbl for the ubi32_cores to the correct values based on the machine compatible. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Tested-by: Jonathan McDowell <noodles@earth.li> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20220226135235.10051-8-ansuelsmth@gmail.com
1 parent a6aedd6 commit 512ea2e

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

drivers/clk/qcom/gcc-ipq806x.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ static struct clk_regmap pll14_vote = {
232232

233233
static struct pll_freq_tbl pll18_freq_tbl[] = {
234234
NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
235+
NSS_PLL_RATE(600000000, 48, 0, 1, 0x01495625),
235236
NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
237+
NSS_PLL_RATE(800000000, 64, 0, 1, 0x01495625),
236238
};
237239

238240
static struct clk_pll pll18 = {
@@ -2698,14 +2700,22 @@ static struct clk_branch nss_tcm_clk = {
26982700
},
26992701
};
27002702

2701-
static const struct freq_tbl clk_tbl_nss[] = {
2703+
static const struct freq_tbl clk_tbl_nss_ipq8064[] = {
27022704
{ 110000000, P_PLL18, 1, 1, 5 },
27032705
{ 275000000, P_PLL18, 2, 0, 0 },
27042706
{ 550000000, P_PLL18, 1, 0, 0 },
27052707
{ 733000000, P_PLL18, 1, 0, 0 },
27062708
{ }
27072709
};
27082710

2711+
static const struct freq_tbl clk_tbl_nss_ipq8065[] = {
2712+
{ 110000000, P_PLL18, 1, 1, 5 },
2713+
{ 275000000, P_PLL18, 2, 0, 0 },
2714+
{ 600000000, P_PLL18, 1, 0, 0 },
2715+
{ 800000000, P_PLL18, 1, 0, 0 },
2716+
{ }
2717+
};
2718+
27092719
static struct clk_dyn_rcg ubi32_core1_src_clk = {
27102720
.ns_reg[0] = 0x3d2c,
27112721
.ns_reg[1] = 0x3d30,
@@ -2745,7 +2755,7 @@ static struct clk_dyn_rcg ubi32_core1_src_clk = {
27452755
.pre_div_width = 2,
27462756
},
27472757
.mux_sel_bit = 0,
2748-
.freq_tbl = clk_tbl_nss,
2758+
/* nss freq table is selected based on the SoC compatible */
27492759
.clkr = {
27502760
.enable_reg = 0x3d20,
27512761
.enable_mask = BIT(1),
@@ -2798,7 +2808,7 @@ static struct clk_dyn_rcg ubi32_core2_src_clk = {
27982808
.pre_div_width = 2,
27992809
},
28002810
.mux_sel_bit = 0,
2801-
.freq_tbl = clk_tbl_nss,
2811+
/* nss freq table is selected based on the SoC compatible */
28022812
.clkr = {
28032813
.enable_reg = 0x3d40,
28042814
.enable_mask = BIT(1),
@@ -3131,6 +3141,14 @@ static int gcc_ipq806x_probe(struct platform_device *pdev)
31313141
if (ret)
31323142
return ret;
31333143

3144+
if (of_machine_is_compatible("qcom,ipq8065")) {
3145+
ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
3146+
ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
3147+
} else {
3148+
ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8064;
3149+
ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8064;
3150+
}
3151+
31343152
ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
31353153
if (ret)
31363154
return ret;

0 commit comments

Comments
 (0)