All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Fustini <dfustini@baylibre.com>
To: "Benoît Cousson" <bcousson@baylibre.com>,
	"Bjorn Andersson" <bjorn.andersson@linaro.org>,
	"Dave Gerlach" <d-gerlach@ti.com>,
	devicetree@vger.kernel.org,
	"Drew Fustini" <dfustini@baylibre.com>,
	Keerthy <j-keerthy@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-remoteproc@vger.kernel.org,
	"Mathieu Poirier" <mathieu.poirier@linaro.org>,
	"Nishanth Menon" <nm@ti.com>, "Rob Herring" <robh+dt@kernel.org>,
	"Santosh Shilimkar" <ssantosh@kernel.org>,
	"Tony Lindgren" <tony@atomide.com>,
	s-anna@ti.com, khilman@baylibre.com
Subject: [PATCH 05/11] soc: ti: wkup_m3_ipc: Add support for IO Isolation
Date: Sat, 19 Feb 2022 13:53:22 -0800	[thread overview]
Message-ID: <20220219215328.485660-6-dfustini@baylibre.com> (raw)
In-Reply-To: <20220219215328.485660-1-dfustini@baylibre.com>

From: Dave Gerlach <d-gerlach@ti.com>

AM43xx support isolation of the IOs so that control is taken
from the peripheral they are connected to and overridden by values
present in the CTRL_CONF_* registers for the pad in the control module.

The actual toggling happens from the wkup_m3, so use a DT property from
thea wkup_m3_ipc node to allow the PM code to communicate the necessity
for placing the IOs into isolation to the firmware.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
---
 drivers/soc/ti/wkup_m3_ipc.c | 14 ++++++++++++--
 include/linux/wkup_m3_ipc.h  |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 974b4118a893..e7ae942b7014 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -46,6 +46,8 @@
 #define IPC_VTT_STAT_MASK		(0x1 << 3)
 #define IPC_VTT_GPIO_PIN_SHIFT		(0x4)
 #define IPC_VTT_GPIO_PIN_MASK		(0x3f << 4)
+#define IPC_IO_ISOLATION_STAT_SHIFT	(10)
+#define IPC_IO_ISOLATION_STAT_MASK	(0x1 << 10)
 
 #define M3_STATE_UNKNOWN		0
 #define M3_STATE_RESET			1
@@ -228,6 +230,11 @@ static void wkup_m3_set_vtt_gpio(struct wkup_m3_ipc *m3_ipc, int gpio)
 			    (gpio << IPC_VTT_GPIO_PIN_SHIFT);
 }
 
