Linux clock framework development
 help / color / mirror / Atom feed
From: Jagadeesh Kona <quic_jkona@quicinc.com>
To: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Taniya Das <quic_tdas@quicinc.com>,
	Satya Priya Kakitapalli <quic_skakitap@quicinc.com>,
	Ajit Pandey <quic_ajipan@quicinc.com>,
	Imran Shaik <quic_imrashai@quicinc.com>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Subject: Re: [PATCH V2 RESEND 5/6] clk: qcom: camcc-sm8650: Add SM8650 camera clock controller driver
Date: Mon, 22 Apr 2024 16:27:54 +0530	[thread overview]
Message-ID: <4b2e0c76-e455-40f8-b652-a4b723cc8601@quicinc.com> (raw)
In-Reply-To: <d3d3be20-7ec0-419c-b5a3-77047d8bc7bf@linaro.org>



On 4/19/2024 3:00 AM, Vladimir Zapolskiy wrote:
> Hello Jagadeesh,
> 
> thank you for submitting the clock driver.
> 
> On 3/21/24 11:25, Jagadeesh Kona wrote:
>> Add support for the camera clock controller for camera clients to
>> be able to request for camcc clocks on SM8650 platform.
>>
>> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
>> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>> ---
>>   drivers/clk/qcom/Kconfig        |    8 +
>>   drivers/clk/qcom/Makefile       |    1 +
>>   drivers/clk/qcom/camcc-sm8650.c | 3591 +++++++++++++++++++++++++++++++
>>   3 files changed, 3600 insertions(+)
>>   create mode 100644 drivers/clk/qcom/camcc-sm8650.c
>>
>> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
>> index 8ab08e7b5b6c..6257f4a02ec4 100644
>> --- a/drivers/clk/qcom/Kconfig
>> +++ b/drivers/clk/qcom/Kconfig
>> @@ -826,6 +826,14 @@ config SM_CAMCC_8550
>>         Support for the camera clock controller on SM8550 devices.
>>         Say Y if you want to support camera devices and camera 
>> functionality.
>> +config SM_CAMCC_8650
>> +    tristate "SM8650 Camera Clock Controller"
>> +    depends on ARM64 || COMPILE_TEST
>> +    select SM_GCC_8650
>> +    help
>> +      Support for the camera clock controller on SM8650 devices.
>> +      Say Y if you want to support camera devices and camera 
>> functionality.
>> +
>>   config SM_DISPCC_6115
>>       tristate "SM6115 Display Clock Controller"
>>       depends on ARM64 || COMPILE_TEST
>> diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
>> index dec5b6db6860..28bffa1eb8dd 100644
>> --- a/drivers/clk/qcom/Makefile
>> +++ b/drivers/clk/qcom/Makefile
>> @@ -109,6 +109,7 @@ obj-$(CONFIG_SM_CAMCC_6350) += camcc-sm6350.o
>>   obj-$(CONFIG_SM_CAMCC_8250) += camcc-sm8250.o
>>   obj-$(CONFIG_SM_CAMCC_8450) += camcc-sm8450.o
>>   obj-$(CONFIG_SM_CAMCC_8550) += camcc-sm8550.o
>> +obj-$(CONFIG_SM_CAMCC_8650) += camcc-sm8650.o
>>   obj-$(CONFIG_SM_DISPCC_6115) += dispcc-sm6115.o
>>   obj-$(CONFIG_SM_DISPCC_6125) += dispcc-sm6125.o
>>   obj-$(CONFIG_SM_DISPCC_6350) += dispcc-sm6350.o
>> diff --git a/drivers/clk/qcom/camcc-sm8650.c 
>> b/drivers/clk/qcom/camcc-sm8650.c
>> new file mode 100644
>> index 000000000000..1b28e086e519
>> --- /dev/null
>> +++ b/drivers/clk/qcom/camcc-sm8650.c
>> @@ -0,0 +1,3591 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights 
>> reserved.
>> + */
>> +
>> +#include <linux/clk-provider.h>
>> +#include <linux/mod_devicetable.h>
>> +#include <linux/module.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/pm_runtime.h>
>> +#include <linux/regmap.h>
>> +
>> +#include <dt-bindings/clock/qcom,sm8650-camcc.h>
>> +
>> +#include "clk-alpha-pll.h"
>> +#include "clk-branch.h"
>> +#include "clk-rcg.h"
>> +#include "clk-regmap.h"
>> +#include "common.h"
>> +#include "gdsc.h"
>> +#include "reset.h"
>> +
>> +enum {
>> +    DT_IFACE,
>> +    DT_BI_TCXO,
>> +    DT_BI_TCXO_AO,
>> +    DT_SLEEP_CLK,
>> +};
>> +
>> +enum {
>> +    P_BI_TCXO,
>> +    P_BI_TCXO_AO,
>> +    P_CAM_CC_PLL0_OUT_EVEN,
>> +    P_CAM_CC_PLL0_OUT_MAIN,
>> +    P_CAM_CC_PLL0_OUT_ODD,
>> +    P_CAM_CC_PLL1_OUT_EVEN,
>> +    P_CAM_CC_PLL2_OUT_EVEN,
>> +    P_CAM_CC_PLL2_OUT_MAIN,
>> +    P_CAM_CC_PLL3_OUT_EVEN,
>> +    P_CAM_CC_PLL4_OUT_EVEN,
>> +    P_CAM_CC_PLL5_OUT_EVEN,
>> +    P_CAM_CC_PLL6_OUT_EVEN,
>> +    P_CAM_CC_PLL7_OUT_EVEN,
>> +    P_CAM_CC_PLL8_OUT_EVEN,
>> +    P_CAM_CC_PLL9_OUT_EVEN,
>> +    P_CAM_CC_PLL9_OUT_ODD,
>> +    P_CAM_CC_PLL10_OUT_EVEN,
>> +    P_SLEEP_CLK,
>> +};
>> +
>> +static const struct pll_vco lucid_ole_vco[] = {
>> +    { 249600000, 2300000000, 0 },
>> +};
> 
> I've noticed that a downstream Android kernel v6.1.25 defines this clock as
> 
>      static const struct pll_vco lucid_ole_vco[] = {
>          { 249600000, 2100000000, 0 },
>      };
> 
> Do you know any particular reason why here the clock frequencies are 
> different?
> 

