2023-03-27 18:39:10

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH v2 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 v1 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

Kind regards,
Dylan Van Assche

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

.../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-27 18:39:16

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH v2 2/3] remoteproc: qcom: pas: add SDM845 SLPI resource

Add SLPI resources for the SDM845 Qualcomm SoC to the Qualcomm
remoteproc q6v5_pas driver to define the default firmware name
and GLink edge name.

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

diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index c99a20542685..d82b6f4bced4 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -1028,6 +1028,22 @@ static const struct adsp_data slpi_resource_init = {
.ssctl_id = 0x16,
};

+static const struct adsp_data sdm845_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 sm8150_slpi_resource = {
.crash_reason_smem = 424,
.firmware_name = "slpi.mdt",
@@ -1201,6 +1217,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},
{ .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-27 18:39:21

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH v2 3/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 | 66 ++++--------------------------
1 file changed, 9 insertions(+), 57 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index d82b6f4bced4..d1c7baec4aca 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 msm_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 sdm845_slpi_resource = {
+static const struct adsp_data sm_slpi_resource_init = {
.crash_reason_smem = 424,
.firmware_name = "slpi.mdt",
.pas_id = 12,
@@ -1044,54 +1044,6 @@ static const struct adsp_data sdm845_slpi_resource = {
.ssctl_id = 0x16,
};

-static const struct adsp_data sm8150_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 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",
@@ -1200,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 = &msm_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 = &msm_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 },
@@ -1217,7 +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},
+ { .compatible = "qcom,sdm845-slpi-pas", .data = &sm_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},
@@ -1228,17 +1180,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 = &sm_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 = &sm_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 = &sm_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 = &sm_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-28 06:47:45

by Krzysztof Kozlowski

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

On 27/03/2023 20:37, 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]>
> ---
> drivers/remoteproc/qcom_q6v5_pas.c | 66 ++++--------------------------
> 1 file changed, 9 insertions(+), 57 deletions(-)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index d82b6f4bced4..d1c7baec4aca 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 msm_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 sdm845_slpi_resource = {
> +static const struct adsp_data sm_slpi_resource_init = {

You just added this and further lines. First refactor, then add new
device support.


Best regards,
Krzysztof

2023-03-28 08:27:56

by Konrad Dybcio

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



On 27.03.2023 20:37, 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]>
> ---
> drivers/remoteproc/qcom_q6v5_pas.c | 66 ++++--------------------------
> 1 file changed, 9 insertions(+), 57 deletions(-)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index d82b6f4bced4..d1c7baec4aca 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 msm_slpi_resource_init = {
Clever idea, but I think naming it after the first SoC it was
used on (msm8996) will be clearer, e.g. msm8960 doesn't have SLPI.

> .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 sdm845_slpi_resource = {
> +static const struct adsp_data sm_slpi_resource_init = {
And similarly here, the sdm845 name can stay.

Konrad
> .crash_reason_smem = 424,
> .firmware_name = "slpi.mdt",
> .pas_id = 12,
> @@ -1044,54 +1044,6 @@ static const struct adsp_data sdm845_slpi_resource = {
> .ssctl_id = 0x16,
> };
>
> -static const struct adsp_data sm8150_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 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",
> @@ -1200,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 = &msm_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 = &msm_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 },
> @@ -1217,7 +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},
> + { .compatible = "qcom,sdm845-slpi-pas", .data = &sm_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},
> @@ -1228,17 +1180,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 = &sm_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 = &sm_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 = &sm_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 = &sm_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-28 08:28:04

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] remoteproc: qcom: pas: add SDM845 SLPI resource



On 27.03.2023 20:37, Dylan Van Assche wrote:
> Add SLPI resources for the SDM845 Qualcomm SoC to the Qualcomm
> remoteproc q6v5_pas driver to define the default firmware name
> and GLink edge name.
>
> Signed-off-by: Dylan Van Assche <[email protected]>
> ---
> drivers/remoteproc/qcom_q6v5_pas.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index c99a20542685..d82b6f4bced4 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -1028,6 +1028,22 @@ static const struct adsp_data slpi_resource_init = {
> .ssctl_id = 0x16,
> };
>
> +static const struct adsp_data sdm845_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,
> +};
Not sure why you're adding this just to remove it in the next
patch. You can just assign a different one here and then clean
it up for all others.

Konrad
> +
> static const struct adsp_data sm8150_slpi_resource = {
> .crash_reason_smem = 424,
> .firmware_name = "slpi.mdt",
> @@ -1201,6 +1217,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},
> { .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},