2021-06-07 15:41:58

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 00/13] Use qmp_send to update co-processor load state

The power domains exposed by the AOSS QMP driver control the load state
resources linked to modem, adsp, cdsp remoteprocs. These are used to
notify the Always on Subsystem (AOSS) that a particular co-processor is
up/down. AOSS uses this information to wait for the co-processors to
suspend before starting its sleep sequence. These co-processors enter
low-power modes independent to that of the application processor and
the load state resources linked to them are expected to remain unaltered
across system suspend/resume cycles. To achieve this behavior let's stop
modeling them as power-domains and replace them with generic qmp_send
interface instead.

https://lore.kernel.org/lkml/20200913034603.GV3715@yoga/
Previous dicussion on dropping power-domain support from AOSS QMP driver

Depends on:
qmp_send: https://patchwork.kernel.org/project/linux-arm-msm/cover/[email protected]/
rproc,adsp_yaml: https://patchwork.kernel.org/project/linux-arm-msm/patch/[email protected]/

V2:
* load_state is currently broken on mainline so be safely dropped
without side-effects.
* Rebased on top of qmp_send v3 series.
* Dropped R-b from Stephen and Rob on patch 3 due to the yaml
conversion.
* New patch [12] to drop unused aoss-qmp header.
* Commit message update [patch 1] [Rob]
* Reorder the series [Stephen]

Sibi Sankar (13):
dt-bindings: soc: qcom: aoss: Drop power-domain bindings
dt-bindings: remoteproc: qcom: pas: Add QMP bindings
dt-bindings: remoteproc: qcom: Add QMP bindings
remoteproc: qcom: q6v5: Use qmp_send to update co-processor load state
arm64: dts: qcom: sc7180: Use QMP binding to control load state
arm64: dts: qcom: sc7280: Use QMP binding to control load state
arm64: dts: qcom: sdm845: Use QMP binding to control load state
arm64: dts: qcom: sm8150: Use QMP binding to control load state
arm64: dts: qcom: sm8250: Use QMP binding to control load state
arm64: dts: qcom: sm8350: Use QMP binding to control load state
soc: qcom: aoss: Drop power domain support
dt-bindings: msm/dp: Remove aoss-qmp header
dt-bindings: soc: qcom: aoss: Delete unused power-domain definitions

.../bindings/display/msm/dp-controller.yaml | 1 -
.../devicetree/bindings/remoteproc/qcom,adsp.yaml | 40 +++++---
.../devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 +-
.../devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt | 16 +--
arch/arm64/boot/dts/qcom/sc7180.dtsi | 9 +-
arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 -
arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 +-
arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 +++---
arch/arm64/boot/dts/qcom/sm8250.dtsi | 22 ++---
arch/arm64/boot/dts/qcom/sm8350.dtsi | 30 +++---
drivers/remoteproc/qcom_q6v5.c | 56 ++++++++++-
drivers/remoteproc/qcom_q6v5.h | 7 +-
drivers/remoteproc/qcom_q6v5_adsp.c | 7 +-
drivers/remoteproc/qcom_q6v5_mss.c | 44 ++-------
drivers/remoteproc/qcom_q6v5_pas.c | 80 ++++-----------
drivers/remoteproc/qcom_q6v5_wcss.c | 4 +-
drivers/soc/qcom/qcom_aoss.c | 109 +--------------------
include/dt-bindings/power/qcom-aoss-qmp.h | 14 ---
18 files changed, 181 insertions(+), 303 deletions(-)
delete mode 100644 include/dt-bindings/power/qcom-aoss-qmp.h

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2021-06-07 15:42:23

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 02/13] dt-bindings: remoteproc: qcom: pas: Add QMP bindings

Add Qualcomm Mailbox Protocol (QMP) binding to replace the power domains
exposed by the AOSS QMP node.

Signed-off-by: Sibi Sankar <[email protected]>
---

v2:
* Drop R-b from Rob/Stephen due to yaml conversion.

.../devicetree/bindings/remoteproc/qcom,adsp.yaml | 40 +++++++++++++++-------
1 file changed, 27 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
index 9ea05e608bc1..b6396bc07388 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
@@ -89,6 +89,10 @@ properties:
maxItems: 1
description: Reference to the reserved-memory for the Hexagon core

+ qcom,qmp:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description: Reference to the AOSS side-channel message RAM.
+
qcom,smem-states:
$ref: /schemas/types.yaml#/definitions/phandle-array
description: States used by the AP to signal the Hexagon core
@@ -359,13 +363,11 @@ allOf:
properties:
power-domains:
items:
- - description: Load State power domain
- description: CX power domain
- description: MX power domain
- description: MSS power domain
power-domain-names:
items:
- - const: load_state
- const: cx
- const: mx
- const: mss
@@ -381,12 +383,7 @@ allOf:
properties:
power-domains:
items:
- - description: Load State power domain
- description: CX power domain
- power-domain-names:
- items:
- - const: load_state
- - const: cx