Thanks Vladimir for your review!

The min and max supported frequencies of PLL mentioned above are taken 
from the HW specification, and as per the latest HW spec, the maximum 
supported frequency for lucid OLE PLL is 2300MHz, hence used 2300MHz above.

>> +
>> +static const struct pll_vco rivian_ole_vco[] = {
>> +    { 777000000, 1285000000, 0 },
>> +};
>> +
> 
> <snip>
> 
>> +static struct clk_rcg2 cam_cc_bps_clk_src = {
>> +    .cmd_rcgr = 0x10050,
>> +    .mnd_width = 0,
>> +    .hid_width = 5,
>> +    .parent_map = cam_cc_parent_map_2,
>> +    .freq_tbl = ftbl_cam_cc_bps_clk_src,
>> +    .clkr.hw.init = &(const struct clk_init_data) {
>> +        .name = "cam_cc_bps_clk_src",
>> +        .parent_data = cam_cc_parent_data_2,
>> +        .num_parents = ARRAY_SIZE(cam_cc_parent_data_2),
>> +        .flags = CLK_SET_RATE_PARENT,
>> +        .ops = &clk_rcg2_shared_ops,
>> +    },
>> +};
> 
> Please let me ask after Dmitry about your rationale to select
> &clk_rcg2_shared_ops here and below for all *_src clocks introduced in
> the driver, I do remember you've did it in v1, could you please
> elaborate it a bit more?
> 
> I have a concern that it's not possible to get an .is_enabled status
> of the shared clocks, however at least in this particular case of
> camcc clocks it seems to be technically possible.
> 
> It might indicate that there is an incompleteness in clk-rcg2.c driver
> also, if it's really possible to get is_enabled runtime status at least
> for some of the shared clocks.
> 

The recommendation from HW team is to park the RCG's at XO clock source 
when RCG is in disabled state and clk_rcg2_shared_ops is the closest 
implementation for achieving the same, hence used clk_rcg2_shared_ops 
for all the RCG's.

I will check if .is_enabled callback can be added to shared_ops and post 
a separate series for it based on the requirement.

