Skip to contentSkip to conversation

clks: qcom: Introduce clks for SM8750

PATCH In review Melody Olvera 5 participants 23 messages Oct 21, 2024 – Nov 6, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover clks: qcom: Introduce clks for SM8750

Add GCC, RPMH, and TCSR clocks for the SM8750 SoC.

The Qualcomm Technologies, Inc. SM8750 SoC is the latest in the line of consumer mobile device SoCs. See more at:
https://www.qualcomm.com/content/dam/qcomm-martech/dm-assets/images/company/news-media/media-center/press-kits/snapdragon-summit-2024/day-1/documents/Snapdragon8EliteProductBrief.pdf

Taniya Das (7):
dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for SM8750
clk: qcom: rpmh: Add support for SM8750 rpmh clocks
clk: qcom: clk-alpha-pll: Add support for controlling Taycan PLLs
dt-bindings: clock: qcom: Add SM8750 GCC clock controller
clk: qcom: Add support for GCC clock controller on SM8750
dt-bindings: clock: qcom: Document the SM8750 TCSR Clock Controller
clk: qcom: Add TCSR clock driver for SM8750

 .../bindings/clock/qcom,rpmhcc.yaml           |    1 +
 .../bindings/clock/qcom,sm8550-tcsr.yaml      |    2 +
 .../bindings/clock/qcom,sm8750-gcc.yaml       |   65 +
 drivers/clk/qcom/Kconfig                      |   17 +
 drivers/clk/qcom/Makefile                     |    2 +
 drivers/clk/qcom/clk-alpha-pll.c              |   14 +
 drivers/clk/qcom/clk-alpha-pll.h              |    7 +
 drivers/clk/qcom/clk-rpmh.c                   |   26 +
 drivers/clk/qcom/gcc-sm8750.c                 | 3285 +++++++++++++++++
 drivers/clk/qcom/tcsrcc-sm8750.c              |  147 +
 include/dt-bindings/clock/qcom,rpmh.h         |    2 +
 include/dt-bindings/clock/qcom,sm8750-gcc.h   |  226 ++
 include/dt-bindings/clock/qcom,sm8750-tcsr.h  |   15 +
 13 files changed, 3809 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml
 create mode 100644 drivers/clk/qcom/gcc-sm8750.c
 create mode 100644 drivers/clk/qcom/tcsrcc-sm8750.c
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-gcc.h
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-tcsr.h

base-commit: 63b3ff03d91ae8f875fe8747c781a521f78cde17

Signature · 1 line
2.46.1
#1 lore raw

PATCH 1/7 dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for SM8750

From: Taniya Das <[email protected]>

Add bindings and update documentation for clock rpmh driver on SM8750 SoCs.

---
 Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml | 1 +
 include/dt-bindings/clock/qcom,rpmh.h                    | 2 ++
 2 files changed, 3 insertions(+)
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml +1 -0
index ca857942ed6c..b12a233e0e7b 100644
@@ -36,6 +36,7 @@ properties:
       - qcom,sm8450-rpmh-clk
       - qcom,sm8550-rpmh-clk
       - qcom,sm8650-rpmh-clk
+      - qcom,sm8750-rpmh-clk
       - qcom,x1e80100-rpmh-clk
 
   clocks:
include/dt-bindings/clock/qcom,rpmh.h +2 -0
index 0a7d1be0d124..f3e0288420ce 100644
@@ -33,5 +33,7 @@
 #define RPMH_HWKM_CLK				24
 #define RPMH_QLINK_CLK				25
 #define RPMH_QLINK_CLK_A			26
+#define RPMH_CXO_PAD_CLK			27
+#define RPMH_CXO_PAD_CLK_A			28
 
 #endif
Signature · 1 line
2.46.1
#2 lore raw

Re: [PATCH 1/7] dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for SM8750

Quoted 8 lines · Melody Olvera

From: Taniya Das <[email protected]>

Add bindings and update documentation for clock rpmh driver on SM8750 SoCs.

---

A nit, subject: drop second/last, redundant "bindings for". The "dt-bindings" prefix is already stating that these are bindings. See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

This applies to all your patches.

There is already CXO clock, so why pad is needed? All of these clocks come via some pad, right? Commit msg could explain here this. Otherwise it just duplicates the diff.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/7] dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for SM8750

Quoted 10 lines · Krzysztof Kozlowski
Quoted 8 lines · Melody Olvera

From: Taniya Das <[email protected]>

Add bindings and update documentation for clock rpmh driver on SM8750 SoCs.

---

Quoted 7 lines

A nit, subject: drop second/last, redundant "bindings for". The "dt-bindings" prefix is already stating that these are bindings. See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

This applies to all your patches.

I will remove the extra "bindings" in the next patch and also cleanup where ever required.

Quoted 4 lines

There is already CXO clock, so why pad is needed? All of these clocks come via some pad, right? Commit msg could explain here this. Otherwise it just duplicates the diff.

Yes, I will fix the CXO clock and remove the newly added pad clock in the next patch.

Quoted 3 lines

Best regards,
Krzysztof

Signature · 2 lines
Thanks & Regards,
Taniya Das.
#4 lore raw

PATCH 2/7 clk: qcom: rpmh: Add support for SM8750 rpmh clocks

In reply to Melody Olvera

From: Taniya Das <[email protected]>

Add the RPMH clocks present in SM8750 SoC.

---
 drivers/clk/qcom/clk-rpmh.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
drivers/clk/qcom/clk-rpmh.c +26 -0
index 4acde937114a..245bdfe4827d 100644
@@ -344,6 +344,7 @@ static const struct clk_ops clk_rpmh_bcm_ops = {
 DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 1);
 DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 2);
 DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 4);
+DEFINE_CLK_RPMH_ARC(xo_pad,  "xo.lvl", 0x3, 2);
 DEFINE_CLK_RPMH_ARC(qlink, "qphy.lvl", 0x1, 4);
 
 DEFINE_CLK_RPMH_VRM(ln_bb_clk1, _a2, "lnbclka1", 2);
@@ -368,6 +369,10 @@ DEFINE_CLK_RPMH_VRM(rf_clk2, _d, "rfclkd2", 1);
 DEFINE_CLK_RPMH_VRM(rf_clk3, _d, "rfclkd3", 1);
 DEFINE_CLK_RPMH_VRM(rf_clk4, _d, "rfclkd4", 1);
 
+DEFINE_CLK_RPMH_VRM(rf_clk3, _a2, "rfclka3", 2);
+DEFINE_CLK_RPMH_VRM(rf_clk4, _a2, "rfclka4", 2);
+DEFINE_CLK_RPMH_VRM(rf_clk5, _a2, "rfclka5", 2);
+
 DEFINE_CLK_RPMH_VRM(clk1, _a1, "clka1", 1);
 DEFINE_CLK_RPMH_VRM(clk2, _a1, "clka2", 1);
 DEFINE_CLK_RPMH_VRM(clk3, _a1, "clka3", 1);
@@ -795,6 +800,26 @@ static const struct clk_rpmh_desc clk_rpmh_x1e80100 = {
 	.num_clks = ARRAY_SIZE(x1e80100_rpmh_clocks),
 };
 