- if:
properties:
@@ -399,12 +396,10 @@ allOf:
properties:
power-domains:
items:
- - description: Load State power domain
- description: CX power domain
- description: MSS power domain
power-domain-names:
items:
- - const: load_state
- const: cx
- const: mss

@@ -439,12 +434,10 @@ allOf:
properties:
power-domains:
items:
- - description: Load State power domain
- description: LCX power domain
- description: LMX power domain
power-domain-names:
items:
- - const: load_state
- const: lcx
- const: lmx

@@ -458,12 +451,10 @@ allOf:
properties:
power-domains:
items:
- - description: Load State power domain
- description: CX power domain
- description: MXC power domain
power-domain-names:
items:
- - const: load_state
- const: cx
- const: mxc

@@ -499,6 +490,29 @@ allOf:
- const: mss_restart
- const: pdc_reset

+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,sc7180-mpss-pas
+ - qcom,sm8150-adsp-pas
+ - qcom,sm8150-cdsp-pas
+ - qcom,sm8150-mpss-pas
+ - qcom,sm8150-slpi-pas
+ - qcom,sm8250-adsp-pas
+ - qcom,sm8250-cdsp-pas
+ - qcom,sm8250-slpi-pas
+ - qcom,sm8350-adsp-pas
+ - qcom,sm8350-cdsp-pas
+ - qcom,sm8350-mpss-pas
+ - qcom,sm8350-slpi-pas
+ then:
+ properties:
+ qcom,qmp:
+ items:
+ - description: Reference to the AOSS side-channel message RAM.
+
examples:
- |
#include <dt-bindings/clock/qcom,rpmcc.h>
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:42:44

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 01/13] dt-bindings: soc: qcom: aoss: Drop power-domain bindings

The power-domains exposed by AOSS QMP node are used to notify the Always
on Subsystem (AOSS) that a particular co-processor is up/down. These
co-processors enter low-power modes independent to that of the application
processor and their states are expected to remain unaltered across system
suspend/resume cycles. To achieve this behavior let's drop the power-domain
bindings and replace them with generic qmp_send interface instead.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---

v2:
* Commit message update [Rob]

.../devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt
index 783dc81b0f26..c0ae051a5b76 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt
@@ -9,8 +9,7 @@ Messaging Protocol (QMP)

The AOSS side channel exposes control over a set of resources, used to control
a set of debug related clocks and to affect the low power state of resources
-related to the secondary subsystems. These resources are exposed as a set of
-power-domains.
+related to the secondary subsystems.

- compatible:
Usage: required
@@ -46,14 +45,6 @@ power-domains.
Definition: must be 0
The single clock represents the QDSS clock.

-- #power-domain-cells:
- Usage: optional
- Value type: <u32>
- Definition: must be 1
- The provided power-domains are:
- CDSP state (0), LPASS state (1), modem state (2), SLPI
- state (3), SPSS state (4) and Venus state (5).
-
= SUBNODES
The AOSS side channel also provides the controls for three cooling devices,
these are expressed as subnodes of the QMP node. The name of the node is used
@@ -66,8 +57,7 @@ to identify the resource and must therefor be "cx", "mx" or "ebi".

= EXAMPLE

-The following example represents the AOSS side-channel message RAM and the
-mechanism exposing the power-domains, as found in SDM845.
+The following example represents the AOSS side-channel message RAM as found in SDM845.

aoss_qmp: qmp@c300000 {
compatible = "qcom,sdm845-aoss-qmp";
@@ -75,8 +65,6 @@ mechanism exposing the power-domains, as found in SDM845.
interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>;
mboxes = <&apss_shared 0>;

- #power-domain-cells = <1>;
-
cx_cdev: cx {
#cooling-cells = <2>;
};
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:42:46

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 05/13] arm64: dts: qcom: sc7180: Use QMP binding to control load state

