devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
@ 2025-05-02  1:15 Alexey Klimov
  2025-05-02  2:16 ` Dmitry Baryshkov
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Alexey Klimov @ 2025-05-02  1:15 UTC (permalink / raw)
  To: andersson, konradybcio, linux-arm-msm
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-kernel, srini,
	quic_ekangupt, krzysztof.kozlowski

While at this, also add required memory region for fastrpc.

Tested on sm8750-mtp device with adsprpdcd.

Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
Cc: Srinivas Kandagatla <srini@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
index 149d2ed17641..48ee66125a89 100644
--- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
@@ -7,6 +7,7 @@
 #include <dt-bindings/clock/qcom,sm8750-gcc.h>
 #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
 #include <dt-bindings/dma/qcom-gpi.h>
+#include <dt-bindings/firmware/qcom,scm.h>
 #include <dt-bindings/interconnect/qcom,icc.h>
 #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
 			reg = <0x0 0xff800000 0x0 0x800000>;
 			no-map;
 		};
+
+		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
+			compatible = "shared-dma-pool";
+			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
+			alignment = <0x0 0x400000>;
+			size = <0x0 0xc00000>;
+			reusable;
+		};
 	};
 
 	smp2p-adsp {
@@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
 						};
 					};
 				};
+
+				fastrpc {
+					compatible = "qcom,fastrpc";
+					qcom,glink-channels = "fastrpcglink-apps-dsp";
+					label = "adsp";
+					memory-region = <&adsp_rpc_remote_heap_mem>;
+					qcom,vmids = <QCOM_SCM_VMID_LPASS
+						      QCOM_SCM_VMID_ADSP_HEAP>;
+					qcom,non-secure-domain;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					compute-cb@3 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <3>;
+						iommus = <&apps_smmu 0x1003 0x80>,
+							 <&apps_smmu 0x1043 0x20>;
+						dma-coherent;
+					};
+
+					compute-cb@4 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <4>;
+						iommus = <&apps_smmu 0x1004 0x80>,
+							 <&apps_smmu 0x1044 0x20>;
+						dma-coherent;
+					};
+
+					compute-cb@5 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <5>;
+						iommus = <&apps_smmu 0x1005 0x80>,
+							 <&apps_smmu 0x1045 0x20>;
+						dma-coherent;
+					};
+
+					compute-cb@6 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <6>;
+						iommus = <&apps_smmu 0x1006 0x80>,
+							 <&apps_smmu 0x1046 0x20>;
+						dma-coherent;
+					};
+
+					compute-cb@7 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <7>;
+						iommus = <&apps_smmu 0x1007 0x40>,
+							 <&apps_smmu 0x1067 0x0>,
+							 <&apps_smmu 0x1087 0x0>;
+						dma-coherent;
+					};
+
+					compute-cb@8 {
+						compatible = "qcom,fastrpc-compute-cb";
+						reg = <8>;
+						iommus = <&apps_smmu 0x1008 0x80>,
+							 <&apps_smmu 0x1048 0x20>;
+						dma-coherent;
+					};
+				};
 			};
 		};
 
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-02  1:15 [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support Alexey Klimov
@ 2025-05-02  2:16 ` Dmitry Baryshkov
  2025-05-02  9:38 ` Konrad Dybcio
  2025-05-02 10:51 ` Srinivas Kandagatla
  2 siblings, 0 replies; 17+ messages in thread
From: Dmitry Baryshkov @ 2025-05-02  2:16 UTC (permalink / raw)
  To: Alexey Klimov
  Cc: andersson, konradybcio, linux-arm-msm, robh, krzk+dt, conor+dt,
	devicetree, linux-kernel, srini, quic_ekangupt,
	krzysztof.kozlowski

