2023-03-25 13:54:02

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH 0/4] Qualcomm SDM845 SLPI DSP enablement

* 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 completes support for the SLPI in the Qualcomm SDM845 SoC
by adding the SLPI to the SDM845 DTS and enable it for 2 hardware devices:
- Oneplus 6
- SHIFTPHONES SHIFT6mq

* Related patches *

1. Remoteproc changes to support the SLPI DSP in SDM845:
https://lore.kernel.org/linux-remoteproc/[email protected]/
2. FastRPC changes to support the SLPI DSP in SDM845:
https://lore.kernel.org/linux-arm-msm/[email protected]/

This serie does not depend on any serie, but all of them are necessary
to enable the feature in the end.

Kind regards,
Dylan Van Assche

Dylan Van Assche (4):
dts: arm64: qcom: sdm845: add SLPI remoteproc
dts: arm64: qcom: sdm845: add SLPI FastRPC support
dts: arm64: qcom: sdm845-oneplus: enable SLPI
dts: arm64: qcom: sdm845-shift-axolotl: enable SLPI

.../boot/dts/qcom/sdm845-oneplus-common.dtsi | 5 ++
.../boot/dts/qcom/sdm845-shift-axolotl.dts | 5 ++
arch/arm64/boot/dts/qcom/sdm845.dtsi | 61 +++++++++++++++++++
3 files changed, 71 insertions(+)

--
2.39.2


2023-03-25 13:55:01

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH 3/4] dts: arm64: qcom: sdm845-oneplus: enable SLPI

Enable the SLPI DSP on the Oneplus 6 phone with a Qualcomm SDM845 SoC.

Signed-off-by: Dylan Van Assche <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index b01542d79ae2..a14e6021c934 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -450,6 +450,11 @@ &ipa {
status = "okay";
};

+&slpi_pas {
+ status = "okay";
+ firmware-name = "qcom/sdm845/oneplus6/slpi.mbn";
+};
+
&mdss {
status = "okay";
};
--
2.39.2

2023-03-25 13:55:14

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH 1/4] dts: arm64: qcom: sdm845: add SLPI remoteproc

Add the SLPI remoteproc to the SDM845 Qualcomm SoC which is responsible
for exposing the sensors connected to the SoC. The SLPI communicates
over GLink edge 'dsps' and is similar to other DSPs e.g. ADSP or CDSP.
This patch allows the SLPI to boot and expose itself over QRTR as
service 400.

Signed-off-by: Dylan Van Assche <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 37 ++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 2f32179c7d1b..8dcfe6293762 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -3311,6 +3311,43 @@ glink-edge {
};
};

+ slpi_pas: remoteproc@5c00000 {
+ compatible = "qcom,sdm845-slpi-pas";
+ reg = <0 0x5c00000 0 0x4000>;
+
+ interrupts-extended = <&intc GIC_SPI 494 IRQ_TYPE_EDGE_RISING>,
+ <&slpi_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+ <&slpi_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+ <&slpi_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+ <&slpi_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "wdog", "fatal", "ready",
+ "handover", "stop-ack";
+
+ clocks = <&rpmhcc RPMH_CXO_CLK>;
+ clock-names = "xo";
+
+ qcom,qmp = <&aoss_qmp>;
+
+ power-domains = <&rpmhpd SDM845_CX>,
+ <&rpmhpd SDM845_MX>;
+ power-domain-names = "lcx", "lmx";
+
+ memory-region = <&slpi_mem>;
+
+ qcom,smem-states = <&slpi_smp2p_out 0>;
+ qcom,smem-state-names = "stop";
+
+ status = "disabled";
+
+ glink-edge {
+ interrupts = <GIC_SPI 170 IRQ_TYPE_EDGE_RISING>;
+ label = "dsps";
+ qcom,remote-pid = <3>;
+ mboxes = <&apss_shared 24>;
+ };
+ };
+
+
gpucc: clock-controller@5090000 {
compatible = "qcom,sdm845-gpucc";
reg = <0 0x05090000 0 0x9000>;
--
2.39.2

2023-03-25 13:55:56

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH 2/4] dts: arm64: qcom: sdm845: add SLPI FastRPC support

Qualcomm SDM845 SoC features a SLPI DSP which uses FastRPC through
an allocated memory region to load files from the host filesystem
such as sensor configuration files.

