linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>,
	Taniya Das <tdas@codeaurora.org>
Cc: Rajendra Nayak <rnayak@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org, robh+dt@kernel.org,
	Taniya Das <tdas@codeaurora.org>
Subject: Re: [PATCH v1 2/2] clk: qcom: Add Global Clock controller (GCC) driver for SC7280
Date: Tue, 12 Jan 2021 12:04:41 -0800	[thread overview]
Message-ID: <161048188125.3661239.13161942092910464158@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <1608058114-29025-3-git-send-email-tdas@codeaurora.org>

Quoting Taniya Das (2020-12-15 10:48:34)
> diff --git a/drivers/clk/qcom/gcc-sc7280.c b/drivers/clk/qcom/gcc-sc7280.c
> new file mode 100644
> index 0000000..74a3151
> --- /dev/null
> +++ b/drivers/clk/qcom/gcc-sc7280.c
> @@ -0,0 +1,3361 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) 2020, The Linux Foundation. All rights reserved.
> + */
> +
> +#include <linux/clk-provider.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/of.h>
> +#include <linux/regmap.h>
> +
> +#include <dt-bindings/clock/qcom,gcc-sc7280.h>
> +
> +#include "clk-alpha-pll.h"
> +#include "clk-branch.h"
> +#include "clk-rcg.h"
> +#include "clk-regmap-divider.h"
> +#include "clk-regmap-mux.h"
> +#include "common.h"
> +#include "gdsc.h"
> +#include "reset.h"
> +
[...]
> +static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk_src[] = {
> +       F(144000, P_BI_TCXO, 16, 3, 25),
> +       F(400000, P_BI_TCXO, 12, 1, 4),
> +       F(20000000, P_GCC_GPLL0_OUT_EVEN, 5, 1, 3),
> +       F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
> +       F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0),
> +       F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
> +       F(192000000, P_GCC_GPLL10_OUT_MAIN, 2, 0, 0),
> +       F(384000000, P_GCC_GPLL10_OUT_MAIN, 1, 0, 0),
> +       { }
> +};
> +
> +static struct clk_rcg2 gcc_sdcc1_apps_clk_src = {
> +       .cmd_rcgr = 0x7500c,
> +       .mnd_width = 8,
> +       .hid_width = 5,
> +       .parent_map = gcc_parent_map_8,
> +       .freq_tbl = ftbl_gcc_sdcc1_apps_clk_src,
> +       .clkr.hw.init = &(struct clk_init_data){
> +               .name = "gcc_sdcc1_apps_clk_src",
> +               .parent_data = gcc_parent_data_8,
> +               .num_parents = ARRAY_SIZE(gcc_parent_data_8),
> +               .flags = CLK_SET_RATE_PARENT,
> +               .ops = &clk_rcg2_ops,

This needs to use floor clk ops?

> +       },
> +};
> +
> +static const struct freq_tbl ftbl_gcc_sdcc1_ice_core_clk_src[] = {
> +       F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
> +       F(150000000, P_GCC_GPLL0_OUT_EVEN, 2, 0, 0),
> +       F(300000000, P_GCC_GPLL0_OUT_EVEN, 1, 0, 0),
> +       { }
> +};
> +
> +static struct clk_rcg2 gcc_sdcc1_ice_core_clk_src = {
> +       .cmd_rcgr = 0x7502c,
> +       .mnd_width = 0,
> +       .hid_width = 5,
> +       .parent_map = gcc_parent_map_1,
> +       .freq_tbl = ftbl_gcc_sdcc1_ice_core_clk_src,
> +       .clkr.hw.init = &(struct clk_init_data){
> +               .name = "gcc_sdcc1_ice_core_clk_src",
> +               .parent_data = gcc_parent_data_1,
> +               .num_parents = ARRAY_SIZE(gcc_parent_data_1),
> +               .flags = CLK_SET_RATE_PARENT,
> +               .ops = &clk_rcg2_ops,

Same.

> +       },
> +};
> +
> +static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
> +       F(400000, P_BI_TCXO, 12, 1, 4),
> +       F(19200000, P_BI_TCXO, 1, 0, 0),
> +       F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
> +       F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0),
> +       F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
> +       F(202000000, P_GCC_GPLL9_OUT_MAIN, 4, 0, 0),
> +       { }
> +};
> +
> +static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
> +       .cmd_rcgr = 0x1400c,
> +       .mnd_width = 8,
> +       .hid_width = 5,
> +       .parent_map = gcc_parent_map_9,
> +       .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_9,
> +               .num_parents = ARRAY_SIZE(gcc_parent_data_9),
> +               .flags = CLK_SET_RATE_PARENT,
> +               .ops = &clk_rcg2_ops,

Same.

> +       },
> +};
> +
> +static const struct freq_tbl ftbl_gcc_sdcc4_apps_clk_src[] = {
> +       F(400000, P_BI_TCXO, 12, 1, 4),
> +       F(19200000, P_BI_TCXO, 1, 0, 0),
> +       F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
> +       F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0),
> +       F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
> +       { }
> +};
> +
> +static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
> +       .cmd_rcgr = 0x1600c,
> +       .mnd_width = 8,
> +       .hid_width = 5,
> +       .parent_map = gcc_parent_map_1,
> +       .freq_tbl = ftbl_gcc_sdcc4_apps_clk_src,
> +       .clkr.hw.init = &(struct clk_init_data){
> +               .name = "gcc_sdcc4_apps_clk_src",
> +               .parent_data = gcc_parent_data_1,
> +               .num_parents = ARRAY_SIZE(gcc_parent_data_1),
> +               .flags = CLK_SET_RATE_PARENT,
> +               .ops = &clk_rcg2_ops,

Same.

> +       },
> +};
> +
[...]
> +static struct clk_branch gcc_cpuss_ahb_clk = {
> +       .halt_reg = 0x48000,
> +       .halt_check = BRANCH_HALT_VOTED,
> +       .hwcg_reg = 0x48000,
> +       .hwcg_bit = 1,
> +       .clkr = {
> +               .enable_reg = 0x52000,
> +               .enable_mask = BIT(21),
> +               .hw.init = &(struct clk_init_data){
> +                       .name = "gcc_cpuss_ahb_clk",
> +                       .parent_data = &(const struct clk_parent_data){
> +                               .hw = &gcc_cpuss_ahb_postdiv_clk_src.clkr.hw,
> +                       },
> +                       .num_parents = 1,
> +                       .flags = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT,

Why is it critical? Please add a comment like sc7180.

> +                       .ops = &clk_branch2_ops,
> +               },
> +       },
> +};
> +

  reply	other threads:[~2021-01-12 21:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 18:48 [PATCH v1 0/2] Add Global Clock controller (GCC) driver for SC7280 Taniya Das
2020-12-15 18:48 ` [PATCH v1 1/2] dt-bindings: clock: Add SC7280 GCC clock binding Taniya Das
2020-12-21 19:00   ` Rob Herring
2021-02-10 18:21     ` Taniya Das
2021-01-12 20:06   ` Stephen Boyd
2021-02-10 18:22     ` Taniya Das
2020-12-15 18:48 ` [PATCH v1 2/2] clk: qcom: Add Global Clock controller (GCC) driver for SC7280 Taniya Das
2021-01-12 20:04   ` Stephen Boyd [this message]
2021-02-10 18:24     ` Taniya Das

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=161048188125.3661239.13161942092910464158@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=rnayak@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=tdas@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).