On Fri, May 02, 2025 at 02:15:39AM +0100, Alexey Klimov wrote:
> While at this, also add required memory region for fastrpc.
> 
> Tested on sm8750-mtp device with adsprpdcd.
> 
> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
> Cc: Srinivas Kandagatla <srini@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>  1 file changed, 70 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-02  1:15 [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support Alexey Klimov
  2025-05-02  2:16 ` Dmitry Baryshkov
@ 2025-05-02  9:38 ` Konrad Dybcio
  2025-05-08 22:20   ` Alexey Klimov
  2025-05-02 10:51 ` Srinivas Kandagatla
  2 siblings, 1 reply; 17+ messages in thread
From: Konrad Dybcio @ 2025-05-02  9:38 UTC (permalink / raw)
  To: Alexey Klimov, andersson, konradybcio, linux-arm-msm
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-kernel, srini,
	quic_ekangupt, krzysztof.kozlowski

On 5/2/25 3:15 AM, Alexey Klimov wrote:
> While at this, also add required memory region for fastrpc.
> 
> Tested on sm8750-mtp device with adsprpdcd.
> 
> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
> Cc: Srinivas Kandagatla <srini@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> index 149d2ed17641..48ee66125a89 100644
> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> @@ -7,6 +7,7 @@
>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>  #include <dt-bindings/dma/qcom-gpi.h>
> +#include <dt-bindings/firmware/qcom,scm.h>
>  #include <dt-bindings/interconnect/qcom,icc.h>
>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>  			reg = <0x0 0xff800000 0x0 0x800000>;
>  			no-map;
>  		};
> +
> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
> +			compatible = "shared-dma-pool";
> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
> +			alignment = <0x0 0x400000>;
> +			size = <0x0 0xc00000>;
> +			reusable;
> +		};
>  	};
>  
>  	smp2p-adsp {
> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>  						};
>  					};
>  				};
> +
> +				fastrpc {
> +					compatible = "qcom,fastrpc";
> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
> +					label = "adsp";
> +					memory-region = <&adsp_rpc_remote_heap_mem>;

IIUC the driver only considers this on the sensor DSP

Konrad

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-02  1:15 [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support Alexey Klimov
  2025-05-02  2:16 ` Dmitry Baryshkov
  2025-05-02  9:38 ` Konrad Dybcio
@ 2025-05-02 10:51 ` Srinivas Kandagatla
  2025-05-09 13:16   ` Alexey Klimov
  2 siblings, 1 reply; 17+ messages in thread
From: Srinivas Kandagatla @ 2025-05-02 10:51 UTC (permalink / raw)
  To: Alexey Klimov, andersson, konradybcio, linux-arm-msm
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-kernel, srini,
	quic_ekangupt, krzysztof.kozlowski

On 5/2/25 02:15, Alexey Klimov wrote:
> While at this, also add required memory region for fastrpc.
> 
> Tested on sm8750-mtp device with adsprpdcd.
> 
> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
> Cc: Srinivas Kandagatla <srini@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> index 149d2ed17641..48ee66125a89 100644
> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> @@ -7,6 +7,7 @@
>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>  #include <dt-bindings/dma/qcom-gpi.h>
> +#include <dt-bindings/firmware/qcom,scm.h>
>  #include <dt-bindings/interconnect/qcom,icc.h>
>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>  			reg = <0x0 0xff800000 0x0 0x800000>;
>  			no-map;
>  		};
> +
> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
> +			compatible = "shared-dma-pool";
> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
> +			alignment = <0x0 0x400000>;
> +			size = <0x0 0xc00000>;
> +			reusable;
> +		};
>  	};
>  
>  	smp2p-adsp {
> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>  						};
>  					};
>  				};
> +
> +				fastrpc {
> +					compatible = "qcom,fastrpc";
> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
> +					label = "adsp";
> +					memory-region = <&adsp_rpc_remote_heap_mem>;
> +					qcom,vmids = <QCOM_SCM_VMID_LPASS
> +						      QCOM_SCM_VMID_ADSP_HEAP>;
> +					qcom,non-secure-domain;

Any reason why we what to mark adsp as non-secure domain by default?

--srini

> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +
> +					compute-cb@3 {
> +						compatible = "qcom,fastrpc-compute-cb";
> +						reg = <3>;
> +						iommus = <&apps_smmu 0x1003 0x80>,
> +							 <&apps_smmu 0x1043 0x20>;
> +						dma-coherent;
> +					};
> +
> +					compute-cb@4 {
> +						compatible = "qcom,fastrpc-compute-cb";
> +						reg = <4>;
> +						iommus = <&apps_smmu 0x1004 0x80>,
> +							 <&apps_smmu 0x1044 0x20>;
> +						dma-coherent;
> +					};
> +
> +					compute-cb@5 {
> +						compatible = "qcom,fastrpc-compute-cb";
> +						reg = <5>;
> +						iommus = <&apps_smmu 0x1005 0x80>,
> +							 <&apps_smmu 0x1045 0x20>;
> +						dma-coherent;
> +					};
> +
> +					compute-cb@6 {
> +						compatible = "qcom,fastrpc-compute-cb";
> +						reg = <6>;
> +						iommus = <&apps_smmu 0x1006 0x80>,
> +							 <&apps_smmu 0x1046 0x20>;
> +						dma-coherent;
> +					};
> +
> +					compute-cb@7 {
> +						compatible = "qcom,fastrpc-compute-cb";
> +						reg = <7>;
> +						iommus = <&apps_smmu 0x1007 0x40>,
> +							 <&apps_smmu 0x1067 0x0>,
> +							 <&apps_smmu 0x1087 0x0>;
> +						dma-coherent;
> +					};
> +
> +					compute-cb@8 {
> +						compatible = "qcom,fastrpc-compute-cb";
> +						reg = <8>;
> +						iommus = <&apps_smmu 0x1008 0x80>,
> +							 <&apps_smmu 0x1048 0x20>;
> +						dma-coherent;
> +					};
> +				};
>  			};
>  		};
>  


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-02  9:38 ` Konrad Dybcio
@ 2025-05-08 22:20   ` Alexey Klimov
  2025-05-08 22:57     ` Konrad Dybcio
  0 siblings, 1 reply; 17+ messages in thread
From: Alexey Klimov @ 2025-05-08 22:20 UTC (permalink / raw)
  To: Konrad Dybcio, andersson, konradybcio, linux-arm-msm
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-kernel, srini,
	quic_ekangupt, krzysztof.kozlowski

On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>> While at this, also add required memory region for fastrpc.
>> 
>> Tested on sm8750-mtp device with adsprpdcd.
>> 
>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>> Cc: Srinivas Kandagatla <srini@kernel.org>
>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>> ---
>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>  1 file changed, 70 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>> index 149d2ed17641..48ee66125a89 100644
>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>> @@ -7,6 +7,7 @@
>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>  #include <dt-bindings/dma/qcom-gpi.h>
>> +#include <dt-bindings/firmware/qcom,scm.h>
>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>  			no-map;
>>  		};
>> +
>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>> +			compatible = "shared-dma-pool";
>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>> +			alignment = <0x0 0x400000>;
>> +			size = <0x0 0xc00000>;
>> +			reusable;
>> +		};
>>  	};
>>  
>>  	smp2p-adsp {
>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>  						};
>>  					};
>>  				};
>> +
>> +				fastrpc {
>> +					compatible = "qcom,fastrpc";
>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>> +					label = "adsp";
>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>
> IIUC the driver only considers this on the sensor DSP

Memory region is required for audio protection domain + adsprpdcd as far as I know.

Thanks,
Alexey

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-08 22:20   ` Alexey Klimov
@ 2025-05-08 22:57     ` Konrad Dybcio
  2025-05-09  3:42       ` Ekansh Gupta
  0 siblings, 1 reply; 17+ messages in thread
From: Konrad Dybcio @ 2025-05-08 22:57 UTC (permalink / raw)
  To: Alexey Klimov, andersson, konradybcio, linux-arm-msm
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-kernel, srini,
	quic_ekangupt, krzysztof.kozlowski

On 5/9/25 12:20 AM, Alexey Klimov wrote:
> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>>> While at this, also add required memory region for fastrpc.
>>>
>>> Tested on sm8750-mtp device with adsprpdcd.
>>>
>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>> ---
>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>  1 file changed, 70 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>> index 149d2ed17641..48ee66125a89 100644
>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>> @@ -7,6 +7,7 @@
>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>>  #include <dt-bindings/dma/qcom-gpi.h>
>>> +#include <dt-bindings/firmware/qcom,scm.h>
>>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>>  			no-map;
>>>  		};
>>> +
>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>>> +			compatible = "shared-dma-pool";
>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>>> +			alignment = <0x0 0x400000>;
>>> +			size = <0x0 0xc00000>;
>>> +			reusable;
>>> +		};
>>>  	};
>>>  
>>>  	smp2p-adsp {
>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>>  						};
>>>  					};
>>>  				};
>>> +
>>> +				fastrpc {
>>> +					compatible = "qcom,fastrpc";
>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>>> +					label = "adsp";
>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>>
>> IIUC the driver only considers this on the sensor DSP
> 
> Memory region is required for audio protection domain + adsprpdcd as far as I know.

next-20250508

rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
	// ...
}

maybe some driver changes are still pending?

Konrad

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-08 22:57     ` Konrad Dybcio
@ 2025-05-09  3:42       ` Ekansh Gupta
  2025-05-09 19:49         ` Dmitry Baryshkov
  2025-05-13 13:09         ` Konrad Dybcio
  0 siblings, 2 replies; 17+ messages in thread
