diff mbox series

[v3,4/7] arm64: dts: qcom: sc7280: Update VA/RX/TX macro clock nodes

Message ID 1674131227-26456-5-git-send-email-quic_srivasam@quicinc.com (mailing list archive)
State Superseded
Headers show
Series Add SC7280 audioreach device tree nodes | expand

Commit Message

Srinivasa Rao Mandadapu Jan. 19, 2023, 12:27 p.m. UTC
Update VA, RX and TX macro and lpass_tlmm clock properties and
enable them.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Tested-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
---
 .../qcom/sc7280-herobrine-audioreach-wcd9385.dtsi  | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)

Comments

Krzysztof Kozlowski Jan. 19, 2023, 1:31 p.m. UTC | #1
On 19/01/2023 13:27, Srinivasa Rao Mandadapu wrote:
> Update VA, RX and TX macro and lpass_tlmm clock properties and
> enable them.

Everything is an update and this does not explain what exactly you are
updating in the nodes and why.

> 
> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
> Tested-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
> ---
>  .../qcom/sc7280-herobrine-audioreach-wcd9385.dtsi  | 59 ++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
> index 81e0f3a..674b01a 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
> @@ -8,8 +8,67 @@
>  
>  #include <dt-bindings/sound/qcom,q6afe.h>
>  
> +/delete-node/ &lpass_rx_macro;

Why?

