--- zzzz-none-000/linux-4.4.271/drivers/clk/qcom/gcc-ipq806x.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/drivers/clk/qcom/gcc-ipq806x.c 2023-04-19 10:22:28.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2014, 2016, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -30,8 +30,12 @@ #include "clk-pll.h" #include "clk-rcg.h" #include "clk-branch.h" +#include "clk-hfpll.h" #include "reset.h" +#include "nss-volt-ipq806x.h" +/* NSS safe parent index which will be used during NSS PLL rate change */ +static int gcc_ipq806x_nss_safe_parent; static struct clk_pll pll0 = { .l_reg = 0x30c4, .m_reg = 0x30c8, @@ -72,6 +76,7 @@ .parent_names = (const char *[]){ "pxo" }, .num_parents = 1, .ops = &clk_pll_ops, + .flags = CLK_IS_CRITICAL, }, }; @@ -113,6 +118,84 @@ }, }; +static struct hfpll_data hfpll0_data = { + .mode_reg = 0x3200, + .l_reg = 0x3208, + .m_reg = 0x320c, + .n_reg = 0x3210, + .config_reg = 0x3204, + .status_reg = 0x321c, + .config_val = 0x7845c665, + .droop_reg = 0x3214, + .droop_val = 0x0108c000, + .min_rate = 600000000UL, + .max_rate = 1800000000UL, +}; + +static struct clk_hfpll hfpll0 = { + .d = &hfpll0_data, + .clkr.hw.init = &(struct clk_init_data){ + .parent_names = (const char *[]){ "pxo" }, + .num_parents = 1, + .name = "hfpll0", + .ops = &clk_ops_hfpll, + .flags = CLK_IGNORE_UNUSED, + }, + .lock = __SPIN_LOCK_UNLOCKED(hfpll0.lock), +}; + +static struct hfpll_data hfpll1_data = { + .mode_reg = 0x3240, + .l_reg = 0x3248, + .m_reg = 0x324c, + .n_reg = 0x3250, + .config_reg = 0x3244, + .status_reg = 0x325c, + .config_val = 0x7845c665, + .droop_reg = 0x3314, + .droop_val = 0x0108c000, + .min_rate = 600000000UL, + .max_rate = 1800000000UL, +}; + +static struct clk_hfpll hfpll1 = { + .d = &hfpll1_data, + .clkr.hw.init = &(struct clk_init_data){ + .parent_names = (const char *[]){ "pxo" }, + .num_parents = 1, + .name = "hfpll1", + .ops = &clk_ops_hfpll, + .flags = CLK_IGNORE_UNUSED, + }, + .lock = __SPIN_LOCK_UNLOCKED(hfpll1.lock), +}; + +static struct hfpll_data hfpll_l2_data = { + .mode_reg = 0x3300, + .l_reg = 0x3308, + .m_reg = 0x330c, + .n_reg = 0x3310, + .config_reg = 0x3304, + .status_reg = 0x331c, + .config_val = 0x7845c665, + .droop_reg = 0x3314, + .droop_val = 0x0108c000, + .min_rate = 600000000UL, + .max_rate = 1800000000UL, +}; + +static struct clk_hfpll hfpll_l2 = { + .d = &hfpll_l2_data, + .clkr.hw.init = &(struct clk_init_data){ + .parent_names = (const char *[]){ "pxo" }, + .num_parents = 1, + .name = "hfpll_l2", + .ops = &clk_ops_hfpll, + .flags = CLK_IGNORE_UNUSED, + }, + .lock = __SPIN_LOCK_UNLOCKED(hfpll_l2.lock), +}; + static struct clk_pll pll14 = { .l_reg = 0x31c4, .m_reg = 0x31c8, @@ -151,7 +234,9 @@ static struct pll_freq_tbl pll18_freq_tbl[] = { NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625), + NSS_PLL_RATE(600000000, 48, 0, 1, 0x01495625), NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625), + NSS_PLL_RATE(800000000, 64, 0, 1, 0x01495625), }; static struct clk_pll pll18 = { @@ -173,6 +258,22 @@ }, }; +static struct clk_pll pll11 = { + .l_reg = 0x3184, + .m_reg = 0x3188, + .n_reg = 0x318c, + .config_reg = 0x3194, + .mode_reg = 0x3180, + .status_reg = 0x3198, + .status_bit = 16, + .clkr.hw.init = &(struct clk_init_data){ + .name = "pll11", + .parent_names = (const char *[]){ "pxo" }, + .num_parents = 1, + .ops = &clk_pll_ops, + }, +}; + enum { P_PXO, P_PLL8, @@ -181,6 +282,7 @@ P_CXO, P_PLL14, P_PLL18, + P_PLL11, }; static const struct parent_map gcc_pxo_pll8_map[] = { @@ -248,6 +350,42 @@ "pll18", }; +static const struct parent_map gcc_pxo_pll8_pll0_pll14_pll18_pll11_map[] = { + { P_PXO, 0 }, + { P_PLL8, 4 }, + { P_PLL0, 2 }, + { P_PLL14, 5 }, + { P_PLL18, 1 }, + { P_PLL11, 3 }, +}; + +static const char *gcc_pxo_pll8_pll0_pll14_pll18_pll11[] = { + "pxo", + "pll8_vote", + "pll0_vote", + "pll14", + "pll18", + "pll11" +}; + +static const struct parent_map gcc_pxo_pll3_pll0_pll14_pll18_pll11_map[] = { + { P_PXO, 0 }, + { P_PLL3, 6 }, + { P_PLL0, 2 }, + { P_PLL14, 5 }, + { P_PLL18, 1 }, + { P_PLL11, 3 }, +}; + +static const char *gcc_pxo_pll3_pll0_pll14_pll18_pll11[] = { + "pxo", + "pll3", + "pll0_vote", + "pll14", + "pll18", + "pll11" +}; + static struct freq_tbl clk_tbl_gsbi_uart[] = { { 1843200, P_PLL8, 2, 6, 625 }, { 3686400, P_PLL8, 2, 12, 625 }, @@ -711,7 +849,7 @@ .parent_names = gcc_pxo_pll8, .num_parents = 2, .ops = &clk_rcg_ops, - .flags = CLK_SET_PARENT_GATE, + .flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED, }, }, }; @@ -727,7 +865,7 @@ .parent_names = (const char *[]){ "gsbi4_qup_src" }, .num_parents = 1, .ops = &clk_branch_ops, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, }, }, }; @@ -809,7 +947,7 @@ .parent_names = gcc_pxo_pll8, .num_parents = 2, .ops = &clk_rcg_ops, - .flags = CLK_SET_PARENT_GATE, + .flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED, }, }, }; @@ -874,7 +1012,7 @@ .parent_names = (const char *[]){ "gsbi7_qup_src" }, .num_parents = 1, .ops = &clk_branch_ops, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, }, }, }; @@ -922,7 +1060,7 @@ .hw.init = &(struct clk_init_data){ .name = "gsbi4_h_clk", .ops = &clk_branch_ops, - .flags = CLK_IS_ROOT, + .flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED, }, }, }; @@ -1160,6 +1298,8 @@ .parent_map = gcc_pxo_pll8_map, }, .clkr = { + .enable_reg = 0x2e80, + .enable_mask = BIT(11), .hw.init = &(struct clk_init_data){ .name = "prng_src", .parent_names = gcc_pxo_pll8, @@ -1193,6 +1333,7 @@ { 20210000, P_PLL8, 1, 1, 19 }, { 24000000, P_PLL8, 4, 1, 4 }, { 48000000, P_PLL8, 4, 1, 2 }, + { 52000000, P_PLL8, 1, 2, 15 }, /* 51.2 Mhz */ { 64000000, P_PLL8, 3, 1, 2 }, { 96000000, P_PLL8, 4, 0, 0 }, { 192000000, P_PLL8, 2, 0, 0 }, @@ -1974,9 +2115,9 @@ static struct clk_branch usb30_0_branch_clk = { .halt_reg = 0x2fc4, - .halt_bit = 22, + .halt_bit = 17, .clkr = { - .enable_reg = 0x3b24, + .enable_reg = 0x3b34, .enable_mask = BIT(4), .hw.init = &(struct clk_init_data){ .name = "usb30_0_branch_clk", @@ -1990,9 +2131,9 @@ static struct clk_branch usb30_1_branch_clk = { .halt_reg = 0x2fc4, - .halt_bit = 17, + .halt_bit = 22, .clkr = { - .enable_reg = 0x3b34, + .enable_reg = 0x3b24, .enable_mask = BIT(4), .hw.init = &(struct clk_init_data){ .name = "usb30_1_branch_clk", @@ -2044,9 +2185,9 @@ static struct clk_branch usb30_0_utmi_clk_ctl = { .halt_reg = 0x2fc4, - .halt_bit = 21, + .halt_bit = 15, .clkr = { - .enable_reg = 0x3b48, + .enable_reg = 0x3b4c, .enable_mask = BIT(4), .hw.init = &(struct clk_init_data){ .name = "usb30_0_utmi_clk_ctl", @@ -2060,9 +2201,9 @@ static struct clk_branch usb30_1_utmi_clk_ctl = { .halt_reg = 0x2fc4, - .halt_bit = 15, + .halt_bit = 21, .clkr = { - .enable_reg = 0x3b4c, + .enable_reg = 0x3b48, .enable_mask = BIT(4), .hw.init = &(struct clk_init_data){ .name = "usb30_1_utmi_clk_ctl", @@ -2100,7 +2241,7 @@ }, .freq_tbl = clk_tbl_usb, .clkr = { - .enable_reg = 0x2968, + .enable_reg = 0x290c, .enable_mask = BIT(11), .hw.init = &(struct clk_init_data){ .name = "usb_hs1_xcvr_src", @@ -2113,8 +2254,8 @@ }; static struct clk_branch usb_hs1_xcvr_clk = { - .halt_reg = 0x2fcc, - .halt_bit = 17, + .halt_reg = 0x2fc8, + .halt_bit = 0, .clkr = { .enable_reg = 0x290c, .enable_mask = BIT(9), @@ -2609,7 +2750,9 @@ { 110000000, P_PLL18, 1, 1, 5 }, { 275000000, P_PLL18, 2, 0, 0 }, { 550000000, P_PLL18, 1, 0, 0 }, + { 600000000, P_PLL18, 1, 0, 0 }, { 733000000, P_PLL18, 1, 0, 0 }, + { 800000000, P_PLL18, 1, 0, 0 }, { } }; @@ -2661,7 +2804,8 @@ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0, .num_parents = 5, .ops = &clk_dyn_rcg_ops, - .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE, + .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE | + CLK_IGNORE_UNUSED, }, }, }; @@ -2714,11 +2858,331 @@ .parent_names = gcc_pxo_pll8_pll14_pll18_pll0, .num_parents = 5, .ops = &clk_dyn_rcg_ops, - .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE, + .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE | + CLK_IGNORE_UNUSED, + }, + }, +}; + +static const struct freq_tbl clk_tbl_ce5_core[] = { + { 150000000, P_PLL3, 8, 1, 1 }, + { 213200000, P_PLL11, 5, 1, 1 }, + { } +}; + +static struct clk_dyn_rcg ce5_core_src = { + .ns_reg[0] = 0x36C4, + .ns_reg[1] = 0x36C8, + .bank_reg = 0x36C0, + .s[0] = { + .src_sel_shift = 0, + .parent_map = gcc_pxo_pll3_pll0_pll14_pll18_pll11_map, + }, + .s[1] = { + .src_sel_shift = 0, + .parent_map = gcc_pxo_pll3_pll0_pll14_pll18_pll11_map, + }, + .p[0] = { + .pre_div_shift = 3, + .pre_div_width = 4, + }, + .p[1] = { + .pre_div_shift = 3, + .pre_div_width = 4, + }, + .mux_sel_bit = 0, + .freq_tbl = clk_tbl_ce5_core, + .clkr = { + .enable_reg = 0x36C0, + .enable_mask = BIT(1), + .hw.init = &(struct clk_init_data){ + .name = "ce5_core_src", + .parent_names = gcc_pxo_pll3_pll0_pll14_pll18_pll11, + .num_parents = 6, + .ops = &clk_dyn_rcg_ops, + }, + }, +}; + +static struct clk_branch ce5_core_clk = { + .halt_reg = 0x2FDC, + .halt_bit = 5, + .hwcg_reg = 0x36CC, + .hwcg_bit = 6, + .clkr = { + .enable_reg = 0x36CC, + .enable_mask = BIT(4), + .hw.init = &(struct clk_init_data){ + .name = "ce5_core_clk", + .parent_names = (const char *[]){ + "ce5_core_src", + }, + .num_parents = 1, + .ops = &clk_branch_ops, + .flags = CLK_SET_RATE_PARENT, + }, + }, +}; + +static const struct freq_tbl clk_tbl_ce5_a_clk[] = { + { 160000000, P_PLL0, 5, 1, 1 }, + { 213200000, P_PLL11, 5, 1, 1 }, + { } +}; + +static struct clk_dyn_rcg ce5_a_clk_src = { + .ns_reg[0] = 0x3d84, + .ns_reg[1] = 0x3d88, + .bank_reg = 0x3d80, + .s[0] = { + .src_sel_shift = 0, + .parent_map = gcc_pxo_pll8_pll0_pll14_pll18_pll11_map, + }, + .s[1] = { + .src_sel_shift = 0, + .parent_map = gcc_pxo_pll8_pll0_pll14_pll18_pll11_map, + }, + .p[0] = { + .pre_div_shift = 3, + .pre_div_width = 4, + }, + .p[1] = { + .pre_div_shift = 3, + .pre_div_width = 4, + }, + .mux_sel_bit = 0, + .freq_tbl = clk_tbl_ce5_a_clk, + .clkr = { + .enable_reg = 0x3d80, + .enable_mask = BIT(1), + .hw.init = &(struct clk_init_data){ + .name = "ce5_a_clk_src", + .parent_names = gcc_pxo_pll8_pll0_pll14_pll18_pll11, + .num_parents = 6, + .ops = &clk_dyn_rcg_ops, + }, + }, +}; + +static struct clk_branch ce5_a_clk = { + .halt_reg = 0x3c20, + .halt_bit = 12, + .hwcg_reg = 0x3d8c, + .hwcg_bit = 6, + .clkr = { + .enable_reg = 0x3d8c, + .enable_mask = BIT(4), + .hw.init = &(struct clk_init_data){ + .name = "ce5_a_clk", + .parent_names = (const char *[]){ + "ce5_a_clk_src", + }, + .num_parents = 1, + .ops = &clk_branch_ops, + .flags = CLK_SET_RATE_PARENT, + }, + }, +}; + +static const struct freq_tbl clk_tbl_ce5_h_clk[] = { + { 160000000, P_PLL0, 5, 1, 1 }, + { 213200000, P_PLL11, 5, 1, 1 }, + { } +}; + +static struct clk_dyn_rcg ce5_h_clk_src = { + .ns_reg[0] = 0x3c64, + .ns_reg[1] = 0x3c68, + .bank_reg = 0x3c60, + .s[0] = { + .src_sel_shift = 0, + .parent_map = gcc_pxo_pll8_pll0_pll14_pll18_pll11_map, + }, + .s[1] = { + .src_sel_shift = 0, + .parent_map = gcc_pxo_pll8_pll0_pll14_pll18_pll11_map, + }, + .p[0] = { + .pre_div_shift = 3, + .pre_div_width = 4, + }, + .p[1] = { + .pre_div_shift = 3, + .pre_div_width = 4, + }, + .mux_sel_bit = 0, + .freq_tbl = clk_tbl_ce5_h_clk, + .clkr = { + .enable_reg = 0x3c60, + .enable_mask = BIT(1), + .hw.init = &(struct clk_init_data){ + .name = "ce5_h_clk_src", + .parent_names = gcc_pxo_pll8_pll0_pll14_pll18_pll11, + .num_parents = 6, + .ops = &clk_dyn_rcg_ops, + }, + }, +}; + +static struct clk_branch ce5_h_clk = { + .halt_reg = 0x3c20, + .halt_bit = 11, + .hwcg_reg = 0x3c6c, + .hwcg_bit = 6, + .clkr = { + .enable_reg = 0x3c6c, + .enable_mask = BIT(4), + .hw.init = &(struct clk_init_data){ + .name = "ce5_h_clk", + .parent_names = (const char *[]){ + "ce5_h_clk_src", + }, + .num_parents = 1, + .ops = &clk_branch_ops, + .flags = CLK_SET_RATE_PARENT, }, }, }; +static int nss_core_clk_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + int ret; + + /* + * When ramping up voltage, it needs to be done first. This ensures that + * the volt required will be available when you step up the frequency. + */ + ret = nss_ramp_voltage(rate, true); + if (ret) + return ret; + + ret = clk_dyn_rcg_ops.set_rate(&ubi32_core1_src_clk.clkr.hw, rate, + parent_rate); + if (ret) + return ret; + + ret = clk_dyn_rcg_ops.set_rate(&ubi32_core2_src_clk.clkr.hw, rate, + parent_rate); + + if (ret) + return ret; + + /* + * When ramping down voltage, it needs to be set first. This ensures + * that the volt required will be available until you step down the + * frequency. + */ + ret = nss_ramp_voltage(rate, false); + + return ret; +} + +static int +nss_core_clk_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate, u8 index) +{ + int ret; + + /* + * When ramping up voltage needs to be done first. This ensures that + * the voltage required will be available when you step up the + * frequency. + */ + ret = nss_ramp_voltage(rate, true); + if (ret) + return ret; + + ret = clk_dyn_rcg_ops.set_rate_and_parent( + &ubi32_core1_src_clk.clkr.hw, rate, parent_rate, index); + if (ret) + return ret; + + ret = clk_dyn_rcg_ops.set_rate_and_parent( + &ubi32_core2_src_clk.clkr.hw, rate, parent_rate, index); + + if (ret) + return ret; + + /* + * When ramping down voltage needs to be done last. This ensures that + * the voltage required will be available when you step down the + * frequency. + */ + ret = nss_ramp_voltage(rate, false); + + return ret; +} + +static int nss_core_clk_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + return clk_dyn_rcg_ops.determine_rate(&ubi32_core1_src_clk.clkr.hw, + req); +} + +static unsigned long +nss_core_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) +{ + return clk_dyn_rcg_ops.recalc_rate(&ubi32_core1_src_clk.clkr.hw, + parent_rate); +} + +static u8 nss_core_clk_get_parent(struct clk_hw *hw) +{ + return clk_dyn_rcg_ops.get_parent(&ubi32_core1_src_clk.clkr.hw); +} + +static int nss_core_clk_set_parent(struct clk_hw *hw, u8 i) +{ + int ret; + struct clk_dyn_rcg *rcg; + struct freq_tbl f = { 200000000, P_PLL0, 2, 1, 2 }; + + /* P_PLL0 is 800 Mhz which needs to be divided for 200 Mhz */ + if (i == gcc_ipq806x_nss_safe_parent) { + rcg = to_clk_dyn_rcg(&ubi32_core1_src_clk.clkr.hw); + clk_dyn_configure_bank(rcg, &f); + + rcg = to_clk_dyn_rcg(&ubi32_core2_src_clk.clkr.hw); + clk_dyn_configure_bank(rcg, &f); + + return 0; + } + + ret = clk_dyn_rcg_ops.set_parent(&ubi32_core1_src_clk.clkr.hw, i); + if (ret) + return ret; + + return clk_dyn_rcg_ops.set_parent(&ubi32_core2_src_clk.clkr.hw, i); +} + +static struct clk_hw *nss_core_clk_get_safe_parent(struct clk_hw *hw) +{ + return clk_hw_get_parent_by_index(hw, gcc_ipq806x_nss_safe_parent); +} + +static const struct clk_ops clk_ops_nss_core = { + .set_rate = nss_core_clk_set_rate, + .set_rate_and_parent = nss_core_clk_set_rate_and_parent, + .determine_rate = nss_core_clk_determine_rate, + .recalc_rate = nss_core_clk_recalc_rate, + .get_parent = nss_core_clk_get_parent, + .set_parent = nss_core_clk_set_parent, + .get_safe_parent = nss_core_clk_get_safe_parent, +}; + +/* Virtual clock for nss core clocks */ +static struct clk_regmap nss_core_clk = { + .hw.init = &(struct clk_init_data){ + .name = "nss_core_clk", + .ops = &clk_ops_nss_core, + .parent_names = gcc_pxo_pll8_pll14_pll18_pll0, + .num_parents = 5, + .flags = CLK_SET_RATE_PARENT, + }, +}; + static struct clk_regmap *gcc_ipq806x_clks[] = { [PLL0] = &pll0.clkr, [PLL0_VOTE] = &pll0_vote, @@ -2726,6 +3190,7 @@ [PLL4_VOTE] = &pll4_vote, [PLL8] = &pll8.clkr, [PLL8_VOTE] = &pll8_vote, + [PLL11] = &pll11.clkr, [PLL14] = &pll14.clkr, [PLL14_VOTE] = &pll14_vote, [PLL18] = &pll18.clkr, @@ -2837,6 +3302,16 @@ [UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr, [NSSTCM_CLK_SRC] = &nss_tcm_src.clkr, [NSSTCM_CLK] = &nss_tcm_clk.clkr, + [NSS_CORE_CLK] = &nss_core_clk, + [PLL9] = &hfpll0.clkr, + [PLL10] = &hfpll1.clkr, + [PLL12] = &hfpll_l2.clkr, + [CE5_A_CLK_SRC] = &ce5_a_clk_src.clkr, + [CE5_A_CLK] = &ce5_a_clk.clkr, + [CE5_H_CLK_SRC] = &ce5_h_clk_src.clkr, + [CE5_H_CLK] = &ce5_h_clk.clkr, + [CE5_CORE_CLK_SRC] = &ce5_core_src.clkr, + [CE5_CORE_CLK] = &ce5_core_clk.clkr, }; static const struct qcom_reset_map gcc_ipq806x_resets[] = { @@ -2968,6 +3443,11 @@ [GMAC_CORE3_RESET] = { 0x3cfc, 0 }, [GMAC_CORE4_RESET] = { 0x3d1c, 0 }, [GMAC_AHB_RESET] = { 0x3e24, 0 }, + [CRYPTO_ENG1_RESET] = { 0x3e00, 0}, + [CRYPTO_ENG2_RESET] = { 0x3e04, 0}, + [CRYPTO_ENG3_RESET] = { 0x3e08, 0}, + [CRYPTO_ENG4_RESET] = { 0x3e0c, 0}, + [CRYPTO_AHB_RESET] = { 0x3e10, 0}, [NSS_CH0_RST_RX_CLK_N_RESET] = { 0x3b60, 0 }, [NSS_CH0_RST_TX_CLK_N_RESET] = { 0x3b60, 1 }, [NSS_CH0_RST_RX_125M_N_RESET] = { 0x3b60, 2 }, @@ -3023,20 +3503,10 @@ static int gcc_ipq806x_probe(struct platform_device *pdev) { - struct clk *clk; struct device *dev = &pdev->dev; struct regmap *regmap; int ret; - /* Temporary until RPM clocks supported */ - clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000); - if (IS_ERR(clk)) - return PTR_ERR(clk); - - clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 25000000); - if (IS_ERR(clk)) - return PTR_ERR(clk); - ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc); if (ret) return ret; @@ -3045,6 +3515,12 @@ if (!regmap) return -ENODEV; + gcc_ipq806x_nss_safe_parent = qcom_find_src_index(&nss_core_clk.hw, + gcc_pxo_pll8_pll14_pll18_pll0_map, + P_PLL0); + if (gcc_ipq806x_nss_safe_parent < 0) + return gcc_ipq806x_nss_safe_parent; + /* Setup PLL18 static bits */ regmap_update_bits(regmap, 0x31a4, 0xffffffc0, 0x40000400); regmap_write(regmap, 0x31b0, 0x3080);