All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajendra Nayak <rnayak@ti.com>
To: bcousson@baylibre.com, paul@pwsan.com, tony@atomide.com
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	Rajendra Nayak <rnayak@ti.com>
Subject: [PATCH v2 3/5] ARM: OMAP2+: hwmod: Extract no-idle and no-reset info from DT
Date: Wed, 9 Oct 2013 15:41:59 +0530	[thread overview]
Message-ID: <1381313521-10422-4-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1381313521-10422-1-git-send-email-rnayak@ti.com>

Now that we have DT bindings to specify which devices should not
be reset and idled during init, make hwmod extract the information
(and store them in internal flags) from Device tree.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index d9ee0ff..b55923a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2363,11 +2363,11 @@ static struct device_node *of_dev_hwmod_lookup(struct device_node *np,
  * are part of the device's address space can be ioremapped properly.
  * No return value.
  */
-static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
+static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
+				     struct device_node *np)
 {
 	struct omap_hwmod_addr_space *mem;
 	void __iomem *va_start = NULL;
-	struct device_node *np;
 
 	if (!oh)
 		return;
@@ -2383,12 +2383,10 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
 			 oh->name);
 
 		/* Extract the IO space from device tree blob */
-		if (!of_have_populated_dt())
+		if (!np)
 			return;
 
-		np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
-		if (np)
-			va_start = of_iomap(np, oh->mpu_rt_idx);
+		va_start = of_iomap(np, oh->mpu_rt_idx);
 	} else {
 		va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
 	}
@@ -2420,12 +2418,16 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
 static int __init _init(struct omap_hwmod *oh, void *data)
 {
 	int r;
+	struct device_node *np = NULL;
 
 	if (oh->_state != _HWMOD_STATE_REGISTERED)
 		return 0;
 
+	if (of_have_populated_dt())
+		np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
+
 	if (oh->class->sysc)
-		_init_mpu_rt_base(oh, NULL);
+		_init_mpu_rt_base(oh, NULL, np);
 
 	r = _init_clocks(oh, NULL);
 	if (r < 0) {
@@ -2433,6 +2435,13 @@ static int __init _init(struct omap_hwmod *oh, void *data)
 		return -EINVAL;
 	}
 
+	if (np) {
+		if (of_find_property(np, "ti,no-reset-on-init", NULL))
+			oh->flags |= HWMOD_INIT_NO_RESET;
+		if (of_find_property(np, "ti,no-idle-on-init", NULL))
+			oh->flags |= HWMOD_INIT_NO_IDLE;
+	}
+
 	oh->_state = _HWMOD_STATE_INITIALIZED;
 
 	return 0;
-- 
1.7.9.5


WARNING: multiple messages have this Message-ID (diff)
From: rnayak@ti.com (Rajendra Nayak)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/5] ARM: OMAP2+: hwmod: Extract no-idle and no-reset info from DT
Date: Wed, 9 Oct 2013 15:41:59 +0530	[thread overview]
Message-ID: <1381313521-10422-4-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1381313521-10422-1-git-send-email-rnayak@ti.com>

Now that we have DT bindings to specify which devices should not
be reset and idled during init, make hwmod extract the information
(and store them in internal flags) from Device tree.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index d9ee0ff..b55923a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2363,11 +2363,11 @@ static struct device_node *of_dev_hwmod_lookup(struct device_node *np,
  * are part of the device's address space can be ioremapped properly.
  * No return value.
  */
-static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
+static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
+				     struct device_node *np)
 {
 	struct omap_hwmod_addr_space *mem;
 	void __iomem *va_start = NULL;
-	struct device_node *np;
 
 	if (!oh)
 		return;
@@ -2383,12 +2383,10 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
 			 oh->name);
 
 		/* Extract the IO space from device tree blob */
-		if (!of_have_populated_dt())
+		if (!np)
 			return;
 
-		np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
-		if (np)
-			va_start = of_iomap(np, oh->mpu_rt_idx);
+		va_start = of_iomap(np, oh->mpu_rt_idx);
 	} else {
 		va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
 	}