Add a FastRPC node at /dev/fastrpc-sdsp and a DMA region, similar to
downstream, to allow userspace to communicate with the SLPI via the
FastRPC interface for initializing the sensors on the SLPI.

Signed-off-by: Dylan Van Assche <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 8dcfe6293762..5a6c7d00719b 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -878,6 +878,14 @@ mdata_mem: mpss-metadata {
size = <0 0x4000>;
no-map;
};
+
+ fastrpc_mem: fastrpc {
+ compatible = "shared-dma-pool";
+ reusable;
+ alloc-ranges = <0 0x00000000 0 0xffffffff>;
+ alignment = <0 0x400000>;
+ size = <0 0x1000000>;
+ };
};

adsp_pas: remoteproc-adsp {
@@ -3344,6 +3352,22 @@ glink-edge {
label = "dsps";
qcom,remote-pid = <3>;
mboxes = <&apss_shared 24>;
+
+ fastrpc {
+ compatible = "qcom,fastrpc";
+ qcom,glink-channels = "fastrpcglink-apps-dsp";
+ label = "sdsp";
+ qcom,non-secure-domain;
+ qcom,vmids = <0x3 0xF 0x5 0x6>;
+ memory-region = <&fastrpc_mem>;
+ qcom,assign-all-mem;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ compute-cb {
+ compatible = "qcom,fastrpc-compute-cb";
+ };
+ }
};
};

--
2.39.2

2023-03-25 13:58:02

by Dylan Van Assche

[permalink] [raw]
Subject: [PATCH 4/4] dts: arm64: qcom: sdm845-shift-axolotl: enable SLPI

Enable the SLPI DSP on the SHIFTPHONES SHIFT6mq phone with a
Qualcomm SDM845 SoC.

Signed-off-by: Dylan Van Assche <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
index b54e304abf71..66d1cac6c515 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
@@ -501,6 +501,11 @@ &ipa {
status = "okay";
};

+&slpi_pas {
+ status = "okay";
+ firmware-name = "qcom/sdm845/axolotl/slpi.mbn";
+};
+
&mdss {
status = "okay";
};
--
2.39.2

2023-03-25 16:23:12

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/4] dts: arm64: qcom: sdm845: add SLPI FastRPC support

Hi Dylan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on linus/master v6.3-rc3 next-20230324]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Dylan-Van-Assche/dts-arm64-qcom-sdm845-add-SLPI-remoteproc/20230325-215354
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20230325135114.21688-3-me%40dylanvanassche.be
patch subject: [PATCH 2/4] dts: arm64: qcom: sdm845: add SLPI FastRPC support
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20230326/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/df03f51210d03566bf0d35a56633d55e3c57b5ad
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dylan-Van-Assche/dts-arm64-qcom-sdm845-add-SLPI-remoteproc/20230325-215354
git checkout df03f51210d03566bf0d35a56633d55e3c57b5ad
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> Error: arch/arm64/boot/dts/qcom/sdm845.dtsi:3360.4-5 syntax error
FATAL ERROR: Unable to parse input tree

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

2023-03-26 08:57:32

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/4] dts: arm64: qcom: sdm845: add SLPI remoteproc

On 25/03/2023 14:51, Dylan Van Assche wrote:
> Add the SLPI remoteproc to the SDM845 Qualcomm SoC which is responsible
> for exposing the sensors connected to the SoC. The SLPI communicates
> over GLink edge 'dsps' and is similar to other DSPs e.g. ADSP or CDSP.
> This patch allows the SLPI to boot and expose itself over QRTR as
> service 400.
>
> Signed-off-by: Dylan Van Assche <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sdm845.dtsi | 37 ++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 2f32179c7d1b..8dcfe6293762 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -3311,6 +3311,43 @@ glink-edge {
> };
> };
>
> + slpi_pas: remoteproc@5c00000 {
> + compatible = "qcom,sdm845-slpi-pas";
> + reg = <0 0x5c00000 0 0x4000>;
> +
> + interrupts-extended = <&intc GIC_SPI 494 IRQ_TYPE_EDGE_RISING>,
> + <&slpi_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> + <&slpi_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> + <&slpi_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> + <&slpi_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "wdog", "fatal", "ready",
> + "handover", "stop-ack";
> +
> + clocks = <&rpmhcc RPMH_CXO_CLK>;
> + clock-names = "xo";
> +
> + qcom,qmp = <&aoss_qmp>;
> +
> + power-domains = <&rpmhpd SDM845_CX>,
> + <&rpmhpd SDM845_MX>;
> + power-domain-names = "lcx", "lmx";
> +
> + memory-region = <&slpi_mem>;
> +
> + qcom,smem-states = <&slpi_smp2p_out 0>;
> + qcom,smem-state-names = "stop";
> +
> + status = "disabled";
> +
> + glink-edge {
> + interrupts = <GIC_SPI 170 IRQ_TYPE_EDGE_RISING>;
> + label = "dsps";
> + qcom,remote-pid = <3>;
> + mboxes = <&apss_shared 24>;
> + };
> + };
> +
> +

