2023-04-07 09:25:21

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v11 0/3] Add resets for ADSP based audio clock controller driver

Add resets and remove qdsp6ss clock controller for audioreach based platforms.

Changes since v10:
-- drop #define macro for max_register.
-- Add max_register value for top_cc register.
Changes since v9:
-- Drop "clk: qcom: lpassaudiocc-sc7280: Modify qcom_cc_probe" patch.
-- Update Fixes tag in Add the required gdsc's in lpass_cc_sc7280_desc patch.
-- Add the max_register value in Skip qdsp6ss clock registration patch.
Changes since v8:
-- Add the required gdsc's in lpass_cc_sc7280_desc structure.
-- Modify qcom_cc_probe to qcom_cc_probe_by_index.
-- Update the commit message for v8,4/5 patch, which is not required for new logic.
-- Drop "Add binding headers for lpasscc" patch.
-- Drop "Skip lpass_aon_cc_pll config" patch.
Changes since v7:
-- Modiy AHB clock probing method in "Merge lpasscc into lpass_aon patch".
-- Fix Typo errors in "Merge lpasscc into lpass_aon patch".
-- Update commit message in "Merge lpasscc into lpass_aon patch"
Changes since v6:
-- Update commit message in "Merge lpasscc into lpass_aon patch" patch.
-- Drop "Skip lpasscorecc registration" patch.
-- Add comment in the code in "Skip lpass_aon_cc_pll config" patch.
Changes since v5:
-- Fix compilation issue.
Changes since v4:
-- Update Fixes tag in Merge lpasscc into lpass_aon patch.
-- Revert removal of clk_regmap structure in Merge lpasscc into lpass_aon patch.
Changes since v3:
-- Remove duplicate clock resets patch.
-- Add binding headers for q6 clocks.
-- Create new patch for merging lpasscc q6 clocks into lpass_aon.
-- Create new patches for handling conflicts of ADSP and bypass solution.
Changes since v2:
-- Revert removing qdsp6ss clock control.
-- Add Conditional check for qdsp6ss clock registration.
Changes since v1:
-- Update commit message.
-- Remove qdsp6ss clock control.

Mohammad Rafi Shaik (1):
clk: qcom: lpassaudiocc-sc7280: Add required gdsc power domain clks in
lpass_cc_sc7280_desc

Srinivasa Rao Mandadapu (2):
dt-bindings: clock: qcom,sc7280-lpasscc: Add qcom,adsp-pil-mode
property
clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration

.../bindings/clock/qcom,sc7280-lpasscc.yaml | 7 +++++++
drivers/clk/qcom/lpassaudiocc-sc7280.c | 2 ++
drivers/clk/qcom/lpasscc-sc7280.c | 16 ++++++++++------
3 files changed, 19 insertions(+), 6 deletions(-)

--
2.25.1


2023-04-07 09:26:03

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v11 3/3] clk: qcom: lpassaudiocc-sc7280: Add required gdsc power domain clks in lpass_cc_sc7280_desc

Add GDSCs in lpass_cc_sc7280_desc struct.
When qcom,adsp-pil-mode is enabled, GDSCs required to solve
dependencies in lpass_audiocc probe().

Fixes: 0cbcfbe50cbf ("clk: qcom: lpass: Handle the regmap overlap of lpasscc and lpass_aon")
Signed-off-by: Mohammad Rafi Shaik <[email protected]>
---
drivers/clk/qcom/lpassaudiocc-sc7280.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
index 1339f9211a14..134eb1529ede 100644
--- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
+++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
@@ -696,6 +696,8 @@ static const struct qcom_cc_desc lpass_cc_sc7280_desc = {
.config = &lpass_audio_cc_sc7280_regmap_config,
.clks = lpass_cc_sc7280_clocks,
.num_clks = ARRAY_SIZE(lpass_cc_sc7280_clocks),
+ .gdscs = lpass_aon_cc_sc7280_gdscs,
+ .num_gdscs = ARRAY_SIZE(lpass_aon_cc_sc7280_gdscs),
};

static const struct qcom_cc_desc lpass_audio_cc_sc7280_desc = {
--
2.25.1

2023-04-07 09:26:56

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v11 2/3] clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration

From: Srinivasa Rao Mandadapu <[email protected]>

The qdsp6ss memory region is being shared by ADSP remoteproc device and
lpasscc clock device, hence causing memory conflict.
To avoid this, when qdsp6ss clocks are being enabled in remoteproc driver,
skip qdsp6ss clock registration if "qcom,adsp-pil-mode" is enabled and
also assign max_register value.

Fixes: 4ab43d171181 ("clk: qcom: Add lpass clock controller driver for SC7280")
Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
Signed-off-by: Mohammad Rafi Shaik <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
drivers/clk/qcom/lpasscc-sc7280.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/qcom/lpasscc-sc7280.c b/drivers/clk/qcom/lpasscc-sc7280.c
index 48432010ce24..0df2b29e95e3 100644
--- a/drivers/clk/qcom/lpasscc-sc7280.c
+++ b/drivers/clk/qcom/lpasscc-sc7280.c
@@ -121,14 +121,18 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev)
goto destroy_pm_clk;
}

- lpass_regmap_config.name = "qdsp6ss";
- desc = &lpass_qdsp6ss_sc7280_desc;
-
- ret = qcom_cc_probe_by_index(pdev, 0, desc);
- if (ret)
- goto destroy_pm_clk;
+ if (!of_property_read_bool(pdev->dev.of_node, "qcom,adsp-pil-mode")) {
+ lpass_regmap_config.name = "qdsp6ss";
+ lpass_regmap_config.max_register = 0x3f;
+ desc = &lpass_qdsp6ss_sc7280_desc;
+
+ ret = qcom_cc_probe_by_index(pdev, 0, desc);
+ if (ret)
+ goto destroy_pm_clk;
+ }