Use the Qualcomm Mailbox Protocol (QMP) binding to control the load
state resources on SC7180 SoCs and drop deprecated power-domains exposed
by AOSS QMP node.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7180.dtsi | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 295844e90dd5..2ddff56e2f2d 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -15,7 +15,6 @@
#include <dt-bindings/interconnect/qcom,sc7180.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/phy/phy-qcom-qusb2.h>
-#include <dt-bindings/power/qcom-aoss-qmp.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/reset/qcom,sdm845-aoss.h>
#include <dt-bindings/reset/qcom,sdm845-pdc.h>
@@ -1994,14 +1993,15 @@
clock-names = "iface", "bus", "nav", "snoc_axi",
"mnoc_axi", "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
- <&rpmhpd SC7180_CX>,
+ power-domains = <&rpmhpd SC7180_CX>,
<&rpmhpd SC7180_MX>,
<&rpmhpd SC7180_MSS>;
- power-domain-names = "load_state", "cx", "mx", "mss";
+ power-domain-names = "cx", "mx", "mss";

memory-region = <&mpss_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&modem_smp2p_out 0>;
qcom,smem-state-names = "stop";

@@ -3216,7 +3216,6 @@
mboxes = <&apss_shared 0>;

#clock-cells = <0>;
- #power-domain-cells = <1>;
};

spmi_bus: spmi@c440000 {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:42:55

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 06/13] arm64: dts: qcom: sc7280: Use QMP binding to control load state

Use the Qualcomm Mailbox Protocol (QMP) binding to control the load
state resources on SC7280 SoCs and drop deprecated power-domains exposed
by AOSS QMP node.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 --
1 file changed, 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 0b6f119dce10..73af05929a55 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -9,7 +9,6 @@
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/mailbox/qcom-ipcc.h>
-#include <dt-bindings/power/qcom-aoss-qmp.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/reset/qcom,sdm845-aoss.h>
#include <dt-bindings/reset/qcom,sdm845-pdc.h>
@@ -1066,7 +1065,6 @@
IPCC_MPROC_SIGNAL_GLINK_QMP>;

#clock-cells = <0>;
- #power-domain-cells = <1>;
};

spmi_bus: spmi@c440000 {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:43:01

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 03/13] dt-bindings: remoteproc: qcom: Add QMP bindings

Add Qualcomm Mailbox Protocol (QMP) binding to replace the power domains
exposed by the AOSS QMP node.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Acked-by: Rob Herring <[email protected]>
---
Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 69c49c7b2cff..494257010629 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -174,7 +174,12 @@ For the compatible string below the following supplies are required:
must be "cx", "mx"
qcom,sc7180-mss-pil:
qcom,sdm845-mss-pil:
- must be "cx", "mx", "mss", "load_state"
+ must be "cx", "mx", "mss"
+
+- qcom,qmp:
+ Usage: optional
+ Value type: <phandle>
+ Definition: reference to the AOSS side-channel message RAM.

- qcom,smem-states:
Usage: required
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:43:14

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 11/13] soc: qcom: aoss: Drop power domain support

The load state resources are expected to follow the life cycle of the
remote processor it tracks. However, modeling load state resources as
power-domains result in them getting turned off during system suspend
and thereby falling out of sync with the remote processors that are still
on. Fix this by replacing load state resource control through the generic
qmp message send interface instead.

Signed-off-by: Sibi Sankar <[email protected]>
---
drivers/soc/qcom/qcom_aoss.c | 109 ++-----------------------------------------
1 file changed, 3 insertions(+), 106 deletions(-)

diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
index 5902cc7b1afd..9bfe82d234cd 100644
--- a/drivers/soc/qcom/qcom_aoss.c
+++ b/drivers/soc/qcom/qcom_aoss.c
@@ -2,7 +2,6 @@
/*
* Copyright (c) 2019, Linaro Ltd
*/
-#include <dt-bindings/power/qcom-aoss-qmp.h>
#include <linux/clk-provider.h>
#include <linux/debugfs.h>
#include <linux/interrupt.h>
@@ -11,7 +10,6 @@
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
-#include <linux/pm_domain.h>
#include <linux/thermal.h>
#include <linux/slab.h>
#include <linux/soc/qcom/qcom_aoss.h>
@@ -68,7 +66,6 @@ struct qmp_cooling_device {
* @event: wait_queue for synchronization with the IRQ
* @tx_lock: provides synchronization between multiple callers of qmp_send()
* @qdss_clk: QDSS clock hw struct
- * @pd_data: genpd data
* @cooling_devs: thermal cooling devices
*/
struct qmp {
@@ -88,20 +85,12 @@ struct qmp {
struct mutex tx_lock;

struct clk_hw qdss_clk;
- struct genpd_onecell_data pd_data;
struct qmp_cooling_device *cooling_devs;
#if IS_ENABLED(CONFIG_DEBUG_FS)
struct dentry *debugfs_file;
#endif /* CONFIG_DEBUG_FS */
};

-struct qmp_pd {
- struct qmp *qmp;
- struct generic_pm_domain pd;
-};
-
-#define to_qmp_pd_resource(res) container_of(res, struct qmp_pd, pd)
-
static void qmp_kick(struct qmp *qmp)
{
mbox_send_message(qmp->mbox_chan, NULL);
@@ -330,95 +319,6 @@ static void qmp_qdss_clk_remove(struct qmp *qmp)
clk_hw_unregister(&qmp->qdss_clk);
}

-static int qmp_pd_power_toggle(struct qmp_pd *res, bool enable)
-{
- char buf[QMP_MSG_LEN] = {};
-
- snprintf(buf, sizeof(buf),
- "{class: image, res: load_state, name: %s, val: %s}",
- res->pd.name, enable ? "on" : "off");
- return qmp_send(res->qmp, buf, sizeof(buf));
-}
-
-static int qmp_pd_power_on(struct generic_pm_domain *domain)
-{
- return qmp_pd_power_toggle(to_qmp_pd_resource(domain), true);
-}
-
-static int qmp_pd_power_off(struct generic_pm_domain *domain)
-{
- return qmp_pd_power_toggle(to_qmp_pd_resource(domain), false);
-}
-
-static const char * const sdm845_resources[] = {
- [AOSS_QMP_LS_CDSP] = "cdsp",
- [AOSS_QMP_LS_LPASS] = "adsp",
- [AOSS_QMP_LS_MODEM] = "modem",
- [AOSS_QMP_LS_SLPI] = "slpi",
- [AOSS_QMP_LS_SPSS] = "spss",
- [AOSS_QMP_LS_VENUS] = "venus",
-};
-
-static int qmp_pd_add(struct qmp *qmp)
-{
- struct genpd_onecell_data *data = &qmp->pd_data;
- struct device *dev = qmp->dev;
- struct qmp_pd *res;
- size_t num = ARRAY_SIZE(sdm845_resources);
- int ret;
- int i;
-
- res = devm_kcalloc(dev, num, sizeof(*res), GFP_KERNEL);
- if (!res)
- return -ENOMEM;
-
- data->domains = devm_kcalloc(dev, num, sizeof(*data->domains),
- GFP_KERNEL);
- if (!data->domains)
- return -ENOMEM;
-
- for (i = 0; i < num; i++) {
- res[i].qmp = qmp;
- res[i].pd.name = sdm845_resources[i];
- res[i].pd.power_on = qmp_pd_power_on;
- res[i].pd.power_off = qmp_pd_power_off;
-
- ret = pm_genpd_init(&res[i].pd, NULL, true);
- if (ret < 0) {
- dev_err(dev, "failed to init genpd\n");
- goto unroll_genpds;
- }
-
- data->domains[i] = &res[i].pd;
- }
-
- data->num_domains = i;
-
- ret = of_genpd_add_provider_onecell(dev->of_node, data);
- if (ret < 0)
- goto unroll_genpds;
-
- return 0;
-
-unroll_genpds:
- for (i--; i >= 0; i--)
- pm_genpd_remove(data->domains[i]);
-
- return ret;
-}
-
-static void qmp_pd_remove(struct qmp *qmp)
-{
- struct genpd_onecell_data *data = &qmp->pd_data;
- struct device *dev = qmp->dev;
- int i;
-
- of_genpd_del_provider(dev->of_node);
-
- for (i = 0; i < data->num_domains; i++)
- pm_genpd_remove(data->domains[i]);
-}
-
static int qmp_cdev_get_max_state(struct thermal_cooling_device *cdev,
unsigned long *state)
{
@@ -650,13 +550,11 @@ static int qmp_probe(struct platform_device *pdev)
if (ret)
goto err_close_qmp;

- ret = qmp_pd_add(qmp);
- if (ret)
- goto err_remove_qdss_clk;
-
ret = qmp_cooling_devices_register(qmp);
- if (ret)
+ if (ret) {
dev_err(&pdev->dev, "failed to register aoss cooling devices\n");
+ goto err_remove_qdss_clk;
+ }

platform_set_drvdata(pdev, qmp);

@@ -689,7 +587,6 @@ static int qmp_remove(struct platform_device *pdev)
#endif /* CONFIG_DEBUG_FS */

qmp_qdss_clk_remove(qmp);
- qmp_pd_remove(qmp);
qmp_cooling_devices_remove(qmp);

qmp_close(qmp);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:43:22

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 12/13] dt-bindings: msm/dp: Remove aoss-qmp header

Remove the unused aoss-qmp header from the list of includes.

Signed-off-by: Sibi Sankar <[email protected]>
---
Documentation/devicetree/bindings/display/msm/dp-controller.yaml | 1 -
1 file changed, 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml
index 64d8d9e5e47a..d89b3c510c27 100644
--- a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml
@@ -95,7 +95,6 @@ examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,dispcc-sc7180.h>
- #include <dt-bindings/power/qcom-aoss-qmp.h>
#include <dt-bindings/power/qcom-rpmpd.h>

displayport-controller@ae90000 {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:43:34

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 10/13] arm64: dts: qcom: sm8350: Use QMP binding to control load state

Use the Qualcomm Mailbox Protocol (QMP) binding to control the load
state resources on SM8350 SoCs and drop deprecated power-domains exposed
by AOSS QMP node.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8350.dtsi | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
index 0d16392bb976..2d78a55f33c2 100644
--- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
@@ -8,7 +8,6 @@
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/interconnect/qcom,sm8350.h>
#include <dt-bindings/mailbox/qcom-ipcc.h>
-#include <dt-bindings/power/qcom-aoss-qmp.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>
#include <dt-bindings/thermal/thermal.h>
@@ -703,15 +702,16 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
- <&rpmhpd 0>,
+ power-domains = <&rpmhpd 0>,
<&rpmhpd 12>;
- power-domain-names = "load_state", "cx", "mss";
+ power-domain-names = "cx", "mss";

interconnects = <&mc_virt MASTER_LLCC &mc_virt SLAVE_EBI1>;

memory-region = <&pil_modem_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&smp2p_modem_out 0>;
qcom,smem-state-names = "stop";

@@ -771,7 +771,6 @@
mboxes = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_GLINK_QMP>;

#clock-cells = <0>;
- #power-domain-cells = <1>;
};

spmi_bus: spmi@c440000 {
@@ -1070,13 +1069,14 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_SLPI>,
- <&rpmhpd 4>,
+ power-domains = <&rpmhpd 4>,
<&rpmhpd 5>;
- power-domain-names = "load_state", "lcx", "lmx";
+ power-domain-names = "lcx", "lmx";

memory-region = <&pil_slpi_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&smp2p_slpi_out 0>;
qcom,smem-state-names = "stop";

@@ -1110,15 +1110,16 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_CDSP>,
- <&rpmhpd 0>,
+ power-domains = <&rpmhpd 0>,
<&rpmhpd 10>;
- power-domain-names = "load_state", "cx", "mxc";
+ power-domain-names = "cx", "mxc";

interconnects = <&compute_noc MASTER_CDSP_PROC &mc_virt SLAVE_EBI1>;

memory-region = <&pil_cdsp_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&smp2p_cdsp_out 0>;
qcom,smem-state-names = "stop";

@@ -1344,13 +1345,14 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_LPASS>,
- <&rpmhpd 4>,
+ power-domains = <&rpmhpd 4>,
<&rpmhpd 5>;
- power-domain-names = "load_state", "lcx", "lmx";
+ power-domain-names = "lcx", "lmx";

memory-region = <&pil_adsp_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&smp2p_adsp_out 0>;
qcom,smem-state-names = "stop";

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:45:06

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 09/13] arm64: dts: qcom: sm8250: Use QMP binding to control load state

Use the Qualcomm Mailbox Protocol (QMP) binding to control the load
state resources on SM8250 SoCs and drop deprecated power-domains exposed
by AOSS QMP node.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8250.dtsi | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 75f9476109e6..6d72bd71f147 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -11,7 +11,6 @@
#include <dt-bindings/interconnect/qcom,osm-l3.h>
#include <dt-bindings/interconnect/qcom,sm8250.h>
#include <dt-bindings/mailbox/qcom-ipcc.h>
-#include <dt-bindings/power/qcom-aoss-qmp.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/soc/qcom,apr.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>
@@ -1881,13 +1880,14 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_SLPI>,
- <&rpmhpd SM8250_LCX>,
+ power-domains = <&rpmhpd SM8250_LCX>,
<&rpmhpd SM8250_LMX>;
- power-domain-names = "load_state", "lcx", "lmx";
+ power-domain-names = "lcx", "lmx";

memory-region = <&slpi_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&smp2p_slpi_out 0>;
qcom,smem-state-names = "stop";

@@ -1947,12 +1947,12 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_CDSP>,
- <&rpmhpd SM8250_CX>;
- power-domain-names = "load_state", "cx";
+ power-domains = <&rpmhpd SM8250_CX>;

memory-region = <&cdsp_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&smp2p_cdsp_out 0>;
qcom,smem-state-names = "stop";

@@ -2689,7 +2689,6 @@
IPCC_MPROC_SIGNAL_GLINK_QMP>;

#clock-cells = <0>;
- #power-domain-cells = <1>;
};