> +/delete-node/ &lpass_tx_macro;
> +/delete-node/ &lpass_va_macro;
> +
>  /{
>  	/* BOARD-SPECIFIC TOP LEVEL NODES */
> +	lpass_rx_macro: codec@3200000 {
> +		compatible = "qcom,sc7280-lpass-rx-macro";
> +		reg = <0 0x03200000 0 0x1000>;

Why? They are the same.

> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&lpass_rx_swr_clk>, <&lpass_rx_swr_data>;

Still the same...

> +
> +		clocks = <&q6prmcc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
> +			 <&q6prmcc LPASS_CLK_ID_TX_CORE_NPL_MCLK  LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
> +			 <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
> +			 <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
> +			 <&lpass_va_macro>;
> +
> +		clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";

This is different...

> +
> +		#clock-cells = <0>;
> +		#sound-dai-cells = <1>;

But this not.


Best regards,
Krzysztof
Srinivasa Rao Mandadapu Jan. 20, 2023, 4:47 a.m. UTC | #2
On 1/19/2023 7:01 PM, Krzysztof Kozlowski wrote:
Thanks for your time Krzysztof!!!
> On 19/01/2023 13:27, Srinivasa Rao Mandadapu wrote:
>> Update VA, RX and TX macro and lpass_tlmm clock properties and
>> enable them.
> Everything is an update and this does not explain what exactly you are
> updating in the nodes and why.
>
>> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
>> Tested-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
>> ---
>>   .../qcom/sc7280-herobrine-audioreach-wcd9385.dtsi  | 59 ++++++++++++++++++++++
>>   1 file changed, 59 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>> index 81e0f3a..674b01a 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>> @@ -8,8 +8,67 @@
>>   
>>   #include <dt-bindings/sound/qcom,q6afe.h>
>>   
>> +/delete-node/ &lpass_rx_macro;
> Why?

Actually in SoC dtsi (sc7280.dtsi) power domains property used.

Which is not required for ADSP based solution. As there is no way to delete

individual property, deleting node and recreating it here.

>
>> +/delete-node/ &lpass_tx_macro;
>> +/delete-node/ &lpass_va_macro;
>> +
>>   /{
>>   	/* BOARD-SPECIFIC TOP LEVEL NODES */
>> +	lpass_rx_macro: codec@3200000 {
>> +		compatible = "qcom,sc7280-lpass-rx-macro";
>> +		reg = <0 0x03200000 0 0x1000>;
> Why? They are the same.
Explained above.
>
>> +
>> +		pinctrl-names = "default";
>> +		pinctrl-0 = <&lpass_rx_swr_clk>, <&lpass_rx_swr_data>;
> Still the same...
>
>> +
>> +		clocks = <&q6prmcc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
>> +			 <&q6prmcc LPASS_CLK_ID_TX_CORE_NPL_MCLK  LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
>> +			 <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
>> +			 <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
>> +			 <&lpass_va_macro>;
>> +
>> +		clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
> This is different...
>
>> +
>> +		#clock-cells = <0>;
>> +		#sound-dai-cells = <1>;
> But this not.
>
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Jan. 20, 2023, 6:24 a.m. UTC | #3
On 20/01/2023 05:47, Srinivasa Rao Mandadapu wrote:
> 
> On 1/19/2023 7:01 PM, Krzysztof Kozlowski wrote:
> Thanks for your time Krzysztof!!!
>> On 19/01/2023 13:27, Srinivasa Rao Mandadapu wrote:
>>> Update VA, RX and TX macro and lpass_tlmm clock properties and
>>> enable them.
>> Everything is an update and this does not explain what exactly you are
>> updating in the nodes and why.
>>
>>> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
>>> Tested-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
>>> ---
>>>   .../qcom/sc7280-herobrine-audioreach-wcd9385.dtsi  | 59 ++++++++++++++++++++++
>>>   1 file changed, 59 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>> index 81e0f3a..674b01a 100644
>>> --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>> @@ -8,8 +8,67 @@
>>>   
>>>   #include <dt-bindings/sound/qcom,q6afe.h>
>>>   
>>> +/delete-node/ &lpass_rx_macro;
>> Why?
> 
> Actually in SoC dtsi (sc7280.dtsi) power domains property used.
> 
> Which is not required for ADSP based solution. As there is no way to delete
> 
> individual property, deleting node and recreating it here.
> 

You can delete property - delete-property. However why in AudioReach
device comes without power domains? What does it mean "power domains
property is not required"? DTS describes the hardware and the rx macro
is powered, isn't it?

Best regards,
Krzysztof
Srinivasa Rao Mandadapu Jan. 20, 2023, 6:35 a.m. UTC | #4
On 1/20/2023 11:54 AM, Krzysztof Kozlowski wrote:
Thanks for your valuable suggestion Krzysztof!!!
> On 20/01/2023 05:47, Srinivasa Rao Mandadapu wrote:
>> On 1/19/2023 7:01 PM, Krzysztof Kozlowski wrote:
>> Thanks for your time Krzysztof!!!
>>> On 19/01/2023 13:27, Srinivasa Rao Mandadapu wrote:
>>>> Update VA, RX and TX macro and lpass_tlmm clock properties and
>>>> enable them.
>>> Everything is an update and this does not explain what exactly you are
>>> updating in the nodes and why.
>>>
>>>> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
>>>> Tested-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
>>>> ---
>>>>    .../qcom/sc7280-herobrine-audioreach-wcd9385.dtsi  | 59 ++++++++++++++++++++++
>>>>    1 file changed, 59 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>>> index 81e0f3a..674b01a 100644
>>>> --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>>> +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>>> @@ -8,8 +8,67 @@
>>>>    
>>>>    #include <dt-bindings/sound/qcom,q6afe.h>
>>>>    
>>>> +/delete-node/ &lpass_rx_macro;
>>> Why?
>> Actually in SoC dtsi (sc7280.dtsi) power domains property used.
>>
>> Which is not required for ADSP based solution. As there is no way to delete
>>
>> individual property, deleting node and recreating it here.
>>
> You can delete property - delete-property. However why in AudioReach
> device comes without power domains? What does it mean "power domains
> property is not required"? DTS describes the hardware and the rx macro
> is powered, isn't it?

Actually in case ADSP bypass solution power domains are handled in HLOS 
clock driver.

Whereas in ADSP based solution they are handled in ADSP firmware, and 
from HLOS

voted as clocks.

Below is the reference commit.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9e3d83c52844f955aa2975f78cee48bf9f72f5e1

>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Jan. 20, 2023, 8:04 a.m. UTC | #5
On 20/01/2023 07:35, Srinivasa Rao Mandadapu wrote:
> 
> On 1/20/2023 11:54 AM, Krzysztof Kozlowski wrote:
> Thanks for your valuable suggestion Krzysztof!!!
>> On 20/01/2023 05:47, Srinivasa Rao Mandadapu wrote:
>>> On 1/19/2023 7:01 PM, Krzysztof Kozlowski wrote:
>>> Thanks for your time Krzysztof!!!
>>>> On 19/01/2023 13:27, Srinivasa Rao Mandadapu wrote:
>>>>> Update VA, RX and TX macro and lpass_tlmm clock properties and
>>>>> enable them.
>>>> Everything is an update and this does not explain what exactly you are
>>>> updating in the nodes and why.
>>>>
>>>>> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
>>>>> Tested-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
>>>>> ---
>>>>>    .../qcom/sc7280-herobrine-audioreach-wcd9385.dtsi  | 59 ++++++++++++++++++++++
>>>>>    1 file changed, 59 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>>>> index 81e0f3a..674b01a 100644
>>>>> --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>>>> +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
>>>>> @@ -8,8 +8,67 @@
>>>>>    
>>>>>    #include <dt-bindings/sound/qcom,q6afe.h>
>>>>>    
>>>>> +/delete-node/ &lpass_rx_macro;
>>>> Why?
>>> Actually in SoC dtsi (sc7280.dtsi) power domains property used.
>>>
>>> Which is not required for ADSP based solution. As there is no way to delete
>>>
>>> individual property, deleting node and recreating it here.
>>>
>> You can delete property - delete-property. However why in AudioReach
>> device comes without power domains? What does it mean "power domains
>> property is not required"? DTS describes the hardware and the rx macro
>> is powered, isn't it?
> 
> Actually in case ADSP bypass solution power domains are handled in HLOS 
> clock driver.
> 
> Whereas in ADSP based solution they are handled in ADSP firmware, and 
> from HLOS
> 
> voted as clocks.
> 
> Below is the reference commit.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9e3d83c52844f955aa2975f78cee48bf9f72f5e1

I am sorry, but this is one big mess. Hardware is one. I understand that
Linux drivers can be entirely different but here - and in the past with
few clocks - the hardware description keeps changing depending on the
wishes of developers. That's not how bindings and DTS work. This suggest
that DTS is being pushed to satisfy driver needs, not to properly
describe the hardware. I am sorry, but hardware does not change.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
index 81e0f3a..674b01a 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audioreach-wcd9385.dtsi
@@ -8,8 +8,67 @@ 
 
 #include <dt-bindings/sound/qcom,q6afe.h>
 
+/delete-node/ &lpass_rx_macro;
+/delete-node/ &lpass_tx_macro;
+/delete-node/ &lpass_va_macro;
+
 /{
 	/* BOARD-SPECIFIC TOP LEVEL NODES */
+	lpass_rx_macro: codec@3200000 {
+		compatible = "qcom,sc7280-lpass-rx-macro";
+		reg = <0 0x03200000 0 0x1000>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&lpass_rx_swr_clk>, <&lpass_rx_swr_data>;
+
+		clocks = <&q6prmcc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_CLK_ID_TX_CORE_NPL_MCLK  LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&lpass_va_macro>;
+
+		clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
+
+		#clock-cells = <0>;
+		#sound-dai-cells = <1>;
+	};
+
+	lpass_tx_macro: codec@3220000 {
+		compatible = "qcom,sc7280-lpass-tx-macro";
+		reg = <0 0x03220000 0 0x1000>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&lpass_tx_swr_clk>, <&lpass_tx_swr_data>;
+
+		clocks = <&q6prmcc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_CLK_ID_TX_CORE_NPL_MCLK  LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&lpass_va_macro>;
+
+		clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
+
+		#clock-cells = <0>;
+		#sound-dai-cells = <1>;
+	};
+
+	lpass_va_macro: codec@3370000 {
+		compatible = "qcom,sc7280-lpass-va-macro";
+		reg = <0 0x03370000 0 0x1000>;
+
+		pinctrl-0 = <&lpass_dmic01_clk>, <&lpass_dmic01_data>;
+		pinctrl-names = "default";
+
+		clocks = <&q6prmcc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+			 <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+
+		clock-names = "mclk", "macro", "dcodec";
+
+		#clock-cells = <0>;
+		#sound-dai-cells = <1>;
+	};
+
 	sound: sound {
 		compatible = "google,sc7280-herobrine";
 		model = "SC7280-AUDIOREACH";