lpass_regmap_config.name = "top_cc";
+ lpass_regmap_config.max_register = 0x4;
desc = &lpass_cc_top_sc7280_desc;

ret = qcom_cc_probe_by_index(pdev, 1, desc);
--
2.25.1

2023-04-07 09:37:47

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v11 1/3] dt-bindings: clock: qcom,sc7280-lpasscc: Add qcom,adsp-pil-mode property

From: Srinivasa Rao Mandadapu <[email protected]>

When this property is set, the remoteproc is used to boot the
LPASS and therefore qdsp6ss clocks would be used to bring LPASS
out of reset, hence they are directly controlled by the remoteproc.

This is a cleanup done to handle overlap of regmap of lpasscc
and adsp remoteproc blocks.

Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
Signed-off-by: Mohammad Rafi Shaik <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
.../devicetree/bindings/clock/qcom,sc7280-lpasscc.yaml | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,sc7280-lpasscc.yaml b/Documentation/devicetree/bindings/clock/qcom,sc7280-lpasscc.yaml
index 6151fdebbff8..97c6bd96e0cb 100644
--- a/Documentation/devicetree/bindings/clock/qcom,sc7280-lpasscc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,sc7280-lpasscc.yaml
@@ -41,6 +41,12 @@ properties:
- const: qdsp6ss
- const: top_cc

+ qcom,adsp-pil-mode:
+ description:
+ Indicates if the LPASS would be brought out of reset using
+ remoteproc peripheral loader.
+ type: boolean
+
required:
- compatible
- reg
@@ -60,6 +66,7 @@ examples:
reg-names = "qdsp6ss", "top_cc";
clocks = <&gcc GCC_CFG_NOC_LPASS_CLK>;
clock-names = "iface";
+ qcom,adsp-pil-mode;
#clock-cells = <1>;
};
...
--
2.25.1

2023-04-07 21:52:16

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v11 3/3] clk: qcom: lpassaudiocc-sc7280: Add required gdsc power domain clks in lpass_cc_sc7280_desc

Quoting Mohammad Rafi Shaik (2023-04-07 02:22:55)
> Add GDSCs in lpass_cc_sc7280_desc struct.
> When qcom,adsp-pil-mode is enabled, GDSCs required to solve
> dependencies in lpass_audiocc probe().
>
> Fixes: 0cbcfbe50cbf ("clk: qcom: lpass: Handle the regmap overlap of lpasscc and lpass_aon")
> Signed-off-by: Mohammad Rafi Shaik <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>

2023-04-14 03:34:53

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v11 0/3] Add resets for ADSP based audio clock controller driver

On Fri, 7 Apr 2023 14:52:52 +0530, Mohammad Rafi Shaik wrote:
> Add resets and remove qdsp6ss clock controller for audioreach based platforms.
>
> Changes since v10:
> -- drop #define macro for max_register.
> -- Add max_register value for top_cc register.
> Changes since v9:
> -- Drop "clk: qcom: lpassaudiocc-sc7280: Modify qcom_cc_probe" patch.
> -- Update Fixes tag in Add the required gdsc's in lpass_cc_sc7280_desc patch.
> -- Add the max_register value in Skip qdsp6ss clock registration patch.
> Changes since v8:
> -- Add the required gdsc's in lpass_cc_sc7280_desc structure.
> -- Modify qcom_cc_probe to qcom_cc_probe_by_index.
> -- Update the commit message for v8,4/5 patch, which is not required for new logic.
> -- Drop "Add binding headers for lpasscc" patch.
> -- Drop "Skip lpass_aon_cc_pll config" patch.
> Changes since v7:
> -- Modiy AHB clock probing method in "Merge lpasscc into lpass_aon patch".
> -- Fix Typo errors in "Merge lpasscc into lpass_aon patch".
> -- Update commit message in "Merge lpasscc into lpass_aon patch"
> Changes since v6:
> -- Update commit message in "Merge lpasscc into lpass_aon patch" patch.
> -- Drop "Skip lpasscorecc registration" patch.
> -- Add comment in the code in "Skip lpass_aon_cc_pll config" patch.
> Changes since v5:
> -- Fix compilation issue.
> Changes since v4:
> -- Update Fixes tag in Merge lpasscc into lpass_aon patch.
> -- Revert removal of clk_regmap structure in Merge lpasscc into lpass_aon patch.
> Changes since v3:
> -- Remove duplicate clock resets patch.
> -- Add binding headers for q6 clocks.
> -- Create new patch for merging lpasscc q6 clocks into lpass_aon.
> -- Create new patches for handling conflicts of ADSP and bypass solution.
> Changes since v2:
> -- Revert removing qdsp6ss clock control.
> -- Add Conditional check for qdsp6ss clock registration.
> Changes since v1:
> -- Update commit message.
> -- Remove qdsp6ss clock control.
>
> [...]

Applied, thanks!

[1/3] dt-bindings: clock: qcom,sc7280-lpasscc: Add qcom,adsp-pil-mode property
commit: 5c3a7dcce10028c5839864ed475ae7930b03c1e8
[2/3] clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration
commit: 4fc1c2d9a2b7a394f3b873aae5e03bffd8b5cd31
[3/3] clk: qcom: lpassaudiocc-sc7280: Add required gdsc power domain clks in lpass_cc_sc7280_desc
commit: aad09fc7c4a522892eb64a79627b17a3869936cb

Best regards,
--
Bjorn Andersson <[email protected]>