@@ -2420,12 +2418,16 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
 static int __init _init(struct omap_hwmod *oh, void *data)
 {
 	int r;
+	struct device_node *np = NULL;
 
 	if (oh->_state != _HWMOD_STATE_REGISTERED)
 		return 0;
 
+	if (of_have_populated_dt())
+		np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
+
 	if (oh->class->sysc)
-		_init_mpu_rt_base(oh, NULL);
+		_init_mpu_rt_base(oh, NULL, np);
 
 	r = _init_clocks(oh, NULL);
 	if (r < 0) {
@@ -2433,6 +2435,13 @@ static int __init _init(struct omap_hwmod *oh, void *data)
 		return -EINVAL;
 	}
 
+	if (np) {
+		if (of_find_property(np, "ti,no-reset-on-init", NULL))
+			oh->flags |= HWMOD_INIT_NO_RESET;
+		if (of_find_property(np, "ti,no-idle-on-init", NULL))
+			oh->flags |= HWMOD_INIT_NO_IDLE;
+	}
+
 	oh->_state = _HWMOD_STATE_INITIALIZED;
 
 	return 0;
-- 
1.7.9.5

  parent reply	other threads:[~2013-10-09 10:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 10:11 [PATCH v2 0/5] OMAP: Add DT bindings to specify when devices should not be idled or reset Rajendra Nayak
2013-10-09 10:11 ` Rajendra Nayak
2013-10-09 10:11 ` [PATCH v2 1/5] ARM: OMAP2+: hwmod: cleanup HWMOD_INIT_NO_RESET usage Rajendra Nayak
2013-10-09 10:11   ` Rajendra Nayak
2013-10-09 14:55   ` Paul Walmsley
2013-10-09 14:55     ` Paul Walmsley
2013-10-09 10:11 ` [PATCH v2 2/5] ARM: dts: omap: Add new bindings for OMAP Rajendra Nayak
2013-10-09 10:11   ` Rajendra Nayak
2013-10-09 15:13   ` Benoit Cousson
2013-10-09 15:13     ` Benoit Cousson
2013-10-09 16:41     ` Rajendra Nayak
2013-10-09 16:41       ` Rajendra Nayak
2013-10-09 16:45       ` Benoit Cousson
2013-10-09 16:45         ` Benoit Cousson
2013-10-15  7:27         ` Benoit Cousson
2013-10-15  7:27           ` Benoit Cousson
2013-10-15  8:23           ` Rajendra Nayak
2013-10-15  8:23             ` Rajendra Nayak
2013-10-09 10:11 ` Rajendra Nayak [this message]
2013-10-09 10:11   ` [PATCH v2 3/5] ARM: OMAP2+: hwmod: Extract no-idle and no-reset info from DT Rajendra Nayak
2013-10-09 14:55   ` Paul Walmsley
2013-10-09 14:55     ` Paul Walmsley
2013-10-09 10:12 ` [PATCH v2 4/5] ARM: OMAP2+: hwmod: Cleanup usage of HWMOD_INIT_NO_RESET and HWMOD_INIT_NO_IDLE Rajendra Nayak
2013-10-09 10:12   ` Rajendra Nayak
2013-10-09 10:12 ` [PATCH v2 5/5] ARM: dts: AM335x-evmsk: Do not reset gpio0 Rajendra Nayak
2013-10-09 10:12   ` Rajendra Nayak
2013-10-10 16:44 ` [PATCH] ARM: dts: omap4-panda-es: Do not reset gpio1 Nishanth Menon
2013-10-10 16:44   ` Nishanth Menon
2013-10-10 16:44   ` Nishanth Menon
2013-10-10 16:47   ` Tony Lindgren
2013-10-10 16:47     ` Tony Lindgren
2013-10-10 19:01     ` Nishanth Menon
2013-10-10 19:01       ` Nishanth Menon
2013-10-10 19:01       ` Nishanth Menon
2013-10-15  7:28   ` Benoit Cousson
2013-10-15  7:28     ` Benoit Cousson

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=1381313521-10422-4-git-send-email-rnayak@ti.com \
    --to=rnayak@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --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.