From: Ekansh Gupta @ 2025-05-09  3:42 UTC (permalink / raw)
  To: Konrad Dybcio, Alexey Klimov, andersson, konradybcio,
	linux-arm-msm
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-kernel, srini,
	quic_ekangupt, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)



On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
> On 5/9/25 12:20 AM, Alexey Klimov wrote:
>> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
>>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>>>> While at this, also add required memory region for fastrpc.
>>>>
>>>> Tested on sm8750-mtp device with adsprpdcd.
>>>>
>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>>> ---
>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>>  1 file changed, 70 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>> index 149d2ed17641..48ee66125a89 100644
>>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>> @@ -7,6 +7,7 @@
>>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>>>  #include <dt-bindings/dma/qcom-gpi.h>
>>>> +#include <dt-bindings/firmware/qcom,scm.h>
>>>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>>>  			no-map;
>>>>  		};
>>>> +
>>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>>>> +			compatible = "shared-dma-pool";
>>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>>>> +			alignment = <0x0 0x400000>;
>>>> +			size = <0x0 0xc00000>;
>>>> +			reusable;
>>>> +		};
>>>>  	};
>>>>  
>>>>  	smp2p-adsp {
>>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>>>  						};
>>>>  					};
>>>>  				};
>>>> +
>>>> +				fastrpc {
>>>> +					compatible = "qcom,fastrpc";
>>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>>>> +					label = "adsp";
>>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>>> IIUC the driver only considers this on the sensor DSP
>> Memory region is required for audio protection domain + adsprpdcd as far as I know.
> next-20250508
>
> rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
> if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
> 	// ...
> }
>
> maybe some driver changes are still pending?

Would like to add some more details here:

Memory region is required for audio PD for dynamic loading and remote heap memory
requirements. Some initial memory(~2MB) is allocated initially when audio daemon
is getting attached[1] and this memory is added to audio PD memory pool.

Additionally, if there is some additional memory requirement from audio PD, the
PD can request for more memory using remote heap request[2]

The support for SDSP was added sometime back[3] to support SDSP usecases on some old
platform as there were no dedicated context banks for SDSP there. On recent platforms,
context banks are available wherever SDSP is supported. 

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a

//Ekansh

>
> Konrad
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-02 10:51 ` Srinivas Kandagatla
@ 2025-05-09 13:16   ` Alexey Klimov
  2025-05-09 13:31     ` Srinivas Kandagatla
  0 siblings, 1 reply; 17+ messages in thread
From: Alexey Klimov @ 2025-05-09 13:16 UTC (permalink / raw)
  To: Srinivas Kandagatla, ekansh.gupta, linux-arm-msm
  Cc: andersson, konradybcio, robh, krzk+dt, conor+dt, devicetree,
	linux-kernel, srini, quic_ekangupt, krzysztof.kozlowski

On Fri May 2, 2025 at 11:51 AM BST, Srinivas Kandagatla wrote:
> On 5/2/25 02:15, Alexey Klimov wrote:
>> While at this, also add required memory region for fastrpc.
>> 
>> Tested on sm8750-mtp device with adsprpdcd.
>> 
>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>> Cc: Srinivas Kandagatla <srini@kernel.org>
>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>> ---
>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>  1 file changed, 70 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>> index 149d2ed17641..48ee66125a89 100644
>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>> @@ -7,6 +7,7 @@
>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>  #include <dt-bindings/dma/qcom-gpi.h>
>> +#include <dt-bindings/firmware/qcom,scm.h>
>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>  			no-map;
>>  		};
>> +
>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>> +			compatible = "shared-dma-pool";
>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>> +			alignment = <0x0 0x400000>;
>> +			size = <0x0 0xc00000>;
>> +			reusable;
>> +		};
>>  	};
>>  
>>  	smp2p-adsp {
>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>  						};
>>  					};
>>  				};
>> +
>> +				fastrpc {
>> +					compatible = "qcom,fastrpc";
>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>> +					label = "adsp";
>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>> +					qcom,vmids = <QCOM_SCM_VMID_LPASS
>> +						      QCOM_SCM_VMID_ADSP_HEAP>;
>> +					qcom,non-secure-domain;
>
> Any reason why we what to mark adsp as non-secure domain by default?

No particular reason. That's what we went with on other platforms, so this just follows
the same. If we need to update this flag to secure then most likely that should be done
for some other platforms as well.
The only thing I know that adsprpcd + audio pd works with non-secure flag.
I can try to re-test with secure flag.

Ekansh, do we have any preference here regarding this?

Best regards,
Alexey

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-09 13:16   ` Alexey Klimov
@ 2025-05-09 13:31     ` Srinivas Kandagatla
  2025-05-09 18:02       ` Ekansh Gupta
  0 siblings, 1 reply; 17+ messages in thread
From: Srinivas Kandagatla @ 2025-05-09 13:31 UTC (permalink / raw)
  To: Alexey Klimov, ekansh.gupta, linux-arm-msm
  Cc: andersson, konradybcio, robh, krzk+dt, conor+dt, devicetree,
	linux-kernel, srini, quic_ekangupt, krzysztof.kozlowski

