Skip to contentSkip to conversation

clk: qcom: Support for Low Power Audio Clocks on SC7180

PATCH Superseded Taniya Das 3 participants 10 messages Mar 27, 2020 – May 17, 2020

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Taniya Das

author
#0 lore raw

cover clk: qcom: Support for Low Power Audio Clocks on SC7180

[v1]
* Add support for Retention of GDSCR.
* Add YAML schema for LPASS clocks and clock IDs for LPASS.
* Add clock driver for LPASS core clocks and GCC LPASS clock.

Taniya Das (4):
clk: qcom: gdsc: Add support to enable retention of GSDCR
dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7180
clk: qcom: gcc: Add support for GCC LPASS clock for SC7180
clk: qcom: lpass: Add support for LPASS clock controller for SC7180

 .../bindings/clock/qcom,sc7180-lpasscorecc.yaml    |  81 ++++
 drivers/clk/qcom/Kconfig                           |   9 +
 drivers/clk/qcom/Makefile                          |   1 +
 drivers/clk/qcom/gcc-sc7180.c                      |  14 +
 drivers/clk/qcom/gdsc.c                            |  12 +
 drivers/clk/qcom/gdsc.h                            |   1 +
 drivers/clk/qcom/lpasscorecc-sc7180.c              | 479 +++++++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-sc7180.h        |   1 +
 .../dt-bindings/clock/qcom,lpasscorecc-sc7180.h    |  28 ++
 9 files changed, 626 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml
 create mode 100644 drivers/clk/qcom/lpasscorecc-sc7180.c
 create mode 100644 include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

author
#1 lore raw

PATCH 1/4 clk: qcom: gdsc: Add support to enable retention of GSDCR

Add support for the RETAIN_FF_ENABLE feature which enables the usage of retention registers. These registers maintain their state after disabling and re-enabling a GDSC.

---
 drivers/clk/qcom/gdsc.c | 12 ++++++++++++
 drivers/clk/qcom/gdsc.h |  1 +
 2 files changed, 13 insertions(+)
drivers/clk/qcom/gdsc.c +12 -0
index a250f59..cfe908f 100644
@@ -28,6 +28,7 @@
 /* CFG_GDSCR */
 #define GDSC_POWER_UP_COMPLETE		BIT(16)
 #define GDSC_POWER_DOWN_COMPLETE	BIT(15)
+#define GDSC_RETAIN_FF_ENABLE		BIT(11)
 #define CFG_GDSCR_OFFSET		0x4
 
 /* Wait 2^n CXO cycles between all states. Here, n=2 (4 cycles). */
@@ -202,6 +203,14 @@ static inline void gdsc_assert_reset_aon(struct gdsc *sc)
 	regmap_update_bits(sc->regmap, sc->clamp_io_ctrl,
 			   GMEM_RESET_MASK, 0);
 }
+
+static inline void gdsc_retain_ff_on(struct gdsc *sc)
+{
+	u32 mask = RETAIN_FF_ENABLE;
+
+	regmap_update_bits(sc->regmap, sc->gdscr, mask, mask);
+}
+
 static int gdsc_enable(struct generic_pm_domain *domain)
 {
 	struct gdsc *sc = domain_to_gdsc(domain);
@@ -254,6 +263,9 @@ static int gdsc_enable(struct generic_pm_domain *domain)
 		udelay(1);
 	}
 
+	if (sc->flags & RETAIN_FF_ENABLE)
+		gdsc_retain_ff_on(sc);
+
 	return 0;
 }
 
