Add resets and remove qdsp6ss clcok controller for audioreach based platforms.
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 | 21 ++++++++++++++++-----
drivers/clk/qcom/lpasscc-sc7280.c | 12 +++++++-----
.../dt-bindings/clock/qcom,lpassaudiocc-sc7280.h | 2 ++
4 files changed, 32 insertions(+), 10 deletions(-)
--
2.7.4
Add binding headers for lpasscc clocks to merge lpasscc clocks into
lpass_aon clk_regmap structure.
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 22dcd47..c72a980 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.7.4
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: 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 5c1e17b..85dd5b9 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.7.4
Merge AHBM and AHBS clocks into lpass_aon clk_regmap structure as they
are using same register space.
Add conditional check for doing Q6 AHB clocks registration only
if regname specified in device tree node.
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: Srinivasa Rao Mandadapu <[email protected]>
Tested-by: Mohammad Rafi Shaik <[email protected]>
---
drivers/clk/qcom/lpassaudiocc-sc7280.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
index 1339f92..8e2f433 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[] = {
@@ -819,6 +821,7 @@ static int lpass_aon_cc_sc7280_probe(struct platform_device *pdev)
{
const struct qcom_cc_desc *desc;
struct regmap *regmap;
+ struct resource *res;
int ret;
ret = lpass_audio_setup_runtime_pm(pdev);
@@ -826,10 +829,12 @@ static int lpass_aon_cc_sc7280_probe(struct platform_device *pdev)
return ret;
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;
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cc");
+ if (res) {
+ lpass_audio_cc_sc7280_regmap_config.name = "cc";
+ desc = &lpass_cc_sc7280_desc;
+ return qcom_cc_probe(pdev, desc);
+ }
}
lpass_audio_cc_sc7280_regmap_config.name = "lpasscc_aon";
--
2.7.4
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: Srinivasa Rao Mandadapu <[email protected]>
Tested-by: Mohammad Rafi Shaik <[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 8e2f433..76611a3 100644
--- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
+++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
@@ -847,7 +847,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.7.4
Quoting Srinivasa Rao Mandadapu (2023-02-01 22:17:32)
> Merge AHBM and AHBS clocks into lpass_aon clk_regmap structure as they
> are using same register space.
> Add conditional check for doing Q6 AHB clocks registration only
> if regname specified in device tree node.
> 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>
Add space ^
> 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.
The commit text is still really hard to read and understand what's going
on. Hopefully a binding update makes it clearer. It could also be
clarified by indicating the compatible string so we know what "Q6 AHB"
means or what "lpass_aon" means. Then we can grep the dtsi files for
those compatibles to better understand what is intended.
>
> Fixes: 4ab43d171181 ("clk: qcom: Add lpass clock controller driver for SC7280")
> Signed-off-by: Srinivasa Rao Mandadapu <[email protected]>
> Tested-by: Mohammad Rafi Shaik <[email protected]>
> ---
> drivers/clk/qcom/lpassaudiocc-sc7280.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
> index 1339f92..8e2f433 100644
> --- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
> +++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
> @@ -826,10 +829,12 @@ static int lpass_aon_cc_sc7280_probe(struct platform_device *pdev)
> return ret;
>
> 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;
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cc");
This should be index based and not reg-name based. Can you point me to
the binding update for "qcom,sc7280-lpassaoncc" compatible that supports
this?
> + if (res) {
> + lpass_audio_cc_sc7280_regmap_config.name = "cc";
> + desc = &lpass_cc_sc7280_desc;
> + return qcom_cc_probe(pdev, desc);
> + }
Quoting Srinivasa Rao Mandadapu (2023-02-01 22:17:33)
> 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: Srinivasa Rao Mandadapu <[email protected]>
> Tested-by: Mohammad Rafi Shaik <[email protected]>
> ---
Reviewed-by: Stephen Boyd <[email protected]>