Do not add double blank lines. Same in other patchsets.

Best regards,
Krzysztof

2023-03-26 08:57:40

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/4] dts: arm64: qcom: sdm845: add SLPI FastRPC support

On 25/03/2023 14:51, Dylan Van Assche wrote:
> Qualcomm SDM845 SoC features a SLPI DSP which uses FastRPC through
> an allocated memory region to load files from the host filesystem
> such as sensor configuration files.
>
> Add a FastRPC node at /dev/fastrpc-sdsp and a DMA region, similar to
> downstream, to allow userspace to communicate with the SLPI via the
> FastRPC interface for initializing the sensors on the SLPI.
>
> Signed-off-by: Dylan Van Assche <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sdm845.dtsi | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 8dcfe6293762..5a6c7d00719b 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -878,6 +878,14 @@ mdata_mem: mpss-metadata {
> size = <0 0x4000>;
> no-map;
> };
> +
> + fastrpc_mem: fastrpc {
> + compatible = "shared-dma-pool";
> + reusable;
> + alloc-ranges = <0 0x00000000 0 0xffffffff>;
> + alignment = <0 0x400000>;
> + size = <0 0x1000000>;
> + };
> };
>
> adsp_pas: remoteproc-adsp {
> @@ -3344,6 +3352,22 @@ glink-edge {
> label = "dsps";
> qcom,remote-pid = <3>;
> mboxes = <&apss_shared 24>;
> +
> + fastrpc {
> + compatible = "qcom,fastrpc";
> + qcom,glink-channels = "fastrpcglink-apps-dsp";
> + label = "sdsp";
> + qcom,non-secure-domain;
> + qcom,vmids = <0x3 0xF 0x5 0x6>;
> + memory-region = <&fastrpc_mem>;
> + qcom,assign-all-mem;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + compute-cb {

Does not look like you tested the DTS against bindings. Please run `make
dtbs_check` (see Documentation/devicetree/bindings/writing-schema.rst
for instructions).

Best regards,
Krzysztof

2023-03-26 08:58:01

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/4] dts: arm64: qcom: sdm845-oneplus: enable SLPI

On 25/03/2023 14:51, Dylan Van Assche wrote:
> Enable the SLPI DSP on the Oneplus 6 phone with a Qualcomm SDM845 SoC.
>
> Signed-off-by: Dylan Van Assche <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> index b01542d79ae2..a14e6021c934 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> @@ -450,6 +450,11 @@ &ipa {
> status = "okay";
> };
>
> +&slpi_pas {

Judging by context it does not look like properly ordered. m is before s.

> + status = "okay";

status is the last property.

> + firmware-name = "qcom/sdm845/oneplus6/slpi.mbn";
> +};
> +
> &mdss {
> status = "okay";
> };

Best regards,
Krzysztof

2023-03-26 08:58:42

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 4/4] dts: arm64: qcom: sdm845-shift-axolotl: enable SLPI

On 25/03/2023 14:51, Dylan Van Assche wrote:
> Enable the SLPI DSP on the SHIFTPHONES SHIFT6mq phone with a
> Qualcomm SDM845 SoC.
>
> Signed-off-by: Dylan Van Assche <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> index b54e304abf71..66d1cac6c515 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> @@ -501,6 +501,11 @@ &ipa {
> status = "okay";
> };
>
> +&slpi_pas {
> + status = "okay";
> + firmware-name = "qcom/sdm845/axolotl/slpi.mbn";
> +};

Same comments as previous patch.

Best regards,
Krzysztof