mbox series

[0/4] sc7180: Add ADSP

Message ID 20230905-sc7180-adsp-rproc-v1-0-dfea7699da7b@trvn.ru
Headers show
Series sc7180: Add ADSP | expand

Message

Nikita Travkin Sept. 5, 2023, 5:47 a.m. UTC
sc7180 has an ADSP remoteproc that can be used to control the sound
hardware. This remoteproc has to be used on those devices that use
Qualcomm firmware and thus are locked out of driving the lpass directly.

Introducing the ADSP would allow multiple WoA laptops such as Aspire 1
to provide sound. It's also useful for the sm7125 devices that are to be
included to the kernel [1]

This series adds the ADSP and the sound services needed to make use of
it later.

[1] https://lore.kernel.org/all/20230824091737.75813-1-davidwronek@gmail.com/

Signed-off-by: Nikita Travkin <nikita@trvn.ru>
---
Nikita Travkin (4):
      dt-bindings: remoteproc: qcom: sc7180-pas: Add ADSP compatible
      remoteproc: qcom: pas: Add sc7180 adsp
      arm64: dts: qcom: sc7180: Add tertiary mi2s pinctrl
      arm64: dts: qcom: sc7180: Add ADSP

 .../bindings/remoteproc/qcom,sc7180-pas.yaml       |  12 ++
 arch/arm64/boot/dts/qcom/sc7180.dtsi               | 127 +++++++++++++++++++++
 drivers/remoteproc/qcom_q6v5_pas.c                 |   1 +
 3 files changed, 140 insertions(+)
---
base-commit: c50216cfa084d5eb67dc10e646a3283da1595bb6
change-id: 20230905-sc7180-adsp-rproc-a745b88af298

Best regards,

Comments

Krzysztof Kozlowski Sept. 5, 2023, 7:04 a.m. UTC | #1
On 05/09/2023 07:47, Nikita Travkin wrote:
> SC7180 has an ADSP remoteproc. Add it's compatible to the bindings.
> 
> Signed-off-by: Nikita Travkin <nikita@trvn.ru>
> ---
>  .../devicetree/bindings/remoteproc/qcom,sc7180-pas.yaml      | 12 ++++++++++++
>  1 file changed, 12

>  
> @@ -88,6 +89,17 @@ allOf:
>            maxItems: 2
>          power-domain-names:
>            maxItems: 2

Blank line

> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - qcom,sc7180-adsp-pas
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 5

This is supposed to be maxItems

> +        interrupt-names:
> +          minItems: 5

Ditto

>  
>  unevaluatedProperties: false
>  
> 

Best regards,
Krzysztof
Krzysztof Kozlowski Sept. 5, 2023, 7:05 a.m. UTC | #2
On 05/09/2023 07:47, Nikita Travkin wrote:

> +					q6afe: apr-service@4 {
> +						compatible = "qcom,q6afe";
> +						reg = <APR_SVC_AFE>;
> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
> +
> +						q6afedai: dais {
> +							compatible = "qcom,q6afe-dais";
> +							#address-cells = <1>;
> +							#size-cells = <0>;
> +							#sound-dai-cells = <1>;
> +						};
> +
> +						q6afecc: cc {

It does not look like you tested the DTS against bindings. Please run
`make dtbs_check W=1` (see
Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).

> +							compatible = "qcom,q6afe-clocks";
> +							#clock-cells = <2>;
> +						};
> +					};
> +


Best regards,
Krzysztof
Krzysztof Kozlowski Sept. 5, 2023, 7:12 a.m. UTC | #3
On 05/09/2023 07:47, Nikita Travkin wrote:
> +				apr {
> +					compatible = "qcom,apr-v2";
> +					qcom,glink-channels = "apr_audio_svc";
> +					qcom,apr-domain = <APR_DOMAIN_ADSP>;
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +
> +					apr-service@3 {

Except missing tests, few more things to fix

> +						reg = <APR_SVC_ADSP_CORE>;
> +						compatible = "qcom,q6core";

compatible is always the first property.

> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
> +					};
> +
> +					q6afe: apr-service@4 {
> +						compatible = "qcom,q6afe";
> +						reg = <APR_SVC_AFE>;
> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
> +
> +						q6afedai: dais {
> +							compatible = "qcom,q6afe-dais";
> +							#address-cells = <1>;
> +							#size-cells = <0>;

You do not have any children, so drop these two. I will fix the binding.

> +							#sound-dai-cells = <1>;
> +						};
> +
> +						q6afecc: cc {
> +							compatible = "qcom,q6afe-clocks";
> +							#clock-cells = <2>;
> +						};
> +					};
> +
> +					q6asm: apr-service@7 {
> +						compatible = "qcom,q6asm";
> +						reg = <APR_SVC_ASM>;
> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
> +
> +						q6asmdai: dais {
> +							compatible = "qcom,q6asm-dais";
> +							#address-cells = <1>;
> +							#size-cells = <0>;

Ditto

> +							#sound-dai-cells = <1>;
> +							iommus = <&apps_smmu 0x1001 0x0>;
> +						};
> +					};
> +
> +					q6adm: apr-service@8 {
> +						compatible = "qcom,q6adm";
> +						reg = <APR_SVC_ADM>;
> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
> +
> +						q6routing: routing {
> +							compatible = "qcom,q6adm-routing";
> +							#sound-dai-cells = <0>;
> +						};
> +					};
> +				};


