Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Ansuel Smith and committed by
Bjorn Andersson
512ea2ed a6aedd65

+21 -3
+21 -3
drivers/clk/qcom/gcc-ipq806x.c
··· 232 232 233 233 static struct pll_freq_tbl pll18_freq_tbl[] = { 234 234 NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625), 235 + NSS_PLL_RATE(600000000, 48, 0, 1, 0x01495625), 235 236 NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625), 237 + NSS_PLL_RATE(800000000, 64, 0, 1, 0x01495625), 236 238 }; 237 239 238 240 static struct clk_pll pll18 = { ··· 2700 2698 }, 2701 2699 }; 2702 2700 2703 - static const struct freq_tbl clk_tbl_nss[] = { 2701 + static const struct freq_tbl clk_tbl_nss_ipq8064[] = { 2704 2702 { 110000000, P_PLL18, 1, 1, 5 }, 2705 2703 { 275000000, P_PLL18, 2, 0, 0 }, 2706 2704 { 550000000, P_PLL18, 1, 0, 0 }, 2707 2705 { 733000000, P_PLL18, 1, 0, 0 }, 2706 + { } 2707 + }; 2708 + 2709 + static const struct freq_tbl clk_tbl_nss_ipq8065[] = { 2710 + { 110000000, P_PLL18, 1, 1, 5 }, 2711 + { 275000000, P_PLL18, 2, 0, 0 }, 2712 + { 600000000, P_PLL18, 1, 0, 0 }, 2713 + { 800000000, P_PLL18, 1, 0, 0 }, 2708 2714 { } 2709 2715 }; 2710 2716 ··· 2755 2745 .pre_div_width = 2, 2756 2746 }, 2757 2747 .mux_sel_bit = 0, 2758 - .freq_tbl = clk_tbl_nss, 2748 + /* nss freq table is selected based on the SoC compatible */ 2759 2749 .clkr = { 2760 2750 .enable_reg = 0x3d20, 2761 2751 .enable_mask = BIT(1), ··· 2808 2798 .pre_div_width = 2, 2809 2799 }, 2810 2800 .mux_sel_bit = 0, 2811 - .freq_tbl = clk_tbl_nss, 2801 + /* nss freq table is selected based on the SoC compatible */ 2812 2802 .clkr = { 2813 2803 .enable_reg = 0x3d40, 2814 2804 .enable_mask = BIT(1), ··· 3140 3130 ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 25000000); 3141 3131 if (ret) 3142 3132 return ret; 3133 + 3134 + if (of_machine_is_compatible("qcom,ipq8065")) { 3135 + ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8065; 3136 + ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8065; 3137 + } else { 3138 + ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8064; 3139 + ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8064; 3140 + } 3143 3141 3144 3142 ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc); 3145 3143 if (ret)