Merge tag 'rproc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Sep 2023 22:12:26 +0000 (15:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Sep 2023 22:12:26 +0000 (15:12 -0700)
Pull remoteproc updates from Bjorn Andersson:
 "Support for booting the iMX remoteprocs using MMIO, instead of SMCCC
  is added. The iMX driver is also extended to support delivering
  interrupts from an arbitrary number of vdev.

  Support is added to the TI PRU driver, to allow GPMUX to be controlled
  from DeviceTree.

  The Qualcomm coredump collector is extended to fall back to generating
  a full coredump, in the case that the loaded firmware doesn't support
  generating minidump. The overly terse MD abbreviation of "MINIDUMP" is
  expanded, to make the code easier on the eye.

  The list of Qualcomm Sensor Low Power Island (SLPI) instances
  supported is cleaned up, and SDM845 is added. SDM630/636/660 support
  for the modem subsystem (mss) is added.

  All the Qualcomm drivers are transitioned to of_reserved_mem_lookup()
  instead of open coding the resolution of reserved-memory regions, to
  gain handling of error cases. A couple of drivers are transitioned to
  use devm_platform_ioremap_resource_byname().

  The stm32 remoteproc driver's PM operations are updated to modern
  macros, to avoid the "unused variable"-warning in some configurations.

  Drivers are transitioned away from directly including of_device.h"

* tag 'rproc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (23 commits)
  remoteproc: pru: add support for configuring GPMUX based on client setup
  remoteproc: stm32: fix incorrect optional pointers
  remoteproc: imx_rproc: Switch iMX8MN/MP from SMCCC to MMIO
  dt-bindings: remoteproc: imx_rproc: Support i.MX8MN/P MMIO
  dt-bindings: remoteproc: qcom,msm8996-mss-pil: Fix 8996 clocks
  remoteproc: qcom: pas: add SDM845 SLPI compatible
  remoteproc: qcom: q6v5-mss: Add support for SDM630/636/660
  dt-bindings: remoteproc: qcom,msm8996-mss-pil: Add SDM660 compatible
  remoteproc: qcom: Expand MD_* as MINIDUMP_*
  remoteproc: qcom: pas: refactor SLPI remoteproc init
  dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas compatible
  remoteproc: qcom: wcnss: use devm_platform_ioremap_resource_byname()
  remoteproc: qcom: q6v5: use devm_platform_ioremap_resource_byname()
  dt-bindings: remoteproc: qcom: sm6115-pas: Add QCM2290
  remoteproc: qcom: Add full coredump fallback mechanism
  remoteproc: core: Export the rproc coredump APIs
  remoteproc: qcom: Use of_reserved_mem_lookup()
  remoteproc: imx_rproc: iterate all notifiyids in rx callback
  dt-bindings: remoteproc: qcom,adsp: bring back firmware-name
  dt-bindings: remoteproc: qcom,sm8550-pas: require memory-region
  ...

36 files changed:
Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml
Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
Documentation/devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml
Documentation/devicetree/bindings/remoteproc/qcom,pas-common.yaml
Documentation/devicetree/bindings/remoteproc/qcom,qcs404-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sc8180x-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sc8280xp-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sdx55-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sm6115-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sm6350-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sm8150-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sm8350-pas.yaml
Documentation/devicetree/bindings/remoteproc/qcom,sm8550-pas.yaml
drivers/remoteproc/imx_dsp_rproc.c
drivers/remoteproc/imx_rproc.c
drivers/remoteproc/imx_rproc.h
drivers/remoteproc/omap_remoteproc.c
drivers/remoteproc/pru_rproc.c
drivers/remoteproc/qcom_common.c
drivers/remoteproc/qcom_q6v5_adsp.c
drivers/remoteproc/qcom_q6v5_mss.c
drivers/remoteproc/qcom_q6v5_pas.c
drivers/remoteproc/qcom_q6v5_wcss.c
drivers/remoteproc/qcom_sysmon.c
drivers/remoteproc/qcom_wcnss.c
drivers/remoteproc/qcom_wcnss_iris.c
drivers/remoteproc/rcar_rproc.c
drivers/remoteproc/remoteproc_coredump.c
drivers/remoteproc/remoteproc_internal.h
drivers/remoteproc/st_slim_rproc.c
drivers/remoteproc/stm32_rproc.c
drivers/remoteproc/ti_k3_dsp_remoteproc.c
drivers/remoteproc/ti_k3_r5_remoteproc.c
drivers/remoteproc/wkup_m3_rproc.c
include/linux/remoteproc.h

index 0c3910f..30632ef 100644 (file)
@@ -20,7 +20,9 @@ properties:
       - fsl,imx7ulp-cm4
       - fsl,imx8mm-cm4
       - fsl,imx8mn-cm7
+      - fsl,imx8mn-cm7-mmio
       - fsl,imx8mp-cm7
+      - fsl,imx8mp-cm7-mmio
       - fsl,imx8mq-cm4
       - fsl,imx8qm-cm4
       - fsl,imx8qxp-cm4
@@ -70,6 +72,11 @@ properties:
     description:
       Specify CPU entry address for SCU enabled processor.
 
+  fsl,iomuxc-gpr:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to IOMUXC GPR block which provide access to CM7 CPUWAIT bit.
+
   fsl,resource-id:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
@@ -79,6 +86,19 @@ properties:
 required:
   - compatible
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              enum:
+                - fsl,imx8mn-cm7-mmio
+                - fsl,imx8mp-cm7-mmio
+    then:
+      properties:
+        fsl,iomuxc-gpr: false
+
 additionalProperties: false
 
 examples:
