2023-07-23 16:24:11

by Adam Skladowski

[permalink] [raw]
Subject: [PATCH v2 0/7] MSM8976 PLL,RPMPD and DTS changes

This patch series fixes introduce support for msm8976 pll,
also brings some adjustments and fixes domains setup and few dts nitpicks.

Changes since v1
================
1. Fixed few styling issues
2. Changed compatibles for plls
3. Added fixes: tag to first patch

Adam Skladowski (7):
drivers: soc: qcom: rpmpd: Fix MSM8976 power domains setup
clk: qcom: clk-hfpll: Configure l_val in init when required
clk: qcom: hfpll: Allow matching pdata
dt-bindings: clock: qcom,hfpll: Document MSM8976 compatibles
clk: qcom: hfpll: Add MSM8976 PLL data
arm64: dts: qcom: msm8976: Split lpass region
arm64: dts: qcom: msm8976: Fix smsm ipc bit shifts

.../devicetree/bindings/clock/qcom,hfpll.txt | 3 +
arch/arm64/boot/dts/qcom/msm8976.dtsi | 11 +++-
drivers/clk/qcom/clk-hfpll.c | 4 ++
drivers/clk/qcom/clk-hfpll.h | 1 +
drivers/clk/qcom/hfpll.c | 59 ++++++++++++++++++-
drivers/soc/qcom/rpmpd.c | 27 ++++-----
6 files changed, 83 insertions(+), 22 deletions(-)

--
2.25.1



2023-07-23 16:24:15

by Adam Skladowski

[permalink] [raw]
Subject: [PATCH v2 2/7] clk: qcom: clk-hfpll: Configure l_val in init when required

Add support for pre-configuring default frequency multiplier,
this appears to be required on some platforms like MSM8976.
Without configuring L_VAL device reboots when trying to bring PLL up.

Signed-off-by: Adam Skladowski <[email protected]>
---
drivers/clk/qcom/clk-hfpll.c | 4 ++++
drivers/clk/qcom/clk-hfpll.h | 1 +
2 files changed, 5 insertions(+)

diff --git a/drivers/clk/qcom/clk-hfpll.c b/drivers/clk/qcom/clk-hfpll.c
index 86f728dc69e5..705352aff067 100644
--- a/drivers/clk/qcom/clk-hfpll.c
+++ b/drivers/clk/qcom/clk-hfpll.c
@@ -44,6 +44,10 @@ static void __clk_hfpll_init_once(struct clk_hw *hw)
regmap_write(regmap, hd->user_reg, regval);
}

+ /* Write L_VAL from conf if it exist */
+ if (hd->l_val)
+ regmap_write(regmap, hd->l_reg, hd->l_val);
+
if (hd->droop_reg)
regmap_write(regmap, hd->droop_reg, hd->droop_val);

diff --git a/drivers/clk/qcom/clk-hfpll.h b/drivers/clk/qcom/clk-hfpll.h
index 2a57b2fb2f2f..27b9effcb3fd 100644
--- a/drivers/clk/qcom/clk-hfpll.h
+++ b/drivers/clk/qcom/clk-hfpll.h
@@ -18,6 +18,7 @@ struct hfpll_data {
u32 status_reg;
u8 lock_bit;

+ u32 l_val;
u32 droop_val;
u32 config_val;
u32 user_val;
--
2.25.1


2023-07-24 14:27:09

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 2/7] clk: qcom: clk-hfpll: Configure l_val in init when required

On 23.07.2023 18:08, Adam Skladowski wrote:
> Add support for pre-configuring default frequency multiplier,
> this appears to be required on some platforms like MSM8976.
> Without configuring L_VAL device reboots when trying to bring PLL up.
>
> Signed-off-by: Adam Skladowski <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

2023-07-24 21:42:45

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH v2 0/7] MSM8976 PLL,RPMPD and DTS changes

On 23/07/2023 19:08, Adam Skladowski wrote:
> This patch series fixes introduce support for msm8976 pll,
> also brings some adjustments and fixes domains setup and few dts nitpicks.

Could you please extend the series with the DT patches utilizing the
HFPLL? You can keep them disabled via the status property if they are
not expected to be used yet.

>
> Changes since v1
> ================
> 1. Fixed few styling issues
> 2. Changed compatibles for plls
> 3. Added fixes: tag to first patch
>
> Adam Skladowski (7):
> drivers: soc: qcom: rpmpd: Fix MSM8976 power domains setup
> clk: qcom: clk-hfpll: Configure l_val in init when required
> clk: qcom: hfpll: Allow matching pdata
> dt-bindings: clock: qcom,hfpll: Document MSM8976 compatibles
> clk: qcom: hfpll: Add MSM8976 PLL data
> arm64: dts: qcom: msm8976: Split lpass region
> arm64: dts: qcom: msm8976: Fix smsm ipc bit shifts
>
> .../devicetree/bindings/clock/qcom,hfpll.txt | 3 +
> arch/arm64/boot/dts/qcom/msm8976.dtsi | 11 +++-
> drivers/clk/qcom/clk-hfpll.c | 4 ++
> drivers/clk/qcom/clk-hfpll.h | 1 +
> drivers/clk/qcom/hfpll.c | 59 ++++++++++++++++++-
> drivers/soc/qcom/rpmpd.c | 27 ++++-----
> 6 files changed, 83 insertions(+), 22 deletions(-)
>

--
With best wishes
Dmitry