[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1454929941-23949-4-git-send-email-kishon@ti.com>
Date: Mon, 8 Feb 2016 16:42:21 +0530
From: Kishon Vijay Abraham I <kishon@...com>
To: Paul Walmsley <paul@...an.com>, Tony Lindgren <tony@...mide.com>,
<bhelgaas@...gle.com>, <richardcochran@...il.com>, <s-anna@...com>
CC: Russell King <linux@....linux.org.uk>,
<linux-omap@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <bcousson@...libre.com>,
<kishon@...com>, <nsekhar@...com>
Subject: [PATCH 3/3] ARM: OMAP2+: hwmod: Add default reset handling
From: Paul Walmsley <paul@...an.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@...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
Powered by blists - more mailing lists