2023-03-30 16:51:42

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH v3 0/3] remoteproc: qcom: pas: Support SDM845 SLPI

* About *

The Qualcomm SDM845 SoC has a separate SLPI (Sensor Low Power Island)
DSP for sensors connected to the SoC which is responsible for exposing
sensors to userspace, power saving, and other features.
While sensors are connected to GPIOs of the SoC, they cannot be used
because the hypervisor blocks direct access to the sensors, thus the
DSP must be used to access any sensor on this SoC. The SLPI DSP uses a
GLink edge (dsps) to communicate with the host and has a FastRPC interface
to load files from the host filesystem such as sensor configuration files.
The FastRPC interface does not use regular FastRPC Compute Banks
but instead uses an allocated CMA region through which communication happens.

* Changes *

This patchseries adds support for this remoteproc in the q6v5_pas driver
to allow booting the SLPI on the SDM845 and expose its service 400 over QRTR.

* Related patches *

Support for the FastRPC side of the SLPI and DTS changes are submitted
in separate series. These are the links to v2 of the series:

1. FastRPC changes:
https://lore.kernel.org/linux-arm-msm/[email protected]/
2. DTS changes:
https://lore.kernel.org/linux-devicetree/[email protected]

* Changelog *

Changes in v2:

- Removed double blank lines
- Added power-domain if:then: for SDM845 SLPI
- After adding SDM845 SLPI, refactor SLPI resource init

Changes in v3:

- First refactor SLPI resources of SM8150/SM8250/SM8350/SM8450/MSM8996/MSM8998,
then add support for SDM845 SLPI.
- Add Reviewed-by for patch
'dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas compatible'
since it was not changed in v3.

Kind regards,
Dylan Van Assche

Dylan Van Assche (3):
dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas
compatible
remoteproc: qcom: pas: refactor SLPI remoteproc init
remoteproc: qcom: pas: add SDM845 SLPI compatible

.../bindings/remoteproc/qcom,adsp.yaml | 19 +++++++
drivers/remoteproc/qcom_q6v5_pas.c | 49 ++++---------------
2 files changed, 28 insertions(+), 40 deletions(-)

--
2.39.2


2023-03-30 16:51:45

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH v3 1/3] dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas compatible

SLPI DSP remoteproc on DSP is defined by the 'qcom,sdm845-slpi-pas'
compatible in the qcom_q6v5_pas driver. Add this compatible to the
devicetree bindings.

Signed-off-by: Dylan Van Assche <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
---
.../bindings/remoteproc/qcom,adsp.yaml | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
index 643ee787a81f..eb4a440a661a 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
@@ -26,6 +26,7 @@ properties:
- qcom,sdm660-adsp-pas
- qcom,sdm845-adsp-pas
- qcom,sdm845-cdsp-pas
+ - qcom,sdm845-slpi-pas

reg:
maxItems: 1
@@ -63,6 +64,7 @@ allOf:
- qcom,msm8998-adsp-pas
- qcom,sdm845-adsp-pas
- qcom,sdm845-cdsp-pas
+ - qcom,sdm845-slpi-pas
then:
properties:
clocks:
@@ -104,6 +106,7 @@ allOf:
- qcom,msm8998-slpi-pas
- qcom,sdm845-adsp-pas
- qcom,sdm845-cdsp-pas
+ - qcom,sdm845-slpi-pas
then:
properties:
interrupts:
@@ -157,6 +160,22 @@ allOf:
required:
- px-supply

+ - if:
+ properties:
+ compatible:
+ enum:
+ - qcom,sdm845-slpi-pas
+ then:
+ properties:
+ power-domains:
+ items:
+ - description: LCX power domain
+ - description: LMX power domain
+ power-domain-names:
+ items:
+ - const: lcx
+ - const: lmx
+
- if:
properties:
compatible:
--
2.39.2

2023-03-30 16:52:41

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH v3 3/3] remoteproc: qcom: pas: add SDM845 SLPI compatible