+static struct clk_hw *sm8750_rpmh_clocks[] = {
+	[RPMH_CXO_PAD_CLK]      = &clk_rpmh_xo_pad_div2.hw,
+	[RPMH_CXO_PAD_CLK_A]    = &clk_rpmh_xo_pad_div2_ao.hw,
+	[RPMH_LN_BB_CLK1]	= &clk_rpmh_clk6_a2.hw,
+	[RPMH_LN_BB_CLK1_A]	= &clk_rpmh_clk6_a2_ao.hw,
+	[RPMH_LN_BB_CLK3]	= &clk_rpmh_clk8_a2.hw,
+	[RPMH_LN_BB_CLK3_A]	= &clk_rpmh_clk8_a2_ao.hw,
+	[RPMH_RF_CLK1]		= &clk_rpmh_rf_clk1_a.hw,
+	[RPMH_RF_CLK1_A]	= &clk_rpmh_rf_clk1_a_ao.hw,
+	[RPMH_RF_CLK2]		= &clk_rpmh_rf_clk2_a.hw,
+	[RPMH_RF_CLK2_A]	= &clk_rpmh_rf_clk2_a_ao.hw,
+	[RPMH_RF_CLK3]		= &clk_rpmh_rf_clk3_a2.hw,
+	[RPMH_RF_CLK3_A]	= &clk_rpmh_rf_clk3_a2_ao.hw,
+	[RPMH_IPA_CLK]		= &clk_rpmh_ipa.hw,
+};
+
+static const struct clk_rpmh_desc clk_rpmh_sm8750 = {
+	.clks = sm8750_rpmh_clocks,
+	.num_clks = ARRAY_SIZE(sm8750_rpmh_clocks),
+};
 static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
 					 void *data)
 {
@@ -896,6 +921,7 @@ static const struct of_device_id clk_rpmh_match_table[] = {
 	{ .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450},
 	{ .compatible = "qcom,sm8550-rpmh-clk", .data = &clk_rpmh_sm8550},
 	{ .compatible = "qcom,sm8650-rpmh-clk", .data = &clk_rpmh_sm8650},
+	{ .compatible = "qcom,sm8750-rpmh-clk", .data = &clk_rpmh_sm8750},
 	{ .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
 	{ .compatible = "qcom,x1e80100-rpmh-clk", .data = &clk_rpmh_x1e80100},
 	{ }
Signature · 1 line
2.46.1
Reviewed-by on v1 2/7
#5 lore raw

Re: [PATCH 2/7] clk: qcom: rpmh: Add support for SM8750 rpmh clocks

drivers/clk/qcom/clk-rpmh.c static const struct of_device_id clk_rpmh_match_table[] = { · line 925

Quoted 2 lines · Melody Olvera
drivers/clk/qcom/clk-rpmh.c +1 -0
+	{ .compatible = "qcom,sm8750-rpmh-clk", .data = &clk_rpmh_sm8750},
  	{ .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},

Might be a nice opportunity to alphabetise this list if you do a V2.

#6 lore raw

Re: [PATCH 2/7] clk: qcom: rpmh: Add support for SM8750 rpmh clocks

Quoted 6 lines · Bryan O'Donoghue
Quoted 2 lines · Melody Olvera

+    { .compatible = "qcom,sm8750-rpmh-clk", .data = &clk_rpmh_sm8750}, { .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},

Might be a nice opportunity to alphabetise this list if you do a V2.

Will fix in the next patch.

Quoted 1 line
Signature · 2 lines
Thanks & Regards,
Taniya Das.
maintainer
#7 lore raw

Re: [PATCH 2/7] clk: qcom: rpmh: Add support for SM8750 rpmh clocks

In reply to Melody Olvera
Quoted 15 lines · Melody Olvera

From: Taniya Das <[email protected]>

Add the RPMH clocks present in SM8750 SoC.

---
 drivers/clk/qcom/clk-rpmh.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
drivers/clk/qcom/clk-rpmh.c +0 -0
index 4acde937114a..245bdfe4827d 100644

drivers/clk/qcom/clk-rpmh.c static const struct clk_ops clk_rpmh_bcm_ops = { · line 347

Quoted 4 lines
drivers/clk/qcom/clk-rpmh.c +1 -0
@@ -344,6 +344,7 @@ static const struct clk_ops clk_rpmh_bcm_ops = {
 DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 1);
 DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 2);
 DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 4);
+DEFINE_CLK_RPMH_ARC(xo_pad,  "xo.lvl", 0x3, 2);

Please make a note in the commit message documenting why we need two different xo.lvl resources defined.

If we indeed should have two copies, this list is sorted alphabetically on the clock name - rather than on the resource. Please keep that (i.e. move this down one line).

Quoted 28 lines
drivers/clk/qcom/clk-rpmh.c +14 -0
 DEFINE_CLK_RPMH_ARC(qlink, "qphy.lvl", 0x1, 4);
 
 DEFINE_CLK_RPMH_VRM(ln_bb_clk1, _a2, "lnbclka1", 2);
@@ -368,6 +369,10 @@ DEFINE_CLK_RPMH_VRM(rf_clk2, _d, "rfclkd2", 1);
 DEFINE_CLK_RPMH_VRM(rf_clk3, _d, "rfclkd3", 1);
 DEFINE_CLK_RPMH_VRM(rf_clk4, _d, "rfclkd4", 1);
 
+DEFINE_CLK_RPMH_VRM(rf_clk3, _a2, "rfclka3", 2);
+DEFINE_CLK_RPMH_VRM(rf_clk4, _a2, "rfclka4", 2);
+DEFINE_CLK_RPMH_VRM(rf_clk5, _a2, "rfclka5", 2);
+
 DEFINE_CLK_RPMH_VRM(clk1, _a1, "clka1", 1);
 DEFINE_CLK_RPMH_VRM(clk2, _a1, "clka2", 1);
 DEFINE_CLK_RPMH_VRM(clk3, _a1, "clka3", 1);
@@ -795,6 +800,26 @@ static const struct clk_rpmh_desc clk_rpmh_x1e80100 = {
 	.num_clks = ARRAY_SIZE(x1e80100_rpmh_clocks),
 };
 
+static struct clk_hw *sm8750_rpmh_clocks[] = {
+	[RPMH_CXO_PAD_CLK]      = &clk_rpmh_xo_pad_div2.hw,
+	[RPMH_CXO_PAD_CLK_A]    = &clk_rpmh_xo_pad_div2_ao.hw,
+	[RPMH_LN_BB_CLK1]	= &clk_rpmh_clk6_a2.hw,
+	[RPMH_LN_BB_CLK1_A]	= &clk_rpmh_clk6_a2_ao.hw,
+	[RPMH_LN_BB_CLK3]	= &clk_rpmh_clk8_a2.hw,
+	[RPMH_LN_BB_CLK3_A]	= &clk_rpmh_clk8_a2_ao.hw,
+	[RPMH_RF_CLK1]		= &clk_rpmh_rf_clk1_a.hw,
+	[RPMH_RF_CLK1_A]	= &clk_rpmh_rf_clk1_a_ao.hw,
+	[RPMH_RF_CLK2]		= &clk_rpmh_rf_clk2_a.hw,

drivers/clk/qcom/clk-rpmh.c static const struct clk_rpmh_desc clk_rpmh_x1e80100 = { · line 822

Quoted 10 lines
drivers/clk/qcom/clk-rpmh.c +10 -0
+	[RPMH_RF_CLK2_A]	= &clk_rpmh_rf_clk2_a_ao.hw,
+	[RPMH_RF_CLK3]		= &clk_rpmh_rf_clk3_a2.hw,
+	[RPMH_RF_CLK3_A]	= &clk_rpmh_rf_clk3_a2_ao.hw,
+	[RPMH_IPA_CLK]		= &clk_rpmh_ipa.hw,
+};
+
+static const struct clk_rpmh_desc clk_rpmh_sm8750 = {
+	.clks = sm8750_rpmh_clocks,
+	.num_clks = ARRAY_SIZE(sm8750_rpmh_clocks),
+};

Please add an empty line here, when you're resubmitting the series.

Thanks,
Bjorn

Quoted 14 lines
drivers/clk/qcom/clk-rpmh.c +1 -0
 static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
 					 void *data)
 {
@@ -896,6 +921,7 @@ static const struct of_device_id clk_rpmh_match_table[] = {
 	{ .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450},
 	{ .compatible = "qcom,sm8550-rpmh-clk", .data = &clk_rpmh_sm8550},
 	{ .compatible = "qcom,sm8650-rpmh-clk", .data = &clk_rpmh_sm8650},
+	{ .compatible = "qcom,sm8750-rpmh-clk", .data = &clk_rpmh_sm8750},
 	{ .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
 	{ .compatible = "qcom,x1e80100-rpmh-clk", .data = &clk_rpmh_x1e80100},
 	{ }
Signature · 1 line
2.46.1
#8 lore raw

Re: [PATCH 2/7] clk: qcom: rpmh: Add support for SM8750 rpmh clocks

Quoted 24 lines · Bjorn Andersson
Quoted 15 lines · Melody Olvera

From: Taniya Das <[email protected]>

Add the RPMH clocks present in SM8750 SoC.

---
  drivers/clk/qcom/clk-rpmh.c | 26 ++++++++++++++++++++++++++
  1 file changed, 26 insertions(+)
drivers/clk/qcom/clk-rpmh.c +0 -0
index 4acde937114a..245bdfe4827d 100644

drivers/clk/qcom/clk-rpmh.c static const struct clk_ops clk_rpmh_bcm_ops = { · line 347

Quoted 4 lines
drivers/clk/qcom/clk-rpmh.c +1 -0
@@ -344,6 +344,7 @@ static const struct clk_ops clk_rpmh_bcm_ops = {
  DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 1);
  DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 2);
  DEFINE_CLK_RPMH_ARC(bi_tcxo, "xo.lvl", 0x3, 4);
+DEFINE_CLK_RPMH_ARC(xo_pad,  "xo.lvl", 0x3, 2);

Please make a note in the commit message documenting why we need two different xo.lvl resources defined.

Quoted 4 lines

If we indeed should have two copies, this list is sorted alphabetically on the clock name - rather than on the resource. Please keep that (i.e. move this down one line).

I will remove the newly added "xo_pad" and reuse the exisiting nodes to derive 19.2MHZ.

Quoted 32 lines
Quoted 32 lines
drivers/clk/qcom/clk-rpmh.c +18 -0
  DEFINE_CLK_RPMH_ARC(qlink, "qphy.lvl", 0x1, 4);
 
  DEFINE_CLK_RPMH_VRM(ln_bb_clk1, _a2, "lnbclka1", 2);
@@ -368,6 +369,10 @@ DEFINE_CLK_RPMH_VRM(rf_clk2, _d, "rfclkd2", 1);
  DEFINE_CLK_RPMH_VRM(rf_clk3, _d, "rfclkd3", 1);
  DEFINE_CLK_RPMH_VRM(rf_clk4, _d, "rfclkd4", 1);
 
+DEFINE_CLK_RPMH_VRM(rf_clk3, _a2, "rfclka3", 2);
+DEFINE_CLK_RPMH_VRM(rf_clk4, _a2, "rfclka4", 2);
+DEFINE_CLK_RPMH_VRM(rf_clk5, _a2, "rfclka5", 2);
+
  DEFINE_CLK_RPMH_VRM(clk1, _a1, "clka1", 1);
  DEFINE_CLK_RPMH_VRM(clk2, _a1, "clka2", 1);
  DEFINE_CLK_RPMH_VRM(clk3, _a1, "clka3", 1);
@@ -795,6 +800,26 @@ static const struct clk_rpmh_desc clk_rpmh_x1e80100 = {
  	.num_clks = ARRAY_SIZE(x1e80100_rpmh_clocks),
  };
 
+static struct clk_hw *sm8750_rpmh_clocks[] = {
+	[RPMH_CXO_PAD_CLK]      = &clk_rpmh_xo_pad_div2.hw,
+	[RPMH_CXO_PAD_CLK_A]    = &clk_rpmh_xo_pad_div2_ao.hw,
+	[RPMH_LN_BB_CLK1]	= &clk_rpmh_clk6_a2.hw,
+	[RPMH_LN_BB_CLK1_A]	= &clk_rpmh_clk6_a2_ao.hw,
+	[RPMH_LN_BB_CLK3]	= &clk_rpmh_clk8_a2.hw,
+	[RPMH_LN_BB_CLK3_A]	= &clk_rpmh_clk8_a2_ao.hw,
+	[RPMH_RF_CLK1]		= &clk_rpmh_rf_clk1_a.hw,
+	[RPMH_RF_CLK1_A]	= &clk_rpmh_rf_clk1_a_ao.hw,
+	[RPMH_RF_CLK2]		= &clk_rpmh_rf_clk2_a.hw,
+	[RPMH_RF_CLK2_A]	= &clk_rpmh_rf_clk2_a_ao.hw,
+	[RPMH_RF_CLK3]		= &clk_rpmh_rf_clk3_a2.hw,
+	[RPMH_RF_CLK3_A]	= &clk_rpmh_rf_clk3_a2_ao.hw,
+	[RPMH_IPA_CLK]		= &clk_rpmh_ipa.hw,
Quoted 9 lines

drivers/clk/qcom/clk-rpmh.c static const struct clk_rpmh_desc clk_rpmh_x1e80100 = { · line 822

Quoted 6 lines
drivers/clk/qcom/clk-rpmh.c +6 -0
+};
+
+static const struct clk_rpmh_desc clk_rpmh_sm8750 = {
+	.clks = sm8750_rpmh_clocks,
+	.num_clks = ARRAY_SIZE(sm8750_rpmh_clocks),
+};

Please add an empty line here, when you're resubmitting the series.

Will fix this in the next patch.

Quoted 17 lines

Thanks,
Bjorn

Quoted 14 lines
drivers/clk/qcom/clk-rpmh.c +1 -0
  static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
  					 void *data)
  {
@@ -896,6 +921,7 @@ static const struct of_device_id clk_rpmh_match_table[] = {
  	{ .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450},
  	{ .compatible = "qcom,sm8550-rpmh-clk", .data = &clk_rpmh_sm8550},
  	{ .compatible = "qcom,sm8650-rpmh-clk", .data = &clk_rpmh_sm8650},
+	{ .compatible = "qcom,sm8750-rpmh-clk", .data = &clk_rpmh_sm8750},
  	{ .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
  	{ .compatible = "qcom,x1e80100-rpmh-clk", .data = &clk_rpmh_x1e80100},
  	{ }
Signature · 1 line
2.46.1
Signature · 2 lines
Thanks & Regards,
Taniya Das.
#9 lore raw

PATCH 3/7 clk: qcom: clk-alpha-pll: Add support for controlling Taycan PLLs

In reply to Melody Olvera

From: Taniya Das <[email protected]>

Update the clock ops for Taycan PLL, add the register offsets for supporting the PLL.

---
 drivers/clk/qcom/clk-alpha-pll.c | 14 ++++++++++++++
 drivers/clk/qcom/clk-alpha-pll.h |  7 +++++++
 2 files changed, 21 insertions(+)
drivers/clk/qcom/clk-alpha-pll.c +14 -0
index be9bee6ab65f..57a15ac7b052 100644
@@ -267,6 +267,20 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
 		[PLL_OFF_OPMODE] = 0x30,
 		[PLL_OFF_STATUS] = 0x3c,
 	},
+	[CLK_ALPHA_PLL_TYPE_TAYCAN_ELU] = {
+		[PLL_OFF_OPMODE] = 0x04,
+		[PLL_OFF_STATE] = 0x08,
+		[PLL_OFF_STATUS] = 0x0c,
+		[PLL_OFF_L_VAL] = 0x10,
+		[PLL_OFF_ALPHA_VAL] = 0x14,
+		[PLL_OFF_USER_CTL] = 0x18,
+		[PLL_OFF_USER_CTL_U] = 0x1c,
+		[PLL_OFF_CONFIG_CTL] = 0x20,
+		[PLL_OFF_CONFIG_CTL_U] = 0x24,
+		[PLL_OFF_CONFIG_CTL_U1] = 0x28,
+		[PLL_OFF_TEST_CTL] = 0x2c,
+		[PLL_OFF_TEST_CTL_U] = 0x30,
+	},
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
 
drivers/clk/qcom/clk-alpha-pll.h +7 -0
index 55eca04b23a1..5ba06d9ba77e 100644
@@ -27,6 +27,7 @@ enum {
 	CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
 	CLK_ALPHA_PLL_TYPE_LUCID_EVO,
 	CLK_ALPHA_PLL_TYPE_LUCID_OLE,
+	CLK_ALPHA_PLL_TYPE_TAYCAN_ELU,
 	CLK_ALPHA_PLL_TYPE_RIVIAN_EVO,
 	CLK_ALPHA_PLL_TYPE_DEFAULT_EVO,
 	CLK_ALPHA_PLL_TYPE_BRAMMO_EVO,
@@ -184,12 +185,15 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops;
 #define clk_alpha_pll_zonda_ole_ops clk_alpha_pll_zonda_ops
 
 extern const struct clk_ops clk_alpha_pll_lucid_evo_ops;
+#define clk_alpha_pll_taycan_elu_ops clk_alpha_pll_lucid_evo_ops
 extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops;
 #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops
 extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops;
 #define clk_alpha_pll_fixed_lucid_ole_ops clk_alpha_pll_fixed_lucid_evo_ops
+#define clk_alpha_pll_fixed_taycan_elu_ops clk_alpha_pll_fixed_lucid_evo_ops
 extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops;
 #define clk_alpha_pll_postdiv_lucid_ole_ops clk_alpha_pll_postdiv_lucid_evo_ops
+#define clk_alpha_pll_postdiv_taycan_elu_ops clk_alpha_pll_postdiv_lucid_evo_ops
 
 extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
 #define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops
@@ -217,6 +221,9 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma
 				 const struct alpha_pll_config *config);
 void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
 				 const struct alpha_pll_config *config);
+#define clk_taycan_elu_pll_configure(pll, regmap, config) \
+	clk_lucid_evo_pll_configure(pll, regmap, config)
+
 void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
 				  const struct alpha_pll_config *config);
 void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
Signature · 1 line
2.46.1
maintainer
#10 lore raw

Re: [PATCH 3/7] clk: qcom: clk-alpha-pll: Add support for controlling Taycan PLLs

Quoted 4 lines · Melody Olvera

From: Taniya Das <[email protected]>

Update the clock ops for Taycan PLL, add the register offsets for supporting the PLL.

Subject and patch says "Add" so why does it say "Update" here?

Quoted 13 lines
---
 drivers/clk/qcom/clk-alpha-pll.c | 14 ++++++++++++++
 drivers/clk/qcom/clk-alpha-pll.h |  7 +++++++
 2 files changed, 21 insertions(+)
drivers/clk/qcom/clk-alpha-pll.c +0 -0
index be9bee6ab65f..57a15ac7b052 100644

drivers/clk/qcom/clk-alpha-pll.c const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { · line 270

Quoted 4 lines
drivers/clk/qcom/clk-alpha-pll.c +1 -0
@@ -267,6 +267,20 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
 		[PLL_OFF_OPMODE] = 0x30,
 		[PLL_OFF_STATUS] = 0x3c,
 	},
+	[CLK_ALPHA_PLL_TYPE_TAYCAN_ELU] = {

The other entries in this array are following the order of the enum, how come this is different?

Regards,
Bjorn

Quoted 57 lines
drivers/clk/qcom/clk-alpha-pll.c +13 -0
+		[PLL_OFF_OPMODE] = 0x04,
+		[PLL_OFF_STATE] = 0x08,
+		[PLL_OFF_STATUS] = 0x0c,
+		[PLL_OFF_L_VAL] = 0x10,
+		[PLL_OFF_ALPHA_VAL] = 0x14,
+		[PLL_OFF_USER_CTL] = 0x18,
+		[PLL_OFF_USER_CTL_U] = 0x1c,
+		[PLL_OFF_CONFIG_CTL] = 0x20,
+		[PLL_OFF_CONFIG_CTL_U] = 0x24,
+		[PLL_OFF_CONFIG_CTL_U1] = 0x28,
+		[PLL_OFF_TEST_CTL] = 0x2c,
+		[PLL_OFF_TEST_CTL_U] = 0x30,
+	},
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
 
drivers/clk/qcom/clk-alpha-pll.h +7 -0
index 55eca04b23a1..5ba06d9ba77e 100644
@@ -27,6 +27,7 @@ enum {
 	CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
 	CLK_ALPHA_PLL_TYPE_LUCID_EVO,
 	CLK_ALPHA_PLL_TYPE_LUCID_OLE,
+	CLK_ALPHA_PLL_TYPE_TAYCAN_ELU,
 	CLK_ALPHA_PLL_TYPE_RIVIAN_EVO,
 	CLK_ALPHA_PLL_TYPE_DEFAULT_EVO,
 	CLK_ALPHA_PLL_TYPE_BRAMMO_EVO,
@@ -184,12 +185,15 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops;
 #define clk_alpha_pll_zonda_ole_ops clk_alpha_pll_zonda_ops
 
 extern const struct clk_ops clk_alpha_pll_lucid_evo_ops;
+#define clk_alpha_pll_taycan_elu_ops clk_alpha_pll_lucid_evo_ops
 extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops;
 #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops
 extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops;
 #define clk_alpha_pll_fixed_lucid_ole_ops clk_alpha_pll_fixed_lucid_evo_ops
+#define clk_alpha_pll_fixed_taycan_elu_ops clk_alpha_pll_fixed_lucid_evo_ops
 extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops;
 #define clk_alpha_pll_postdiv_lucid_ole_ops clk_alpha_pll_postdiv_lucid_evo_ops
+#define clk_alpha_pll_postdiv_taycan_elu_ops clk_alpha_pll_postdiv_lucid_evo_ops
 
 extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
 #define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops
@@ -217,6 +221,9 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma
 				 const struct alpha_pll_config *config);
 void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
 				 const struct alpha_pll_config *config);
+#define clk_taycan_elu_pll_configure(pll, regmap, config) \
+	clk_lucid_evo_pll_configure(pll, regmap, config)
+
 void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
 				  const struct alpha_pll_config *config);
 void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
Signature · 1 line
2.46.1
#11 lore raw

Re: [PATCH 3/7] clk: qcom: clk-alpha-pll: Add support for controlling Taycan PLLs

Quoted 8 lines · Bjorn Andersson
Quoted 4 lines · Melody Olvera

From: Taniya Das <[email protected]>

Update the clock ops for Taycan PLL, add the register offsets for supporting the PLL.

Subject and patch says "Add" so why does it say "Update" here?

Will fix in the next patch.

Quoted 8 lines
Quoted 8 lines
---
  drivers/clk/qcom/clk-alpha-pll.c | 14 ++++++++++++++
  drivers/clk/qcom/clk-alpha-pll.h |  7 +++++++
  2 files changed, 21 insertions(+)
Quoted 13 lines

drivers/clk/qcom/clk-alpha-pll.c const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { · line 270

Quoted 9 lines
drivers/clk/qcom/clk-alpha-pll.c +1 -0
index be9bee6ab65f..57a15ac7b052 100644
@@ -267,6 +267,20 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
  		[PLL_OFF_OPMODE] = 0x30,
  		[PLL_OFF_STATUS] = 0x3c,
  	},
+	[CLK_ALPHA_PLL_TYPE_TAYCAN_ELU] = {

The other entries in this array are following the order of the enum, how come this is different?

Sure, will align the order.

Quoted 60 lines

Regards,
Bjorn

Quoted 57 lines
drivers/clk/qcom/clk-alpha-pll.c +13 -0
+		[PLL_OFF_OPMODE] = 0x04,
+		[PLL_OFF_STATE] = 0x08,
+		[PLL_OFF_STATUS] = 0x0c,
+		[PLL_OFF_L_VAL] = 0x10,
+		[PLL_OFF_ALPHA_VAL] = 0x14,
+		[PLL_OFF_USER_CTL] = 0x18,
+		[PLL_OFF_USER_CTL_U] = 0x1c,
+		[PLL_OFF_CONFIG_CTL] = 0x20,
+		[PLL_OFF_CONFIG_CTL_U] = 0x24,
+		[PLL_OFF_CONFIG_CTL_U1] = 0x28,
+		[PLL_OFF_TEST_CTL] = 0x2c,
+		[PLL_OFF_TEST_CTL_U] = 0x30,
+	},
  };
  EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
 
drivers/clk/qcom/clk-alpha-pll.h +7 -0
index 55eca04b23a1..5ba06d9ba77e 100644
@@ -27,6 +27,7 @@ enum {
  	CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
  	CLK_ALPHA_PLL_TYPE_LUCID_EVO,
  	CLK_ALPHA_PLL_TYPE_LUCID_OLE,
+	CLK_ALPHA_PLL_TYPE_TAYCAN_ELU,
  	CLK_ALPHA_PLL_TYPE_RIVIAN_EVO,
  	CLK_ALPHA_PLL_TYPE_DEFAULT_EVO,
  	CLK_ALPHA_PLL_TYPE_BRAMMO_EVO,
@@ -184,12 +185,15 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops;
  #define clk_alpha_pll_zonda_ole_ops clk_alpha_pll_zonda_ops
 
  extern const struct clk_ops clk_alpha_pll_lucid_evo_ops;
+#define clk_alpha_pll_taycan_elu_ops clk_alpha_pll_lucid_evo_ops
  extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops;
  #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops
  extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops;
  #define clk_alpha_pll_fixed_lucid_ole_ops clk_alpha_pll_fixed_lucid_evo_ops
+#define clk_alpha_pll_fixed_taycan_elu_ops clk_alpha_pll_fixed_lucid_evo_ops
  extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops;
  #define clk_alpha_pll_postdiv_lucid_ole_ops clk_alpha_pll_postdiv_lucid_evo_ops
+#define clk_alpha_pll_postdiv_taycan_elu_ops clk_alpha_pll_postdiv_lucid_evo_ops
 
  extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
  #define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops
@@ -217,6 +221,9 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma
  				 const struct alpha_pll_config *config);
  void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
  				 const struct alpha_pll_config *config);
+#define clk_taycan_elu_pll_configure(pll, regmap, config) \
+	clk_lucid_evo_pll_configure(pll, regmap, config)
+
  void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
  				  const struct alpha_pll_config *config);
  void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
Signature · 1 line
2.46.1
Signature · 2 lines
Thanks & Regards,
Taniya Das.
#12 lore raw

PATCH 4/7 dt-bindings: clock: qcom: Add SM8750 GCC clock controller

In reply to Melody Olvera

From: Taniya Das <[email protected]>

Add device tree bindings for the video clock controller on Qualcomm SM8750 platform.

---
 .../bindings/clock/qcom,sm8750-gcc.yaml       |  65 +++++
 include/dt-bindings/clock/qcom,sm8750-gcc.h   | 226 ++++++++++++++++++
 2 files changed, 291 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-gcc.h
Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml new file +65 -0
new file mode 100644
index 000000000000..5e46cccd6e6c
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sm8750-gcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Global Clock & Reset Controller on SM8750
+
+maintainers:
+  - Taniya Das <[email protected]>
+
+description: |
+  Qualcomm global clock control module provides the clocks, resets and power
+  domains on SM8750
+
+  See also:: include/dt-bindings/clock/qcom,sm8750-gcc.h
+
+properties:
+  compatible:
+    const: qcom,sm8750-gcc
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: Board Always On XO source
+      - description: Sleep clock source
+      - description: PCIE 0 Pipe clock source
+      - description: PCIE 1 Pipe clock source
+      - description: PCIE 1 Phy Auxiliary clock source
+      - description: UFS Phy Rx symbol 0 clock source
+      - description: UFS Phy Rx symbol 1 clock source
+      - description: UFS Phy Tx symbol 0 clock source
+      - description: USB3 Phy wrapper pipe clock source
+
+required:
+  - compatible
+  - clocks
+
+allOf:
+  - $ref: qcom,gcc.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    clock-controller@100000 {
+      compatible = "qcom,sm8750-gcc";
+      reg = <0x00100000 0x001f4200>;
+      clocks = <&rpmhcc RPMH_CXO_CLK>,
+               <&rpmhcc RPMH_CXO_CLK_A>,
+               <&sleep_clk>,
+               <&pcie0_phy>,
+               <&pcie1_phy>,
+               <&pcie_1_phy_aux_clk>,
+               <&ufs_mem_phy 0>,
+               <&ufs_mem_phy 1>,
+               <&ufs_mem_phy 2>,
+               <&usb_1_qmpphy>;
+      #clock-cells = <1>;
+      #reset-cells = <1>;
+      #power-domain-cells = <1>;
+    };
+
+...
include/dt-bindings/clock/qcom,sm8750-gcc.h new file +226 -0

226 lines not on this page · raw message

Signature · 1 line
2.46.1
#13 lore raw

Re: [PATCH 4/7] dt-bindings: clock: qcom: Add SM8750 GCC clock controller

Quoted 43 lines · Melody Olvera

From: Taniya Das <[email protected]>

Add device tree bindings for the video clock controller on Qualcomm SM8750 platform.

---
 .../bindings/clock/qcom,sm8750-gcc.yaml       |  65 +++++
 include/dt-bindings/clock/qcom,sm8750-gcc.h   | 226 ++++++++++++++++++
 2 files changed, 291 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-gcc.h
Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml new file +23 -0
new file mode 100644
index 000000000000..5e46cccd6e6c
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sm8750-gcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Global Clock & Reset Controller on SM8750
+
+maintainers:
+  - Taniya Das <[email protected]>
+
+description: |
+  Qualcomm global clock control module provides the clocks, resets and power
+  domains on SM8750
+
+  See also:: include/dt-bindings/clock/qcom,sm8750-gcc.h
+
+properties:
+  compatible:
+    const: qcom,sm8750-gcc
+
+  clocks:
+    items:

Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml new file +10 -0
+      - description: Board XO source
+      - description: Board Always On XO source
+      - description: Sleep clock source
+      - description: PCIE 0 Pipe clock source
+      - description: PCIE 1 Pipe clock source
+      - description: PCIE 1 Phy Auxiliary clock source
+      - description: UFS Phy Rx symbol 0 clock source
+      - description: UFS Phy Rx symbol 1 clock source
+      - description: UFS Phy Tx symbol 0 clock source
+      - description: USB3 Phy wrapper pipe clock source

It's the same as sm8650, so it should be there. No need for new file.

Best regards,
Krzysztof

#14 lore raw

Re: [PATCH 4/7] dt-bindings: clock: qcom: Add SM8750 GCC clock controller

Quoted 14 lines · Krzysztof Kozlowski
Quoted 14 lines
Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml new file +14 -0
+  domains on SM8750
+
+  See also:: include/dt-bindings/clock/qcom,sm8750-gcc.h
+
+properties:
+  compatible:
+    const: qcom,sm8750-gcc
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: Board Always On XO source
+      - description: Sleep clock source
+      - description: PCIE 0 Pipe clock source
Quoted 8 lines

Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml line 33

Quoted 6 lines
Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml new file +6 -0
+      - description: PCIE 1 Pipe clock source
+      - description: PCIE 1 Phy Auxiliary clock source
+      - description: UFS Phy Rx symbol 0 clock source
+      - description: UFS Phy Rx symbol 1 clock source
+      - description: UFS Phy Tx symbol 0 clock source
+      - description: USB3 Phy wrapper pipe clock source

It's the same as sm8650, so it should be there. No need for new file.

Sure, will remove this and reuse SM8650 file.

Signature · 2 lines
Thanks & Regards,
Taniya Das.
maintainer
#15 lore raw

Re: [PATCH 4/7] dt-bindings: clock: qcom: Add SM8750 GCC clock controller

In reply to Melody Olvera
Quoted 3 lines · Melody Olvera

From: Taniya Das <[email protected]>

Add device tree bindings for the video clock controller on Qualcomm

"video"...

I'd also suggest s/GCC/global/ in subject, to avoid the double cc

Regards,
Bjorn

Quoted 317 lines

SM8750 platform.

---
 .../bindings/clock/qcom,sm8750-gcc.yaml       |  65 +++++
 include/dt-bindings/clock/qcom,sm8750-gcc.h   | 226 ++++++++++++++++++
 2 files changed, 291 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-gcc.h
Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml new file +65 -0
new file mode 100644
index 000000000000..5e46cccd6e6c
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sm8750-gcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Global Clock & Reset Controller on SM8750
+
+maintainers:
+  - Taniya Das <[email protected]>
+
+description: |
+  Qualcomm global clock control module provides the clocks, resets and power
+  domains on SM8750
+
+  See also:: include/dt-bindings/clock/qcom,sm8750-gcc.h
+
+properties:
+  compatible:
+    const: qcom,sm8750-gcc
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: Board Always On XO source
+      - description: Sleep clock source
+      - description: PCIE 0 Pipe clock source
+      - description: PCIE 1 Pipe clock source
+      - description: PCIE 1 Phy Auxiliary clock source
+      - description: UFS Phy Rx symbol 0 clock source
+      - description: UFS Phy Rx symbol 1 clock source
+      - description: UFS Phy Tx symbol 0 clock source
+      - description: USB3 Phy wrapper pipe clock source
+
+required:
+  - compatible
+  - clocks
+
+allOf:
+  - $ref: qcom,gcc.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    clock-controller@100000 {
+      compatible = "qcom,sm8750-gcc";
+      reg = <0x00100000 0x001f4200>;
+      clocks = <&rpmhcc RPMH_CXO_CLK>,
+               <&rpmhcc RPMH_CXO_CLK_A>,
+               <&sleep_clk>,
+               <&pcie0_phy>,
+               <&pcie1_phy>,
+               <&pcie_1_phy_aux_clk>,
+               <&ufs_mem_phy 0>,
+               <&ufs_mem_phy 1>,
+               <&ufs_mem_phy 2>,
+               <&usb_1_qmpphy>;
+      #clock-cells = <1>;
+      #reset-cells = <1>;
+      #power-domain-cells = <1>;
+    };
+
+...
include/dt-bindings/clock/qcom,sm8750-gcc.h new file +226 -0
new file mode 100644
index 000000000000..e234595d7f42
@@ -0,0 +1,226 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_GCC_SM8750_H
+#define _DT_BINDINGS_CLK_QCOM_GCC_SM8750_H
+
+/* GCC clocks */
+#define GCC_AGGRE_NOC_PCIE_AXI_CLK				0
+#define GCC_AGGRE_UFS_PHY_AXI_CLK				1
+#define GCC_AGGRE_UFS_PHY_AXI_HW_CTL_CLK			2
+#define GCC_AGGRE_USB3_PRIM_AXI_CLK				3
+#define GCC_BOOT_ROM_AHB_CLK					4
+#define GCC_CAM_BIST_MCLK_AHB_CLK				5
+#define GCC_CAMERA_AHB_CLK					6
+#define GCC_CAMERA_HF_AXI_CLK					7
+#define GCC_CAMERA_SF_AXI_CLK					8
+#define GCC_CAMERA_XO_CLK					9
+#define GCC_CFG_NOC_PCIE_ANOC_AHB_CLK				10
+#define GCC_CFG_NOC_USB3_PRIM_AXI_CLK				11
+#define GCC_CNOC_PCIE_SF_AXI_CLK				12
+#define GCC_DDRSS_GPU_AXI_CLK					13
+#define GCC_DDRSS_PCIE_SF_QTB_CLK				14
+#define GCC_DISP_AHB_CLK					15
+#define GCC_DISP_HF_AXI_CLK					16
+#define GCC_EVA_AHB_CLK						17
+#define GCC_EVA_AXI0_CLK					18
+#define GCC_EVA_AXI0C_CLK					19
+#define GCC_EVA_XO_CLK						20
+#define GCC_GP1_CLK						21
+#define GCC_GP1_CLK_SRC						22
+#define GCC_GP2_CLK						23
+#define GCC_GP2_CLK_SRC						24
+#define GCC_GP3_CLK						25
+#define GCC_GP3_CLK_SRC						26
+#define GCC_GPLL0						27
+#define GCC_GPLL0_OUT_EVEN					28
+#define GCC_GPLL1						29
+#define GCC_GPLL4						30
+#define GCC_GPLL7						31
+#define GCC_GPLL9						32
+#define GCC_GPU_CFG_AHB_CLK					33
+#define GCC_GPU_GEMNOC_GFX_CLK					34
+#define GCC_GPU_GPLL0_CLK_SRC					35
+#define GCC_GPU_GPLL0_DIV_CLK_SRC				36
+#define GCC_PCIE_0_AUX_CLK					37
+#define GCC_PCIE_0_AUX_CLK_SRC					38
+#define GCC_PCIE_0_CFG_AHB_CLK					39
+#define GCC_PCIE_0_MSTR_AXI_CLK					40
+#define GCC_PCIE_0_PHY_RCHNG_CLK				41
+#define GCC_PCIE_0_PHY_RCHNG_CLK_SRC				42
+#define GCC_PCIE_0_PIPE_CLK					43
+#define GCC_PCIE_0_PIPE_CLK_SRC					44
+#define GCC_PCIE_0_SLV_AXI_CLK					45
+#define GCC_PCIE_0_SLV_Q2A_AXI_CLK				46
+#define GCC_PCIE_RSCC_CFG_AHB_CLK				47
+#define GCC_PCIE_RSCC_XO_CLK					48
+#define GCC_PDM2_CLK						49
+#define GCC_PDM2_CLK_SRC					50
+#define GCC_PDM_AHB_CLK						51
+#define GCC_PDM_XO4_CLK						52
+#define GCC_QMIP_CAMERA_CMD_AHB_CLK				53
+#define GCC_QMIP_CAMERA_NRT_AHB_CLK				54
+#define GCC_QMIP_CAMERA_RT_AHB_CLK				55
+#define GCC_QMIP_GPU_AHB_CLK					56
+#define GCC_QMIP_PCIE_AHB_CLK					57
+#define GCC_QMIP_VIDEO_CV_CPU_AHB_CLK				58
+#define GCC_QMIP_VIDEO_CVP_AHB_CLK				59
+#define GCC_QMIP_VIDEO_V_CPU_AHB_CLK				60
+#define GCC_QMIP_VIDEO_VCODEC_AHB_CLK				61
+#define GCC_QUPV3_I2C_CORE_CLK					62
+#define GCC_QUPV3_I2C_S0_CLK					63
+#define GCC_QUPV3_I2C_S0_CLK_SRC				64
+#define GCC_QUPV3_I2C_S1_CLK					65
+#define GCC_QUPV3_I2C_S1_CLK_SRC				66
+#define GCC_QUPV3_I2C_S2_CLK					67
+#define GCC_QUPV3_I2C_S2_CLK_SRC				68
+#define GCC_QUPV3_I2C_S3_CLK					69
+#define GCC_QUPV3_I2C_S3_CLK_SRC				70
+#define GCC_QUPV3_I2C_S4_CLK					71
+#define GCC_QUPV3_I2C_S4_CLK_SRC				72
+#define GCC_QUPV3_I2C_S5_CLK					73
+#define GCC_QUPV3_I2C_S5_CLK_SRC				74
+#define GCC_QUPV3_I2C_S6_CLK					75
+#define GCC_QUPV3_I2C_S6_CLK_SRC				76
+#define GCC_QUPV3_I2C_S7_CLK					77
+#define GCC_QUPV3_I2C_S7_CLK_SRC				78
+#define GCC_QUPV3_I2C_S8_CLK					79
+#define GCC_QUPV3_I2C_S8_CLK_SRC				80
+#define GCC_QUPV3_I2C_S9_CLK					81
+#define GCC_QUPV3_I2C_S9_CLK_SRC				82
+#define GCC_QUPV3_I2C_S_AHB_CLK					83
+#define GCC_QUPV3_WRAP1_CORE_2X_CLK				84
+#define GCC_QUPV3_WRAP1_CORE_CLK				85
+#define GCC_QUPV3_WRAP1_QSPI_REF_CLK				86
+#define GCC_QUPV3_WRAP1_QSPI_REF_CLK_SRC			87
+#define GCC_QUPV3_WRAP1_S0_CLK					88
+#define GCC_QUPV3_WRAP1_S0_CLK_SRC				89
+#define GCC_QUPV3_WRAP1_S1_CLK					90
+#define GCC_QUPV3_WRAP1_S1_CLK_SRC				91
+#define GCC_QUPV3_WRAP1_S2_CLK					92
+#define GCC_QUPV3_WRAP1_S2_CLK_SRC				93
+#define GCC_QUPV3_WRAP1_S3_CLK					94
+#define GCC_QUPV3_WRAP1_S3_CLK_SRC				95
+#define GCC_QUPV3_WRAP1_S4_CLK					96
+#define GCC_QUPV3_WRAP1_S4_CLK_SRC				97
+#define GCC_QUPV3_WRAP1_S5_CLK					98
+#define GCC_QUPV3_WRAP1_S5_CLK_SRC				99
+#define GCC_QUPV3_WRAP1_S6_CLK					100
+#define GCC_QUPV3_WRAP1_S6_CLK_SRC				101
+#define GCC_QUPV3_WRAP1_S7_CLK					102
+#define GCC_QUPV3_WRAP1_S7_CLK_SRC				103
+#define GCC_QUPV3_WRAP2_CORE_2X_CLK				104
+#define GCC_QUPV3_WRAP2_CORE_CLK				105
+#define GCC_QUPV3_WRAP2_IBI_CTRL_0_CLK_SRC			106
+#define GCC_QUPV3_WRAP2_IBI_CTRL_2_CLK				107
+#define GCC_QUPV3_WRAP2_IBI_CTRL_3_CLK				108
+#define GCC_QUPV3_WRAP2_S0_CLK					109
+#define GCC_QUPV3_WRAP2_S0_CLK_SRC				110
+#define GCC_QUPV3_WRAP2_S1_CLK					111
+#define GCC_QUPV3_WRAP2_S1_CLK_SRC				112
+#define GCC_QUPV3_WRAP2_S2_CLK					113
+#define GCC_QUPV3_WRAP2_S2_CLK_SRC				114
+#define GCC_QUPV3_WRAP2_S3_CLK					115
+#define GCC_QUPV3_WRAP2_S3_CLK_SRC				116
+#define GCC_QUPV3_WRAP2_S4_CLK					117
+#define GCC_QUPV3_WRAP2_S4_CLK_SRC				118
+#define GCC_QUPV3_WRAP2_S5_CLK					119
+#define GCC_QUPV3_WRAP2_S5_CLK_SRC				120
+#define GCC_QUPV3_WRAP2_S6_CLK					121
+#define GCC_QUPV3_WRAP2_S6_CLK_SRC				122
+#define GCC_QUPV3_WRAP2_S7_CLK					123
+#define GCC_QUPV3_WRAP2_S7_CLK_SRC				124
+#define GCC_QUPV3_WRAP_1_M_AHB_CLK				125
+#define GCC_QUPV3_WRAP_1_S_AHB_CLK				126
+#define GCC_QUPV3_WRAP_2_IBI_2_AHB_CLK				127
+#define GCC_QUPV3_WRAP_2_IBI_3_AHB_CLK				128
+#define GCC_QUPV3_WRAP_2_M_AHB_CLK				129
+#define GCC_QUPV3_WRAP_2_S_AHB_CLK				130
+#define GCC_SDCC2_AHB_CLK					131
+#define GCC_SDCC2_APPS_CLK					132
+#define GCC_SDCC2_APPS_CLK_SRC					133
+#define GCC_SDCC4_AHB_CLK					134
+#define GCC_SDCC4_APPS_CLK					135
+#define GCC_SDCC4_APPS_CLK_SRC					136
+#define GCC_UFS_PHY_AHB_CLK					137
+#define GCC_UFS_PHY_AXI_CLK					138
+#define GCC_UFS_PHY_AXI_CLK_SRC					139
+#define GCC_UFS_PHY_AXI_HW_CTL_CLK				140
+#define GCC_UFS_PHY_ICE_CORE_CLK				141
+#define GCC_UFS_PHY_ICE_CORE_CLK_SRC				142
+#define GCC_UFS_PHY_ICE_CORE_HW_CTL_CLK				143
+#define GCC_UFS_PHY_PHY_AUX_CLK					144
+#define GCC_UFS_PHY_PHY_AUX_CLK_SRC				145
+#define GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK				146
+#define GCC_UFS_PHY_RX_SYMBOL_0_CLK				147
+#define GCC_UFS_PHY_RX_SYMBOL_0_CLK_SRC				148
+#define GCC_UFS_PHY_RX_SYMBOL_1_CLK				149
+#define GCC_UFS_PHY_RX_SYMBOL_1_CLK_SRC				150
+#define GCC_UFS_PHY_TX_SYMBOL_0_CLK				151
+#define GCC_UFS_PHY_TX_SYMBOL_0_CLK_SRC				152
+#define GCC_UFS_PHY_UNIPRO_CORE_CLK				153
+#define GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC				154
+#define GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK			155
+#define GCC_USB30_PRIM_MASTER_CLK				156
+#define GCC_USB30_PRIM_MASTER_CLK_SRC				157
+#define GCC_USB30_PRIM_MOCK_UTMI_CLK				158
+#define GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC			159
+#define GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC		160
+#define GCC_USB30_PRIM_SLEEP_CLK				161
+#define GCC_USB3_PRIM_PHY_AUX_CLK				162
+#define GCC_USB3_PRIM_PHY_AUX_CLK_SRC				163
+#define GCC_USB3_PRIM_PHY_COM_AUX_CLK				164
+#define GCC_USB3_PRIM_PHY_PIPE_CLK				165
+#define GCC_USB3_PRIM_PHY_PIPE_CLK_SRC				166
+#define GCC_VIDEO_AHB_CLK					167
+#define GCC_VIDEO_AXI0_CLK					168
+#define GCC_VIDEO_AXI1_CLK					169
+#define GCC_VIDEO_XO_CLK					170
+
+/* GCC power domains */
+#define GCC_PCIE_0_GDSC						0
+#define GCC_PCIE_0_PHY_GDSC					1
+#define GCC_UFS_MEM_PHY_GDSC					2
+#define GCC_UFS_PHY_GDSC					3
+#define GCC_USB30_PRIM_GDSC					4
+#define GCC_USB3_PHY_GDSC					5
+
+/* GCC resets */
+#define GCC_CAMERA_BCR						0
+#define GCC_DISPLAY_BCR						1
+#define GCC_EVA_BCR						2
+#define GCC_GPU_BCR						3
+#define GCC_PCIE_0_BCR						4
+#define GCC_PCIE_0_LINK_DOWN_BCR				5
+#define GCC_PCIE_0_NOCSR_COM_PHY_BCR				6
+#define GCC_PCIE_0_PHY_BCR					7
+#define GCC_PCIE_0_PHY_NOCSR_COM_PHY_BCR			8
+#define GCC_PCIE_PHY_BCR					9
+#define GCC_PCIE_PHY_CFG_AHB_BCR				10
+#define GCC_PCIE_PHY_COM_BCR					11
+#define GCC_PCIE_RSCC_BCR					12
+#define GCC_PDM_BCR						13
+#define GCC_QUPV3_WRAPPER_1_BCR					14
+#define GCC_QUPV3_WRAPPER_2_BCR					15
+#define GCC_QUPV3_WRAPPER_I2C_BCR				16
+#define GCC_QUSB2PHY_PRIM_BCR					17
+#define GCC_QUSB2PHY_SEC_BCR					18
+#define GCC_SDCC2_BCR						19
+#define GCC_SDCC4_BCR						20
+#define GCC_UFS_PHY_BCR						21
+#define GCC_USB30_PRIM_BCR					22
+#define GCC_USB3_DP_PHY_PRIM_BCR				23
+#define GCC_USB3_DP_PHY_SEC_BCR					24
+#define GCC_USB3_PHY_PRIM_BCR					25
+#define GCC_USB3_PHY_SEC_BCR					26
+#define GCC_USB3PHY_PHY_PRIM_BCR				27
+#define GCC_USB3PHY_PHY_SEC_BCR					28
+#define GCC_VIDEO_AXI0_CLK_ARES					29
+#define GCC_VIDEO_AXI1_CLK_ARES					30
+#define GCC_VIDEO_BCR						31
+#define GCC_EVA_AXI0_CLK_ARES					32
+#define GCC_EVA_AXI0C_CLK_ARES					33
+
+#endif
Signature · 1 line
2.46.1
#16 lore raw

PATCH 5/7 clk: qcom: Add support for GCC clock controller on SM8750

In reply to Melody Olvera

From: Taniya Das <[email protected]>

Add support for GCC Clock Controller for SM8750 platform.

---
 drivers/clk/qcom/Kconfig      |    9 +
 drivers/clk/qcom/Makefile     |    1 +
 drivers/clk/qcom/gcc-sm8750.c | 3285 +++++++++++++++++++++++++++++++++
 3 files changed, 3295 insertions(+)
 create mode 100644 drivers/clk/qcom/gcc-sm8750.c
drivers/clk/qcom/Kconfig +9 -0
index e5d7c89b0dab..14e3632b7c85 100644
@@ -1073,6 +1073,15 @@ config SM_GCC_8650
 	  Say Y if you want to use peripheral devices such as UART,
 	  SPI, I2C, USB, SD/UFS, PCIe etc.
 
+config SM_GCC_8750
+	tristate "SM8750 Global Clock Controller"
+	depends on ARM64 || COMPILE_TEST
+	select QCOM_GDSC
+	help
+	  Support for the global clock controller on SM8750 devices.
+	  Say Y if you want to use peripheral devices such as UART,
+	  SPI, I2C, USB, SD/UFS, PCIe etc.
+
 config SM_GPUCC_4450
 	tristate "SM4450 Graphics Clock Controller"
 	depends on ARM64 || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
index 2b378667a63f..09ddadad7525 100644
@@ -136,6 +136,7 @@ obj-$(CONFIG_SM_GCC_8350) += gcc-sm8350.o
 obj-$(CONFIG_SM_GCC_8450) += gcc-sm8450.o
 obj-$(CONFIG_SM_GCC_8550) += gcc-sm8550.o
 obj-$(CONFIG_SM_GCC_8650) += gcc-sm8650.o
+obj-$(CONFIG_SM_GCC_8750) += gcc-sm8750.o
 obj-$(CONFIG_SM_GPUCC_4450) += gpucc-sm4450.o
 obj-$(CONFIG_SM_GPUCC_6115) += gpucc-sm6115.o
 obj-$(CONFIG_SM_GPUCC_6125) += gpucc-sm6125.o
drivers/clk/qcom/gcc-sm8750.c new file +3285 -0

2,978 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.46.1

Part of the diff is not shown here. View the raw message.

maintainer
#17 lore raw

Re: [PATCH 5/7] clk: qcom: Add support for GCC clock controller on SM8750

On Mon, Oct 21, 2024 at 04:03:57PM GMT, Melody Olvera wrote:
[..]

Quoted 1 line
drivers/clk/qcom/gcc-sm8750.c +0 -0

[..]

drivers/clk/qcom/gcc-sm8750.c line 323

Quoted 11 lines
drivers/clk/qcom/gcc-sm8750.c +11 -0
+static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = {
+	.reg = 0x6b080,
+	.shift = 0,
+	.width = 2,
+	.parent_map = gcc_parent_map_7,
+	.clkr = {
+		.hw.init = &(const struct clk_init_data) {
+			.name = "gcc_pcie_0_pipe_clk_src",
+			.parent_data = gcc_parent_data_7,
+			.num_parents = ARRAY_SIZE(gcc_parent_data_7),
+			.ops = &clk_regmap_mux_closest_ops,

Please confirm that the PCIe pipe clock sources should not be &clk_regmap_phy_mux_ops, as on other platforms.

Quoted 4 lines
drivers/clk/qcom/gcc-sm8750.c +4 -0
+		},
+	},
+};
+

[..]

Quoted 11 lines
drivers/clk/qcom/gcc-sm8750.c +11 -0
+static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
+	F(400000, P_BI_TCXO, 12, 1, 4),
+	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 = 0x1401c,

drivers/clk/qcom/gcc-sm8750.c line 1042

Quoted 10 lines
drivers/clk/qcom/gcc-sm8750.c +10 -0
+	.mnd_width = 8,
+	.hid_width = 5,
+	.parent_map = gcc_parent_map_8,
+	.freq_tbl = ftbl_gcc_sdcc2_apps_clk_src,
+	.clkr.hw.init = &(const struct clk_init_data) {
+		.name = "gcc_sdcc2_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_shared_ops,

Please confirm that the sdcc apps_clk_src no longer needs to use &clk_rcg2_floor_ops.

Quoted 3 lines
drivers/clk/qcom/gcc-sm8750.c +3 -0
+	},
+};
+