spmi_bus: spmi@c440000 {
@@ -3517,13 +3516,14 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_LPASS>,
- <&rpmhpd SM8250_LCX>,
+ power-domains = <&rpmhpd SM8250_LCX>,
<&rpmhpd SM8250_LMX>;
- power-domain-names = "load_state", "lcx", "lmx";
+ power-domain-names = "lcx", "lmx";

memory-region = <&adsp_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&smp2p_adsp_out 0>;
qcom,smem-state-names = "stop";

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:45:38

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 08/13] arm64: dts: qcom: sm8150: Use QMP binding to control load state

Use the Qualcomm Mailbox Protocol (QMP) binding to control the load
state resources on SM8150 SoCs and drop deprecated power-domains exposed
by AOSS QMP node.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 142cf786c6cf..1a82ec935d32 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -6,7 +6,6 @@

#include <dt-bindings/dma/qcom-gpi.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
-#include <dt-bindings/power/qcom-aoss-qmp.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>
#include <dt-bindings/clock/qcom,rpmh.h>
@@ -1110,13 +1109,14 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_SLPI>,
- <&rpmhpd 3>,
+ power-domains = <&rpmhpd 3>,
<&rpmhpd 2>;
- power-domain-names = "load_state", "lcx", "lmx";
+ power-domain-names = "lcx", "lmx";

