From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: "Andy Gross" <agross@kernel.org>,
"Bjorn Andersson" <bjorn.andersson@linaro.org>,
"Stanimir Varbanov" <svarbanov@mm-sol.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <swboyd@chromium.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Prasad Malisetty <pmaliset@codeaurora.org>,
Vinod Koul <vkoul@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org
Subject: [PATCH v2 04/11] clk: qcom: gcc-sc7280: switch PCIe GDSCs to pipe_clk_gdsc
Date: Fri, 4 Feb 2022 17:46:38 +0300 [thread overview]
Message-ID: <20220204144645.3016603-5-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20220204144645.3016603-1-dmitry.baryshkov@linaro.org>
Change sc7280's PCIe GDSCs to use new API for managing corresponding
pipe clock sources.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/clk/qcom/gcc-sc7280.c | 114 ++++++++++++----------------------
1 file changed, 40 insertions(+), 74 deletions(-)
diff --git a/drivers/clk/qcom/gcc-sc7280.c b/drivers/clk/qcom/gcc-sc7280.c
index 423627d49719..e88a2a2416ff 100644
--- a/drivers/clk/qcom/gcc-sc7280.c
+++ b/drivers/clk/qcom/gcc-sc7280.c
@@ -255,26 +255,6 @@ static const struct clk_parent_data gcc_parent_data_5[] = {
{ .hw = &gcc_gpll0_out_even.clkr.hw },
};
-static const struct parent_map gcc_parent_map_6[] = {
- { P_PCIE_0_PIPE_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_6[] = {
- { .fw_name = "pcie_0_pipe_clk", .name = "pcie_0_pipe_clk" },
- { .fw_name = "bi_tcxo" },
-};
-
-static const struct parent_map gcc_parent_map_7[] = {
- { P_PCIE_1_PIPE_CLK, 0 },
- { P_BI_TCXO, 2 },
-};
-
-static const struct clk_parent_data gcc_parent_data_7[] = {
- { .fw_name = "pcie_1_pipe_clk", .name = "pcie_1_pipe_clk" },
- { .fw_name = "bi_tcxo" },
-};
-
static const struct parent_map gcc_parent_map_8[] = {
{ P_BI_TCXO, 0 },
{ P_GCC_GPLL0_OUT_MAIN, 1 },
@@ -369,36 +349,6 @@ static const struct clk_parent_data gcc_parent_data_15[] = {
{ .hw = &gcc_mss_gpll0_main_div_clk_src.clkr.hw },
};
-static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = {
- .reg = 0x6b054,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_6,
- .clkr = {
- .hw.init = &(struct clk_init_data){
- .name = "gcc_pcie_0_pipe_clk_src",
- .parent_data = gcc_parent_data_6,
- .num_parents = ARRAY_SIZE(gcc_parent_data_6),
- .ops = &clk_regmap_mux_closest_ops,
- },
- },
-};
-
-static struct clk_regmap_mux gcc_pcie_1_pipe_clk_src = {
- .reg = 0x8d054,
- .shift = 0,
- .width = 2,
- .parent_map = gcc_parent_map_7,
- .clkr = {
- .hw.init = &(struct clk_init_data){
- .name = "gcc_pcie_1_pipe_clk_src",
- .parent_data = gcc_parent_data_7,
- .num_parents = ARRAY_SIZE(gcc_parent_data_7),
- .ops = &clk_regmap_mux_closest_ops,
- },
- },
-};
-
static struct clk_regmap_mux gcc_ufs_phy_rx_symbol_0_clk_src = {
.reg = 0x77058,
.shift = 0,
@@ -1757,10 +1707,6 @@ static struct clk_branch gcc_pcie_0_pipe_clk = {
.enable_mask = BIT(4),
.hw.init = &(struct clk_init_data){
.name = "gcc_pcie_0_pipe_clk",
- .parent_hws = (const struct clk_hw*[]){
- &gcc_pcie_0_pipe_clk_src.clkr.hw,
- },
- .num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
@@ -1847,10 +1793,6 @@ static struct clk_branch gcc_pcie_1_pipe_clk = {
.enable_mask = BIT(30),
.hw.init = &(struct clk_init_data){
.name = "gcc_pcie_1_pipe_clk",
- .parent_hws = (const struct clk_hw*[]){
- &gcc_pcie_1_pipe_clk_src.clkr.hw,
- },
- .num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
@@ -3113,22 +3055,48 @@ static struct clk_branch gcc_wpss_rscp_clk = {
},
};
-static struct gdsc gcc_pcie_0_gdsc = {
- .gdscr = 0x6b004,
- .pd = {
- .name = "gcc_pcie_0_gdsc",
+static struct pipe_clk_gdsc gcc_pcie_0_gdsc = {
+ .base = {
+ .gdscr = 0x6b004,
+ .pd = {
+ .name = "gcc_pcie_0_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .flags = VOTABLE,
+ },
+ .num_clocks = 1,
+ .clocks = {
+ {
+ /* gcc_pcie_0_pipe_clk_src */
+ .reg = 0x6b054,
+ .shift = 0,
+ .width = 2,
+ .on_value = 0,
+ .off_value = 2,
+ },
},
- .pwrsts = PWRSTS_OFF_ON,
- .flags = VOTABLE,
};
-static struct gdsc gcc_pcie_1_gdsc = {
- .gdscr = 0x8d004,
- .pd = {
- .name = "gcc_pcie_1_gdsc",
+static struct pipe_clk_gdsc gcc_pcie_1_gdsc = {
+ .base = {
+ .gdscr = 0x8d004,
+ .pd = {
+ .name = "gcc_pcie_1_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .flags = VOTABLE,
+ },
+ .num_clocks = 1,
+ .clocks = {
+ {
+ /* gcc_pcie_1_pipe_clk_src */
+ .reg = 0x8d054,
+ .shift = 0,
+ .width = 2,
+ .on_value = 0,
+ .off_value = 2,
+ },
},
- .pwrsts = PWRSTS_OFF_ON,
- .flags = VOTABLE,
};
static struct gdsc gcc_ufs_phy_gdsc = {
@@ -3244,7 +3212,6 @@ static struct clk_regmap *gcc_sc7280_clocks[] = {
[GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr,
[GCC_PCIE_0_PHY_RCHNG_CLK_SRC] = &gcc_pcie_0_phy_rchng_clk_src.clkr,
[GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr,
- [GCC_PCIE_0_PIPE_CLK_SRC] = &gcc_pcie_0_pipe_clk_src.clkr,
[GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr,
[GCC_PCIE_0_SLV_Q2A_AXI_CLK] = &gcc_pcie_0_slv_q2a_axi_clk.clkr,
[GCC_PCIE_1_AUX_CLK] = &gcc_pcie_1_aux_clk.clkr,
@@ -3253,7 +3220,6 @@ static struct clk_regmap *gcc_sc7280_clocks[] = {
[GCC_PCIE_1_MSTR_AXI_CLK] = &gcc_pcie_1_mstr_axi_clk.clkr,
[GCC_PCIE_1_PHY_RCHNG_CLK_SRC] = &gcc_pcie_1_phy_rchng_clk_src.clkr,
[GCC_PCIE_1_PIPE_CLK] = &gcc_pcie_1_pipe_clk.clkr,
- [GCC_PCIE_1_PIPE_CLK_SRC] = &gcc_pcie_1_pipe_clk_src.clkr,
[GCC_PCIE_1_SLV_AXI_CLK] = &gcc_pcie_1_slv_axi_clk.clkr,
[GCC_PCIE_1_SLV_Q2A_AXI_CLK] = &gcc_pcie_1_slv_q2a_axi_clk.clkr,
[GCC_PCIE_THROTTLE_CORE_CLK] = &gcc_pcie_throttle_core_clk.clkr,
@@ -3391,8 +3357,8 @@ static struct clk_regmap *gcc_sc7280_clocks[] = {
};
static struct gdsc *gcc_sc7280_gdscs[] = {
- [GCC_PCIE_0_GDSC] = &gcc_pcie_0_gdsc,
- [GCC_PCIE_1_GDSC] = &gcc_pcie_1_gdsc,
+ [GCC_PCIE_0_GDSC] = &gcc_pcie_0_gdsc.base,
+ [GCC_PCIE_1_GDSC] = &gcc_pcie_1_gdsc.base,
[GCC_UFS_PHY_GDSC] = &gcc_ufs_phy_gdsc,
[GCC_USB30_PRIM_GDSC] = &gcc_usb30_prim_gdsc,
[GCC_USB30_SEC_GDSC] = &gcc_usb30_sec_gdsc,
--
2.34.1
next prev parent reply other threads:[~2022-02-04 14:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 14:46 [PATCH v2 00/11] PCI: qcom: add support for PCIe on SM8450 platform Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 01/11] dt-bindings: pci: qcom,pcie: drop unused "pipe" clocks Dmitry Baryshkov
2022-02-09 22:22 ` Rob Herring
2022-02-04 14:46 ` [PATCH v2 02/11] dt-bindings: pci: qcom: Document PCIe bindings for SM8450 Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 03/11] clk: qcom: gdsc: add support for clocks tied to the GDSC Dmitry Baryshkov
2022-02-04 22:05 ` Bjorn Andersson
2022-02-09 22:41 ` Dmitry Baryshkov
2022-02-11 19:52 ` Dmitry Baryshkov
2022-02-15 10:24 ` Prasad Malisetty (Temp) (QUIC)
2022-02-25 1:55 ` Dmitry Baryshkov
2022-03-01 6:42 ` Prasad Malisetty
2022-03-01 6:47 ` Dmitry Baryshkov
2022-03-01 17:43 ` Bjorn Andersson
2022-02-04 14:46 ` Dmitry Baryshkov [this message]
2022-02-04 14:46 ` [PATCH v2 05/11] clk: qcom: gcc-sm8450: switch PCIe GDSCs to pipe_clk_gdsc Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 06/11] PCI: qcom: Balance pm_runtime_foo() calls Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 07/11] PCI: qcom: Remove unnecessary pipe_clk handling Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 08/11] PCI: qcom: Remove pipe_clk_src reparenting Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 09/11] PCI: qcom: Remove redundancy between qcom_pcie and qcom_pcie_cfg Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 10/11] PCI: qcom: Add ddrss_sf_tbu flag Dmitry Baryshkov
2022-02-04 14:46 ` [PATCH v2 11/11] PCI: qcom: Add SM8450 PCIe support Dmitry Baryshkov
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=20220204144645.3016603-5-dmitry.baryshkov@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=agross@kernel.org \
--cc=bhelgaas@google.com \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mturquette@baylibre.com \
--cc=pmaliset@codeaurora.org \
--cc=robh+dt@kernel.org \
--cc=svarbanov@mm-sol.com \
--cc=swboyd@chromium.org \
--cc=vkoul@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;
as well as URLs for NNTP newsgroup(s).