All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Paul Walmsley <paul@pwsan.com>, Tony Lindgren <tony@atomide.com>,
	bhelgaas@google.com, richardcochran@gmail.com, s-anna@ti.com
Cc: Russell King <linux@arm.linux.org.uk>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, bcousson@baylibre.com,
	kishon@ti.com, nsekhar@ti.com
Subject: [PATCH 3/3] ARM: OMAP2+: hwmod: Add default reset handling
Date: Mon, 8 Feb 2016 16:42:21 +0530	[thread overview]
Message-ID: <1454929941-23949-4-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1454929941-23949-1-git-send-email-kishon@ti.com>

From: Paul Walmsley <paul@pwsan.com>

Certain devices (like PCIe in DRA7xx) require default reset
handling where the reset line should be asserted and then
de-asserted. Other devices require special reset handling
and is indicated using HWMOD_CUSTOM_HARDRESET.
Add default reset handling here where the reset line is
asserted in _reset and deasserted in _enable.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e9f65fe..ab66dd9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2077,7 +2077,7 @@ static int _enable_preprogram(struct omap_hwmod *oh)
  */
 static int _enable(struct omap_hwmod *oh)
 {
-	int r;
+	int r, i;
 	int hwsup = 0;
 
 	pr_debug("omap_hwmod: %s: enabling\n", oh->name);
@@ -2109,17 +2109,23 @@ static int _enable(struct omap_hwmod *oh)
 	}
 
 	/*
-	 * If an IP block contains HW reset lines and all of them are
-	 * asserted, we let integration code associated with that
-	 * block handle the enable.  We've received very little
+	 * If an IP block contains HW reset lines, all of them are
+	 * asserted, and the IP block is marked as requiring a custom
+	 * hardreset handler, we let integration code associated with
+	 * that block handle the enable.  We've received very little
 	 * information on what those driver authors need, and until
 	 * detailed information is provided and the driver code is
 	 * posted to the public lists, this is probably the best we
 	 * can do.
 	 */
-	if (_are_all_hardreset_lines_asserted(oh))
+	if ((oh->flags & HWMOD_CUSTOM_HARDRESET) &&
+	    _are_all_hardreset_lines_asserted(oh))
 		return 0;
 