Add a compatible for the SDM845 SLPI to the Qualcomm remoteproc q6v5_pas
driver. The SLPI is the same as in SM8150, SM8250, SM8350, and SM8450,
so use the same resource in the driver.

Signed-off-by: Dylan Van Assche <[email protected]>
---
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 b96020c93e58..f3a7ae503bd1 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -1169,6 +1169,7 @@ static const struct of_device_id adsp_of_match[] = {
{ .compatible = "qcom,sdm660-adsp-pas", .data = &adsp_resource_init},
{ .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init},
{ .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init},
+ { .compatible = "qcom,sdm845-slpi-pas", .data = &sdm845_slpi_resource_init},
{ .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource},
{ .compatible = "qcom,sm6115-adsp-pas", .data = &adsp_resource_init},
{ .compatible = "qcom,sm6115-cdsp-pas", .data = &cdsp_resource_init},
--
2.39.2

2023-03-30 16:52:53

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH v3 2/3] remoteproc: qcom: pas: refactor SLPI remoteproc init

SLPI remoteproc initialization is the same for SDM845, SM8150, SM8250,
SM8350 but is duplicated for each compatible. Refactor initialization
structs for these 4 compatibles as a single struct.

Signed-off-by: Dylan Van Assche <[email protected]>
---
drivers/remoteproc/qcom_q6v5_pas.c | 48 +++++-------------------------
1 file changed, 8 insertions(+), 40 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index c99a20542685..b96020c93e58 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -1014,7 +1014,7 @@ static const struct adsp_data sc8180x_mpss_resource = {
.ssctl_id = 0x12,
};

