linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Vivek Aknurwar <viveka@codeaurora.org>,
	Andy Gross <agross@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>,
	Taniya Das <tdas@codeaurora.org>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jeevan Shriram <jshriram@codeaurora.org>
Subject: Re: [PATCH v2 5/5] clk: qcom: gcc: Add clock driver for SM8350
Date: Fri, 11 Dec 2020 11:13:49 +0530	[thread overview]
Message-ID: <20201211054349.GS8403@vkoul-mobl> (raw)
In-Reply-To: <160763302790.1580929.10258660966995584297@swboyd.mtv.corp.google.com>

On 10-12-20, 12:43, Stephen Boyd wrote:
> Quoting Vinod Koul (2020-12-07 22:47:02)

> > +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.
> > +
> > +
> 
> Why double newline?

Will drop

> > +#include <linux/bitops.h>
> > +#include <linux/clk.h>
> 
> Is this include used?

Will check this and others and drop unused ones

> 
> > +#include <linux/clk-provider.h>
> > +#include <linux/err.h>
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/of_device.h>
> > +#include <linux/of.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/regmap.h>
> > +#include <linux/reset-controller.h>
> 
> Please add newline here
> 
> > +#include <dt-bindings/clock/qcom,gcc-sm8350.h>
> 
> Please add newline here

Ok to both

> > +static const struct clk_parent_data gcc_parent_data_0[] = {
> > +       { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
> > +       { .hw = &gcc_gpll0.clkr.hw },
> > +       { .hw = &gcc_gpll0_out_even.clkr.hw },
> > +       { .fw_name = "core_bi_pll_test_se", .name = "core_bi_pll_test_se" },
> 
> Is this .fw_name in the binding? Please remove .name everywhere in this
> driver as it shouldn't be necessary.

Ack will drop

> > +static const struct clk_parent_data gcc_parent_data_13[] = {
> > +       { .fw_name = "usb3_phy_wrapper_gcc_usb30_pipe_clk", .name =
> 
> Is this documented in the binding?

Not yet, will update

> > +static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
> > +       .cmd_rcgr = 0x1400c,
> > +       .mnd_width = 8,
> > +       .hid_width = 5,
> > +       .parent_map = gcc_parent_map_6,
> > +       .freq_tbl = ftbl_gcc_sdcc2_apps_clk_src,
> > +       .clkr.hw.init = &(struct clk_init_data){
> > +               .name = "gcc_sdcc2_apps_clk_src",
> > +               .parent_data = gcc_parent_data_6,
> > +               .num_parents = 6,
> > +               .flags = CLK_SET_RATE_PARENT,
> > +               .ops = &clk_rcg2_ops,
> 
> Please use floor ops per Doug's recent patch.

Yes

> > +static struct clk_branch gcc_camera_ahb_clk = {
> > +       .halt_reg = 0x26004,
> > +       .halt_check = BRANCH_HALT_DELAY,
> > +       .hwcg_reg = 0x26004,
> > +       .hwcg_bit = 1,
> > +       .clkr = {
> > +               .enable_reg = 0x26004,
> > +               .enable_mask = BIT(0),
> > +               .hw.init = &(struct clk_init_data){
> > +                       .name = "gcc_camera_ahb_clk",
> > +                       .flags = CLK_IS_CRITICAL,
> 
> Why is it critical? Can we just enable it in driver probe and stop
> modeling it as a clk?

it does not have a parent we control, yeah it would make sense to do
that. Tanya do you folks agree ..?

> > +static struct clk_branch gcc_video_axi0_clk = {
> > +       .halt_reg = 0x28010,
> > +       .halt_check = BRANCH_HALT_SKIP,
> 
> Do these need to be halt skip? Is the video axi clk stuff still broken?

I will check on this and update accordingly

> > +static int gcc_sm8350_probe(struct platform_device *pdev)
> > +{
> > +       struct regmap *regmap;
> > +       int ret;
> > +
> > +       regmap = qcom_cc_map(pdev, &gcc_sm8350_desc);
> > +       if (IS_ERR(regmap)) {
> > +               dev_err(&pdev->dev, "Failed to map gcc registers\n");
> > +               return PTR_ERR(regmap);
> > +       }
> > +
> > +       ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks));
> > +       if (ret)
> > +               return ret;
> > +
> > +       /* FORCE_MEM_CORE_ON for ufs phy ice core clocks */
> 
> Why?

So I understood that this needs to be set so that ufs clocks can
propagate to ufs mem stuff..

-- 
~Vinod

  reply	other threads:[~2020-12-11  5:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08  6:46 [PATCH v2 0/5] Add clock drivers for SM8350 Vinod Koul
2020-12-08  6:46 ` [PATCH v2 1/5] dt-bindings: clock: Add RPMHCC bindings " Vinod Koul
2020-12-10  3:59   ` Rob Herring
2020-12-10 20:44   ` Stephen Boyd
2020-12-08  6:46 ` [PATCH v2 2/5] clk: qcom: rpmh: add support for SM8350 rpmh clocks Vinod Koul
2020-12-10 20:48   ` Stephen Boyd
2020-12-08  6:47 ` [PATCH v2 3/5] dt-bindings: clock: Add SM8350 GCC clock bindings Vinod Koul
2020-12-10  4:01   ` Rob Herring
2020-12-10  6:11     ` Vinod Koul
2020-12-10 20:31       ` Stephen Boyd
2020-12-11  4:29         ` Vinod Koul
2020-12-08  6:47 ` [PATCH v2 4/5] clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL Vinod Koul
2020-12-10 20:36   ` Stephen Boyd
2020-12-11  5:02     ` Vinod Koul
2020-12-11  7:09       ` Stephen Boyd
2020-12-08  6:47 ` [PATCH v2 5/5] clk: qcom: gcc: Add clock driver for SM8350 Vinod Koul
2020-12-10 20:43   ` Stephen Boyd
2020-12-11  5:43     ` Vinod Koul [this message]
2020-12-11  7:10       ` Stephen Boyd
2020-12-13  8:30         ` Taniya Das
2020-12-14  4:40           ` Vinod Koul

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=20201211054349.GS8403@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jshriram@codeaurora.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=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tdas@codeaurora.org \
    --cc=viveka@codeaurora.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;
as well as URLs for NNTP newsgroup(s).