[..]

drivers/clk/qcom/gcc-sm8750.c line 2903

Quoted 11 lines
drivers/clk/qcom/gcc-sm8750.c +11 -0
+static struct gdsc gcc_pcie_0_gdsc = {
+	.gdscr = 0x6b004,
+	.en_rest_wait_val = 0x2,
+	.en_few_wait_val = 0x2,
+	.clk_dis_wait_val = 0xf,
+	.collapse_ctrl = 0x5214c,
+	.collapse_mask = BIT(0),
+	.pd = {
+		.name = "gcc_pcie_0_gdsc",
+	},
+	.pwrsts = PWRSTS_OFF_ON,

Shouldn't the PCIe GDSCs be PWRSTS_RET_ON?

Quoted 3 lines
drivers/clk/qcom/gcc-sm8750.c +3 -0
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE,
+};
+

[..]

Quoted 29 lines
drivers/clk/qcom/gcc-sm8750.c +29 -0
+static int gcc_sm8750_probe(struct platform_device *pdev)
+{
+	struct regmap *regmap;
+	int ret;
+
+	regmap = qcom_cc_map(pdev, &gcc_sm8750_desc);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks,
+				       ARRAY_SIZE(gcc_dfs_clocks));
+	if (ret)
+		return ret;
+
+	/*
+	 * Keep clocks always enabled:
+	 *	gcc_cam_bist_mclk_ahb_clk
+	 *	gcc_camera_ahb_clk
+	 *	gcc_camera_xo_clk
+	 *	gcc_disp_ahb_clk
+	 *	gcc_eva_ahb_clk
+	 *	gcc_eva_xo_clk
+	 *	gcc_gpu_cfg_ahb_clk
+	 *	gcc_pcie_rscc_cfg_ahb_clk
+	 *	gcc_pcie_rscc_xo_clk
+	 *	gcc_video_ahb_clk
+	 *	gcc_video_xo_clk
+	 */
+	regmap_update_bits(regmap, 0xa0004, BIT(0), BIT(0));