On 5/9/25 14:16, Alexey Klimov wrote:
> On Fri May 2, 2025 at 11:51 AM BST, Srinivas Kandagatla wrote:
>> On 5/2/25 02:15, Alexey Klimov wrote:
>>> While at this, also add required memory region for fastrpc.
>>>
>>> Tested on sm8750-mtp device with adsprpdcd.
>>>
>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>> ---
>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>  1 file changed, 70 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>> index 149d2ed17641..48ee66125a89 100644
>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>> @@ -7,6 +7,7 @@
>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>>  #include <dt-bindings/dma/qcom-gpi.h>
>>> +#include <dt-bindings/firmware/qcom,scm.h>
>>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>>  			no-map;
>>>  		};
>>> +
>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>>> +			compatible = "shared-dma-pool";
>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>>> +			alignment = <0x0 0x400000>;
>>> +			size = <0x0 0xc00000>;
>>> +			reusable;
>>> +		};
>>>  	};
>>>  
>>>  	smp2p-adsp {
>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>>  						};
>>>  					};
>>>  				};
>>> +
>>> +				fastrpc {
>>> +					compatible = "qcom,fastrpc";
>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>>> +					label = "adsp";
>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>>> +					qcom,vmids = <QCOM_SCM_VMID_LPASS
>>> +						      QCOM_SCM_VMID_ADSP_HEAP>;
>>> +					qcom,non-secure-domain;
>>
>> Any reason why we what to mark adsp as non-secure domain by default?
> 
> No particular reason. That's what we went with on other platforms, so this just follows
> the same. If we need to update this flag to secure then most likely that should be done
> for some other platforms as well.
> The only thing I know that adsprpcd + audio pd works with non-secure flag.
> I can try to re-test with secure flag.
> 
I know that this is loosely enforced in the current state.
We want adsp to be always in secure mode as it will have access to some
of the IP blocks inside the DSP other than just hexagon compute.


> Ekansh, do we have any preference here regarding this?

@Ekansh, we should provide that clarity in dt bindings.

--srini
> 
> Best regards,
> Alexey


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-09 13:31     ` Srinivas Kandagatla
@ 2025-05-09 18:02       ` Ekansh Gupta
  0 siblings, 0 replies; 17+ messages in thread
From: Ekansh Gupta @ 2025-05-09 18:02 UTC (permalink / raw)
  To: Srinivas Kandagatla, Alexey Klimov, linux-arm-msm
  Cc: andersson, konradybcio, robh, krzk+dt, conor+dt, devicetree,
	linux-kernel, srini, quic_ekangupt, krzysztof.kozlowski



On 5/9/2025 7:01 PM, Srinivas Kandagatla wrote:
> On 5/9/25 14:16, Alexey Klimov wrote:
>> On Fri May 2, 2025 at 11:51 AM BST, Srinivas Kandagatla wrote:
>>> On 5/2/25 02:15, Alexey Klimov wrote:
>>>> While at this, also add required memory region for fastrpc.
>>>>
>>>> Tested on sm8750-mtp device with adsprpdcd.
>>>>
>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>>> ---
>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>>  1 file changed, 70 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>> index 149d2ed17641..48ee66125a89 100644
>>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>> @@ -7,6 +7,7 @@
>>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>>>  #include <dt-bindings/dma/qcom-gpi.h>
>>>> +#include <dt-bindings/firmware/qcom,scm.h>
>>>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>>>  			no-map;
>>>>  		};
>>>> +
>>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>>>> +			compatible = "shared-dma-pool";
>>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>>>> +			alignment = <0x0 0x400000>;
>>>> +			size = <0x0 0xc00000>;
>>>> +			reusable;
>>>> +		};
>>>>  	};
>>>>  
>>>>  	smp2p-adsp {
>>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>>>  						};
>>>>  					};
>>>>  				};
>>>> +
>>>> +				fastrpc {
>>>> +					compatible = "qcom,fastrpc";
>>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>>>> +					label = "adsp";
>>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>>>> +					qcom,vmids = <QCOM_SCM_VMID_LPASS
>>>> +						      QCOM_SCM_VMID_ADSP_HEAP>;
>>>> +					qcom,non-secure-domain;
>>> Any reason why we what to mark adsp as non-secure domain by default?
>> No particular reason. That's what we went with on other platforms, so this just follows
>> the same. If we need to update this flag to secure then most likely that should be done
>> for some other platforms as well.
>> The only thing I know that adsprpcd + audio pd works with non-secure flag.
>> I can try to re-test with secure flag.
>>
> I know that this is loosely enforced in the current state.
> We want adsp to be always in secure mode as it will have access to some
> of the IP blocks inside the DSP other than just hexagon compute.
>
>
>> Ekansh, do we have any preference here regarding this?
> @Ekansh, we should provide that clarity in dt bindings.

qcom,non-secure-domain should actually represent the DSPs supporting
unsigned PD(low privileged) and secure only supports Signed PD(privileged).
I had added some details here[1] also.

I agree with Srini's point about providing clarity in dt bindings for this
property. I'll send some changes for this.

[1] https://lore.kernel.org/all/412fe24e-ce70-4733-ace5-d3fbe43476c4@oss.qualcomm.com/

//Ekansh

>
> --srini
>> Best regards,
>> Alexey


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-09  3:42       ` Ekansh Gupta
@ 2025-05-09 19:49         ` Dmitry Baryshkov
  2025-05-12  3:55           ` Ekansh Gupta
  2025-05-13 13:09         ` Konrad Dybcio
  1 sibling, 1 reply; 17+ messages in thread
From: Dmitry Baryshkov @ 2025-05-09 19:49 UTC (permalink / raw)
  To: Ekansh Gupta
  Cc: Konrad Dybcio, Alexey Klimov, andersson, konradybcio,
	linux-arm-msm, robh, krzk+dt, conor+dt, devicetree, linux-kernel,
	srini, quic_ekangupt, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)

On Fri, May 09, 2025 at 09:12:30AM +0530, Ekansh Gupta wrote:
> 
> 
> On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
> > On 5/9/25 12:20 AM, Alexey Klimov wrote:
> >> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
> >>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
> >>>> While at this, also add required memory region for fastrpc.
> >>>>
> >>>> Tested on sm8750-mtp device with adsprpdcd.
> >>>>
> >>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
> >>>> Cc: Srinivas Kandagatla <srini@kernel.org>
> >>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> >>>> ---
> >>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
> >>>>  1 file changed, 70 insertions(+)
> >>>>
> >>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> >>>> index 149d2ed17641..48ee66125a89 100644
> >>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
> >>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> >>>> @@ -7,6 +7,7 @@
> >>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
> >>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
> >>>>  #include <dt-bindings/dma/qcom-gpi.h>
> >>>> +#include <dt-bindings/firmware/qcom,scm.h>
> >>>>  #include <dt-bindings/interconnect/qcom,icc.h>
> >>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
> >>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> >>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
> >>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
> >>>>  			no-map;
> >>>>  		};
> >>>> +
> >>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
> >>>> +			compatible = "shared-dma-pool";
> >>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
> >>>> +			alignment = <0x0 0x400000>;
> >>>> +			size = <0x0 0xc00000>;
> >>>> +			reusable;
> >>>> +		};
> >>>>  	};
> >>>>  
> >>>>  	smp2p-adsp {
> >>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
> >>>>  						};
> >>>>  					};
> >>>>  				};
> >>>> +
> >>>> +				fastrpc {
> >>>> +					compatible = "qcom,fastrpc";
> >>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
> >>>> +					label = "adsp";
> >>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
> >>> IIUC the driver only considers this on the sensor DSP
> >> Memory region is required for audio protection domain + adsprpdcd as far as I know.
> > next-20250508
> >
> > rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
> > if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
> > 	// ...
> > }
> >
> > maybe some driver changes are still pending?
> 
> Would like to add some more details here:
> 
> Memory region is required for audio PD for dynamic loading and remote heap memory
> requirements. Some initial memory(~2MB) is allocated initially when audio daemon
> is getting attached[1] and this memory is added to audio PD memory pool.

