All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dong Aisheng <aisheng.dong@nxp.com>
To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org,
	robh+dt@kernel.org, linux-imx@nxp.com, jan.kiszka@siemens.com,
	Dong Aisheng <aisheng.dong@nxp.com>
Subject: [PATCH v5 18/18] firmware: imx: scu-pd: do not power off console domain
Date: Fri,  5 Mar 2021 21:17:48 +0800	[thread overview]
Message-ID: <1614950268-22073-20-git-send-email-aisheng.dong@nxp.com> (raw)
In-Reply-To: <1614950268-22073-1-git-send-email-aisheng.dong@nxp.com>

Do not power off console domain in runtime pm.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
ChangeLog:
 * original patch was sent here:
   https://patchwork.kernel.org/project/linux-arm-kernel/patch/1573995924-14752-1-git-send-email-aisheng.dong@nxp.com/
 * move to this patch series as it's required for imx8qm booting
---
 drivers/firmware/imx/scu-pd.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/imx/scu-pd.c b/drivers/firmware/imx/scu-pd.c
index 08533ee67626..338800d16c65 100644
--- a/drivers/firmware/imx/scu-pd.c
+++ b/drivers/firmware/imx/scu-pd.c
@@ -86,6 +86,8 @@ struct imx_sc_pd_soc {
 	u8 num_ranges;
 };
 
+static int imx_con_rsrc;
+
 static const struct imx_sc_pd_range imx8qxp_scu_pd_ranges[] = {
 	/* LSIO SS */
 	{ "pwm", IMX_SC_R_PWM_0, 8, true, 0 },
@@ -207,6 +209,23 @@ to_imx_sc_pd(struct generic_pm_domain *genpd)
 	return container_of(genpd, struct imx_sc_pm_domain, pd);
 }
 
+static void imx_sc_pd_get_console_rsrc(void)
+{
+	struct of_phandle_args specs;
+	int ret;
+
+	if (!of_stdout)
+		return;
+
+	ret = of_parse_phandle_with_args(of_stdout, "power-domains",
+					 "#power-domain-cells",
+					 0, &specs);
+	if (ret)
+		return;
+
+	imx_con_rsrc = specs.args[0];
+}
+
 static int imx_sc_pd_power(struct generic_pm_domain *domain, bool power_on)
 {
 	struct imx_sc_msg_req_set_resource_power_mode msg;
@@ -267,6 +286,7 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
 		      const struct imx_sc_pd_range *pd_ranges)
 {
 	struct imx_sc_pm_domain *sc_pd;
+	bool is_off = true;
 	int ret;
 
 	if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx))
@@ -288,6 +308,10 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
 			 "%s", pd_ranges->name);
 
 	sc_pd->pd.name = sc_pd->name;
+	if (imx_con_rsrc == sc_pd->rsrc) {
+		sc_pd->pd.flags = GENPD_FLAG_RPM_ALWAYS_ON;
+		is_off = false;
+	}
 
 	if (sc_pd->rsrc >= IMX_SC_R_LAST) {
 		dev_warn(dev, "invalid pd %s rsrc id %d found",
@@ -297,7 +321,7 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
 		return NULL;
 	}
 
-	ret = pm_genpd_init(&sc_pd->pd, NULL, true);
+	ret = pm_genpd_init(&sc_pd->pd, NULL, is_off);
 	if (ret) {
 		dev_warn(dev, "failed to init pd %s rsrc id %d",
 			 sc_pd->name, sc_pd->rsrc);
@@ -363,6 +387,8 @@ static int imx_sc_pd_probe(struct platform_device *pdev)
 	if (!pd_soc)
 		return -ENODEV;
 
+	imx_sc_pd_get_console_rsrc();
+
 	return imx_scu_init_pm_domains(&pdev->dev, pd_soc);
 }
 
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Dong Aisheng <aisheng.dong@nxp.com>
To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org,
	robh+dt@kernel.org, linux-imx@nxp.com, jan.kiszka@siemens.com,
	Dong Aisheng <aisheng.dong@nxp.com>
Subject: [PATCH v5 18/18] firmware: imx: scu-pd: do not power off console domain
Date: Fri,  5 Mar 2021 21:17:48 +0800	[thread overview]
Message-ID: <1614950268-22073-20-git-send-email-aisheng.dong@nxp.com> (raw)
In-Reply-To: <1614950268-22073-1-git-send-email-aisheng.dong@nxp.com>

Do not power off console domain in runtime pm.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
ChangeLog:
 * original patch was sent here:
   https://patchwork.kernel.org/project/linux-arm-kernel/patch/1573995924-14752-1-git-send-email-aisheng.dong@nxp.com/
 * move to this patch series as it's required for imx8qm booting
---
 drivers/firmware/imx/scu-pd.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/imx/scu-pd.c b/drivers/firmware/imx/scu-pd.c
index 08533ee67626..338800d16c65 100644
--- a/drivers/firmware/imx/scu-pd.c
+++ b/drivers/firmware/imx/scu-pd.c
@@ -86,6 +86,8 @@ struct imx_sc_pd_soc {
 	u8 num_ranges;
 };
 
+static int imx_con_rsrc;
+
 static const struct imx_sc_pd_range imx8qxp_scu_pd_ranges[] = {
 	/* LSIO SS */
 	{ "pwm", IMX_SC_R_PWM_0, 8, true, 0 },
@@ -207,6 +209,23 @@ to_imx_sc_pd(struct generic_pm_domain *genpd)
 	return container_of(genpd, struct imx_sc_pm_domain, pd);
 }
 
+static void imx_sc_pd_get_console_rsrc(void)
+{
+	struct of_phandle_args specs;
+	int ret;
+
+	if (!of_stdout)
+		return;
+
+	ret = of_parse_phandle_with_args(of_stdout, "power-domains",
+					 "#power-domain-cells",
+					 0, &specs);
+	if (ret)
+		return;
+
+	imx_con_rsrc = specs.args[0];
+}
+
 static int imx_sc_pd_power(struct generic_pm_domain *domain, bool power_on)
 {
 	struct imx_sc_msg_req_set_resource_power_mode msg;
@@ -267,6 +286,7 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
 		      const struct imx_sc_pd_range *pd_ranges)
 {
 	struct imx_sc_pm_domain *sc_pd;
+	bool is_off = true;
 	int ret;
 
 	if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx))
