Re: [RESEND v3 4/4] clk: qcom: lpasscc-sc7280: Add resets for audioreach

From: Srinivasa Rao Mandadapu
Date: Thu Jan 19 2023 - 01:03:31 EST



On 1/13/2023 1:05 AM, Stephen Boyd wrote:
Quoting Srinivasa Rao Mandadapu (2023-01-11 23:53:23)
On 1/12/2023 2:54 AM, Stephen Boyd wrote:
Thanks for your time Stephen!!!
Quoting Srinivasa Rao Mandadapu (2023-01-04 08:21:37)
diff --git a/drivers/clk/qcom/lpasscc-sc7280.c b/drivers/clk/qcom/lpasscc-sc7280.c
index 85dd5b9..1efb72d 100644
--- a/drivers/clk/qcom/lpasscc-sc7280.c
+++ b/drivers/clk/qcom/lpasscc-sc7280.c
@@ -102,6 +104,18 @@ static const struct qcom_cc_desc lpass_qdsp6ss_sc7280_desc = {
.num_clks = ARRAY_SIZE(lpass_qdsp6ss_sc7280_clocks),
};

+static const struct qcom_reset_map lpass_cc_sc7280_resets[] = {
+ [LPASS_AUDIO_SWR_RX_CGCR] = { 0xa0, 1 },
+ [LPASS_AUDIO_SWR_TX_CGCR] = { 0xa8, 1 },
+ [LPASS_AUDIO_SWR_WSA_CGCR] = { 0xb0, 1 },
Why are we adding these resets again? These are already exposed in
lpassaudiocc-sc7280.c
As explained in previous versions, legacy path nodes are not being used
in ADSP based platforms, due to conflicts.
What is legacy path nodes?
Legacy path nodes are for ADSP bypass use case such as nodes lpass_audiocc, lpass_core, etc.

Hence lpasscc node alone being used exclusively in ADSP based solution,
resets are added.
I think I understand..

In probe also, these reset controls are enabled based on
"qcom,adsp-pil-mode" property.

but now I'm super confused! Please help me! We shouldn't have two
different device nodes for the same physical hardware registers.
Instead, we should have one node. The "qcom,adsp-pil-mode" property was
supposed to indicate the different mode of operation.

Maybe the audio clk and reset drivers on sc7280 are duplicating each
other and one of them can be removed?

Yes agreed, that for controlling same registers from two different drivers is not good solution.

But, when we are validating ADSP solution, we have seen issues like ADSP is not coming out of reset with the existing bypass mode

clock drivers(lpassaudiocc_sc7280.c and lpasscoreecc_sc7280.c) enabled.

As per your suggestion, will try to address that  issues with "qcom,adsp-pil-mode" property and avoid duplicating reset control code

in lpasscc driver(lpasscc_sc7280.c).