How is being handled for the audio PD case? Could you please point it
out in? Currently, as Konrad pointed out, it is only being used for
Sensors domain (unless I miss some obvious usage handled by the core).

> 
> Additionally, if there is some additional memory requirement from audio PD, the
> PD can request for more memory using remote heap request[2]
> 
> The support for SDSP was added sometime back[3] to support SDSP usecases on some old
> platform as there were no dedicated context banks for SDSP there. On recent platforms,
> context banks are available wherever SDSP is supported. 
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a
> 
> //Ekansh
> 
> >
> > Konrad
> >
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-09 19:49         ` Dmitry Baryshkov
@ 2025-05-12  3:55           ` Ekansh Gupta
  2025-05-12 15:55             ` Dmitry Baryshkov
  0 siblings, 1 reply; 17+ messages in thread
From: Ekansh Gupta @ 2025-05-12  3:55 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Konrad Dybcio, Alexey Klimov, andersson, konradybcio,
	linux-arm-msm, robh, krzk+dt, conor+dt, devicetree, linux-kernel,
	srini, quic_ekangupt, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)



On 5/10/2025 1:19 AM, Dmitry Baryshkov wrote:
> On Fri, May 09, 2025 at 09:12:30AM +0530, Ekansh Gupta wrote:
>>
>> On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
>>> On 5/9/25 12:20 AM, Alexey Klimov wrote:
>>>> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
>>>>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>>>>>> While at this, also add required memory region for fastrpc.
>>>>>>
>>>>>> Tested on sm8750-mtp device with adsprpdcd.
>>>>>>
>>>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>>>>> ---
>>>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>>>>  1 file changed, 70 insertions(+)
>>>>>>
>>>>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>>> index 149d2ed17641..48ee66125a89 100644
>>>>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>>> @@ -7,6 +7,7 @@
>>>>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>>>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>>>>>  #include <dt-bindings/dma/qcom-gpi.h>
>>>>>> +#include <dt-bindings/firmware/qcom,scm.h>
>>>>>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>>>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>>>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>>>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>>>>>  			no-map;
>>>>>>  		};
>>>>>> +
>>>>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>>>>>> +			compatible = "shared-dma-pool";
>>>>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>>>>>> +			alignment = <0x0 0x400000>;
>>>>>> +			size = <0x0 0xc00000>;
>>>>>> +			reusable;
>>>>>> +		};
>>>>>>  	};
>>>>>>  
>>>>>>  	smp2p-adsp {
>>>>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>>>>>  						};
>>>>>>  					};
>>>>>>  				};
>>>>>> +
>>>>>> +				fastrpc {
>>>>>> +					compatible = "qcom,fastrpc";
>>>>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>>>>>> +					label = "adsp";
>>>>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>>>>> IIUC the driver only considers this on the sensor DSP
>>>> Memory region is required for audio protection domain + adsprpdcd as far as I know.
>>> next-20250508
>>>
>>> rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
>>> if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
>>> 	// ...
>>> }
>>>
>>> maybe some driver changes are still pending?
>> Would like to add some more details here:
>>
>> Memory region is required for audio PD for dynamic loading and remote heap memory
>> requirements. Some initial memory(~2MB) is allocated initially when audio daemon
>> is getting attached[1] and this memory is added to audio PD memory pool.
> How is being handled for the audio PD case? Could you please point it
> out in? Currently, as Konrad pointed out, it is only being used for
> Sensors domain (unless I miss some obvious usage handled by the core).

The reserved-memory support was actually first added for audio PD only[1].

The usage of reserved-memory is audio PD:

This memory is used by audio PD for it's dynamic loading and remote heap
requirements as I had mentioned earlier. I'll give more details here:
When audio PD starts, it expects some initial memory for it's dynamic
loading and other allocation requirements. To fulfill this, the audio
daemon allocates[2] some initial memory(~2MB) and moves the ownership to
the audio specific VMIDs that are configured in DT[3]. Audio PD then uses
this memory for it's initial operations. If there is any more memory
needed, audio PD makes a request to allocate memory from HLOS which is
again allocated from the same region[4] and then the ownership is moved
to the configured VMIDs[5].

The sensors domain that you are pointing was an extension of this and as
pointed earlier, it was added to support SDSP use cases on some old platform
where there are no dedicated SDSP context banks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=1ce91d45ba77a4f6bf9209d142d5c89c42cf877a
[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1274
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/qcom/sa8775p.dtsi#n5334
[4] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
[5] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1927

//Ekansh

>
>> Additionally, if there is some additional memory requirement from audio PD, the
>> PD can request for more memory using remote heap request[2]
>>
>> The support for SDSP was added sometime back[3] to support SDSP usecases on some old
>> platform as there were no dedicated context banks for SDSP there. On recent platforms,
>> context banks are available wherever SDSP is supported. 
>>
>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
>> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a
>>
>> //Ekansh
>>
>>> Konrad
>>>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-12  3:55           ` Ekansh Gupta
@ 2025-05-12 15:55             ` Dmitry Baryshkov
  2025-05-13  5:58               ` Ekansh Gupta
  0 siblings, 1 reply; 17+ messages in thread
From: Dmitry Baryshkov @ 2025-05-12 15:55 UTC (permalink / raw)
  To: Ekansh Gupta
  Cc: Konrad Dybcio, Alexey Klimov, andersson, konradybcio,
	linux-arm-msm, robh, krzk+dt, conor+dt, devicetree, linux-kernel,
	srini, quic_ekangupt, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)

