mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
	Abel Vesa <abelvesa@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Taniya Das <taniya.das@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Tyler Baker <tyler.baker@oss.qualcomm.com>
Subject: [PATCH 4/6] clk: qcom: add the TCSR Clock Controller for Seca
Date: Fri, 27 Nov 2026 12:41:33 +0100	[thread overview]
Message-ID: <20261127-seca-clocks-v1-4-1781298e658b@oss.qualcomm.com> (raw)
In-Reply-To: <20261127-seca-clocks-v1-0-1781298e658b@oss.qualcomm.com>

Add the driver for the Top Control and Status Register Clock Controller
on the Qualcomm Seca SoC.

Co-developed-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/clk/qcom/Kconfig       |  10 +++
 drivers/clk/qcom/Makefile      |   1 +
 drivers/clk/qcom/tcsrcc-seca.c | 147 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 158 insertions(+)

diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index 0680926b0ae0903d46fed642dd60e6187642e56b..13a6deb0db4f0524e0c2077a66a024ec35167ec2 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -339,6 +339,16 @@ config CLK_SECA_GCC
 	  USB, SD/UFS, PCIe etc. The clock controller is a combination of
 	  NE_GCC and NW_GCC.
 
+config CLK_SECA_TCSRCC
+	tristate "Seca TCSR Clock Controller"
+	depends on ARM64 || COMPILE_TEST
+	default m if ARCH_QCOM
+	help
+	  Support for the TCSR clock controller on Seca devices. It gates
+	  the QREF reference clocks of the PCIe, UX SGMII, UFS, DP, USB3 and
+	  eUSB2 PHYs and votes the QREF supplies of each path.
+	  Say Y or M if you want to use any of these PHYs.
+
 config CLK_SHIKRA_GCC
 	tristate "Shikra Global Clock Controller"
 	depends on ARM64 || COMPILE_TEST
diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
index 270c1b97b41f3db7f1d2fa98a262a8c8e189becc..34746aa9e0193993748378163f6fc2dc00ac18f5 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -57,6 +57,7 @@ obj-$(CONFIG_CLK_NORD_GPUCC) += gpucc-nord.o gpu2cc-nord.o
 obj-$(CONFIG_CLK_NORD_TCSRCC) += tcsrcc-nord.o
 obj-$(CONFIG_CLK_NORD_VIDEOCC) += videocc-glymur.o
 obj-$(CONFIG_CLK_SECA_GCC) += negcc-seca.o nwgcc-seca.o
+obj-$(CONFIG_CLK_SECA_TCSRCC) += tcsrcc-seca.o
 obj-$(CONFIG_CLK_SHIKRA_AUDIOCORECC) += audiocorecc-shikra.o
 obj-$(CONFIG_CLK_SHIKRA_GCC) += gcc-shikra.o
 obj-$(CONFIG_CLK_X1E80100_CAMCC) += camcc-x1e80100.o