index 643ee78..a2b0079 100644 (file)
@@ -26,6 +26,7 @@ properties:
       - qcom,sdm660-adsp-pas
       - qcom,sdm845-adsp-pas
       - qcom,sdm845-cdsp-pas
+      - qcom,sdm845-slpi-pas
 
   reg:
     maxItems: 1
@@ -44,8 +45,13 @@ properties:
     maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
+  firmware-name:
+    maxItems: 1
+    description: Firmware name for the Hexagon core
+
 required:
   - compatible
+  - memory-region
 
 unevaluatedProperties: false
 
@@ -63,6 +69,7 @@ allOf:
               - qcom,msm8998-adsp-pas
               - qcom,sdm845-adsp-pas
               - qcom,sdm845-cdsp-pas
+              - qcom,sdm845-slpi-pas
     then:
       properties:
         clocks:
@@ -104,6 +111,7 @@ allOf:
               - qcom,msm8998-slpi-pas
               - qcom,sdm845-adsp-pas
               - qcom,sdm845-cdsp-pas
+              - qcom,sdm845-slpi-pas
     then:
       properties:
         interrupts:
@@ -160,6 +168,22 @@ allOf:
   - 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:
           contains:
             enum:
               - qcom,msm8226-adsp-pil
index c1ac6ca..0643faa 100644 (file)
@@ -19,6 +19,7 @@ properties:
     enum:
       - qcom,msm8996-mss-pil
       - qcom,msm8998-mss-pil
+      - qcom,sdm660-mss-pil
       - qcom,sdm845-mss-pil
 
   reg:
@@ -215,13 +216,12 @@ allOf:
             - description: GCC MSS IFACE clock
             - description: GCC MSS BUS clock
             - description: GCC MSS MEM clock
-            - description: RPMH XO clock
+            - description: RPM XO clock
             - description: GCC MSS GPLL0 clock
             - description: GCC MSS SNOC_AXI clock
             - description: GCC MSS MNOC_AXI clock
-            - description: RPMH PNOC clock
-            - description: GCC MSS PRNG clock
-            - description: RPMH QDSS clock
+            - description: RPM PNOC clock
+            - description: RPM QDSS clock
         clock-names:
           items:
             - const: iface
@@ -245,7 +245,9 @@ allOf:
   - if:
       properties:
         compatible:
-          const: qcom,msm8998-mss-pil
+          enum:
+            - qcom,msm8998-mss-pil
+            - qcom,sdm660-mss-pil
     then:
       properties:
         clocks:
index 171ef85..63a82e7 100644 (file)
@@ -82,7 +82,6 @@ required:
   - clock-names
   - interrupts
   - interrupt-names
-  - memory-region
   - qcom,smem-states
   - qcom,smem-state-names
 
index 5efa0e5..eb868a7 100644 (file)
@@ -42,7 +42,7 @@ properties:
   smd-edge: false
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   firmware-name:
@@ -52,6 +52,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index 5cefd2c..689d5d5 100644 (file)
@@ -51,7 +51,7 @@ properties:
       - const: mss
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   qcom,qmp:
@@ -67,6 +67,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index c1f8dd8..4744a37 100644 (file)
@@ -38,7 +38,7 @@ properties:
   smd-edge: false
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   firmware-name:
@@ -48,6 +48,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index f6fbc53..96d53ba 100644 (file)
@@ -38,7 +38,7 @@ properties:
   smd-edge: false
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   firmware-name:
@@ -48,6 +48,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index c66e298..5d46327 100644 (file)
@@ -46,7 +46,7 @@ properties:
       - const: mss
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   qcom,qmp:
@@ -62,6 +62,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index f5d1fa9..0282872 100644 (file)
@@ -15,10 +15,19 @@ description:
 
 properties:
   compatible:
-    enum:
-      - qcom,sm6115-adsp-pas
-      - qcom,sm6115-cdsp-pas
-      - qcom,sm6115-mpss-pas
+    oneOf:
+      - enum:
+          - qcom,sm6115-adsp-pas
+          - qcom,sm6115-cdsp-pas
+          - qcom,sm6115-mpss-pas
+
+      - items:
+          - const: qcom,qcm2290-adsp-pas
+          - const: qcom,sm6115-adsp-pas
+
+      - items:
+          - const: qcom,qcm2290-mpss-pas
+          - const: qcom,sm6115-mpss-pas
 
   reg:
     maxItems: 1
@@ -32,7 +41,7 @@ properties:
       - const: xo
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   smd-edge: false
@@ -44,15 +53,17 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
   - if:
       properties:
         compatible:
-          enum:
-            - qcom,sm6115-adsp-pas
-            - qcom,sm6115-cdsp-pas
+          contains:
+            enum:
+              - qcom,sm6115-adsp-pas
+              - qcom,sm6115-cdsp-pas
     then:
       properties:
         interrupts:
@@ -69,9 +80,10 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - qcom,sm6115-cdsp-pas
-            - qcom,sm6115-mpss-pas
+          contains:
+            enum:
+              - qcom,sm6115-cdsp-pas
+              - qcom,sm6115-mpss-pas
     then:
       properties:
         power-domains:
@@ -84,8 +96,9 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - qcom,sm6115-adsp-pas
+          contains:
+            enum:
+              - qcom,sm6115-adsp-pas
     then:
       properties:
         power-domains:
index fee02fa..f7e40fb 100644 (file)
@@ -36,7 +36,7 @@ properties:
     description: Reference to the AOSS side-channel message RAM.
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   smd-edge: false
@@ -48,6 +48,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index 2c085ac..238c6e5 100644 (file)
@@ -40,7 +40,7 @@ properties:
     description: Reference to the AOSS side-channel message RAM.
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   smd-edge: false
@@ -52,6 +52,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index 9a04d19..53cea8e 100644 (file)
@@ -43,7 +43,7 @@ properties:
   smd-edge: false
 
   memory-region:
-    minItems: 1
+    maxItems: 1
     description: Reference to the reserved-memory for the Hexagon core
 
   firmware-name:
@@ -53,6 +53,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index fe216aa..5812082 100644 (file)
@@ -53,6 +53,7 @@ properties:
 required:
   - compatible
   - reg
+  - memory-region
 
 allOf:
   - $ref: /schemas/remoteproc/qcom,pas-common.yaml#
index d95fa55..8fcda9b 100644 (file)
@@ -12,8 +12,7 @@
 #include <linux/mailbox_client.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
index f9874fc..8bb293b 100644 (file)
@@ -13,9 +13,9 @@
 #include <linux/mailbox_client.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_reserved_mem.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/regmap.h>
 #define IMX7D_M4_STOP                  (IMX7D_ENABLE_M4 | IMX7D_SW_M4C_RST | \
                                         IMX7D_SW_M4C_NON_SCLR_RST)
 
+#define IMX8M_M7_STOP                  (IMX7D_ENABLE_M4 | IMX7D_SW_M4C_RST)
+#define IMX8M_M7_POLL                  IMX7D_ENABLE_M4
+
+#define IMX8M_GPR22                    0x58
+#define IMX8M_GPR22_CM7_CPUWAIT                BIT(0)
+
 /* Address: 0x020D8000 */
 #define IMX6SX_SRC_SCR                 0x00
 #define IMX6SX_ENABLE_M4               BIT(22)
@@ -91,6 +97,7 @@ static int imx_rproc_detach_pd(struct rproc *rproc);
 struct imx_rproc {
        struct device                   *dev;
        struct regmap                   *regmap;
+       struct regmap                   *gpr;
        struct rproc                    *rproc;
        const struct imx_rproc_dcfg     *dcfg;
        struct imx_rproc_mem            mem[IMX_RPROC_MEM_MAX];
@@ -285,6 +292,18 @@ static const struct imx_rproc_att imx_rproc_att_imx6sx[] = {
        { 0x80000000, 0x80000000, 0x60000000, 0 },
 };
 
+static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mn_mmio = {
+       .src_reg        = IMX7D_SRC_SCR,
+       .src_mask       = IMX7D_M4_RST_MASK,
+       .src_start      = IMX7D_M4_START,
+       .src_stop       = IMX8M_M7_STOP,
+       .gpr_reg        = IMX8M_GPR22,
+       .gpr_wait       = IMX8M_GPR22_CM7_CPUWAIT,
+       .att            = imx_rproc_att_imx8mn,
+       .att_size       = ARRAY_SIZE(imx_rproc_att_imx8mn),
+       .method         = IMX_RPROC_MMIO,
+};
+
 static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mn = {
        .att            = imx_rproc_att_imx8mn,
        .att_size       = ARRAY_SIZE(imx_rproc_att_imx8mn),
@@ -365,8 +384,14 @@ static int imx_rproc_start(struct rproc *rproc)
 
        switch (dcfg->method) {
        case IMX_RPROC_MMIO:
-               ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask,
-                                        dcfg->src_start);
+               if (priv->gpr) {
+                       ret = regmap_clear_bits(priv->gpr, dcfg->gpr_reg,
+                                               dcfg->gpr_wait);
+               } else {
+                       ret = regmap_update_bits(priv->regmap, dcfg->src_reg,
+                                                dcfg->src_mask,
+                                                dcfg->src_start);
+               }
                break;
        case IMX_RPROC_SMC:
                arm_smccc_smc(IMX_SIP_RPROC, IMX_SIP_RPROC_START, 0, 0, 0, 0, 0, 0, &res);
@@ -395,6 +420,16 @@ static int imx_rproc_stop(struct rproc *rproc)
 
        switch (dcfg->method) {
        case IMX_RPROC_MMIO:
+               if (priv->gpr) {
+                       ret = regmap_set_bits(priv->gpr, dcfg->gpr_reg,
+                                             dcfg->gpr_wait);
+                       if (ret) {
+                               dev_err(priv->dev,
+                                       "Failed to quiescence M4 platform!\n");
+                               return ret;
+                       }
+               }
+
                ret = regmap_update_bits(priv->regmap, dcfg->src_reg, dcfg->src_mask,
                                         dcfg->src_stop);
                break;
@@ -725,13 +760,22 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
        return 0;
 }
 
+static int imx_rproc_notified_idr_cb(int id, void *ptr, void *data)
+{
+       struct rproc *rproc = data;
+
+       rproc_vq_interrupt(rproc, id);
+
+       return 0;
+}
+
 static void imx_rproc_vq_work(struct work_struct *work)
 {
        struct imx_rproc *priv = container_of(work, struct imx_rproc,
                                              rproc_work);
+       struct rproc *rproc = priv->rproc;
 
-       rproc_vq_interrupt(priv->rproc, 0);
-       rproc_vq_interrupt(priv->rproc, 1);
+       idr_for_each(&rproc->notifyids, imx_rproc_notified_idr_cb, rproc);
 }
 
 static void imx_rproc_rx_callback(struct mbox_client *cl, void *msg)
@@ -983,6 +1027,10 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv)
                break;
        }
 