-static const struct adsp_data slpi_resource_init = {
+static const struct adsp_data msm8996_slpi_resource_init = {
.crash_reason_smem = 424,
.firmware_name = "slpi.mdt",
.pas_id = 12,
@@ -1028,7 +1028,7 @@ static const struct adsp_data slpi_resource_init = {
.ssctl_id = 0x16,
};

-static const struct adsp_data sm8150_slpi_resource = {
+static const struct adsp_data sdm845_slpi_resource_init = {
.crash_reason_smem = 424,
.firmware_name = "slpi.mdt",
.pas_id = 12,
@@ -1044,38 +1044,6 @@ static const struct adsp_data sm8150_slpi_resource = {
.ssctl_id = 0x16,
};

-static const struct adsp_data sm8250_slpi_resource = {
- .crash_reason_smem = 424,
- .firmware_name = "slpi.mdt",
- .pas_id = 12,
- .auto_boot = true,
- .proxy_pd_names = (char*[]){
- "lcx",
- "lmx",
- NULL
- },
- .load_state = "slpi",
- .ssr_name = "dsps",
- .sysmon_name = "slpi",
- .ssctl_id = 0x16,
-};
-
-static const struct adsp_data sm8350_slpi_resource = {
- .crash_reason_smem = 424,
- .firmware_name = "slpi.mdt",
- .pas_id = 12,
- .auto_boot = true,
- .proxy_pd_names = (char*[]){
- "lcx",
- "lmx",
- NULL
- },
- .load_state = "slpi",
- .ssr_name = "dsps",
- .sysmon_name = "slpi",
- .ssctl_id = 0x16,
-};
-
static const struct adsp_data wcss_resource_init = {
.crash_reason_smem = 421,
.firmware_name = "wcnss.mdt",
@@ -1184,9 +1152,9 @@ static const struct of_device_id adsp_of_match[] = {
{ .compatible = "qcom,msm8953-adsp-pil", .data = &msm8996_adsp_resource},
{ .compatible = "qcom,msm8974-adsp-pil", .data = &adsp_resource_init},
{ .compatible = "qcom,msm8996-adsp-pil", .data = &msm8996_adsp_resource},
- { .compatible = "qcom,msm8996-slpi-pil", .data = &slpi_resource_init},
+ { .compatible = "qcom,msm8996-slpi-pil", .data = &msm8996_slpi_resource_init},
{ .compatible = "qcom,msm8998-adsp-pas", .data = &msm8996_adsp_resource},
- { .compatible = "qcom,msm8998-slpi-pas", .data = &slpi_resource_init},
+ { .compatible = "qcom,msm8998-slpi-pas", .data = &msm8996_slpi_resource_init},
{ .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 },
@@ -1211,17 +1179,17 @@ static const struct of_device_id adsp_of_match[] = {
{ .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},
{ .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},
{ .compatible = "qcom,sm8150-mpss-pas", .data = &mpss_resource_init},
- { .compatible = "qcom,sm8150-slpi-pas", .data = &sm8150_slpi_resource},
+ { .compatible = "qcom,sm8150-slpi-pas", .data = &sdm845_slpi_resource_init},
{ .compatible = "qcom,sm8250-adsp-pas", .data = &sm8250_adsp_resource},
{ .compatible = "qcom,sm8250-cdsp-pas", .data = &sm8250_cdsp_resource},
- { .compatible = "qcom,sm8250-slpi-pas", .data = &sm8250_slpi_resource},
+ { .compatible = "qcom,sm8250-slpi-pas", .data = &sdm845_slpi_resource_init},
{ .compatible = "qcom,sm8350-adsp-pas", .data = &sm8350_adsp_resource},
{ .compatible = "qcom,sm8350-cdsp-pas", .data = &sm8350_cdsp_resource},
- { .compatible = "qcom,sm8350-slpi-pas", .data = &sm8350_slpi_resource},
+ { .compatible = "qcom,sm8350-slpi-pas", .data = &sdm845_slpi_resource_init},
{ .compatible = "qcom,sm8350-mpss-pas", .data = &mpss_resource_init},
{ .compatible = "qcom,sm8450-adsp-pas", .data = &sm8350_adsp_resource},
{ .compatible = "qcom,sm8450-cdsp-pas", .data = &sm8350_cdsp_resource},
- { .compatible = "qcom,sm8450-slpi-pas", .data = &sm8350_slpi_resource},
+ { .compatible = "qcom,sm8450-slpi-pas", .data = &sdm845_slpi_resource_init},
{ .compatible = "qcom,sm8450-mpss-pas", .data = &sm8450_mpss_resource},
{ .compatible = "qcom,sm8550-adsp-pas", .data = &sm8550_adsp_resource},
{ .compatible = "qcom,sm8550-cdsp-pas", .data = &sm8550_cdsp_resource},
--
2.39.2

2023-03-30 23:08:24

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] remoteproc: qcom: pas: refactor SLPI remoteproc init



On 30.03.2023 18:46, Dylan Van Assche wrote:
> SLPI remoteproc initialization is the same for SDM845, SM8150, SM8250,
> SM8350 but is duplicated for each compatible. Refactor initialization
> structs for these 4 compatibles as a single struct.
>
> Signed-off-by: Dylan Van Assche <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
> drivers/remoteproc/qcom_q6v5_pas.c | 48 +++++-------------------------
> 1 file changed, 8 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index c99a20542685..b96020c93e58 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -1014,7 +1014,7 @@ static const struct adsp_data sc8180x_mpss_resource = {
> .ssctl_id = 0x12,
> };
>
> -static const struct adsp_data slpi_resource_init = {
> +static const struct adsp_data msm8996_slpi_resource_init = {
> .crash_reason_smem = 424,
> .firmware_name = "slpi.mdt",
> .pas_id = 12,
> @@ -1028,7 +1028,7 @@ static const struct adsp_data slpi_resource_init = {
> .ssctl_id = 0x16,
> };
>
> -static const struct adsp_data sm8150_slpi_resource = {
> +static const struct adsp_data sdm845_slpi_resource_init = {
> .crash_reason_smem = 424,
> .firmware_name = "slpi.mdt",
> .pas_id = 12,
> @@ -1044,38 +1044,6 @@ static const struct adsp_data sm8150_slpi_resource = {
> .ssctl_id = 0x16,
> };
>
> -static const struct adsp_data sm8250_slpi_resource = {
> - .crash_reason_smem = 424,
> - .firmware_name = "slpi.mdt",
> - .pas_id = 12,
> - .auto_boot = true,
> - .proxy_pd_names = (char*[]){
> - "lcx",
> - "lmx",
> - NULL
> - },
> - .load_state = "slpi",
> - .ssr_name = "dsps",
> - .sysmon_name = "slpi",
> - .ssctl_id = 0x16,
> -};
> -
> -static const struct adsp_data sm8350_slpi_resource = {
> - .crash_reason_smem = 424,
> - .firmware_name = "slpi.mdt",
> - .pas_id = 12,
> - .auto_boot = true,
> - .proxy_pd_names = (char*[]){
> - "lcx",
> - "lmx",
> - NULL
> - },
> - .load_state = "slpi",
> - .ssr_name = "dsps",
> - .sysmon_name = "slpi",
> - .ssctl_id = 0x16,
> -};
> -
> static const struct adsp_data wcss_resource_init = {
> .crash_reason_smem = 421,
> .firmware_name = "wcnss.mdt",
> @@ -1184,9 +1152,9 @@ static const struct of_device_id adsp_of_match[] = {
> { .compatible = "qcom,msm8953-adsp-pil", .data = &msm8996_adsp_resource},
> { .compatible = "qcom,msm8974-adsp-pil", .data = &adsp_resource_init},
> { .compatible = "qcom,msm8996-adsp-pil", .data = &msm8996_adsp_resource},
> - { .compatible = "qcom,msm8996-slpi-pil", .data = &slpi_resource_init},
> + { .compatible = "qcom,msm8996-slpi-pil", .data = &msm8996_slpi_resource_init},
> { .compatible = "qcom,msm8998-adsp-pas", .data = &msm8996_adsp_resource},
> - { .compatible = "qcom,msm8998-slpi-pas", .data = &slpi_resource_init},
> + { .compatible = "qcom,msm8998-slpi-pas", .data = &msm8996_slpi_resource_init},
> { .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 },
> @@ -1211,17 +1179,17 @@ static const struct of_device_id adsp_of_match[] = {
> { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},
> { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},
> { .compatible = "qcom,sm8150-mpss-pas", .data = &mpss_resource_init},
> - { .compatible = "qcom,sm8150-slpi-pas", .data = &sm8150_slpi_resource},
> + { .compatible = "qcom,sm8150-slpi-pas", .data = &sdm845_slpi_resource_init},
> { .compatible = "qcom,sm8250-adsp-pas", .data = &sm8250_adsp_resource},
> { .compatible = "qcom,sm8250-cdsp-pas", .data = &sm8250_cdsp_resource},
> - { .compatible = "qcom,sm8250-slpi-pas", .data = &sm8250_slpi_resource},
> + { .compatible = "qcom,sm8250-slpi-pas", .data = &sdm845_slpi_resource_init},
> { .compatible = "qcom,sm8350-adsp-pas", .data = &sm8350_adsp_resource},
> { .compatible = "qcom,sm8350-cdsp-pas", .data = &sm8350_cdsp_resource},
> - { .compatible = "qcom,sm8350-slpi-pas", .data = &sm8350_slpi_resource},
> + { .compatible = "qcom,sm8350-slpi-pas", .data = &sdm845_slpi_resource_init},
> { .compatible = "qcom,sm8350-mpss-pas", .data = &mpss_resource_init},
> { .compatible = "qcom,sm8450-adsp-pas", .data = &sm8350_adsp_resource},
> { .compatible = "qcom,sm8450-cdsp-pas", .data = &sm8350_cdsp_resource},
> - { .compatible = "qcom,sm8450-slpi-pas", .data = &sm8350_slpi_resource},
> + { .compatible = "qcom,sm8450-slpi-pas", .data = &sdm845_slpi_resource_init},
> { .compatible = "qcom,sm8450-mpss-pas", .data = &sm8450_mpss_resource},
> { .compatible = "qcom,sm8550-adsp-pas", .data = &sm8550_adsp_resource},
> { .compatible = "qcom,sm8550-cdsp-pas", .data = &sm8550_cdsp_resource},

2023-03-30 23:08:38

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] remoteproc: qcom: pas: add SDM845 SLPI compatible



On 30.03.2023 18:46, Dylan Van Assche wrote:
> Add a compatible for the SDM845 SLPI to the Qualcomm remoteproc q6v5_pas
> driver. The SLPI is the same as in SM8150, SM8250, SM8350, and SM8450,
> so use the same resource in the driver.
>
> Signed-off-by: Dylan Van Assche <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
> 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 b96020c93e58..f3a7ae503bd1 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -1169,6 +1169,7 @@ static const struct of_device_id adsp_of_match[] = {
> { .compatible = "qcom,sdm660-adsp-pas", .data = &adsp_resource_init},
> { .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init},
> { .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init},
> + { .compatible = "qcom,sdm845-slpi-pas", .data = &sdm845_slpi_resource_init},
> { .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource},
> { .compatible = "qcom,sm6115-adsp-pas", .data = &adsp_resource_init},
> { .compatible = "qcom,sm6115-cdsp-pas", .data = &cdsp_resource_init},

2023-07-15 22:28:24

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v3 0/3] remoteproc: qcom: pas: Support SDM845 SLPI


On Thu, 30 Mar 2023 18:46:30 +0200, Dylan Van Assche wrote:
> * About *
>
> The Qualcomm SDM845 SoC has a separate SLPI (Sensor Low Power Island)
> DSP for sensors connected to the SoC which is responsible for exposing
> sensors to userspace, power saving, and other features.
> While sensors are connected to GPIOs of the SoC, they cannot be used
> because the hypervisor blocks direct access to the sensors, thus the
> DSP must be used to access any sensor on this SoC. The SLPI DSP uses a
> GLink edge (dsps) to communicate with the host and has a FastRPC interface
> to load files from the host filesystem such as sensor configuration files.
> The FastRPC interface does not use regular FastRPC Compute Banks
> but instead uses an allocated CMA region through which communication happens.
>
> [...]

Applied, thanks!

[1/3] dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas compatible
commit: 242a626870eb453934b75749f8dbab997556b555
[2/3] remoteproc: qcom: pas: refactor SLPI remoteproc init
commit: 637e98bfe20b2c6866cd79b8d487430af09dc8ac

Best regards,
--
Bjorn Andersson <[email protected]>

2023-07-15 23:09:03

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] remoteproc: qcom: pas: Support SDM845 SLPI


On Thu, 30 Mar 2023 18:46:30 +0200, Dylan Van Assche wrote:
> * About *
>
> The Qualcomm SDM845 SoC has a separate SLPI (Sensor Low Power Island)
> DSP for sensors connected to the SoC which is responsible for exposing
> sensors to userspace, power saving, and other features.
> While sensors are connected to GPIOs of the SoC, they cannot be used
> because the hypervisor blocks direct access to the sensors, thus the
> DSP must be used to access any sensor on this SoC. The SLPI DSP uses a
> GLink edge (dsps) to communicate with the host and has a FastRPC interface
> to load files from the host filesystem such as sensor configuration files.
> The FastRPC interface does not use regular FastRPC Compute Banks
> but instead uses an allocated CMA region through which communication happens.
>
> [...]

Applied, thanks!

[1/3] dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas compatible
commit: 242a626870eb453934b75749f8dbab997556b555
[2/3] remoteproc: qcom: pas: refactor SLPI remoteproc init
commit: 637e98bfe20b2c6866cd79b8d487430af09dc8ac
[3/3] remoteproc: qcom: pas: add SDM845 SLPI compatible
commit: ba3125b47016cdc66454cf720f899b3bf806debc

Best regards,
--
Bjorn Andersson <[email protected]>