drivers/clk/qcom/gcc-sm8750.c line 3255

Quoted 10 lines
drivers/clk/qcom/gcc-sm8750.c +10 -0
+	regmap_update_bits(regmap, 0x26004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x26034, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x27004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x9f004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x9f01c, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x52010, BIT(20), BIT(20));
+	regmap_update_bits(regmap, 0x52010, BIT(21), BIT(21));
+	regmap_update_bits(regmap, 0x32004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x32038, BIT(0), BIT(0));

Any reason why qcom_branch_set_clk_en() can't be used here?

drivers/clk/qcom/gcc-sm8750.c line 3259

Quoted 4 lines
drivers/clk/qcom/gcc-sm8750.c +4 -0
+
+	/* FORCE_MEM_CORE_ON for ufs phy ice core clocks */
+	regmap_update_bits(regmap, gcc_ufs_phy_ice_core_clk.halt_reg,
+			   BIT(14), BIT(14));

qcom_branch_set_force_mem_core() ?

Regards,
Bjorn

Quoted 29 lines
drivers/clk/qcom/gcc-sm8750.c +26 -0
+
+	return qcom_cc_really_probe(&pdev->dev, &gcc_sm8750_desc, regmap);
+}
+
+static struct platform_driver gcc_sm8750_driver = {
+	.probe = gcc_sm8750_probe,
+	.driver = {
+		.name = "gcc-sm8750",
+		.of_match_table = gcc_sm8750_match_table,
+	},
+};
+
+static int __init gcc_sm8750_init(void)
+{
+	return platform_driver_register(&gcc_sm8750_driver);
+}
+subsys_initcall(gcc_sm8750_init);
+
+static void __exit gcc_sm8750_exit(void)
+{
+	platform_driver_unregister(&gcc_sm8750_driver);
+}
+module_exit(gcc_sm8750_exit);
+
+MODULE_DESCRIPTION("QTI GCC SM8750 Driver");
+MODULE_LICENSE("GPL");
Signature · 1 line
2.46.1
#18 lore raw