+       priv->gpr = syscon_regmap_lookup_by_phandle(dev->of_node, "fsl,iomuxc-gpr");
+       if (IS_ERR(priv->gpr))
+               priv->gpr = NULL;
+
        regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
        if (IS_ERR(regmap)) {
                dev_err(dev, "failed to find syscon\n");
@@ -992,6 +1040,19 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv)
        priv->regmap = regmap;
        regmap_attach_dev(dev, regmap, &config);
 
+       if (priv->gpr) {
+               ret = regmap_read(priv->gpr, dcfg->gpr_reg, &val);
+               if (val & dcfg->gpr_wait) {
+                       /*
+                        * After cold boot, the CM indicates its in wait
+                        * state, but not fully powered off. Power it off
+                        * fully so firmware can be loaded into it.
+                        */
+                       imx_rproc_stop(priv->rproc);
+                       return 0;
+               }
+       }
+
        ret = regmap_read(regmap, dcfg->src_reg, &val);
        if (ret) {
                dev_err(dev, "Failed to read src\n");
@@ -1133,6 +1194,8 @@ static const struct of_device_id imx_rproc_of_match[] = {
        { .compatible = "fsl,imx8mm-cm4", .data = &imx_rproc_cfg_imx8mq },
        { .compatible = "fsl,imx8mn-cm7", .data = &imx_rproc_cfg_imx8mn },
        { .compatible = "fsl,imx8mp-cm7", .data = &imx_rproc_cfg_imx8mn },
+       { .compatible = "fsl,imx8mn-cm7-mmio", .data = &imx_rproc_cfg_imx8mn_mmio },
+       { .compatible = "fsl,imx8mp-cm7-mmio", .data = &imx_rproc_cfg_imx8mn_mmio },
        { .compatible = "fsl,imx8qxp-cm4", .data = &imx_rproc_cfg_imx8qxp },
        { .compatible = "fsl,imx8qm-cm4", .data = &imx_rproc_cfg_imx8qm },
        { .compatible = "fsl,imx8ulp-cm33", .data = &imx_rproc_cfg_imx8ulp },
index 1c7e212..79a1b89 100644 (file)
@@ -31,6 +31,8 @@ struct imx_rproc_dcfg {
        u32                             src_mask;
        u32                             src_start;
        u32                             src_stop;
+       u32                             gpr_reg;
+       u32                             gpr_wait;
        const struct imx_rproc_att      *att;
        size_t                          att_size;
        enum imx_rproc_method           method;
index 82ed90f..8f50ab8 100644 (file)
@@ -19,7 +19,8 @@
 #include <linux/clk/ti.h>
 #include <linux/err.h>
 #include <linux/io.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
index 2874c8d..327f0c7 100644 (file)
@@ -16,8 +16,9 @@
 #include <linux/debugfs.h>
 #include <linux/irqdomain.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_irq.h>
+#include <linux/platform_device.h>
 #include <linux/remoteproc/pruss.h>
 #include <linux/pruss_driver.h>
 #include <linux/remoteproc.h>
@@ -109,6 +110,7 @@ struct pru_private_data {
  * @dbg_single_step: debug state variable to set PRU into single step mode
  * @dbg_continuous: debug state variable to restore PRU execution mode
  * @evt_count: number of mapped events
+ * @gpmux_save: saved value for gpmux config
  */
 struct pru_rproc {
        int id;
@@ -127,6 +129,7 @@ struct pru_rproc {
        u32 dbg_single_step;
        u32 dbg_continuous;
        u8 evt_count;
+       u8 gpmux_save;
 };
 
 static inline u32 pru_control_read_reg(struct pru_rproc *pru, unsigned int reg)
@@ -228,6 +231,7 @@ struct rproc *pru_rproc_get(struct device_node *np, int index,
        struct device *dev;
        const char *fw_name;
        int ret;
+       u32 mux;
 
        rproc = __pru_rproc_get(np, index);
        if (IS_ERR(rproc))
@@ -252,6 +256,23 @@ struct rproc *pru_rproc_get(struct device_node *np, int index,
        if (pru_id)
                *pru_id = pru->id;
 
+       ret = pruss_cfg_get_gpmux(pru->pruss, pru->id, &pru->gpmux_save);
+       if (ret) {
+               dev_err(dev, "failed to get cfg gpmux: %d\n", ret);
+               goto err;
+       }
+
+       /* An error here is acceptable for backward compatibility */
+       ret = of_property_read_u32_index(np, "ti,pruss-gp-mux-sel", index,
+                                        &mux);
+       if (!ret) {
+               ret = pruss_cfg_set_gpmux(pru->pruss, pru->id, mux);
+               if (ret) {
+                       dev_err(dev, "failed to set cfg gpmux: %d\n", ret);
+                       goto err;
+               }
+       }
+
        ret = of_property_read_string_index(np, "firmware-name", index,
                                            &fw_name);
        if (!ret) {
@@ -290,6 +311,8 @@ void pru_rproc_put(struct rproc *rproc)
 
        pru = rproc->priv;
 
+       pruss_cfg_set_gpmux(pru->pruss, pru->id, pru->gpmux_save);
+
        pru_rproc_set_firmware(rproc, NULL);
 
        mutex_lock(&pru->lock);
index a0d4238..03e5f5d 100644 (file)
@@ -29,9 +29,9 @@
 #define MAX_NUM_OF_SS           10
 #define MAX_REGION_NAME_LENGTH  16
 #define SBL_MINIDUMP_SMEM_ID   602
-#define MD_REGION_VALID                ('V' << 24 | 'A' << 16 | 'L' << 8 | 'I' << 0)
-#define MD_SS_ENCR_DONE                ('D' << 24 | 'O' << 16 | 'N' << 8 | 'E' << 0)
-#define MD_SS_ENABLED          ('E' << 24 | 'N' << 16 | 'B' << 8 | 'L' << 0)
+#define MINIDUMP_REGION_VALID          ('V' << 24 | 'A' << 16 | 'L' << 8 | 'I' << 0)
+#define MINIDUMP_SS_ENCR_DONE          ('D' << 24 | 'O' << 16 | 'N' << 8 | 'E' << 0)
+#define MINIDUMP_SS_ENABLED            ('E' << 24 | 'N' << 16 | 'B' << 8 | 'L' << 0)
 
 /**
  * struct minidump_region - Minidump region
@@ -125,7 +125,7 @@ static int qcom_add_minidump_segments(struct rproc *rproc, struct minidump_subsy
 
        for (i = 0; i < seg_cnt; i++) {
                memcpy_fromio(&region, ptr + i, sizeof(region));
-               if (le32_to_cpu(region.valid) == MD_REGION_VALID) {
+               if (le32_to_cpu(region.valid) == MINIDUMP_REGION_VALID) {
                        name = kstrndup(region.name, MAX_REGION_NAME_LENGTH - 1, GFP_KERNEL);
                        if (!name) {
                                iounmap(ptr);
@@ -168,12 +168,21 @@ void qcom_minidump(struct rproc *rproc, unsigned int minidump_id,
         */
        if (subsystem->regions_baseptr == 0 ||
            le32_to_cpu(subsystem->status) != 1 ||
-           le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED ||
-           le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) {
+           le32_to_cpu(subsystem->enabled) != MINIDUMP_SS_ENABLED) {
+               return rproc_coredump(rproc);
+       }
+
+       if (le32_to_cpu(subsystem->encryption_status) != MINIDUMP_SS_ENCR_DONE) {
                dev_err(&rproc->dev, "Minidump not ready, skipping\n");
                return;
        }
 
+       /**
+        * Clear out the dump segments populated by parse_fw before
+        * re-populating them with minidump segments.
+        */
+       rproc_coredump_cleanup(rproc);
+
        ret = qcom_add_minidump_segments(rproc, subsystem, rproc_dumpfn_t);
        if (ret) {
                dev_err(&rproc->dev, "Failed with error: %d while adding minidump entries\n", ret);
index 6777a3b..6c67514 100644 (file)
@@ -14,8 +14,8 @@
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
@@ -637,28 +637,26 @@ static int adsp_init_mmio(struct qcom_adsp *adsp,
 
 static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
 {
+       struct reserved_mem *rmem = NULL;
        struct device_node *node;
-       struct resource r;
-       int ret;
 
        node = of_parse_phandle(adsp->dev->of_node, "memory-region", 0);
-       if (!node) {
-               dev_err(adsp->dev, "no memory-region specified\n");
+       if (node)
+               rmem = of_reserved_mem_lookup(node);
+       of_node_put(node);
+
+       if (!rmem) {
+               dev_err(adsp->dev, "unable to resolve memory-region\n");
                return -EINVAL;
        }
 
-       ret = of_address_to_resource(node, 0, &r);
-       of_node_put(node);
-       if (ret)
-               return ret;
-
-       adsp->mem_phys = adsp->mem_reloc = r.start;
-       adsp->mem_size = resource_size(&r);
+       adsp->mem_phys = adsp->mem_reloc = rmem->base;
+       adsp->mem_size = rmem->size;
        adsp->mem_region = devm_ioremap_wc(adsp->dev,
                                adsp->mem_phys, adsp->mem_size);
        if (!adsp->mem_region) {
                dev_err(adsp->dev, "unable to map memory region: %pa+%zx\n",
-                       &r.start, adsp->mem_size);
+                       &rmem->base, adsp->mem_size);
                return -EBUSY;
        }
 
index 70bffc9..22fe7b5 100644 (file)
@@ -15,9 +15,9 @@
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
@@ -71,6 +71,7 @@
 #define QDSP6SS_MEM_PWR_CTL            0x0B0
 #define QDSP6V6SS_MEM_PWR_CTL          0x034
 #define QDSP6SS_STRAP_ACC              0x110
+#define QDSP6V62SS_BHS_STATUS          0x0C4
 
 /* AXI Halt Register Offsets */
 #define AXI_HALTREQ_REG                        0x0
 #define QDSP6v56_CLAMP_QMC_MEM         BIT(22)
 #define QDSP6SS_XO_CBCR                0x0038
 #define QDSP6SS_ACC_OVERRIDE_VAL               0x20
+#define QDSP6v55_BHS_EN_REST_ACK       BIT(0)
 
 /* QDSP6v65 parameters */
 #define QDSP6SS_CORE_CBCR              0x20
 #define QDSP6SS_BOOT_CORE_START         0x400
 #define QDSP6SS_BOOT_CMD                0x404
 #define BOOT_FSM_TIMEOUT                10000
+#define BHS_CHECK_MAX_LOOPS             200
 
 struct reg_info {
        struct regulator *reg;
@@ -250,6 +253,7 @@ enum {
        MSS_MSM8998,
        MSS_SC7180,
        MSS_SC7280,
+       MSS_SDM660,
        MSS_SDM845,
 };
 
@@ -700,7 +704,8 @@ static int q6v5proc_reset(struct q6v5 *qproc)
        } else if (qproc->version == MSS_MSM8909 ||
                   qproc->version == MSS_MSM8953 ||
                   qproc->version == MSS_MSM8996 ||
-                  qproc->version == MSS_MSM8998) {
+                  qproc->version == MSS_MSM8998 ||
+                  qproc->version == MSS_SDM660) {
 
                if (qproc->version != MSS_MSM8909 &&
                    qproc->version != MSS_MSM8953)
@@ -734,6 +739,16 @@ static int q6v5proc_reset(struct q6v5 *qproc)
                val |= readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG);
                udelay(1);
 
+               if (qproc->version == MSS_SDM660) {
+                       ret = readl_relaxed_poll_timeout(qproc->reg_base + QDSP6V62SS_BHS_STATUS,
+                                                        i, (i & QDSP6v55_BHS_EN_REST_ACK),
+                                                        1, BHS_CHECK_MAX_LOOPS);
+                       if (ret == -ETIMEDOUT) {
+                               dev_err(qproc->dev, "BHS_EN_REST_ACK not set!\n");
+                               return -ETIMEDOUT;
+                       }
+               }
+
                /* Put LDO in bypass mode */
                val |= QDSP6v56_LDO_BYP;
                writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
@@ -756,7 +771,7 @@ static int q6v5proc_reset(struct q6v5 *qproc)
                                mem_pwr_ctl = QDSP6SS_MEM_PWR_CTL;
                                i = 19;
                        } else {
-                               /* MSS_MSM8998 */
+                               /* MSS_MSM8998, MSS_SDM660 */
                                mem_pwr_ctl = QDSP6V6SS_MEM_PWR_CTL;
                                i = 28;
                        }
@@ -1875,8 +1890,6 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
        struct device_node *child;
        struct reserved_mem *rmem;
        struct device_node *node;
-       struct resource r;
-       int ret;
 
        /*
         * In the absence of mba/mpss sub-child, extract the mba and mpss
@@ -1891,15 +1904,20 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
                of_node_put(child);
        }
 
-       ret = of_address_to_resource(node, 0, &r);
+       if (!node) {
+               dev_err(qproc->dev, "no mba memory-region specified\n");
+               return -EINVAL;
+       }
+
+       rmem = of_reserved_mem_lookup(node);
        of_node_put(node);
-       if (ret) {
+       if (!rmem) {
                dev_err(qproc->dev, "unable to resolve mba region\n");
-               return ret;
+               return -EINVAL;
        }
 
-       qproc->mba_phys = r.start;
-       qproc->mba_size = resource_size(&r);
+       qproc->mba_phys = rmem->base;
+       qproc->mba_size = rmem->size;
 
        if (!child) {
                node = of_parse_phandle(qproc->dev->of_node,
@@ -1910,15 +1928,20 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
                of_node_put(child);
        }
 
-       ret = of_address_to_resource(node, 0, &r);
+       if (!node) {
+               dev_err(qproc->dev, "no mpss memory-region specified\n");
+               return -EINVAL;
+       }
+
+       rmem = of_reserved_mem_lookup(node);
        of_node_put(node);
-       if (ret) {
+       if (!rmem) {
                dev_err(qproc->dev, "unable to resolve mpss region\n");
-               return ret;
+               return -EINVAL;
        }
 
-       qproc->mpss_phys = qproc->mpss_reloc = r.start;
-       qproc->mpss_size = resource_size(&r);
+       qproc->mpss_phys = qproc->mpss_reloc = rmem->base;
+       qproc->mpss_size = rmem->size;
 
        if (!child) {
                node = of_parse_phandle(qproc->dev->of_node, "memory-region", 2);
@@ -2191,6 +2214,37 @@ static const struct rproc_hexagon_res sc7280_mss = {
        .version = MSS_SC7280,
 };
 
+static const struct rproc_hexagon_res sdm660_mss = {
+       .hexagon_mba_image = "mba.mbn",
+       .proxy_clk_names = (char*[]){
+                       "xo",
+                       "qdss",
+                       "mem",
+                       NULL
+       },
+       .active_clk_names = (char*[]){
+                       "iface",
+                       "bus",
+                       "gpll0_mss",
+                       "mnoc_axi",
+                       "snoc_axi",
+                       NULL
+       },
+       .proxy_pd_names = (char*[]){
+                       "cx",
+                       "mx",
+                       NULL
+       },
+       .need_mem_protection = true,
+       .has_alt_reset = false,
+       .has_mba_logs = false,
+       .has_spare_reg = false,
+       .has_qaccept_regs = false,
+       .has_ext_cntl_regs = false,
+       .has_vq6 = false,
+       .version = MSS_SDM660,
+};
+
 static const struct rproc_hexagon_res sdm845_mss = {
        .hexagon_mba_image = "mba.mbn",
        .proxy_clk_names = (char*[]){
@@ -2473,6 +2527,7 @@ static const struct of_device_id q6v5_of_match[] = {
        { .compatible = "qcom,msm8998-mss-pil", .data = &msm8998_mss},
        { .compatible = "qcom,sc7180-mss-pil", .data = &sc7180_mss},
        { .compatible = "qcom,sc7280-mss-pil", .data = &sc7280_mss},
+       { .compatible = "qcom,sdm660-mss-pil", .data = &sdm660_mss},
        { .compatible = "qcom,sdm845-mss-pil", .data = &sdm845_mss},
        { },
 };
index 3153d82..b5447dd 100644 (file)
@@ -13,8 +13,9 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
@@ -425,6 +426,7 @@ static const struct rproc_ops adsp_minidump_ops = {
        .start = adsp_start,
        .stop = adsp_stop,
        .da_to_va = adsp_da_to_va,
+       .parse_fw = qcom_register_dump_segments,
        .load = adsp_load,
        .panic = adsp_panic,
        .coredump = adsp_minidump,
@@ -533,9 +535,8 @@ static void adsp_pds_detach(struct qcom_adsp *adsp, struct device **pds,
 
 static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
 {
+       struct reserved_mem *rmem;
        struct device_node *node;
-       struct resource r;
-       int ret;
 
        node = of_parse_phandle(adsp->dev->of_node, "memory-region", 0);
        if (!node) {
@@ -543,17 +544,19 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
                return -EINVAL;
        }
 
-       ret = of_address_to_resource(node, 0, &r);
+       rmem = of_reserved_mem_lookup(node);
        of_node_put(node);
-       if (ret)
-               return ret;
+       if (!rmem) {
+               dev_err(adsp->dev, "unable to resolve memory-region\n");
+               return -EINVAL;
+       }
 
-       adsp->mem_phys = adsp->mem_reloc = r.start;
-       adsp->mem_size = resource_size(&r);
+       adsp->mem_phys = adsp->mem_reloc = rmem->base;
+       adsp->mem_size = rmem->size;
        adsp->mem_region = devm_ioremap_wc(adsp->dev, adsp->mem_phys, adsp->mem_size);
        if (!adsp->mem_region) {
                dev_err(adsp->dev, "unable to map memory region: %pa+%zx\n",
-                       &r.start, adsp->mem_size);
+                       &rmem->base, adsp->mem_size);
                return -EBUSY;
        }
 
@@ -566,16 +569,19 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
                return -EINVAL;
        }
 
-       ret = of_address_to_resource(node, 0, &r);
-       if (ret)
-               return ret;
+       rmem = of_reserved_mem_lookup(node);
+       of_node_put(node);
+       if (!rmem) {
+               dev_err(adsp->dev, "unable to resolve dtb memory-region\n");
+               return -EINVAL;
+       }
 
-       adsp->dtb_mem_phys = adsp->dtb_mem_reloc = r.start;
-       adsp->dtb_mem_size = resource_size(&r);
+       adsp->dtb_mem_phys = adsp->dtb_mem_reloc = rmem->base;
+       adsp->dtb_mem_size = rmem->size;
        adsp->dtb_mem_region = devm_ioremap_wc(adsp->dev, adsp->dtb_mem_phys, adsp->dtb_mem_size);
        if (!adsp->dtb_mem_region) {
                dev_err(adsp->dev, "unable to map dtb memory region: %pa+%zx\n",
-                       &r.start, adsp->dtb_mem_size);
+                       &rmem->base, adsp->dtb_mem_size);
                return -EBUSY;
        }
 
@@ -584,29 +590,28 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
 
 static int adsp_assign_memory_region(struct qcom_adsp *adsp)
 {
+       struct reserved_mem *rmem = NULL;
        struct qcom_scm_vmperm perm;
        struct device_node *node;
-       struct resource r;
        int ret;
 
        if (!adsp->region_assign_idx)
                return 0;
 
        node = of_parse_phandle(adsp->dev->of_node, "memory-region", adsp->region_assign_idx);
-       if (!node) {
-               dev_err(adsp->dev, "missing shareable memory-region\n");
+       if (node)
+               rmem = of_reserved_mem_lookup(node);
+       of_node_put(node);
+       if (!rmem) {
+               dev_err(adsp->dev, "unable to resolve shareable memory-region\n");
                return -EINVAL;
        }
 
-       ret = of_address_to_resource(node, 0, &r);
-       if (ret)
-               return ret;
-
        perm.vmid = QCOM_SCM_VMID_MSS_MSA;
        perm.perm = QCOM_SCM_PERM_RW;
 
-       adsp->region_assign_phys = r.start;
-       adsp->region_assign_size = resource_size(&r);
+       adsp->region_assign_phys = rmem->base;
+       adsp->region_assign_size = rmem->size;
        adsp->region_assign_perms = BIT(QCOM_SCM_VMID_HLOS);
 
        ret = qcom_scm_assign_mem(adsp->region_assign_phys,
@@ -1012,7 +1017,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,
@@ -1026,7 +1031,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,
@@ -1042,38 +1047,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",
@@ -1182,9 +1155,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 },
@@ -1199,6 +1172,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},
@@ -1209,17 +1183,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},
index b437044..cff1fa0 100644 (file)
@@ -837,8 +837,7 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss *wcss,
                return -ENOMEM;
 
        if (wcss->version == WCSS_IPQ8074) {
-               res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rmb");
-               wcss->rmb_base = devm_ioremap_resource(&pdev->dev, res);
+               wcss->rmb_base = devm_platform_ioremap_resource_byname(pdev, "rmb");
                if (IS_ERR(wcss->rmb_base))
                        return PTR_ERR(wcss->rmb_base);
        }
index 746f56b..c24e4a8 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/of_irq.h>
-#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/remoteproc/qcom_rproc.h>
 #include <linux/rpmsg.h>
index 1ed0647..90de22c 100644 (file)
@@ -14,8 +14,8 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/io.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
@@ -506,27 +506,25 @@ static int wcnss_request_irq(struct qcom_wcnss *wcnss,
 
 static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss)
 {
+       struct reserved_mem *rmem = NULL;
        struct device_node *node;
-       struct resource r;
-       int ret;
 
        node = of_parse_phandle(wcnss->dev->of_node, "memory-region", 0);
-       if (!node) {
-               dev_err(wcnss->dev, "no memory-region specified\n");
+       if (node)
+               rmem = of_reserved_mem_lookup(node);
+       of_node_put(node);
+
+       if (!rmem) {
+               dev_err(wcnss->dev, "unable to resolve memory-region\n");
                return -EINVAL;
        }
 
-       ret = of_address_to_resource(node, 0, &r);
-       of_node_put(node);
-       if (ret)
-               return ret;
-
-       wcnss->mem_phys = wcnss->mem_reloc = r.start;
-       wcnss->mem_size = resource_size(&r);
+       wcnss->mem_phys = wcnss->mem_reloc = rmem->base;
+       wcnss->mem_size = rmem->size;
        wcnss->mem_region = devm_ioremap_wc(wcnss->dev, wcnss->mem_phys, wcnss->mem_size);
        if (!wcnss->mem_region) {
                dev_err(wcnss->dev, "unable to map memory region: %pa+%zx\n",
-                       &r.start, wcnss->mem_size);
+                       &rmem->base, wcnss->mem_size);
                return -EBUSY;
        }
 
@@ -538,7 +536,6 @@ static int wcnss_probe(struct platform_device *pdev)
        const char *fw_name = WCNSS_FIRMWARE_NAME;
        const struct wcnss_data *data;
        struct qcom_wcnss *wcnss;
-       struct resource *res;
        struct rproc *rproc;
        void __iomem *mmio;
        int ret;
@@ -576,8 +573,7 @@ static int wcnss_probe(struct platform_device *pdev)
 
        mutex_init(&wcnss->iris_lock);
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pmu");
-       mmio = devm_ioremap_resource(&pdev->dev, res);
+       mmio = devm_platform_ioremap_resource_byname(pdev, "pmu");
        if (IS_ERR(mmio)) {
                ret = PTR_ERR(mmio);
                goto free_rproc;
index 09720dd..dd36fd0 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
index 90e8769..cc17e84 100644 (file)
@@ -5,8 +5,9 @@
 
 #include <linux/limits.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/remoteproc.h>
 #include <linux/reset.h>
index bc0e160..6ede8c0 100644 (file)
@@ -32,6 +32,7 @@ void rproc_coredump_cleanup(struct rproc *rproc)
                kfree(entry);
        }
 }
+EXPORT_SYMBOL_GPL(rproc_coredump_cleanup);
 
 /**
  * rproc_coredump_add_segment() - add segment of device memory to coredump
@@ -327,6 +328,7 @@ void rproc_coredump(struct rproc *rproc)
         */
        wait_for_completion(&dump_state.dump_done);
 }
+EXPORT_SYMBOL_GPL(rproc_coredump);
 
 /**
  * rproc_coredump_using_sections() - perform coredump using section headers
index d4dbb8d..f62a82d 100644 (file)
@@ -76,10 +76,6 @@ extern struct class rproc_class;
 int rproc_init_sysfs(void);
 void rproc_exit_sysfs(void);
 
-/* from remoteproc_coredump.c */
-void rproc_coredump_cleanup(struct rproc *rproc);
-void rproc_coredump(struct rproc *rproc);
-
 #ifdef CONFIG_REMOTEPROC_CDEV
 void rproc_init_cdev(void);
 void rproc_exit_cdev(void);
index 4ed9467..d177193 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/remoteproc.h>
 #include <linux/remoteproc/st_slim_rproc.h>
index cf073ba..9d9b135 100644 (file)
@@ -12,9 +12,9 @@
 #include <linux/mailbox_client.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/platform_device.h>
 #include <linux/pm_wakeirq.h>
 #include <linux/regmap.h>
 #include <linux/remoteproc.h>
@@ -921,7 +921,7 @@ static void stm32_rproc_remove(struct platform_device *pdev)
        rproc_free(rproc);
 }
 
-static int __maybe_unused stm32_rproc_suspend(struct device *dev)
+static int stm32_rproc_suspend(struct device *dev)
 {
        struct rproc *rproc = dev_get_drvdata(dev);
        struct stm32_rproc *ddata = rproc->priv;
@@ -932,7 +932,7 @@ static int __maybe_unused stm32_rproc_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused stm32_rproc_resume(struct device *dev)
+static int stm32_rproc_resume(struct device *dev)
 {
        struct rproc *rproc = dev_get_drvdata(dev);
        struct stm32_rproc *ddata = rproc->priv;
@@ -943,16 +943,16 @@ static int __maybe_unused stm32_rproc_resume(struct device *dev)
        return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops,
-                        stm32_rproc_suspend, stm32_rproc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops,
+                               stm32_rproc_suspend, stm32_rproc_resume);
 
 static struct platform_driver stm32_rproc_driver = {
        .probe = stm32_rproc_probe,
        .remove_new = stm32_rproc_remove,
        .driver = {
                .name = "stm32-rproc",
-               .pm = &stm32_rproc_pm_ops,
-               .of_match_table = of_match_ptr(stm32_rproc_match),
+               .pm = pm_ptr(&stm32_rproc_pm_ops),
+               .of_match_table = stm32_rproc_match,
        },
 };
 module_platform_driver(stm32_rproc_driver);
index ec626a3..ef8415a 100644 (file)
@@ -9,7 +9,7 @@
 #include <linux/io.h>
 #include <linux/mailbox_client.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/omap-mailbox.h>
 #include <linux/platform_device.h>
index 23fe44d..ad3415a 100644 (file)
 #include <linux/kernel.h>
 #include <linux/mailbox_client.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/of_platform.h>
 #include <linux/omap-mailbox.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
index 120dc7d..36a55f7 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
index fe8978e..b479569 100644 (file)
@@ -690,6 +690,10 @@ int rproc_detach(struct rproc *rproc);
 int rproc_set_firmware(struct rproc *rproc, const char *fw_name);
 void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
 void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem);
+
+/* from remoteproc_coredump.c */
+void rproc_coredump_cleanup(struct rproc *rproc);
+void rproc_coredump(struct rproc *rproc);
 void rproc_coredump_using_sections(struct rproc *rproc);
 int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size);
 int rproc_coredump_add_custom_segment(struct rproc *rproc,