Re: [PATCH v7 4/4] remoteproc: qcom: Add support for mss remoteproc on msm8996

2017-10-18 Thread Sricharan R
Hi Bjorn,

On 10/17/2017 12:28 AM, Bjorn Andersson wrote:
> On Mon 16 Oct 06:19 PDT 2017, Dwivedi, Avaneesh Kumar (avani) wrote:
>> On 10/12/2017 11:50 PM, Bjorn Andersson wrote:
> [..]
>>> Please fix this and add my Acked-by
>> Sure will do, just want to ask, when i am sending updated patches, should i
>> sent all the 4 patches in series or should skip those which are acked by
>> you.
> 
> Please include all the patches in each submission (unless the maintainer
> tells you that he/she applied some of them already).
> 
> Make sure to add any "Acked-by", "Reviewed-by" and "Tested-by" on your
> patches, so that people know that they are already reviewed/tested.
> 
> 
> And finally, when resending patches, add a section between "---" and the
> diff-stat describing changes since the last version - that makes it
> easier to see what changed since last time and will help the reviewer
> look at the "new" things.

 So i was having the ipq8074 q6 remoteproc support based on this series last 
time.
 With the msm8996 now getting cleared, i will rebase my patches and repost.
 Otherwise, just hope that you were ok with the approach [1].

