Skip to contentSkip to conversation

Add NSS clock controller support for IPQ9574

PATCH Superseded Devi Priya 3 participants 10 messages Jan 29, 2024 – Apr 8, 2024

Subsystems (8)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Devi Priya

author
#0 lore raw

v3 cover Add NSS clock controller support for IPQ9574

Add bindings, driver and devicetree node for networking sub system clock controller on IPQ9574. Also add support for NSS Huayra type alpha PLL and add support for gpll0_out_aux clock which serves as the parent for some nss clocks.

Some of the nssnoc clocks present in GCC driver is
enabled by default and its RCG is configured by bootloaders, so enable those clocks in driver probe.

The NSS clock controller driver depends on the below patchset which adds support for multiple configurations for same frequency.
https://lore.kernel.org/linux-arm-msm/[email protected]/

Changes in V3:
- Detailed change logs are added to the respective patches.

V2 can be found at:
https://lore.kernel.org/linux-arm-msm/[email protected]/

Devi Priya (7):
clk: qcom: clk-alpha-pll: Add NSS HUAYRA ALPHA PLL support for ipq9574
dt-bindings: clock: gcc-ipq9574: Add definition for GPLL0_OUT_AUX
clk: qcom: gcc-ipq9574: Add gpll0_out_aux clock & enable few nssnoc
clocks
dt-bindings: clock: Add ipq9574 NSSCC clock and reset definitions
clk: qcom: Add NSS clock Controller driver for IPQ9574
arm64: dts: qcom: ipq9574: Add support for nsscc node
arm64: defconfig: Build NSS Clock Controller driver for IPQ9574

 .../bindings/clock/qcom,ipq9574-nsscc.yaml    |   69 +
 arch/arm64/boot/dts/qcom/ipq9574.dtsi         |   39 +
 arch/arm64/configs/defconfig                  |    1 +
 drivers/clk/qcom/Kconfig                      |    7 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/clk-alpha-pll.c              |   10 +
 drivers/clk/qcom/clk-alpha-pll.h              |    1 +
 drivers/clk/qcom/gcc-ipq9574.c                |   83 +-
 drivers/clk/qcom/nsscc-ipq9574.c              | 3068 +++++++++++++++++
 include/dt-bindings/clock/qcom,ipq9574-gcc.h  |    1 +
 .../dt-bindings/clock/qcom,ipq9574-nsscc.h    |  152 +
 .../dt-bindings/reset/qcom,ipq9574-nsscc.h    |  134 +
 12 files changed, 3511 insertions(+), 55 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,ipq9574-nsscc.yaml
 create mode 100644 drivers/clk/qcom/nsscc-ipq9574.c
 create mode 100644 include/dt-bindings/clock/qcom,ipq9574-nsscc.h
 create mode 100644 include/dt-bindings/reset/qcom,ipq9574-nsscc.h

base-commit: 596764183be8ebb13352b281a442a1f1151c9b06

Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v3 1/7 clk: qcom: clk-alpha-pll: Add NSS HUAYRA ALPHA PLL support for ipq9574

Add support for NSS Huayra alpha pll found on ipq9574 SoCs. Programming sequence is the same as that of Huayra type Alpha PLL, so we can re-use the same.

---
Changes in V3:
- Dropped the extra new lines in clk_alpha_pll_regs

 drivers/clk/qcom/clk-alpha-pll.c | 10 ++++++++++
 drivers/clk/qcom/clk-alpha-pll.h |  1 +
 2 files changed, 11 insertions(+)
drivers/clk/qcom/clk-alpha-pll.c +10 -0
index 05898d2a8b22..f5f380624ec2 100644
@@ -228,6 +228,16 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
 		[PLL_OFF_ALPHA_VAL] = 0x24,
 		[PLL_OFF_ALPHA_VAL_U] = 0x28,
 	},