memory-region = <&slpi_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&slpi_smp2p_out 0>;
qcom,smem-state-names = "stop";

@@ -1556,13 +1556,14 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
- <&rpmhpd 7>,
+ power-domains = <&rpmhpd 7>,
<&rpmhpd 0>;
- power-domain-names = "load_state", "cx", "mss";
+ power-domain-names = "cx", "mss";

memory-region = <&mpss_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&modem_smp2p_out 0>;
qcom,smem-state-names = "stop";

@@ -2180,12 +2181,12 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_CDSP>,
- <&rpmhpd 7>;
- power-domain-names = "load_state", "cx";
+ power-domains = <&rpmhpd 7>;

memory-region = <&cdsp_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&cdsp_smp2p_out 0>;
qcom,smem-state-names = "stop";

@@ -2409,7 +2410,6 @@
mboxes = <&apss_shared 0>;

#clock-cells = <0>;
- #power-domain-cells = <1>;
};

tsens0: thermal-sensor@c263000 {
@@ -2556,12 +2556,12 @@
clocks = <&rpmhcc RPMH_CXO_CLK>;
clock-names = "xo";

- power-domains = <&aoss_qmp AOSS_QMP_LS_LPASS>,
- <&rpmhpd 7>;
- power-domain-names = "load_state", "cx";
+ power-domains = <&rpmhpd 7>;

memory-region = <&adsp_mem>;

+ qcom,qmp = <&aoss_qmp>;
+
qcom,smem-states = <&adsp_smp2p_out 0>;
qcom,smem-state-names = "stop";

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-07 15:46:04

by Sibi Sankar

[permalink] [raw]
Subject: [PATCH v2 13/13] dt-bindings: soc: qcom: aoss: Delete unused power-domain definitions

Delete unused power-domain definitions exposed by AOSS QMP.

Signed-off-by: Sibi Sankar <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Acked-by: Rob Herring <[email protected]>
---
include/dt-bindings/power/qcom-aoss-qmp.h | 14 --------------
1 file changed, 14 deletions(-)
delete mode 100644 include/dt-bindings/power/qcom-aoss-qmp.h

diff --git a/include/dt-bindings/power/qcom-aoss-qmp.h b/include/dt-bindings/power/qcom-aoss-qmp.h
deleted file mode 100644
index ec336d31dee4..000000000000
--- a/include/dt-bindings/power/qcom-aoss-qmp.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (c) 2018, Linaro Ltd. */
-
-#ifndef __DT_BINDINGS_POWER_QCOM_AOSS_QMP_H
-#define __DT_BINDINGS_POWER_QCOM_AOSS_QMP_H
-
-#define AOSS_QMP_LS_CDSP 0
-#define AOSS_QMP_LS_LPASS 1
-#define AOSS_QMP_LS_MODEM 2
-#define AOSS_QMP_LS_SLPI 3
-#define AOSS_QMP_LS_SPSS 4
-#define AOSS_QMP_LS_VENUS 5
-
-#endif
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

2021-06-19 03:46:13

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 02/13] dt-bindings: remoteproc: qcom: pas: Add QMP bindings

