From: Jie Luo <quic_luoj@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<quic_kkumarcs@quicinc.com>, <quic_suruchia@quicinc.com>,
<quic_pavir@quicinc.com>, <quic_linchen@quicinc.com>,
<quic_leiwei@quicinc.com>, <bartosz.golaszewski@linaro.org>,
<srinivas.kandagatla@linaro.org>
Subject: Re: [PATCH v6 2/5] clk: qcom: Add CMN PLL clock controller driver for IPQ SoC
Date: Fri, 13 Dec 2024 18:19:40 +0800 [thread overview]
Message-ID: <a3ddacc9-73cd-4214-9a39-5aaaa91fc93e@quicinc.com> (raw)
In-Reply-To: <7f0f2ad6-7895-46f8-8f80-0375dde2e763@oss.qualcomm.com>
On 12/13/2024 2:30 AM, Konrad Dybcio wrote:
> On 7.11.2024 10:50 AM, Luo Jie wrote:
>> The CMN PLL clock controller supplies clocks to the hardware
>> blocks that together make up the Ethernet function on Qualcomm
>> IPQ SoCs and to GCC. The driver is initially supported for
>> IPQ9574 SoC.
>>
>> The CMN PLL clock controller expects a reference input clock
>> from the on-board Wi-Fi block acting as clock source. The input
>> reference clock needs to be configured to one of the supported
>> clock rates.
>>
>> The controller supplies a number of fixed-rate output clocks.
>> For the IPQ9574, there is one output clock of 353 MHZ to PPE
>> (Packet Process Engine) hardware block, three 50 MHZ output
>> clocks and an additional 25 MHZ output clock supplied to the
>> connected Ethernet devices. The PLL also supplies a 24 MHZ
>> clock as XO and a 32 KHZ sleep clock to GCC, and one 31.25
>> MHZ clock to PCS.
>>
>> Signed-off-by: Luo Jie <quic_luoj@quicinc.com>
>> ---
>
> [...]
>
>> + /* Enable PLL locked detect. */
>> + ret = regmap_update_bits(cmn_pll->regmap, CMN_PLL_CTRL,
>> + CMN_PLL_CTRL_LOCK_DETECT_EN,
>> + CMN_PLL_CTRL_LOCK_DETECT_EN);
>> + if (ret)
>
> you can streamline these with regmap_set/clear_bits
Ok, thanks, I will update to use it.
>
>> + return ret;
>> +
>> + /*
>> + * Reset the CMN PLL block to ensure the updated configurations
>> + * take effect.
>> + */
>> + ret = regmap_update_bits(cmn_pll->regmap, CMN_PLL_POWER_ON_AND_RESET,
>> + CMN_ANA_EN_SW_RSTN, 0);
>> + if (ret)
>> + return ret;
>> +
>> + usleep_range(1000, 1200);
>> + ret = regmap_update_bits(cmn_pll->regmap, CMN_PLL_POWER_ON_AND_RESET,
>> + CMN_ANA_EN_SW_RSTN, CMN_ANA_EN_SW_RSTN);
>> + if (ret)
>> + return ret;
>> +
>> + /* Stability check of CMN PLL output clocks. */
>> + return regmap_read_poll_timeout(cmn_pll->regmap, CMN_PLL_LOCKED, val,
>> + (val & CMN_PLL_CLKS_LOCKED),
>> + 100, 100 * USEC_PER_MSEC);
>> +}
>
> [...]
>
>> +static int ipq_cmn_pll_clk_probe(struct platform_device *pdev)
>> +{
>> + struct device *dev = &pdev->dev;
>> + int ret;
>> +
>> + ret = devm_pm_runtime_enable(dev);
>> + if (ret)
>> + return ret;
>> +
>> + ret = devm_pm_clk_create(dev);
>> + if (ret)
>> + return ret;
>> +
>> + /*
>> + * To access the CMN PLL registers, the GCC AHB & SYSY clocks
>
> SYS?
>
> Konrad
Yes, I will correct it.
next prev parent reply other threads:[~2024-12-13 10:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 9:50 [PATCH v6 0/5] Add CMN PLL clock controller driver for IPQ9574 Luo Jie
2024-11-07 9:50 ` [PATCH v6 1/5] dt-bindings: clock: qcom: Add CMN PLL clock controller for IPQ SoC Luo Jie
2024-11-07 9:50 ` [PATCH v6 2/5] clk: qcom: Add CMN PLL clock controller driver " Luo Jie
2024-12-12 18:30 ` Konrad Dybcio
2024-12-13 10:19 ` Jie Luo [this message]
2024-11-07 9:50 ` [PATCH v6 3/5] arm64: defconfig: Enable Qualcomm IPQ CMN PLL clock controller Luo Jie
2024-11-07 9:50 ` [PATCH v6 4/5] arm64: dts: qcom: Add CMN PLL node for IPQ9574 SoC Luo Jie
2024-12-12 18:32 ` Konrad Dybcio
2024-12-13 10:28 ` Jie Luo
2024-11-07 9:50 ` [PATCH v6 5/5] arm64: dts: qcom: Update IPQ9574 xo_board_clk to use fixed factor clock Luo Jie
2024-12-12 18:33 ` Konrad Dybcio
2024-12-13 10:30 ` Jie Luo
2024-12-18 11:17 ` Jie Luo
2024-12-19 21:28 ` Konrad Dybcio
2024-12-20 6:43 ` Jie Luo
2024-12-20 10:07 ` Konrad Dybcio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3ddacc9-73cd-4214-9a39-5aaaa91fc93e@quicinc.com \
--to=quic_luoj@quicinc.com \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=quic_kkumarcs@quicinc.com \
--cc=quic_leiwei@quicinc.com \
--cc=quic_linchen@quicinc.com \
--cc=quic_pavir@quicinc.com \
--cc=quic_suruchia@quicinc.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®