>> +
>> +static const struct freq_tbl ftbl_cam_cc_camnoc_axi_rt_clk_src[] = {
>> +    F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0),
>> +    F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0),
>> +    { }
>> +};
>> +
> 
> <snip>
> 
> Other than two my open questions above I don't see any issues with the
> driver, if you be kind to provide the answers, please feel free to add
> my
> 
> Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
> Tested-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
> 

Thanks, sure will add these tags in next series.

Thanks,
Jagadeesh

> -- 
> Best wishes,
> Vladimir
> 

  reply	other threads:[~2024-04-22 10:58 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21  9:25 [PATCH V2 RESEND 0/6] Add support for videocc and camcc on SM8650 Jagadeesh Kona
2024-03-21  9:25 ` [PATCH V2 RESEND 1/6] dt-bindings: clock: qcom: Add SM8650 video clock controller Jagadeesh Kona
2024-03-21 13:12   ` Dmitry Baryshkov
2024-03-25  6:07     ` Jagadeesh Kona
2024-03-25  6:38       ` Dmitry Baryshkov
2024-03-25  7:00         ` Jagadeesh Kona
2024-04-18 21:01       ` Vladimir Zapolskiy
2024-04-22 11:00         ` Jagadeesh Kona
2024-04-25 13:32           ` Vladimir Zapolskiy
2024-04-26 14:26             ` Jagadeesh Kona
2024-03-21  9:25 ` [PATCH V2 RESEND 2/6] clk: qcom: videocc-sm8550: Add support for videocc XO clk ares Jagadeesh Kona
2024-03-21  9:44   ` Dmitry Baryshkov
2024-03-21 11:36     ` Jagadeesh Kona
2024-03-23  0:30   ` Konrad Dybcio
2024-03-25  6:09     ` Jagadeesh Kona
2024-03-21  9:25 ` [PATCH V2 RESEND 3/6] clk: qcom: videocc-sm8550: Add SM8650 video clock controller Jagadeesh Kona
2024-03-21 10:03   ` Dmitry Baryshkov
2024-03-21 11:33     ` Jagadeesh Kona
2024-03-21  9:25 ` [PATCH V2 RESEND 4/6] dt-bindings: clock: qcom: Add SM8650 camera " Jagadeesh Kona
2024-03-21 10:20   ` Johan Hovold
2024-03-21 11:28     ` Jagadeesh Kona
2024-04-18 21:32   ` Vladimir Zapolskiy
2024-03-21  9:25 ` [PATCH V2 RESEND 5/6] clk: qcom: camcc-sm8650: Add SM8650 camera clock controller driver Jagadeesh Kona
2024-03-21 10:26   ` Dmitry Baryshkov
2024-04-18 21:30   ` Vladimir Zapolskiy
2024-04-22 10:57     ` Jagadeesh Kona [this message]
2024-03-21  9:25 ` [PATCH V2 RESEND 6/6] arm64: dts: qcom: sm8650: Add video and camera clock controllers Jagadeesh Kona
2024-03-21 13:07   ` Vladimir Zapolskiy
2024-03-23  0:33     ` Konrad Dybcio
2024-04-18 20:56       ` Vladimir Zapolskiy
2024-03-21 13:13   ` Dmitry Baryshkov
2024-03-25  6:08     ` Jagadeesh Kona
2024-04-03  7:16       ` Jagadeesh Kona
2024-04-03 15:54         ` Dmitry Baryshkov
2024-04-04  5:13           ` Jagadeesh Kona
2024-04-04  5:30             ` Dmitry Baryshkov
2024-04-04 10:06               ` Jagadeesh Kona
2024-04-04 16:05                 ` Dmitry Baryshkov
2024-04-05  6:00                   ` Jagadeesh Kona
2024-04-05  7:44                     ` Dmitry Baryshkov
2024-04-18 11:17                       ` Jagadeesh Kona

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=4b2e0c76-e455-40f8-b652-a4b723cc8601@quicinc.com \
    --to=quic_jkona@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.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_ajipan@quicinc.com \
    --cc=quic_imrashai@quicinc.com \
    --cc=quic_skakitap@quicinc.com \
    --cc=quic_tdas@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vladimir.zapolskiy@linaro.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