On Mon, Jun 07, 2021 at 09:09:21PM +0530, Sibi Sankar wrote:
> Add Qualcomm Mailbox Protocol (QMP) binding to replace the power domains
> exposed by the AOSS QMP node.
>
> Signed-off-by: Sibi Sankar <[email protected]>
> ---
>
> v2:
> * Drop R-b from Rob/Stephen due to yaml conversion.
>
> .../devicetree/bindings/remoteproc/qcom,adsp.yaml | 40 +++++++++++++++-------
> 1 file changed, 27 insertions(+), 13 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
> index 9ea05e608bc1..b6396bc07388 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
> @@ -89,6 +89,10 @@ properties:
> maxItems: 1
> description: Reference to the reserved-memory for the Hexagon core
>
> + qcom,qmp:

Is there more than one QMP? If not just search for the QMP node and you
can avoid the ABI issue at least partially.

> + $ref: /schemas/types.yaml#/definitions/phandle-array

There's more than 1 cell? What's in them?

> + description: Reference to the AOSS side-channel message RAM.
> +
> qcom,smem-states:
> $ref: /schemas/types.yaml#/definitions/phandle-array
> description: States used by the AP to signal the Hexagon core
> @@ -359,13 +363,11 @@ allOf:
> properties:
> power-domains:
> items:
> - - description: Load State power domain
> - description: CX power domain
> - description: MX power domain
> - description: MSS power domain
> power-domain-names:
> items:
> - - const: load_state
> - const: cx
> - const: mx
> - const: mss
> @@ -381,12 +383,7 @@ allOf:
> properties:
> power-domains:
> items:
> - - description: Load State power domain
> - description: CX power domain
> - power-domain-names:
> - items:
> - - const: load_state
> - - const: cx
>
> - if:
> properties:
> @@ -399,12 +396,10 @@ allOf:
> properties:
> power-domains:
> items:
> - - description: Load State power domain
> - description: CX power domain
> - description: MSS power domain
> power-domain-names:
> items:
> - - const: load_state
> - const: cx
> - const: mss
>
> @@ -439,12 +434,10 @@ allOf:
> properties:
> power-domains:
> items:
> - - description: Load State power domain
> - description: LCX power domain
> - description: LMX power domain
> power-domain-names:
> items:
> - - const: load_state
> - const: lcx
> - const: lmx
>
> @@ -458,12 +451,10 @@ allOf:
> properties:
> power-domains:
> items:
> - - description: Load State power domain
> - description: CX power domain
> - description: MXC power domain
> power-domain-names:
> items:
> - - const: load_state
> - const: cx
> - const: mxc
>
> @@ -499,6 +490,29 @@ allOf:
> - const: mss_restart
> - const: pdc_reset
>
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - qcom,sc7180-mpss-pas
> + - qcom,sm8150-adsp-pas
> + - qcom,sm8150-cdsp-pas
> + - qcom,sm8150-mpss-pas
> + - qcom,sm8150-slpi-pas
> + - qcom,sm8250-adsp-pas
> + - qcom,sm8250-cdsp-pas
> + - qcom,sm8250-slpi-pas
> + - qcom,sm8350-adsp-pas
> + - qcom,sm8350-cdsp-pas
> + - qcom,sm8350-mpss-pas
> + - qcom,sm8350-slpi-pas
> + then:
> + properties:
> + qcom,qmp:
> + items:
> + - description: Reference to the AOSS side-channel message RAM.
> +
> examples:
> - |
> #include <dt-bindings/clock/qcom,rpmcc.h>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
>

2021-06-19 06:31:47

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 01/13] dt-bindings: soc: qcom: aoss: Drop power-domain bindings

On Mon, 07 Jun 2021 21:09:20 +0530, Sibi Sankar wrote:
> The power-domains exposed by AOSS QMP node are used to notify the Always
> on Subsystem (AOSS) that a particular co-processor is up/down. These
> co-processors enter low-power modes independent to that of the application
> processor and their states are expected to remain unaltered across system
> suspend/resume cycles. To achieve this behavior let's drop the power-domain
> bindings and replace them with generic qmp_send interface instead.
>
> Signed-off-by: Sibi Sankar <[email protected]>
> Reviewed-by: Stephen Boyd <[email protected]>
> ---
>
> v2:
> * Commit message update [Rob]
>
> .../devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt | 16 ++--------------
> 1 file changed, 2 insertions(+), 14 deletions(-)
>

Acked-by: Rob Herring <[email protected]>

2021-06-19 06:34:20

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 12/13] dt-bindings: msm/dp: Remove aoss-qmp header

On Mon, 07 Jun 2021 21:09:31 +0530, Sibi Sankar wrote:
> Remove the unused aoss-qmp header from the list of includes.
>
> Signed-off-by: Sibi Sankar <[email protected]>
> ---
> Documentation/devicetree/bindings/display/msm/dp-controller.yaml | 1 -
> 1 file changed, 1 deletion(-)
>

