Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1569809 > unrolled thread

[PATCH v3 0/4]remoteproc: qcom: Add support for Qualcomm low pass sensor peripheral loader.

Started byAvaneesh Kumar Dwivedi <akdwived@codeaurora.org>
First post2017-01-30 16:10 +0100
Last post2017-01-31 06:50 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/4]remoteproc: qcom: Add support for  Qualcomm low pass sensor peripheral loader. Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-01-30 16:10 +0100
    [PATCH v3 4/4] arm64: dts: msm8996: Add SLPI SMP2P dt node. Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-01-30 16:10 +0100
      Re: [PATCH v3 4/4] arm64: dts: msm8996: Add SLPI SMP2P dt node. Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-01-31 02:40 +0100
    [PATCH v3 1/4] remoteproc: qcom: Compatible string based resource initialization. Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> - 2017-01-30 16:10 +0100
      Re: [PATCH v3 1/4] remoteproc: qcom: Compatible string based  resource initialization. Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-01-31 06:50 +0100

#1569809 — [PATCH v3 0/4]remoteproc: qcom: Add support for Qualcomm low pass sensor peripheral loader.

FromAvaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Date2017-01-30 16:10 +0100
Subject[PATCH v3 0/4]remoteproc: qcom: Add support for Qualcomm low pass sensor peripheral loader.
Message-ID<t5lKF-5uN-15@gated-at.bofh.it>
This patchset has changed from last patchset in below respect
	1- Generic regulator and clock resource handling is dropped.
	2- Introdused additional px supply and aggre2 clock initialization.
	3- Add SLPI boot support in existing ADSP driver.
	4- Address other minor comments on patchset 2.

Avaneesh Kumar Dwivedi (4):
  remoteproc: qcom: Compatible string based resource initialization.
  remoteproc: qcom: Add additional agree2_clk and px regulator resource.
  remoteproc: qcom: Add SLPI rproc support to load and boot slpi proc.
  arm64: dts: msm8996: Add SLPI SMP2P dt node.

 .../devicetree/bindings/remoteproc/qcom,adsp.txt   |  28 ++++++
 arch/arm64/boot/dts/qcom/msm8996.dtsi              |  24 +++++
 drivers/remoteproc/qcom_adsp_pil.c                 | 100 ++++++++++++++++-----
 3 files changed, 130 insertions(+), 22 deletions(-)

-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

[toc] | [next] | [standalone]


#1569812 — [PATCH v3 4/4] arm64: dts: msm8996: Add SLPI SMP2P dt node.

FromAvaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Date2017-01-30 16:10 +0100
Subject[PATCH v3 4/4] arm64: dts: msm8996: Add SLPI SMP2P dt node.
Message-ID<t5lKH-5uN-43@gated-at.bofh.it>
In reply to#1569809
Add smp2p support to communicate with slpi processor.

Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 29ed6b6..5bec315 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -551,5 +551,29 @@
 			#interrupt-cells = <2>;
 		};
 	};
+
+	smp2p-slpi {
+		compatible = "qcom,smp2p";
+		qcom,smem = <481>, <430>;
+
+		interrupts = <GIC_SPI 178 IRQ_TYPE_EDGE_RISING>;
+
+		qcom,ipc = <&apcs 16 26>;
+
+		qcom,local-pid = <0>;
+		qcom,remote-pid = <3>;
+
+		slpi_smp2p_in: slave-kernel {
+			qcom,entry-name = "slave-kernel";
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		slpi_smp2p_out: master-kernel {
+			qcom,entry-name = "master-kernel";
+			#qcom,smem-state-cells = <1>;
+		};
+	};
+
 };
 #include "msm8996-pins.dtsi"
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

[toc] | [prev] | [next] | [standalone]


#1570241 — Re: [PATCH v3 4/4] arm64: dts: msm8996: Add SLPI SMP2P dt node.

FromBjorn Andersson <bjorn.andersson@linaro.org>
Date2017-01-31 02:40 +0100
SubjectRe: [PATCH v3 4/4] arm64: dts: msm8996: Add SLPI SMP2P dt node.
Message-ID<t5vAl-2Rg-3@gated-at.bofh.it>
In reply to#1569812
On Mon 30 Jan 07:03 PST 2017, Avaneesh Kumar Dwivedi wrote:

> Add smp2p support to communicate with slpi processor.
> 
> Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

[toc] | [prev] | [next] | [standalone]


#1569814 — [PATCH v3 1/4] remoteproc: qcom: Compatible string based resource initialization.

FromAvaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Date2017-01-30 16:10 +0100
Subject[PATCH v3 1/4] remoteproc: qcom: Compatible string based resource initialization.
Message-ID<t5lKH-5uN-47@gated-at.bofh.it>
In reply to#1569809
This patch initialize certain driver related data based on compatible
string. This enable driver to handle more than one similar device in
by differentiating in probe their private data.

Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
---
 drivers/remoteproc/qcom_adsp_pil.c | 47 ++++++++++++++++++++++++++------------
 1 file changed, 33 insertions(+), 14 deletions(-)

diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c
index 43a4ed2..f674301 100644
--- a/drivers/remoteproc/qcom_adsp_pil.c
+++ b/drivers/remoteproc/qcom_adsp_pil.c
@@ -32,9 +32,12 @@
 #include "qcom_mdt_loader.h"
 #include "remoteproc_internal.h"
 
-#define ADSP_CRASH_REASON_SMEM		423
-#define ADSP_FIRMWARE_NAME		"adsp.mdt"
-#define ADSP_PAS_ID			1
+struct adsp_data {
+	int crash_reason_smem;
+	const char *firmware_name;
+	int pas_id;
+};
+
 
 struct qcom_adsp {
 	struct device *dev;
@@ -53,6 +56,9 @@ struct qcom_adsp {
 
 	struct regulator *cx_supply;
 
+	int pas_id;
+	int crash_reason_smem;
+
 	struct completion start_done;
 	struct completion stop_done;
 
@@ -70,7 +76,7 @@ static int adsp_load(struct rproc *rproc, const struct firmware *fw)
 	bool relocate;
 	int ret;
 
-	ret = qcom_scm_pas_init_image(ADSP_PAS_ID, fw->data, fw->size);
+	ret = qcom_scm_pas_init_image(adsp->pas_id, fw->data, fw->size);
 	if (ret) {
 		dev_err(&rproc->dev, "invalid firmware metadata\n");
 		return ret;
@@ -85,7 +91,8 @@ static int adsp_load(struct rproc *rproc, const struct firmware *fw)
 	if (relocate) {
 		adsp->mem_reloc = fw_addr;
 
-		ret = qcom_scm_pas_mem_setup(ADSP_PAS_ID, adsp->mem_phys, fw_size);
+		ret = qcom_scm_pas_mem_setup(adsp->pas_id,
+					adsp->mem_phys, fw_size);
 		if (ret) {
 			dev_err(&rproc->dev, "unable to setup memory for image\n");
 			return ret;
@@ -113,7 +120,7 @@ static int adsp_start(struct rproc *rproc)
 	if (ret)
 		goto disable_clocks;
 
-	ret = qcom_scm_pas_auth_and_reset(ADSP_PAS_ID);
+	ret = qcom_scm_pas_auth_and_reset(adsp->pas_id);
 	if (ret) {
 		dev_err(adsp->dev,
 			"failed to authenticate image and release reset\n");
@@ -124,7 +131,7 @@ static int adsp_start(struct rproc *rproc)
 					  msecs_to_jiffies(5000));
 	if (!ret) {
 		dev_err(adsp->dev, "start timed out\n");
-		qcom_scm_pas_shutdown(ADSP_PAS_ID);
+		qcom_scm_pas_shutdown(adsp->pas_id);
 		ret = -ETIMEDOUT;
 		goto disable_regulators;
 	}
@@ -157,7 +164,7 @@ static int adsp_stop(struct rproc *rproc)
 				    BIT(adsp->stop_bit),
 				    0);
 
-	ret = qcom_scm_pas_shutdown(ADSP_PAS_ID);
+	ret = qcom_scm_pas_shutdown(adsp->pas_id);
 	if (ret)
 		dev_err(adsp->dev, "failed to shutdown: %d\n", ret);
 
@@ -197,7 +204,7 @@ static irqreturn_t adsp_fatal_interrupt(int irq, void *dev)
 	size_t len;
 	char *msg;
 
-	msg = qcom_smem_get(QCOM_SMEM_HOST_ANY, ADSP_CRASH_REASON_SMEM, &len);
+	msg = qcom_smem_get(QCOM_SMEM_HOST_ANY, adsp->crash_reason_smem, &len);
 	if (!IS_ERR(msg) && len > 0 && msg[0])
 		dev_err(adsp->dev, "fatal error received: %s\n", msg);
 
@@ -311,20 +318,25 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
 
 static int adsp_probe(struct platform_device *pdev)
 {
+	const struct adsp_data *desc;
 	struct qcom_adsp *adsp;
 	struct rproc *rproc;
 	int ret;
 
+	desc = of_device_get_match_data(&pdev->dev);
+	if (!desc)
+		return -EINVAL;
+
 	if (!qcom_scm_is_available())
 		return -EPROBE_DEFER;
 
-	if (!qcom_scm_pas_supported(ADSP_PAS_ID)) {
-		dev_err(&pdev->dev, "PAS is not available for ADSP\n");
+	if (!qcom_scm_pas_supported(desc->pas_id)) {
+		dev_err(&pdev->dev, "PAS is not available for subsystem\n");
 		return -ENXIO;
 	}
 
 	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
-			    ADSP_FIRMWARE_NAME, sizeof(*adsp));
+			    desc->firmware_name, sizeof(*adsp));
 	if (!rproc) {
 		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
 		return -ENOMEM;
@@ -344,6 +356,8 @@ static int adsp_probe(struct platform_device *pdev)
 	if (ret)
 		goto free_rproc;
 
+	adsp->pas_id = desc->pas_id;
+	adsp->crash_reason_smem = desc->crash_reason_smem;
 	ret = adsp_init_clock(adsp);
 	if (ret)
 		goto free_rproc;
@@ -407,9 +421,14 @@ static int adsp_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct adsp_data adsp_resource_init = {
+		.crash_reason_smem = 423,
+		.firmware_name = "adsp.mdt",
+		.pas_id = 1,
+};
 static const struct of_device_id adsp_of_match[] = {
-	{ .compatible = "qcom,msm8974-adsp-pil" },
-	{ .compatible = "qcom,msm8996-adsp-pil" },
+	{ .compatible = "qcom,msm8974-adsp-pil", .data = &adsp_resource_init},
+	{ .compatible = "qcom,msm8996-adsp-pil", .data = &adsp_resource_init},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, adsp_of_match);
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

[toc] | [prev] | [next] | [standalone]


#1570339 — Re: [PATCH v3 1/4] remoteproc: qcom: Compatible string based resource initialization.

FromBjorn Andersson <bjorn.andersson@linaro.org>
Date2017-01-31 06:50 +0100
SubjectRe: [PATCH v3 1/4] remoteproc: qcom: Compatible string based resource initialization.
Message-ID<t5zuh-5gO-3@gated-at.bofh.it>
In reply to#1569814
On Mon 30 Jan 07:03 PST 2017, Avaneesh Kumar Dwivedi wrote:

> This patch initialize certain driver related data based on compatible
> string. This enable driver to handle more than one similar device in
> by differentiating in probe their private data.
> 
> Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>

Applied, thanks

Regards,
Bjorn

> ---
>  drivers/remoteproc/qcom_adsp_pil.c | 47 ++++++++++++++++++++++++++------------
>  1 file changed, 33 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c
> index 43a4ed2..f674301 100644
> --- a/drivers/remoteproc/qcom_adsp_pil.c
> +++ b/drivers/remoteproc/qcom_adsp_pil.c
> @@ -32,9 +32,12 @@
>  #include "qcom_mdt_loader.h"
>  #include "remoteproc_internal.h"
>  
> -#define ADSP_CRASH_REASON_SMEM		423
> -#define ADSP_FIRMWARE_NAME		"adsp.mdt"
> -#define ADSP_PAS_ID			1
> +struct adsp_data {
> +	int crash_reason_smem;
> +	const char *firmware_name;
> +	int pas_id;
> +};
> +
>  
>  struct qcom_adsp {
>  	struct device *dev;
> @@ -53,6 +56,9 @@ struct qcom_adsp {
>  
>  	struct regulator *cx_supply;
>  
> +	int pas_id;
> +	int crash_reason_smem;
> +
>  	struct completion start_done;
>  	struct completion stop_done;
>  
> @@ -70,7 +76,7 @@ static int adsp_load(struct rproc *rproc, const struct firmware *fw)
>  	bool relocate;
>  	int ret;
>  
> -	ret = qcom_scm_pas_init_image(ADSP_PAS_ID, fw->data, fw->size);
> +	ret = qcom_scm_pas_init_image(adsp->pas_id, fw->data, fw->size);
>  	if (ret) {
>  		dev_err(&rproc->dev, "invalid firmware metadata\n");
>  		return ret;
> @@ -85,7 +91,8 @@ static int adsp_load(struct rproc *rproc, const struct firmware *fw)
>  	if (relocate) {
>  		adsp->mem_reloc = fw_addr;
>  
> -		ret = qcom_scm_pas_mem_setup(ADSP_PAS_ID, adsp->mem_phys, fw_size);
> +		ret = qcom_scm_pas_mem_setup(adsp->pas_id,
> +					adsp->mem_phys, fw_size);
>  		if (ret) {
>  			dev_err(&rproc->dev, "unable to setup memory for image\n");
>  			return ret;
> @@ -113,7 +120,7 @@ static int adsp_start(struct rproc *rproc)
>  	if (ret)
>  		goto disable_clocks;
>  
> -	ret = qcom_scm_pas_auth_and_reset(ADSP_PAS_ID);
> +	ret = qcom_scm_pas_auth_and_reset(adsp->pas_id);
>  	if (ret) {
>  		dev_err(adsp->dev,
>  			"failed to authenticate image and release reset\n");
> @@ -124,7 +131,7 @@ static int adsp_start(struct rproc *rproc)
>  					  msecs_to_jiffies(5000));
>  	if (!ret) {
>  		dev_err(adsp->dev, "start timed out\n");
> -		qcom_scm_pas_shutdown(ADSP_PAS_ID);
> +		qcom_scm_pas_shutdown(adsp->pas_id);
>  		ret = -ETIMEDOUT;
>  		goto disable_regulators;
>  	}
> @@ -157,7 +164,7 @@ static int adsp_stop(struct rproc *rproc)
>  				    BIT(adsp->stop_bit),
>  				    0);
>  
> -	ret = qcom_scm_pas_shutdown(ADSP_PAS_ID);
> +	ret = qcom_scm_pas_shutdown(adsp->pas_id);
>  	if (ret)
>  		dev_err(adsp->dev, "failed to shutdown: %d\n", ret);
>  
> @@ -197,7 +204,7 @@ static irqreturn_t adsp_fatal_interrupt(int irq, void *dev)
>  	size_t len;
>  	char *msg;
>  
> -	msg = qcom_smem_get(QCOM_SMEM_HOST_ANY, ADSP_CRASH_REASON_SMEM, &len);
> +	msg = qcom_smem_get(QCOM_SMEM_HOST_ANY, adsp->crash_reason_smem, &len);
>  	if (!IS_ERR(msg) && len > 0 && msg[0])
>  		dev_err(adsp->dev, "fatal error received: %s\n", msg);
>  
> @@ -311,20 +318,25 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
>  
>  static int adsp_probe(struct platform_device *pdev)
>  {
> +	const struct adsp_data *desc;
>  	struct qcom_adsp *adsp;
>  	struct rproc *rproc;
>  	int ret;
>  
> +	desc = of_device_get_match_data(&pdev->dev);
> +	if (!desc)
> +		return -EINVAL;
> +
>  	if (!qcom_scm_is_available())
>  		return -EPROBE_DEFER;
>  
> -	if (!qcom_scm_pas_supported(ADSP_PAS_ID)) {
> -		dev_err(&pdev->dev, "PAS is not available for ADSP\n");
> +	if (!qcom_scm_pas_supported(desc->pas_id)) {
> +		dev_err(&pdev->dev, "PAS is not available for subsystem\n");
>  		return -ENXIO;
>  	}
>  
>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
> -			    ADSP_FIRMWARE_NAME, sizeof(*adsp));
> +			    desc->firmware_name, sizeof(*adsp));
>  	if (!rproc) {
>  		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
>  		return -ENOMEM;
> @@ -344,6 +356,8 @@ static int adsp_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto free_rproc;
>  
> +	adsp->pas_id = desc->pas_id;
> +	adsp->crash_reason_smem = desc->crash_reason_smem;
>  	ret = adsp_init_clock(adsp);
>  	if (ret)
>  		goto free_rproc;
> @@ -407,9 +421,14 @@ static int adsp_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct adsp_data adsp_resource_init = {
> +		.crash_reason_smem = 423,
> +		.firmware_name = "adsp.mdt",
> +		.pas_id = 1,
> +};
>  static const struct of_device_id adsp_of_match[] = {
> -	{ .compatible = "qcom,msm8974-adsp-pil" },
> -	{ .compatible = "qcom,msm8996-adsp-pil" },
> +	{ .compatible = "qcom,msm8974-adsp-pil", .data = &adsp_resource_init},
> +	{ .compatible = "qcom,msm8996-adsp-pil", .data = &adsp_resource_init},
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, adsp_of_match);
> -- 
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project.
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web