+static void wkup_m3_set_io_isolation(struct wkup_m3_ipc *m3_ipc)
+{
+	m3_ipc->isolation_conf = (1 << IPC_IO_ISOLATION_STAT_SHIFT);
+}
+
 /* Public functions */
 /**
  * wkup_m3_set_mem_type - Pass wkup_m3 which type of memory is in use
@@ -308,8 +315,8 @@ static int wkup_m3_prepare_low_power(struct wkup_m3_ipc *m3_ipc, int state)
 	wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->resume_addr, 0);
 	wkup_m3_ctrl_ipc_write(m3_ipc, m3_power_state, 1);
 	wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->mem_type |
-			       m3_ipc->vtt_conf, 4);
-
+			       m3_ipc->vtt_conf |
+			       m3_ipc->isolation_conf, 4);
 	wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 2);
 	wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 3);
 	wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 5);
@@ -519,6 +526,9 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
 			dev_warn(dev, "Invalid VTT GPIO(%d) pin\n", temp);
 	}
 
+	if (of_find_property(np, "ti,set-io-isolation", NULL))
+		wkup_m3_set_io_isolation(m3_ipc);
+
 	/*
 	 * Wait for firmware loading completion in a thread so we
 	 * can boot the wkup_m3 as soon as it's ready without holding
diff --git a/include/linux/wkup_m3_ipc.h b/include/linux/wkup_m3_ipc.h
index 2bc52c6381d5..b706eac58f92 100644
--- a/include/linux/wkup_m3_ipc.h
+++ b/include/linux/wkup_m3_ipc.h
@@ -34,6 +34,7 @@ struct wkup_m3_ipc {
 	int mem_type;
 	unsigned long resume_addr;
 	int vtt_conf;
+	int isolation_conf;
 	int state;
 
 	struct completion sync_complete;
-- 
2.32.0


WARNING: multiple messages have this Message-ID (diff)
From: Drew Fustini <dfustini@baylibre.com>
To: "Benoît Cousson" <bcousson@baylibre.com>,
	"Bjorn Andersson" <bjorn.andersson@linaro.org>,
	"Dave Gerlach" <d-gerlach@ti.com>,
	devicetree@vger.kernel.org,
	"Drew Fustini" <dfustini@baylibre.com>,
	Keerthy <j-keerthy@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-remoteproc@vger.kernel.org,
	"Mathieu Poirier" <mathieu.poirier@linaro.org>,
	"Nishanth Menon" <nm@ti.com>, "Rob Herring" <robh+dt@kernel.org>,
	"Santosh Shilimkar" <ssantosh@kernel.org>,
	"Tony Lindgren" <tony@atomide.com>,
	s-anna@ti.com, khilman@baylibre.com
Subject: [PATCH 05/11] soc: ti: wkup_m3_ipc: Add support for IO Isolation
Date: Sat, 19 Feb 2022 13:53:22 -0800	[thread overview]
Message-ID: <20220219215328.485660-6-dfustini@baylibre.com> (raw)
In-Reply-To: <20220219215328.485660-1-dfustini@baylibre.com>

From: Dave Gerlach <d-gerlach@ti.com>

AM43xx support isolation of the IOs so that control is taken
from the peripheral they are connected to and overridden by values
present in the CTRL_CONF_* registers for the pad in the control module.

The actual toggling happens from the wkup_m3, so use a DT property from
thea wkup_m3_ipc node to allow the PM code to communicate the necessity
for placing the IOs into isolation to the firmware.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
---
 drivers/soc/ti/wkup_m3_ipc.c | 14 ++++++++++++--
 include/linux/wkup_m3_ipc.h  |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 974b4118a893..e7ae942b7014 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -46,6 +46,8 @@
 #define IPC_VTT_STAT_MASK		(0x1 << 3)
 #define IPC_VTT_GPIO_PIN_SHIFT		(0x4)
 #define IPC_VTT_GPIO_PIN_MASK		(0x3f << 4)
+#define IPC_IO_ISOLATION_STAT_SHIFT	(10)
+#define IPC_IO_ISOLATION_STAT_MASK	(0x1 << 10)
 
 #define M3_STATE_UNKNOWN		0
 #define M3_STATE_RESET			1
@@ -228,6 +230,11 @@ static void wkup_m3_set_vtt_gpio(struct wkup_m3_ipc *m3_ipc, int gpio)
 			    (gpio << IPC_VTT_GPIO_PIN_SHIFT);
 }
 
+static void wkup_m3_set_io_isolation(struct wkup_m3_ipc *m3_ipc)
+{
+	m3_ipc->isolation_conf = (1 << IPC_IO_ISOLATION_STAT_SHIFT);
+}
+
 /* Public functions */
 /**
  * wkup_m3_set_mem_type - Pass wkup_m3 which type of memory is in use
@@ -308,8 +315,8 @@ static int wkup_m3_prepare_low_power(struct wkup_m3_ipc *m3_ipc, int state)
 	wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->resume_addr, 0);
 	wkup_m3_ctrl_ipc_write(m3_ipc, m3_power_state, 1);
 	wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->mem_type |
-			       m3_ipc->vtt_conf, 4);
-
+			       m3_ipc->vtt_conf |
+			       m3_ipc->isolation_conf, 4);
 	wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 2);
 	wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 3);
 	wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 5);
@@ -519,6 +526,9 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
 			dev_warn(dev, "Invalid VTT GPIO(%d) pin\n", temp);
 	}
 
+	if (of_find_property(np, "ti,set-io-isolation", NULL))
+		wkup_m3_set_io_isolation(m3_ipc);
+
 	/*
 	 * Wait for firmware loading completion in a thread so we
 	 * can boot the wkup_m3 as soon as it's ready without holding
diff --git a/include/linux/wkup_m3_ipc.h b/include/linux/wkup_m3_ipc.h
index 2bc52c6381d5..b706eac58f92 100644
--- a/include/linux/wkup_m3_ipc.h
+++ b/include/linux/wkup_m3_ipc.h
@@ -34,6 +34,7 @@ struct wkup_m3_ipc {
 	int mem_type;
 	unsigned long resume_addr;
 	int vtt_conf;
+	int isolation_conf;
 	int state;
 
 	struct completion sync_complete;
-- 
2.32.0


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

  parent reply	other threads:[~2022-02-19 21:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19 21:53 [PATCH 00/11] soc: ti: wkup_m3_ipc: support vtt toggle, io isolation & voltage scaling Drew Fustini
2022-02-19 21:53 ` Drew Fustini
2022-02-19 21:53 ` [PATCH 01/11] remoteproc: move rproc_da_to_va declaration to remoteproc.h Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` [PATCH 02/11] dt-bindings: wkup_m3_ipc: Add vtt toggling bindings Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-21 12:55   ` Nishanth Menon
2022-02-21 12:55     ` Nishanth Menon
2022-02-19 21:53 ` [PATCH 03/11] soc: ti: wkup_m3_ipc: Add support for toggling VTT regulator Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` [PATCH 04/11] dt-bindings: wkup_m3_ipc: Add ti,io-isolation property Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` Drew Fustini [this message]
2022-02-19 21:53   ` [PATCH 05/11] soc: ti: wkup_m3_ipc: Add support for IO Isolation Drew Fustini
2022-02-19 21:53 ` [PATCH 06/11] ARM: dts: am437x-gp-evm: Enable wkup_m3 control of IO isolation Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` [PATCH 07/11] dt-bindings: wkup_m3_ipc: Add scale-data-fw property Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` [PATCH 08/11] soc: ti: wkup_m3_ipc: Add support for i2c voltage scaling Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` [PATCH 09/11] ARM: dts: am33xx: Add scale data fw to wkup_m3_ipc node Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` [PATCH 10/11] ARM: dts: am43xx: " Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-19 21:53 ` [PATCH 11/11] soc: ti: wkup_m3_ipc: Add debug option to halt m3 in suspend Drew Fustini
2022-02-19 21:53   ` Drew Fustini
2022-02-21 12:58 ` [PATCH 00/11] soc: ti: wkup_m3_ipc: support vtt toggle, io isolation & voltage scaling Nishanth Menon
2022-02-21 12:58   ` Nishanth Menon

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=20220219215328.485660-6-dfustini@baylibre.com \
    --to=dfustini@baylibre.com \
    --cc=bcousson@baylibre.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=d-gerlach@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=j-keerthy@ti.com \
    --cc=khilman@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=nm@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=s-anna@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=tony@atomide.com \
    /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.