+	[CLK_ALPHA_PLL_TYPE_NSS_HUAYRA] =  {
+		[PLL_OFF_L_VAL] = 0x04,
+		[PLL_OFF_ALPHA_VAL] = 0x08,
+		[PLL_OFF_TEST_CTL] = 0x0c,
+		[PLL_OFF_TEST_CTL_U] = 0x10,
+		[PLL_OFF_USER_CTL] = 0x14,
+		[PLL_OFF_CONFIG_CTL] = 0x18,
+		[PLL_OFF_CONFIG_CTL_U] = 0x1c,
+		[PLL_OFF_STATUS] = 0x20,
+	},
 };
 EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
 
drivers/clk/qcom/clk-alpha-pll.h +1 -0
index a1a75bb12fe8..adade3919ce1 100644
@@ -28,6 +28,7 @@ enum {
 	CLK_ALPHA_PLL_TYPE_BRAMMO_EVO,
 	CLK_ALPHA_PLL_TYPE_STROMER,
 	CLK_ALPHA_PLL_TYPE_STROMER_PLUS,
+	CLK_ALPHA_PLL_TYPE_NSS_HUAYRA,
 	CLK_ALPHA_PLL_TYPE_MAX,
 };
 
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v3 2/7 dt-bindings: clock: gcc-ipq9574: Add definition for GPLL0_OUT_AUX

In reply to Devi Priya

Add the definition for GPLL0_OUT_AUX clock.

---
Changes in V3:
- Picked up the Acked-by tag

 include/dt-bindings/clock/qcom,ipq9574-gcc.h | 1 +
 1 file changed, 1 insertion(+)
include/dt-bindings/clock/qcom,ipq9574-gcc.h +1 -0
index 08fd3a37acaa..f5749bf53898 100644
@@ -216,4 +216,5 @@
 #define GCC_CRYPTO_AHB_CLK				207
 #define GCC_USB0_PIPE_CLK				208
 #define GCC_USB0_SLEEP_CLK				209
+#define GPLL0_OUT_AUX					210
 #endif
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH v3 3/7 clk: qcom: gcc-ipq9574: Add gpll0_out_aux clock & enable few nssnoc clocks

In reply to Devi Priya

gcc_nssnoc_nsscc_clk, gcc_nssnoc_snoc_clk, gcc_nssnoc_snoc_1_clk are enabled by default and the RCGs are properly configured by the bootloader.

Some of the NSS clocks needs these clocks to be enabled. To avoid these clocks being disabled by clock framework, drop these entries from the clock table and enable it in the driver probe itself.

Also, add support for gpll0_out_aux clock which acts as the parent for certain networking subsystem (nss) clocks.

---
Changes in V3:
- Dropped flags for gpll0_out_aux
- Dropped few nss clock entries from the clock table and enabled them in the probe

 drivers/clk/qcom/gcc-ipq9574.c | 83 ++++++++++++----------------------
 1 file changed, 28 insertions(+), 55 deletions(-)
drivers/clk/qcom/gcc-ipq9574.c +28 -55
index e8190108e1ae..987703431b5b 100644
@@ -105,6 +105,20 @@ static struct clk_alpha_pll_postdiv gpll0 = {
 	},
 };
 
+static struct clk_alpha_pll_postdiv gpll0_out_aux = {
+	.offset = 0x20000,
+	.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
+	.width = 4,
+	.clkr.hw.init = &(const struct clk_init_data) {
+		.name = "gpll0_out_aux",
+		.parent_hws = (const struct clk_hw *[]) {
+			&gpll0_main.clkr.hw
+		},
+		.num_parents = 1,
+		.ops = &clk_alpha_pll_postdiv_ro_ops,
+	},
+};
+
 static struct clk_alpha_pll gpll4_main = {
 	.offset = 0x22000,
 	.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
@@ -2186,23 +2200,6 @@ static struct clk_branch gcc_nsscfg_clk = {
 	},
 };
 
