Add clock drivers for SM8350
cover Add clock drivers for SM8350
This adds gcc clock controller drivers for the controller found in SM8350 SoC
Changes in v3:
- Drop rpmh clk patches applied
- Add a new patch to replace regval with val as suggested by Stephen
- Fix comments for new Lucid 5LPE PLL: sort new defines by BIT numbers, fix comments, use alpha_pll_check_rate_margin(), rework clk_lucid_5lpe_pll_postdiv_set_rate() logic
- Add power domains and optional clocks in bindings
- Fix comments for gcc sm8350 driver: clean includes used, use only .fw_name for clocks defined in DT, use floor ops for sdcc clocks, remove critical clocks and enable them in probe, add comments for clks using BRANCH_HALT_SKIP and BRANCH_HALT_DELAY
Changes in v2:
- Add r-b from Bjorn
- Add the gcc_qupv3_wrap_1_{m|s}_ahb_clk and gcc_qupv3_wrap1_s5_clk
Vinod Koul (2):
clk: qcom: clk-alpha-pll: replace regval with val
dt-bindings: clock: Add SM8350 GCC clock bindings
Vivek Aknurwar (2):
clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL
clk: qcom: gcc: Add clock driver for SM8350
.../bindings/clock/qcom,gcc-sm8350.yaml | 96 + drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/clk-alpha-pll.c | 237 +- drivers/clk/qcom/clk-alpha-pll.h | 4 + drivers/clk/qcom/gcc-sm8350.c | 3790 +++++++++++++++++ include/dt-bindings/clock/qcom,gcc-sm8350.h | 261 ++ 7 files changed, 4387 insertions(+), 10 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm8350.yaml create mode 100644 drivers/clk/qcom/gcc-sm8350.c create mode 100644 include/dt-bindings/clock/qcom,gcc-sm8350.h
Signature · 1 line
2.26.2
PATCH 1/4 clk: qcom: clk-alpha-pll: replace regval with val
Driver uses regval variable for holding register values, replace with a shorter one val
--- drivers/clk/qcom/clk-alpha-pll.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/clk/qcom/clk-alpha-pll.c +10 -10
@@ -777,15 +777,15 @@ static long alpha_pll_huayra_round_rate(struct clk_hw *hw, unsigned long rate,static int trion_pll_is_enabled (struct clk_alpha_pll *pll,struct regmap *regmap) { -u32 mode_regval, opmode_regval; +u32 mode_val, opmode_val;int ret; - ret =regmap_read (regmap,PLL_MODE (pll), &mode_regval); - ret |=regmap_read (regmap,PLL_OPMODE (pll), &opmode_regval); + ret =regmap_read (regmap,PLL_MODE (pll), &mode_val); + ret |=regmap_read (regmap,PLL_OPMODE (pll), &opmode_val);if (ret)return 0 ; -return ((opmode_regval &PLL_RUN ) && (mode_regval &PLL_OUTCTRL )); +return ((opmode_val &PLL_RUN ) && (mode_val &PLL_OUTCTRL )); }static int clk_trion_pll_is_enabled (struct clk_hw *hw)
@@ -1445,12 +1445,12 @@ EXPORT_SYMBOL_GPL(clk_trion_pll_configure);static int __alpha_pll_trion_prepare (struct clk_hw *hw,u32 pcal_done) {struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); -u32 regval; +u32 val;int ret;/* Return early if calibration is not needed. */ -regmap_read (pll->clkr.regmap,PLL_STATUS (pll), ®val); -if (regval & pcal_done) +regmap_read (pll->clkr.regmap,PLL_STATUS (pll), &val); +if (val & pcal_done)return 0 ;/* On/off to calibrate */
@@ -1476,7 +1476,7 @@ static int alpha_pll_trion_set_rate(struct clk_hw *hw, unsigned long rate, {struct clk_alpha_pll *pll =to_clk_alpha_pll (hw);unsigned long rrate; -u32 regval, l, alpha_width =pll_alpha_width (pll); +u32 val, l, alpha_width =pll_alpha_width (pll);u64 a;int ret;
@@ -1497,8 +1497,8 @@ static int alpha_pll_trion_set_rate(struct clk_hw *hw, unsigned long rate,/* Wait for 2 reference cycles before checking the ACK bit. */ udelay (1 ); -regmap_read (pll->clkr.regmap,PLL_MODE (pll), ®val); -if (!(regval &ALPHA_PLL_ACK_LATCH )) { +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (!(val &ALPHA_PLL_ACK_LATCH )) {pr_err ("Lucid PLL latch failed. Output may be unstable!\n" );return -EINVAL ; }
Signature · 1 line
2.26.2
PATCH 2/4 clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL
In reply to Vinod KoulFrom: Vivek Aknurwar <[email protected]>
Lucid 5LPE is a slightly different Lucid PLL with different offsets and porgramming sequence so add support for these
--- drivers/clk/qcom/clk-alpha-pll.c | 217 +++++++++++++++++++++++++++++++ drivers/clk/qcom/clk-alpha-pll.h | 4 + 2 files changed, 221 insertions(+)
drivers/clk/qcom/clk-alpha-pll.c +217 -0
@@ -156,6 +156,12 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);/* LUCID PLL specific settings and offsets */ #define LUCID_PCAL_DONE BIT(27) +/* LUCID 5LPE PLL specific settings and offsets */ +#define LUCID_5LPE_PCAL_DONE BIT(11) +#define LUCID_5LPE_ALPHA_PLL_ACK_LATCH BIT(13) +#define LUCID_5LPE_PLL_LATCH_INPUT BIT(14) +#define LUCID_5LPE_ENABLE_VOTE_RUN BIT(21) +#define pll_alpha_width (p) \ ((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \ ALPHA_REG_BITWIDTH : ALPHA_REG_16BIT_WIDTH)
@@ -1600,3 +1606,214 @@ const struct clk_ops clk_alpha_pll_agera_ops = { .set_rate = clk_alpha_pll_agera_set_rate, };EXPORT_SYMBOL_GPL (clk_alpha_pll_agera_ops); + +static int alpha_pll_lucid_5lpe_enable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ret; + +/* If in FSM mode, just vote for it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { + ret =clk_enable_regmap (hw); +if (ret) +return ret; +return wait_for_pll_enable_lock (pll); + } + +/* Check if PLL is already enabled, return if enabled */ + ret =trion_pll_is_enabled (pll, pll->clkr.regmap); +if (ret <0 ) +return ret; + + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_RESET_N ,PLL_RESET_N ); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_RUN ); + + ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + +/* Enable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,PLL_OUT_MASK ); +if (ret) +return ret; + +/* Enable the global PLL outputs */ +return regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,PLL_OUTCTRL ); +} + +static void alpha_pll_lucid_5lpe_disable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ; + +/* If in FSM mode, just unvote it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { +clk_disable_regmap (hw); +return ; + } + +/* Disable the global PLL output */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,0 ); +if (ret) +return ; + +/* Disable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,0 ); +if (ret) +return ; + +/* Place the PLL mode in STANDBY */ +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_STANDBY ); +} + +/* +* The Lucid 5LPE PLL requires a power-on self-calibration which happens +* when the PLL comes out of reset. Calibrate in case it is not completed. +*/ +static int alpha_pll_lucid_5lpe_prepare (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +struct clk_hw *p; +u32 val; +int ret; + +/* Return early if calibration is not needed. */ +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (val &LUCID_5LPE_PCAL_DONE ) +return 0 ; + + p =clk_hw_get_parent (hw); +if (!p) +return -EINVAL ; + + ret =alpha_pll_lucid_5lpe_enable (hw); +if (ret) +return ret; + +alpha_pll_lucid_5lpe_disable (hw); + +return 0 ; +} + +static int alpha_pll_lucid_5lpe_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long prate) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +unsigned long rrate; +u32 val, l; +u64 a; +int ret; + + rrate =alpha_pll_round_rate (rate, prate, &l, &a,ALPHA_REG_16BIT_WIDTH ); + +/* +* Due to a limited number of bits for fractional rate programming, the +* rounded up rate could be marginally higher than the requested rate. +*/ + ret =alpha_pll_check_rate_margin (hw, rrate, rate); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_L_VAL (pll), l); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL (pll), a); + +/* Latch the PLL input */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll), +LUCID_5LPE_PLL_LATCH_INPUT ,LUCID_5LPE_PLL_LATCH_INPUT ); +if (ret) +return ret; + +/* Wait for 2 reference cycles before checking the ACK bit. */ +udelay (1 ); +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (!(val &LUCID_5LPE_ALPHA_PLL_ACK_LATCH )) { +pr_err ("Lucid 5LPE PLL latch failed. Output may be unstable!\n" ); +return -EINVAL ; + } + +/* Return the latch input to 0 */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),LUCID_5LPE_PLL_LATCH_INPUT ,0 ); +if (ret) +return ret; + +if (clk_hw_is_enabled (hw)) { + ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + } + +/* Wait for PLL output to stabilize */ +udelay (100 ); +return 0 ; +} + +static int clk_lucid_5lpe_pll_postdiv_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long parent_rate) +{ +struct clk_alpha_pll_postdiv *pll =to_clk_alpha_pll_postdiv (hw); +int i, val =0 , div, ret; +u32 mask; + +/* +* If the PLL is in FSM mode, then treat set_rate callback as a +* no-operation. +*/ + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ret; + +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) +return 0 ; + + div =DIV_ROUND_UP_ULL ((u64 )parent_rate, rate); +for (i =0 ; i < pll->num_post_div; i++) { +if (pll->post_div_table[i].div == div) { + val = pll->post_div_table[i].val; +break ; + } + } + + mask =GENMASK (pll->width + pll->post_div_shift -1 , pll->post_div_shift); +return regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll), + mask, val << pll->post_div_shift); +} + +const struct clk_ops clk_alpha_pll_lucid_5lpe_ops = { + .prepare = alpha_pll_lucid_5lpe_prepare, + .enable = alpha_pll_lucid_5lpe_enable, + .disable = alpha_pll_lucid_5lpe_disable, + .is_enabled = clk_trion_pll_is_enabled, + .recalc_rate = clk_trion_pll_recalc_rate, + .round_rate = clk_alpha_pll_round_rate, + .set_rate = alpha_pll_lucid_5lpe_set_rate, +}; +EXPORT_SYMBOL (clk_alpha_pll_lucid_5lpe_ops); + +const struct clk_ops clk_alpha_pll_fixed_lucid_5lpe_ops = { + .enable = alpha_pll_lucid_5lpe_enable, + .disable = alpha_pll_lucid_5lpe_disable, + .is_enabled = clk_trion_pll_is_enabled, + .recalc_rate = clk_trion_pll_recalc_rate, + .round_rate = clk_alpha_pll_round_rate, +}; +EXPORT_SYMBOL (clk_alpha_pll_fixed_lucid_5lpe_ops); + +const struct clk_ops clk_alpha_pll_postdiv_lucid_5lpe_ops = { + .recalc_rate = clk_alpha_pll_postdiv_fabia_recalc_rate, + .round_rate = clk_alpha_pll_postdiv_fabia_round_rate, + .set_rate = clk_lucid_5lpe_pll_postdiv_set_rate, +}; +EXPORT_SYMBOL (clk_alpha_pll_postdiv_lucid_5lpe_ops);
drivers/clk/qcom/clk-alpha-pll.h +4 -0
@@ -144,6 +144,10 @@ extern const struct clk_ops clk_alpha_pll_lucid_ops;extern const struct clk_ops clk_alpha_pll_postdiv_lucid_ops;extern const struct clk_ops clk_alpha_pll_agera_ops; +extern const struct clk_ops clk_alpha_pll_lucid_5lpe_ops; +extern const struct clk_ops clk_alpha_pll_fixed_lucid_5lpe_ops; +extern const struct clk_ops clk_alpha_pll_postdiv_lucid_5lpe_ops; +void clk_alpha_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap,const struct alpha_pll_config *config); void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
Signature · 1 line
2.26.2
Re: [PATCH 2/4] clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL
Il 05/01/21 16:46, Vinod Koul ha scritto:
Quoted 179 lines
From: Vivek Aknurwar <[email protected]>
Lucid 5LPE is a slightly different Lucid PLL with different offsets and porgramming sequence so add support for these
Signed-off-by Vivek Aknurwar <[email protected]>Signed-off-by Jeevan Shriram <[email protected]>[vkoul: rebase and tidy up for upstream]Signed-off-by Vinod Koul <[email protected]>--- drivers/clk/qcom/clk-alpha-pll.c | 217 +++++++++++++++++++++++++++++++ drivers/clk/qcom/clk-alpha-pll.h | 4 + 2 files changed, 221 insertions(+)drivers/clk/qcom/clk-alpha-pll.c +150
-0@@ -156,6 +156,12 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);/* LUCID PLL specific settings and offsets */ #define LUCID_PCAL_DONE BIT(27) +/* LUCID 5LPE PLL specific settings and offsets */ +#define LUCID_5LPE_PCAL_DONE BIT(11) +#define LUCID_5LPE_ALPHA_PLL_ACK_LATCH BIT(13) +#define LUCID_5LPE_PLL_LATCH_INPUT BIT(14) +#define LUCID_5LPE_ENABLE_VOTE_RUN BIT(21) +#define pll_alpha_width (p) \ ((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \ ALPHA_REG_BITWIDTH : ALPHA_REG_16BIT_WIDTH)@@ -1600,3 +1606,214 @@ const struct clk_ops clk_alpha_pll_agera_ops = { .set_rate = clk_alpha_pll_agera_set_rate, };EXPORT_SYMBOL_GPL (clk_alpha_pll_agera_ops); + +static int alpha_pll_lucid_5lpe_enable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ret; + +/* If in FSM mode, just vote for it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { + ret =clk_enable_regmap (hw); +if (ret) +return ret; +return wait_for_pll_enable_lock (pll); + } + +/* Check if PLL is already enabled, return if enabled */ + ret =trion_pll_is_enabled (pll, pll->clkr.regmap); +if (ret <0 ) +return ret; + + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_RESET_N ,PLL_RESET_N ); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_RUN ); + + ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + +/* Enable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,PLL_OUT_MASK ); +if (ret) +return ret; + +/* Enable the global PLL outputs */ +return regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,PLL_OUTCTRL ); +} + +static void alpha_pll_lucid_5lpe_disable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ; + +/* If in FSM mode, just unvote it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { +clk_disable_regmap (hw); +return ; + } + +/* Disable the global PLL output */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,0 ); +if (ret) +return ; + +/* Disable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,0 ); +if (ret) +return ; + +/* Place the PLL mode in STANDBY */ +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_STANDBY ); +} + +/* +* The Lucid 5LPE PLL requires a power-on self-calibration which happens +* when the PLL comes out of reset. Calibrate in case it is not completed. +*/ +static int alpha_pll_lucid_5lpe_prepare (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +struct clk_hw *p; +u32 val; +int ret; + +/* Return early if calibration is not needed. */ +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (val &LUCID_5LPE_PCAL_DONE ) +return 0 ; + + p =clk_hw_get_parent (hw); +if (!p) +return -EINVAL ; + + ret =alpha_pll_lucid_5lpe_enable (hw); +if (ret) +return ret; + +alpha_pll_lucid_5lpe_disable (hw); + +return 0 ; +} + +static int alpha_pll_lucid_5lpe_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long prate) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +unsigned long rrate; +u32 val, l; +u64 a; +int ret; + + rrate =alpha_pll_round_rate (rate, prate, &l, &a,ALPHA_REG_16BIT_WIDTH ); + +/* +* Due to a limited number of bits for fractional rate programming, the +* rounded up rate could be marginally higher than the requested rate. +*/ + ret =alpha_pll_check_rate_margin (hw, rrate, rate); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_L_VAL (pll), l); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL (pll), a); + +/* Latch the PLL input */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll), +LUCID_5LPE_PLL_LATCH_INPUT ,LUCID_5LPE_PLL_LATCH_INPUT ); +if (ret) +return ret; + +/* Wait for 2 reference cycles before checking the ACK bit. */ +udelay (1 ); +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (!(val &LUCID_5LPE_ALPHA_PLL_ACK_LATCH )) { +pr_err ("Lucid 5LPE PLL latch failed. Output may be unstable!\n" ); +return -EINVAL ; + } + +/* Return the latch input to 0 */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),LUCID_5LPE_PLL_LATCH_INPUT ,0 ); +if (ret) +return ret; + +if (clk_hw_is_enabled (hw)) {
drivers/clk/qcom/clk-alpha-pll.c const struct clk_ops clk_alpha_pll_agera_ops = { · line 1762
Quoted 10 lines
drivers/clk/qcom/clk-alpha-pll.c +10
-0+ ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + } + +/* Wait for PLL output to stabilize */ +udelay (100 ); +return 0 ; +} +
This one looks exactly like alpha_pll_trion_set_rate() but:
1. You are forcing ALPHA_REG_16BIT_WIDTH for the alpha_pll_round_rate
call: this is bad, you should actually use pll_alpha_width(pll) here, unless you have a very good reason that I didn't understand...
2. The only change between these two functions (trion and lucid_5lpe_set_rate) is that PLL_UPDATE becomes LUCID_5LPE_PLL_LATCH_INPUT, and that you check for LUCID_5LPE_ALPHA_PLL_ACK_LATCH instead of ALPHA_PLL_ACK_LATCH: this looks like being 95% code duplication.
The best options here, in my opinion, would be to commonize the functionalpha_pll_trion_set_rate: that will avoid this huge duplication.
Quoted 73 lines
drivers/clk/qcom/clk-alpha-pll.c +57
-0+static int clk_lucid_5lpe_pll_postdiv_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long parent_rate) +{ +struct clk_alpha_pll_postdiv *pll =to_clk_alpha_pll_postdiv (hw); +int i, val =0 , div, ret; +u32 mask; + +/* +* If the PLL is in FSM mode, then treat set_rate callback as a +* no-operation. +*/ + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ret; + +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) +return 0 ; + + div =DIV_ROUND_UP_ULL ((u64 )parent_rate, rate); +for (i =0 ; i < pll->num_post_div; i++) { +if (pll->post_div_table[i].div == div) { + val = pll->post_div_table[i].val; +break ; + } + } + + mask =GENMASK (pll->width + pll->post_div_shift -1 , pll->post_div_shift); +return regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll), + mask, val << pll->post_div_shift); +} + +const struct clk_ops clk_alpha_pll_lucid_5lpe_ops = { + .prepare = alpha_pll_lucid_5lpe_prepare, + .enable = alpha_pll_lucid_5lpe_enable, + .disable = alpha_pll_lucid_5lpe_disable, + .is_enabled = clk_trion_pll_is_enabled, + .recalc_rate = clk_trion_pll_recalc_rate, + .round_rate = clk_alpha_pll_round_rate, + .set_rate = alpha_pll_lucid_5lpe_set_rate, +}; +EXPORT_SYMBOL (clk_alpha_pll_lucid_5lpe_ops); + +const struct clk_ops clk_alpha_pll_fixed_lucid_5lpe_ops = { + .enable = alpha_pll_lucid_5lpe_enable, + .disable = alpha_pll_lucid_5lpe_disable, + .is_enabled = clk_trion_pll_is_enabled, + .recalc_rate = clk_trion_pll_recalc_rate, + .round_rate = clk_alpha_pll_round_rate, +}; +EXPORT_SYMBOL (clk_alpha_pll_fixed_lucid_5lpe_ops); + +const struct clk_ops clk_alpha_pll_postdiv_lucid_5lpe_ops = { + .recalc_rate = clk_alpha_pll_postdiv_fabia_recalc_rate, + .round_rate = clk_alpha_pll_postdiv_fabia_round_rate, + .set_rate = clk_lucid_5lpe_pll_postdiv_set_rate, +}; +EXPORT_SYMBOL (clk_alpha_pll_postdiv_lucid_5lpe_ops);drivers/clk/qcom/clk-alpha-pll.h +4
-0@@ -144,6 +144,10 @@ extern const struct clk_ops clk_alpha_pll_lucid_ops;extern const struct clk_ops clk_alpha_pll_postdiv_lucid_ops;extern const struct clk_ops clk_alpha_pll_agera_ops; +extern const struct clk_ops clk_alpha_pll_lucid_5lpe_ops; +extern const struct clk_ops clk_alpha_pll_fixed_lucid_5lpe_ops; +extern const struct clk_ops clk_alpha_pll_postdiv_lucid_5lpe_ops; +void clk_alpha_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap,const struct alpha_pll_config *config); void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
Re: [PATCH 2/4] clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL
Quoted 200 lines · AngeloGioacchino Del Regno
Il 05/01/21 16:46, Vinod Koul ha scritto:
Quoted 178 lines
From: Vivek Aknurwar <[email protected]>
Lucid 5LPE is a slightly different Lucid PLL with different offsets and porgramming sequence so add support for these
Signed-off-by Vivek Aknurwar <[email protected]>Signed-off-by Jeevan Shriram <[email protected]>[vkoul: rebase and tidy up for upstream]Signed-off-by Vinod Koul <[email protected]>--- drivers/clk/qcom/clk-alpha-pll.c | 217 +++++++++++++++++++++++++++++++ drivers/clk/qcom/clk-alpha-pll.h | 4 + 2 files changed, 221 insertions(+)drivers/clk/qcom/clk-alpha-pll.c +150
-0@@ -156,6 +156,12 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);/* LUCID PLL specific settings and offsets */ #define LUCID_PCAL_DONE BIT(27) +/* LUCID 5LPE PLL specific settings and offsets */ +#define LUCID_5LPE_PCAL_DONE BIT(11) +#define LUCID_5LPE_ALPHA_PLL_ACK_LATCH BIT(13) +#define LUCID_5LPE_PLL_LATCH_INPUT BIT(14) +#define LUCID_5LPE_ENABLE_VOTE_RUN BIT(21) +#define pll_alpha_width (p) \ ((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \ ALPHA_REG_BITWIDTH : ALPHA_REG_16BIT_WIDTH)@@ -1600,3 +1606,214 @@ const struct clk_ops clk_alpha_pll_agera_ops = { .set_rate = clk_alpha_pll_agera_set_rate, };EXPORT_SYMBOL_GPL (clk_alpha_pll_agera_ops); + +static int alpha_pll_lucid_5lpe_enable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ret; + +/* If in FSM mode, just vote for it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { + ret =clk_enable_regmap (hw); +if (ret) +return ret; +return wait_for_pll_enable_lock (pll); + } + +/* Check if PLL is already enabled, return if enabled */ + ret =trion_pll_is_enabled (pll, pll->clkr.regmap); +if (ret <0 ) +return ret; + + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_RESET_N ,PLL_RESET_N ); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_RUN ); + + ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + +/* Enable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,PLL_OUT_MASK ); +if (ret) +return ret; + +/* Enable the global PLL outputs */ +return regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,PLL_OUTCTRL ); +} + +static void alpha_pll_lucid_5lpe_disable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ; + +/* If in FSM mode, just unvote it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { +clk_disable_regmap (hw); +return ; + } + +/* Disable the global PLL output */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,0 ); +if (ret) +return ; + +/* Disable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,0 ); +if (ret) +return ; + +/* Place the PLL mode in STANDBY */ +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_STANDBY ); +} + +/* +* The Lucid 5LPE PLL requires a power-on self-calibration which happens +* when the PLL comes out of reset. Calibrate in case it is not completed. +*/ +static int alpha_pll_lucid_5lpe_prepare (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +struct clk_hw *p; +u32 val; +int ret; + +/* Return early if calibration is not needed. */ +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (val &LUCID_5LPE_PCAL_DONE ) +return 0 ; + + p =clk_hw_get_parent (hw); +if (!p) +return -EINVAL ; + + ret =alpha_pll_lucid_5lpe_enable (hw); +if (ret) +return ret; + +alpha_pll_lucid_5lpe_disable (hw); + +return 0 ; +} + +static int alpha_pll_lucid_5lpe_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long prate) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +unsigned long rrate; +u32 val, l; +u64 a; +int ret; + + rrate =alpha_pll_round_rate (rate, prate, &l, &a,ALPHA_REG_16BIT_WIDTH ); + +/* +* Due to a limited number of bits for fractional rate programming, the +* rounded up rate could be marginally higher than the requested rate. +*/ + ret =alpha_pll_check_rate_margin (hw, rrate, rate); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_L_VAL (pll), l); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL (pll), a); + +/* Latch the PLL input */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll), +LUCID_5LPE_PLL_LATCH_INPUT ,LUCID_5LPE_PLL_LATCH_INPUT ); +if (ret) +return ret; + +/* Wait for 2 reference cycles before checking the ACK bit. */ +udelay (1 ); +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (!(val &LUCID_5LPE_ALPHA_PLL_ACK_LATCH )) { +pr_err ("Lucid 5LPE PLL latch failed. Output may be unstable!\n" ); +return -EINVAL ; + } + +/* Return the latch input to 0 */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),LUCID_5LPE_PLL_LATCH_INPUT ,0 ); +if (ret) +return ret; + +if (clk_hw_is_enabled (hw)) {drivers/clk/qcom/clk-alpha-pll.c const struct clk_ops clk_alpha_pll_agera_ops = { · line 1762
Quoted 10 lines
drivers/clk/qcom/clk-alpha-pll.c +10
-0+ ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + } + +/* Wait for PLL output to stabilize */ +udelay (100 ); +return 0 ; +} +This one looks exactly like
alpha_pll_trion_set_rate()but:
1. You are forcingALPHA_REG_16BIT_WIDTHfor thealpha_pll_round_rate
call: this is bad, you should actually usepll_alpha_width(pll)here, unless you have a very good reason that I didn't understand...
2. The only change between these two functions (trion andlucid_5lpe_set_rate) is thatPLL_UPDATEbecomesLUCID_5LPE_PLL_LATCH_INPUT, and that you check forLUCID_5LPE_ALPHA_PLL_ACK_LATCHinstead ofALPHA_PLL_ACK_LATCH: this looks like being 95% code duplication.
Quoted 2 lines
The best options here, in my opinion, would be to commonize the function
alpha_pll_trion_set_rate: that will avoid this huge duplication.
Yeah I agree we could reuse, I can redo this. I was thinking of making this bit as one of the values in register and use that but that does not look good as this is not a register offset, so only option is to have a new type of PLL for this and use that as here..
Signature · 1 line
~Vinod
Re: [PATCH 2/4] clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL
Il 15/01/21 14:02, Vinod Koul ha scritto:
Quoted 201 lines · AngeloGioacchino Del Regno
Quoted 200 lines
Il 05/01/21 16:46, Vinod Koul ha scritto:
Quoted 178 lines
From: Vivek Aknurwar <[email protected]>
Lucid 5LPE is a slightly different Lucid PLL with different offsets and porgramming sequence so add support for these
Signed-off-by Vivek Aknurwar <[email protected]>Signed-off-by Jeevan Shriram <[email protected]>[vkoul: rebase and tidy up for upstream]Signed-off-by Vinod Koul <[email protected]>--- drivers/clk/qcom/clk-alpha-pll.c | 217 +++++++++++++++++++++++++++++++ drivers/clk/qcom/clk-alpha-pll.h | 4 + 2 files changed, 221 insertions(+)drivers/clk/qcom/clk-alpha-pll.c +150
-0@@ -156,6 +156,12 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);/* LUCID PLL specific settings and offsets */ #define LUCID_PCAL_DONE BIT(27) +/* LUCID 5LPE PLL specific settings and offsets */ +#define LUCID_5LPE_PCAL_DONE BIT(11) +#define LUCID_5LPE_ALPHA_PLL_ACK_LATCH BIT(13) +#define LUCID_5LPE_PLL_LATCH_INPUT BIT(14) +#define LUCID_5LPE_ENABLE_VOTE_RUN BIT(21) +#define pll_alpha_width (p) \ ((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \ ALPHA_REG_BITWIDTH : ALPHA_REG_16BIT_WIDTH)@@ -1600,3 +1606,214 @@ const struct clk_ops clk_alpha_pll_agera_ops = { .set_rate = clk_alpha_pll_agera_set_rate, };EXPORT_SYMBOL_GPL (clk_alpha_pll_agera_ops); + +static int alpha_pll_lucid_5lpe_enable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ret; + +/* If in FSM mode, just vote for it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { + ret =clk_enable_regmap (hw); +if (ret) +return ret; +return wait_for_pll_enable_lock (pll); + } + +/* Check if PLL is already enabled, return if enabled */ + ret =trion_pll_is_enabled (pll, pll->clkr.regmap); +if (ret <0 ) +return ret; + + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_RESET_N ,PLL_RESET_N ); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_RUN ); + + ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + +/* Enable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,PLL_OUT_MASK ); +if (ret) +return ret; + +/* Enable the global PLL outputs */ +return regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,PLL_OUTCTRL ); +} + +static void alpha_pll_lucid_5lpe_disable (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +u32 val; +int ret; + + ret =regmap_read (pll->clkr.regmap,PLL_USER_CTL (pll), &val); +if (ret) +return ; + +/* If in FSM mode, just unvote it */ +if (val &LUCID_5LPE_ENABLE_VOTE_RUN ) { +clk_disable_regmap (hw); +return ; + } + +/* Disable the global PLL output */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),PLL_OUTCTRL ,0 ); +if (ret) +return ; + +/* Disable the PLL outputs */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_USER_CTL (pll),PLL_OUT_MASK ,0 ); +if (ret) +return ; + +/* Place the PLL mode in STANDBY */ +regmap_write (pll->clkr.regmap,PLL_OPMODE (pll),PLL_STANDBY ); +} + +/* +* The Lucid 5LPE PLL requires a power-on self-calibration which happens +* when the PLL comes out of reset. Calibrate in case it is not completed. +*/ +static int alpha_pll_lucid_5lpe_prepare (struct clk_hw *hw) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +struct clk_hw *p; +u32 val; +int ret; + +/* Return early if calibration is not needed. */ +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (val &LUCID_5LPE_PCAL_DONE ) +return 0 ; + + p =clk_hw_get_parent (hw); +if (!p) +return -EINVAL ; + + ret =alpha_pll_lucid_5lpe_enable (hw); +if (ret) +return ret; + +alpha_pll_lucid_5lpe_disable (hw); + +return 0 ; +} + +static int alpha_pll_lucid_5lpe_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long prate) +{ +struct clk_alpha_pll *pll =to_clk_alpha_pll (hw); +unsigned long rrate; +u32 val, l; +u64 a; +int ret; + + rrate =alpha_pll_round_rate (rate, prate, &l, &a,ALPHA_REG_16BIT_WIDTH ); + +/* +* Due to a limited number of bits for fractional rate programming, the +* rounded up rate could be marginally higher than the requested rate. +*/ + ret =alpha_pll_check_rate_margin (hw, rrate, rate); +if (ret) +return ret; + +regmap_write (pll->clkr.regmap,PLL_L_VAL (pll), l); +regmap_write (pll->clkr.regmap,PLL_ALPHA_VAL (pll), a); + +/* Latch the PLL input */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll), +LUCID_5LPE_PLL_LATCH_INPUT ,LUCID_5LPE_PLL_LATCH_INPUT ); +if (ret) +return ret; + +/* Wait for 2 reference cycles before checking the ACK bit. */ +udelay (1 ); +regmap_read (pll->clkr.regmap,PLL_MODE (pll), &val); +if (!(val &LUCID_5LPE_ALPHA_PLL_ACK_LATCH )) { +pr_err ("Lucid 5LPE PLL latch failed. Output may be unstable!\n" ); +return -EINVAL ; + } + +/* Return the latch input to 0 */ + ret =regmap_update_bits (pll->clkr.regmap,PLL_MODE (pll),LUCID_5LPE_PLL_LATCH_INPUT ,0 ); +if (ret) +return ret; + +if (clk_hw_is_enabled (hw)) {drivers/clk/qcom/clk-alpha-pll.c const struct clk_ops clk_alpha_pll_agera_ops = { · line 1762
Quoted 10 lines
drivers/clk/qcom/clk-alpha-pll.c +10
-0+ ret =wait_for_pll_enable_lock (pll); +if (ret) +return ret; + } + +/* Wait for PLL output to stabilize */ +udelay (100 ); +return 0 ; +} +This one looks exactly like
alpha_pll_trion_set_rate()but:
1. You are forcingALPHA_REG_16BIT_WIDTHfor thealpha_pll_round_rate
call: this is bad, you should actually usepll_alpha_width(pll)here, unless you have a very good reason that I didn't understand...
2. The only change between these two functions (trion andlucid_5lpe_set_rate) is thatPLL_UPDATEbecomesLUCID_5LPE_PLL_LATCH_INPUT, and that you check forLUCID_5LPE_ALPHA_PLL_ACK_LATCHinstead ofALPHA_PLL_ACK_LATCH: this looks like being 95% code duplication.
Quoted 8 lines
Quoted 2 lines
The best options here, in my opinion, would be to commonize the function
alpha_pll_trion_set_rate: that will avoid this huge duplication.Yeah I agree we could reuse, I can redo this. I was thinking of making this bit as one of the values in register and use that but that does not look good as this is not a register offset, so only option is to have a new type of PLL for this and use that as here..
Just an idea:
static int __alpha_pll_trion_set_rate(struct clk_hw *hw,
u32 upd_regbit, u32 latch_regbit, unsigned long rate, unsigned long prate)
static int alpha_pll_trion_set_rate( args here )
{
return __alpha_pll_trion_set_rate(hw, PLL_UPDATE,
ALPHA_PLL_ACK_LATCH,
rate, prate);
}static int alpha_pll_lucid_5lpe_set_rate( args )
{
return __alpha_pll_trion_set_rate(hw, LUCID_5LPE_PLL_UPDATE,
LUCID_5LPE_PLL_ACK_LATCH,
rate, prate);
}Perhaps, that would be good.
--Angelo
PATCH 3/4 dt-bindings: clock: Add SM8350 GCC clock bindings
In reply to Vinod KoulAdd device tree bindings for global clock controller on SM8350 SoCs.
--- .../bindings/clock/qcom,gcc-sm8350.yaml | 96 +++++++ include/dt-bindings/clock/qcom,gcc-sm8350.h | 261 ++++++++++++++++++ 2 files changed, 357 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm8350.yaml create mode 100644 include/dt-bindings/clock/qcom,gcc-sm8350.h
Documentation/devicetree/bindings/clock/qcom,gcc-sm8350.yaml new file +96 -0
@@ -0,0 +1,96 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,gcc-sm8350.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Global Clock & Reset Controller Binding for SM8350 + +maintainers: + - Vinod Koul <[email protected]> + +description: | + Qualcomm global clock control module which supports the clocks, resets and + power domains on SM8350. + + See also: + - dt-bindings/clock/qcom,gcc-sm8350.h + +properties: + compatible: + const: qcom,gcc-sm8350 + + clocks: + items: + - description: Board XO source + - description: Sleep clock source + - description: PLL test clock source (Optional clock) + - description: PCIE 0 Pipe clock source (Optional clock) + - description: PCIE 1 Pipe clock source (Optional clock) + - description: UFS card Rx symbol 0 clock source (Optional clock) + - description: UFS card Rx symbol 1 clock source (Optional clock) + - description: UFS card Tx symbol 0 clock source (Optional clock) + - description: UFS phy Rx symbol 0 clock source (Optional clock) + - description: UFS phy Rx symbol 1 clock source (Optional clock) + - description: UFS phy Tx symbol 0 clock source (Optional clock) + - description: USB3 phy wrapper pipe clock source (Optional clock) + - description: USB3 phy sec pipe clock source (Optional clock) + minItems: 2 + maxItems: 13 + + clock-names: + items: + - const: bi_tcxo + - const: sleep_clk + - const: core_bi_pll_test_se # Optional clock + - const: pcie_0_pipe_clk # Optional clock + - const: pcie_1_pipe_clk # Optional clock + - const: ufs_card_rx_symbol_0_clk # Optional clock + - const: ufs_card_rx_symbol_1_clk # Optional clock + - const: ufs_card_tx_symbol_0_clk # Optional clock + - const: ufs_phy_rx_symbol_0_clk # Optional clock + - const: ufs_phy_rx_symbol_1_clk # Optional clock + - const: ufs_phy_tx_symbol_0_clk # Optional clock + - const: usb3_phy_wrapper_gcc_usb30_pipe_clk # Optional clock + - const: usb3_uni_phy_sec_gcc_usb30_pipe_clk # Optional clock + minItems: 2 + maxItems: 13 + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + + '#power-domain-cells': + const: 1 + + reg: + maxItems: 1 + +required: + - compatible + - clocks + - clock-names + - reg + - '#clock-cells' + - '#reset-cells' + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,rpmh.h> + clock-controller@100000 { + compatible = "qcom,gcc-sm8350"; + reg = <0x00100000 0x1f0000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&sleep_clk>; + clock-names = "bi_tcxo", "sleep_clk"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; + +...
include/dt-bindings/clock/qcom,gcc-sm8350.h new file +261 -0
261 lines not on this page · raw message
Signature · 1 line
2.26.2
Re: [PATCH 3/4] dt-bindings: clock: Add SM8350 GCC clock bindings
Quoted 10 lines · Vinod Koul
Add device tree bindings for global clock controller on SM8350 SoCs.
Signed-off-by Vinod Koul <[email protected]>--- .../bindings/clock/qcom,gcc-sm8350.yaml | 96 +++++++ include/dt-bindings/clock/qcom,gcc-sm8350.h | 261 ++++++++++++++++++ 2 files changed, 357 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm8350.yaml create mode 100644 include/dt-bindings/clock/qcom,gcc-sm8350.h
PATCH 4/4 clk: qcom: gcc: Add clock driver for SM8350
In reply to Vinod KoulFrom: Vivek Aknurwar <[email protected]>
This adds Global Clock controller (GCC) driver for SM8350 SoC
--- drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-sm8350.c | 3790 +++++++++++++++++++++++++++++++++ 3 files changed, 3799 insertions(+) create mode 100644 drivers/clk/qcom/gcc-sm8350.c
drivers/clk/qcom/Kconfig +8 -0
@@ -454,6 +454,14 @@ config SM_GCC_8250 Say Y if you want to use peripheral devices such as UART, SPI, I2C, USB, SD/UFS, PCIe etc. +config SM_GCC_8350 + tristate "SM8350 Global Clock Controller" + select QCOM_GDSC + help + Support for the global clock controller on SM8350 devices. + Say Y if you want to use peripheral devices such as UART, + SPI, I2C, USB, SD/UFS, PCIe etc. + config SM_GPUCC_8150 tristate "SM8150 Graphics Clock Controller" select SM_GCC_8150
drivers/clk/qcom/Makefile +1 -0
@@ -70,6 +70,7 @@ obj-$(CONFIG_SDX_GCC_55) += gcc-sdx55.o obj-$(CONFIG_SM_DISPCC_8250) += dispcc-sm8250.o obj-$(CONFIG_SM_GCC_8150) += gcc-sm8150.o obj-$(CONFIG_SM_GCC_8250) += gcc-sm8250.o +obj-$(CONFIG_SM_GCC_8350) += gcc-sm8350.o obj-$(CONFIG_SM_GPUCC_8150) += gpucc-sm8150.o obj-$(CONFIG_SM_GPUCC_8250) += gpucc-sm8250.o obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o
drivers/clk/qcom/gcc-sm8350.c new file +3790 -0
2,979 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.26.2
Part of the diff is not shown here. View the raw message.