diff --git a/drivers/clk/qcom/tcsrcc-seca.c b/drivers/clk/qcom/tcsrcc-seca.c
new file mode 100644
index 0000000000000000000000000000000000000000..f24d9d2aad69df7fc89e43fb35426ebd3493bc1b
--- /dev/null
+++ b/drivers/clk/qcom/tcsrcc-seca.c
@@ -0,0 +1,147 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/clk/qcom.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+
+#include <dt-bindings/clock/qcom,seca-tcsrcc.h>
+
+static const char * const seca_tcsr_qref0_regulators[] = {
+	"vdda-qref0-0p9",
+	"vdda-qref-1p2",
+};
+
+static const char * const seca_tcsr_qref1_regulators[] = {
+	"vdda-qref1-0p9",
+	"vdda-qref-1p2",
+};
+
+static const char * const seca_tcsr_qref2_regulators[] = {
+	"vdda-qref2-0p9",
+	"vdda-qref-1p2",
+};
+
+static const struct regmap_config tcsr_cc_seca_regmap_config = {
+	.reg_bits = 32,
+	.reg_stride = 4,
+	.val_bits = 32,
+	.max_register = 0xf008,
+	.fast_io = true,
+};
+
+static const struct qcom_clk_ref_desc * const tcsr_cc_seca_clk_descs[] = {
+	[TCSR_DP_RX_0_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_dp_rx_0_clkref_en",
+		.offset = 0x5008,
+		.regulator_names = seca_tcsr_qref2_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref2_regulators),
+	},
+	[TCSR_DP_TX_0_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_dp_tx_0_clkref_en",
+		.offset = 0x6008,
+		.regulator_names = seca_tcsr_qref2_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref2_regulators),
+	},
+	[TCSR_DP_TX_1_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_dp_tx_1_clkref_en",
+		.offset = 0x7008,
+		.regulator_names = seca_tcsr_qref2_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref2_regulators),
+	},
+	[TCSR_DP_TX_2_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_dp_tx_2_clkref_en",
+		.offset = 0x8008,
+		.regulator_names = seca_tcsr_qref2_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref2_regulators),
+	},
+	[TCSR_PCIE_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_pcie_clkref_en",
+		.offset = 0x8,
+		.regulator_names = seca_tcsr_qref0_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref0_regulators),
+	},
+	[TCSR_UFS_0_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_ufs_0_clkref_en",
+		.offset = 0x3008,
+		.regulator_names = seca_tcsr_qref2_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref2_regulators),
+	},
+	[TCSR_UFS_1_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_ufs_1_clkref_en",
+		.offset = 0x4008,
+		.regulator_names = seca_tcsr_qref2_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref2_regulators),
+	},
+	[TCSR_USB2_0_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_usb2_0_clkref_en",
+		.offset = 0xb008,
+		.regulator_names = seca_tcsr_qref1_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref1_regulators),
+	},
+	[TCSR_USB2_1_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_usb2_1_clkref_en",
+		.offset = 0xc008,
+		.regulator_names = seca_tcsr_qref1_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref1_regulators),
+	},
+	[TCSR_USB2_2_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_usb2_2_clkref_en",
+		.offset = 0xd008,
+		.regulator_names = seca_tcsr_qref1_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref1_regulators),
+	},
+	[TCSR_USB3_0_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_usb3_0_clkref_en",
+		.offset = 0x9008,
+		.regulator_names = seca_tcsr_qref1_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref1_regulators),
+	},
+	[TCSR_USB3_1_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_usb3_1_clkref_en",
+		.offset = 0xa008,
+		.regulator_names = seca_tcsr_qref1_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref1_regulators),
+	},
+	[TCSR_UX_SGMII_0_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_ux_sgmii_0_clkref_en",
+		.offset = 0x1008,
+		.regulator_names = seca_tcsr_qref0_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref0_regulators),
+	},
+	[TCSR_UX_SGMII_1_CLKREF_EN] = &(const struct qcom_clk_ref_desc) {
+		.name = "tcsr_ux_sgmii_1_clkref_en",
+		.offset = 0x2008,
+		.regulator_names = seca_tcsr_qref0_regulators,
+		.num_regulators = ARRAY_SIZE(seca_tcsr_qref0_regulators),
+	},
+};
+
+static const struct of_device_id tcsr_cc_seca_match_table[] = {
+	{ .compatible = "qcom,seca-tcsr" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, tcsr_cc_seca_match_table);
+
+static int tcsr_cc_seca_probe(struct platform_device *pdev)
+{
+	return qcom_clk_ref_probe(pdev, &tcsr_cc_seca_regmap_config,
+				  tcsr_cc_seca_clk_descs,
+				  ARRAY_SIZE(tcsr_cc_seca_clk_descs));
+}
+
+static struct platform_driver tcsr_cc_seca_driver = {
+	.probe = tcsr_cc_seca_probe,
+	.driver = {
+		.name = "tcsrcc-seca",
+		.of_match_table = tcsr_cc_seca_match_table,
+	},
+};
+
+subsys_platform_driver(tcsr_cc_seca_driver);
+
+MODULE_DESCRIPTION("QTI TCSRCC Seca Driver");
+MODULE_LICENSE("GPL");

-- 
2.47.3


  parent reply	other threads:[~2026-11-27 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 11:41 [PATCH 0/6] clk: qcom: add clock drivers for Qualcomm Seca Bartosz Golaszewski
2026-11-27 11:41 ` [PATCH 1/6] dt-bindings: clock: qcom: document the Seca Global Clock Controller Bartosz Golaszewski
2026-11-27 11:41 ` [PATCH 2/6] clk: qcom: add the Global Clock Controller driver for Seca Bartosz Golaszewski
2026-11-27 11:41 ` [PATCH 3/6] dt-bindings: clock: qcom: document the Seca TCSR Clock Controller Bartosz Golaszewski
2026-11-27 11:41 ` Bartosz Golaszewski [this message]
2026-11-27 11:41 ` [PATCH 5/6] dt-bindings: clock: qcom,rpmhcc: document the RPMh clock controller on Seca Bartosz Golaszewski
2026-11-27 11:41 ` [PATCH 6/6] clk: qcom: rpmh: add RPMh clocks for Seca Bartosz Golaszewski
2026-11-27 13:26   ` Konrad Dybcio

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=20261127-seca-clocks-v1-4-1781298e658b@oss.qualcomm.com \
    --to=bartosz.golaszewski@oss.qualcomm.com \
    --cc=abelvesa@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bmasney+clk@redhat.com \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=taniya.das@oss.qualcomm.com \
    --cc=tyler.baker@oss.qualcomm.com \
    /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

all inboxes | Powered by JetHome®