Best regards,
Krzysztof
Krzysztof Kozlowski Sept. 5, 2023, 7:18 a.m. UTC | #4
On 05/09/2023 09:12, Krzysztof Kozlowski wrote:
>> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
>> +					};
>> +
>> +					q6afe: apr-service@4 {
>> +						compatible = "qcom,q6afe";
>> +						reg = <APR_SVC_AFE>;
>> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
>> +
>> +						q6afedai: dais {
>> +							compatible = "qcom,q6afe-dais";
>> +							#address-cells = <1>;
>> +							#size-cells = <0>;
> 
> You do not have any children, so drop these two. I will fix the binding.

No, address/size cells (and next comment) are correct - your board will
bring the children.

Best regards,
Krzysztof
Konrad Dybcio Sept. 5, 2023, 8:35 a.m. UTC | #5
On 5.09.2023 07:47, Nikita Travkin wrote:
> sc7180 has a dedicated ADSP similar to the one found in sm8250.
> Add it's compatible to the driver reusing the existing config so
> the devices that use the adsp can probe it.
> 
> Signed-off-by: Nikita Travkin <nikita@trvn.ru>
> ---
>  drivers/remoteproc/qcom_q6v5_pas.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index b5447dd2dd35..55fafc68200e 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -1161,6 +1161,7 @@ static const struct of_device_id adsp_of_match[] = {
>  	{ .compatible = "qcom,qcs404-adsp-pas", .data = &adsp_resource_init },
>  	{ .compatible = "qcom,qcs404-cdsp-pas", .data = &cdsp_resource_init },
>  	{ .compatible = "qcom,qcs404-wcss-pas", .data = &wcss_resource_init },
> +	{ .compatible = "qcom,sc7180-adsp-pas", .data = &sm8250_adsp_resource},
Should we use a fallback here, maybe?

Konrad
Nikita Travkin Sept. 5, 2023, 10:24 a.m. UTC | #6
Konrad Dybcio писал(а) 05.09.2023 13:35:
> On 5.09.2023 07:47, Nikita Travkin wrote:
>> sc7180 has a dedicated ADSP similar to the one found in sm8250.
>> Add it's compatible to the driver reusing the existing config so
>> the devices that use the adsp can probe it.
>>
>> Signed-off-by: Nikita Travkin <nikita@trvn.ru>
>> ---
>>  drivers/remoteproc/qcom_q6v5_pas.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
>> index b5447dd2dd35..55fafc68200e 100644
>> --- a/drivers/remoteproc/qcom_q6v5_pas.c
>> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
>> @@ -1161,6 +1161,7 @@ static const struct of_device_id adsp_of_match[] = {
>>  	{ .compatible = "qcom,qcs404-adsp-pas", .data = &adsp_resource_init },
>>  	{ .compatible = "qcom,qcs404-cdsp-pas", .data = &cdsp_resource_init },
>>  	{ .compatible = "qcom,qcs404-wcss-pas", .data = &wcss_resource_init },
>> +	{ .compatible = "qcom,sc7180-adsp-pas", .data = &sm8250_adsp_resource},
> Should we use a fallback here, maybe?
> 

Not sure if it makes sense to, given afaiu no other soc defines two
compatibles for the adsp right now...

> Konrad
Nikita Travkin Sept. 5, 2023, 10:34 a.m. UTC | #7
Krzysztof Kozlowski писал(а) 05.09.2023 12:12:
> On 05/09/2023 07:47, Nikita Travkin wrote:
>> +				apr {
>> +					compatible = "qcom,apr-v2";
>> +					qcom,glink-channels = "apr_audio_svc";
>> +					qcom,apr-domain = <APR_DOMAIN_ADSP>;
>> +					#address-cells = <1>;
>> +					#size-cells = <0>;
>> +
>> +					apr-service@3 {
> 
> Except missing tests, few more things to fix

Will rename the services to fit the schema

> 
>> +						reg = <APR_SVC_ADSP_CORE>;
>> +						compatible = "qcom,q6core";
> 
> compatible is always the first property.
> 

Ack, missed that

>> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
>> +					};
>> +
>> +					q6afe: apr-service@4 {
>> +						compatible = "qcom,q6afe";
>> +						reg = <APR_SVC_AFE>;
>> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
>> +
>> +						q6afedai: dais {
>> +							compatible = "qcom,q6afe-dais";
>> +							#address-cells = <1>;
>> +							#size-cells = <0>;
> 
> You do not have any children, so drop these two. I will fix the binding.
> 

As you have already pointed out, the children will be in the board.
Will keep the sizes for this and the next one.

Nikita

>> +							#sound-dai-cells = <1>;
>> +						};
>> +
>> +						q6afecc: cc {
>> +							compatible = "qcom,q6afe-clocks";
>> +							#clock-cells = <2>;
>> +						};
>> +					};
>> +
>> +					q6asm: apr-service@7 {
>> +						compatible = "qcom,q6asm";
>> +						reg = <APR_SVC_ASM>;
>> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
>> +
>> +						q6asmdai: dais {
>> +							compatible = "qcom,q6asm-dais";
>> +							#address-cells = <1>;
>> +							#size-cells = <0>;
> 
> Ditto
> 
>> +							#sound-dai-cells = <1>;
>> +							iommus = <&apps_smmu 0x1001 0x0>;
>> +						};
>> +					};
>> +
>> +					q6adm: apr-service@8 {
>> +						compatible = "qcom,q6adm";
>> +						reg = <APR_SVC_ADM>;
>> +						qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
>> +
>> +						q6routing: routing {
>> +							compatible = "qcom,q6adm-routing";
>> +							#sound-dai-cells = <0>;
>> +						};
>> +					};
>> +				};
> 
> 
> Best regards,
> Krzysztof