On Mon, May 12, 2025 at 09:25:13AM +0530, Ekansh Gupta wrote:
> 
> 
> On 5/10/2025 1:19 AM, Dmitry Baryshkov wrote:
> > On Fri, May 09, 2025 at 09:12:30AM +0530, Ekansh Gupta wrote:
> >>
> >> On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
> >>> On 5/9/25 12:20 AM, Alexey Klimov wrote:
> >>>> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
> >>>>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
> >>>>>> While at this, also add required memory region for fastrpc.
> >>>>>>
> >>>>>> Tested on sm8750-mtp device with adsprpdcd.
> >>>>>>
> >>>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
> >>>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
> >>>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> >>>>>> ---
> >>>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
> >>>>>>  1 file changed, 70 insertions(+)
> >>>>>>
> >>>>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> >>>>>> index 149d2ed17641..48ee66125a89 100644
> >>>>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
> >>>>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> >>>>>> @@ -7,6 +7,7 @@
> >>>>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
> >>>>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
> >>>>>>  #include <dt-bindings/dma/qcom-gpi.h>
> >>>>>> +#include <dt-bindings/firmware/qcom,scm.h>
> >>>>>>  #include <dt-bindings/interconnect/qcom,icc.h>
> >>>>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
> >>>>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> >>>>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
> >>>>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
> >>>>>>  			no-map;
> >>>>>>  		};
> >>>>>> +
> >>>>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
> >>>>>> +			compatible = "shared-dma-pool";
> >>>>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
> >>>>>> +			alignment = <0x0 0x400000>;
> >>>>>> +			size = <0x0 0xc00000>;
> >>>>>> +			reusable;
> >>>>>> +		};
> >>>>>>  	};
> >>>>>>  
> >>>>>>  	smp2p-adsp {
> >>>>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
> >>>>>>  						};
> >>>>>>  					};
> >>>>>>  				};
> >>>>>> +
> >>>>>> +				fastrpc {
> >>>>>> +					compatible = "qcom,fastrpc";
> >>>>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
> >>>>>> +					label = "adsp";
> >>>>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
> >>>>> IIUC the driver only considers this on the sensor DSP
> >>>> Memory region is required for audio protection domain + adsprpdcd as far as I know.
> >>> next-20250508
> >>>
> >>> rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
> >>> if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
> >>> 	// ...
> >>> }
> >>>
> >>> maybe some driver changes are still pending?
> >> Would like to add some more details here:
> >>
> >> Memory region is required for audio PD for dynamic loading and remote heap memory
> >> requirements. Some initial memory(~2MB) is allocated initially when audio daemon
> >> is getting attached[1] and this memory is added to audio PD memory pool.
> > How is being handled for the audio PD case? Could you please point it
> > out in? Currently, as Konrad pointed out, it is only being used for
> > Sensors domain (unless I miss some obvious usage handled by the core).
> 
> The reserved-memory support was actually first added for audio PD only[1].

Okay, so it uses an API which I missed, excuse me. But then... How does
it work? of_reserved_mem_device_init_by_idx() requires
rmem->ops->device_init() to be present, which is not set for a
reserved-memory nodes without a compat string. However on all two and a
half platforms where I see the ADSP remote heap, it is declared without
extra compat.

> 
> The usage of reserved-memory is audio PD:
> 
> This memory is used by audio PD for it's dynamic loading and remote heap
> requirements as I had mentioned earlier. I'll give more details here:
> When audio PD starts, it expects some initial memory for it's dynamic
> loading and other allocation requirements. To fulfill this, the audio
> daemon allocates[2] some initial memory(~2MB) and moves the ownership to
> the audio specific VMIDs that are configured in DT[3]. Audio PD then uses
> this memory for it's initial operations. If there is any more memory
> needed, audio PD makes a request to allocate memory from HLOS which is
> again allocated from the same region[4] and then the ownership is moved
> to the configured VMIDs[5].
> 
> The sensors domain that you are pointing was an extension of this and as
> pointed earlier, it was added to support SDSP use cases on some old platform
> where there are no dedicated SDSP context banks.
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=1ce91d45ba77a4f6bf9209d142d5c89c42cf877a
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1274
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/qcom/sa8775p.dtsi#n5334
> [4] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
> [5] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1927
> 
> //Ekansh
> 
> >
> >> Additionally, if there is some additional memory requirement from audio PD, the
> >> PD can request for more memory using remote heap request[2]
> >>
> >> The support for SDSP was added sometime back[3] to support SDSP usecases on some old
> >> platform as there were no dedicated context banks for SDSP there. On recent platforms,
> >> context banks are available wherever SDSP is supported. 
> >>
> >> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
> >> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
> >> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a
> >>
> >> //Ekansh
> >>
> >>> Konrad
> >>>
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-12 15:55             ` Dmitry Baryshkov
@ 2025-05-13  5:58               ` Ekansh Gupta
  0 siblings, 0 replies; 17+ messages in thread
From: Ekansh Gupta @ 2025-05-13  5:58 UTC (permalink / raw)
  To: Dmitry Baryshkov, Ekansh Gupta
  Cc: Konrad Dybcio, Alexey Klimov, andersson, konradybcio,
	linux-arm-msm, robh, krzk+dt, conor+dt, devicetree, linux-kernel,
	srini, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)



On 5/12/2025 9:25 PM, Dmitry Baryshkov wrote:
> On Mon, May 12, 2025 at 09:25:13AM +0530, Ekansh Gupta wrote:
>>
>> On 5/10/2025 1:19 AM, Dmitry Baryshkov wrote:
>>> On Fri, May 09, 2025 at 09:12:30AM +0530, Ekansh Gupta wrote:
>>>> On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
>>>>> On 5/9/25 12:20 AM, Alexey Klimov wrote:
>>>>>> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
>>>>>>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>>>>>>>> While at this, also add required memory region for fastrpc.
>>>>>>>>
>>>>>>>> Tested on sm8750-mtp device with adsprpdcd.
>>>>>>>>
>>>>>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>>>>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>>>>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>>>>>>> ---
>>>>>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>>>>>>  1 file changed, 70 insertions(+)
>>>>>>>>
>>>>>>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>>>>> index 149d2ed17641..48ee66125a89 100644
>>>>>>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>>>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>>>>> @@ -7,6 +7,7 @@
>>>>>>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>>>>>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>>>>>>>  #include <dt-bindings/dma/qcom-gpi.h>
>>>>>>>> +#include <dt-bindings/firmware/qcom,scm.h>
>>>>>>>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>>>>>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>>>>>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>>>>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>>>>>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>>>>>>>  			no-map;
>>>>>>>>  		};
>>>>>>>> +
>>>>>>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>>>>>>>> +			compatible = "shared-dma-pool";
>>>>>>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>>>>>>>> +			alignment = <0x0 0x400000>;
>>>>>>>> +			size = <0x0 0xc00000>;
>>>>>>>> +			reusable;
>>>>>>>> +		};
>>>>>>>>  	};
>>>>>>>>  
>>>>>>>>  	smp2p-adsp {
>>>>>>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>>>>>>>  						};
>>>>>>>>  					};
>>>>>>>>  				};
>>>>>>>> +
>>>>>>>> +				fastrpc {
>>>>>>>> +					compatible = "qcom,fastrpc";
>>>>>>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>>>>>>>> +					label = "adsp";
>>>>>>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>>>>>>> IIUC the driver only considers this on the sensor DSP
>>>>>> Memory region is required for audio protection domain + adsprpdcd as far as I know.
>>>>> next-20250508
>>>>>
>>>>> rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
>>>>> if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
>>>>> 	// ...
>>>>> }
>>>>>
>>>>> maybe some driver changes are still pending?
>>>> Would like to add some more details here:
>>>>
>>>> Memory region is required for audio PD for dynamic loading and remote heap memory
>>>> requirements. Some initial memory(~2MB) is allocated initially when audio daemon
>>>> is getting attached[1] and this memory is added to audio PD memory pool.
>>> How is being handled for the audio PD case? Could you please point it
>>> out in? Currently, as Konrad pointed out, it is only being used for
>>> Sensors domain (unless I miss some obvious usage handled by the core).
>> The reserved-memory support was actually first added for audio PD only[1].
> Okay, so it uses an API which I missed, excuse me. But then... How does
> it work? of_reserved_mem_device_init_by_idx() requires
> rmem->ops->device_init() to be present, which is not set for a
> reserved-memory nodes without a compat string. However on all two and a
> half platforms where I see the ADSP remote heap, it is declared without
> extra compat.