Re: [PATCH 5/7] clk: qcom: Add support for GCC clock controller on SM8750

Quoted 4 lines · Bjorn Andersson

On Mon, Oct 21, 2024 at 04:03:57PM GMT, Melody Olvera wrote:
[..]

Quoted 1 line
drivers/clk/qcom/gcc-sm8750.c +0 -0

[..]

Quoted 15 lines

drivers/clk/qcom/gcc-sm8750.c line 323

Quoted 11 lines
drivers/clk/qcom/gcc-sm8750.c +11 -0
+static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = {
+	.reg = 0x6b080,
+	.shift = 0,
+	.width = 2,
+	.parent_map = gcc_parent_map_7,
+	.clkr = {
+		.hw.init = &(const struct clk_init_data) {
+			.name = "gcc_pcie_0_pipe_clk_src",
+			.parent_data = gcc_parent_data_7,
+			.num_parents = ARRAY_SIZE(gcc_parent_data_7),
+			.ops = &clk_regmap_mux_closest_ops,

Please confirm that the PCIe pipe clock sources should not be &clk_regmap_phy_mux_ops, as on other platforms.

Yes Bjorn this will be fixed in the next series.

Quoted 21 lines
Quoted 4 lines
drivers/clk/qcom/gcc-sm8750.c +4 -0
+		},
+	},
+};
+