+	/* If the IP block is an initiator, release it from hardreset */
+	for (i = 0; i < oh->rst_lines_cnt; i++)
+		_deassert_hardreset(oh, oh->rst_lines[i].name);
+
 	/* Mux pins for device runtime if populated */
 	if (oh->mux && (!oh->mux->enabled ||
 			((oh->_state == _HWMOD_STATE_IDLE) &&
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: kishon@ti.com (Kishon Vijay Abraham I)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: OMAP2+: hwmod: Add default reset handling
Date: Mon, 8 Feb 2016 16:42:21 +0530	[thread overview]
Message-ID: <1454929941-23949-4-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1454929941-23949-1-git-send-email-kishon@ti.com>

From: Paul Walmsley <paul@pwsan.com>

Certain devices (like PCIe in DRA7xx) require default reset
handling where the reset line should be asserted and then
de-asserted. Other devices require special reset handling
and is indicated using HWMOD_CUSTOM_HARDRESET.
Add default reset handling here where the reset line is
asserted in _reset and deasserted in _enable.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e9f65fe..ab66dd9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2077,7 +2077,7 @@ static int _enable_preprogram(struct omap_hwmod *oh)
  */
 static int _enable(struct omap_hwmod *oh)
 {
-	int r;
+	int r, i;
 	int hwsup = 0;
 
 	pr_debug("omap_hwmod: %s: enabling\n", oh->name);
@@ -2109,17 +2109,23 @@ static int _enable(struct omap_hwmod *oh)
 	}
 
 	/*
-	 * If an IP block contains HW reset lines and all of them are
-	 * asserted, we let integration code associated with that
-	 * block handle the enable.  We've received very little
+	 * If an IP block contains HW reset lines, all of them are
+	 * asserted, and the IP block is marked as requiring a custom
+	 * hardreset handler, we let integration code associated with
+	 * that block handle the enable.  We've received very little
 	 * information on what those driver authors need, and until
 	 * detailed information is provided and the driver code is
 	 * posted to the public lists, this is probably the best we
 	 * can do.
 	 */
-	if (_are_all_hardreset_lines_asserted(oh))
+	if ((oh->flags & HWMOD_CUSTOM_HARDRESET) &&
+	    _are_all_hardreset_lines_asserted(oh))
 		return 0;
 
+	/* If the IP block is an initiator, release it from hardreset */
+	for (i = 0; i < oh->rst_lines_cnt; i++)
+		_deassert_hardreset(oh, oh->rst_lines[i].name);
+
 	/* Mux pins for device runtime if populated */
 	if (oh->mux && (!oh->mux->enabled ||
 			((oh->_state == _HWMOD_STATE_IDLE) &&
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Paul Walmsley <paul@pwsan.com>, Tony Lindgren <tony@atomide.com>,
	<bhelgaas@google.com>, <richardcochran@gmail.com>,
	<s-anna@ti.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <bcousson@baylibre.com>,
	<kishon@ti.com>, <nsekhar@ti.com>
Subject: [PATCH 3/3] ARM: OMAP2+: hwmod: Add default reset handling
Date: Mon, 8 Feb 2016 16:42:21 +0530	[thread overview]
Message-ID: <1454929941-23949-4-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1454929941-23949-1-git-send-email-kishon@ti.com>

From: Paul Walmsley <paul@pwsan.com>

Certain devices (like PCIe in DRA7xx) require default reset
handling where the reset line should be asserted and then
de-asserted. Other devices require special reset handling
and is indicated using HWMOD_CUSTOM_HARDRESET.
Add default reset handling here where the reset line is
asserted in _reset and deasserted in _enable.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e9f65fe..ab66dd9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2077,7 +2077,7 @@ static int _enable_preprogram(struct omap_hwmod *oh)
  */
 static int _enable(struct omap_hwmod *oh)
 {
-	int r;
+	int r, i;
 	int hwsup = 0;
 
 	pr_debug("omap_hwmod: %s: enabling\n", oh->name);
@@ -2109,17 +2109,23 @@ static int _enable(struct omap_hwmod *oh)
 	}
 
 	/*
-	 * If an IP block contains HW reset lines and all of them are
-	 * asserted, we let integration code associated with that
-	 * block handle the enable.  We've received very little
+	 * If an IP block contains HW reset lines, all of them are
+	 * asserted, and the IP block is marked as requiring a custom
+	 * hardreset handler, we let integration code associated with
+	 * that block handle the enable.  We've received very little
 	 * information on what those driver authors need, and until
 	 * detailed information is provided and the driver code is
 	 * posted to the public lists, this is probably the best we
 	 * can do.
 	 */
-	if (_are_all_hardreset_lines_asserted(oh))
+	if ((oh->flags & HWMOD_CUSTOM_HARDRESET) &&
+	    _are_all_hardreset_lines_asserted(oh))
 		return 0;
 
+	/* If the IP block is an initiator, release it from hardreset */
+	for (i = 0; i < oh->rst_lines_cnt; i++)
+		_deassert_hardreset(oh, oh->rst_lines[i].name);
+
 	/* Mux pins for device runtime if populated */
 	if (oh->mux && (!oh->mux->enabled ||
 			((oh->_state == _HWMOD_STATE_IDLE) &&
-- 
1.7.9.5

  parent reply	other threads:[~2016-02-08 11:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 11:12 [PATCH 0/3] omap: hwmod: add default reset handling support Kishon Vijay Abraham I
2016-02-08 11:12 ` Kishon Vijay Abraham I
2016-02-08 11:12 ` Kishon Vijay Abraham I
2016-02-08 11:12 ` [PATCH 1/3] ARM: omap2+: omap_hwmod: introduce hwmod flag for custom reset handling Kishon Vijay Abraham I
2016-02-08 11:12   ` Kishon Vijay Abraham I
2016-02-08 11:12   ` Kishon Vijay Abraham I
2016-02-08 11:12 ` [RFT PATCH 2/3] ARM: OMAP2+: hwmod: use HWMOD_CUSTOM_HARDRESET " Kishon Vijay Abraham I
2016-02-08 11:12   ` Kishon Vijay Abraham I
2016-02-08 11:12   ` Kishon Vijay Abraham I
2016-02-08 11:12 ` Kishon Vijay Abraham I [this message]
2016-02-08 11:12   ` [PATCH 3/3] ARM: OMAP2+: hwmod: Add default " Kishon Vijay Abraham I
2016-02-08 11:12   ` Kishon Vijay Abraham I
2016-02-08 20:44 ` [PATCH 0/3] omap: hwmod: add default reset handling support Tony Lindgren
2016-02-08 20:44   ` Tony Lindgren
2016-02-09  5:13   ` Kishon Vijay Abraham I
2016-02-09  5:13     ` Kishon Vijay Abraham I
2016-02-09  5:13     ` Kishon Vijay Abraham I
2016-02-09 15:58     ` Tony Lindgren
2016-02-09 15:58       ` Tony Lindgren
2016-02-08 21:07 ` Suman Anna
2016-02-08 21:07   ` Suman Anna
2016-02-08 21:07   ` Suman Anna
2016-02-09  5:17   ` Kishon Vijay Abraham I
2016-02-09  5:17     ` Kishon Vijay Abraham I
2016-02-09  5:17     ` Kishon Vijay Abraham I
2016-02-09 17:44     ` Suman Anna
2016-02-09 17:44       ` Suman Anna
2016-02-09 17:44       ` Suman Anna
2016-02-09 20:19       ` Dave Gerlach
2016-02-09 20:19         ` Dave Gerlach
2016-02-09 20:19         ` Dave Gerlach
2016-02-09 21:34         ` Paul Walmsley
2016-02-09 21:34           ` Paul Walmsley

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=1454929941-23949-4-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=bhelgaas@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nsekhar@ti.com \
    --cc=paul@pwsan.com \
    --cc=richardcochran@gmail.com \
    --cc=s-anna@ti.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.