drivers/clk/qcom/gdsc.h +1 -0
index 64cdc8c..8604d44 100644
@@ -49,6 +49,7 @@ struct gdsc {
 #define AON_RESET	BIT(4)
 #define POLL_CFG_GDSCR	BIT(5)
 #define ALWAYS_ON	BIT(6)
+#define RETAIN_FF_ENABLE	BIT(7)
 	struct reset_controller_dev	*rcdev;
 	unsigned int			*resets;
 	unsigned int			reset_count;

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

maintainer
#2 lore raw

Re: [PATCH v1 1/4] clk: qcom: gdsc: Add support to enable retention of GSDCR

Quoting Taniya Das (2020-03-27 12:48:02)

Quoted 13 lines
drivers/clk/qcom/gdsc.c +1 -0
index a250f59..cfe908f 100644
@@ -28,6 +28,7 @@
 /* CFG_GDSCR */
 #define GDSC_POWER_UP_COMPLETE         BIT(16)
 #define GDSC_POWER_DOWN_COMPLETE       BIT(15)
+#define GDSC_RETAIN_FF_ENABLE          BIT(11)
 #define CFG_GDSCR_OFFSET               0x4
 
 /* Wait 2^n CXO cycles between all states. Here, n=2 (4 cycles). */

drivers/clk/qcom/gdsc.c static inline void gdsc_assert_reset_aon(struct gdsc *sc) · line 207

Quoted 5 lines
drivers/clk/qcom/gdsc.c +2 -0
@@ -202,6 +203,14 @@ static inline void gdsc_assert_reset_aon(struct gdsc *sc)
        regmap_update_bits(sc->regmap, sc->clamp_io_ctrl,
                           GMEM_RESET_MASK, 0);
 }
+
+static inline void gdsc_retain_ff_on(struct gdsc *sc)

Drop inline please.

drivers/clk/qcom/gdsc.c static inline void gdsc_assert_reset_aon(struct gdsc *sc) · line 209

Quoted 2 lines
drivers/clk/qcom/gdsc.c +2 -0
+{
+       u32 mask = RETAIN_FF_ENABLE;

Is this supposed to be GDSC_RETAIN_FF_ENABLE?

Quoted 22 lines
drivers/clk/qcom/gdsc.c +7 -0
+
+       regmap_update_bits(sc->regmap, sc->gdscr, mask, mask);
+}
+
 static int gdsc_enable(struct generic_pm_domain *domain)
 {
        struct gdsc *sc = domain_to_gdsc(domain);
@@ -254,6 +263,9 @@ static int gdsc_enable(struct generic_pm_domain *domain)
                udelay(1);
        }
 
+       if (sc->flags & RETAIN_FF_ENABLE)
+               gdsc_retain_ff_on(sc);
+
        return 0;
 }
 
drivers/clk/qcom/gdsc.h +0 -0
index 64cdc8c..8604d44 100644

drivers/clk/qcom/gdsc.h struct gdsc { · line 52

Quoted 4 lines
drivers/clk/qcom/gdsc.h +1 -0
@@ -49,6 +49,7 @@ struct gdsc {
 #define AON_RESET      BIT(4)
 #define POLL_CFG_GDSCR BIT(5)
 #define ALWAYS_ON      BIT(6)
+#define RETAIN_FF_ENABLE       BIT(7)

This is a flag, not a register bit presumably.

Quoted 3 lines
drivers/clk/qcom/gdsc.h +0 -0
        struct reset_controller_dev     *rcdev;
        unsigned int                    *resets;
        unsigned int                    reset_count;
author
#3 lore raw

Re: [PATCH v1 1/4] clk: qcom: gdsc: Add support to enable retention of GSDCR

Hello Stephen,

Thanks for the review.

Quoted 12 lines · Stephen Boyd

Quoting Taniya Das (2020-03-27 12:48:02)

Quoted 11 lines
drivers/clk/qcom/gdsc.c +1 -0
index a250f59..cfe908f 100644
@@ -28,6 +28,7 @@
  /* CFG_GDSCR */
  #define GDSC_POWER_UP_COMPLETE         BIT(16)
  #define GDSC_POWER_DOWN_COMPLETE       BIT(15)
+#define GDSC_RETAIN_FF_ENABLE          BIT(11)
  #define CFG_GDSCR_OFFSET               0x4
 
Quoted 10 lines

drivers/clk/qcom/gdsc.c static inline void gdsc_assert_reset_aon(struct gdsc *sc) · line 207

Quoted 7 lines
drivers/clk/qcom/gdsc.c +2 -0
  /* Wait 2^n CXO cycles between all states. Here, n=2 (4 cycles). */
@@ -202,6 +203,14 @@ static inline void gdsc_assert_reset_aon(struct gdsc *sc)
         regmap_update_bits(sc->regmap, sc->clamp_io_ctrl,
                            GMEM_RESET_MASK, 0);
  }
+
+static inline void gdsc_retain_ff_on(struct gdsc *sc)

Drop inline please.

Will drop in the next patch.

Quoted 5 lines

drivers/clk/qcom/gdsc.c static inline void gdsc_assert_reset_aon(struct gdsc *sc) · line 209

Quoted 2 lines
drivers/clk/qcom/gdsc.c +2 -0
+{
+       u32 mask = RETAIN_FF_ENABLE;

Is this supposed to be GDSC_RETAIN_FF_ENABLE?

Will update in next patch.

Quoted 17 lines
Quoted 17 lines
drivers/clk/qcom/gdsc.c +7 -0
+
+       regmap_update_bits(sc->regmap, sc->gdscr, mask, mask);
+}
+
  static int gdsc_enable(struct generic_pm_domain *domain)
  {
         struct gdsc *sc = domain_to_gdsc(domain);
@@ -254,6 +263,9 @@ static int gdsc_enable(struct generic_pm_domain *domain)
                 udelay(1);
         }
 
+       if (sc->flags & RETAIN_FF_ENABLE)
+               gdsc_retain_ff_on(sc);
+
         return 0;
  }
 