Yes, of_reserved_mem_device_init_by_idx() will fail if the compat
string is not included in the reserved-memory nodes. To understand
this better, I tested the reserved-memory both with and without the
compat string. Despite this, I did not observe any allocation
failures in either case. The only difference was the appearance of
the log message "no reserved DMA memory for FASTRPC" when the compat
string was not added, although the allocation was still successful.
The correct approach is to include the compat string, and it's
unclear why it was omitted for existing platforms.

//Ekansh

>
>> The usage of reserved-memory is audio PD:
>>
>> This memory is used by audio PD for it's dynamic loading and remote heap
>> requirements as I had mentioned earlier. I'll give more details here:
>> When audio PD starts, it expects some initial memory for it's dynamic
>> loading and other allocation requirements. To fulfill this, the audio
>> daemon allocates[2] some initial memory(~2MB) and moves the ownership to
>> the audio specific VMIDs that are configured in DT[3]. Audio PD then uses
>> this memory for it's initial operations. If there is any more memory
>> needed, audio PD makes a request to allocate memory from HLOS which is
>> again allocated from the same region[4] and then the ownership is moved
>> to the configured VMIDs[5].
>>
>> The sensors domain that you are pointing was an extension of this and as
>> pointed earlier, it was added to support SDSP use cases on some old platform
>> where there are no dedicated SDSP context banks.
>>
>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=1ce91d45ba77a4f6bf9209d142d5c89c42cf877a
>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1274
>> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm64/boot/dts/qcom/sa8775p.dtsi#n5334
>> [4] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
>> [5] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1927
>>
>> //Ekansh
>>
>>>> Additionally, if there is some additional memory requirement from audio PD, the
>>>> PD can request for more memory using remote heap request[2]
>>>>
>>>> The support for SDSP was added sometime back[3] to support SDSP usecases on some old
>>>> platform as there were no dedicated context banks for SDSP there. On recent platforms,
>>>> context banks are available wherever SDSP is supported. 
>>>>
>>>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
>>>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
>>>> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a
>>>>
>>>> //Ekansh
>>>>
>>>>> Konrad
>>>>>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-09  3:42       ` Ekansh Gupta
  2025-05-09 19:49         ` Dmitry Baryshkov
@ 2025-05-13 13:09         ` Konrad Dybcio
  2025-06-13 14:48           ` Alexey Klimov
  1 sibling, 1 reply; 17+ messages in thread
From: Konrad Dybcio @ 2025-05-13 13:09 UTC (permalink / raw)
  To: Ekansh Gupta, Konrad Dybcio, Alexey Klimov, andersson,
	konradybcio, linux-arm-msm
  Cc: robh, krzk+dt, conor+dt, devicetree, linux-kernel, srini,
	quic_ekangupt, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)

On 5/9/25 5:42 AM, Ekansh Gupta wrote:
> 
> 
> On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
>> On 5/9/25 12:20 AM, Alexey Klimov wrote:
>>> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
>>>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>>>>> While at this, also add required memory region for fastrpc.
>>>>>
>>>>> Tested on sm8750-mtp device with adsprpdcd.
>>>>>
>>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>>>> ---
>>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>>>  1 file changed, 70 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>> index 149d2ed17641..48ee66125a89 100644
>>>>> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
>>>>> @@ -7,6 +7,7 @@
>>>>>  #include <dt-bindings/clock/qcom,sm8750-gcc.h>
>>>>>  #include <dt-bindings/clock/qcom,sm8750-tcsr.h>
>>>>>  #include <dt-bindings/dma/qcom-gpi.h>
>>>>> +#include <dt-bindings/firmware/qcom,scm.h>
>>>>>  #include <dt-bindings/interconnect/qcom,icc.h>
>>>>>  #include <dt-bindings/interconnect/qcom,sm8750-rpmh.h>
>>>>>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>>> @@ -523,6 +524,14 @@ llcc_lpi_mem: llcc-lpi@ff800000 {
>>>>>  			reg = <0x0 0xff800000 0x0 0x800000>;
>>>>>  			no-map;
>>>>>  		};
>>>>> +
>>>>> +		adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap {
>>>>> +			compatible = "shared-dma-pool";
>>>>> +			alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>;
>>>>> +			alignment = <0x0 0x400000>;
>>>>> +			size = <0x0 0xc00000>;
>>>>> +			reusable;
>>>>> +		};
>>>>>  	};
>>>>>  
>>>>>  	smp2p-adsp {
>>>>> @@ -2237,6 +2246,67 @@ q6prmcc: clock-controller {
>>>>>  						};
>>>>>  					};
>>>>>  				};
>>>>> +
>>>>> +				fastrpc {
>>>>> +					compatible = "qcom,fastrpc";
>>>>> +					qcom,glink-channels = "fastrpcglink-apps-dsp";
>>>>> +					label = "adsp";
>>>>> +					memory-region = <&adsp_rpc_remote_heap_mem>;
>>>> IIUC the driver only considers this on the sensor DSP
>>> Memory region is required for audio protection domain + adsprpdcd as far as I know.
>> next-20250508
>>
>> rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
>> if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
>> 	// ...
>> }
>>
>> maybe some driver changes are still pending?
> 
> Would like to add some more details here:
> 
> Memory region is required for audio PD for dynamic loading and remote heap memory
> requirements. Some initial memory(~2MB) is allocated initially when audio daemon
> is getting attached[1] and this memory is added to audio PD memory pool.
> 
> Additionally, if there is some additional memory requirement from audio PD, the
> PD can request for more memory using remote heap request[2]
> 
> The support for SDSP was added sometime back[3] to support SDSP usecases on some old
> platform as there were no dedicated context banks for SDSP there. On recent platforms,
> context banks are available wherever SDSP is supported. 
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a

Ok, this was mildly confusing given there's specific "normal" region
handling, but the DMA allocator takes care of this one