[..]

Quoted 16 lines
drivers/clk/qcom/gcc-sm8750.c +16 -0
+static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
+	F(400000, P_BI_TCXO, 12, 1, 4),
+	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 = 0x1401c,
+	.mnd_width = 8,
+	.hid_width = 5,
+	.parent_map = gcc_parent_map_8,
+	.freq_tbl = ftbl_gcc_sdcc2_apps_clk_src,
+	.clkr.hw.init = &(const struct clk_init_data) {
Quoted 9 lines

drivers/clk/qcom/gcc-sm8750.c line 1042

Quoted 5 lines
drivers/clk/qcom/gcc-sm8750.c +5 -0
+		.name = "gcc_sdcc2_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_shared_ops,

Please confirm that the sdcc apps_clk_src no longer needs to use &clk_rcg2_floor_ops.

This too would be fixed in the next series.

Quoted 4 lines
Quoted 3 lines
drivers/clk/qcom/gcc-sm8750.c +3 -0
+	},
+};
+

[..]

Quoted 14 lines

drivers/clk/qcom/gcc-sm8750.c line 2903

Quoted 11 lines
drivers/clk/qcom/gcc-sm8750.c +11 -0
+static struct gdsc gcc_pcie_0_gdsc = {
+	.gdscr = 0x6b004,
+	.en_rest_wait_val = 0x2,
+	.en_few_wait_val = 0x2,
+	.clk_dis_wait_val = 0xf,
+	.collapse_ctrl = 0x5214c,
+	.collapse_mask = BIT(0),
+	.pd = {
+		.name = "gcc_pcie_0_gdsc",
+	},
+	.pwrsts = PWRSTS_OFF_ON,

Shouldn't the PCIe GDSCs be PWRSTS_RET_ON?

Not required.

Quoted 40 lines
Quoted 3 lines
drivers/clk/qcom/gcc-sm8750.c +3 -0
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE,
+};
+

