2023-02-13 09:46:34

by Mohammad Rafi Shaik

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

Add resets and remove qdsp6ss clcok controller for audioreach based platforms.
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.

Srinivasa Rao Mandadapu (5):
dt-bindings: clock: qcom,sc7280-lpasscc: Add qcom,adsp-pil-mode
property
dt-bindings: clock: lpassaudiocc-sc7280: Add binding headers for
lpasscc
clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration
clk: qcom: lpassaudiocc-sc7280: Merge AHB clocks into lpass_aon
clk: qcom: lpassaudiocc-sc7280: Skip lpass_aon_cc_pll config

.../bindings/clock/qcom,sc7280-lpasscc.yaml | 7 +++++++
drivers/clk/qcom/lpassaudiocc-sc7280.c | 15 ++++++++++++---
drivers/clk/qcom/lpasscc-sc7280.c | 12 +++++++-----
.../dt-bindings/clock/qcom,lpassaudiocc-sc7280.h | 2 ++
4 files changed, 28 insertions(+), 8 deletions(-)

--
2.25.1



2023-02-13 09:46:41

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v8 1/5] 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: Mohammad Rafi Shaik <[email protected]>
Signed-off-by: Srinivasa Rao Mandadapu <[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-02-13 09:46:49

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v8 2/5] dt-bindings: clock: lpassaudiocc-sc7280: Add binding headers for lpasscc

From: Srinivasa Rao Mandadapu <[email protected]>

Add binding headers for lpasscc clocks to merge lpasscc clocks into
lpass_aon clk_regmap structure.

Signed-off-by: Mohammad Rafi Shaik <[email protected]>
Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
---
include/dt-bindings/clock/qcom,lpassaudiocc-sc7280.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/dt-bindings/clock/qcom,lpassaudiocc-sc7280.h b/include/dt-bindings/clock/qcom,lpassaudiocc-sc7280.h
index 22dcd47d4513..c72a98034d8b 100644
--- a/include/dt-bindings/clock/qcom,lpassaudiocc-sc7280.h
+++ b/include/dt-bindings/clock/qcom,lpassaudiocc-sc7280.h
@@ -41,6 +41,8 @@
#define LPASS_AON_CC_TX_MCLK_CLK 8
#define LPASS_AON_CC_TX_MCLK_RCG_CLK_SRC 9
#define LPASS_AON_CC_VA_MEM0_CLK 10
+#define LPASS_Q6_AHBM_CLK 11
+#define LPASS_Q6_AHBS_CLK 12

/* LPASS_AON_CC power domains */
#define LPASS_AON_CC_LPASS_AUDIO_HM_GDSC 0
--
2.25.1


2023-02-13 09:46:55

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v8 3/5] 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.
As the qdsp6ss clocks are being enabled in remoteproc driver, skip qdsp6ss
clock registration if "qcom,adsp-pil-mode" is enabled.

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

diff --git a/drivers/clk/qcom/lpasscc-sc7280.c b/drivers/clk/qcom/lpasscc-sc7280.c
index 5c1e17bd0d76..85dd5b9d64f0 100644
--- a/drivers/clk/qcom/lpasscc-sc7280.c
+++ b/drivers/clk/qcom/lpasscc-sc7280.c
@@ -118,12 +118,14 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev)
goto destroy_pm_clk;
}

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

lpass_regmap_config.name = "top_cc";
desc = &lpass_cc_top_sc7280_desc;
--
2.25.1


2023-02-13 09:47:00

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v8 4/5] clk: qcom: lpassaudiocc-sc7280: Merge AHB clocks into lpass_aon

From: Srinivasa Rao Mandadapu <[email protected]>

Merge AHBM and AHBS clocks into lpass_aon clk_regmap structure as they
are using same register space.
Modify AHB clocks explicit registration, from qcom_cc_probe to
com_cc_probe_by_index.
In existing implementation, Q6 AHB clocks and lpass_aon clocks are
being registered exclusively and overlapping if both of them are
to be used. The regmap region used by Q6 AHB clocks is <0x03389000 0x24>
and of lpass_aon clocks is <0x03380000 0x30000>.
This is required to avoid such overlapping and to register
Q6 AHB clocks and lpass_aon clocks simultaneously.