Acked-by: Rob Herring <[email protected]>

2021-06-22 07:25:35

by Sibi Sankar

[permalink] [raw]
Subject: Re: [PATCH v2 02/13] dt-bindings: remoteproc: qcom: pas: Add QMP bindings

Hey Rob,
Thanks for the review.

On 2021-06-19 01:55, Rob Herring wrote:
> On Mon, Jun 07, 2021 at 09:09:21PM +0530, Sibi Sankar wrote:
>> Add Qualcomm Mailbox Protocol (QMP) binding to replace the power
>> domains
>> exposed by the AOSS QMP node.
>>
>> Signed-off-by: Sibi Sankar <[email protected]>
>> ---
>>
>> v2:
>> * Drop R-b from Rob/Stephen due to yaml conversion.
>>
>> .../devicetree/bindings/remoteproc/qcom,adsp.yaml | 40
>> +++++++++++++++-------
>> 1 file changed, 27 insertions(+), 13 deletions(-)
>>
>> diff --git
>> a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
>> b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
>> index 9ea05e608bc1..b6396bc07388 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml
>> @@ -89,6 +89,10 @@ properties:
>> maxItems: 1
>> description: Reference to the reserved-memory for the Hexagon
>> core
>>
>> + qcom,qmp:
>
> Is there more than one QMP? If not just search for the QMP node and you
> can avoid the ABI issue at least partially.

yeah there is just one qmp node
used by all remote processors and
we just search for the qmp node.

>
>> + $ref: /schemas/types.yaml#/definitions/phandle-array
>
> There's more than 1 cell? What's in them?

Just a single cell i.e. handle to the
qmp node. I'll fix this in the re-spin.

>
>> + description: Reference to the AOSS side-channel message RAM.
>> +
>> qcom,smem-states:
>> $ref: /schemas/types.yaml#/definitions/phandle-array
>> description: States used by the AP to signal the Hexagon core
>> @@ -359,13 +363,11 @@ allOf:
>> properties:
>> power-domains:
>> items:
>> - - description: Load State power domain
>> - description: CX power domain
>> - description: MX power domain
>> - description: MSS power domain
>> power-domain-names:
>> items:
>> - - const: load_state
>> - const: cx
>> - const: mx
>> - const: mss
>> @@ -381,12 +383,7 @@ allOf:
>> properties:
>> power-domains:
>> items:
>> - - description: Load State power domain
>> - description: CX power domain
>> - power-domain-names:
>> - items:
>> - - const: load_state
>> - - const: cx
>>
>> - if:
>> properties:
>> @@ -399,12 +396,10 @@ allOf:
>> properties:
>> power-domains:
>> items:
>> - - description: Load State power domain
>> - description: CX power domain
>> - description: MSS power domain
>> power-domain-names:
>> items:
>> - - const: load_state
>> - const: cx
>> - const: mss
>>
>> @@ -439,12 +434,10 @@ allOf:
>> properties:
>> power-domains:
>> items:
>> - - description: Load State power domain
>> - description: LCX power domain
>> - description: LMX power domain
>> power-domain-names:
>> items:
>> - - const: load_state
>> - const: lcx
>> - const: lmx
>>
>> @@ -458,12 +451,10 @@ allOf:
>> properties:
>> power-domains:
>> items:
>> - - description: Load State power domain
>> - description: CX power domain
>> - description: MXC power domain
>> power-domain-names:
>> items:
>> - - const: load_state
>> - const: cx
>> - const: mxc
>>
>> @@ -499,6 +490,29 @@ allOf:
>> - const: mss_restart
>> - const: pdc_reset
>>
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + enum:
>> + - qcom,sc7180-mpss-pas
>> + - qcom,sm8150-adsp-pas
>> + - qcom,sm8150-cdsp-pas
>> + - qcom,sm8150-mpss-pas
>> + - qcom,sm8150-slpi-pas
>> + - qcom,sm8250-adsp-pas
>> + - qcom,sm8250-cdsp-pas
>> + - qcom,sm8250-slpi-pas
>> + - qcom,sm8350-adsp-pas
>> + - qcom,sm8350-cdsp-pas
>> + - qcom,sm8350-mpss-pas
>> + - qcom,sm8350-slpi-pas
>> + then:
>> + properties:
>> + qcom,qmp:
>> + items:
>> + - description: Reference to the AOSS side-channel message
>> RAM.
>> +
>> examples:
>> - |
>> #include <dt-bindings/clock/qcom,rpmcc.h>
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
>> Forum,
>> a Linux Foundation Collaborative Project
>>
>>

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.