[..]

Quoted 35 lines
drivers/clk/qcom/gcc-sm8750.c +35 -0
+static int gcc_sm8750_probe(struct platform_device *pdev)
+{
+	struct regmap *regmap;
+	int ret;
+
+	regmap = qcom_cc_map(pdev, &gcc_sm8750_desc);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks,
+				       ARRAY_SIZE(gcc_dfs_clocks));
+	if (ret)
+		return ret;
+
+	/*
+	 * Keep clocks always enabled:
+	 *	gcc_cam_bist_mclk_ahb_clk
+	 *	gcc_camera_ahb_clk
+	 *	gcc_camera_xo_clk
+	 *	gcc_disp_ahb_clk
+	 *	gcc_eva_ahb_clk
+	 *	gcc_eva_xo_clk
+	 *	gcc_gpu_cfg_ahb_clk
+	 *	gcc_pcie_rscc_cfg_ahb_clk
+	 *	gcc_pcie_rscc_xo_clk
+	 *	gcc_video_ahb_clk
+	 *	gcc_video_xo_clk
+	 */
+	regmap_update_bits(regmap, 0xa0004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x26004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x26034, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x27004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x9f004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x9f01c, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0));
Quoted 2 lines

drivers/clk/qcom/gcc-sm8750.c line 3253