[1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1481961.html


Regards,
 Sricharan

-- 
"QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of 
Code Aurora Forum, hosted by The Linux Foundation

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [PATCH v7 4/4] remoteproc: qcom: Add support for mss remoteproc on msm8996

2017-10-16 Thread Bjorn Andersson
On Mon 16 Oct 06:19 PDT 2017, Dwivedi, Avaneesh Kumar (avani) wrote:
> On 10/12/2017 11:50 PM, Bjorn Andersson wrote:
[..]
> > Please fix this and add my Acked-by
> Sure will do, just want to ask, when i am sending updated patches, should i
> sent all the 4 patches in series or should skip those which are acked by
> you.

Please include all the patches in each submission (unless the maintainer
tells you that he/she applied some of them already).

Make sure to add any "Acked-by", "Reviewed-by" and "Tested-by" on your
patches, so that people know that they are already reviewed/tested.


And finally, when resending patches, add a section between "---" and the
diff-stat describing changes since the last version - that makes it
easier to see what changed since last time and will help the reviewer
look at the "new" things.

Thanks,
Bjorn


Re: [PATCH v7 4/4] remoteproc: qcom: Add support for mss remoteproc on msm8996

2017-10-16 Thread Dwivedi, Avaneesh Kumar (avani)



On 10/12/2017 11:50 PM, Bjorn Andersson wrote:

On Fri 21 Jul 03:49 PDT 2017, Avaneesh Kumar Dwivedi wrote:


This patch add support for mss boot on msm8996. Major changes
include initializing mss rproc for msm8996, making appropriate
change for executing mss reset sequence etc.

Signed-off-by: Avaneesh Kumar Dwivedi 
---
  .../devicetree/bindings/remoteproc/qcom,q6v5.txt   |   1 +
  drivers/remoteproc/qcom_q6v5_pil.c | 164 ++---
  2 files changed, 141 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 92347fe..87a8e51 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -11,6 +11,7 @@ on the Qualcomm Hexagon core.
"qcom,msm8916-mss-pil",
"qcom,msm8974-mss-pil"
  
+		"qcom,msm8996-mss-pil"

I like the empty line, but it should be after the list, not in the
middle.


  - reg:

Please fix this and add my Acked-by
Sure will do, just want to ask, when i am sending updated patches, 
should i sent all the 4 patches in series or should skip those which are 
acked by you.


Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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



Re: [PATCH v7 4/4] remoteproc: qcom: Add support for mss remoteproc on msm8996

2017-10-12 Thread Bjorn Andersson
On Fri 21 Jul 03:49 PDT 2017, Avaneesh Kumar Dwivedi wrote:

> This patch add support for mss boot on msm8996. Major changes
> include initializing mss rproc for msm8996, making appropriate
> change for executing mss reset sequence etc.
> 
> Signed-off-by: Avaneesh Kumar Dwivedi 
> ---
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt   |   1 +
>  drivers/remoteproc/qcom_q6v5_pil.c | 164 
> ++---
>  2 files changed, 141 insertions(+), 24 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 92347fe..87a8e51 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -11,6 +11,7 @@ on the Qualcomm Hexagon core.
>   "qcom,msm8916-mss-pil",
>   "qcom,msm8974-mss-pil"
>  
> + "qcom,msm8996-mss-pil"

I like the empty line, but it should be after the list, not in the
middle.

>  - reg:

Please fix this and add my Acked-by

Regards,
Bjorn


[PATCH v7 4/4] remoteproc: qcom: Add support for mss remoteproc on msm8996

2017-07-21 Thread Avaneesh Kumar Dwivedi
This patch add support for mss boot on msm8996. Major changes
include initializing mss rproc for msm8996, making appropriate
change for executing mss reset sequence etc.

Signed-off-by: Avaneesh Kumar Dwivedi 
---
 .../devicetree/bindings/remoteproc/qcom,q6v5.txt   |   1 +
 drivers/remoteproc/qcom_q6v5_pil.c | 164 ++---
 2 files changed, 141 insertions(+), 24 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 92347fe..87a8e51 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -11,6 +11,7 @@ on the Qualcomm Hexagon core.
"qcom,msm8916-mss-pil",
"qcom,msm8974-mss-pil"
 
+   "qcom,msm8996-mss-pil"
 - reg:
Usage: required
Value type: 
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c 
b/drivers/remoteproc/qcom_q6v5_pil.c
index a82b62a..808ee45 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "remoteproc_internal.h"
 #include "qcom_common.h"
@@ -64,6 +65,8 @@
 #define QDSP6SS_RESET_REG  0x014
 #define QDSP6SS_GFMUX_CTL_REG  0x020
 #define QDSP6SS_PWR_CTL_REG0x030
+#define QDSP6SS_MEM_PWR_CTL0x0B0
+#define QDSP6SS_STRAP_ACC  0x110
 
 /* AXI Halt Register Offsets */
 #define AXI_HALTREQ_REG0x0
@@ -92,6 +95,15 @@
 #define QDSS_BHS_ONBIT(21)
 #define QDSS_LDO_BYP   BIT(22)
 
+/* QDSP6v56 parameters */
+#define QDSP6v56_LDO_BYP   BIT(25)
+#define QDSP6v56_BHS_ONBIT(24)
+#define QDSP6v56_CLAMP_WL  BIT(21)
+#define QDSP6v56_CLAMP_QMC_MEM BIT(22)
+#define HALT_CHECK_MAX_LOOPS   200
+#define QDSP6SS_XO_CBCR0x0038
+#define QDSP6SS_ACC_OVERRIDE_VAL   0x20
+
 struct reg_info {
struct regulator *reg;
int uV;
@@ -110,6 +122,7 @@ struct rproc_hexagon_res {
struct qcom_mss_reg_res *active_supply;
char **proxy_clk_names;
char **active_clk_names;
+   int version;
bool need_mem_protection;
 };
 
@@ -157,6 +170,13 @@ struct q6v5 {
struct qcom_rproc_subdev smd_subdev;
int mpss_perm;
int mba_perm;
+   int version;
+};
+
+enum {
+   MSS_MSM8916,
+   MSS_MSM8974,
+   MSS_MSM8996,
 };
 
 static int q6v5_regulator_init(struct device *dev, struct reg_info *regs,
@@ -386,33 +406,98 @@ static int q6v5proc_reset(struct q6v5 *qproc)
 {
u32 val;
int ret;
+   int i;
 
-   /* Assert resets, stop core */
-   val = readl(qproc->reg_base + QDSP6SS_RESET_REG);
-   val |= (Q6SS_CORE_ARES | Q6SS_BUS_ARES_ENABLE | Q6SS_STOP_CORE);
-   writel(val, qproc->reg_base + QDSP6SS_RESET_REG);
 
-   /* Enable power block headswitch, and wait for it to stabilize */
-   val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-   val |= QDSS_BHS_ON | QDSS_LDO_BYP;
-   writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-   udelay(1);
-
-   /*
-* Turn on memories. L2 banks should be done individually
-* to minimize inrush current.
-*/
-   val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-   val |= Q6SS_SLP_RET_N | Q6SS_L2TAG_SLP_NRET_N |
-   Q6SS_ETB_SLP_NRET_N | Q6SS_L2DATA_STBY_N;
-   writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-   val |= Q6SS_L2DATA_SLP_NRET_N_2;
-   writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-   val |= Q6SS_L2DATA_SLP_NRET_N_1;
-   writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-   val |= Q6SS_L2DATA_SLP_NRET_N_0;
-   writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
+   if (qproc->version == MSS_MSM8996) {
+   /* Override the ACC value if required */
+   writel(QDSP6SS_ACC_OVERRIDE_VAL,
+  qproc->reg_base + QDSP6SS_STRAP_ACC);
+
+   /* Assert resets, stop core */
+   val = readl(qproc->reg_base + QDSP6SS_RESET_REG);
+   val |= Q6SS_CORE_ARES | Q6SS_BUS_ARES_ENABLE | Q6SS_STOP_CORE;
+   writel(val, qproc->reg_base + QDSP6SS_RESET_REG);
+
+   /* BHS require xo cbcr to be enabled */
+   val = readl(qproc->reg_base + QDSP6SS_XO_CBCR);
+   val |= 0x1;
+   writel(val, qproc->reg_base + QDSP6SS_XO_CBCR);
 
+   /* Read CLKOFF bit to go low indicating CLK is enabled */
+   ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_XO_CBCR,
+val, !(val & BIT(31)), 1,
+HALT_CHECK_MAX_LOOPS);
+   if (ret) {
+   dev_err(qproc->dev,
+