Quoted 11 lines

drivers/clk/qcom/gdsc.h struct gdsc { · line 52

Quoted 9 lines
drivers/clk/qcom/gdsc.h +1 -0
index 64cdc8c..8604d44 100644
@@ -49,6 +49,7 @@ struct gdsc {
  #define AON_RESET      BIT(4)
  #define POLL_CFG_GDSCR BIT(5)
  #define ALWAYS_ON      BIT(6)
+#define RETAIN_FF_ENABLE       BIT(7)

This is a flag, not a register bit presumably.

Yes, it is a flag.

Quoted 4 lines
Quoted 4 lines
drivers/clk/qcom/gdsc.h +0 -0
         struct reset_controller_dev     *rcdev;
         unsigned int                    *resets;
         unsigned int                    reset_count;
Signature · 4 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation.

--
author
#4 lore raw

PATCH 2/4 dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7180

In reply to Taniya Das

The LPASS(Low Power Audio Subsystem) clock provider have a bunch of generic properties that are needed in a device tree. Also add clock ids for GCC LPASS and LPASS Core clock IDs for LPASS client to request for the clocks.

---
 .../bindings/clock/qcom,sc7180-lpasscorecc.yaml    | 81 ++++++++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-sc7180.h        |  1 +
 .../dt-bindings/clock/qcom,lpasscorecc-sc7180.h    | 28 ++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml new file +81 -0
new file mode 100644
index 0000000..d040bd1
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sc7180-lpasscorecc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm LPASS Core Clock Controller Binding for SC7180
+
+maintainers:
+  - Taniya Das <[email protected]>
+
+description: |
+  Qualcomm LPASS core clock control module which supports the clocks and
+  power domains on SC7180.
+
+  See also:
+  - dt-bindings/clock/qcom,lpasscorecc-sc7180.h
+
+properties:
+  compatible:
+    enum:
+      - qcom,sc7180-lpasshm
+      - qcom,sc7180-lpasscorecc
+
+  clocks:
+    items:
+      - description: gcc_lpass_sway clock from GCC
+
+  clock-names:
+    items:
+      - const: gcc_lpass_sway
+
+  power-domains:
+    items:
+      - description: LPASS CORE HM GSDCR
+
+  '#clock-cells':
+    const: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  reg:
+    minItems: 1
+    maxItems: 2
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - '#clock-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sc7180.h>
+    #include <dt-bindings/clock/qcom,lpasscorecc-sc7180.h>
+    clock-controller@63000000 {
+      compatible = "qcom,sc7180-lpasshm";
+        reg = <0 0x63000000 0 0x28>;
+        clocks = <&gcc GCC_LPASS_CFG_NOC_SWAY_CLK>;
+        clock-names = "gcc_lpass_sway";
+        #clock-cells = <1>;
+        #power-domain-cells = <1>;
+    };
+
+  - |
+    clock-controller@62d00000 {
+        compatible = "qcom,sc7180-lpasscorecc";
+        reg = <0 0x62d00000 0 0x50000>,
+            <0 0x62780000 0 0x30000>;
+        clocks = <&gcc GCC_LPASS_CFG_NOC_SWAY_CLK>;
+        clock-names = "gcc_lpass_sway";
+        power-domains = <&lpass_hm LPASS_CORE_HM_GDSCR>;
+        #clock-cells = <1>;
+        #power-domain-cells = <1>;
+    };
+...
include/dt-bindings/clock/qcom,gcc-sc7180.h +1 -0
index 1258fd0..439476c 100644
@@ -137,6 +137,7 @@
 #define GCC_MSS_NAV_AXI_CLK					127
 #define GCC_MSS_Q6_MEMNOC_AXI_CLK				128
 #define GCC_MSS_SNOC_AXI_CLK					129
+#define GCC_LPASS_CFG_NOC_SWAY_CLK				130
 
 /* GCC resets */
 #define GCC_QUSB2PHY_PRIM_BCR					0
include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h new file +28 -0
new file mode 100644
index 0000000..9466d5e
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_LPASS_CORE_CC_SC7180_H
+#define _DT_BINDINGS_CLK_QCOM_LPASS_CORE_CC_SC7180_H
+
+/* LPASS_CORE_CC clocks */
+#define LPASS_LPAAUDIO_DIG_PLL				0
+#define LPASS_LPAAUDIO_DIG_PLL_OUT_ODD			1
+#define CORE_CLK_SRC					2
+#define EXT_MCLK0_CLK_SRC				3
+#define LPAIF_PRI_CLK_SRC				4
+#define LPAIF_SEC_CLK_SRC				5
+#define LPASS_AUDIO_CORE_CORE_CLK			6
+#define LPASS_AUDIO_CORE_EXT_MCLK0_CLK			7
+#define LPASS_AUDIO_CORE_LPAIF_PRI_IBIT_CLK		8
+#define LPASS_AUDIO_CORE_LPAIF_SEC_IBIT_CLK		9
+#define LPASS_AUDIO_CORE_SYSNOC_MPORT_CORE_CLK		10
+
+/* LPASS power domains */
+#define LPASS_CORE_HM_GDSCR				0
+
+#define LPASS_AUDIO_HM_GDSCR				0
+#define LPASS_PDC_HM_GDSCR				1
+
+#endif

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

maintainer
#5 lore raw

Re: [PATCH v1 2/4] dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7180

Quoted 54 lines · Taniya Das

The LPASS(Low Power Audio Subsystem) clock provider have a bunch of generic properties that are needed in a device tree. Also add clock ids for GCC LPASS and LPASS Core clock IDs for LPASS client to request for the clocks.

---
 .../bindings/clock/qcom,sc7180-lpasscorecc.yaml    | 81 ++++++++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-sc7180.h        |  1 +
 .../dt-bindings/clock/qcom,lpasscorecc-sc7180.h    | 28 ++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml
 create mode 100644 include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml new file +35 -0
new file mode 100644
index 0000000..d040bd1
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sc7180-lpasscorecc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm LPASS Core Clock Controller Binding for SC7180
+
+maintainers:
+  - Taniya Das <[email protected]>
+
+description: |
+  Qualcomm LPASS core clock control module which supports the clocks and
+  power domains on SC7180.
+
+  See also:
+  - dt-bindings/clock/qcom,lpasscorecc-sc7180.h
+
+properties:
+  compatible:
+    enum:
+      - qcom,sc7180-lpasshm
+      - qcom,sc7180-lpasscorecc
+
+  clocks:
+    items:
+      - description: gcc_lpass_sway clock from GCC
+
+  clock-names:
+    items:
+      - const: gcc_lpass_sway
+
+  power-domains:
+    items:
+      - description: LPASS CORE HM GSDCR

Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml line 45

Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml new file +10 -0
+
+  '#clock-cells':
+    const: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  reg:
+    minItems: 1
+    maxItems: 2

Need to define what each one is when there are 2.

Quoted 69 lines
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml new file +36 -0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - '#clock-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sc7180.h>
+    #include <dt-bindings/clock/qcom,lpasscorecc-sc7180.h>
+    clock-controller@63000000 {
+      compatible = "qcom,sc7180-lpasshm";
+        reg = <0 0x63000000 0 0x28>;
+        clocks = <&gcc GCC_LPASS_CFG_NOC_SWAY_CLK>;
+        clock-names = "gcc_lpass_sway";
+        #clock-cells = <1>;
+        #power-domain-cells = <1>;
+    };
+
+  - |
+    clock-controller@62d00000 {
+        compatible = "qcom,sc7180-lpasscorecc";
+        reg = <0 0x62d00000 0 0x50000>,
+            <0 0x62780000 0 0x30000>;
+        clocks = <&gcc GCC_LPASS_CFG_NOC_SWAY_CLK>;
+        clock-names = "gcc_lpass_sway";
+        power-domains = <&lpass_hm LPASS_CORE_HM_GDSCR>;
+        #clock-cells = <1>;
+        #power-domain-cells = <1>;
+    };
+...
include/dt-bindings/clock/qcom,gcc-sc7180.h +1 -0
index 1258fd0..439476c 100644
@@ -137,6 +137,7 @@
 #define GCC_MSS_NAV_AXI_CLK					127
 #define GCC_MSS_Q6_MEMNOC_AXI_CLK				128
 #define GCC_MSS_SNOC_AXI_CLK					129
+#define GCC_LPASS_CFG_NOC_SWAY_CLK				130
 
 /* GCC resets */
 #define GCC_QUSB2PHY_PRIM_BCR					0
include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h new file +15 -0
new file mode 100644
index 0000000..9466d5e
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_LPASS_CORE_CC_SC7180_H
+#define _DT_BINDINGS_CLK_QCOM_LPASS_CORE_CC_SC7180_H
+
+/* LPASS_CORE_CC clocks */
+#define LPASS_LPAAUDIO_DIG_PLL				0
+#define LPASS_LPAAUDIO_DIG_PLL_OUT_ODD			1
+#define CORE_CLK_SRC					2
+#define EXT_MCLK0_CLK_SRC				3
+#define LPAIF_PRI_CLK_SRC				4
+#define LPAIF_SEC_CLK_SRC				5

include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h line 25

Quoted 10 lines
include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h new file +10 -0
+#define LPASS_AUDIO_CORE_CORE_CLK			6
+#define LPASS_AUDIO_CORE_EXT_MCLK0_CLK			7
+#define LPASS_AUDIO_CORE_LPAIF_PRI_IBIT_CLK		8
+#define LPASS_AUDIO_CORE_LPAIF_SEC_IBIT_CLK		9
+#define LPASS_AUDIO_CORE_SYSNOC_MPORT_CORE_CLK		10
+
+/* LPASS power domains */
+#define LPASS_CORE_HM_GDSCR				0
+
+#define LPASS_AUDIO_HM_GDSCR				0

Kind of odd that 2 are the same value.

Quoted 7 lines
include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h new file +3 -1
+#define LPASS_PDC_HM_GDSCR				1
+
+#endif
--

Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

author
#6 lore raw

Re: [PATCH v1 2/4] dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7180

Hello Rob,

Thanks for the review.

Quoted 7 lines · Rob Herring

Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml line 45

Quoted 4 lines
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml new file +4 -0
+
+  reg:
+    minItems: 1
+    maxItems: 2

Need to define what each one is when there are 2.

Yes will define them in the next patch.

Quoted 65 lines
Quoted 26 lines
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml new file +26 -0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - '#clock-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sc7180.h>
+    #include <dt-bindings/clock/qcom,lpasscorecc-sc7180.h>
+    clock-controller@63000000 {
+      compatible = "qcom,sc7180-lpasshm";
+        reg = <0 0x63000000 0 0x28>;
+        clocks = <&gcc GCC_LPASS_CFG_NOC_SWAY_CLK>;
+        clock-names = "gcc_lpass_sway";
+        #clock-cells = <1>;
+        #power-domain-cells = <1>;
+    };
+
+  - |
+    clock-controller@62d00000 {

Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml line 81

Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml new file +10 -0
+        compatible = "qcom,sc7180-lpasscorecc";
+        reg = <0 0x62d00000 0 0x50000>,
+            <0 0x62780000 0 0x30000>;
+        clocks = <&gcc GCC_LPASS_CFG_NOC_SWAY_CLK>;
+        clock-names = "gcc_lpass_sway";
+        power-domains = <&lpass_hm LPASS_CORE_HM_GDSCR>;
+        #clock-cells = <1>;
+        #power-domain-cells = <1>;
+    };
+...

/* GCC resets */

Quoted 26 lines
  #define GCC_QUSB2PHY_PRIM_BCR					0
include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h new file +19 -0
new file mode 100644
index 0000000..9466d5e
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_LPASS_CORE_CC_SC7180_H
+#define _DT_BINDINGS_CLK_QCOM_LPASS_CORE_CC_SC7180_H
+
+/* LPASS_CORE_CC clocks */
+#define LPASS_LPAAUDIO_DIG_PLL				0
+#define LPASS_LPAAUDIO_DIG_PLL_OUT_ODD			1
+#define CORE_CLK_SRC					2
+#define EXT_MCLK0_CLK_SRC				3
+#define LPAIF_PRI_CLK_SRC				4
+#define LPAIF_SEC_CLK_SRC				5
+#define LPASS_AUDIO_CORE_CORE_CLK			6
+#define LPASS_AUDIO_CORE_EXT_MCLK0_CLK			7
+#define LPASS_AUDIO_CORE_LPAIF_PRI_IBIT_CLK		8
+#define LPASS_AUDIO_CORE_LPAIF_SEC_IBIT_CLK		9
Quoted 9 lines

include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h line 25

Quoted 6 lines
include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h new file +6 -0
+#define LPASS_AUDIO_CORE_SYSNOC_MPORT_CORE_CLK		10
+
+/* LPASS power domains */
+#define LPASS_CORE_HM_GDSCR				0
+
+#define LPASS_AUDIO_HM_GDSCR				0

Kind of odd that 2 are the same value.

These GDSCs are from two different domains. I will update the comments in the next patch.

Quoted 7 lines
Quoted 7 lines
include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h new file +3 -1
+#define LPASS_PDC_HM_GDSCR				1
+
+#endif
--

Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

Signature · 4 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation.

--
author
#7 lore raw

PATCH 3/4 clk: qcom: gcc: Add support for GCC LPASS clock for SC7180

In reply to Taniya Das

Add the GCC lpass clock which is required to access the LPASS core clocks.

---
 drivers/clk/qcom/gcc-sc7180.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/clk/qcom/gcc-sc7180.c +14 -0
index 6a51b5b..d970647 100644
@@ -2230,6 +2230,19 @@ static struct clk_branch gcc_mss_q6_memnoc_axi_clk = {
 	},
 };
 
+static struct clk_branch gcc_lpass_cfg_noc_sway_clk = {
+	.halt_reg = 0x47018,
+	.halt_check = BRANCH_HALT_DELAY,
+	.clkr = {
+		.enable_reg = 0x47018,
+		.enable_mask = BIT(0),
+		.hw.init = &(struct clk_init_data){
+			.name = "gcc_lpass_cfg_noc_sway_clk",
+			.ops = &clk_branch2_ops,
+		},
+	},
+};
+
 static struct gdsc ufs_phy_gdsc = {
 	.gdscr = 0x77004,
 	.pd = {
@@ -2406,6 +2419,7 @@ static struct clk_regmap *gcc_sc7180_clocks[] = {
 	[GCC_MSS_NAV_AXI_CLK] = &gcc_mss_nav_axi_clk.clkr,
 	[GCC_MSS_Q6_MEMNOC_AXI_CLK] = &gcc_mss_q6_memnoc_axi_clk.clkr,
 	[GCC_MSS_SNOC_AXI_CLK] = &gcc_mss_snoc_axi_clk.clkr,
+	[GCC_LPASS_CFG_NOC_SWAY_CLK] = &gcc_lpass_cfg_noc_sway_clk.clkr,
 };
 
 static const struct qcom_reset_map gcc_sc7180_resets[] = {

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

maintainer
#8 lore raw

Re: [PATCH v1 3/4] clk: qcom: gcc: Add support for GCC LPASS clock for SC7180

Quoting Taniya Das (2020-03-27 12:48:04)

drivers/clk/qcom/gcc-sc7180.c static struct clk_regmap *gcc_sc7180_clocks[] = { · line 2422

Quoted 5 lines
drivers/clk/qcom/gcc-sc7180.c +1 -0
@@ -2406,6 +2419,7 @@ static struct clk_regmap *gcc_sc7180_clocks[] = {
        [GCC_MSS_NAV_AXI_CLK] = &gcc_mss_nav_axi_clk.clkr,
        [GCC_MSS_Q6_MEMNOC_AXI_CLK] = &gcc_mss_q6_memnoc_axi_clk.clkr,
        [GCC_MSS_SNOC_AXI_CLK] = &gcc_mss_snoc_axi_clk.clkr,
+       [GCC_LPASS_CFG_NOC_SWAY_CLK] = &gcc_lpass_cfg_noc_sway_clk.clkr,

Sad to see that more defines are being added slowly to the header file. It would be better to have all the defines there so the binding header file isn't updated in small updates over months and months.

Quoted 2 lines
(quoted diff) +0 -0
 };
 
author
#9 lore raw

PATCH 4/4 clk: qcom: lpass: Add support for LPASS clock controller for SC7180

In reply to Taniya Das

The Low Power Audio subsystem clocks are required for Audio client to be able to request for the clocks and power domains.

---
 drivers/clk/qcom/Kconfig              |   9 +
 drivers/clk/qcom/Makefile             |   1 +
 drivers/clk/qcom/lpasscorecc-sc7180.c | 479 ++++++++++++++++++++++++++++++++++
 3 files changed, 489 insertions(+)
 create mode 100644 drivers/clk/qcom/lpasscorecc-sc7180.c
drivers/clk/qcom/Kconfig +9 -0
index 11ec6f4..732e91d 100644
@@ -272,6 +272,15 @@ config SC_GCC_7180
 	  Say Y if you want to use peripheral devices such as UART, SPI,
 	  I2C, USB, UFS, SDCC, etc.
 
+config SC_LPASS_CORECC_7180
+	tristate "SC7180 LPASS Core Clock Controller"
+	select SC_GCC_7180
+	help
+	  Support for the LPASS(Low Power Audio Subsystem) core clock controller
+	  on SC7180 devices.
+	  Say Y if you want to use LPASS clocks and power domains of the LPASS
+	  core clock controller.
+
 config SC_GPUCC_7180
 	tristate "SC7180 Graphics Clock Controller"
 	select SC_GCC_7180
drivers/clk/qcom/Makefile +1 -0
index 691efbf..cb29262 100644
@@ -50,6 +50,7 @@ obj-$(CONFIG_QCS_TURING_404) += turingcc-qcs404.o
 obj-$(CONFIG_SC_DISPCC_7180) += dispcc-sc7180.o
 obj-$(CONFIG_SC_GCC_7180) += gcc-sc7180.o
 obj-$(CONFIG_SC_GPUCC_7180) += gpucc-sc7180.o
+obj-$(CONFIG_SC_LPASS_CORECC_7180) += lpasscorecc-sc7180.o
 obj-$(CONFIG_SC_MSS_7180) += mss-sc7180.o
 obj-$(CONFIG_SC_VIDEOCC_7180) += videocc-sc7180.o
 obj-$(CONFIG_SDM_CAMCC_845) += camcc-sdm845.o
drivers/clk/qcom/lpasscorecc-sc7180.c new file +479 -0

479 lines not on this page · raw message

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.