-static struct clk_branch gcc_nssnoc_nsscc_clk = {
-	.halt_reg = 0x17030,
-	.clkr = {
-		.enable_reg = 0x17030,
-		.enable_mask = BIT(0),
-		.hw.init = &(const struct clk_init_data) {
-			.name = "gcc_nssnoc_nsscc_clk",
-			.parent_hws = (const struct clk_hw *[]) {
-				&pcnoc_bfdcd_clk_src.clkr.hw
-			},
-			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
-			.ops = &clk_branch2_ops,
-		},
-	},
-};
-
 static struct clk_branch gcc_nsscc_clk = {
 	.halt_reg = 0x17034,
 	.clkr = {
@@ -2585,40 +2582,6 @@ static struct clk_branch gcc_q6ss_boot_clk = {
 	},
 };
 
-static struct clk_branch gcc_nssnoc_snoc_clk = {
-	.halt_reg = 0x17028,
-	.clkr = {
-		.enable_reg = 0x17028,
-		.enable_mask = BIT(0),
-		.hw.init = &(const struct clk_init_data) {
-			.name = "gcc_nssnoc_snoc_clk",
-			.parent_hws = (const struct clk_hw *[]) {
-				&system_noc_bfdcd_clk_src.clkr.hw
-			},
-			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
-			.ops = &clk_branch2_ops,
-		},
-	},
-};
-
-static struct clk_branch gcc_nssnoc_snoc_1_clk = {
-	.halt_reg = 0x1707c,
-	.clkr = {
-		.enable_reg = 0x1707c,
-		.enable_mask = BIT(0),
-		.hw.init = &(const struct clk_init_data) {
-			.name = "gcc_nssnoc_snoc_1_clk",
-			.parent_hws = (const struct clk_hw *[]) {
-				&system_noc_bfdcd_clk_src.clkr.hw
-			},
-			.num_parents = 1,
-			.flags = CLK_SET_RATE_PARENT,
-			.ops = &clk_branch2_ops,
-		},
-	},
-};
-
 static struct clk_branch gcc_qdss_etr_usb_clk = {
 	.halt_reg = 0x2d060,
 	.clkr = {
@@ -4043,7 +4006,6 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
 	[GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
 	[PCNOC_BFDCD_CLK_SRC] = &pcnoc_bfdcd_clk_src.clkr,
 	[GCC_NSSCFG_CLK] = &gcc_nsscfg_clk.clkr,
-	[GCC_NSSNOC_NSSCC_CLK] = &gcc_nssnoc_nsscc_clk.clkr,
 	[GCC_NSSCC_CLK] = &gcc_nsscc_clk.clkr,
 	[GCC_NSSNOC_PCNOC_1_CLK] = &gcc_nssnoc_pcnoc_1_clk.clkr,
 	[GCC_QDSS_DAP_AHB_CLK] = &gcc_qdss_dap_ahb_clk.clkr,
@@ -4059,8 +4021,6 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
 	[GCC_CMN_12GPLL_AHB_CLK] = &gcc_cmn_12gpll_ahb_clk.clkr,
 	[GCC_CMN_12GPLL_APU_CLK] = &gcc_cmn_12gpll_apu_clk.clkr,
 	[SYSTEM_NOC_BFDCD_CLK_SRC] = &system_noc_bfdcd_clk_src.clkr,
-	[GCC_NSSNOC_SNOC_CLK] = &gcc_nssnoc_snoc_clk.clkr,
-	[GCC_NSSNOC_SNOC_1_CLK] = &gcc_nssnoc_snoc_1_clk.clkr,
 	[GCC_QDSS_ETR_USB_CLK] = &gcc_qdss_etr_usb_clk.clkr,
 	[WCSS_AHB_CLK_SRC] = &wcss_ahb_clk_src.clkr,
 	[GCC_Q6_AHB_CLK] = &gcc_q6_ahb_clk.clkr,
@@ -4140,6 +4100,7 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
 	[GCC_SNOC_PCIE1_1LANE_S_CLK] = &gcc_snoc_pcie1_1lane_s_clk.clkr,
 	[GCC_SNOC_PCIE2_2LANE_S_CLK] = &gcc_snoc_pcie2_2lane_s_clk.clkr,
 	[GCC_SNOC_PCIE3_2LANE_S_CLK] = &gcc_snoc_pcie3_2lane_s_clk.clkr,
+	[GPLL0_OUT_AUX] = &gpll0_out_aux.clkr,
 };
 
 static const struct qcom_reset_map gcc_ipq9574_resets[] = {
@@ -4326,7 +4287,19 @@ static const struct qcom_cc_desc gcc_ipq9574_desc = {
 
 static int gcc_ipq9574_probe(struct platform_device *pdev)
 {
-	return qcom_cc_probe(pdev, &gcc_ipq9574_desc);
+	struct regmap *regmap;
+
+	regmap = qcom_cc_map(pdev, &gcc_ipq9574_desc);
+
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	/* Keep the critical clocks always-On */
+	regmap_update_bits(regmap, 0x17030, BIT(0), BIT(0)); /* gcc_nssnoc_nsscc_clk */
+	regmap_update_bits(regmap, 0x17028, BIT(0), BIT(0)); /* gcc_nssnoc_snoc_clk */
+	regmap_update_bits(regmap, 0x1707C, BIT(0), BIT(0)); /* gcc_nssnoc_snoc_1_clk */
+
+	return qcom_cc_really_probe(pdev, &gcc_ipq9574_desc, regmap);
 }
 
 static struct platform_driver gcc_ipq9574_driver = {
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH V3 3/7] clk: qcom: gcc-ipq9574: Add gpll0_out_aux clock & enable few nssnoc clocks

Quoted 7 lines · Devi Priya

gcc_nssnoc_nsscc_clk, gcc_nssnoc_snoc_clk, gcc_nssnoc_snoc_1_clk are enabled by default and the RCGs are properly configured by the bootloader.

Some of the NSS clocks needs these clocks to be enabled. To avoid these clocks being disabled by clock framework, drop these entries from the clock table and enable it in the driver probe itself.

Obvious NAK for mixing two independent changes into a single patch.

Quoted 50 lines

Also, add support for gpll0_out_aux clock which acts as the parent for certain networking subsystem (nss) clocks.

---
Changes in V3:
- Dropped flags for gpll0_out_aux
- Dropped few nss clock entries from the clock table and enabled them in the probe

 drivers/clk/qcom/gcc-ipq9574.c | 83 ++++++++++++----------------------
 1 file changed, 28 insertions(+), 55 deletions(-)
drivers/clk/qcom/gcc-ipq9574.c +14 -7
index e8190108e1ae..987703431b5b 100644
@@ -105,6 +105,20 @@ static struct clk_alpha_pll_postdiv gpll0 = {
        },
 };
 
+static struct clk_alpha_pll_postdiv gpll0_out_aux = {
+       .offset = 0x20000,
+       .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
+       .width = 4,
+       .clkr.hw.init = &(const struct clk_init_data) {
+               .name = "gpll0_out_aux",
+               .parent_hws = (const struct clk_hw *[]) {
+                       &gpll0_main.clkr.hw
+               },
+               .num_parents = 1,
+               .ops = &clk_alpha_pll_postdiv_ro_ops,
+       },
+};
+
 static struct clk_alpha_pll gpll4_main = {
        .offset = 0x22000,
        .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
@@ -2186,23 +2200,6 @@ static struct clk_branch gcc_nsscfg_clk = {
        },
 };
 
-static struct clk_branch gcc_nssnoc_nsscc_clk = {
-       .halt_reg = 0x17030,
-       .clkr = {
-               .enable_reg = 0x17030,
-               .enable_mask = BIT(0),
-               .hw.init = &(const struct clk_init_data) {
-                       .name = "gcc_nssnoc_nsscc_clk",

drivers/clk/qcom/gcc-ipq9574.c static struct clk_branch gcc_nsscfg_clk = { · line 2205

Quoted 10 lines
drivers/clk/qcom/gcc-ipq9574.c +0 -10
-                       .parent_hws = (const struct clk_hw *[]) {
-                               &pcnoc_bfdcd_clk_src.clkr.hw
-                       },
-                       .num_parents = 1,
-                       .flags = CLK_SET_RATE_PARENT,
-                       .ops = &clk_branch2_ops,
-               },
-       },
-};
-

What is the actual consumer for these clocks? Why are you trying to hide them instead of making them used by the consumer device?

Quoted 94 lines
drivers/clk/qcom/gcc-ipq9574.c +14 -39
 static struct clk_branch gcc_nsscc_clk = {
        .halt_reg = 0x17034,
        .clkr = {
@@ -2585,40 +2582,6 @@ static struct clk_branch gcc_q6ss_boot_clk = {
        },
 };
 
-static struct clk_branch gcc_nssnoc_snoc_clk = {
-       .halt_reg = 0x17028,
-       .clkr = {
-               .enable_reg = 0x17028,
-               .enable_mask = BIT(0),
-               .hw.init = &(const struct clk_init_data) {
-                       .name = "gcc_nssnoc_snoc_clk",
-                       .parent_hws = (const struct clk_hw *[]) {
-                               &system_noc_bfdcd_clk_src.clkr.hw
-                       },
-                       .num_parents = 1,
-                       .flags = CLK_SET_RATE_PARENT,
-                       .ops = &clk_branch2_ops,
-               },
-       },
-};
-
-static struct clk_branch gcc_nssnoc_snoc_1_clk = {
-       .halt_reg = 0x1707c,
-       .clkr = {
-               .enable_reg = 0x1707c,
-               .enable_mask = BIT(0),
-               .hw.init = &(const struct clk_init_data) {
-                       .name = "gcc_nssnoc_snoc_1_clk",
-                       .parent_hws = (const struct clk_hw *[]) {
-                               &system_noc_bfdcd_clk_src.clkr.hw
-                       },
-                       .num_parents = 1,
-                       .flags = CLK_SET_RATE_PARENT,
-                       .ops = &clk_branch2_ops,
-               },
-       },
-};
-
 static struct clk_branch gcc_qdss_etr_usb_clk = {
        .halt_reg = 0x2d060,
        .clkr = {
@@ -4043,7 +4006,6 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
        [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
        [PCNOC_BFDCD_CLK_SRC] = &pcnoc_bfdcd_clk_src.clkr,
        [GCC_NSSCFG_CLK] = &gcc_nsscfg_clk.clkr,
-       [GCC_NSSNOC_NSSCC_CLK] = &gcc_nssnoc_nsscc_clk.clkr,
        [GCC_NSSCC_CLK] = &gcc_nsscc_clk.clkr,
        [GCC_NSSNOC_PCNOC_1_CLK] = &gcc_nssnoc_pcnoc_1_clk.clkr,
        [GCC_QDSS_DAP_AHB_CLK] = &gcc_qdss_dap_ahb_clk.clkr,
@@ -4059,8 +4021,6 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
        [GCC_CMN_12GPLL_AHB_CLK] = &gcc_cmn_12gpll_ahb_clk.clkr,
        [GCC_CMN_12GPLL_APU_CLK] = &gcc_cmn_12gpll_apu_clk.clkr,
        [SYSTEM_NOC_BFDCD_CLK_SRC] = &system_noc_bfdcd_clk_src.clkr,
-       [GCC_NSSNOC_SNOC_CLK] = &gcc_nssnoc_snoc_clk.clkr,
-       [GCC_NSSNOC_SNOC_1_CLK] = &gcc_nssnoc_snoc_1_clk.clkr,
        [GCC_QDSS_ETR_USB_CLK] = &gcc_qdss_etr_usb_clk.clkr,
        [WCSS_AHB_CLK_SRC] = &wcss_ahb_clk_src.clkr,
        [GCC_Q6_AHB_CLK] = &gcc_q6_ahb_clk.clkr,
@@ -4140,6 +4100,7 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
        [GCC_SNOC_PCIE1_1LANE_S_CLK] = &gcc_snoc_pcie1_1lane_s_clk.clkr,
        [GCC_SNOC_PCIE2_2LANE_S_CLK] = &gcc_snoc_pcie2_2lane_s_clk.clkr,
        [GCC_SNOC_PCIE3_2LANE_S_CLK] = &gcc_snoc_pcie3_2lane_s_clk.clkr,
+       [GPLL0_OUT_AUX] = &gpll0_out_aux.clkr,
 };
 
 static const struct qcom_reset_map gcc_ipq9574_resets[] = {
@@ -4326,7 +4287,19 @@ static const struct qcom_cc_desc gcc_ipq9574_desc = {
 
 static int gcc_ipq9574_probe(struct platform_device *pdev)
 {
-       return qcom_cc_probe(pdev, &gcc_ipq9574_desc);
+       struct regmap *regmap;
+
+       regmap = qcom_cc_map(pdev, &gcc_ipq9574_desc);
+
+       if (IS_ERR(regmap))
+               return PTR_ERR(regmap);
+
+       /* Keep the critical clocks always-On */
+       regmap_update_bits(regmap, 0x17030, BIT(0), BIT(0)); /* gcc_nssnoc_nsscc_clk */
+       regmap_update_bits(regmap, 0x17028, BIT(0), BIT(0)); /* gcc_nssnoc_snoc_clk */
+       regmap_update_bits(regmap, 0x1707C, BIT(0), BIT(0)); /* gcc_nssnoc_snoc_1_clk */
+
+       return qcom_cc_really_probe(pdev, &gcc_ipq9574_desc, regmap);
 }
 
 static struct platform_driver gcc_ipq9574_driver = {
--

2.34.1

Signature · 2 lines
With best wishes
Dmitry
author
#5 lore raw

PATCH v3 4/7 dt-bindings: clock: Add ipq9574 NSSCC clock and reset definitions

In reply to Devi Priya

Add NSSCC clock and reset definitions for ipq9574.

---
Changes in V3:
- Dropped clock-names
- Reordered clock items to have XO source at the start as suggested by Dmitry
- Dropped nssnoc clock entries as they have been dropped from the gcc clock table & enabled in probe
- Picked up the R-b tag

 .../bindings/clock/qcom,ipq9574-nsscc.yaml    |  69 ++++++++
 .../dt-bindings/clock/qcom,ipq9574-nsscc.h    | 152 ++++++++++++++++++
 .../dt-bindings/reset/qcom,ipq9574-nsscc.h    | 134 +++++++++++++++
 3 files changed, 355 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,ipq9574-nsscc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,ipq9574-nsscc.h
 create mode 100644 include/dt-bindings/reset/qcom,ipq9574-nsscc.h
Documentation/devicetree/bindings/clock/qcom,ipq9574-nsscc.yaml new file +69 -0
new file mode 100644
index 000000000000..b55daa155c7b
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,ipq9574-nsscc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Networking Sub System Clock & Reset Controller on IPQ9574
+
+maintainers:
+  - Bjorn Andersson <[email protected]>
+  - Anusha Rao <[email protected]>
+
+description: |
+  Qualcomm networking sub system clock control module provides the clocks,
+  resets and power domains on IPQ9574
+
+  See also::
+    include/dt-bindings/clock/qcom,ipq9574-nsscc.h
+    include/dt-bindings/reset/qcom,ipq9574-nsscc.h
+
+properties:
+  compatible:
+    const: qcom,ipq9574-nsscc
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: Bias PLL cc clock source
+      - description: Bias PLL nss noc clock source
+      - description: Bias PLL ubi nc clock source
+      - description: GCC GPLL0 OUT AUX clock source
+      - description: Uniphy0 NSS Rx clock source
+      - description: Uniphy0 NSS Tx clock source
+      - description: Uniphy1 NSS Rx clock source
+      - description: Uniphy1 NSS Tx clock source
+      - description: Uniphy2 NSS Rx clock source
+      - description: Uniphy2 NSS Tx clock source
+
+required:
+  - compatible
+  - clocks
+
+allOf:
+  - $ref: qcom,gcc.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,ipq9574-gcc.h>
+    clock-controller@39b00000 {
+      compatible = "qcom,ipq9574-nsscc";
+      reg = <0x39b00000 0x80000>;
+      clocks = <&xo_board_clk>,
+               <&bias_pll_cc_clk>,
+               <&bias_pll_nss_noc_clk>,
+               <&bias_pll_ubi_nc_clk>,
+               <&gcc GPLL0_OUT_AUX>,
+               <&uniphy 0>,
+               <&uniphy 1>,
+               <&uniphy 2>,
+               <&uniphy 3>,
+               <&uniphy 4>,
+               <&uniphy 5>;
+      #clock-cells = <1>;
+      #reset-cells = <1>;
+      #power-domain-cells = <1>;
+    };
+...
include/dt-bindings/clock/qcom,ipq9574-nsscc.h new file +152 -0

152 lines not on this page · raw message

include/dt-bindings/reset/qcom,ipq9574-nsscc.h new file +134 -0

134 lines not on this page · raw message

Signature · 1 line
2.34.1
author
#6 lore raw

PATCH v3 5/7 clk: qcom: Add NSS clock Controller driver for IPQ9574

In reply to Devi Priya

Add Networking Sub System Clock Controller(NSSCC) driver for ipq9574 based devices.

---
Changes in V3:
- Moved DT_XO to the beginning of the enum list
- Hex values changed to lowercase
- Construct mask for resets which require multiple bits to be set/cleared.
- Dropped pm_clks as the necessary nss clocks are enabled in the probe function of gcc driver.

 drivers/clk/qcom/Kconfig         |    7 +
 drivers/clk/qcom/Makefile        |    1 +
 drivers/clk/qcom/nsscc-ipq9574.c | 3068 ++++++++++++++++++++++++++++++
 3 files changed, 3076 insertions(+)
 create mode 100644 drivers/clk/qcom/nsscc-ipq9574.c
drivers/clk/qcom/Kconfig +7 -0
index 2a9da0939377..bfdf08e1ea3e 100644
@@ -214,6 +214,13 @@ config IPQ_GCC_9574
 	  i2c, USB, SD/eMMC, etc. Select this for the root clock
 	  of ipq9574.
 
+config IPQ_NSSCC_9574
+	tristate "IPQ9574 NSS Clock Controller"
+	depends on ARM64 || COMPILE_TEST
+	depends on IPQ_GCC_9574
+	help
+	  Support for NSS clock controller on ipq9574 devices.
+
 config MSM_GCC_8660
 	tristate "MSM8660 Global Clock Controller"
 	depends on ARM || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
index 582e06dc1d93..afb5c80b6a8e 100644
@@ -31,6 +31,7 @@ obj-$(CONFIG_IPQ_GCC_6018) += gcc-ipq6018.o
 obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o
 obj-$(CONFIG_IPQ_GCC_8074) += gcc-ipq8074.o
 obj-$(CONFIG_IPQ_GCC_9574) += gcc-ipq9574.o
+obj-$(CONFIG_IPQ_NSSCC_9574)	+= nsscc-ipq9574.o
 obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o
 obj-$(CONFIG_MDM_GCC_9607) += gcc-mdm9607.o
 obj-$(CONFIG_MDM_GCC_9615) += gcc-mdm9615.o
drivers/clk/qcom/nsscc-ipq9574.c new file +3068 -0

2,980 lines not on this page · raw message

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

Signature · 1 line
2.34.1

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

Tested-by on v3 5/7
#7 lore raw

Re: [PATCH V3 5/7] clk: qcom: Add NSS clock Controller driver for IPQ9574

Quoted 12 lines · Devi Priya

Add Networking Sub System Clock Controller(NSSCC) driver for ipq9574 based devices.

---
Changes in V3:
- Moved DT_XO to the beginning of the enum list
- Hex values changed to lowercase
- Construct mask for resets which require multiple bits to be set/cleared.
- Dropped pm_clks as the necessary nss clocks are enabled in the probe function of gcc driver.

Quoted 5 lines
  drivers/clk/qcom/Kconfig         |    7 +
  drivers/clk/qcom/Makefile        |    1 +
  drivers/clk/qcom/nsscc-ipq9574.c | 3068 ++++++++++++++++++++++++++++++
  3 files changed, 3076 insertions(+)

create mode 100644 drivers/clk/qcom/nsscc-ipq9574.c

author
#8 lore raw

PATCH v3 6/7 arm64: dts: qcom: ipq9574: Add support for nsscc node

In reply to Devi Priya

Add a node for the nss clock controller found on ipq9574 based devices.

---
Changes in V3:
- Dropped clock-names & moved xo clock to the start of the list

 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 39 +++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +39 -0
index 5f83ee42a719..20e51a5c7a87 100644
@@ -10,6 +10,8 @@
 #include <dt-bindings/clock/qcom,ipq9574-gcc.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/qcom,ipq9574-gcc.h>
+#include <dt-bindings/clock/qcom,ipq9574-nsscc.h>
+#include <dt-bindings/reset/qcom,ipq9574-nsscc.h>
 #include <dt-bindings/thermal/thermal.h>
 
 / {
@@ -18,6 +20,24 @@ / {
 	#size-cells = <2>;
 
 	clocks {
+		bias_pll_cc_clk: bias-pll-cc-clk {
+			compatible = "fixed-clock";
+			clock-frequency = <1200000000>;
+			#clock-cells = <0>;
+		};
+
+		bias_pll_nss_noc_clk: bias-pll-nss-noc-clk {
+			compatible = "fixed-clock";
+			clock-frequency = <461500000>;
+			#clock-cells = <0>;
+		};
+
+		bias_pll_ubi_nc_clk: bias-pll-ubi-nc-clk {
+			compatible = "fixed-clock";
+			clock-frequency = <353000000>;
+			#clock-cells = <0>;
+		};
+
 		sleep_clk: sleep-clk {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
@@ -741,6 +761,25 @@ frame@b128000 {
 				status = "disabled";
 			};
 		};
+
+		nsscc: clock-controller@39b00000 {
+			compatible = "qcom,ipq9574-nsscc";
+			reg = <0x39b00000 0x80000>;
+			clocks = <&xo_board_clk>,
+				 <&bias_pll_cc_clk>,
+				 <&bias_pll_nss_noc_clk>,
+				 <&bias_pll_ubi_nc_clk>,
+				 <&gcc GPLL0_OUT_AUX>,
+				 <0>,
+				 <0>,
+				 <0>,
+				 <0>,
+				 <0>,
+				 <0>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+			#power-domain-cells = <1>;
+		};
 	};
 
 	thermal-zones {
Signature · 1 line
2.34.1
author
#9 lore raw

PATCH v3 7/7 arm64: defconfig: Build NSS Clock Controller driver for IPQ9574

In reply to Devi Priya

NSSCC driver is needed to enable the ethernet interfaces and not necessary for the bootup of the SoC, hence build it as a module.

---
Changes in V3:
- No change

 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index e6cf3e5d63c3..00e7f3112d53 100644
@@ -1255,6 +1255,7 @@ CONFIG_IPQ_GCC_5332=y
 CONFIG_IPQ_GCC_6018=y
 CONFIG_IPQ_GCC_8074=y
 CONFIG_IPQ_GCC_9574=y
+CONFIG_IPQ_NSSCC_9574=m
 CONFIG_MSM_GCC_8916=y
 CONFIG_MSM_MMCC_8994=m
 CONFIG_MSM_GCC_8994=y
Signature · 1 line
2.34.1