Fixes: 4ab43d171181 ("clk: qcom: Add lpass clock controller driver for SC7280")
Signed-off-by: Mohammad Rafi Shaik <[email protected]>
Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
Tested-by: Mohammad Rafi Shaik <[email protected]>
---
drivers/clk/qcom/lpassaudiocc-sc7280.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
index 1339f9211a14..533d68d80538 100644
--- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
+++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
@@ -660,6 +660,8 @@ static struct clk_regmap *lpass_aon_cc_sc7280_clocks[] = {
[LPASS_AON_CC_TX_MCLK_2X_CLK] = &lpass_aon_cc_tx_mclk_2x_clk.clkr,
[LPASS_AON_CC_TX_MCLK_CLK] = &lpass_aon_cc_tx_mclk_clk.clkr,
[LPASS_AON_CC_TX_MCLK_RCG_CLK_SRC] = &lpass_aon_cc_tx_mclk_rcg_clk_src.clkr,
+ [LPASS_Q6_AHBM_CLK] = &lpass_q6ss_ahbm_clk.clkr,
+ [LPASS_Q6_AHBS_CLK] = &lpass_q6ss_ahbs_clk.clkr,
};

static struct gdsc *lpass_aon_cc_sc7280_gdscs[] = {
@@ -828,8 +830,9 @@ static int lpass_aon_cc_sc7280_probe(struct platform_device *pdev)
if (of_property_read_bool(pdev->dev.of_node, "qcom,adsp-pil-mode")) {
lpass_audio_cc_sc7280_regmap_config.name = "cc";
desc = &lpass_cc_sc7280_desc;
- ret = qcom_cc_probe(pdev, desc);
- goto exit;
+ ret = qcom_cc_probe_by_index(pdev, 1, desc);
+ if (!ret)
+ goto exit;
}

lpass_audio_cc_sc7280_regmap_config.name = "lpasscc_aon";
--
2.25.1


2023-02-13 09:47:12

by Mohammad Rafi Shaik

[permalink] [raw]
Subject: [PATCH v8 5/5] clk: qcom: lpassaudiocc-sc7280: Skip lpass_aon_cc_pll config

From: Srinivasa Rao Mandadapu <[email protected]>

Skip lpass_aon_cc_pll configuration for ADSP based platforms
based on qcom,adsp-pil-mode property.
This is to avoid ADSP out of reset fail.

Signed-off-by: Mohammad Rafi Shaik <[email protected]>
Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
Tested-by: Mohammad Rafi Shaik <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
drivers/clk/qcom/lpassaudiocc-sc7280.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
index 533d68d80538..14ff6cb1c99b 100644
--- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
+++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
@@ -845,7 +845,13 @@ static int lpass_aon_cc_sc7280_probe(struct platform_device *pdev)
goto exit;
}

- clk_lucid_pll_configure(&lpass_aon_cc_pll, regmap, &lpass_aon_cc_pll_config);
+ /*
+ * ADSP firmware is in control of this PLL frequency when
+ * remoteproc is used. Skip frequency configuration in that
+ * case.
+ */
+ if (!of_property_read_bool(pdev->dev.of_node, "qcom,adsp-pil-mode"))
+ clk_lucid_pll_configure(&lpass_aon_cc_pll, regmap, &lpass_aon_cc_pll_config);

ret = qcom_cc_really_probe(pdev, &lpass_aon_cc_sc7280_desc, regmap);
if (ret) {
--
2.25.1


2023-02-13 12:20:32

by Krzysztof Kozlowski

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

On 13/02/2023 10:45, Mohammad Rafi Shaik wrote:
> 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: Mohammad Rafi Shaik <[email protected]>
> Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>

SoB chain looks not correct. Your should be after Srinivasa.



Best regards,
Krzysztof