Quoted 2 lines
drivers/clk/qcom/gcc-sm8750.c +2 -0
+	regmap_update_bits(regmap, 0x52010, BIT(20), BIT(20));
+	regmap_update_bits(regmap, 0x52010, BIT(21), BIT(21));

These will still require to use the regmap_update_bits().

Quoted 5 lines

drivers/clk/qcom/gcc-sm8750.c line 3255

Quoted 2 lines
drivers/clk/qcom/gcc-sm8750.c +2 -0
+	regmap_update_bits(regmap, 0x32004, BIT(0), BIT(0));
+	regmap_update_bits(regmap, 0x32038, BIT(0), BIT(0));

Any reason why qcom_branch_set_clk_en() can't be used here?

Yes, I agree it is a miss.

Quoted 7 lines

drivers/clk/qcom/gcc-sm8750.c line 3259

Quoted 4 lines
drivers/clk/qcom/gcc-sm8750.c +4 -0
+
+	/* FORCE_MEM_CORE_ON for ufs phy ice core clocks */
+	regmap_update_bits(regmap, gcc_ufs_phy_ice_core_clk.halt_reg,
+			   BIT(14), BIT(14));

qcom_branch_set_force_mem_core() ?

It will be fixed.

Quoted 32 lines

Regards,
Bjorn

Quoted 29 lines
drivers/clk/qcom/gcc-sm8750.c +26 -0
+
+	return qcom_cc_really_probe(&pdev->dev, &gcc_sm8750_desc, regmap);
+}
+
+static struct platform_driver gcc_sm8750_driver = {
+	.probe = gcc_sm8750_probe,
+	.driver = {
+		.name = "gcc-sm8750",
+		.of_match_table = gcc_sm8750_match_table,
+	},
+};
+
+static int __init gcc_sm8750_init(void)
+{
+	return platform_driver_register(&gcc_sm8750_driver);
+}
+subsys_initcall(gcc_sm8750_init);
+
+static void __exit gcc_sm8750_exit(void)
+{
+	platform_driver_unregister(&gcc_sm8750_driver);
+}
+module_exit(gcc_sm8750_exit);
+
+MODULE_DESCRIPTION("QTI GCC SM8750 Driver");
+MODULE_LICENSE("GPL");
Signature · 1 line
2.46.1
Signature · 2 lines
Thanks & Regards,
Taniya Das.
#19 lore raw

PATCH 6/7 dt-bindings: clock: qcom: Document the SM8750 TCSR Clock Controller

In reply to Melody Olvera

From: Taniya Das <[email protected]>

Add bindings documentation for the SM8750 Clock Controller.

---
 .../bindings/clock/qcom,sm8550-tcsr.yaml          |  2 ++
 include/dt-bindings/clock/qcom,sm8750-tcsr.h      | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-tcsr.h
Documentation/devicetree/bindings/clock/qcom,sm8550-tcsr.yaml +2 -0
index 48fdd562d743..e7d521355699 100644
@@ -16,6 +16,7 @@ description: |
   See also:
   - include/dt-bindings/clock/qcom,sm8550-tcsr.h
   - include/dt-bindings/clock/qcom,sm8650-tcsr.h
+  - include/dt-bindings/clock/qcom,sm8750-tcsr.h
 
 properties:
   compatible:
@@ -23,6 +24,7 @@ properties:
       - enum:
           - qcom,sm8550-tcsr
           - qcom,sm8650-tcsr
+          - qcom,sm8750-tcsr
           - qcom,x1e80100-tcsr
       - const: syscon
 
include/dt-bindings/clock/qcom,sm8750-tcsr.h new file +15 -0
new file mode 100644
index 000000000000..1c502ac7c7f4
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_TCSR_CC_SM8750_H
+#define _DT_BINDINGS_CLK_QCOM_TCSR_CC_SM8750_H
+
+/* TCSR_CC clocks */
+#define TCSR_PCIE_0_CLKREF_EN				0
+#define TCSR_UFS_CLKREF_EN				1
+#define TCSR_USB2_CLKREF_EN				2
+#define TCSR_USB3_CLKREF_EN				3
+
+#endif
Signature · 1 line
2.46.1
Acked-by on v1 6/7
#20 lore raw

Re: [PATCH 6/7] dt-bindings: clock: qcom: Document the SM8750 TCSR Clock Controller

Quoted 11 lines · Melody Olvera

From: Taniya Das <[email protected]>

Add bindings documentation for the SM8750 Clock Controller.

---
 .../bindings/clock/qcom,sm8550-tcsr.yaml          |  2 ++
 include/dt-bindings/clock/qcom,sm8750-tcsr.h      | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-tcsr.h

Best regards,
Krzysztof

#21 lore raw

PATCH 7/7 clk: qcom: Add TCSR clock driver for SM8750

In reply to Melody Olvera

From: Taniya Das <[email protected]>

The TCSR clock controller found on SM8750 provides refclks for PCIE, USB and UFS. Add clock driver for it.

---
 drivers/clk/qcom/Kconfig         |   8 ++
 drivers/clk/qcom/Makefile        |   1 +
 drivers/clk/qcom/tcsrcc-sm8750.c | 147 +++++++++++++++++++++++++++++++
 3 files changed, 156 insertions(+)
 create mode 100644 drivers/clk/qcom/tcsrcc-sm8750.c
drivers/clk/qcom/Kconfig +8 -0
index 14e3632b7c85..cc314c67a280 100644
@@ -1198,6 +1198,14 @@ config SM_TCSRCC_8650
 	  Support for the TCSR clock controller on SM8650 devices.
 	  Say Y if you want to use peripheral devices such as SD/UFS.
 
+config SM_TCSRCC_8750
+	tristate "SM8750 TCSR Clock Controller"
+	depends on ARM64 || COMPILE_TEST
+	select QCOM_GDSC
+	help
+	  Support for the TCSR clock controller on SM8750 devices.
+	  Say Y if you want to use peripheral devices such as UFS/USB/PCIe.
+
 config SM_VIDEOCC_7150
 	tristate "SM7150 Video Clock Controller"
 	depends on ARM64 || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
index 09ddadad7525..9fe007bc9132 100644
@@ -150,6 +150,7 @@ obj-$(CONFIG_SM_GPUCC_8550) += gpucc-sm8550.o
 obj-$(CONFIG_SM_GPUCC_8650) += gpucc-sm8650.o
 obj-$(CONFIG_SM_TCSRCC_8550) += tcsrcc-sm8550.o
 obj-$(CONFIG_SM_TCSRCC_8650) += tcsrcc-sm8650.o
+obj-$(CONFIG_SM_TCSRCC_8750) += tcsrcc-sm8750.o
 obj-$(CONFIG_SM_VIDEOCC_7150) += videocc-sm7150.o
 obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o
 obj-$(CONFIG_SM_VIDEOCC_8250) += videocc-sm8250.o
drivers/clk/qcom/tcsrcc-sm8750.c new file +147 -0

147 lines not on this page · raw message

Signature · 1 line
2.46.1
maintainer
#22 lore raw
In reply to Melody Olvera
Quoted 6 lines · Melody Olvera

Add GCC, RPMH, and TCSR clocks for the SM8750 SoC.

The Qualcomm Technologies, Inc. SM8750 SoC is the latest in the line of consumer mobile device SoCs. See more at:
https://www.qualcomm.com/content/dam/qcomm-martech/dm-assets/images/company/news-media/media-center/press-kits/snapdragon-summit-2024/day-1/documents/Snapdragon8EliteProductBrief.pdf

Please adopt b4, as described in go/upstream, to help avoid the mistake with linux-arm-msm not being Cc'ed in the future.

Regards,
Bjorn

Quoted 34 lines

Taniya Das (7):
dt-bindings: clock: qcom-rpmhcc: Add RPMHCC bindings for SM8750
clk: qcom: rpmh: Add support for SM8750 rpmh clocks
clk: qcom: clk-alpha-pll: Add support for controlling Taycan PLLs
dt-bindings: clock: qcom: Add SM8750 GCC clock controller
clk: qcom: Add support for GCC clock controller on SM8750
dt-bindings: clock: qcom: Document the SM8750 TCSR Clock Controller
clk: qcom: Add TCSR clock driver for SM8750

 .../bindings/clock/qcom,rpmhcc.yaml           |    1 +
 .../bindings/clock/qcom,sm8550-tcsr.yaml      |    2 +
 .../bindings/clock/qcom,sm8750-gcc.yaml       |   65 +
 drivers/clk/qcom/Kconfig                      |   17 +
 drivers/clk/qcom/Makefile                     |    2 +
 drivers/clk/qcom/clk-alpha-pll.c              |   14 +
 drivers/clk/qcom/clk-alpha-pll.h              |    7 +
 drivers/clk/qcom/clk-rpmh.c                   |   26 +
 drivers/clk/qcom/gcc-sm8750.c                 | 3285 +++++++++++++++++
 drivers/clk/qcom/tcsrcc-sm8750.c              |  147 +
 include/dt-bindings/clock/qcom,rpmh.h         |    2 +
 include/dt-bindings/clock/qcom,sm8750-gcc.h   |  226 ++
 include/dt-bindings/clock/qcom,sm8750-tcsr.h  |   15 +
 13 files changed, 3809 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8750-gcc.yaml
 create mode 100644 drivers/clk/qcom/gcc-sm8750.c
 create mode 100644 drivers/clk/qcom/tcsrcc-sm8750.c
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-gcc.h
 create mode 100644 include/dt-bindings/clock/qcom,sm8750-tcsr.h

base-commit: 63b3ff03d91ae8f875fe8747c781a521f78cde17

Signature · 1 line
2.46.1