Konrad

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-05-13 13:09         ` Konrad Dybcio
@ 2025-06-13 14:48           ` Alexey Klimov
  2025-06-14 19:51             ` Konrad Dybcio
  0 siblings, 1 reply; 17+ messages in thread
From: Alexey Klimov @ 2025-06-13 14:48 UTC (permalink / raw)
  To: Konrad Dybcio, Ekansh Gupta, konradybcio, srini, quic_ekangupt
  Cc: andersson, linux-arm-msm, robh, krzk+dt, conor+dt, devicetree,
	linux-kernel, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)

On Tue May 13, 2025 at 2:09 PM BST, Konrad Dybcio wrote:
> On 5/9/25 5:42 AM, Ekansh Gupta wrote:
>> 
>> On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
>>> On 5/9/25 12:20 AM, Alexey Klimov wrote:
>>>> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
>>>>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>>>>>> While at this, also add required memory region for fastrpc.
>>>>>>
>>>>>> Tested on sm8750-mtp device with adsprpdcd.
>>>>>>
>>>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>>>>> ---
>>>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>>>>  1 file changed, 70 insertions(+)

[...]

>>>>> IIUC the driver only considers this on the sensor DSP
>>>> Memory region is required for audio protection domain + adsprpdcd as far as I know.
>>> next-20250508
>>>
>>> rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
>>> if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
>>> 	// ...
>>> }
>>>
>>> maybe some driver changes are still pending?
>> 
>> Would like to add some more details here:
>> 
>> Memory region is required for audio PD for dynamic loading and remote heap memory
>> requirements. Some initial memory(~2MB) is allocated initially when audio daemon
>> is getting attached[1] and this memory is added to audio PD memory pool.
>> 
>> Additionally, if there is some additional memory requirement from audio PD, the
>> PD can request for more memory using remote heap request[2]
>> 
>> The support for SDSP was added sometime back[3] to support SDSP usecases on some old
>> platform as there were no dedicated context banks for SDSP there. On recent platforms,
>> context banks are available wherever SDSP is supported. 
>> 
>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
>> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a
>
> Ok, this was mildly confusing given there's specific "normal" region
> handling, but the DMA allocator takes care of this one

Konrad, Srini, Ekansh,
what's left here -- I guess memory region is needed, 
so do you want me to test with secure flag as the only required change at this point?

Best regards,
Alexey


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support
  2025-06-13 14:48           ` Alexey Klimov
@ 2025-06-14 19:51             ` Konrad Dybcio
  0 siblings, 0 replies; 17+ messages in thread
From: Konrad Dybcio @ 2025-06-14 19:51 UTC (permalink / raw)
  To: Alexey Klimov, Konrad Dybcio, Ekansh Gupta, konradybcio, srini,
	quic_ekangupt
  Cc: andersson, linux-arm-msm, robh, krzk+dt, conor+dt, devicetree,
	linux-kernel, krzysztof.kozlowski, Bharath Kumar (QUIC),
	Chenna Kesava Raju (QUIC)

On 6/13/25 4:48 PM, Alexey Klimov wrote:
> On Tue May 13, 2025 at 2:09 PM BST, Konrad Dybcio wrote:
>> On 5/9/25 5:42 AM, Ekansh Gupta wrote:
>>>
>>> On 5/9/2025 4:27 AM, Konrad Dybcio wrote:
>>>> On 5/9/25 12:20 AM, Alexey Klimov wrote:
>>>>> On Fri May 2, 2025 at 10:38 AM BST, Konrad Dybcio wrote:
>>>>>> On 5/2/25 3:15 AM, Alexey Klimov wrote:
>>>>>>> While at this, also add required memory region for fastrpc.
>>>>>>>
>>>>>>> Tested on sm8750-mtp device with adsprpdcd.
>>>>>>>
>>>>>>> Cc: Ekansh Gupta <quic_ekangupt@quicinc.com>
>>>>>>> Cc: Srinivas Kandagatla <srini@kernel.org>
>>>>>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>>>>>> ---
>>>>>>>  arch/arm64/boot/dts/qcom/sm8750.dtsi | 70 ++++++++++++++++++++++++++++
>>>>>>>  1 file changed, 70 insertions(+)
> 
> [...]
> 
>>>>>> IIUC the driver only considers this on the sensor DSP
>>>>> Memory region is required for audio protection domain + adsprpdcd as far as I know.
>>>> next-20250508
>>>>
>>>> rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
>>>> if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
>>>> 	// ...
>>>> }
>>>>
>>>> maybe some driver changes are still pending?
>>>
>>> Would like to add some more details here:
>>>
>>> Memory region is required for audio PD for dynamic loading and remote heap memory
>>> requirements. Some initial memory(~2MB) is allocated initially when audio daemon
>>> is getting attached[1] and this memory is added to audio PD memory pool.
>>>
>>> Additionally, if there is some additional memory requirement from audio PD, the
>>> PD can request for more memory using remote heap request[2]
>>>
>>> The support for SDSP was added sometime back[3] to support SDSP usecases on some old
>>> platform as there were no dedicated context banks for SDSP there. On recent platforms,
>>> context banks are available wherever SDSP is supported. 
>>>
>>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1273
>>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/misc/fastrpc.c#n1884
>>> [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/misc/fastrpc.c?id=c3c0363bc72d4d0907a6d446d7424b3f022ce82a
>>
>> Ok, this was mildly confusing given there's specific "normal" region
>> handling, but the DMA allocator takes care of this one
> 
> Konrad, Srini, Ekansh,
> what's left here -- I guess memory region is needed, 
> so do you want me to test with secure flag as the only required change at this point?

I think so, please give it a shot

Konrad

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-06-14 19:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02  1:15 [PATCH] arm64: dts: qcom: sm8750: Add adsp fastrpc support Alexey Klimov
2025-05-02  2:16 ` Dmitry Baryshkov
2025-05-02  9:38 ` Konrad Dybcio
2025-05-08 22:20   ` Alexey Klimov
2025-05-08 22:57     ` Konrad Dybcio
2025-05-09  3:42       ` Ekansh Gupta
2025-05-09 19:49         ` Dmitry Baryshkov
2025-05-12  3:55           ` Ekansh Gupta
2025-05-12 15:55             ` Dmitry Baryshkov
2025-05-13  5:58               ` Ekansh Gupta
2025-05-13 13:09         ` Konrad Dybcio
2025-06-13 14:48           ` Alexey Klimov
2025-06-14 19:51             ` Konrad Dybcio
2025-05-02 10:51 ` Srinivas Kandagatla
2025-05-09 13:16   ` Alexey Klimov
2025-05-09 13:31     ` Srinivas Kandagatla
2025-05-09 18:02       ` Ekansh Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).