@@ -288,6 +308,10 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
 			 "%s", pd_ranges->name);
 
 	sc_pd->pd.name = sc_pd->name;
+	if (imx_con_rsrc == sc_pd->rsrc) {
+		sc_pd->pd.flags = GENPD_FLAG_RPM_ALWAYS_ON;
+		is_off = false;
+	}
 
 	if (sc_pd->rsrc >= IMX_SC_R_LAST) {
 		dev_warn(dev, "invalid pd %s rsrc id %d found",
@@ -297,7 +321,7 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
 		return NULL;
 	}
 
-	ret = pm_genpd_init(&sc_pd->pd, NULL, true);
+	ret = pm_genpd_init(&sc_pd->pd, NULL, is_off);
 	if (ret) {
 		dev_warn(dev, "failed to init pd %s rsrc id %d",
 			 sc_pd->name, sc_pd->rsrc);
@@ -363,6 +387,8 @@ static int imx_sc_pd_probe(struct platform_device *pdev)
 	if (!pd_soc)
 		return -ENODEV;
 
+	imx_sc_pd_get_console_rsrc();
+
 	return imx_scu_init_pm_domains(&pdev->dev, pd_soc);
 }
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-03-05 13:31 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 13:17 [PATCH v5 00/18] arm64: dts: imx8: architecture improvement and adding imx8qm support Dong Aisheng
2021-03-05 13:17 ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 01/18] dt-bindings: arm: fsl: add imx8qm boards compatible string Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-08  1:40   ` Shawn Guo
2021-03-08  1:40     ` Shawn Guo
2021-03-05 13:17 ` [PATCH 1/1] firmware: imx: scu-pd: do not power off console domain Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:33   ` Aisheng Dong
2021-03-05 13:33     ` Aisheng Dong
2021-03-05 13:17 ` [PATCH v5 02/18] dt-bindings: mailbox: mu: add imx8qm support Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-08  1:40   ` Shawn Guo
2021-03-08  1:40     ` Shawn Guo
2021-03-05 13:17 ` [PATCH v5 03/18] arm64: dts: imx8qxp: add fallback compatible string for scu pd Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 04/18] arm64: dts: imx8qxp: move scu pd node before scu clock node Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 05/18] arm64: dts: imx8qxp: orginize dts in subsystems Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 06/18] arm64: dts: imx8: add lsio lpcg clocks Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 07/18] arm64: dts: imx8: add conn " Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 08/18] arm64: dts: imx8: add adma " Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 09/18] arm64: dts: imx8: switch to two cell scu clock binding Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 10/18] arm64: dts: imx8: switch to new lpcg " Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 11/18] arm64: dts: imx8qm: add lsio ss support Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 12/18] arm64: dts: imx8qm: add conn " Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 13/18] arm64: dts: imx8: split adma ss into dma and audio ss Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 14/18] arm64: dts: imx8qm: add dma ss support Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 15/18] arm64: dts: imx: add imx8qm common dts file Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 16/18] arm64: dts: imx: add imx8qm mek support Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-05 13:17 ` [PATCH v5 17/18] arm64: defconfig: " Dong Aisheng
2021-03-05 13:17   ` Dong Aisheng
2021-03-08  1:44   ` Shawn Guo
2021-03-08  1:44     ` Shawn Guo
2021-03-05 13:17 ` Dong Aisheng [this message]
2021-03-05 13:17   ` [PATCH v5 18/18] firmware: imx: scu-pd: do not power off console domain Dong Aisheng
2021-03-08  1:45   ` Shawn Guo
2021-03-08  1:45     ` Shawn Guo
2021-03-08  1:59 ` [PATCH v5 00/18] arm64: dts: imx8: architecture improvement and adding imx8qm support Shawn Guo
2021-03-08  1:59   ` Shawn Guo
2021-03-08  2:29   ` Aisheng Dong
2021-03-08  2:29     ` Aisheng Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1614950268-22073-20-git-send-email-aisheng.dong@nxp.com \
    --to=aisheng.dong@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dongas86@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.